emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-agenda: fix regexp in progress for state logging
@ 2011-01-26 15:52 Julien Danjou
  2011-01-26 16:15 ` Giovanni Ridolfi
  2011-01-26 17:25 ` [Accepted] " Bastien Guerry
  0 siblings, 2 replies; 4+ messages in thread
From: Julien Danjou @ 2011-01-26 15:52 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Julien Danjou

* org-agenda.el (org-agenda-get-progress): Fix regexp for statep: it
must has \\ at the end of the line. This avoid matching the following
heading when there's no newline between the logged state and the next
heading.

Signed-off-by: Julien Danjou <julien@danjou.info>
---
 lisp/org-agenda.el |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 3c1104e..6e8d07a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4814,15 +4814,15 @@ be skipped."
 		     (setq clocked (match-string 2 rest)))
 	    (setq clocked "-")))
 	(save-excursion
-	  (setq extra nil)
-	  (cond
-	   ((not org-agenda-log-mode-add-notes))
-	   (statep
-	    (and (looking-at ".*\n[ \t]*\\([^-\n \t].*?\\)[ \t]*$")
-		 (setq extra (match-string 1))))
-	   (clockp
-	    (and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
-		 (setq extra (match-string 1)))))
+	  (setq extra
+		(cond
+		 ((not org-agenda-log-mode-add-notes) nil)
+		 (statep
+		  (and (looking-at ".*\\\\\n[ \t]*\\([^-\n \t].*?\\)[ \t]*$")
+		       (match-string 1)))
+		 (clockp
+		  (and (looking-at ".*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$")
+		       (match-string 1)))))
 	  (if (not (re-search-backward "^\\*+ " nil t))
 	      (setq txt org-agenda-no-heading-message)
 	    (goto-char (match-beginning 0))
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-01-26 17:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-26 15:52 [PATCH] org-agenda: fix regexp in progress for state logging Julien Danjou
2011-01-26 16:15 ` Giovanni Ridolfi
2011-01-26 16:51   ` Julien Danjou
2011-01-26 17:25 ` [Accepted] " Bastien Guerry

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).