From c5797f6a1e6803a5eeff5a251c5ec7bbe91dd298 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 20 Mar 2026 16:38:50 +0100 Subject: emacs: Use cape for CAPF functions --- .config/emacs/modules/mm-completion.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to '.config/emacs') diff --git a/.config/emacs/modules/mm-completion.el b/.config/emacs/modules/mm-completion.el index 74740b4..8ff2894 100644 --- a/.config/emacs/modules/mm-completion.el +++ b/.config/emacs/modules/mm-completion.el @@ -158,6 +158,23 @@ :custom (find-library-include-other-files nil)) + +;;; Completion at Point Functions + +(defun mm-cape-file--not-dot-path-p (cand) + (declare (ftype (function (string) boolean)) + (pure t) (side-effect-free t)) + (not (or (string= cand "./") + (string= cand "../")))) + +(use-package cape + :ensure t + :init + (add-hook 'completion-at-point-functions + (cape-capf-predicate #'cape-file #'mm-cape-file--not-dot-path-p)) + (add-hook 'completion-at-point-functions + (cape-capf-prefix-length #'cape-dabbrev 3))) + ;;; Completion at Point Live Completions -- cgit v1.2.3