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

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

[elpa] externals/kiwix 3b73980 12/13: Add Emacs built-in completing-read


From: Stefan Monnier
Subject: [elpa] externals/kiwix 3b73980 12/13: Add Emacs built-in completing-read support
Date: Mon, 4 Jan 2021 01:12:53 -0500 (EST)

branch: externals/kiwix
commit 3b73980bea4a81002174966262a1efeac4dd7593
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: stardiviner <numbchild@gmail.com>

    Add Emacs built-in completing-read support
---
 kiwix.el | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index f73dfd3..91ee4e5 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -120,9 +120,11 @@
   :safe #'stringp)
 
 (defcustom kiwix-default-completing-read (cond ((fboundp 'ivy-read) 'ivy)
-                                               ((fboundp 'helm) 'helm))
+                                               ((fboundp 'helm) 'helm)
+                                               (t t))
   "Kiwix default completion frontend.
-Currently Ivy (`ivy') and Helm (`helm') both supported."
+Currently Ivy (`ivy') and Helm (`helm') both supported.
+Set it to ‘t’ will use Emacs built-in ‘completing-read’."
   :type 'symbol
   :safe #'symbolp)
 
@@ -323,7 +325,17 @@ list and return a list result."
                                    :update-fn 'auto
                                    :sort t
                                    :dynamic-collection t
-                                   :caller 'ivy-done)))))
+                                   :caller 'ivy-done))
+                        (_
+                         (completing-read
+                          "Kiwix related entries: "
+                          ;; FIXME: This needs work!
+                          (completion-table-dynamic
+                           (lambda (input)
+                             (apply #'kiwix-ajax-search-hints
+                                    input `(,kiwix--selected-library))))
+                          nil nil
+                          (kiwix--get-thing-at-point))))))
           (message (format "library: %s, query: %s" library query))
           (if (or (null library)
                   (string-empty-p library)



reply via email to

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