From: Lars Ingebrigtsen Date: Sat, 8 Aug 2020 09:53:09 +0000 (+0200) Subject: Tweak how whitespace-mode marks the end of the buffer X-Git-Tag: emacs-28.0.90~6757 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4085a2c15e4f9e162bf8c9b77f4a1a2a84ad9437;p=emacs.git Tweak how whitespace-mode marks the end of the buffer * lisp/whitespace.el (whitespace-missing-newline-at-eof): Change the colours to not be as angry. (whitespace-color-on): Don't mark the end of the buffer if point is there. --- diff --git a/lisp/whitespace.el b/lisp/whitespace.el index fb5f28c0029..42c4b61daff 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -594,7 +594,7 @@ line. Used when `whitespace-style' includes the value `indentation'.") (defface whitespace-missing-newline-at-eof '((((class mono)) :inverse-video t :weight bold :underline t) - (t :background "red" :foreground "firebrick")) + (t :background "#d0d040" :foreground "black")) "Face used to visualize missing newline at the end of the file.") (defvar whitespace-empty 'whitespace-empty @@ -2137,7 +2137,13 @@ resultant list will be returned." 1 whitespace-space-after-tab t))) ,@(when (memq 'missing-newline-at-eof whitespace-active-style) ;; Show missing newline. - `(("[^\n]\\'" 0 'whitespace-missing-newline-at-eof t))))) + `(("[^\n]\\'" 0 + ;; Don't mark the end of the buffer is point is there -- + ;; it probably means that the user is typing something + ;; at the end of the buffer. + (and (/= whitespace-point (point-max)) + 'whitespace-missing-newline-at-eof) + t))))) (font-lock-add-keywords nil whitespace-font-lock-keywords t) (font-lock-flush)))