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

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

[elpa] externals/consult 663bfbcb96 4/4: consult--multi: Improve backwar


From: ELPA Syncer
Subject: [elpa] externals/consult 663bfbcb96 4/4: consult--multi: Improve backward compatibility
Date: Tue, 19 Apr 2022 06:57:23 -0400 (EDT)

branch: externals/consult
commit 663bfbcb968a3b3918be2d8cd4c41b31d237b08c
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult--multi: Improve backward compatibility
    
    Remove consult--multi-new-fallback
---
 consult.el | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/consult.el b/consult.el
index d88ce696ba..cf3d157f24 100644
--- a/consult.el
+++ b/consult.el
@@ -2306,15 +2306,7 @@ INHERIT-INPUT-METHOD, if non-nil the minibuffer inherits 
the input method."
                          (consult--multi-source sources cand)
                        (aref sources 0))))
         (cons (if tofu (substring cand 0 -1) cand)
-              `(:action
-                ,(or (plist-get source :new)
-                     (apply-partially #'consult--multi-new-fallback
-                                      (plist-get source :category)))
-                ,@source))))))
-
-(defun consult--multi-new-fallback (cat cand)
-  "Fallback for new CAND of CAT for sources which do not specify a :new 
function."
-  (message "Cannot create new %s `%s'" cat cand))
+              `(:new t :action ,(plist-get source :new) ,@source))))))
 
 (defun consult--multi-candidates (sources)
   "Return `consult--multi' candidates from SOURCES."
@@ -2395,9 +2387,10 @@ options are supported: :require-match, :history, 
:keymap, :initial,
 be overwritten only in special scenarios.
 
 The function returns the selected candidate in the form (cons candidate
-source-value). The sources of the source list can either be symbols of source
-variables or source values. Source values must be plists with the following
-fields:
+source-plist). For non-existing candidates the plist contains the entry
+`:new t'. The sources of the source list can either be symbols of source
+variables or source values. Source values must be plists with the
+following fields:
 
 Required source fields:
 * :category - Completion category.



reply via email to

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