[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape e5e11f30f0: cape-file: Mark completion table as no
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape e5e11f30f0: cape-file: Mark completion table as non-essential |
Date: |
Mon, 14 Feb 2022 06:57:20 -0500 (EST) |
branch: externals/cape
commit e5e11f30f0b6ed0a2b283d5d3dec84bcd36557fc
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
cape-file: Mark completion table as non-essential
---
cape.el | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/cape.el b/cape.el
index 4c7e40054e..b91d5813d3 100644
--- a/cape.el
+++ b/cape.el
@@ -352,6 +352,15 @@
(cape--silent
(complete-with-action action table str pred))))
+(defun cape--nonessential-table (table)
+ "Mark completion TABLE as `non-essential'."
+ (lambda (str pred action)
+ (let ((non-essential t))
+ (let ((result (funcall table str pred action)))
+ (when (and (eq action 'completion--unquote) (functionp (cadr result)))
+ (cl-callf cape--nonessential-table (cadr result)))
+ result))))
+
(cl-defun cape--table-with-properties (table &key category (sort t)
&allow-other-keys)
"Create completion TABLE with properties.
CATEGORY is the optional completion category.
@@ -416,13 +425,15 @@ VALID is the input comparator, see `cape--input-valid-p'."
If INTERACTIVE is nil the function acts like a capf."
(interactive (list t))
(if interactive
- (let (cape-file-directory-must-exist)
+ (let ((cape-file-directory-must-exist))
(cape--interactive #'cape-file))
(let* ((bounds (cape--bounds 'filename))
+ (non-essential t)
(file (buffer-substring (car bounds) (cdr bounds))))
(when (or (not cape-file-directory-must-exist)
(and (string-match-p "/" file) (file-exists-p
(file-name-directory file))))
- `(,(car bounds) ,(cdr bounds) ,#'read-file-name-internal
+ `(,(car bounds) ,(cdr bounds)
+ ,(cape--nonessential-table #'read-file-name-internal)
,@(and (not (equal file "/")) (string-suffix-p "/" file)
'(:company-prefix-length t))
:exclusive no ,@cape--file-properties)))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] externals/cape e5e11f30f0: cape-file: Mark completion table as non-essential,
ELPA Syncer <=