minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.12k stars 98 forks source link

[request] allow `:lookup` in `consult--multi` sources #976

Closed 45mg closed 1 month ago

45mg commented 1 month ago

When defining a source, it might make sense to reuse existing state functions (eg. consult--file-state if the source is a list of file names). However, we might also want to display the candidates in a different form than what is passed to the state function (eg. abbreviate the file names). In consult--read, the :lookup property enables this; in consult--multi, we are forced to create new state functions that wrap the --preview and --action functions used in existing state functions, calling the function that would normally be passed through :lookup on each candidate before passing it to the wrapped functions.

Since this is rather inelegant, and difficult to get right, would it be possible to support :lookup in consult--multi?