From mboxrd@z Thu Jan 1 00:00:00 1970 From: James TD Smith Subject: [PATCH 2/2] Make drawer skipping for note insertion more sensible. Date: Thu, 16 Oct 2008 15:51:19 +0100 Message-ID: <1224168679-56353-2-git-send-email-ahktenzero@mohorovi.cc> References: <1224168679-56353-1-git-send-email-ahktenzero@mohorovi.cc> Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KqUhm-00058C-MP for emacs-orgmode@gnu.org; Thu, 16 Oct 2008 11:24:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KqUhl-00057m-8I for emacs-orgmode@gnu.org; Thu, 16 Oct 2008 11:24:02 -0400 Received: from [199.232.76.173] (port=34070 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KqUhl-00057j-10 for emacs-orgmode@gnu.org; Thu, 16 Oct 2008 11:24:01 -0400 Received: from 81-86-40-42.dsl.pipex.com ([81.86.40.42]:54310 helo=masada.internal.mohorovi.cc) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KqUhk-00088Z-IX for emacs-orgmode@gnu.org; Thu, 16 Oct 2008 11:24:00 -0400 In-Reply-To: <1224168679-56353-1-git-send-email-ahktenzero@mohorovi.cc> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --- lisp/ChangeLog | 3 +++ lisp/org.el | 12 +++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 42622b0..33eca1a 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -8,6 +8,9 @@ (org-clock-in): Use org-indent-line-function to indent clock lines. (org-clock-find-position): Fix indentation of empty clock drawers. + * org.el (org-add-log-setup): Only skip drawers if the are + immediately after the scheduling keywords. + 2008-10-16 Carsten Dominik * org.el (org-add-log-setup): Respect diff --git a/lisp/org.el b/lisp/org.el index 2eb70dd..413ac6c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8392,15 +8392,17 @@ 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))) - (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]*\\)?")) (goto-char (match-end 0)) + (when (and org-log-state-notes-insert-after-drawers + (save-excursion (forward-line) (looking-at org-drawer-regexp))) + (progn (forward-line) + (while (looking-at org-drawer-regexp) + (goto-char (match-end 0)) + (re-search-forward org-property-end-re (point-max) t) + (forward-line)))) (unless org-log-states-order-reversed (and (= (char-after) ?\n) (forward-char 1)) (org-skip-over-state-notes) -- 1.6.0.2