From 751adc4b9631cedcf9bec475afe40da4db7d74a1 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Mon, 9 Feb 2015 10:05:44 +0800 Subject: 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. --- lisp/emacs-lisp/macroexp.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp/emacs-lisp/macroexp.el') 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))) -- cgit v1.2.3