From caa3bc8aa8fd4c46268fef135936d2f1901888fc Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 9 Aug 2023 20:42:44 +0800 Subject: [PATCH] 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) --- lisp/isearch.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index daf884d3d53..a3c32e06004 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -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. -- 2.39.2