From 32f086e6e1aca48120b71fec2437b4c8b21b29fd Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 30 Jul 2024 15:39:04 +0200 Subject: [PATCH] emacsql-show-sql: Simplify how font-lock is ensured We are in a newly created temporary buffer, so we do not need to ensure that the buffer is non narrowed or that there is no outdated fontification. All we have to do is to ensure that the buffer is fully font-locked before we insert the `buffer-string' into another buffer. --- emacsql.el | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/emacsql.el b/emacsql.el index 4f9e94f..c207990 100644 --- a/emacsql.el +++ b/emacsql.el @@ -378,10 +378,7 @@ Each column must be a plain symbol, no expressions allowed here." (sql-mode) (with-no-warnings ;; autoloaded by previous line (sql-highlight-sqlite-keywords)) - (save-restriction - (widen) - (font-lock-flush) - (font-lock-ensure)) + (font-lock-ensure) (emacsql--indent) (buffer-string)))) (with-current-buffer (get-buffer-create emacsql-show-buffer-name)