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

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

[elpa] externals/kiwix 5b5b117 163/192: improve the kiwix-query URL to u


From: Stefan Monnier
Subject: [elpa] externals/kiwix 5b5b117 163/192: improve the kiwix-query URL to use the search API
Date: Sat, 19 Dec 2020 00:41:53 -0500 (EST)

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

    improve the kiwix-query URL to use the search API
---
 kiwix.el | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/kiwix.el b/kiwix.el
index 4711d45..cd2d2a3 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -195,17 +195,7 @@ Like in function `kiwix-ajax-search-hints'.")
 (defun kiwix-query (query &optional selected-library)
   "Search `QUERY' in `LIBRARY' with Kiwix."
   (let* ((library (or selected-library (kiwix--get-library-name 
kiwix-default-library)))
-         (url (concat
-               kiwix-server-url "/" library "/A/"
-               ;; query need to be convert to URL encoding: "禅宗" 
https://zh.wikipedia.org/wiki/%E7%A6%85%E5%AE%97
-               (url-encode-url
-                ;; convert space to underline: "Beta distribution" 
"Beta_distribution"
-                (replace-regexp-in-string
-                 " " "_"
-                 ;; only capitalize the first word. like: "meta-circular 
interpreter" -> "Meta-circular interpreter"
-                 (kiwix-capitalize-first query)
-                 nil nil))
-               ".html"))
+         (url (concat kiwix-server-url "/search?content=" library "&pattern=" 
(url-hexify-string query)))
          (browse-url-browser-function kiwix-default-browser-function))
     (browse-url url)))
 



reply via email to

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