minad / consult

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

Transform yanks before listing/previewing in consult-yank #1000

Closed haji-ali closed 1 month ago

haji-ali commented 1 month ago

I am using yank-transform-functions to transform text before it is yanked. I noticed that the listed yanks in consult as well as the previewed ones are not transformed.

Is this an oversight, or is there something that prevents consult from doing that. Happy to contribute a PR if it's there's interest to included it (I think a simple modificiation to consult--read-from-kill-ring to call the hook yank-transform-functions should do?).

minad commented 1 month ago

Is this an oversight, or is there something that prevents consult from doing that. Happy to contribute a PR if it's there's interest to included it (I think a simple modificiation to consult--read-from-kill-ring to call the hook yank-transform-functions should do?).

The yank transform fuctions are an Emacs 29 feature, so we don't have that here yet (Consult supports 27 and newer). But please create a PR which adds this in a backward compatible manner. See https://github.com/minad/consult?tab=readme-ov-file#contributions.