diff options
author | Case Duckworth | 2021-12-17 18:30:41 -0600 |
---|---|---|
committer | Case Duckworth | 2021-12-17 18:30:41 -0600 |
commit | 347008024ac3c671570309e4379a1079271124e5 (patch) | |
tree | 932c8c321c59f8c456cd4d64a0342db362b82e2d /lisp | |
parent | Add minibuffer stuff (diff) | |
download | emacs-347008024ac3c671570309e4379a1079271124e5.tar.gz emacs-347008024ac3c671570309e4379a1079271124e5.zip |
Advise vertico
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+vertico.el | 16 |
1 files changed, 16 insertions, 0 deletions
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 | ||