[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix edd8458 1/7: Make external library elquery option
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix edd8458 1/7: Make external library elquery optional |
Date: |
Wed, 11 Aug 2021 15:58:43 -0400 (EDT) |
branch: externals/kiwix
commit edd84586be5ad1d530dfdde4544cc23131badf1d
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
Make external library elquery optional
---
kiwix.el | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/kiwix.el b/kiwix.el
index 5761f02..d715180 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -7,7 +7,7 @@
;; Homepage: https://github.com/stardiviner/kiwix.el
;; Created: 23th July 2016
;; Version: 1.1.0
-;; Package-Requires: ((emacs "24.4") (request "0.3.0") (elquery "0.1.0"))
+;; Package-Requires: ((emacs "24.4") (request "0.3.0"))
;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
@@ -61,7 +61,6 @@
(require 'subr-x)
(require 'thingatpt)
(require 'json)
-(require 'elquery)
(declare-function helm "helm")
(declare-function helm-build-async-source "helm")
@@ -156,21 +155,25 @@ Set it to ‘t’ will use Emacs built-in ‘completing-read’."
:type "GET"
:sync t
:parser (lambda ()
- (let ((html (elquery-read-string
(buffer-substring-no-properties (point-min) (point-max)))))
- (setq kiwix-libraries
- (mapcar
- ;; remove "/" from "/<zim_library_name>"
- (lambda (slash_library)
- (substring slash_library 1 nil))
- ;; extract plist values. list of
"/<zim_library_name>"
- (mapcar 'cadr
- ;; extract nodes properties in plist
- (mapcar #'elquery-props
- ;; return a list of elquery nodes
- (elquery-children
- ;; return the <div
class="book__list">
- (car (elquery-$ ".book__list"
html)))))))
- (elquery-children (first (elquery-$ ".book__list" html)))))
+ (if (not (featurep 'elquery))
+ (print "PLACEHOLDER: use libxml by default")
+ (require 'elquery)
+ (let ((html (elquery-read-string
+ (buffer-substring-no-properties (point-min)
(point-max)))))
+ (setq kiwix-libraries
+ (mapcar
+ ;; remove "/" from "/<zim_library_name>"
+ (lambda (slash_library)
+ (substring slash_library 1 nil))
+ ;; extract plist values. list of
"/<zim_library_name>"
+ (mapcar 'cadr
+ ;; extract nodes properties in plist
+ (mapcar #'elquery-props
+ ;; return a list of elquery nodes
+ (elquery-children
+ ;; return the <div
class="book__list">
+ (car (elquery-$ ".book__list"
html)))))))
+ (elquery-children (first (elquery-$ ".book__list"
html))))))
:error (cl-function
(lambda (&rest args &key error-thrown &allow-other-keys)
(message "Function kiwix-get-libraries error.")))
- [elpa] externals/kiwix updated (71e770c -> 7d6039f), Stefan Monnier, 2021/08/11
- [elpa] externals/kiwix 5616b66 6/7: Merge pull request #6 from zonuexe/patch-1, Stefan Monnier, 2021/08/11
- [elpa] externals/kiwix 801c924 2/7: Make elquery optional by use Emacs built-in library libxml and dom, Stefan Monnier, 2021/08/11
- [elpa] externals/kiwix edd8458 1/7: Make external library elquery optional,
Stefan Monnier <=
- [elpa] externals/kiwix 5f9cff3 5/7: Activate embedded HTML, Stefan Monnier, 2021/08/11
- [elpa] externals/kiwix 33cfe42 4/7: Use cond structure is better, Stefan Monnier, 2021/08/11
- [elpa] externals/kiwix 7d6039f 7/7: Fix org-kiwix void function incompatible which is behind API upgrade, Stefan Monnier, 2021/08/11
- [elpa] externals/kiwix 4f04ffd 3/7: Error: You should depend on (emacs "25.1") if you need ‘dom’., Stefan Monnier, 2021/08/11