(diary-face, holiday-face): Add dark-background variants.
[bpt/emacs.git] / lisp / jit-lock.el
index e4323a0..9cd9d29 100644 (file)
@@ -66,7 +66,7 @@ Preserves the `buffer-modified-p' state of the current buffer."
 (defcustom jit-lock-stealth-time 3
   "*Time in seconds to wait before beginning stealth fontification.
 Stealth fontification occurs if there is no input within this time.
-If nil, means stealth fontification is never performed.
+If nil, stealth fontification is never performed.
 
 The value of this variable is used when JIT Lock mode is turned on."
   :type '(choice (const :tag "never" nil)
@@ -238,7 +238,6 @@ Only applies to the current buffer."
 ;; fontifying eagerly the whole buffer.  This is important for
 ;; things like CWarn mode which adds/removes a few keywords and
 ;; does a refontify (which takes ages on large files).
-(defalias 'jit-lock-fontify-buffer 'jit-lock-refontify)
 (defun jit-lock-refontify (&optional beg end)
   "Force refontification of the region BEG..END (default whole buffer)."
   (with-buffer-prepared-for-jit-lock
@@ -421,12 +420,20 @@ will take place when text is fontified stealthily."
   (when jit-lock-mode
     (save-excursion
       (with-buffer-prepared-for-jit-lock
+       ;; If we're in text that matches a multi-line font-lock pattern,
+       ;; make sure the whole text will be redisplayed.
+       (when (get-text-property start 'font-lock-multiline)
+        (setq start (or (previous-single-property-change
+                         start 'font-lock-multiline)
+                        (point-min))))
+       
        ;; It's important that the `fontified' property be set from the
        ;; beginning of the line, else font-lock will properly change the
        ;; text's face, but the display will have been done already and will
        ;; be inconsistent with the buffer's content.
        (goto-char start)
        (setq start (line-beginning-position))
+       
        ;; Make sure we change at least one char (in case of deletions).
        (setq end (min (max end (1+ start)) (point-max)))
        ;; Request refontification.