[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-27 d6a0b66: * lisp/subr.el (save-match-data): Clarify use in docst
From: |
Stefan Monnier |
Subject: |
emacs-27 d6a0b66: * lisp/subr.el (save-match-data): Clarify use in docstring |
Date: |
Sat, 23 May 2020 09:33:46 -0400 (EDT) |
branch: emacs-27
commit d6a0b66a0cf44389c7474a60dd23cbf666e78537
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* lisp/subr.el (save-match-data): Clarify use in docstring
---
lisp/subr.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/subr.el b/lisp/subr.el
index 33194e4..2b3231b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-27 d6a0b66: * lisp/subr.el (save-match-data): Clarify use in docstring,
Stefan Monnier <=