[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 648916d 154/192: add option to set Kiwix default
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 648916d 154/192: add option to set Kiwix default completing-read framework, default is Ivy. |
Date: |
Sat, 19 Dec 2020 00:41:51 -0500 (EST) |
branch: externals/kiwix
commit 648916d4cb0d368db6ff3ffd13d57688606e0f6b
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
add option to set Kiwix default completing-read framework, default is Ivy.
---
kiwix.el | 52 ++++++++++++++++++++++++++++++++++------------------
1 file changed, 34 insertions(+), 18 deletions(-)
diff --git a/kiwix.el b/kiwix.el
index b31a6d1..ab87164 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -98,6 +98,12 @@
:type 'string
:group 'kiwix-mode)
+(defcustom kiwix-default-completing-read 'ivy
+ "Kiwix default completion frontend. Currently Ivy ('ivy) and Helm ('helm)
both supported."
+ :type 'symbol
+ :safe #'symbolp
+ :group 'kiwix-mode)
+
(defcustom kiwix-default-browser-function browse-url-browser-function
"Set default browser for open kiwix query result URL."
:type 'function
@@ -241,24 +247,34 @@ for query string and library interactively."
(kiwix-select-library)
(kiwix--get-library-name
kiwix-default-library)))
(let* ((library kiwix--selected-library)
- (query (ivy-read "Kiwix related entries: "
- `(lambda (input)
- (apply 'kiwix-ajax-search-hints
- input `(,kiwix--selected-library)))
- :predicate nil
- :require-match nil
- :initial-input (if mark-active
- (buffer-substring
- (region-beginning)
(region-end))
- (thing-at-point 'symbol))
- :preselect nil
- :def nil
- :history nil
- :keymap nil
- :update-fn 'auto
- :sort t
- :dynamic-collection t
- :caller 'ivy-done)))
+ (query (case kiwix-default-completing-read
+ ('helm
+ (helm :source (helm-build-async-source
"kiwix-helm-search-hints"
+ :candidates-process
+ `(lambda (input)
+ (apply 'kiwix-ajax-search-hints
+ input
`(,kiwix--selected-library))))
+ :input (word-at-point)
+ :buffer "*helm kiwix completion candidates*"))
+ ('ivy
+ (ivy-read "Kiwix related entries: "
+ `(lambda (input)
+ (apply 'kiwix-ajax-search-hints
+ input
`(,kiwix--selected-library)))
+ :predicate nil
+ :require-match nil
+ :initial-input (if mark-active
+ (buffer-substring
+ (region-beginning)
(region-end))
+ (thing-at-point 'symbol))
+ :preselect nil
+ :def nil
+ :history nil
+ :keymap nil
+ :update-fn 'auto
+ :sort t
+ :dynamic-collection t
+ :caller 'ivy-done)))))
(message (format "library: %s, query: %s" library query))
(if (or (null library)
(string-empty-p library)
- [elpa] externals/kiwix 04347e6 137/192: turn a request part into a separate function, (continued)
- [elpa] externals/kiwix 04347e6 137/192: turn a request part into a separate function, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix f587833 135/192: make available testing before every query, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6c4d80a 136/192: fix `request' :error sentinel., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5221eda 142/192: silent request result, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 80c0899 144/192: Follow previous commit which can use the select library to construct API URL, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 82140a5 145/192: Make Ivy optional, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 9ee19a0 146/192: silent request flashing echo-area messages flashing., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix ce554ec 147/192: add async search completion keywords candidates screenshot in README, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 013449c 151/192: update image link for GitHub Org Mode link path support., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 1fdcfcc 153/192: add screenshot for kiwix open URL with EWW, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 648916d 154/192: add option to set Kiwix default completing-read framework, default is Ivy.,
Stefan Monnier <=
- [elpa] externals/kiwix eee7cbd 157/192: auto pull download Docker image if it is not available, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix ba929ec 159/192: update Docker run container command, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 2d31741 160/192: auto launch server if ping not available, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 8cc16b1 161/192: no need to select library when use Docker container, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix f11e8fb 167/192: support more web browsers, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix fbd00ab 170/192: select library every time you query because Docker container use libraries index, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d5e5780 173/192: fix GitHub Org Mode inline image display format, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix e2933785 174/192: add autoload cookie for kiwix.el Org link functions, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 0155c9a 177/192: rename org-link functions, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 57d6f5c 178/192: migrate Org Mode link support to separate source code file, Stefan Monnier, 2020/12/19