* lisp/emacs-lisp/cl-macs.el (cl--sm-macroexpand): Handle lambda!

(cl--old-macroexpand): Remove.
(cl--sm-macroexpand): Change its calling convention, so it can use
advice-add.  Extend re-binding treatment of vars so it applies to all
var-introducing forms rather than only to 'let'.
(cl-symbol-macrolet): Use advice-add rather than fset.
This commit is contained in:
Stefan Monnier 2018-02-08 21:40:46 -05:00
parent d34dbc0b69
commit 6b183f85e0
2 changed files with 59 additions and 26 deletions

View file

@ -518,13 +518,14 @@
(ert-deftest cl-lib-symbol-macrolet-hide ()
;; bug#26325
;; bug#26325, bug#26073
(should (equal (let ((y 5))
(cl-symbol-macrolet ((x y))
(list x
(let ((x 6)) (list x y))
(cl-letf ((x 6)) (list x y)))))
'(5 (6 5) (6 6)))))
(cl-letf ((x 6)) (list x y))
(apply (lambda (x) (+ x 1)) (list 8)))))
'(5 (6 5) (6 6) 9))))
(defun cl-lib-tests--dummy-function ()
;; Dummy function to see if the file is compiled.