From: João Távora Date: Thu, 9 Nov 2017 21:16:40 +0000 (+0000) Subject: Flymake correctly highlights whole last line if eob (bug#29201) X-Git-Tag: emacs-26.0.91~342 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=535688a4181ae4052db354ce2b877507f11c9e66;p=emacs.git Flymake correctly highlights whole last line if eob (bug#29201) If a line/column pair indicates an end-of-buffer position, flymake should behave like the case where the last line of the buffer is referenced without a column indication. This behavior is currently to highlight the whole last line. * lisp/progmodes/flymake.el (flymake-diag-region): Correct conditions of fallback to the fallback-eol local function. --- diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 921ac913309..883f96747b9 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -334,7 +334,8 @@ region is invalid." (end (or (and sexp-end (not (= sexp-end beg)) sexp-end) - (ignore-errors (goto-char (1+ beg))))) + (and (< (goto-char (1+ beg)) (point-max)) + (point)))) (safe-end (or end (fallback-eol beg)))) (cons (if end beg (fallback-bol))