From: Mattias EngdegÄrd Date: Mon, 19 Dec 2022 16:42:33 +0000 (+0100) Subject: called-interactively-p: cut broken comparison X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=03e75b0f5f279f166db895ba4245bda6fa2f1ffe;p=emacs.git 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. --- 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