From ffff3931e104c73a0f332c9e181d11eebd81d816 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 20 Aug 2022 20:30:49 +0100 Subject: fix: don't override user's capfs (see issue #50) --- elisp/geiser-capf.el | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'elisp') 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." -- cgit v1.2.3