From: Tom Tromey Date: Sun, 29 Oct 2017 18:05:28 +0000 (-0600) Subject: Fix mthml submode lighting at end of buffer X-Git-Tag: emacs-26.0.91~432 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4c4ad8084872937776783bc1e59908114ec8f44c;p=emacs.git Fix mthml submode lighting at end of buffer * lisp/textmodes/mhtml-mode.el (mhtml--submode-lighter): Handle end of buffer correctly. --- diff --git a/lisp/textmodes/mhtml-mode.el b/lisp/textmodes/mhtml-mode.el index 05d5e52225d..2c1b26d571c 100644 --- a/lisp/textmodes/mhtml-mode.el +++ b/lisp/textmodes/mhtml-mode.el @@ -149,7 +149,12 @@ code(); (defun mhtml--submode-lighter () "Mode-line lighter indicating the current submode." - (let ((submode (get-text-property (point) 'mhtml-submode))) + ;; The end of the buffer has no text properties, so in this case + ;; back up one character, if possible. + (let* ((where (if (and (eobp) (not (bobp))) + (1- (point)) + (point))) + (submode (get-text-property where 'mhtml-submode))) (if submode (mhtml--submode-name submode) "")))