diff options
Diffstat (limited to 'lisp/emacs-lisp/macroexp.el')
-rw-r--r-- | lisp/emacs-lisp/macroexp.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 797de9abb5b..b75c8cc50a7 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -297,6 +297,16 @@ definitions to shadow the loaded ones for use in file byte-compilation." ;;; Handy functions to use in macros. +(defun macroexp-parse-body (exps) + "Parse EXPS into ((DOC DECLARE-FORM INTERACTIVE-FORM) . BODY)." + `((,(and (stringp (car exps)) + (pop exps)) + ,(and (eq (car-safe (car exps)) 'declare) + (pop exps)) + ,(and (eq (car-safe (car exps)) 'interactive) + (pop exps))) + ,@exps)) + (defun macroexp-progn (exps) "Return an expression equivalent to `(progn ,@EXPS)." (if (cdr exps) `(progn ,@exps) (car exps))) |