emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/emacsql 8f3d0d4b81 344/427: Use font-lock-flush and font-l


From: ELPA Syncer
Subject: [nongnu] elpa/emacsql 8f3d0d4b81 344/427: Use font-lock-flush and font-lock-ensure if available
Date: Tue, 13 Dec 2022 03:00:00 -0500 (EST)

branch: elpa/emacsql
commit 8f3d0d4b81e17a0aac0449ca10fafa679cb6deec
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    Use font-lock-flush and font-lock-ensure if available
    
    `font-lock-fontity-buffer' is only intended for interactive use.  Emacs
    v25.1 adds `font-lock-flush' and `font-lock-ensure' as replacements.  A
    lot of reading revealed that we actually have to call both functions.
---
 emacsql.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/emacsql.el b/emacsql.el
index 33402820d2..ea6ba3094b 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -340,7 +340,14 @@ Each column must be a plain symbol, no expressions allowed 
here."
            (sql-mode)
            (with-no-warnings ;; autoloaded by previous line
              (sql-highlight-sqlite-keywords))
-           (font-lock-fontify-buffer)
+           (if (and (fboundp 'font-lock-flush)
+                    (fboundp 'font-lock-ensure))
+               (save-restriction
+                 (widen)
+                 (font-lock-flush)
+                 (font-lock-ensure))
+             (with-no-warnings
+               (font-lock-fontify-buffer)))
            (emacsql--indent)
            (buffer-string))))
     (with-current-buffer (get-buffer-create emacsql-show-buffer-name)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]