From ceeeb390f01f0c2fe1e2502a8ad42fa2acdd8e9c Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Thu, 2 Oct 2025 15:22:51 +0200 Subject: [PATCH] ; (elisp-scope-1): Analyze macros with (debug t) as progn Take an Edebug spec of t as an indication that all of the macro's arguments are evaluated, and analyze them as such. Only do so as a fallback for macros that we cannot expand, because expanding can lead to more accurate analysis, e.g. with regards to the output type of the form. --- lisp/emacs-lisp/elisp-scope.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/elisp-scope.el b/lisp/emacs-lisp/elisp-scope.el index 3e49bad721f..00562c4a859 100644 --- a/lisp/emacs-lisp/elisp-scope.el +++ b/lisp/emacs-lisp/elisp-scope.el @@ -2736,7 +2736,6 @@ are analyzed." ((special-form-p bare) (elisp-scope-report-s f 'special-form) (elisp-scope-n forms)) ((macrop bare) (elisp-scope-report-s f 'macro) (cond - ;; ((eq (get bare 'edebug-form-spec) t) (elisp-scope-n forms)) ((elisp-scope-safe-macro-p bare) (let* ((warning-minimum-log-level :emergency) (macroexp-inhibit-compiler-macros t) @@ -2746,7 +2745,8 @@ are analyzed." (macroexpand-all-environment (append (mapcar #'list elisp-scope-unsafe-macros) macroexpand-all-environment)) (expanded (ignore-errors (macroexpand-1 form macroexpand-all-environment)))) - (elisp-scope-1 expanded outtype))))) + (elisp-scope-1 expanded outtype))) + ((eq (get bare 'edebug-form-spec) t) (elisp-scope-n forms)))) ((or (functionp bare) (memq bare elisp-scope-local-functions)) (elisp-scope-report-s f 'function) (elisp-scope-n forms)) (t