diff options
author | Leo Liu <sdl.web@gmail.com> | 2015-02-09 10:05:44 +0800 |
---|---|---|
committer | Leo Liu <sdl.web@gmail.com> | 2015-02-09 10:05:44 +0800 |
commit | 751adc4b9631cedcf9bec475afe40da4db7d74a1 (patch) | |
tree | db7eaca97d1312b5b0592b67e6b134fda51502ea /lisp/emacs-lisp/macroexp.el | |
parent | fd6f7d1449c8496ab5c019d2aad7ca5e2980713a (diff) | |
download | emacs-751adc4b9631cedcf9bec475afe40da4db7d74a1.tar.gz emacs-751adc4b9631cedcf9bec475afe40da4db7d74a1.tar.bz2 emacs-751adc4b9631cedcf9bec475afe40da4db7d74a1.zip |
Add macro pcase-lambda
Fixes: debbugs:19814
* emacs-lisp/lisp-mode.el (el-kws-re): Include `pcase-lambda'.
* emacs-lisp/macroexp.el (macroexp-parse-body): New function.
* emacs-lisp/pcase.el (pcase-lambda): New Macro.
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))) |