# HG changeset patch # User Stefan Monnier # Date 1187238297 0 # Node ID 328998bce86555384238cd7bb8bc8ee8f8eb41e3 # Parent ef9caa847a4929046c35e4c132c1be5629a4f072 (cl-transform-lambda): Preserve the match-data. diff -r ef9caa847a49 -r 328998bce865 lisp/ChangeLog --- a/lisp/ChangeLog Thu Aug 16 03:23:07 2007 +0000 +++ b/lisp/ChangeLog Thu Aug 16 04:24:57 2007 +0000 @@ -1,3 +1,7 @@ +2007-08-16 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl-transform-lambda): Preserve the match-data. + 2007-08-16 Glenn Morris * ps-print.el (ps-font-size): Doc fix. diff -r ef9caa847a49 -r 328998bce865 lisp/emacs-lisp/cl-macs.el --- a/lisp/emacs-lisp/cl-macs.el Thu Aug 16 03:23:07 2007 +0000 +++ b/lisp/emacs-lisp/cl-macs.el Thu Aug 16 04:24:57 2007 +0000 @@ -266,15 +266,19 @@ (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)))))))