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.
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
(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)