branch: externals/kiwix
commit 38986bb58715b90976053bb431c16353b9c78a69
Merge: f1554ba d5e1ad0
Author: stardiviner <numbch...@gmail.com>
Commit: stardiviner <numbch...@gmail.com>

    Merge branch 'release/v0.4.3'
---
 kiwix.el | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/kiwix.el b/kiwix.el
index d0b6fcf..bac104a 100644
--- a/kiwix.el
+++ b/kiwix.el
@@ -17,6 +17,13 @@
 ;;
 ;; http://www.kiwix.org
 
+;;; Config:
+;;
+;; (define-key my-prog-help-document-map (kbd "w") 'kiwix-at-point)
+;; (define-key my-prog-help-document-map (kbd "W") 'kiwix-at-point-interactive)
+;; (define-key my-prog-help-document-map (kbd "C-w") 'kiwix-launch-server)
+
+
 ;;; Usage:
 ;;
 ;; [M-x kiwix-launch-server] to launch Kiwix server.
@@ -183,9 +190,19 @@ for query string and library interactively."
                          (region-beginning) (region-end))
                       (thing-at-point 'symbol))))))
     (message (format "library: %s, query: %s" library query))
-    (kiwix-query query library)))
+    (if (or (null library)
+            (string-empty-p library)
+            (null query)
+            (string-empty-p query))
+        (error "Your query is invalid")
+      (kiwix-query query library))))
 
 
+;;;###autoload
+(defun kiwix-at-point-interactive ()
+  (interactive)
+  (let ((current-prefix-arg t))
+    (call-interactively 'kiwix-at-point)))
 
 ;;; Support Org-mode
 ;;

Reply via email to