[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fdaaf88: Document that flymake-diag-region saves match data
From: |
Jo�o T�vora |
Subject: |
master fdaaf88: Document that flymake-diag-region saves match data |
Date: |
Fri, 18 Dec 2020 10:38:58 -0500 (EST) |
branch: master
commit fdaaf886b71fc41d0d6d717af55e4927ed4cd2c1
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Document that flymake-diag-region saves match data
The typical use of this function (which is parsing compiler diagnostic
messages), lends itself too easily to one the problems in bug#29193.
Make it a friendlier API.
* doc/misc/flymake.texi (Flymake utility functions): Document that
flymake-diag-region saves match data.
* lisp/progmodes/flymake.el (flymake-diag-region): Document that
this saves match data.
---
doc/misc/flymake.texi | 2 +-
lisp/progmodes/flymake.el | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi
index b475793..f4fc26d 100644
--- a/doc/misc/flymake.texi
+++ b/doc/misc/flymake.texi
@@ -581,7 +581,7 @@ can use the following function:
Compute @var{buffer}'s region (@var{beg} . @var{end}) corresponding
to @var{line} and @var{col}. If @var{col} is @code{nil}, return a
region just for @var{line}. Return @code{nil} if the region is
-invalid.
+invalid. This function saves match data (@pxref{Saving Match Data}).
@end deffn
@cindex add a log message
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index dfb4f18..40bb90d 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -412,7 +412,7 @@ verify FILTER, a function, and sort them by COMPARE (using
KEY)."
(defun flymake-diag-region (buffer line &optional col)
"Compute BUFFER's region (BEG . END) corresponding to LINE and COL.
If COL is nil, return a region just for LINE. Return nil if the
-region is invalid."
+region is invalid. This function saves match data."
(condition-case-unless-debug _err
(with-current-buffer buffer
(let ((line (min (max line 1)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master fdaaf88: Document that flymake-diag-region saves match data,
Jo�o T�vora <=