1 ;;; org-ebib.el - Support for links to Ebib's entries in Org
3 ;; Author: Grégoire Jadi <daimrod@gmail.com>
5 ;; This file is not yet part of GNU Emacs.
7 ;; This program is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 3, or (at your option)
12 ;; This program is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
19 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 (org-add-link-type "ebib" 'org-ebib-open
)
27 (add-hook 'org-store-link-functions
'org-ebib-store-link
)
29 (defun org-ebib-open (key)
30 "Open Ebib and jump to KEY."
33 (defun org-ebib-store-link ()
34 "Store a key to an Ebib entry."
35 (when (memq major-mode
'(ebib-index-mode ebib-entry-mode
))
36 ;; This is an Ebib entry
37 (let* ((key (ebib-cur-entry-key))
38 (link (concat "ebib:" key
))
39 (description (ignore-errors (ebib-db-get-field-value 'title key ebib-cur-db
))))
43 :description description
))))
47 ;;; org-ebib.el ends here