Function: elisp-scope-define-macro-analyzer

elisp-scope-define-macro-analyzer is a macro defined in elisp-scope.el.gz.

Signature

(elisp-scope-define-macro-analyzer FSYM ARGS &rest BODY)

Documentation

Define an analyzer function for macro FSYM.

FSYM is a symbol, or a list of symbols that all share the same analyzer. The analyzer function analyzes occurrences of FSYM as a macro call, and it analyzes the arguments in calls to FSYM by executing BODY with ARGS bound to the analyzed arguments.

Probably introduced at or before Emacs version 32.1.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/elisp-scope.el.gz
(defmacro elisp-scope-define-macro-analyzer (fsym args &rest body)
  "Define an analyzer function for macro FSYM.
FSYM is a symbol, or a list of symbols that all share the same analyzer.
The analyzer function analyzes occurrences of FSYM as a macro call, and
it analyzes the arguments in calls to FSYM by executing BODY with ARGS
bound to the analyzed arguments."
  (declare (indent defun))
  (let ((helper (intern (concat "elisp-scope--analyze-"
                                (symbol-name (car (ensure-list fsym)))
                                "-1"))))
    `(progn
       (defun ,helper ,args ,@body)
       (elisp-scope-define-analyzer ,fsym (f &rest args)
         (elisp-scope-report-s f 'macro)
         (apply #',helper args)))))