;; 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.
(setq overriding-terminal-local-map isearch-mode-map)
(run-hooks 'isearch-mode-hook)
+ ;; Remember the initial map possibly modified
+ ;; by external packages in isearch-mode-hook. (Bug#16035)
+ (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
(isearch-update)
- (add-hook 'pre-command-hook 'isearch-pre-command-hook nil t)
- (add-hook 'post-command-hook 'isearch-post-command-hook nil t)
+ (add-hook 'pre-command-hook 'isearch-pre-command-hook)
+ (add-hook 'post-command-hook 'isearch-post-command-hook)
(add-hook 'mouse-leave-buffer-hook 'isearch-done)
(add-hook 'kbd-macro-termination-hook 'isearch-done)
(unless (equal (car command-history) command)
(setq command-history (cons command command-history)))))
- (remove-hook 'pre-command-hook 'isearch-pre-command-hook t)
- (remove-hook 'post-command-hook 'isearch-post-command-hook t)
+ (remove-hook 'pre-command-hook 'isearch-pre-command-hook)
+ (remove-hook 'post-command-hook 'isearch-post-command-hook)
(remove-hook 'mouse-leave-buffer-hook 'isearch-done)
(remove-hook 'kbd-macro-termination-hook 'isearch-done)
(setq isearch-lazy-highlight-start nil)
(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.