nit(corfu): revise comments, grammar, and formatting

This commit is contained in:
Henrik Lissner
2025-03-31 02:54:35 -04:00
parent f3165c1c5b
commit 74817a6f25
4 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,5 @@
#+title: :completion corfu #+title: :completion corfu
#+subtitle: Complete with cap(f), cape and a flying feather #+subtitle: Complete with cap(f), cape, and a flying feather
#+created: September 9, 2022 #+created: September 9, 2022
#+since: 3.0.0 (#7002) #+since: 3.0.0 (#7002)

View File

@ -10,7 +10,7 @@
;;;###autoload ;;;###autoload
(defun +corfu/move-to-minibuffer () (defun +corfu/move-to-minibuffer ()
"Move the current list of candidates to your choice of minibuffer completion UI." "Move list of candidates to your choice of minibuffer completion UI."
(interactive) (interactive)
(pcase completion-in-region--data (pcase completion-in-region--data
(`(,beg ,end ,table ,pred ,extras) (`(,beg ,end ,table ,pred ,extras)

View File

@ -60,6 +60,7 @@ If any return non-nil, `corfu-auto' will not invoke as-you-type completion.")
'separator t) 'separator t)
corfu-quit-no-match corfu-quit-at-boundary corfu-quit-no-match corfu-quit-at-boundary
tab-always-indent 'complete) tab-always-indent 'complete)
(add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles))) (add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles)))
(add-to-list 'corfu-auto-commands #'lispy-colon) (add-to-list 'corfu-auto-commands #'lispy-colon)
(add-to-list 'corfu-continue-commands #'+corfu/move-to-minibuffer) (add-to-list 'corfu-continue-commands #'+corfu/move-to-minibuffer)
@ -125,11 +126,11 @@ See `+corfu-want-minibuffer-completion'."
:around #'ispell-completion-at-point :around #'ispell-completion-at-point
(condition-case-unless-debug e (condition-case-unless-debug e
(apply fn args) (apply fn args)
('error ('error
(message "Error: %s" (error-message-string e)) (message "Error: %s" (error-message-string e))
(message "Auto-disabling `text-mode-ispell-word-completion'") (message "Auto-disabling `text-mode-ispell-word-completion'")
(setq text-mode-ispell-word-completion nil) (setq text-mode-ispell-word-completion nil)
(remove-hook 'completion-at-point-functions #'ispell-completion-at-point t))))) (remove-hook 'completion-at-point-functions #'ispell-completion-at-point t)))))
(use-package! cape (use-package! cape
:defer t :defer t
@ -218,8 +219,8 @@ See `+corfu-want-minibuffer-completion'."
;; If vertico is not enabled, orderless will be installed but not configured. ;; If vertico is not enabled, orderless will be installed but not configured.
;; That may break smart separator behavior, so we conditionally configure it. ;; That may break smart separator behavior, so we conditionally configure it.
(use-package! orderless (use-package! orderless
:when (and (not (modulep! :completion vertico)) :when (not (modulep! :completion vertico))
(modulep! +orderless)) :when (modulep! +orderless)
:config :config
(setq completion-styles '(orderless basic) (setq completion-styles '(orderless basic)
completion-category-defaults nil completion-category-defaults nil

View File

@ -7,9 +7,9 @@
(package! nerd-icons-corfu :pin "13166345b290d6c6a2ac6ba94a8d28ec3bb58c67")) (package! nerd-icons-corfu :pin "13166345b290d6c6a2ac6ba94a8d28ec3bb58c67"))
(when (and (not (modulep! :completion vertico)) (when (and (not (modulep! :completion vertico))
(modulep! +orderless)) (modulep! +orderless))
;; enabling +orderless without vertico should be fairly niche enough that to ;; Enabling +orderless without vertico should be fairly niche enough that to
;; save contributor headaches we should only pin vertico's orderless and leave ;; save contributor headaches we should only pin vertico's orderless and leave
;; this one unpinned ;; this one unpinned.
(package! orderless)) (package! orderless))
(when (modulep! :os tty) (when (modulep! :os tty)
(package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc")) (package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc"))