From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daimrod Subject: [PATCH] Support for links to Ebib's entries Date: Wed, 12 Mar 2014 08:09:03 +0900 Message-ID: <87eh288h9s.fsf@tanger.home> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNVnT-0004dP-8R for emacs-orgmode@gnu.org; Tue, 11 Mar 2014 19:09:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WNVnO-0000QQ-Iz for emacs-orgmode@gnu.org; Tue, 11 Mar 2014 19:09:19 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:47633) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WNVnO-0000Q0-6T for emacs-orgmode@gnu.org; Tue, 11 Mar 2014 19:09:14 -0400 Received: by mail-pa0-f47.google.com with SMTP id lj1so215770pab.34 for ; Tue, 11 Mar 2014 16:09:13 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi, I've attached a small patch to support links (opening and storing) to Ebib's[1] entries. Can I integrate it? 1: http://joostkremers.github.io/ebib/ --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=0001-contrib-lisp-org-ebib.el-Support-for-links-to-Ebib-s.patch Content-Transfer-Encoding: quoted-printable From=20acd007302d56d40189659853ef146407bb64ba20 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Gr=3DC3=3DA9goire=3D20Jadi?=3D Date: Wed, 12 Mar 2014 08:06:13 +0900 Subject: [PATCH] contrib/lisp/org-ebib.el: Support for links to Ebib's entr= ies * contrib/lisp/org-ebib.el: Support for links to Ebib's entries. (org-ebib-open): Open an Ebib's entry. (org-ebib-store-link): Store a link to an Ebib's entry. =2D-- contrib/lisp/org-ebib.el | 47 ++++++++++++++++++++++++++++++++++++++++++++= +++ 1 file changed, 47 insertions(+) create mode 100644 contrib/lisp/org-ebib.el diff --git a/contrib/lisp/org-ebib.el b/contrib/lisp/org-ebib.el new file mode 100644 index 0000000..2136a13 =2D-- /dev/null +++ b/contrib/lisp/org-ebib.el @@ -0,0 +1,47 @@ +;;; org-ebib.el - Support for links to Ebib's entries in Org +;; +;; Author: Gr=C3=A9goire Jadi +;; +;; This file is not yet part of GNU Emacs. +;; +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;= ;;; +;; +;;; Commentary: + +(require 'org) + +(org-add-link-type "ebib" 'org-ebib-open) + +(add-hook 'org-store-link-functions 'org-ebib-store-link) + +(defun org-ebib-open (key) + "Open Ebib and jump to KEY." + (ebib nil key)) + +(defun org-ebib-store-link () + "Store a key to an Ebib entry." + (when (memq major-mode '(ebib-index-mode ebib-entry-mode)) + ;; This is an Ebib entry + (let* ((key (ebib-cur-entry-key)) + (link (concat "ebib:" key)) + (description (ignore-errors (ebib-db-get-field-value 'title key= ebib-cur-db)))) + (org-store-link-props + :type "ebib" + :link link + :description description)))) + +(provide 'org-ebib) + +;;; org-ebib.el ends here =2D-=20 1.8.0.2722.gc0242e5 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Daimrod/Greg --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTH5eUAAoJEBNzVHcrZRiU62sQAJEuM3jmTlCjAnTZiiZUoOM+ Wj5HlssvJNXs5Rw6l3wNlQNaMeTQnGTEy488TzqPZHAjPOW8Nvcc/Rvc8af4ozjU rtzVIOhDLzDBcVNVwmh10OoV6VVnCa7sOS1NEqhkDOTAGkR1HqjLw0nbJT/wWy5/ dwm0edVGVgyPlfOic+GP7ySN4MXstX/b2VxDzvkbeXKOqdZ7fVglcVOtRdWzOrxJ GENFl3iIrbNumFCuTXKA25+1kf4C44O8AdbSo//3Jti2Io4U2IfAnFa+dwMicGLc w2kwJch/FKaFJnU9NWLjvQbQ1OSqGXL1vqbyhkVSSzaZ84BF9JJVdwMPfB+g8oiW 2Bx4S1QaBXAx2JIYEobQ0LXbmidsbonTTEE3P+OysLWF+UxCwoEVt7wNcP1G16we A/lCDVtpBNMadn15RQgr5J8ngWc/lyD4Il5fhGKPJtvrwhbwC0nh00V6W5NNhCM/ B643jZibFOORjCpR1R7qqRUwVCFowlFdjKX5d3APNmEZn0x3iL4WEWdrbH8LxS6Y eVVoc76nG+xfn2J7g7sxLIUOPF9+uqIIEVyRT/2uhU+bhjrzhgPG07i8s6LGDdei ykY0ebRqT8WJ7jC0TWSn72zCX6pDSSrpDKzywxHspEGza8eFCmN9PtDVRd69EJ5T fbByKLIFCnA4KNPQpEr9 =ujZp -----END PGP SIGNATURE----- --==-=-=--