emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
To: Bastien <bzg@gnu.org>
Cc: emacs-orgmode@gnu.org, "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
Subject: [PATCH 3/5] org-bibtex.el: Replace double used fieldnames ":key" and ":byte".
Date: Sun, 23 Mar 2014 11:16:09 +0100	[thread overview]
Message-ID: <1395569771-32421-4-git-send-email-stefan.hahn@s-hahn.de> (raw)
In-Reply-To: <1395569771-32421-1-git-send-email-stefan.hahn@s-hahn.de>

* 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 <stefan.hahn@s-hahn.de>
---
 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

  parent reply	other threads:[~2014-03-23 10:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 16:17 Problem with org-bibtex-read with fields type, key Stefan-W. Hahn
2014-03-19 11:08 ` Bastien
2014-03-21 19:26   ` Stefan-W. Hahn
2014-03-21 22:02     ` Bastien
2014-03-23 10:16 ` [RFC] " Stefan-W. Hahn
2014-03-23 10:16   ` [PATCH 1/5] org-bibtex.el (org-bibtex-read): Split in two functions for internal use Stefan-W. Hahn
2014-03-23 10:16   ` [PATCH 2/5] org-bibtex.el: Use `org-bibtex-read-internal' in `org-bibtex-store-link' Stefan-W. Hahn
2014-03-23 10:16   ` Stefan-W. Hahn [this message]
2014-03-23 10:16   ` [PATCH 4/5] org-bibtex.el: Change property names in `org-bibtex-store-link' API Stefan-W. Hahn
2014-03-23 10:16   ` [PATCH 5/5] org-bibtex.el: Clarifying description of `org-bibtex-type-property-name' Stefan-W. Hahn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1395569771-32421-4-git-send-email-stefan.hahn@s-hahn.de \
    --to=stefan.hahn@s-hahn.de \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).