diff --git a/modules/completion/corfu/autoload.el b/modules/completion/corfu/autoload.el index e8a8aa73c..84fd6949b 100644 --- a/modules/completion/corfu/autoload.el +++ b/modules/completion/corfu/autoload.el @@ -1,5 +1,13 @@ ;;; completion/corfu/autoload.el -*- lexical-binding: t; -*- +;;;###autoload +(defun +corfu-dabbrev-friend-buffer-p (other-buffer) + (< (buffer-size other-buffer) +corfu-buffer-scanning-size-limit)) + + +;; +;;; Commands + ;;;###autoload (defun +corfu/move-to-minibuffer () "Move the current list of candidates to your choice of minibuffer completion UI." diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index e6f3ee9c0..c7de6a893 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -144,8 +144,6 @@ See `+corfu-want-minibuffer-completion'." (when (modulep! +dabbrev) (setq cape-dabbrev-check-other-buffers t) ;; Set up `cape-dabbrev' options. - (defun +dabbrev-friend-buffer-p (other-buffer) - (< (buffer-size other-buffer) +corfu-buffer-scanning-size-limit)) (add-hook! '(prog-mode-hook text-mode-hook conf-mode-hook @@ -155,7 +153,7 @@ See `+corfu-want-minibuffer-completion'." (defun +corfu-add-cape-dabbrev-h () (add-hook 'completion-at-point-functions #'cape-dabbrev 20 t))) (after! dabbrev - (setq dabbrev-friend-buffer-function #'+dabbrev-friend-buffer-p + (setq dabbrev-friend-buffer-function #'+corfu-dabbrev-friend-buffer-p dabbrev-ignored-buffer-regexps '("\\` " "\\(?:\\(?:[EG]?\\|GR\\)TAGS\\|e?tags\\|GPATH\\)\\(<[0-9]+>\\)?") @@ -173,8 +171,8 @@ See `+corfu-want-minibuffer-completion'." ;; From the `cape' readme. Without this, Eshell autocompletion is broken on ;; Emacs28. (when (< emacs-major-version 29) - (advice-add 'pcomplete-completions-at-point :around #'cape-wrap-silent) - (advice-add 'pcomplete-completions-at-point :around #'cape-wrap-purify)) + (advice-add #'pcomplete-completions-at-point :around #'cape-wrap-silent) + (advice-add #'pcomplete-completions-at-point :around #'cape-wrap-purify)) (when (modulep! :lang latex) ;; Allow file completion on latex directives.