(flymake-diag-region): Fall back to (end-of-thing 'symbol)

* lisp/progmodes/flymake.el (flymake-diag-region):
Fall back to (end-of-thing 'symbol) (bug#29193).
This commit is contained in:
Dmitry Gutov 2020-12-16 02:49:35 +02:00
parent 2e7402b760
commit fda9a2bbfd

View file

@ -437,7 +437,8 @@ region is invalid."
(if (and col (cl-plusp col))
(let* ((beg (progn (forward-char (1- col))
(point)))
(sexp-end (ignore-errors (end-of-thing 'sexp)))
(sexp-end (or (ignore-errors (end-of-thing 'sexp))
(ignore-errors (end-of-thing 'symbol))))
(end (or (and sexp-end
(not (= sexp-end beg))
sexp-end)