emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] org-property-format, trailing whitespace


From: John J Foerch
Subject: [O] org-property-format, trailing whitespace
Date: Sat, 18 Apr 2015 13:21:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

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

[Prev in Thread] Current Thread [Next in Thread]