Hello,

There is a certain case when org-mode leaves trailing whitespace on
":LOGBOOK:" and ":END:" lines and this was bringing me a little
annoyance, as I like to keep my org files neat.  I finally tracked down
the source of the problem.

I use the following configuration to automatically create a logbook
drawer for each TODO:

    (setq org-treat-insert-todo-heading-as-state-change t
          org-log-into-drawer t
          org-todo-keywords '((sequence "TODO(t!)" "|" "DONE(d!)")))

Down at the end of `org-indent-line', a bit of code meant to clean up
the whitespace of properties inserts the trailing whitespace in the case
of the ":LOGBOOK:" and ":END:" lines.

    (if (looking-at org-property-re)
        (replace-match (concat (match-string 4)
                               (format org-property-format
                                       (match-string 1) (match-string 3)))
                       t t))

The ":LOGBOOK:" and ":END:" lines are matched by this block.  The
default value of org-property-format is "%-10s %s", so ":LOGBOOK:" and
":END:" are considered property keys and get padded out to 10
characters; then an additional space is added after that, followed by
nothing because `(match-string 3)' is nil.

I'm not sure of the best way to rewrite the above block to eliminate the
trailing whitespace, but I would really appreciate any help in getting
such a change applied.

Thank you,

John Foerch


Reply via email to