OSDN Git Service

fix incomplete font-lock after save
authorHiraoka <khi@users.osdn.me>
Wed, 17 Feb 2021 11:25:38 +0000 (20:25 +0900)
committerHiraoka <khi@users.osdn.me>
Wed, 17 Feb 2021 11:25:38 +0000 (20:25 +0900)
ChangeLog
cheat-font-lock.el

index d5d92fe..87ca559 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-02-17  HIRAOKA Kazuyuki  <khi@users.osdn.me>
+
+       * cheat-font-lock.el (cheat-font-lock-mode, cheat-font-lock-fontify):
+       fix incomplete font-lock after save
+
 2020-12-31  HIRAOKA Kazuyuki  <khi@users.osdn.me>
 
        * configure.ac: version 1.4.8-snapshot1
index 420f36f..74ff41c 100644 (file)
@@ -92,7 +92,9 @@
   ;; Without the next line, global value is changed to t. [2003-12-30]
   ;; (emacs-20.7.2 on Vine Linux 2.6)
   (make-local-variable 'font-lock-fontified)
-  (let* ((font-lock-fontified t) ;; adjourn fontify-buffer
+  (let* (;; Stop cheating font-lock in such a way. [2021-02-15]
+         ;; This seems troublesome and font-lock is not slow today.
+         ;; (font-lock-fontified t) ;; adjourn fontify-buffer
          (bname (buffer-name))
          (need-rename (eq (aref (buffer-name) 0) ?\ )))
     ;; Rename invisible buffer in order to force font-lock-mode.
   (font-lock-set-defaults))
 
 (defun cheat-font-lock-fontify (&optional dummy)
-  (if (fboundp 'font-lock-ensure)
-      (font-lock-ensure)
+  (if (and (fboundp 'font-lock-flush) (fboundp 'font-lock-ensure))
+      (progn (font-lock-flush) (font-lock-ensure))
     (with-no-warnings
       (font-lock-fontify-buffer))))