about summary refs log tree commit diff stats
path: root/lisp/+cape.el
diff options
context:
space:
mode:
authorCase Duckworth2023-01-04 23:21:15 -0600
committerCase Duckworth2023-01-04 23:21:15 -0600
commit33c7ddb09e0eae0796686c64ffa022a181145cc1 (patch)
treea7a00e960558acedf21dea0d1aedc1c33980ba3c /lisp/+cape.el
parentfoo (diff)
downloademacs-33c7ddb09e0eae0796686c64ffa022a181145cc1.tar.gz
emacs-33c7ddb09e0eae0796686c64ffa022a181145cc1.zip
Restart ... again ... again
Diffstat (limited to 'lisp/+cape.el')
-rw-r--r--lisp/+cape.el25
1 files changed, 0 insertions, 25 deletions
diff --git a/lisp/+cape.el b/lisp/+cape.el deleted file mode 100644 index 37e88fe..0000000 --- a/lisp/+cape.el +++ /dev/null
@@ -1,25 +0,0 @@
1;;; cape.el -*- lexical-binding: t; -*-
2
3;;; Code:
4
5(require 'cape)
6
7(defmacro +cape-insinuate (hook capes &rest capfs)
8 "Insinuate CAPES for a mode.
9Add a function to HOOK that will add CAPES to the local
10`completion-at-point-functions' for that mode's buffer. If CAPFS
11are given, mark them all as non-exclusive."
12 (let ((fn (intern (format "+cape-insinuate@%s" hook))))
13 `(prog1
14 ,@(when capes
15 `((defun ,fn ()
16 ,@(cl-loop for cape in capes
17 collect `(add-hook 'completion-at-point-functions
18 #',cape 90 :local)))
19 (add-hook ',hook #',fn)))
20 ,@(cl-loop for capf in capfs
21 collect `(advice-add ',capf :around
22 #'cape-wrap-nonexclusive)))))
23
24(provide '+cape)
25;;; +cape.el ends here