Ihor Radchenko <[email protected]> writes:

> I am not sure if it is a good idea. What you are essentially doing is
> trying to provide some kind of fix working around the fact that
> `org-tags-completion-function' is called inappropriately by
> `org-make-tags-matcher'. But I do not think that doing it in
> `org-tags-completion-function' itself is the right approach:

If all we are doing is giving the user the option to select a tag then we can
simply compute all the tags and pass that list straight to completing-read
without a custom completion function.

We already use this solution in `org-agenda-filter-by-tag',
`org-agenda-bulk-action', `org-capture-fill-template', and probably more.

The completion function in question allows the user to build up a match
expression of tags separated by our matching characters "[-+:&,|]".  Unless I'm
missing something, I think the function is being used exactly as intended.

I'm about to head to bed so I'm not going to dig any deeper then that but
reading the commit message from 622f9fa76c8ee0766b15945c013b0950d703b955 it
says:

>> Note that there is still one use for `org-tags-completion-function',
>> which is for completing tag matches.  Completing tag matches is
>> different from completing lists of tags since the separators (+, -,
>> etc) have semantic meaning.  This commit does not address that use
>> case.

Oh and if your objection is about how clunky a job a did with the quote
counting code (which is a fair criticism), you could check if emacs 28
has seq-count so we could just do:

(seq-count (lambda (char) (eq char ?\")) string)


Goodnight,

Morgan

Reply via email to