emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [PATCH 3/5] org-bibtex.el: Replace double used fieldnames ":key" and


From: Stefan-W. Hahn
Subject: [O] [PATCH 3/5] org-bibtex.el: Replace double used fieldnames ":key" and ":byte".
Date: Sun, 23 Mar 2014 11:16:09 +0100

* org-bibtex.el (org-bibtex-read-internal): Change property names.

The bibtex parser returns

  =key=  for the key of the bibtex entry
  =type= for the type of the bibtex entry.

These both should not be mixed up with the ":key" and ":type" entries of a
bibtex item. So they get renamed to ":bibkey" and ":bibtype" respectively.

TINY CHANGE

Signed-off-by: Stefan-W. Hahn <address@hidden>
---
 lisp/org-bibtex.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index 4fd1153..b4b707a 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -456,7 +456,7 @@ (defun org-bibtex-store-link ()
           (entry (org-bibtex-read-internal)))
 
       (org-store-link-props
-       :key (cdr (assoc :key entry))
+       :key (cdr (assoc :bibkey 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]")
@@ -473,8 +473,8 @@ (defun org-bibtex-store-link ()
        :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"
+       :btype (or (cdr (assoc :bibtype entry)) "[no bibtype]")
+       :type "bibtex" ; hides bibtex entry :type
        :link link
        :description org-bibtex-description))))
 
@@ -614,8 +614,8 @@ (defun org-bibtex-read-internal ()
      (lambda (pair)
        (cons (let ((field (funcall keyword (car pair))))
               (case field
-                (:=type= :type)
-                (:=key= :key)
+                (:=type= :bibtype)
+                (:=key= :bibkey)
                 (otherwise field)))
             (funcall clean-space (funcall strip-delim (cdr pair)))))
      (save-excursion (bibtex-beginning-of-entry) (bibtex-parse-entry)))))
@@ -660,12 +660,12 @@ (defun org-bibtex-write ()
     (insert (funcall val :title))
     (org-bibtex-put "TITLE" (funcall val :title))
     (org-bibtex-put org-bibtex-type-property-name
-                   (downcase (funcall val :type)))
+                   (downcase (funcall val :bibtype)))
     (dolist (pair entry)
       (case (car pair)
        (:title    nil)
        (:type     nil)
-       (:key      (org-bibtex-put org-bibtex-key-property (cdr pair)))
+       (:bibkey   (org-bibtex-put org-bibtex-key-property (cdr pair)))
        (:keywords (if org-bibtex-tags-are-keywords
                       (mapc
                        (lambda (kw)
-- 
1.8.3.2.733.gf8abaeb




reply via email to

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