Commit d6a0b66a authored by Stefan Monnier's avatar Stefan Monnier

* lisp/subr.el (save-match-data): Clarify use in docstring

parent 1a6d59ee
Pipeline #5654 passed with stage
in 71 minutes and 46 seconds
......@@ -4088,7 +4088,11 @@ MODES is as for `set-default-file-modes'."
;; now, but it generates slower code.
(defmacro save-match-data (&rest body)
"Execute the BODY forms, restoring the global value of the match data.
The value returned is the value of the last form in BODY."
The value returned is the value of the last form in BODY.
NOTE: The convention in Elisp is that any function, except for a few
exceptions like car/assoc/+/goto-char, can clobber the match data,
so `save-match-data' should normally be used to save *your* match data
rather than your caller's match data."
;; It is better not to use backquote here,
;; because that makes a bootstrapping problem
;; if you need to recompile all the Lisp files using interpreted code.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment