Don't signal when I-search occurs within a kbd macro

* lisp/isearch.el (isearch-mode): Check last-event-frame is not
`macro' before providing it to `device-class'.  (bug#65175)
This commit is contained in:
Po Lu 2023-08-09 20:42:44 +08:00
parent 18a84922c5
commit caa3bc8aa8

View file

@ -1342,10 +1342,14 @@ used to set the value of `isearch-regexp-function'."
;; If the keyboard is not up and the last event did not come from
;; a keyboard, bring it up so that the user can type.
(when (or (not last-event-frame)
(not (eq (device-class last-event-frame
last-event-device)
'keyboard)))
;;
;; last-event-frame may be `macro', since people apparently make use
;; of I-search in keyboard macros. (bug#65175)
(when (and (not (eq last-event-frame 'macro))
(or (not last-event-frame)
(not (eq (device-class last-event-frame
last-event-device)
'keyboard))))
(frame-toggle-on-screen-keyboard (selected-frame) nil))
;; Disable text conversion so that isearch can behave correctly.