[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vertico 1522d9a 07/11: Extract vertico--file-predicate
From: |
Protesilaos Stavrou |
Subject: |
[elpa] externals/vertico 1522d9a 07/11: Extract vertico--file-predicate |
Date: |
Thu, 8 Apr 2021 07:11:16 -0400 (EDT) |
branch: externals/vertico
commit 1522d9a34fa92f3b6dd74465b38094c82961f412
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Extract vertico--file-predicate
---
vertico.el | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/vertico.el b/vertico.el
index 0a23876..a5790e7 100644
--- a/vertico.el
+++ b/vertico.el
@@ -233,18 +233,22 @@
(nconc (list head) (delq head list))
list))
+(defun vertico--file-predicate ()
+ "Filter predicate for files."
+ (let ((ignore (concat "\\(?:\\`\\|/\\)\\.?\\./\\'"
+ (and completion-ignored-extensions
+ (concat "\\|" (regexp-opt
completion-ignored-extensions) "\\'")))))
+ (if-let (pred minibuffer-completion-predicate)
+ (lambda (x) (and (not (string-match-p ignore x)) (funcall pred x)))
+ (lambda (x) (not (string-match-p ignore x))))))
+
(defun vertico--recompute-candidates (input metadata)
"Recompute candidates with INPUT string and METADATA."
- (let* ((ignore-re (concat "\\(?:\\`\\|/\\)\\.?\\./\\'"
- (and completion-ignored-extensions
- (concat "\\|" (regexp-opt
completion-ignored-extensions) "\\'"))))
- (all (completion-all-completions
+ (let* ((all (completion-all-completions
input
minibuffer-completion-table
(if minibuffer-completing-file-name
- (if-let (pred minibuffer-completion-predicate)
- (lambda (x) (and (not (string-match-p ignore-re x))
(funcall pred x)))
- (lambda (x) (not (string-match-p ignore-re x))))
+ (vertico--file-predicate)
minibuffer-completion-predicate)
(- (point) (minibuffer-prompt-end))
metadata))
- [elpa] externals/vertico updated (1a9b1b2 -> 82ed224), Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico d65eeac 04/11: vertico--recompute-candidates: Move exact input and default to front, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico ee77886 01/11: Expand README, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico c734b0f 02/11: Minor simplification and docstring updates, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico d9bb816 09/11: README: Mention a few more useful configurations, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 403e154 05/11: Fix #2 - Screenshot background, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico edf6a06 08/11: Do not always overwrite resize-mini-windows (See #5), Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico bf76000 06/11: Rename vertico--pred to vertico--sort-predicate, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 1522d9a 07/11: Extract vertico--file-predicate,
Protesilaos Stavrou <=
- [elpa] externals/vertico 953ff1e 10/11: README: Document keymap, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico 82ed224 11/11: Package: Remove license header in order to fix the ELPA linter, Protesilaos Stavrou, 2021/04/08
- [elpa] externals/vertico a68f4cf 03/11: vertico--format-candidates: Only add space for point if eobp, Protesilaos Stavrou, 2021/04/08