minad / consult

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

IDEA: Start consult-flymake on the current error. #841

Closed jgarte closed 9 months ago

jgarte commented 9 months ago

Hi,

WDYT if consult-flymake would start on the current error instead of jumping to the top of the error list.

Could we add a defcustom to configure that?

More context:

It jumps up here:

image

Instead of here:

image

image

minad commented 9 months ago

To be brief, no, we cannot. Such requests have been made a few times for different commands, e.g., consult-outline.

The problem is that jumping to a specific candidate is not supported by the completion UIs through the completing-read API. The best we could do is to split the list and wrap it around as consult-line does, since otherwise preselecting the nearest candidate would be incompatible with completion filtering. See https://github.com/minad/consult/wiki#pre-select-nearest-heading-for-consult-org-heading-and-consult-outline-using-vertico as an example for the hacks needed to make this work and this will still be incompatible with filtering. After entering some input, you will end up at an unexpected location.

This has been discussed and a few times, also in the context of consult-line, where some users don't like the wrap around. For example we've investigated workarounds based on supporting a custom vertico-preselect function. You can search the issue tracker for these discussions.

jgarte commented 9 months ago

Thanks for the infos.

I'm just going to go with emacs-flymake-popon and accept when it vomits large posframes of white space chars sometimes unexpectedly...

I haven't seen it happen lately.