From 8a272e686074b41dcf3f336932681b4ac3e56e69 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 20 May 2022 03:07:03 +0100 Subject: completion: trying vertico for completion-in-region for a while --- completion.org | 16 +++++++++++----- notmuch.org | 6 +++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/completion.org b/completion.org index 8d7467a..c1fd686 100644 --- a/completion.org +++ b/completion.org @@ -171,9 +171,8 @@ (bound-and-true-p vertico--input)) (corfu-mode 1))) - (add-hook 'minibuffer-setup-hook #'corfu-in-minibuffer 1) - - (global-corfu-mode 1) + ;; (add-hook 'minibuffer-setup-hook #'corfu-in-minibuffer 1) + ;; (global-corfu-mode 1) #+end_src * vertico @@ -187,6 +186,14 @@ org-refile-use-outline-path t) :config + ;; Use `consult-completion-in-region' if Vertico is enabled. + ;; Otherwise use the default `completion--in-region' function. + (setq completion-in-region-function + (lambda (&rest args) + (apply (if vertico-mode + #'consult-completion-in-region + #'completion--in-region) + args))) (defun jao-vertico--display-candidates (lines) (move-overlay vertico--candidates-ov (point-min) (point-min)) @@ -201,8 +208,7 @@ :bind (:map vertico-map (("RET" . vertico-directory-enter) ("M-" . vertico-directory-delete-word) ("" . vertico-directory-delete-char)))) - - (vertico-mode) + (vertico-mode) #+end_src * consult diff --git a/notmuch.org b/notmuch.org index 971f53c..340a114 100644 --- a/notmuch.org +++ b/notmuch.org @@ -63,7 +63,7 @@ (defvar jao-notmuch--shared-tags '("new" "unread" "flagged" "signed" "sent" "attachment" "forwarded" - "encrypted" "gmane" "feeds" "rss" "mce" "trove" "prog" "emacs")) + "encrypted" "gmane" "gnus" "feeds" "rss" "mce" "trove" "prog" "emacs")) (defun jao-notmuch--subtags (tag &rest excl) (let* ((cmd (concat "notmuch search --output=tags tag:" tag)) @@ -132,11 +132,11 @@ '("tag:jao" "date:24h.." "not tag:\"/(feeds|spam|local)/\"")) ,(jao-notmuch--q "jao" "flagged" "rj" '("tag:flagged" "tag:jao")) - ,(jao-notmuch--q "jao" "drafts" "d" '("tag:draft")) ,(jao-notmuch--q "feeds" "flagged" "rf" '("tag:flagged" "tag:feeds")))) (defvar jao-notmuch-new-searches - `(,(jao-notmuch--q "new" nil "nn" '("tag:new" "not tag:draft")) + `(,(jao-notmuch--q "jao" "drafts" "d" '("tag:draft")) + ,(jao-notmuch--q "new" nil "nn" '("tag:new" "not tag:draft")) ,(jao-notmuch--q "unread" nil "nu" '("tag:unread")) (:query "*" :name "messages"))) -- cgit v1.2.3