[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 634b5ae 061/192: enhance function kiwix-query to
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 634b5ae 061/192: enhance function kiwix-query to support space between strings. |
Date: |
Sat, 19 Dec 2020 00:41:33 -0500 (EST) |
branch: externals/kiwix
commit 634b5ae0d1c79d8b3f1c0a34a8737ad9dea1b4a5
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
enhance function kiwix-query to support space between strings.
---
kiwix.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/kiwix.el b/kiwix.el
index bac104a..3865f96 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -164,7 +164,12 @@
(let* ((kiwix-library (if library
library
(kiwix-get-library-fullname "default")))
- (url (concat kiwix-server-url kiwix-library "/A/" (url-encode-url
(capitalize query)) ".html")))
+ (url (concat kiwix-server-url kiwix-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 " " "_" (capitalize query)
nil nil))
+ ".html")))
(browse-url url)))
;;;###autoload
@@ -234,11 +239,13 @@ for query string and library interactively."
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 (capitalize query))
+ (url-encode-url
+ ;; convert space to underline: "Beta distribution"
"Beta_distribution"
+ (replace-regexp-in-string " " "_"
+ (capitalize query) nil nil))
".html")))
;; (prin1 (format "library: %s, query: %s, url: %s" library query url))
- (browse-url url))
- ))
+ (browse-url url))))
(defun org-wiki-link-export (link description format)
"Export the wiki LINK with DESCRIPTION for FORMAT from Org files."
- [elpa] externals/kiwix 9774c61 040/192: update elisp link matching regexp, (continued)
- [elpa] externals/kiwix 9774c61 040/192: update elisp link matching regexp, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix c09f7ad 041/192: optimize open link function, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6e6959b 045/192: improve custom options, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 90ac73a 046/192: update README declaration, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix f6a5f4c 048/192: Merge tag 'v0.4.0' into develop, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 160b228 049/192: fix cl-lib version, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 90658b7 050/192: support old format library name, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5bfc5a2 053/192: support more flexible library name, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d5e1ad0 057/192: add config section comments., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 38986bb 058/192: Merge branch 'release/v0.4.3', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 634b5ae 061/192: enhance function kiwix-query to support space between strings.,
Stefan Monnier <=
- [elpa] externals/kiwix ec62ab0 063/192: Merge branch 'release/v0.5.0', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix a11fcd4 064/192: remove org-mode link prefix setup, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 74ce07a 065/192: fix query invalid when the query contains space, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6e85607 066/192: validate query is english or non-english., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix c325402 012/192: fix add kiwix link abbrev to org-mode list, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5f60967 013/192: use browse-url to replace custom browser custom, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 53f2b72 008/192: add file kiwix-at-point.el, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 06ad0af 009/192: remove duplicate function names, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6d7bc71 010/192: change default Kiwix library, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 126b172 015/192: update defgroup and defcustom, Stefan Monnier, 2020/12/19