* emacs-lisp/cl-macs.el (cl-macrolet): Avoid excessive progn's.
This commit is contained in:
parent
1d7f01eeed
commit
14781f7f44
2 changed files with 13 additions and 7 deletions
|
@ -1,3 +1,7 @@
|
|||
2014-06-05 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* emacs-lisp/cl-macs.el (cl-macrolet): Avoid excessive progn's.
|
||||
|
||||
2014-06-05 Michal Nazarewicz <mina86@mina86.com>
|
||||
|
||||
* textmodes/tildify.el (tildify-foreach-region-outside-env): New
|
||||
|
|
|
@ -1886,13 +1886,15 @@ This is like `cl-flet', but for macros instead of functions.
|
|||
cl-declarations body)))
|
||||
(if (cdr bindings)
|
||||
`(cl-macrolet (,(car bindings)) (cl-macrolet ,(cdr bindings) ,@body))
|
||||
(if (null bindings) (cons 'progn body)
|
||||
(let* ((name (caar bindings))
|
||||
(res (cl--transform-lambda (cdar bindings) name)))
|
||||
(eval (car res))
|
||||
(macroexpand-all (cons 'progn body)
|
||||
(cons (cons name `(lambda ,@(cdr res)))
|
||||
macroexpand-all-environment))))))
|
||||
(let ((progn-maybe (lambda (body)
|
||||
(if (cdr body) (cons 'progn body) (car body)))))
|
||||
(if (null bindings) (funcall progn-maybe body)
|
||||
(let* ((name (caar bindings))
|
||||
(res (cl--transform-lambda (cdar bindings) name)))
|
||||
(eval (car res))
|
||||
(macroexpand-all (funcall progn-maybe body)
|
||||
(cons (cons name `(lambda ,@(cdr res)))
|
||||
macroexpand-all-environment)))))))
|
||||
|
||||
(defconst cl--old-macroexpand
|
||||
(if (and (boundp 'cl--old-macroexpand)
|
||||
|
|
Loading…
Add table
Reference in a new issue