Daan Ro <[email protected]> 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>