summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2022-04-28 11:41:57 +0200
committerDaniel Mendler <mail@daniel-mendler.de>2022-04-28 11:41:57 +0200
commite27c37944f6171692061e2fd8e75d84416f3b022 (patch)
treed5ed473663774f8d5cac0a00bac83b66dc7ca003
parent29130e35225fa8e5f5ecc86f2ad2425f7ec3c35d (diff)
cape-dabbrev: Accept all matchesdabbrev-accept-all
-rw-r--r--cape.el17
1 files changed, 7 insertions, 10 deletions
diff --git a/cape.el b/cape.el
index fe03764..afaebe7 100644
--- a/cape.el
+++ b/cape.el
@@ -274,17 +274,14 @@ If INTERACTIVE is nil the function acts like a capf."
(let ((cape-dabbrev-min-length 0))
(cape--interactive #'cape-dabbrev))
(when (thing-at-point-looking-at "\\(?:\\sw\\|\\s_\\)+")
- (let ((beg (match-beginning 0))
- (end (match-end 0)))
+ (let* ((beg (match-beginning 0))
+ (end (match-end 0))
+ (table (cape--table-with-properties
+ (cape--cached-table beg end #'cape--dabbrev-list 'prefix)
+ :category 'cape-dabbrev)))
`(,beg ,end
- ,(cape--table-with-properties
- (cape--cached-table beg end
- #'cape--dabbrev-list
- ;; TODO: Use equal, if candidates must be longer than cape-dabbrev-min-length.
- ;;(if (> cape-dabbrev-min-length 0) 'equal 'prefix)
- ;; Problem is that when entering more input, candidates get lost!
- 'prefix)
- :category 'cape-dabbrev)
+ ,(lambda (str pred action)
+ (or (eq action 'lambda) (funcall table str pred action)))
:exclusive no ,@cape--dabbrev-properties)))))
(defun cape--dabbrev-list (word)