From 9f3c896f7cb116bddaa072b6b37fe6c2377c3cc2 Mon Sep 17 00:00:00 2001 From: Matt Armstrong Date: Thu, 27 Oct 2022 13:46:38 -0700 Subject: [PATCH 1/3] ; * doc/emacs/text.texi (Quotation Marks): Typo fix. (Bug#58822) --- doc/emacs/text.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index a8aa4a413dc..caf853d6e2c 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -460,7 +460,7 @@ variables. @vindex electric-quote-replace-double You can also set the option @code{electric-quote-replace-double} to -a non-@code{nil} value. Then, typing @kbd{"} insert an appropriate +a non-@code{nil} value. Then, typing @kbd{"} inserts an appropriate curved double quote depending on context: @t{“} at the beginning of the buffer or after a line break, whitespace, opening parenthesis, or quote character, and @t{”} otherwise. From 15fc5225b1c84abfd08a312cf5ca34c65f235a27 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Oct 2022 15:40:31 +0300 Subject: [PATCH 2/3] ; * lisp/whitespace.el (whitespace-trailing): Fix a typo. --- lisp/whitespace.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/whitespace.el b/lisp/whitespace.el index e518f1e00ab..6cdc4ab4845 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -536,7 +536,7 @@ Used when `whitespace-style' includes the value `trailing'.") (t :background "red1" :foreground "yellow")) "Face used to visualize trailing blanks. -See '`whitespace-trailing-regexp'." +See `whitespace-trailing-regexp'." :group 'whitespace) From 1862df834c29197cdd339ee369c0ef21694db851 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 30 Oct 2022 19:57:14 +0200 Subject: [PATCH 3/3] ; * src/search.c (Fmatch_data): Doc fix. --- src/search.c | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/src/search.c b/src/search.c index 88ee584504f..88ab1df7791 100644 --- a/src/search.c +++ b/src/search.c @@ -2811,22 +2811,37 @@ Return value is undefined if the last search failed. */) } DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 3, 0, - doc: /* Return a list describing what the last search matched. -Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'. -All the elements are markers or nil (nil if the Nth pair didn't match) -if the last match was on a buffer; integers or nil if a string was matched. -Use `set-match-data' to reinstate the data in this list. + doc: /* Return a list of positions that record text matched by the last search. +Element 2N of the returned list is the position of the beginning of the +match of the Nth subexpression; it corresponds to `(match-beginning N)'; +element 2N + 1 is the position of the end of the match of the Nth +subexpression; it corresponds to `(match-end N)'. See `match-beginning' +and `match-end'. +If the last search was on a buffer, all the elements are by default +markers or nil (nil when the Nth pair didn't match); they are integers +or nil if the search was on a string. But if the optional argument +INTEGERS is non-nil, the elements that represent buffer positions are +always integers, not markers, and (if the search was on a buffer) the +buffer itself is appended to the list as one additional element. -If INTEGERS (the optional first argument) is non-nil, always use -integers (rather than markers) to represent buffer positions. In -this case, and if the last match was in a buffer, the buffer will get -stored as one additional element at the end of the list. +Use `set-match-data' to reinstate the match data from the elements of +this list. -If REUSE is a list, reuse it as part of the value. If REUSE is long -enough to hold all the values, and if INTEGERS is non-nil, no consing -is done. +Note that non-matching optional groups at the end of the regexp are +elided instead of being represented with two `nil's each. For instance: -If optional third arg RESEAT is non-nil, any previous markers on the + (progn + (string-match "^\\(a\\)?\\(b\\)\\(c\\)?$" "b") + (match-data)) + => (0 1 nil nil 0 1) + +If REUSE is a list, store the value in REUSE by destructively modifying it. +If REUSE is long enough to hold all the values, its length remains the +same, and any unused elements are set to nil. If REUSE is not long +enough, it is extended. Note that if REUSE is long enough and INTEGERS +is non-nil, no consing is done to make the return value; this minimizes GC. + +If optional third argument RESEAT is non-nil, any previous markers on the REUSE list will be modified to point to nowhere. Return value is undefined if the last search failed. */)