diff options
Diffstat (limited to 'elisp')
-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." |