[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 15fd8fa 191/192: use hook to auto setup org-kiwix
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 15fd8fa 191/192: use hook to auto setup org-kiwix link type |
Date: |
Sat, 19 Dec 2020 00:41:58 -0500 (EST) |
branch: externals/kiwix
commit 15fd8fad3b252363818ff9338e7fb4811955ac89
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
use hook to auto setup org-kiwix link type
---
README.org | 15 ++++++---------
org-kiwix.el | 11 +++++++++--
2 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/README.org b/README.org
index 7a38bfc..ccf1369 100644
--- a/README.org
+++ b/README.org
@@ -78,18 +78,15 @@
https://chrome.google.com/webstore/detail/kiwix/donaljnlmapmngakoipdmehbfcioahhk
** MELPA
-#+begin_src org
-,#+begin_src emacs-lisp :eval no
+#+begin_src emacs-lisp :eval no
(use-package kiwix
- ;; :ensure t
- :load-path "~/Code/Emacs/kiwix.el/"
+ :ensure t
:after org
:commands (kiwix-launch-server kiwix-at-point-interactive)
- :bind (:map document-prefix ("w" . kiwix-at-point-interactive))
- :init (setq kiwix-server-use-docker t
- kiwix-server-port 8080
- kiwix-default-library "wikipedia_zh_all_2015-11.zim"))
-,#+end_src
+ :custom ((kiwix-server-use-docker t)
+ (kiwix-server-port 8089)
+ (kiwix-default-library "wikipedia_en_all_2016-02.zim"))
+ :hook (org-load . org-kiwix-setup-link))
#+end_src
* Setup
diff --git a/org-kiwix.el b/org-kiwix.el
index 34bf511..f824a05 100644
--- a/org-kiwix.el
+++ b/org-kiwix.el
@@ -1,6 +1,6 @@
;;; org-kiwix.el --- Org Mode link support -*- lexical-binding: t; -*-
-;;; Time-stamp: <2020-07-11 17:39:13 stardiviner>
+;;; Time-stamp: <2020-08-20 11:55:13 stardiviner>
;;; Commentary:
@@ -22,6 +22,10 @@
;; - 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.
+;; Usage:
+;;
+;; (add-hook 'org-load-hook #'org-kiwix-setup-link)
+
;;; Code:
(require 'kiwix)
@@ -35,6 +39,7 @@
t
nil))
+;;;###autoload
(defun kiwix-org-get-library (link)
"Get library from Org-mode `LINK'."
(let ((library (catch 'args-out-of-range
@@ -109,6 +114,7 @@
:description query)
link)))
+;;;###autoload
(defun org-wikipedia-complete-link (&optional arg)
"Use kiwix AJAX request to provide available completion keywords."
(let* ((query (or arg (read-from-minibuffer "Search keyword: ")))
@@ -119,7 +125,8 @@
(completing-read "Available keywords: " keywords))))
;;;###autoload
-(with-eval-after-load 'org
+(defun org-kiwix-setup-link ()
+ "Setup Org link for org-kiwix."
(org-link-set-parameters "wikipedia" ; NOTE: use `wikipedia' for future
backend changing.
:follow #'org-wikipedia-open-link
:store #'org-wikipedia-store-link
- [elpa] externals/kiwix 0155c9a 177/192: rename org-link functions, (continued)
- [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, 2020/12/19
- [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 <=
- [elpa] externals/kiwix ddeecd1 186/192: fix void org link functions by autoload, Stefan Monnier, 2020/12/19