[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 8858b52e77 2/2: Expand documentation of `consul
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 8858b52e77 2/2: Expand documentation of `consult-preview-allowed-hooks' (See #814) |
Date: |
Wed, 14 Jun 2023 06:57:55 -0400 (EDT) |
branch: externals/consult
commit 8858b52e77e2566cc3a3383a58a0435526e11ab3
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Expand documentation of `consult-preview-allowed-hooks' (See #814)
---
README.org | 24 +++++++++++++++++-------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/README.org b/README.org
index 41b90f720a..032a305641 100644
--- a/README.org
+++ b/README.org
@@ -467,13 +467,23 @@ to be considered.
In this case one may wonder what the difference is between using an Embark
action on the current candidate in comparison to a manually triggered preview.
The main difference is that the files opened by manual preview are closed again
-after the completion session. Furthermore during preview some functionality is
-disabled to improve the performance, see for example the customization
variables
-=consult-preview-allowed-hooks= and =consult-preview-variables=. Files larger
than
-=consult-preview-raw-size= are previewed literally without syntax highlighting
and
-without changing the major mode. Delaying the preview is also useful for
-=consult-theme=, since the theme preview is slow. The delay results in a
smoother
-UI experience.
+after the completion session. During preview some functionality is disabled to
+improve the performance, see for example the customization variables
+=consult-preview-variables= and =consult-preview-allowed-hooks=. Only the hooks
+listed in =consult-preview-allowed-hooks= are executed when a file is opened
+(=find-file-hook=). In order to enable additional font locking during preview,
add
+the corresponding hooks to the allow list. The following code demonstrates this
+for [[https://github.com/minad/org-modern][org-modern]] and
[[https://github.com/tarsius/hl-todo][hl-todo]].
+
+#+begin_src emacs-lisp
+(add-to-list 'consult-preview-allowed-hooks
'global-org-modern-mode-check-buffers)
+(add-to-list 'consult-preview-allowed-hooks 'global-hl-todo-mode-check-buffers)
+#+end_src
+
+Files larger than =consult-preview-raw-size= are previewed literally without
+syntax highlighting and without changing the major mode. Delaying the preview
is
+also useful for =consult-theme=, since the theme preview is slow. The delay
+results in a smoother UI experience.
#+begin_src emacs-lisp
;; Preview on any key press, but delay 0.5s