bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#16035: 24.3.50; Custom isearch broken on trunk (e.g. change-log-mode


From: Anders Lindgren
Subject: bug#16035: 24.3.50; Custom isearch broken on trunk (e.g. change-log-mode)
Date: Thu, 5 Dec 2013 16:33:17 +0100

Juri,

Both problems seems to be fixed!

(I tested the latest isearch.el, add added your patch, on Emacs bzr version 115300 (newer versions don't run on OS X due to some font-related issue).)

Thanks a lot, both of you!

    -- Anders


On Thu, Dec 5, 2013 at 2:20 AM, Juri Linkov <juri@jurta.org> wrote:
>> I tried you solution and it works perfectly! Just make sure to save the
>> keymap after the call to "(run-hooks 'isearch-mode-hook)", as this is where
>> packages like "folding" installs its keymap.
>
> Great to hear.  Juri, can you do that for me?

I tested this patch, and it seems to fix the second case reported
by Anders.  If the patch is correct then I could install it.

>> While looking around the isearch code, I came up with a theory why
>> multi-buffer search in change-log-mode no longer works. isearch adds its
>> hook to the LOCAL pre-command-hook. As change-log-mode search change buffer
>> and the hook is not installed in the new buffer, the user can't exit
>> isearch.
>
> Sounds right, as well.  Juri, can you take care of that while you're at it?

I already installed the fix for this case a day ago in revno:115368
Anders, can you try this fix? Only the first case that you reported
has been fixed and installed, and the second case fixed by this patch
will be installed soon too.

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el     2013-12-04 00:12:02 +0000
+++ lisp/isearch.el     2013-12-05 01:18:56 +0000
@@ -637,6 +637,8 @@ (defvar isearch-input-method-function ni
 ;; isearch is invoked.
 (defvar isearch-input-method-local-p nil)

+(defvar isearch-saved-overriding-local-map nil)
+
 ;; Minor-mode-alist changes - kind of redundant with the
 ;; echo area, but if isearching in multiple windows, it can be useful.

@@ -904,6 +906,7 @@ (defun isearch-mode (forward &optional r

   (setq overriding-terminal-local-map isearch-mode-map)
   (run-hooks 'isearch-mode-hook)
+  (setq isearch-saved-overriding-local-map overriding-terminal-local-map)

   ;; Pushing the initial state used to be before running isearch-mode-hook,
   ;; but a hook might set `isearch-push-state-function' used in
@@ -2235,7 +2238,7 @@ (defun isearch-pre-command-hook ()
     (cond
      ;; Don't exit Isearch if we're in the middle of some
      ;; set-temporary-overlay-map thingy like universal-argument--mode.
-     ((not (eq overriding-terminal-local-map isearch-mode-map)))
+     ((not (eq overriding-terminal-local-map isearch-saved-overriding-local-map)))
      ;; Don't exit Isearch for isearch key bindings.
      ((commandp (lookup-key isearch-mode-map key nil)))
      ;; Optionally edit the search string instead of exiting.



reply via email to

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