From mboxrd@z Thu Jan 1 00:00:00 1970 From: John J Foerch Subject: org-property-format, trailing whitespace Date: Sat, 18 Apr 2015 13:21:01 -0400 Message-ID: <87r3rhz72a.fsf@hecubus.retroj.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjWSj-0008CF-Gh for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 13:23:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjWSg-0004HS-Bk for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 13:23:25 -0400 Received: from plane.gmane.org ([80.91.229.3]:43482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjWSg-0004HK-4v for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 13:23:22 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YjWSd-0002Qr-Q5 for emacs-orgmode@gnu.org; Sat, 18 Apr 2015 19:23:19 +0200 Received: from 152.160.184.109 ([152.160.184.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Apr 2015 19:23:19 +0200 Received: from jjfoerch by 152.160.184.109 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Apr 2015 19:23:19 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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