From 263032646f5a73aeb3a60a5035b53a20377e4b83 Mon Sep 17 00:00:00 2001 From: shoshin Date: Fri, 1 Jul 2022 23:43:04 -0500 Subject: Add: [consult] theme preview debouncing and notes --- shoshin-config.el | 2 ++ shoshin-config.org | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/shoshin-config.el b/shoshin-config.el index 9d62ab1..56caa1a 100644 --- a/shoshin-config.el +++ b/shoshin-config.el @@ -29,6 +29,8 @@ (define-key xah-fly-leader-key-map (kbd "f") #'consult-buffer) (define-key xah-fly-command-map (kbd "n") #'consult-line) +(consult-customize consult-theme :preview-key '(:debounce 0.5 any)) + (package-install 'embark) (package-install 'marginalia) diff --git a/shoshin-config.org b/shoshin-config.org index 336b5a9..53a57e2 100644 --- a/shoshin-config.org +++ b/shoshin-config.org @@ -266,14 +266,24 @@ and press ~m SPC~ to narrow the "buffer list" to any bookmarks. (define-key xah-fly-command-map (kbd "n") #'consult-line) #+end_src -*** note about ~consult-themes~ +*** consult-themes i had a bit of a mess with it at first, because i'd implemented my own solution to a quirk of theme loading. enabling themes is additive, and can cause unexpected results. so i added [[info:elisp#Advising Functions][advice]] to ~load-theme~ to automatically disable the old one before enabling -the new. it seems like consult does this as well as switching themes -/as you narrow your selection/. +the new. + +it seems like ~consult-theme~ does this as well. additionally, as +it will preview the theme as you are narrowing the selection. i did not +expect this behavior and it got all kinds of wonky. the manual has a +nice example of delaying the theme-switch-preview since it is slow. +this way you can scroll / narrow your list of themes without the colors +changing with every keypress. + +#+begin_src emacs-lisp + (consult-customize consult-theme :preview-key '(:debounce 0.5 any)) +#+end_src *** TODO consult-project-buffer -- cgit v1.2.3