From 03e75b0f5f279f166db895ba4245bda6fa2f1ffe Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mattias=20Engdeg=C3=A5rd?= Date: Mon, 19 Dec 2022 17:42:33 +0100 Subject: [PATCH] called-interactively-p: cut broken comparison * lisp/subr.el (called-interactively-p): Remove attempt to detect `byte-code` frames; it wasn't done right but also does not seem to be necessary. Adjust comment that was out of date. --- lisp/subr.el | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index e142eaa8104..4fa63a1f3cd 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -6084,14 +6084,8 @@ command is called from a keyboard macro?" ;; Skip special forms (from non-compiled code). (and frame (null (car frame))) ;; Skip also `interactive-p' (because we don't want to know if - ;; interactive-p was called interactively but if it's caller was) - ;; and `byte-code' (idem; this appears in subexpressions of things - ;; like condition-case, which are wrapped in a separate bytecode - ;; chunk). - ;; FIXME: For lexical-binding code, this is much worse, - ;; because the frames look like "byte-code -> funcall -> #[...]", - ;; which is not a reliable signature. - (memq (nth 1 frame) '(interactive-p 'byte-code)) + ;; interactive-p was called interactively but if it's caller was). + (eq (nth 1 frame) 'interactive-p) ;; Skip package-specific stack-frames. (let ((skip (run-hook-with-args-until-success 'called-interactively-p-functions -- 2.39.2