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

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

[elpa] externals/kiwix 04347e6 137/192: turn a request part into a separ


From: Stefan Monnier
Subject: [elpa] externals/kiwix 04347e6 137/192: turn a request part into a separate function
Date: Sat, 19 Dec 2020 00:41:48 -0500 (EST)

branch: externals/kiwix
commit 04347e6a76ca4fad32e5a0150d805af6df0467ff
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>

    turn a request part into a separate function
---
 kiwix.el | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index 5a13694..22552e9 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -180,14 +180,8 @@
 (defvar kiwix-server-available? nil
   "The kiwix-server current available?")
 
-;;;###autoload
-(defun kiwix-at-point (&optional interactively)
-  "Search for the symbol at point with `kiwix-query'.
-
-Or When prefix argument `INTERACTIVELY' specified, then prompt
-for query string and library interactively."
-  (interactive "P")
-  ;; ping kiwix-serve generally to make sure server available.
+(defun kiwix-ping-server ()
+  "Ping Kiwix server to set `kiwix-server-available?' global state variable."
   (request kiwix-server-url
            :type "GET"
            :sync t
@@ -195,7 +189,16 @@ for query string and library interactively."
            :success (function* (lambda (&key data &allow-other-keys)
                                  (setq kiwix-server-available? t)))
            :error (function* (lambda (&rest args &key error-thrown 
&allow-other-keys)
-                               (setq kiwix-server-available? nil))))
+                               (setq kiwix-server-available? nil)))))
+
+;;;###autoload
+(defun kiwix-at-point (&optional interactively)
+  "Search for the symbol at point with `kiwix-query'.
+
+Or When prefix argument `INTERACTIVELY' specified, then prompt
+for query string and library interactively."
+  (interactive "P")
+  (kiwix-ping-server)
   (if kiwix-server-available?
       (let* ((library (if (or kiwix-search-interactively interactively)
                           (kiwix-select-library)



reply via email to

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