[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/kiwix 8855ac4 060/192: delete deprecated source code fi
From: |
Stefan Monnier |
Subject: |
[elpa] externals/kiwix 8855ac4 060/192: delete deprecated source code files. |
Date: |
Sat, 19 Dec 2020 00:41:33 -0500 (EST) |
branch: externals/kiwix
commit 8855ac45b4d2237f5da5c465080891877e06390e
Author: stardiviner <numbchild@gmail.com>
Commit: stardiviner <numbchild@gmail.com>
delete deprecated source code files.
---
kiwix-at-point.el | 106 ------------------------------------------------------
kiwix-http.el | 94 ------------------------------------------------
2 files changed, 200 deletions(-)
diff --git a/kiwix-at-point.el b/kiwix-at-point.el
deleted file mode 100644
index 5cedef1..0000000
--- a/kiwix-at-point.el
+++ /dev/null
@@ -1,106 +0,0 @@
-;;; kiwix-at-point.el --- Kiwix client for Emacs
-;;; -*- coding: utf-8 -*-
-
-;;; Commentary:
-
-
-
-;;; Code:
-
-(require 'cl-lib)
-
-(defgroup kiwix-at-point nil
- "Search in Kiwix for text at point."
- :group 'external)
-
-(defcustom kiwix-at-point-library-alist
- ;; e.g.
"~/.www.kiwix.org/kiwix/8ip89lik.default/data/index/wikinews_en_all_2015-11.zim.idx"
- '((wikipedia . "")
- (wiktionary . "")
- (wikinews . "")
- (wikibooks . "")
- (wikiquote . "")
- (wikisource . "")
- (wikiversity . "")
- (wikimed . "") ; "WikiMed Medical Encyclopedia" "Wikispecies"
- )
- "Alist which contains available kiwix libraries."
- :type '(repeat 'string)
- :group 'kiwix-at-point)
-
-(defvar kiwix-at-point-library nil
- "Variable used to specify the library for the current search.")
-(make-variable-buffer-local 'kiwix-at-point-library)
-
-(defvar kiwix-at-point--library-history nil)
-
-(defun kiwix-at-point-get-library ()
- "Guess which library suit to the current search."
- (or kiwix-at-point-library
- kiwix-at-point--library-history))
-
-(defun kiwix-at-point-maybe-specify-library (search-string)
- "Prefix SEARCH-STRING with the guessed library, if any."
- (let ((library (kiwix-at-point-get-library)))
- (concat (when library
- (concat library ":"))
- search-string)))
-
-(defun kiwix-at-point-get-idx ()
- "Get the idx file path."
- ;; TODO:
- )
-
-(defun kiwix-at-point-run-search (search)
- (if (executable-find "kiwix")
- ;; TODO:
- (start-process "Kiwix" nil "kiwix-search" (kiwix-at-point-get-idx)
search)
- (message "Kiwix wasn't found, install it first http://www.kiwix.org")))
-
-;;;###autoload
-(defun kiwix-at-point (&optional edit-search)
- "Search for the word at point in Kiwix."
- (interactive "P")
- (let* ((thing (if mark-active
- (buffer-substring (region-beginning) (region-end))
- (thing-at-point 'symbol)))
- (search (kiwix-at-point-maybe-specify-library thing)))
- (kiwix-at-point-run-search
- (if (or edit-search (null thing))
- (read-string "Kiwix search: " search)
- search))))
-
-(defun kiwix-at-point--library-candidates ()
- kiwix-at-point-library-alist)
-
-(defun kiwix-at-point--set-library-prompt ()
- (let ((default-library (kiwix-at-point-get-library)))
- (format "Kiwix library%s: "
- (if default-library
- (format "[Default: %s]" default-library)
- ""))))
-
-;;;###autoload
-(defun kiwix-at-point-set-library ()
- "Set current search's library."
- (interactive)
- (let ((minibuffer-local-completion-map
- (copy-keymap minibuffer-local-completion-map)))
- (define-key minibuffer-local-completion-map (kbd "SPC") nil)
- (setq-local kiwix-at-point-library
- (completing-read (kiwix-at-point--set-library-prompt)
- (kiwix-at-point--library-candidates) nil nil
nil
- 'kiwix-at-point--library-history
(kiwix-at-point-get-library)))))
-
-;;;###autoload
-(defun kiwix-at-point-search (&optional edit-search)
- "Prompt and search in Kiwix."
- (interactive "P")
- (let ((search (kiwix-at-point-maybe-specify-library "")))
- (kiwix-at-point-run-search
- (read-string "Kiwix search: " search))))
-
-
-(provide 'kiwix-at-point)
-
-;;; kiwix-at-point.el ends here
diff --git a/kiwix-http.el b/kiwix-http.el
deleted file mode 100644
index fae7b13..0000000
--- a/kiwix-http.el
+++ /dev/null
@@ -1,94 +0,0 @@
-;;; kiwix-http.el
-;;; -*- coding: utf-8 -*-
-
-;;; Commentary:
-
-
-
-;;; Code:
-
-
-(require 'cl-lib)
-
-;; FIXME:
-;; should use a standard where function to find path.
-;; you may can define a function instead or a constant holding the relative
path, then make use of it when needed.
-(defcustom kiwix-search-command "/usr/lib/kiwix/bin/kiwix-search"
- "The kiwix-search command path."
- :type 'string
- :group 'kiwix
- :safe 'stringp)
-(defcustom kiwix-data-profile-path "~/.www.kiwix.org/kiwix/8ip89lik.default/"
- "The kiwix profile data directory."
- :type 'string
- :group 'kiwix
- :safe 'stringp)
-
-;; TODO: replace `browse-url'
-(defcustom kiwix-browser-function 'browse-url-conkeror
- "Specify browser function to open kiwix search result."
- :type 'function
- :group 'kiwix
- :safe 'functionp)
-
-(defvar kiwix-data-index-path nil)
-
-(setq kiwix-data-index-path (concat kiwix-data-profile-path "data/index/"))
-
-(defun kiwix-serve-index ()
- "Open kiwix HTTP server index page."
- (interactive)
- (browse-url "http://127.0.0.1:8000")
- )
-
-(defun kiwix-libraries ()
- "Get a list of dirs under a specific dir."
- ;; ~/.www.kiwix.org/kiwix/8ip89lik.default/data/content/*.zim
- (let ((libraries
- ;; TODO: use a filter function from cl-lib or dash to replace
`mapcar'.
- (mapcar #'(lambda (file)
- (let ((zim-file (string-match-p ".*\\.zim\\'" file)))
- zim-file))
- (directory-files kiwix-data-index-path)
- )))
- libraries))
-
-(defun kiwix-serve-search (library query)
- "Execute shell command `kiwix-search' on `LIBRARY' with `QUERY'.
-Return a list of results."
-
- ;; TODO: don't use shell-command.
- ;; use execute a process sync/async. check out in Elisp info.
- (let ((search-results (shell-command
- (concat kiwix-search-command " "
- kiwix-data-profile-path kiwix-data-index-path
- library " " query
- " 2> /dev/null"))))
- search-results)
- )
-
-(defun kiwix-serve-query (library)
- "Query kiwix HTTP server in a specific `LIBRARY'."
- (interactive ; FIXME: Don't know where is wrong yet.
- (list (completing-read
- "Kiwix Library: "
- (let (libraries)
- (dolist (elt (kiwix-libraries))
- (setq libraries (append libraries (list (car elt)))))
- libraries))))
-
- (let ((query (read-from-minibuffer "Kiwix Query: "))
- (results (kiwix-search library query))
- (result (interactive
- (list (completing-read
- "select a result to visit: "
- results)))))
- (browse-url
- (concat "http://127.0.0.1:8000/" library "/A/" result))
- )
- )
-
-
-(provide 'kiwix-http)
-
-;;; kiwix-http.el ends here
- [elpa] externals/kiwix c5df1ac 042/192: Merge branch 'release/v0.3.0', (continued)
- [elpa] externals/kiwix c5df1ac 042/192: Merge branch 'release/v0.3.0', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix fb92b4f 043/192: Merge tag 'v0.3.0' into develop, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 1ddddc1 044/192: improve library fragment, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix b84a5ff 047/192: Merge branch 'release/v0.4.0', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 19bfe4f 051/192: add an option to let kiwix-at-point search interactively, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d4fbf7b 052/192: define function ahead, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix f1554ba 054/192: fix some default library abbr name., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 4968e3d 055/192: error when query is invalid., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 1b9f25b 056/192: add interactively called function., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 2e2d64d 059/192: Merge tag 'v0.4.3' into develop, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 8855ac4 060/192: delete deprecated source code files.,
Stefan Monnier <=
- [elpa] externals/kiwix fb83985 062/192: Merge branch 'master' into develop, Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix 45cc8ef 067/192: add some links test., Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix d9bab20 074/192: Merge branch 'release/v0.5.1', Stefan Monnier, 2020/12/19
- [elpa] externals/kiwix ea54acf 080/192: extract get org-mode link library to a single function, Stefan Monnier, 2020/12/19
- [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