summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2008-10-16 06:49:55 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2008-10-16 06:49:55 +0200
commita1d30864191b70fb2dba49c9e2bf24f5a9bab704 (patch)
treea742171c8bbd619551e10ebc8d6de8b67579ae0c
parent3e72fb8c35f20a18cacf8111daaedc87d0b64940 (diff)
downloadorg-mode-a1d30864191b70fb2dba49c9e2bf24f5a9bab704.tar.gz
New option `org-log-state-notes-insert-after-drawers'.
Default is nil.
-rw-r--r--ORGWEBPAGE/Changes.org4
-rwxr-xr-xlisp/ChangeLog6
-rw-r--r--lisp/org.el16
3 files changed, 23 insertions, 3 deletions
diff --git a/ORGWEBPAGE/Changes.org b/ORGWEBPAGE/Changes.org
index 6d75435..fc511f9 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 103a4b9..b2db9d7 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2008-10-16 Carsten Dominik <dominik@science.uva.nl>
+
+ * 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 <dominik@science.uva.nl>
* org-publish.el (org-publish-org-to): Handle case when
diff --git a/lisp/org.el b/lisp/org.el
index 9f22e1c..ee6178d 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]*\\)?"))