From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Stefan-W. Hahn" Subject: [PATCH 2/5] org-bibtex.el: Use `org-bibtex-read-internal' in `org-bibtex-store-link' Date: Sun, 23 Mar 2014 11:16:08 +0100 Message-ID: <1395569771-32421-3-git-send-email-stefan.hahn@s-hahn.de> References: <20140221161702.GS7560@pille.home> <1395569771-32421-1-git-send-email-stefan.hahn@s-hahn.de> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WRfSM-0008Mx-0r for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 06:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WRfSF-0008Ry-SQ for emacs-orgmode@gnu.org; Sun, 23 Mar 2014 06:16:41 -0400 In-Reply-To: <1395569771-32421-1-git-send-email-stefan.hahn@s-hahn.de> 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: Bastien Cc: emacs-orgmode@gnu.org, "Stefan-W. Hahn" * org-bibtex.el (org-bibtex-store-link): To have the same conversion, especially removing of {{...}}, of a bibtex entry use `org-bibtex-read-internal' in `org-bibtex-store-link'. TINY CHANGE Signed-off-by: Stefan-W. Hahn --- lisp/org-bibtex.el | 46 ++++++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el index 7a12c30..4fd1153 100644 --- a/lisp/org-bibtex.el +++ b/lisp/org-bibtex.el @@ -453,33 +453,27 @@ (defun org-bibtex-store-link () (let* ((search (org-create-file-search-in-bibtex)) (link (concat "file:" (abbreviate-file-name buffer-file-name) "::" search)) - (entry (mapcar ; repair strings enclosed in "..." or {...} - (lambda(c) - (if (string-match - "^\\(?:{\\|\"\\)\\(.*\\)\\(?:}\\|\"\\)$" (cdr c)) - (cons (car c) (match-string 1 (cdr c))) c)) - (save-excursion - (bibtex-beginning-of-entry) - (bibtex-parse-entry))))) + (entry (org-bibtex-read-internal))) + (org-store-link-props - :key (cdr (assoc "=key=" entry)) - :author (or (cdr (assoc "author" entry)) "[no author]") - :editor (or (cdr (assoc "editor" entry)) "[no editor]") - :title (or (cdr (assoc "title" entry)) "[no title]") - :booktitle (or (cdr (assoc "booktitle" entry)) "[no booktitle]") - :journal (or (cdr (assoc "journal" entry)) "[no journal]") - :publisher (or (cdr (assoc "publisher" entry)) "[no publisher]") - :pages (or (cdr (assoc "pages" entry)) "[no pages]") - :url (or (cdr (assoc "url" entry)) "[no url]") - :year (or (cdr (assoc "year" entry)) "[no year]") - :month (or (cdr (assoc "month" entry)) "[no month]") - :address (or (cdr (assoc "address" entry)) "[no address]") - :volume (or (cdr (assoc "volume" entry)) "[no volume]") - :number (or (cdr (assoc "number" entry)) "[no number]") - :annote (or (cdr (assoc "annote" entry)) "[no annotation]") - :series (or (cdr (assoc "series" entry)) "[no series]") - :abstract (or (cdr (assoc "abstract" entry)) "[no abstract]") - :btype (or (cdr (assoc "=type=" entry)) "[no type]") + :key (cdr (assoc :key entry)) + :author (or (cdr (assoc :author entry)) "[no author]") + :editor (or (cdr (assoc :editor entry)) "[no editor]") + :title (or (cdr (assoc :title entry)) "[no title]") + :booktitle (or (cdr (assoc :booktitle entry)) "[no booktitle]") + :journal (or (cdr (assoc :journal entry)) "[no journal]") + :publisher (or (cdr (assoc :publisher entry)) "[no publisher]") + :pages (or (cdr (assoc :pages entry)) "[no pages]") + :url (or (cdr (assoc :url entry)) "[no url]") + :year (or (cdr (assoc :year entry)) "[no year]") + :month (or (cdr (assoc :month entry)) "[no month]") + :address (or (cdr (assoc :address entry)) "[no address]") + :volume (or (cdr (assoc :volume entry)) "[no volume]") + :number (or (cdr (assoc :number entry)) "[no number]") + :annote (or (cdr (assoc :annote entry)) "[no annotation]") + :series (or (cdr (assoc :series entry)) "[no series]") + :abstract (or (cdr (assoc :abstract entry)) "[no abstract]") + :btype (or (cdr (assoc :type entry)) "[no type]") :type "bibtex" :link link :description org-bibtex-description)))) -- 1.8.3.2.733.gf8abaeb