emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH 2/5] org-bibtex.el: Use `org-bibtex-read-internal' in `org-bi


From: Stefan-W. Hahn
Subject: [O] [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

* 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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]