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

Recursive searches break the modeline #40

Open
wavexx opened this issue Apr 5, 2015 · 7 comments
Open

Recursive searches break the modeline #40

wavexx opened this issue Apr 5, 2015 · 7 comments
Labels

Comments

@wavexx
Copy link

wavexx commented Apr 5, 2015

Assuming C-s is bound to phi-search:

C-s ; start phi-search
C-x o ; switch away
C-s ; break the modeline

I noticed that I got the modeline stuck with phi-search, and today I finally was able to realize how I did it ;). Isearch has quite a complex logic to determine when aborting search since it supports recursive searches, but the most interesting seem:

(add-hook 'mouse-leave-buffer-hook 'isearch-done)
(add-hook 'kbd-macro-termination-hook 'isearch-done)

I'm not sure if 'mouse-leave-buffer-hook is also run for C-x o?

@wavexx
Copy link
Author

wavexx commented Apr 5, 2015

After looking at this a bit, I've found that isearch handles this in the 'pre-command-hook.

@zk-phi
Copy link
Owner

zk-phi commented Apr 8, 2015

Thanks for reporting!

@zk-phi zk-phi closed this as completed in 55308aa Apr 8, 2015
@wavexx
Copy link
Author

wavexx commented Apr 8, 2015

If phi-seach is active, instead of erroring, what about just switching to the minibuffer?
This allows to continue the previous search.

@wavexx
Copy link
Author

wavexx commented Apr 8, 2015

On 04/08/2015 02:23 PM, zk-phi wrote:

we probably need to abort recursive edit instead of switching to the
minibuffer recursively, but I wonder if just calling
(abort-recursive-edit) is fine.

I was thinking more of:

(when phi-search--active
(select-window (active-minibuffer-window))
(return-from ...)

so that it just switches to the minibuffer and the old search continues.

@zk-phi
Copy link
Owner

zk-phi commented Apr 8, 2015

yes, I've just committed so please update phi-search.

@wavexx
Copy link
Author

wavexx commented Apr 8, 2015

On 04/08/2015 02:45 PM, zk-phi wrote:

yes, I've just committed so please update phi-search.

Sorry I replied by mail and didn't see it.

@wavexx
Copy link
Author

wavexx commented Apr 8, 2015

Another way to break the modeline is to execute another read-from-minibuffer call :/
C-s, C-x o, M-x (for example).

I think read-from-minibuffer does a non-local exit in this case, which should be trapped with unwind-protect or condition-case.

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

No branches or pull requests

2 participants