]> git.eshelyaron.com Git - emacs.git/commitdiff
scope.el: 'nnoo-define-basics' is unsafe.
authorEshel Yaron <me@eshelyaron.com>
Sun, 30 Mar 2025 15:17:18 +0000 (17:17 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 30 Mar 2025 15:17:18 +0000 (17:17 +0200)
lisp/emacs-lisp/scope.el
lisp/progmodes/elisp-mode.el

index 88cf178ff521fdc0f6f53e230188b5d3f06924ff..6a0a115a8b2a96c72f574e3cf4416b492ec04f7a 100644 (file)
@@ -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))
 
index 8a99d58781d6e53e5b459de270be1e3839455168..1b1eec72e06691fe2b38a479789e409b6b5036f1 100644 (file)
@@ -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)