[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG] [BUG] inconsistent behavior when reading multiple tags [9.4.6 (9.4
[BUG] [BUG] inconsistent behavior when reading multiple tags [9.4.6 (9.4.6-g366444 @ /home/n/.emacs.d/straight/build/org/)]
Thu, 26 Aug 2021 13:04:20 -0400
mu4e 1.6.4; emacs 28.0.50
Remember to cover the basics, that is, what you expected to happen
what in fact did happen. You don't know how to make a good
Your bug report will be posted to the Org mailing list.
622f9fa76c8ee0766b15945c013b0950d703b955 ("org: Use crm for
lexically binds crm-separator to ":" while prompting for multiple
org-set-tags-command and org-capture-fill-template.
org-set-tags-command correctly parses the tags when using a comma
crm-separator) to separate them, but completion is broken unless
":" is used as
org-capture-fill-template incorrectly parses this.
Reproducible from emacs -Q:
1. Insert a new Org entry in the a buffer
2. M-x org-set-tags-command
3. At the prompt enter "one,two,three"
4. Entry's tags are correctly set to :one:two:three:
1. evaluate (org-capture-fill-template "%^g")
2. At the prompt enter "one,two,three"
3. String returned is incorrect: ":one,two,three:"
I can think of a couple ways we could improve this and make the
We could introduce a defcustom which allows the user to choose
whether or not
Org will rebind crm-separator during commands/functions which
#+begin_src emacs-lisp :lexical t
(defcustom org-contextual-crm-separator t
"Use contextual binding of crm-separator during Org commands.
For example, when setting tags, \":\" is used as the separator.
If nil, `crm-separator' is used.")
Alternatively, we could change the lexical binding we're using
during these commands/functions.
Instead of binding the separator explicitly to "[ \t]*:[ \t]*", we
could instead use a regexp
which will match any character not described by org-tag-re. The
this is that completing-read-multiple completion will work for any
that doesn't match org-tag-re transparently and the results should
consistent between org-set-tags-command and
The attached patch implements that change, which seems to do the
from my testing. I can polish it, but I wanted to get opinions on
the solution first.
Note this does not change the case of org-todo-list, which binds
crm-separator to "|". I chose not to touch that because I'm not
of what the restrictions on characters for todo-keywords are, if
org-todo-list also does the right thing by mentioning the
separator in the prompt.
We could also combine the approaches:
- Introduce a defcustom that determines if we're going to
contextually rebind crm-separator
- Use a broader regexp when contextually binding crm-separator
- Mention the separator in the prompt when rebound
Emacs : GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+
Version 3.24.30, cairo version 1.17.4)
Package: Org mode version 9.4.6 (9.4.6-g366444 @
- [BUG] [BUG] inconsistent behavior when reading multiple tags [9.4.6 (9.4.6-g366444 @ /home/n/.emacs.d/straight/build/org/)],
No Wayman <=