Fix mthml submode lighting at end of buffer

* lisp/textmodes/mhtml-mode.el (mhtml--submode-lighter): Handle end of
buffer correctly.
This commit is contained in:
Tom Tromey 2017-10-29 12:05:28 -06:00
parent 557e252aa2
commit 4c4ad80848

View file

@ -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)
"")))