Skip to content

Commit

Permalink
emacsql-show-sql: Simplify how font-lock is ensured
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tarsius committed Jul 30, 2024
1 parent 8aeffcf commit 32f086e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions emacsql.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 32f086e

Please sign in to comment.