diff options
| author | Thomas Voss <thomas.voss@humanwave.nl> | 2026-03-20 16:38:50 +0100 |
|---|---|---|
| committer | Thomas Voss <thomas.voss@humanwave.nl> | 2026-03-20 16:48:31 +0100 |
| commit | c5797f6a1e6803a5eeff5a251c5ec7bbe91dd298 (patch) | |
| tree | 4a39596fad4daa6287b4200dc2922eab8258f4f2 /.config/emacs/modules | |
| parent | 9049047797a619df4ba5383b73a4cf83988aa30e (diff) | |
emacs: Use cape for CAPF functions
Diffstat (limited to '.config/emacs/modules')
| -rw-r--r-- | .config/emacs/modules/mm-completion.el | 17 |
1 files changed, 17 insertions, 0 deletions
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 @@ -159,6 +159,23 @@ (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 (use-package completion-preview |