From: Eli Zaretskii Date: Sat, 17 Feb 2007 11:28:18 +0000 (+0000) Subject: (font-lock-extend-region-wholelines): Test for EOB in addition to BOL. X-Git-Tag: emacs-pretest-22.0.94~107 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ead4759c9c241f5179249859a283809e43c4b1bd;p=emacs.git (font-lock-extend-region-wholelines): Test for EOB in addition to BOL. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 281cdd624a9..832d921c20a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-02-17 David Hansen (tiny change) + + * font-lock.el (font-lock-extend-region-wholelines): Test for EOB + in addition to BOL. + 2007-02-16 Stefan Monnier * ps-print.el: Use (defvar ) where applicable. diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 62008ac295b..fd2dedc1dae 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1075,20 +1075,20 @@ Put first the functions more likely to cause a change and cheaper to compute.") (setq font-lock-beg (or (previous-single-property-change font-lock-beg 'font-lock-multiline) (point-min)))) - ;; + ;; (when (get-text-property font-lock-end 'font-lock-multiline) (setq changed t) (setq font-lock-end (or (text-property-any font-lock-end (point-max) 'font-lock-multiline nil) (point-max)))) changed)) - - + (defun font-lock-extend-region-wholelines () "Move fontification boundaries to beginning of lines." (let ((changed nil)) (goto-char font-lock-beg) - (unless (bolp) (setq changed t font-lock-beg (line-beginning-position))) + (unless (or (bolp) (eobp)) + (setq changed t font-lock-beg (line-beginning-position))) (goto-char font-lock-end) (unless (bolp) (unless (eq font-lock-end