From e27c37944f6171692061e2fd8e75d84416f3b022 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Thu, 28 Apr 2022 11:41:57 +0200 Subject: cape-dabbrev: Accept all matches --- cape.el | 17 +++++++---------- 1 file 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) -- cgit v1.0