Wait, Emacs 31 has added `crm-prompt' for CRM indication: https://yhetil.org/emacs/874j16hriz....@daniel-mendler.de/T/#m2b8290e24cd133171e143f93720384dab7b112ee https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a8a4c3a091bc6ebab40db3b33f4d15bb1040dbcb Since having both only leads to unessential verbosity, should we guard this prompt for Emacs <= 30 only and make it as close to 31's default as possible?
Daanturo On Mar 28 2025, at 12:41 am, Ihor Radchenko <yanta...@posteo.net> wrote: > Daan Ro <daant...@gmail.com> writes: > > >> (completing-read > >> (concat > >> (if negate "Negative filter" "Filter") > >> " [+cat-tag<0:10-/regexp/]: ") > >> #'org-agenda-filter-completion-function > >> nil nil ff) > >> > > > > Right. Is 'Keys [citation1 ;; citation2 ;; ...]: ' fine? Or an > > Yup. > > + (`dynamic > > + (let > > + ((repeated-sep > > + (org-cite-basic--complete-key-dynamic-crm-separator > > + (hash-table-keys table) ";"))) > > + (setq prompt > > + (format > > + "Keys [citation1 %s citation2 %s ...]: " > > + repeated-sep repeated-sep)) > > + (format "[ \t]*%s[ \t]*" > > + (regexp-quote repeated-sep))))))) > > What about other allowed values of > `org-cite-basic-complete-key-crm-separator'? > What if the user customizes it to, say [ ]*;;[ ]*? We should probably > display it somehow. > > We can reuse the following from mct.el package: > (defun mct--regex-to-separator (regex) > "Parse REGEX of `crm-separator' in `mct-choose-completion-dwim'." > (save-match-data > (cond > ;; whitespace-delimited, like default & org-set-tag-command > ((string-match (rx > bos "[" (1+ blank) "]*" > (group (1+ any)) > "[" (1+ blank) "]*" eos) > regex) > (match-string 1 regex)) > ;; literal character > ((string= regex (regexp-quote regex)) > regex)))) > > -- > Ihor Radchenko // yantar92, > Org mode maintainer, > Learn more about Org mode at <https://orgmode.org/>. > Support Org development at <https://liberapay.com/org-mode>, > or support my work at <https://liberapay.com/yantar92> >