[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 43e0547 083/192: Merge branch 'release/v0.6.0'
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 43e0547 083/192: Merge branch 'release/v0.6.0' |
Date: |
Sat, 19 Dec 2020 00:41:38 -0500 (EST) |
branch: externals/kiwix
commit 43e05477ad4633bbc2582f7491071e186f3986cd
Merge: 6fb8354 9d16244
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
Merge branch 'release/v0.6.0'
---
README.org | 1 +
kiwix.el | 32 +++++++++++++++++++++-----------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/README.org b/README.org
index a7824e5..f1e4799 100644
--- a/README.org
+++ b/README.org
@@ -84,3 +84,4 @@ The =(library)= can be =wikipedia_en=, =wikipedia_zh=,
=wiktionary_en=, or =en=,
- [[wiki:Operations%20Research][Operations Research]] :: query contains space.
- [[wiki:Operations%20research][Operations research]] :: the second word is
not capitalized.
- [[wiki:%E4%B8%AD%E5%9B%BD][中国]] :: non-english query
+- [[wiki:meta-circular%20interpreter][meta-circular interpreter]] :: only
capitalize the first word.
diff --git a/kiwix.el b/kiwix.el
index 3adc442..d5211b7 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -122,7 +122,9 @@
(cdr (assoc abbr kiwix-libraries-abbrev-alist)))
(defcustom kiwix-default-library "wikipedia_en_all"
- "The default kiwix library when library fragment in link not specified.")
+ "The default kiwix library when library fragment in link not specified."
+ :type 'string
+ :group 'kiwix)
;; add default key-value pair to libraries alist.
(dolist
@@ -134,6 +136,11 @@
(push cons kiwix-libraries-abbrev-alist)
)
+(defcustom kiwix-your-language-library "zh"
+ "Specify the library for your navtive language."
+ :type 'string
+ :group 'kiwix)
+
;; test
;; (kiwix-get-library-fullname "wikipedia_en")
;; (kiwix-get-library-fullname "default")
@@ -239,19 +246,23 @@ for query string and library interactively."
;; - group 2: link? (match everything but ], space, tab, carriage return,
linefeed by using [^] \n\t\r]*)
;; for open wiki search query with local application database.
+(defun kiwix-org-get-library ()
+ "Get library from Org-mode link."
+ (if (string-match-p "[a-zA-Z\ ]+" (match-string 2 link)) ; validate query is
English
+ ;; convert between libraries full name and abbrev.
+ (kiwix-get-library-fullname (or (match-string 1 link)
+ "default"))
+ ;; validate query is non-English
+ (kiwix-get-library-fullname kiwix-your-language-library)
+ )
+ )
+
(defun org-wiki-link-open (link)
"Open LINK in external wiki program."
;; The regexp: (library):query
;; - query : should not exclude space
(when (string-match "\\(?:(\\(.*\\)):\\)?\\([^]\n\t\r]*\\)" link) ;
(library):query
- (let* (
- (library (if (string-match-p "[a-zA-Z\ ]+" (match-string 2 link)) ;
validate query is English
- ;; convert between libraries full name and abbrev.
- (kiwix-get-library-fullname (or (match-string 1 link)
- "default"))
- ;; validate query is non-English
- (kiwix-get-library-fullname "zh")
- ))
+ (let* ((library (kiwix-org-get-library))
(query (match-string 2 link))
(url (concat
kiwix-server-url
@@ -271,8 +282,7 @@ for query string and library interactively."
(defun org-wiki-link-export (link description format)
"Export the wiki LINK with DESCRIPTION for FORMAT from Org files."
(when (string-match "\\(?:(\\(.*\\)):\\)?\\([^] \n\t\r]*\\)" link)
- (let* ((library (or (match-string 1 link)
- (kiwix-get-library-fullname "default")))
+ (let* ((library (kiwix-org-get-library))
(query (url-encode-url (or (match-string 2 link) description)))
;; "http://en.wikipedia.org/wiki/Linux"
;; --
- [elpa] externals/kiwix 49fdf02 079/192: add custom option for specifying your native language library, (continued)
- [elpa] externals/kiwix 49fdf02 079/192: add custom option for specifying your native language library, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5cba3b5 081/192: add a test for only capitalize the first word, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 4102205 086/192: load for `org-link-set-parameters', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 7b8a799 088/192: Merge tag 'void-function_org-link-set-parameters' into develop, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix e600844 089/192: fix kiwix does not contain group., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 121d98a 093/192: fix void function org-link-set-parameters., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 686bac6 068/192: fix query validating regexp, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 47d968a 069/192: update add org-mode link functions to Org-mode 9.0, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 3dab002 077/192: only capitalize the first word of string., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6fb8354 078/192: Merge branch 'release/v0.5.2', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 43e0547 083/192: Merge branch 'release/v0.6.0',
Stefan Monnier <=
- [elpa] externals/kiwix 6a7fc40 097/192: Merge branch 'hotfix/void-function-org-link-set-parameters-2', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 2ab63c9 098/192: Merge tag 'void-function-org-link-set-parameters-2' into develop, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 6e43812 102/192: fix void functions by adding autoload cookies., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 5aa6c3a 105/192: `string-empty-p` depends on (emacs "24.4"), Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 86dbead 107/192: add a helper function to detect kiwix profile directory accessible., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 44a44cb 110/192: autoload org related functions, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix f7535e0 112/192: format code, remove dangling parentheses, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 183b133 114/192: update usage comments, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 658038e 113/192: fix kiwix libraries data structure duplicate when re-evaluate., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 30559cc 116/192: add option for specifying default library, Stefan Monnier, 2020/12/19