emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/cape ecd5864bcf 2/3: Configurable capf exclusivity


From: ELPA Syncer
Subject: [elpa] externals/cape ecd5864bcf 2/3: Configurable capf exclusivity
Date: Fri, 29 Apr 2022 14:57:19 -0400 (EDT)

branch: externals/cape
commit ecd5864bcf3ffa93d5d2a2c01ea0772672cfe4be
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Configurable capf exclusivity
---
 cape.el | 35 +++++++++++++++++++++--------------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/cape.el b/cape.el
index 114c55dca8..f920407db1 100644
--- a/cape.el
+++ b/cape.el
@@ -190,7 +190,8 @@ VALID is the input comparator, see `cape--input-valid-p'."
 (declare-function ring-elements "ring")
 
 (defvar cape--history-properties
-  (list :company-kind (lambda (_) 'text))
+  (list :company-kind (lambda (_) 'text)
+        :exclusive 'no)
   "Completion extra properties for `cape-history'.")
 
 (defun cape-history (&optional interactive)
@@ -212,13 +213,14 @@ If INTERACTIVE is nil the function acts like a capf."
       (when history
         `(,(line-beginning-position) ,(point)
           ,(cape--table-with-properties history :sort nil)
-          :exclusive no ,@cape--history-properties)))))
+          ,@cape--history-properties)))))
 
 ;;;;; cape-file
 
 (defvar cape--file-properties
   (list :annotation-function (lambda (s) (if (string-suffix-p "/" s) " Folder" 
" File"))
-        :company-kind (lambda (s) (if (string-suffix-p "/" s) 'folder 'file)))
+        :company-kind (lambda (s) (if (string-suffix-p "/" s) 'folder 'file))
+        :exclusive 'no)
   "Completion extra properties for `cape-file'.")
 
 ;;;###autoload
@@ -239,13 +241,14 @@ If INTERACTIVE is nil the function acts like a capf."
           ,(cape--nonessential-table #'read-file-name-internal)
           ,@(and (not (equal file "/")) (string-suffix-p "/" file)
                  '(:company-prefix-length t))
-          :exclusive no ,@cape--file-properties)))))
+          ,@cape--file-properties)))))
 
 ;;;;; cape-symbol
 
 (defvar cape--symbol-properties
   (list :annotation-function #'cape--symbol-annotation
-        :company-kind #'cape--symbol-kind)
+        :company-kind #'cape--symbol-kind
+        :exclusive 'no)
   "Completion extra properties for `cape-symbol'.")
 
 (defun cape--symbol-kind (sym)
@@ -282,13 +285,14 @@ If INTERACTIVE is nil the function acts like a capf."
         (setq beg (1+ beg) end (max beg end)))
       `(,beg ,end
         ,(cape--table-with-properties obarray :category 'symbol)
-        :exclusive no ,@cape--symbol-properties))))
+        ,@cape--symbol-properties))))
 
 ;;;;; cape-dabbrev
 
 (defvar cape--dabbrev-properties
   (list :annotation-function (lambda (_) " Dabbrev")
-        :company-kind (lambda (_) 'text))
+        :company-kind (lambda (_) 'text)
+        :exclusive 'no)
   "Completion extra properties for `cape-dabbrev'.")
 
 (defvar dabbrev-check-all-buffers)
@@ -319,7 +323,7 @@ If INTERACTIVE is nil the function acts like a capf."
                                 ;; Problem is that when entering more input, 
candidates get lost!
                                 'prefix)
             :category 'cape-dabbrev)
-          :exclusive no ,@cape--dabbrev-properties)))))
+          ,@cape--dabbrev-properties)))))
 
 (defun cape--dabbrev-list (word)
   "Find all dabbrev expansions for WORD."
@@ -336,7 +340,8 @@ If INTERACTIVE is nil the function acts like a capf."
 
 (defvar cape--ispell-properties
   (list :annotation-function (lambda (_) " Ispell")
-        :company-kind (lambda (_) 'text))
+        :company-kind (lambda (_) 'text)
+        :exclusive 'no)
   "Completion extra properties for `cape-ispell'.")
 
 (declare-function ispell-lookup-words "ispell")
@@ -358,13 +363,14 @@ If INTERACTIVE is nil the function acts like a capf."
         ,(cape--table-with-properties
           (cape--cached-table (car bounds) (cdr bounds) #'cape--ispell-words 
'substring)
           :category 'cape-ispell)
-        :exclusive no ,@cape--ispell-properties))))
+        ,@cape--ispell-properties))))
 
 ;;;;; cape-dict
 
 (defvar cape--dict-properties
   (list :annotation-function (lambda (_) " Dict")
-        :company-kind (lambda (_) 'text))
+        :company-kind (lambda (_) 'text)
+        :exclusive 'no)
   "Completion extra properties for `cape-dict'.")
 
 (defvar cape--dict-words nil)
@@ -388,7 +394,7 @@ If INTERACTIVE is nil the function acts like a capf."
     (let ((bounds (cape--bounds 'word)))
       `(,(car bounds) ,(cdr bounds)
         ,(cape--table-with-properties (cape--dict-words) :category 'cape-dict)
-        :exclusive no ,@cape--dict-properties))))
+        ,@cape--dict-properties))))
 
 ;;;;; cape-abbrev
 
@@ -423,7 +429,8 @@ If INTERACTIVE is nil the function acts like a capf."
 (defvar cape--abbrev-properties
   (list :annotation-function #'cape--abbrev-annotation
         :exit-function #'cape--abbrev-exit
-        :company-kind (lambda (_) 'snippet))
+        :company-kind (lambda (_) 'snippet)
+        :exclusive 'no)
   "Completion extra properties for `cape-abbrev'.")
 
 ;;;###autoload
@@ -439,7 +446,7 @@ If INTERACTIVE is nil the function acts like a capf."
       (let ((bounds (cape--bounds 'symbol)))
         `(,(car bounds) ,(cdr bounds)
           ,(cape--table-with-properties abbrevs :category 'cape-abbrev)
-          :exclusive no ,@cape--abbrev-properties)))))
+          ,@cape--abbrev-properties)))))
 
 ;;;;; cape-line
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]