]> git.eshelyaron.com Git - emacs.git/commitdiff
(scope-1): Recognize hook names in a few more functions
authorEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 21:11:52 +0000 (22:11 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 21:12:15 +0000 (22:12 +0100)
lisp/emacs-lisp/scope.el

index 34a29a1b0f797d4d63a462214d7ff672b60772bd..206d3e7feee71ec62cfaf77dc3a903094f7254a8 100644 (file)
@@ -1097,13 +1097,21 @@ a (possibly empty) list of safe macros.")
                special-variable-p local-variable-p
                local-variable-if-set-p
                default-value set-default make-local-variable
-               buffer-local-value add-to-list add-hook)
+               buffer-local-value add-to-list
+               add-hook run-hook-with-args run-hook-wrapped)
              (when-let* ((var-form (car forms))
                          ((memq (scope-sym-bare (car-safe var-form)) '(quote \`)))
                          (var (cadr var-form))
                          (beg (scope-sym-pos var))
                          (bare (scope-sym-bare var)))
                (funcall scope-callback 'variable beg (length (symbol-name bare)) nil)))
+            ((run-hooks)
+             (dolist (var-form forms)
+               (when-let* (((memq (scope-sym-bare (car-safe var-form)) '(quote \`)))
+                           (var (cadr var-form))
+                           (beg (scope-sym-pos var))
+                           (bare (scope-sym-bare var)))
+                 (funcall scope-callback 'variable beg (length (symbol-name bare)) nil))))
             ((featurep provide require)
              (when-let* ((feat-form (car forms))
                          ((memq (scope-sym-bare (car-safe feat-form)) '(quote \`)))