summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-10-29 10:37:33 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-10-29 10:37:33 +0100
commit0e14d8bcac6ee324d1fc2164b5d501ce966e93b5 (patch)
tree7eaa9371830570f9d256898d1539f1c3c58159ce
parentbee13e568d42ffec9010fbf795e8f942973da174 (diff)
Rename internal function for consistency
-rw-r--r--cape-char.el2
-rw-r--r--cape-keyword.el2
-rw-r--r--cape.el32
3 files changed, 19 insertions, 17 deletions
diff --git a/cape-char.el b/cape-char.el
index ff82444..7c0a292 100644
--- a/cape-char.el
+++ b/cape-char.el
@@ -126,7 +126,7 @@ function acts like a Capf." method method)
((not ,pre-req) (cons (point) (point))))))
(append
(list (car bounds) (cdr bounds)
- (cape--table-with-properties ,hash :category ',capf))
+ (cape--properties-table ,hash :category ',capf))
,props)))))))
;;;###autoload (autoload 'cape-tex "cape-char" nil t)
diff --git a/cape-keyword.el b/cape-keyword.el
index 48a8015..775f652 100644
--- a/cape-keyword.el
+++ b/cape-keyword.el
@@ -407,7 +407,7 @@ If INTERACTIVE is nil the function acts like a capf."
(when-let (keywords (cape--keyword-list))
(let ((bounds (cape--bounds 'symbol)))
`(,(car bounds) ,(cdr bounds)
- ,(cape--table-with-properties keywords :category 'cape-keyword)
+ ,(cape--properties-table keywords :category 'cape-keyword)
,@cape--keyword-properties)))))
(provide 'cape-keyword)
diff --git a/cape.el b/cape.el
index fa4b43f..54a9ba4 100644
--- a/cape.el
+++ b/cape.el
@@ -258,7 +258,7 @@ NAME is the name of the Capf, BEG and END are the input markers."
(cape--debug-print result)))
result)))
-(cl-defun cape--table-with-properties (table &key category (sort t) &allow-other-keys)
+(cl-defun cape--properties-table (table &key category (sort t) &allow-other-keys)
"Create completion TABLE with properties.
CATEGORY is the optional completion category.
SORT should be nil to disable sorting."
@@ -356,7 +356,7 @@ See also `consult-history' for a more flexible variant based on
(setq history (ring-elements history)))
(when history
`(,bol ,(point)
- ,(cape--table-with-properties history :sort nil)
+ ,(cape--properties-table history :sort nil)
,@cape--history-properties)))))
;;;;; cape-file
@@ -466,7 +466,7 @@ If INTERACTIVE is nil the function acts like a Capf."
(when (eq (char-after beg) ?')
(setq beg (1+ beg) end (max beg end)))
`(,beg ,end
- ,(cape--table-with-properties obarray :category 'symbol)
+ ,(cape--properties-table obarray :category 'symbol)
,@cape--symbol-properties))))
;;;;; cape-elisp-block
@@ -564,7 +564,7 @@ See the user options `cape-dabbrev-min-length' and
(cape-interactive '((cape-dabbrev-min-length 0)) #'cape-dabbrev)
(when-let ((bounds (cape--dabbrev-bounds)))
`(,(car bounds) ,(cdr bounds)
- ,(cape--table-with-properties
+ ,(cape--properties-table
(completion-table-case-fold
(cape--dynamic-table (car bounds) (cdr bounds) #'cape--dabbrev-list)
(not (cape--case-fold-p dabbrev-case-fold-search)))
@@ -613,7 +613,7 @@ INTERACTIVE is nil the function acts like a Capf."
(cape-interactive #'cape-dict)
(pcase-let ((`(,beg . ,end) (cape--bounds 'word)))
`(,beg ,end
- ,(cape--table-with-properties
+ ,(cape--properties-table
(completion-table-case-fold
(cape--dynamic-table beg end #'cape--dict-list)
(not (cape--case-fold-p cape-dict-case-fold)))
@@ -670,7 +670,7 @@ If INTERACTIVE is nil the function acts like a Capf."
(when-let (abbrevs (cape--abbrev-list))
(let ((bounds (cape--bounds 'symbol)))
`(,(car bounds) ,(cdr bounds)
- ,(cape--table-with-properties abbrevs :category 'cape-abbrev)
+ ,(cape--properties-table abbrevs :category 'cape-abbrev)
,@cape--abbrev-properties)))))
;;;;; cape-line
@@ -717,7 +717,7 @@ If INTERACTIVE is nil the function acts like a Capf."
(if interactive
(cape-interactive #'cape-line)
`(,(pos-bol) ,(point)
- ,(cape--table-with-properties (cape--line-list) :sort nil)
+ ,(cape--properties-table (cape--line-list) :sort nil)
,@cape--line-properties)))
;;;; Capf combinators
@@ -788,7 +788,7 @@ changed. The function `cape-company-to-capf' is experimental."
(if (cape--company-call backend 'ignore-case)
#'completion-table-case-fold
#'identity)
- (cape--table-with-properties
+ (cape--properties-table
(cape--dynamic-table
beg end
(lambda (input)
@@ -918,13 +918,15 @@ meaningful debugging output."
(setq name (format "%s@%s" name (cl-incf cape--debug-id)))
(pcase (funcall capf)
(`(,beg ,end ,table . ,plist)
- (let* (completion-ignore-case completion-regexp-list
- (limit (1+ cape--debug-length))
+ (let* ((limit (1+ cape--debug-length))
(pred (plist-get plist :predicate))
- (cands (all-completions
- "" table
- (lambda (&rest args)
- (and (or (not pred) (apply pred args)) (>= (cl-decf limit) 0)))))
+ (cands
+ ;; Reset regexps for `all-completions'
+ (let (completion-ignore-case completion-regexp-list)
+ (all-completions
+ "" table
+ (lambda (&rest args)
+ (and (or (not pred) (apply pred args)) (>= (cl-decf limit) 0))))))
(plist-str "")
(plist-elt plist))
(while (cdr plist-elt)
@@ -993,7 +995,7 @@ completion :category symbol can be specified."
(pcase (funcall capf)
(`(,beg ,end ,table . ,plist)
`(,beg ,end
- ,(apply #'cape--table-with-properties table properties)
+ ,(apply #'cape--properties-table table properties)
,@properties ,@plist))))
;;;###autoload