[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 5516cff: Use pcase-let*
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vertico 5516cff: Use pcase-let* |
Date: |
Sat, 29 May 2021 23:57:16 -0400 (EDT) |
branch: externals/vertico
commit 5516cff8bea2451eb4623954641998a206b86100
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Use pcase-let*
---
vertico.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/vertico.el b/vertico.el
index 19f3019..c5782e6 100644
--- a/vertico.el
+++ b/vertico.el
@@ -260,16 +260,15 @@
(defun vertico--recompute-candidates (pt content bounds metadata)
"Recompute candidates given PT, CONTENT, BOUNDS and METADATA."
- (let* ((field (substring content (car bounds) (+ pt (cdr bounds))))
- ;; `minibuffer-completing-file-name' has been obsoleted by the
completion category
- (completing-file (eq 'file (completion-metadata-get metadata
'category)))
- (all-hl (vertico--all-completions content
- minibuffer-completion-table
- minibuffer-completion-predicate
- pt metadata))
- (all (car all-hl))
- (base (or (when-let (z (last all)) (prog1 (cdr z) (setcdr z nil))) 0))
- (def (or (car-safe minibuffer-default) minibuffer-default)))
+ (pcase-let* ((field (substring content (car bounds) (+ pt (cdr bounds))))
+ ;; `minibuffer-completing-file-name' has been obsoleted by the
completion category
+ (completing-file (eq 'file (completion-metadata-get metadata
'category)))
+ (`(,all . ,hl) (vertico--all-completions content
+
minibuffer-completion-table
+
minibuffer-completion-predicate
+ pt metadata))
+ (base (or (when-let (z (last all)) (prog1 (cdr z) (setcdr z
nil))) 0))
+ (def (or (car-safe minibuffer-default) minibuffer-default)))
;; Filter the ignored file extensions. We cannot use modified predicate
for this filtering,
;; since this breaks the special casing in the
`completion-file-name-table' for `file-exists-p'
;; and `file-directory-p'.
@@ -289,7 +288,7 @@
(setq all (vertico--move-to-front field all))
(when-let (group-fun (completion-metadata-get metadata 'group-function))
(setq all (vertico--group-by group-fun all)))
- (list base (length all) all (cdr all-hl))))
+ (list base (length all) all hl)))
(defun vertico--group-by (fun elems)
"Group ELEMS by FUN."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/vertico 5516cff: Use pcase-let*,
ELPA Syncer <=