-
Notifications
You must be signed in to change notification settings - Fork 0
/
slime-cape.el
40 lines (33 loc) · 1.15 KB
/
slime-cape.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
;;; slime-cape.el --- slime completion backend for cape mode -*-lexical-binding:t-*-
;; This mode technically just connect slime-company to Cape mode
;;
;; See Also:
;;
;; [slime-company](https://github.com/anwyn/slime-company)
;; [cape](https://github.com/minad/cape)
;; Author: ccQpein
;; URL: https://github.com/ccqpein/slime-cape
;; Version: 0.1.0
;; Keywords: cape, corfu, slime, lisp
;; Package-Requires: ((slime-company "1.6"))
(require 'slime)
(require 'slime-company)
(require 'cape)
(defvar cape-slime-backend (cape-company-to-capf #'company-slime))
(define-slime-contrib slime-cape
(:authors "ccQpein")
(:swank-dependencies swank-arglists)
(:on-load
(dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook))
(add-hook h 'slime-cape-maybe-enable))
)
(:on-unload
(dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook))
(remove-hook h 'slime-cape-maybe-enable))
(delete cape-slime-backend completion-at-point-functions)
))
(defun slime-cape-maybe-enable ()
(when (slime-company-active-p)
(add-to-list 'completion-at-point-functions cape-slime-backend)))
(provide 'slime-cape)
;;; slime-cape.el ends here