]> git.eshelyaron.com Git - emacs.git/commitdiff
(cl-transform-lambda): Preserve the match-data.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 16 Aug 2007 04:24:57 +0000 (04:24 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 16 Aug 2007 04:24:57 +0000 (04:24 +0000)
lisp/ChangeLog
lisp/emacs-lisp/cl-macs.el

index 067a6291c3e8f10ac755b6565601b94fbe42e49c..16edb115181c44e780cbf1dbdd3d9b67c2555594 100644 (file)
@@ -1,3 +1,7 @@
+2007-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/cl-macs.el (cl-transform-lambda): Preserve the match-data.
+
 2007-08-16  Glenn Morris  <rgm@gnu.org>
 
        * ps-print.el (ps-font-size): Doc fix.
index 5a79a6424e0c87b4b9c8bf31d15d520282481a9d..e4a84e44e64fc5fb9bff637c6f1a45e4fef41e90 100644 (file)
@@ -266,15 +266,19 @@ its argument list allows full Common Lisp conventions."
             (nconc (nreverse simple-args)
                    (list '&rest (car (pop bind-lets))))
             (nconc (let ((hdr (nreverse header)))
-                     (require 'help-fns)
-                     (cons (help-add-fundoc-usage
-                            (if (stringp (car hdr)) (pop hdr))
-                            ;; orig-args can contain &cl-defs (an internal CL
-                            ;; thingy that I do not understand), so remove it.
-                            (let ((x (memq '&cl-defs orig-args)))
-                              (if (null x) orig-args
-                                (delq (car x) (remq (cadr x) orig-args)))))
-                           hdr))
+                      ;; Macro expansion can take place in the middle of
+                      ;; apparently harmless computation, so it should not
+                      ;; touch the match-data.
+                      (save-match-data
+                        (require 'help-fns)
+                        (cons (help-add-fundoc-usage
+                               (if (stringp (car hdr)) (pop hdr))
+                               ;; orig-args can contain &cl-defs (an internal
+                               ;; CL thingy I don't understand), so remove it.
+                               (let ((x (memq '&cl-defs orig-args)))
+                                 (if (null x) orig-args
+                                   (delq (car x) (remq (cadr x) orig-args)))))
+                              hdr)))
                    (list (nconc (list 'let* bind-lets)
                                 (nreverse bind-forms) body)))))))