[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape 8643892a6d 066/146: Minor refactoring
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape 8643892a6d 066/146: Minor refactoring |
Date: |
Sun, 9 Jan 2022 20:57:43 -0500 (EST) |
branch: externals/cape
commit 8643892a6dc95cdd8969fb066515a67efb75f544
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Minor refactoring
---
cape.el | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/cape.el b/cape.el
index ba9288309d..9945f3b168 100644
--- a/cape.el
+++ b/cape.el
@@ -310,9 +310,13 @@
(defun cape--complete-thing (thing table extra)
"Complete THING at point given completion TABLE and EXTRA properties."
- (let ((bounds (or (bounds-of-thing-at-point thing) (cons (point) (point))))
- (completion-extra-properties extra))
- (completion-in-region (car bounds) (cdr bounds) table)))
+ (let ((bounds (or (bounds-of-thing-at-point thing) (cons (point) (point)))))
+ (cape--complete (car bounds) (cdr bounds) table extra)))
+
+(defun cape--complete (beg end table extra)
+ "Complete between BEG and END given completion TABLE and EXTRA properties."
+ (let ((completion-extra-properties extra))
+ (completion-in-region beg end table)))
(cl-defun cape--table-with-properties (table &key category (sort t))
"Create completion TABLE with properties.
@@ -480,9 +484,9 @@ SORT should be nil to disable sorting."
(defun cape-ispell ()
"Complete with Ispell at point."
(interactive)
- (let ((bounds (or (bounds-of-thing-at-point 'word) (cons (point) (point))))
- (completion-extra-properties cape--ispell-properties))
- (completion-in-region (car bounds) (cdr bounds) (cape--ispell-table
bounds))))
+ (let ((bounds (or (bounds-of-thing-at-point 'word) (cons (point) (point)))))
+ (cape--complete (car bounds) (cdr bounds) (cape--ispell-table bounds)
+ cape--ispell-properties)))
(defvar cape--dict-properties
(list :annotation-function (lambda (_) " Dict")
@@ -710,6 +714,9 @@ VALID is the input comparator, see `cape--input-valid-p'."
(complete-with-action action table str pred)))
,@plist)))))
+(defvar cape--line-properties nil
+ "Completion extra properties for `cape-line'.")
+
;;;###autoload
(defun cape-line ()
"Complete current line from other lines in buffer."
@@ -729,8 +736,9 @@ VALID is the input comparator, see `cape--input-valid-p'."
(puthash line t ht)
(push line lines))))
(setq beg (1+ end))))
- (completion-in-region (line-beginning-position) (point)
- (cape--table-with-properties (nreverse lines) :sort
nil))))
+ (cape--complete (line-beginning-position) (point)
+ (cape--table-with-properties (nreverse lines) :sort nil)
+ cape--line-properties)))
;;;###autoload
(defun cape-capf-with-properties (capf &rest properties)
- [elpa] externals/cape 0bdc6ae05c 034/146: README: Mention cape-capf-buster, (continued)
- [elpa] externals/cape 0bdc6ae05c 034/146: README: Mention cape-capf-buster, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 8fd6c17a01 033/146: Add cape-capf-buster, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 90ad5d68d5 037/146: Extract cape--cached-table, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 04a332c5fe 036/146: Extract cape--input-changed-p, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 882b9d9e79 042/146: Rename cape-merge-capfs, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 9111ad5101 043/146: Ensure that dabbrev is initialized properly, ELPA Syncer, 2022/01/09
- [elpa] externals/cape af4268549c 055/146: Dabbrev: Use equality check, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 29f828cc82 061/146: Reorder, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 80ca6abfd5 063/146: Add cape-line, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 52c86daf8c 062/146: Version 0.2, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 8643892a6d 066/146: Minor refactoring,
ELPA Syncer <=
- [elpa] externals/cape 0fdbf4f5c3 073/146: cape-line: Implement capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 16ef21309b 076/146: Improve cape-dabbrev, ELPA Syncer, 2022/01/09
- [elpa] externals/cape edb2be3b71 092/146: Version 0.3, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 08877dbf75 096/146: Improve comments, ELPA Syncer, 2022/01/09
- [elpa] externals/cape b5485b8878 031/146: cape-ispell-capf: Compute candidates later, ELPA Syncer, 2022/01/09
- [elpa] externals/cape dc26e9f7ab 049/146: cape-dict-capf: Load the dict lazily, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 2bcdd7bfe5 052/146: cape-file-capf: Require directory as prefix (Fix #9), ELPA Syncer, 2022/01/09
- [elpa] externals/cape 673b086dae 056/146: Annotate abbreviations with expansion, ELPA Syncer, 2022/01/09
- [elpa] externals/cape 6ff72e5253 067/146: Unify cape-ispell and cape-ispell-capf, ELPA Syncer, 2022/01/09
- [elpa] externals/cape d3e4d152ac 024/146: Add cape-symbol, ELPA Syncer, 2022/01/09