From a1d30864191b70fb2dba49c9e2bf24f5a9bab704 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Thu, 16 Oct 2008 06:49:55 +0200 Subject: [PATCH] New option `org-log-state-notes-insert-after-drawers'. Default is nil. --- ORGWEBPAGE/Changes.org | 4 ++++ lisp/ChangeLog | 6 ++++++ lisp/org.el | 16 +++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org index 6d7543581..fc511f92a 100644 --- a/ORGWEBPAGE/Changes.org +++ b/ORGWEBPAGE/Changes.org @@ -18,6 +18,10 @@ ** Details +*** New option `org-log-state-notes-insert-after-drawers' + Set this to t if you want state change notes to be inserted + after any drawers. + *** New commands for export to PDF This is using LaTeX export, and then processes it to PDF using pdflatex. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 103a4b9fa..b2db9d792 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2008-10-16 Carsten Dominik + + * org.el (org-add-log-setup): Respect + `org-log-state-notes-insert-after-drawers'. + (org-log-state-notes-insert-after-drawers): New option. + 2008-10-15 Carsten Dominik * org-publish.el (org-publish-org-to): Handle case when diff --git a/lisp/org.el b/lisp/org.el index 9f22e1c21..ee6178d69 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1492,6 +1492,14 @@ empty string. (unless (assq 'note org-log-note-headings) (push '(note . "%t") org-log-note-headings)) +(defcustom org-log-state-notes-insert-after-drawers nil + "Non-nil means, insert state change notes after any drawers in entry. +When nil, insert them right after the heading and perhaps the line +with deadline/scheduling if present." + :group 'org-todo + :group 'org-progress + :type 'boolean) + (defcustom org-log-states-order-reversed t "Non-nil means, the latest state change note will be directly after heading. When nil, the notes will be orderer according to time." @@ -8347,9 +8355,11 @@ EXTRA is additional text that will be inserted into the notes buffer." (org-back-to-heading t) (narrow-to-region (point) (save-excursion (outline-next-heading) (point))) - (while (re-search-forward - (concat "\\(" org-drawer-regexp "\\|" org-property-end-re "\\)") - (point-max) t) (forward-line)) + (when org-log-state-notes-insert-after-drawers + (while (re-search-forward + (concat "\\(" org-drawer-regexp + "\\|" org-property-end-re "\\)") + (point-max) t) (forward-line))) (looking-at (concat outline-regexp "\\( *\\)[^\r\n]*" "\\(\n[^\r\n]*?" org-keyword-time-not-clock-regexp "[^\r\n]*\\)?"))