Org-mode mailing list
 help / color / mirror / Atom feed
* [PATCH] Allow multiple %(expression) instances in org-agenda-prefix-format
@ 2021-03-15  7:22 Ihor Radchenko
  2021-04-26  8:06 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Ihor Radchenko @ 2021-03-15  7:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-Allow-multiple-expression-instances-in-org-agenda-pr.patch --]
[-- Type: text/x-diff, Size: 1193 bytes --]

From ae1e4041f77d056649b8fa90d12e2cd1354b78f3 Mon Sep 17 00:00:00 2001
From: Ihor Radchenko <yantar92@gmail.com>
Date: Mon, 15 Mar 2021 15:18:20 +0800
Subject: [PATCH] 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.
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 50a9b3dbd..8bd328e6d 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6929,7 +6929,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)
-- 
2.26.2



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

end of thread, other threads:[~2021-04-29 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15  7:22 [PATCH] Allow multiple %(expression) instances in org-agenda-prefix-format Ihor Radchenko
2021-04-26  8:06 ` Bastien
2021-04-29 14:17   ` Ihor Radchenko

Org-mode mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://orgmode.org/list/0 list/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 list list/ https://orgmode.org/list \
		emacs-orgmode@gnu.org
	public-inbox-index list

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git