about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-12-17 18:30:41 -0600
committerCase Duckworth2021-12-17 18:30:41 -0600
commit347008024ac3c671570309e4379a1079271124e5 (patch)
tree932c8c321c59f8c456cd4d64a0342db362b82e2d
parentAdd minibuffer stuff (diff)
downloademacs-347008024ac3c671570309e4379a1079271124e5.tar.gz
emacs-347008024ac3c671570309e4379a1079271124e5.zip
Advise vertico
-rw-r--r--init.el2
-rw-r--r--lisp/+vertico.el16
2 files changed, 18 insertions, 0 deletions
diff --git a/init.el b/init.el index ff686a5..1c4d8e7 100644 --- a/init.el +++ b/init.el
@@ -755,9 +755,11 @@ See also `crux-reopen-as-root-mode'."
755 :repo "minad/vertico" 755 :repo "minad/vertico"
756 :files ("*" "extensions/*" 756 :files ("*" "extensions/*"
757 (:exclude ".git")))) 757 (:exclude ".git"))))
758 (:also-load +vertico)
758 (:option resize-mini-windows 'grow-only 759 (:option resize-mini-windows 'grow-only
759 vertico-count-format nil 760 vertico-count-format nil
760 vertico-cycle t) 761 vertico-cycle t)
762 (advice-add 'vertico-next :around '+vertico-ding-wrap)
761 (when (boundp 'native-comp-deferred-compilation-deny-list) 763 (when (boundp 'native-comp-deferred-compilation-deny-list)
762 (add-to-list 'native-comp-deferred-compilation-deny-list "vertico")) 764 (add-to-list 'native-comp-deferred-compilation-deny-list "vertico"))
763 (vertico-mode +1) 765 (vertico-mode +1)
diff --git a/lisp/+vertico.el b/lisp/+vertico.el new file mode 100644 index 0000000..4adde3d --- /dev/null +++ b/lisp/+vertico.el
@@ -0,0 +1,16 @@
1;;; +vertico.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5;; https://old.reddit.com/r/emacs/comments/rbmfwk/weekly_tips_tricks_c_thread/hof7rz7/
6;; Add this advice to `vertico-next'.
7;; Takes care of `vertico-previous' as well, since it calls `vertico-next'.
8(defun +vertico-ding-wrap (origin &rest args)
9 "ADVICE to wrap `vertico-next': ding when wrapping."
10 (let ((beg-index vertico--index))
11 (apply origin args)
12 (unless (eq 1 (abs (- beg-index vertico--index)))
13 (ding))))
14
15(provide '+vertico)
16;;; +vertico.el ends here