Paul Bryan <[email protected]> writes:

> Morgan Smith <[email protected]> writes:
>
>> I'm sure Ihor wouldn't mind me taking over this review.
>>
>> Thank you very much for taking a look at this!  It looks good and is
>> almost ready.  I just have some very minor nits I thought I'd bring up.

While I'm at it, here's the updated patch but still keeping defconst. If defvar 
is better, I can change it though. See below.

>>>>>> Ihor Radchenko <[email protected]> writes:
>>>>>>>
>>>>>>> I think we can make separator a variable (not a custom option).
>>>>>>> This way, if someone absolutely wants to change it, they could.
>>
>>> +(defconst org-tag-crm-separator "[ \t]*[:,][ \t]*"
>>> +  "Regexp used to determine `crm-separator' when reading multiple tags.")
>>> +
>>
>> A modifiable variable would mean defvar, not defconst.
>>
>
> I went with defconst since the various existing org-tag regexes are of
> this form and most other defvars in org.el are not initialised. Seemed
> to be the convention to follow here. As I understand it, the idea is
> for users to modify it only if they really, really want to. Mostly it
> should be left as a constant. Happy to defer to others judgement on
> that though.
>

--
Paul
>From 20c02fffce0b555569844145820fb46f260ff306 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <[email protected]>
Date: Tue, 13 Oct 2026 21:50:45 +1100
Subject: [PATCH] org.el, org-capture.el: Introduce variable for completing
 read separator regex when reading tags.

* lisp/org.el (org-tag-crm-separator): Introduce variable for regex
determining completing read separator when reading tags.
(org-capture-fill-template): Use completing read separator variable
when reading tags.
* lisp/org-capture.el: (org-capture-fill): Use completing read
separator variable when reading tags.

Separator now includes commas "," in addition to colons ":".
---
 lisp/org-capture.el | 2 +-
 lisp/org.el         | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 7654f74f9..429db76c7 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1981,7 +1981,7 @@ buffers."
 			          (org-add-colon-after-tag-completion t)
 			          (ins (mapconcat
 				        #'identity
-				        (let ((crm-separator "[ \t]*:[ \t]*"))
+				        (let ((crm-separator org-tag-crm-separator))
                                           (completing-read-multiple
 				           (if prompt (concat prompt ": ") "Tags: ")
 				           org-last-tags-completion-table nil nil nil
diff --git a/lisp/org.el b/lisp/org.el
index 6f46078f1..e5ff913da 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -705,6 +705,9 @@ This is the base pattern for tag matching regex.")
 (defconst org-tag-re (format "[%s]+" org-tag--valid-char-set)
   "Regexp matching a single tag.")
 
+(defconst org-tag-crm-separator "[ \t]*[:,][ \t]*"
+  "Regexp used to determine `crm-separator' when reading multiple tags.")
+
 (defconst org-tag--group-enclosed-re
   (format "\\(:\\([%s:]+\\):\\)" org-tag--valid-char-set)
   "Regex pattern for a colon-enclosed group of tags.
@@ -12415,7 +12418,7 @@ in Lisp code use `org-set-tags' instead."
 		      table
 		      (and org-fast-tag-selection-include-todo org-todo-key-alist))
 		   (let ((org-add-colon-after-tag-completion (< 1 (length table)))
-                         (crm-separator "[ \t]*:[ \t]*"))
+                         (crm-separator org-tag-crm-separator))
 		     (mapconcat #'identity
                                 (completing-read-multiple
 			         "Tags: "
-- 
2.56.0

Reply via email to