diff --git a/lisp/emacs-lisp/elisp-scope.el b/lisp/emacs-lisp/elisp-scope.el index 098bc231994..10c223b3a5e 100644 --- a/lisp/emacs-lisp/elisp-scope.el +++ b/lisp/emacs-lisp/elisp-scope.el @@ -733,6 +733,7 @@ Optional argument LOCAL is a local context to extend." (bare (bare-symbol func)) (len (length (symbol-name bare)))) (when beg + ;; TODO: Use a bespoke 'local-function-definition' role. (elisp-scope-report 'function beg len beg)) (if (cdr exps) ;; def is (FUNC ARGLIST BODY...) @@ -1540,6 +1541,7 @@ Optional argument LOCAL is a local context to extend." (when-let* ((bare (elisp-scope-sym-bare name)) (len (length (symbol-name bare)))) (let ((beg (elisp-scope-sym-pos name))) + ;; TODO: Use a bespoke 'local-macro-definition' role. (when beg (elisp-scope-report 'macro beg len beg)) (let ((pos (or beg (cons 'gen (incf elisp-scope-counter))))) (elisp-scope-with-local-definition bare diff --git a/test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el b/test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el index 359a1f52c8a..d72e8d49fb4 100644 --- a/test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el +++ b/test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el @@ -97,3 +97,17 @@ (length long)))))) ;; ^ elisp-function-reference ;; ^ elisp-bound-variable + +(let ((foo 'bar)) +;; ^ (elisp-special-form font-lock-keyword-face) +;; ^ elisp-binding-variable + (cl-flet ((foo () 'baz)) +;; ^ (elisp-macro-call font-lock-keyword-face) +;; ^ elisp-function-reference + (foo) +;; ^ elisp-function-reference + (cl-macrolet ((foo () 'foo)) +;; ^ (elisp-macro-call font-lock-keyword-face) +;; ^ elisp-macro-call + (foo)))) +;; ^ elisp-macro-call