Commit 4c4ad808 authored by Tom Tromey's avatar Tom Tromey

Fix mthml submode lighting at end of buffer

* lisp/textmodes/mhtml-mode.el (mhtml--submode-lighter): Handle end of
buffer correctly.
parent 557e252a
...@@ -149,7 +149,12 @@ code(); ...@@ -149,7 +149,12 @@ code();
(defun mhtml--submode-lighter () (defun mhtml--submode-lighter ()
"Mode-line lighter indicating the current submode." "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))
(submode (get-text-property where 'mhtml-submode)))
(if submode (if submode
(mhtml--submode-name submode) (mhtml--submode-name submode)
""))) "")))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment