radian-software/ctrlf

ctrlf should not interfere with ido by default

4DA opened this issue · 5 comments

4DA commented

When ctrlf is enabled and ido is used, pressing ido's C-s or C-r triggers ctrlf.

Since ido is in base and used by lot of packages I think it would be great to disable ctrlf for ido by default. One extra argument that such interatction is anyway useless.

This hook works on my emacs (27.1), though I am not sure this is right way to do it:

(add-hook 'ido-minibuffer-setup-hook (lambda () (ctrlf-local-mode -1)))

Yes, that seems reasonable to me. Isearch does not run into the same problem, because its bindings are established in global-map (ew) which is then overridden by minor mode maps, whereas CTRLF activates its bindings in a proper (global) minor mode map.

I'm not sure what the most appropriate solution would be. One way might be to make the binding by ctrlf-mode be an extended menu item using the :filter property to inhibit the binding from taking effect when a certain predicate returns non-nil. In that predicate we could implement a denylist for major/minor modes, or simply hardcode it to disable for IDO.

Your solution also would work perfectly well, I think. Might be easier. I think I would be fine with either.

ctrlf-mode also breaks Swiper. Disabling ctrl-local-mode would solve this, but I don't know if Swiper provides a setup hook to replicate the above solution. In any case, adding a hook for every package that redefines C-s in the minibuffer doesn't scale well. The source of all these problems is a keymap precedence issue, as pointed out in #80.

I've come up with a more robust keymapping scheme. It's a bit of a hack but should address the conflicting needs of these various bug reports. My new solution should solve #51, #52, #67, and #80 simultaneously while also working with remap bindings. I have tested it a bit and it seems to work, but I don't actually use most of the modes that have been mentioned in these issue reports, so I could use some help to confirm if the bug is resolved for all of them.

This thread is being closed automatically by Tidier because it is labeled with "waiting on response" and has not seen any activity for 90 days. But don't worry—if you have any information that might advance the discussion, leave a comment and I will be happy to reopen the thread :)