diff --git a/modules/completion/corfu/README.org b/modules/completion/corfu/README.org index e10d1b17d..541510cb5 100644 --- a/modules/completion/corfu/README.org +++ b/modules/completion/corfu/README.org @@ -244,6 +244,22 @@ doing is to look at the list of buffers Dabbrev is scanning: ... and modify ~dabbrev-ignored-buffer-regexps~ or ~dabbrev-ignored-buffer-modes~ accordingly. +If you see garbage completion candidates, you can use the following command to +debug the issue: + +#+begin_src emacs-lisp +;;;###autoload +(defun search-in-dabbrev-buffers (search-string) + "Search for SEARCH-STRING in all buffers returned by `dabbrev--select-buffers'." + (interactive "sSearch string: ") + (let ((buffers (dabbrev--select-buffers))) + (multi-occur buffers search-string))) + +;; Example usage: +;; Why are these weird characters appearing in my completions? +(search-in-dabbrev-buffers "\342\200\231") +#+end_src + * Frequently asked questions /This module has no FAQs yet./ [[doom-suggest-faq:][Ask one?]] diff --git a/modules/completion/corfu/config.el b/modules/completion/corfu/config.el index 475894fa5..7cd7b5173 100644 --- a/modules/completion/corfu/config.el +++ b/modules/completion/corfu/config.el @@ -55,8 +55,10 @@ use the minibuffer such as `query-replace'.") corfu-count 16 corfu-max-width 120 corfu-on-exact-match nil - corfu-quit-at-boundary (if (modulep! +orderless) 'separator t) - corfu-quit-no-match (if (modulep! +orderless) 'separator t) + corfu-quit-at-boundary (if (or (modulep! :completion vertico) + (modulep! +orderless)) + 'separator t) + corfu-quit-no-match corfu-quit-at-boundary tab-always-indent 'complete) (add-to-list 'completion-category-overrides `(lsp-capf (styles ,@completion-styles))) (add-to-list 'corfu-auto-commands #'lispy-colon) diff --git a/modules/completion/corfu/packages.el b/modules/completion/corfu/packages.el index cf45a992f..3c0e58714 100644 --- a/modules/completion/corfu/packages.el +++ b/modules/completion/corfu/packages.el @@ -5,8 +5,12 @@ (package! cape :pin "a397a0c92de38277b7f835fa999fac400a764908") (when (modulep! +icons) (package! nerd-icons-corfu :pin "7077bb76fefc15aed967476406a19dc5c2500b3c")) -(when (modulep! +orderless) - (package! orderless :pin "b24748093b00b37c3a572c4909f61c08fa27504f")) +(when (and (not (modulep! :completion vertico)) + (modulep! +orderless)) + ;; enabling +orderless without vertico should be fairly niche enough that to + ;; save contributor headaches we should only pin vertico's orderless and leave + ;; this one unpinned + (package! orderless)) (when (modulep! :os tty) (package! corfu-terminal :pin "501548c3d51f926c687e8cd838c5865ec45d03cc")) (when (modulep! :editor snippets) diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index d48e0e3a6..098e01835 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -83,6 +83,9 @@ orderless." ((string= "!" pattern) `(orderless-literal . "")) ;; Without literal ((string-prefix-p "!" pattern) `(orderless-without-literal . ,(substring pattern 1))) + ;; Annotation + ((string-prefix-p "&" pattern) `(orderless-annotation . ,(substring pattern 1))) + ((string-suffix-p "&" pattern) `(orderless-annotation . ,(substring pattern 0 -1))) ;; Character folding ((string-prefix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 1))) ((string-suffix-p "%" pattern) `(char-fold-to-regexp . ,(substring pattern 0 -1))) @@ -202,7 +205,8 @@ orderless." ("C-x C-j" . consult-dir-jump-file)) :config (when (modulep! :tools docker) - ;; TODO Replace with `tramp-container--completion-function' when we drop support for <29 + ;; TODO: Replace with `tramp-container--completion-function' when we drop + ;; support for <29 (defun +vertico--consult-dir-container-hosts (host) "Get a list of hosts from HOST." (cl-loop for line in (cdr @@ -210,10 +214,7 @@ orderless." (apply #'process-lines +vertico-consult-dir-container-executable (append +vertico-consult-dir-container-args (list "ps"))))) for cand = (split-string line "[[:space:]]+" t) - collect (let ((user (unless (string-empty-p (car cand)) - (concat (car cand) "@"))) - (hostname (car (last cand)))) - (format "/%s:%s%s:/" host user hostname)))) + collect (format "/%s:%s:/" host (car (last cand))))) (defun +vertico--consult-dir-podman-hosts () (let ((+vertico-consult-dir-container-executable "podman")) @@ -230,7 +231,7 @@ orderless." :face consult-file :history file-name-history :items ,#'+vertico--consult-dir-podman-hosts) - "Podman candiadate source for `consult-dir'.") + "Podman candidate source for `consult-dir'.") (defvar +vertico--consult-dir-source-tramp-docker `(:name "Docker" @@ -239,7 +240,7 @@ orderless." :face consult-file :history file-name-history :items ,#'+vertico--consult-dir-docker-hosts) - "Docker candiadate source for `consult-dir'.") + "Docker candidate source for `consult-dir'.") (add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-podman t) (add-to-list 'consult-dir-sources '+vertico--consult-dir-source-tramp-docker t)) diff --git a/modules/lang/julia/packages.el b/modules/lang/julia/packages.el index 5892896be..410dc62b9 100644 --- a/modules/lang/julia/packages.el +++ b/modules/lang/julia/packages.el @@ -1,13 +1,13 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/julia/packages.el -(package! julia-mode :pin "7a8c868e0d3e51ba4a2c621ee22ca9599e0e4bbb") +(package! julia-mode :pin "2dfc869ff6b3878407fe7226669dfaae8d38d541") (package! julia-repl :pin "4947319bc948b3f80d61b0d65a719737275949b8") (when (modulep! +lsp) (if (modulep! :tools lsp +eglot) - (package! eglot-jl :pin "7dc604fe42a459a987853d065cd6d0f3c4cbc02a") + (package! eglot-jl :pin "1d9cab682380f37ca1e9e9933cda13164600706d") (package! lsp-julia :pin "c869b2f6c05a97e5495ed3cc6710a33b4faf41a2"))) (when (modulep! +snail) - (package! julia-snail :pin "d36653bb938050cfabbe3c1ea6d4575071085577")) + (package! julia-snail :pin "a25ce847480a0c2bed24fad3f1ee62904c9c93a5")) diff --git a/modules/tools/lsp/+eglot.el b/modules/tools/lsp/+eglot.el index 8bf7ed20f..a020a00c1 100644 --- a/modules/tools/lsp/+eglot.el +++ b/modules/tools/lsp/+eglot.el @@ -4,7 +4,7 @@ :commands eglot eglot-ensure :hook (eglot-managed-mode . +lsp-optimization-mode) :init - (defadvice! +eglot--ensure-available-mode (fn) + (defadvice! +eglot--ensure-available-mode-a (fn) "Run `eglot-ensure' if the current mode has support." :around #'eglot-ensure (when (alist-get major-mode eglot-server-programs nil nil @@ -15,7 +15,6 @@ (funcall fn))) (setq eglot-sync-connect 1 eglot-autoshutdown t - eglot-send-changes-idle-time 0.5 ;; NOTE: We disable eglot-auto-display-help-buffer because :select t in ;; its popup rule causes eglot to steal focus too often. eglot-auto-display-help-buffer nil) @@ -44,8 +43,8 @@ (defadvice! +lsp--defer-server-shutdown-a (fn &optional server) "Defer server shutdown for a few seconds. This gives the user a chance to open other project files before the server is -auto-killed (which is a potentially expensive process). It also prevents the -server getting expensively restarted when reverting buffers." +auto-killed (which is a potentially expensive process). It also spares the +server an expensive restart when its buffer is reverted." :around #'eglot--managed-mode (letf! (defun eglot-shutdown (server) (if (or (null +lsp-defer-shutdown)