[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Handling of [mouse-movement] and exiting isearch
From: |
Daniel Martín |
Subject: |
Handling of [mouse-movement] and exiting isearch |
Date: |
Mon, 09 Nov 2020 01:09:50 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin) |
I'd like commands bound to [mouse-movement] to not exit isearch, and I'm
confused by this code in isearch.el:
;; Pass frame events transparently so they won't exit the search.
;; In particular, if we have more than one display open, then a
;; switch-frame might be generated by someone typing at another keyboard.
(define-key map [switch-frame] nil)
(define-key map [delete-frame] nil)
(define-key map [iconify-frame] nil)
(define-key map [make-frame-visible] nil)
(define-key map [mouse-movement] nil)
(define-key map [language-change] nil)
The comment seems to imply that [mouse-movement], [language-change] and
some frame-related events won't exit isearch. However, the code is
calling define-key and passsing KEY as nil, which means that the events
will be undefined in isearch-mode-map, which by default means that they
_will_ exit isearch, right? I think the code that implements this logic
is in function isearch-pre-command-hook:
;; Don't exit Isearch for isearch key bindings.
((or (commandp (lookup-key isearch-mode-map key nil))
(commandp
(lookup-key
`(keymap (tool-bar menu-item nil ,isearch-tool-bar-map))
key))))
What am I missing? I'm not sure if making [mouse-movement] not exit
isearch worked in the past but has regressed in recent versions of
Emacs, or if I'm not understanding the logic correctly.
Thanks.
- Handling of [mouse-movement] and exiting isearch,
Daniel Martín <=