OSDN Git Service

set version as 1.4.8-snapshot3
[howm/howm.git] / cheat-font-lock.el
index 5268289..74ff41c 100644 (file)
@@ -1,5 +1,5 @@
 ;;; cheat-font-lock.el --- modify font-lock-keywords
-;;; Copyright (C) 2002, 2003, 2004, 2005-2019
+;;; Copyright (C) 2002, 2003, 2004, 2005-2020
 ;;;   HIRAOKA Kazuyuki <khi@users.osdn.me>
 ;;;
 ;;; This program is free software; you can redistribute it and/or modify
@@ -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)
-  (font-lock-fontify-buffer))
+  (if (and (fboundp 'font-lock-flush) (fboundp 'font-lock-ensure))
+      (progn (font-lock-flush) (font-lock-ensure))
+    (with-no-warnings
+      (font-lock-fontify-buffer))))
 
 (provide 'cheat-font-lock)