[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape 3c44bff1f6 095/146: Minor refactoring
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape 3c44bff1f6 095/146: Minor refactoring |
Date: |
Sun, 9 Jan 2022 20:57:45 -0500 (EST) |
branch: externals/cape
commit 3c44bff1f6afb9b16e4e5e6c16affe0ca97c0d6b
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Minor refactoring
---
cape.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/cape.el b/cape.el
index f1e0404ae5..792306c3fb 100644
--- a/cape.el
+++ b/cape.el
@@ -320,6 +320,18 @@
(completion-in-region beg end table (plist-get extra :predicate))))
(_ (user-error "%s: No completions" capf))))
+(defun cape--noninterruptible-table (table)
+ "Create non-interruptible completion TABLE."
+ (lambda (str pred action)
+ (let (throw-on-input)
+ (complete-with-action action table str pred))))
+
+(defun cape--silent-table (table)
+ "Create a new completion TABLE which is silent (no messages, no errors)."
+ (lambda (str pred action)
+ (cape--silent
+ (complete-with-action action table str pred))))
+
(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.
@@ -836,27 +848,19 @@ The PREDICATE is passed the candidate symbol or string."
;;;###autoload
(defun cape-silent-capf (capf)
- "Return a new CAPF which is silent (no messages, no errors)."
+ "Create a new CAPF which is silent (no messages, no errors)."
(lambda ()
(pcase (cape--silent (funcall capf))
(`(,beg ,end ,table . ,plist)
- `(,beg ,end
- ,(lambda (str pred action)
- (cape--silent
- (complete-with-action action table str pred)))
- ,@plist)))))
+ `(,beg ,end ,(cape--silent-table table) ,@plist)))))
;;;###autoload
(defun cape-noninterruptible-capf (capf)
- "Return a new CAPF which is non-interruptible silent by input."
+ "Create a new CAPF which is non-interruptible silent by input."
(lambda ()
(pcase (let (throw-on-input) (funcall capf))
(`(,beg ,end ,table . ,plist)
- `(,beg ,end
- ,(lambda (str pred action)
- (let (throw-on-input)
- (complete-with-action action table str pred)))
- ,@plist)))))
+ `(,beg ,end ,(cape--noninterruptible-table table) ,@plist)))))
;;;###autoload
(defun cape-interactive-capf (capf)
- [elpa] externals/cape 202345e954 083/146: cape-capf-with-properties: Add support for :sort and :category, (continued)
- [elpa] externals/cape 202345e954 083/146: cape-capf-with-properties: Add support for :sort and :category, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 15491cef1a 087/146: Add link to Emacs, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 659f710682 089/146: Add comment, ELPA Syncer, 2022/01/09
- [elpa] externals/cape ceca3a3d06 077/146: Expand readme, ELPA Syncer, 2022/01/09
- [elpa] externals/cape c57b01e982 091/146: Improve dynamic table support of cape-super-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 7008958b02 078/146: Minor corrections, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 9e4651649b 094/146: Treat company backends as non-interruptible., ELPA Syncer, 2022/01/09
- [elpa] externals/cape c7feeee10b 080/146: Simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 02c9629bc6 081/146: Refactor and simplify, ELPA Syncer, 2022/01/09
- [elpa] externals/cape d3d9d926ac 082/146: Add cape-interactive-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 3c44bff1f6 095/146: Minor refactoring,
ELPA Syncer <=
- [elpa] externals/cape e341f81a79 098/146: README: Add emoji example, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b06e3271e0 099/146: README: Be more precise about supported completion tables, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b612af5754 101/146: Capf query should always be interruptible, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 15279b57fa 103/146: Remove todo, ELPA Syncer, 2022/01/09
- [elpa] externals/cape dcb5a139c4 105/146: Add cape-capf-with-case-fold, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 4cd6cdd4a2 106/146: Respect ignore-case for company backends, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b8776afc9f 107/146: Add cape-dabbrev-check-other-buffers, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b52829ad6d 110/146: Add comments, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 26d6025da2 111/146: Minor adjustments, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 5e6abb568a 113/146: Rename capf function in analogy to the table function, ELPA Syncer, 2022/01/09