diff options
author | Tom Tromey <tom@tromey.com> | 2017-10-29 12:05:28 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-10-29 12:05:28 -0600 |
commit | 4c4ad8084872937776783bc1e59908114ec8f44c (patch) | |
tree | 974ab1396d263e991e9cd9941c30f8ff739232c2 /lisp/textmodes/mhtml-mode.el | |
parent | 557e252aa22919e7ae89bb0a364ca22250b7121e (diff) | |
download | emacs-4c4ad8084872937776783bc1e59908114ec8f44c.tar.gz |
Fix mthml submode lighting at end of buffer
* lisp/textmodes/mhtml-mode.el (mhtml--submode-lighter): Handle end of
buffer correctly.
Diffstat (limited to 'lisp/textmodes/mhtml-mode.el')
-rw-r--r-- | lisp/textmodes/mhtml-mode.el | 7 |
1 files changed, 6 insertions, 1 deletions
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) ""))) |