Browse Source

org-agenda: fix regexp in progress for state logging

* 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>
Julien Danjou 14 năm trước cách đây
mục cha
commit
2d747caeab
1 tập tin đã thay đổi với 9 bổ sung9 xóa
  1. 9 9
      lisp/org-agenda.el

+ 9 - 9
lisp/org-agenda.el

@@ -4850,15 +4850,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))