emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Desktop saves isearch-mode


From: Juri Linkov
Subject: Re: Desktop saves isearch-mode
Date: Tue, 18 Oct 2005 11:07:19 +0300
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>     When isearch leaves the buffer in isearch mode (this can happen after
>     switching buffers during incremental search),
>
> I think that is the bug.  Isearch mode should not be left enabled.
>
> Can you debug that and fix it?

The simplest way to reproduce this is to evaluate:

(define-key isearch-mode-map "\M-m"
            (lambda () (interactive) (switch-to-buffer "*Messages*")))

and to type `C-s M-m a' in any buffer except the *Messages* buffer.

The first key activates search mode, the second key switches to the
*Messages* buffer, and the third key continues to search for `a' in
the *Messages* buffer with search mode still enabled.

After exiting the search in the *Messages* buffer and switching back
to the original buffer where the search was activated, the mode line
of the original buffer still displays the "Isearch" string and
isearch-mode is non-nil.

But perhaps this is just an improper key binding for isearch mode
and a valid way to duplicate a global keybinding in isearch mode is
to bind its key to `isearch-other-control-char':

;; existing global key binding:
(define-key global-map "\M-m"
            (lambda () (interactive) (switch-to-buffer "*Messages*")))

;; how to allow using the same key binding in isearch-mode:
(define-key isearch-mode-map "\M-m"
            'isearch-other-control-char)

This doesn't cause the reported problem.

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]