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

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

[elpa] externals/kiwix 5990cc7 022/192: improve query function to specif


From: Stefan Monnier
Subject: [elpa] externals/kiwix 5990cc7 022/192: improve query function to specify library
Date: Sat, 19 Dec 2020 00:41:25 -0500 (EST)

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

    improve query function to specify library
---
 kiwix.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index 5a9d144..e138aa6 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -24,6 +24,11 @@
 (defgroup kiwix nil
   "Kiwix customization options.")
 
+(defcustom kiwix-server-url "http://127.0.0.1:8000/";
+  "Specify Kiwix server URL."
+  :type 'string
+  :group 'kiwix)
+
 (defcustom kiwix-server-command "/usr/lib/kiwix/bin/kiwix-serve "
   "Specify kiwix server command."
   :type 'string
@@ -69,11 +74,12 @@
      (concat kiwix-server-command library port daemon library-path))))
 
 
-(defun kiwix-query (query)
-  "Search `QUERY' with Kiwix."
-  (let* ((kiwix-server "http://127.0.0.1:8000/";)
-         (kiwix-library kiwix-default-library)
-         (url (concat kiwix-server kiwix-library "/A/" (capitalize query) 
".html")))
+(defun kiwix-query (query &optional library)
+  "Search `QUERY' in `LIBRARY' with Kiwix."
+  (let* ((kiwix-library (if library
+                            library
+                          kiwix-default-library))
+         (url (concat kiwix-server-url kiwix-library "/A/" (capitalize query) 
".html")))
     (browse-url url)))
 
 ;;;###autoload



reply via email to

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