From 77fce4bc2cd757b0d904e8c71ed9f17cf9ea14de Mon Sep 17 00:00:00 2001 From: Hiraoka Date: Wed, 17 Feb 2021 20:25:38 +0900 Subject: [PATCH] fix incomplete font-lock after save --- ChangeLog | 5 +++++ cheat-font-lock.el | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5d92fe..87ca559 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-02-17 HIRAOKA Kazuyuki + + * cheat-font-lock.el (cheat-font-lock-mode, cheat-font-lock-fontify): + fix incomplete font-lock after save + 2020-12-31 HIRAOKA Kazuyuki * configure.ac: version 1.4.8-snapshot1 diff --git a/cheat-font-lock.el b/cheat-font-lock.el index 420f36f..74ff41c 100644 --- a/cheat-font-lock.el +++ b/cheat-font-lock.el @@ -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. @@ -105,8 +107,8 @@ (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)))) -- 2.11.0