[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 1861f27 134/192: replace simple url-retrieve-sync
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 1861f27 134/192: replace simple url-retrieve-synchronously with library request.el |
Date: |
Sat, 19 Dec 2020 00:41:47 -0500 (EST) |
branch: externals/kiwix
commit 1861f27674eb376cc0e2b84c1b5545e0fec28d79
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
replace simple url-retrieve-synchronously with library request.el
---
kiwix.el | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/kiwix.el b/kiwix.el
index 896bd98..8e4c80d 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -7,7 +7,7 @@
;; URL: https://github.com/stardiviner/kiwix.el
;; Created: 23th July 2016
;; Version: 1.0.0
-;; Package-Requires: ((emacs "24.4") (cl-lib "0.5"))
+;; Package-Requires: ((emacs "24.4") (cl-lib "0.5") (request "0.3.0"))
;;; Commentary:
@@ -37,6 +37,7 @@
(require 'cl-lib)
+(require 'request)
(autoload 'org-link-set-parameters "org")
(autoload 'org-store-link-props "org")
@@ -187,13 +188,14 @@ 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.
- (if (> (length
- (with-temp-buffer
- (url-retrieve-synchronously kiwix-server-url)
- (buffer-string)))
- 1)
- (setq kiwix-server-available? nil)
- (setq kiwix-server-available? t))
+ (request kiwix-server-url
+ :type "GET"
+ :sync t
+ :parser (lambda () (libxml-parse-html-region (point-min)
(point-max)))
+ :success (function* (lambda (&key data &allow-other-keys)
+ (setq kiwix-server-available? t)))
+ :error (lambda (&rest args &key error-thrown &allow-other-keys)
+ (setq kiwix-server-available? nil)))
(if kiwix-server-available?
(let* ((library (if (or kiwix-search-interactively interactively)
(kiwix-select-library)
- [elpa] externals/kiwix 39b96cb 119/192: let kiwix-launch-server support start Docker container, (continued)
- [elpa] externals/kiwix 39b96cb 119/192: let kiwix-launch-server support start Docker container, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 4b093e0 128/192: add autoload cookies for some necessary functions, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix c662f3d 129/192: roll the version to release, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5fbf5bc 141/192: use symbol under point or region text as initial input for Ivy, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d4d5ee0 149/192: Add an option for user to specify default browse-url function., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix ca3f70b 150/192: fix URL construct part missing slash., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 885a6c5 166/192: set kiwix-serve not started no response error handling, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 33e8cbb 106/192: fix functions docstring., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix aea0901 125/192: simplify Org kiwix link select library logic, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 878b02b 131/192: remove autoload cookies for Org link commands, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 1861f27 134/192: replace simple url-retrieve-synchronously with library request.el,
Stefan Monnier <=
- [elpa] externals/kiwix 8d5e53c 138/192: add query string related wikipedia entries through kiwix AJAX instantly search, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 87c1246 139/192: simplify kiwix read input, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix cc6a8df 140/192: implement instantly async completion backend with Ivy, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix b185775 143/192: fix hardcoded `kiwix-ajax-search-hints` API URL, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 32ad2cb 148/192: update Org Mode name, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d2065a1 152/192: fix default browse-url variable name, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 4082292 155/192: provide a helper function to refresh available kiwix libraries, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 7e18994 158/192: add a custom option for kiwix default libraries path, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 4243689 156/192: check whether Docker image "kiwix/kiwix-serve" is available, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d7c4778 162/192: select library require matched in candidates, Stefan Monnier, 2020/12/19