Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctrlf-mode breaks search in find-file and switch-buffer #41

Closed
gcv opened this issue Apr 13, 2020 · 6 comments
Closed

ctrlf-mode breaks search in find-file and switch-buffer #41

gcv opened this issue Apr 13, 2020 · 6 comments

Comments

@gcv
Copy link

gcv commented Apr 13, 2020

I frequently use find-file history search (C-x C-f followed by C-r). That errors out with ctrlf-mode enabled. I'm not sure if there's a recursive minibuffer in play when isearch is used from find-file or switch-buffer, but maybe you could detect this situation and fall back to vanilla isearch.

@gcv gcv changed the title ctrlf-mode breaks search in find-file ctrlf-mode breaks search in find-file and switch-buffer Apr 13, 2020
@raxod502
Copy link
Member

I think you mean C-x C-f followed by M-r, because in vanilla Emacs C-x C-f followed by C-r just does an Isearch on the current contents of the minibuffer, without any interaction with history. Let me know if I guessed wrong here.

Anyway, I pushed a commit that should fix all the compatibility issues. Let me know if it works for you.

@raxod502
Copy link
Member

(I'm assuming you are using Selectrum, because otherwise I can't think of any reason M-r would not work. See radian-software/selectrum@551b119.)

@gcv
Copy link
Author

gcv commented Apr 14, 2020

Multiple separate but related problems here with both ctrlf and selectrum, I'm not exactly sure how to keep the conversation organized between this and radian-software/selectrum#4, but I'll try. :)

in vanilla Emacs C-x C-f followed by C-r just does an Isearch on the current contents of the minibuffer, without any interaction with history.

No, it definitely interacts with history! When used in find-file, C-r does a search through file-name-history, not the default minibuffer-history. I'll comment on that further in the other ticket.

The breakage I'm referring to here occurs when ctrlf is the only package installed in an Emacs sandbox (no configuration, naturally). Steps to reproduce:

  1. enable ctrlf-mode
  2. C-x C-f
  3. C-r errors out: ctrlf--start: Command attempted to use minibuffer while in minibuffer

The expected result is incremental search through file-name-history. It's okay to fall back on isearch-backward here rather than ctrlf-backward-*.

@raxod502
Copy link
Member

Okay. Thanks for the explanation. This is bizarre to me because I cannot find the code that implements this behavior anywhere in Isearch. It would be helpful if someone could point to the implementation. That would help to determine why using Isearch within Selectrum breaks ("text is read-only" error).

@raxod502
Copy link
Member

I guess that's a separate issue, though, from CTRLF overriding the bindings which also breaks usage without Selectrum. Open a new issue against Selectrum if it bothers you; the bug you reported here should be fixed.

@raxod502
Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants