diff options
author | jao <jao@gnu.org> | 2022-08-20 20:30:49 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-08-20 20:30:49 +0100 |
commit | ffff3931e104c73a0f332c9e181d11eebd81d816 (patch) | |
tree | c552fa7448b08300da22f97b855031836e7efe97 /elisp/geiser-capf.el | |
parent | 6284841ce075b04eb802d980044860ac0d72b93f (diff) | |
download | geiser-ffff3931e104c73a0f332c9e181d11eebd81d816.tar.gz geiser-ffff3931e104c73a0f332c9e181d11eebd81d816.tar.bz2 |
fix: don't override user's capfs (see issue #50)
Diffstat (limited to 'elisp/geiser-capf.el')
-rw-r--r-- | elisp/geiser-capf.el | 14 |
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." |