Jelajahi Sumber

Allow multiple %(expression) instances in org-agenda-prefix-format

* lisp/org-agenda.el (org-compile-prefix-format): Use non-greedy match
for %(expression).

Previously, format like "%-12.12s%(expr1) %(expr2)" would not be
parsed correctly because of greedy "(.+)" regexp used to match the
expressions.
Ihor Radchenko 4 tahun lalu
induk
melakukan
0260d2fcf6
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      lisp/org-agenda.el

+ 1 - 1
lisp/org-agenda.el

@@ -6927,7 +6927,7 @@ and stored in the variable `org-prefix-format-compiled'."
 	    (t "  %-12:c%?-12t% s")))
 	(start 0)
 	varform vars var c f opt) ;; e
-    (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltseib]\\|(.+)\\)"
+    (while (string-match "%\\(\\?\\)?\\([-+]?[0-9.]*\\)\\([ .;,:!?=|/<>]?\\)\\([cltseib]\\|(.+?)\\)"
 			 s start)
       (setq var (or (cdr (assoc (match-string 4 s)
 				'(("c" . category) ("t" . time) ("l" . level) ("s" . extra)