[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 5f60388 181/192: update kiwix-server-url everytim
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 5f60388 181/192: update kiwix-server-url everytime used |
Date: |
Sat, 19 Dec 2020 00:41:56 -0500 (EST) |
branch: externals/kiwix
commit 5f6038856a9cfa0d19afc3c8af73d933fda95b72
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
update kiwix-server-url everytime used
---
kiwix.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kiwix.el b/kiwix.el
index 9c9c145..df65c8e 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -176,6 +176,11 @@ Like in function `kiwix-ajax-search-hints'.")
:type 'kbd
:group 'kiwix-mode)
+;; update kiwix server url and port
+(defun kiwix-server-url-update ()
+ "Update `kiwix-server-url' everytime used. In case setting port is lated."
+ (setq kiwix-server-url (format "http://127.0.0.1:%s" kiwix-server-port)))
+
;; launch Kiwix server
;;;###autoload
(defun kiwix-launch-server ()
@@ -202,6 +207,7 @@ Like in function `kiwix-ajax-search-hints'.")
(defun kiwix-query (query &optional selected-library)
"Search `QUERY' in `LIBRARY' with Kiwix."
+ (kiwix-server-url-update)
(let* ((library (or selected-library (kiwix--get-library-name
kiwix-default-library)))
(url (concat kiwix-server-url "/search?content=" library "&pattern="
(url-hexify-string query)))
(browse-url-browser-function kiwix-default-browser-function))
@@ -224,6 +230,7 @@ Like in function `kiwix-ajax-search-hints'.")
(kiwix-docker-check)
(async-shell-command "docker pull kiwix/kiwix-serve"))
(let ((inhibit-message t))
+ (kiwix-server-url-update)
(request kiwix-server-url
:type "GET"
:sync t
@@ -243,7 +250,7 @@ Like in function `kiwix-ajax-search-hints'.")
(defun kiwix-ajax-search-hints (input &optional selected-library)
"Instantly AJAX request to get available Kiwix entry keywords
list and return a list result."
- (when input
+ (kiwix-server-url-update)
(let* ((library (or selected-library
(kiwix--get-library-name (or kiwix--selected-library
kiwix-default-library))))
- [elpa] externals/kiwix f11e8fb 167/192: support more web browsers, (continued)
- [elpa] externals/kiwix f11e8fb 167/192: support more web browsers, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix fbd00ab 170/192: select library every time you query because Docker container use libraries index, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d5e5780 173/192: fix GitHub Org Mode inline image display format, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix e2933785 174/192: add autoload cookie for kiwix.el Org link functions, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 0155c9a 177/192: rename org-link functions, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 57d6f5c 178/192: migrate Org Mode link support to separate source code file, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 36b15f3c 179/192: add kiwix.el load in README, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 2011a9f 183/192: update package config in README, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix dd02284 185/192: fix free variable `kiwix-response', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix f5d7a2f 180/192: support Org Mode link :complete property function, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5f60388 181/192: update kiwix-server-url everytime used,
Stefan Monnier <=
- [elpa] externals/kiwix 4bdf16b 188/192: smarter `kiwix-org-get-library' detect existing library in link, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6878b7d 182/192: add condition to detect kiwix server is available when get search hints, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix cb3e253 190/192: Merge pull request #2 from syohex/syohex/warnings, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 15fd8fa 191/192: use hook to auto setup org-kiwix link type, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix ddeecd1 186/192: fix void org link functions by autoload, Stefan Monnier, 2020/12/19