summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorJoakim Verona <joakim@verona.se>2016-01-15 20:06:45 +0100
committerJoakim Verona <joakim@verona.se>2016-01-15 20:06:45 +0100
commit4b73dac2885aa7eb23b66c299065e19bd118a4fb (patch)
tree18452b36b890faf52d40f555ebe4dc3c6e020bc6 /lisp/font-lock.el
parent0d824cc5e79e7d29a01929a51dfd673a117c77e8 (diff)
parent984a14904658da42ca9dea50a811a901ddc56e60 (diff)
downloademacs-xwidget_mvp.tar.gz
merge masterxwidget_mvp
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 93d677c67e7..3c1f01d5886 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1,6 +1,6 @@
;;; font-lock.el --- Electric font lock mode
-;; Copyright (C) 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1992-2016 Free Software Foundation, Inc.
;; Author: Jamie Zawinski
;; Richard Stallman
@@ -1302,15 +1302,18 @@ This function does 2 things:
(point-min))))
(when (< end (point-max))
(setq end
- (if (get-text-property end 'font-lock-multiline)
- (or (text-property-any end (point-max)
- 'font-lock-multiline nil)
- (point-max))
+ (cond
+ ((get-text-property end 'font-lock-multiline)
+ (or (text-property-any end (point-max)
+ 'font-lock-multiline nil)
+ (point-max)))
+ ;; If `end' has been set by the function above, don't corrupt it.
+ (font-lock-extend-after-change-region-function end)
;; Rounding up to a whole number of lines should include the
;; line right after `end'. Typical case: the first char of
;; the line was deleted. Or a \n was inserted in the middle
;; of a line.
- (1+ end))))
+ (t (1+ end)))))
;; Finally, pre-enlarge the region to a whole number of lines, to try
;; and anticipate what font-lock-default-fontify-region will do, so as to
;; avoid double-redisplay.