[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 85c3a05 03/10: Use same initial input for Ivy and
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 85c3a05 03/10: Use same initial input for Ivy and Helm and extract the login into function |
Date: |
Wed, 30 Dec 2020 16:32:21 -0500 (EST) |
branch: externals/kiwix
commit 85c3a054a243474c85e7f2351384455ac60c3542
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: stardiviner <numbchild@gmail.com>
Use same initial input for Ivy and Helm and extract the login into function
---
kiwix.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/kiwix.el b/kiwix.el
index 44c0cfd..b044d6e 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -261,15 +261,22 @@ list and return a list result."
(data (request-response-data
(let ((inhibit-message t))
(request ajax-url
- :type "GET"
- :sync t
- :headers '(("Content-Type" . "application/json"))
- :parser #'json-read
- :success (cl-function
- (lambda (&key data &allow-other-keys)
- data)))))))
+ :type "GET"
+ :sync t
+ :headers '(("Content-Type" . "application/json"))
+ :parser #'json-read
+ :success (cl-function
+ (lambda (&key data &allow-other-keys)
+ data)))))))
(if (vectorp data) (mapcar 'cdar data)))))
+(defun kiwix--get-thing-at-point ()
+ "Get region select text or symbol at point."
+ (if mark-active
+ (buffer-substring
+ (region-beginning) (region-end))
+ (thing-at-point 'symbol)))
+
;;;###autoload
(defun kiwix-at-point ()
"Search for the symbol at point with `kiwix-query'."
@@ -287,7 +294,7 @@ list and return a list result."
`(lambda (input)
(apply 'kiwix-ajax-search-hints
input
`(,kiwix--selected-library))))
- :input (word-at-point)
+ :input (kiwix--get-thing-at-point)
:buffer "*helm kiwix completion candidates*"))
('ivy
(ivy-read "Kiwix related entries: "
@@ -296,10 +303,7 @@ list and return a list result."
input
`(,kiwix--selected-library)))
:predicate nil
:require-match nil
- :initial-input (if mark-active
- (buffer-substring
- (region-beginning)
(region-end))
- (thing-at-point 'symbol))
+ :initial-input (kiwix--get-thing-at-point)
:preselect nil
:def nil
:history nil
- [elpa] externals/kiwix updated (3e1275d -> e3b9b50), Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix b6e2189 09/10: Update kiwix.el commentary about Kiwix installation, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 42209ba 01/10: bump version to 1.0.1, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix e3b9b50 10/10: declare helm, ivy functions to fix byte-compiler warnings, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 88d7b5b 08/10: Fix compilation error: functions are not known to be defined, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 86c163c 06/10: Many syntax etc minor fixes, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 64ca93a 05/10: remove un-necessary the append t argument, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 601757e 07/10: Add declaration on README about package is GPLv3 licensed, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 85c3a05 03/10: Use same initial input for Ivy and Helm and extract the login into function,
Stefan Monnier <=
- [elpa] externals/kiwix 0acfd6a 04/10: Remove un-necessary autoload cookies, improve config of org-kiwix, Stefan Monnier, 2020/12/30
- [elpa] externals/kiwix 207eb5f 02/10: Fix .zim files matching in candidates, Stefan Monnier, 2020/12/30