summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-08-20 20:30:49 +0100
committerjao <jao@gnu.org>2022-08-20 20:30:49 +0100
commitffff3931e104c73a0f332c9e181d11eebd81d816 (patch)
treec552fa7448b08300da22f97b855031836e7efe97 /elisp
parent6284841ce075b04eb802d980044860ac0d72b93f (diff)
downloadgeiser-ffff3931e104c73a0f332c9e181d11eebd81d816.tar.gz
geiser-ffff3931e104c73a0f332c9e181d11eebd81d816.tar.bz2
fix: don't override user's capfs (see issue #50)
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-capf.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/elisp/geiser-capf.el b/elisp/geiser-capf.el
index 73a6f07..d51a88c 100644
--- a/elisp/geiser-capf.el
+++ b/elisp/geiser-capf.el
@@ -70,13 +70,15 @@
(let ((comint-completion-addsuffix "\""))
(ignore-errors (comint-filename-completion)))))
+(defconst geiser-capf--capfs
+ '(geiser-capf--for-filename geiser-capf--for-module geiser-capf--for-symbol))
+
(defun geiser-capf-setup (enable)
- (set (make-local-variable 'completion-at-point-functions)
- (if enable
- '(geiser-capf--for-symbol
- geiser-capf--for-module
- geiser-capf--for-filename)
- (default-value 'completion-at-point-functions))))
+ (if enable
+ (dolist (f geiser-capf--capfs)
+ (add-hook 'completion-at-point-functions f nil t))
+ (dolist (f geiser-capf--capfs)
+ (remove-hook 'completion-at-point-functions f t))))
(defun geiser-capf-complete-module ()
"Complete module name at point."