From 48ea01295f1cb8be09cc0b2c88006b97700eb5f2 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sun, 30 Mar 2025 17:17:18 +0200 Subject: [PATCH] scope.el: 'nnoo-define-basics' is unsafe. --- lisp/emacs-lisp/scope.el | 9 ++++++++- lisp/progmodes/elisp-mode.el | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/scope.el b/lisp/emacs-lisp/scope.el index 88cf178ff52..6a0a115a8b2 100644 --- a/lisp/emacs-lisp/scope.el +++ b/lisp/emacs-lisp/scope.el @@ -1112,7 +1112,7 @@ a (possibly empty) list of safe macros.") (defvar scope-unsafe-macros '( static-if cl-eval-when eval-when-compile eval-and-compile let-when-compile - rx cl-macrolet)) + rx cl-macrolet nnoo-define-basics)) (defun scope-safe-macro-p (macro) (and (not (memq macro scope-unsafe-macros)) @@ -1424,6 +1424,13 @@ a (possibly empty) list of safe macros.") ;; Unsafe macro! (scope-cl-macrolet l bindings body)) +(scope-define-macro-analyzer nnoo-define-basics (_l &optional backend) + ;; Unsafe macro! + (let* ((bare (bare-symbol backend)) + (len (length (symbol-name bare))) + (beg (scope-sym-pos backend))) + (when beg (scope-report 'nnoo-backend beg len)))) + (scope-define-macro-analyzer gv-define-expander (l name handler) (scope-gv-define-expander l name handler)) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 8a99d58781d..1b1eec72e06 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -476,6 +476,7 @@ happens in interactive invocations." (defun "Function definition") (defvar "Special variable definition") (defface "Face definition") + (nnoo-backend "`nnoo' backend") (major-mode (if-let ((sym (intern (buffer-substring-no-properties beg end)))) (lambda (&rest _) (if-let ((doc (documentation sym))) @@ -504,6 +505,7 @@ happens in interactive invocations." (widget-type 'font-lock-type-face) (type 'font-lock-type-face) (group 'font-lock-type-face) + (nnoo-backend 'font-lock-type-face) (condition 'elisp-condition) (ampersand 'font-lock-type-face) (constant 'font-lock-builtin-face) -- 2.39.5