]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/cl-macs.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / emacs-lisp / cl-macs.el
index ab87fd5336173ebc420b6b24e05d9c5fc0abde87..8b55dd4a379b133349a8146f2bae484336ca3d8f 100644 (file)
@@ -272,15 +272,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)))))))