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

No isearch-esque unprettifying while searching #128

Open
slotThe opened this issue Nov 20, 2022 · 2 comments
Open

No isearch-esque unprettifying while searching #128

slotThe opened this issue Nov 20, 2022 · 2 comments

Comments

@slotThe
Copy link

slotThe commented Nov 20, 2022

One feature (?) of the default isearch that's extremely convenient is unprettifying prettify-symbols-mode symbols while in search. It seems that ctrlf does not do this while searching, regardless of the setting of prettify-symbols-unprettify-at-point.

For example, with ctrlf-mode disabled:

  1. Enter e.g., emacs-lisp-mode (or any other mode for which prettify-symbols-mode has some default symbols)
  2. Set prettify-symbols-unprettify-at-point to some value that unprettifies things (e.g., 'right-edge)
  3. M-x prettify-symbols-mode RET
  4. Type (lambda ()). This should now show up as (λ ()).
  5. C-r l (that is, isearch-backward for "l") now takes you back to the "l" in "lambda", but also unprettifies "λ" to "lambda".

With ctrlf-mode enabled, point 5 above works differently; pressing C-r l also takes you back to the "l" in "lambda", but does not unprettify "λ". This is only done after pressing RET, ending the search.

Some example screenshots:

no search isearch ctrlf
2022-11-20-103331_128x57_scrot 2022-11-20-103106_154x68_scrot 2022-11-20-103119_218x61_scrot

I would take a stab at this myself, but I have absolutely now idea where to start; any tips?

@slotThe
Copy link
Author

slotThe commented Nov 20, 2022

Ah, I guess rubber-ducking really helps.

The problem, of course, is that ctrlf keeps the point in the minibuffer during those searches. prettify-symbols-mode quite sensibly only unprettifies the symbol at point, like we told it to. If I switch windows after searching with ctrlf, then everything unprettifies correctly (and stays that way when switching back to the minibuffer afterwards). I suppose having the point inside of the minibuffer during the search is one of the main design goals of ctrlf (and let's not switch windows after every keystroke :).

@raxod502
Copy link
Member

Mmm. It's possible that we could add some integration that would allow for hooks to be added to accomplish tasks like this. It's not ideal, because every package that depends on the location of point for updating search results like this would need to be added, but it might work well enough in practice.

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