bufferlo icon indicating copy to clipboard operation
bufferlo copied to clipboard

Consider custom completing-read-multiple function

Open shipmints opened this issue 4 months ago • 4 comments

I'd resurrect the code I once put in that allowed vertico/orderless users to leverage regexp CRM completions. I took it out because it was incompatible with other completion frameworks. It could be abstracted to a default function which does what it does now, and be customized via a function and which we'd document under configuration with a function that works for vertico.

Via this discussion with a bufferlo user https://www.reddit.com/r/emacs/comments/1meuel2/help_using_bufferlosets_in_bufferlo/

shipmints avatar Aug 01 '25 14:08 shipmints

Yes, of course, sounds like a good idea. I am currently happy with the comma-selection, but I agree, the possibility to use regexes is very useful, especially for larger selections.

So this would be a configurable function that is called in bufferlo--bookmark-completing-read-multiple?

florommel avatar Aug 03 '25 21:08 florommel

I don't yet know the best way to handle this. And I need to make it work well first outside bufferlo. Currently, if I have partial-completion in completion-styles doing what I'm doing, it signals an error and looks like a bug in partial-completion which I'll report. The workaround is easy: override the completion style for bookmarks to exclude partial-completion but still.

Let's not count on this change for the 1.2 release.

shipmints avatar Aug 07 '25 20:08 shipmints

Still working on this. See https://github.com/oantolin/orderless/issues/191.

shipmints avatar Aug 17 '25 12:08 shipmints

Another reason to consider something "better" than completing-read-multiple is that any candidate that contains an embedded crm-separator is returned as multiple items, split at each crm-separator. That's horrible. I might report a bug and suggest that there be an option to inhibit this and return a matched candidate verbatim.

In the absence of a proper solution, perhaps we can, in advance of invoking completing-read-multiple, offer to replace the main selector character from crm-separator found in candidates with a special character, perhaps "~", and then undo that on the way out to force a match. This would have to be an option as some people might create a more complex crm-separator regexp with multiple selectors. I guess we could accept a list of selector/replacement pairs.

Or, we offer bufferlo-crm-separator and if nil, use crm-separator, otherwise it could default to a character unlikely to be in a bookmark name, perhaps "/", and just go simple.

crm is 25 years old and still anemic.

shipmints avatar Aug 24 '25 11:08 shipmints