mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor(corfu): conform to conventions
This commit is contained in:
@ -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."
|
||||
|
@ -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.
|
||||
|
Reference in New Issue
Block a user