emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Torsten Wagner <torsten.wagner@gmail.com>
Cc: nicholas.dokos@hp.com, Org Mode Mailing List <emacs-orgmode@gnu.org>
Subject: Re: BUG org-bibtex error for importing bibtex conference entries
Date: Thu, 24 Nov 2011 03:09:10 -0500	[thread overview]
Message-ID: <19104.1322122150@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Torsten Wagner <torsten.wagner@gmail.com> of "Thu, 24 Nov 2011 13:36:06 +0900." <CAPaq-gPmR_FU5_CTC3=HngSoYPmQCR55Cf_BKefo7GoVGnyBug@mail.gmail.com>

Torsten Wagner <torsten.wagner@gmail.com> wrote:

> Hi,
> I was going to convert my bibtex file into an org-mode file.
> I receive an error message for conference entries.
> E.g.
> I can read in by org-bibtex-read
> 
> @CONFERENCE{foo11,
>   author = {foo, A. and faa, B},
>   title = {This is the title},
>   booktitle = {Proceeding of the 5th Org-mode conference},
>   year = {2011},
>   month = Jul,
>   day = {4--5},
>   conference_name = {org-mode V},
>   keywords = {published},
>   location = {Somewhere, org-land},
>   presentation = {Oral}
> }
> 

I think the problem is in the reading: after org-bibtex-read,
*org-bibtex-entries* is still nil. I presume that's why
org-bibtex-write fails.

> However, org-bibtex-write results in the following output
> 
> *
> and a debug error-log [1]:
> 
> By changing the bibtex type to e.g., INPROCEEDINGS  the import works correct.
> I tried to debug this but I can't see why it works for inproceedings
> and not for conference.
> 

... and after org-bibtex-read in this case, *org-bibtex-entries* is not
nil.

org-bibtex-read calls bibtex-parse-entry and that one returns nil
on the conference entry above: are you sure it's a legal bibtex type?
Or maybe bibtex-parse-entry just does not know about it and needs
fixing.

Nick

> As a side note, I noticed that the importer is rather quite about
> errors. If I try to import an mal-formated BibTeX entry I often
> receive an result for which some keyword-entries are simply missing.
> E.g. try
> 
> @INPROCEEDINGS{foo11,
>   author = {foo, A. and faa, B},
>   title = {This is the title},
>   booktitle = {Proceeding of the 5th Org-mode conference},
>   year = {2011},
>   month = Jul,
>   day = (4--5),
>   conference_name = {org-mode V},
>   keywords = {published},
>   location = {Somewhere, org-land},
>   presentation = {Oral}
> }
> note the round instead of curl brackets around day. An import will
> skip silently everything behind the month line.
> Wouldn't it make more sens to issue a warning whenever the parser has
> trouble to read something? I noticed that the beamer.el from
> beamer-mode is involved in parsing. Thus, I have no idea whether
> org-mode is capable to notice such a problem. You might argue that
> BibTeX is specifies the correct syntax very well, but many other tools
> export and import to BibTeX too and an error in these programs might
> still allow them to import nd export entries with wrong syntax, a
> import in org-mode however, could result finally in fatal data loose.
> Thus, I vote for an error or warning message whenever there is
> something which requires human attentions.
> As for now, I have to carefully check, that all entries moved into the
> org-mode file, which is a bit tiring and error prone.
> 
> All the best
> 
> Torsten
> 
> 
> 
> [1] Debug log:
> 
> Debugger entered--Lisp error: (wrong-type-argument char-or-string-p nil)
>   insert(nil)
>   (progn (fset (quote togtag) (function* (lambda (tag) (block togtag
> (org-toggle-tag tag (quote on)))))) (org-insert-heading) (insert (val
> :title)) (org-bibtex-put "TITLE" (val :title)) (org-bibtex-put
> org-bibtex-type-property-name (downcase (val :type))) (dolist (pair
> entry) (case (car pair) (:title nil) (:type nil) (:key (org-bibtex-put
> org-bibtex-key-property (cdr pair))) (:keywords (if
> org-bibtex-tags-are-keywords (mapc (lambda (kw) (togtag ...))
> (split-string (cdr pair) ", *")) (org-bibtex-put (car pair) (cdr
> pair)))) (otherwise (org-bibtex-put (car pair) (cdr pair))))) (mapc
> (function togtag) org-bibtex-tags))
>   (unwind-protect (progn (fset (quote togtag) (function* (lambda (tag)
> (block togtag (org-toggle-tag tag (quote on)))))) (org-insert-heading)
> (insert (val :title)) (org-bibtex-put "TITLE" (val :title))
> (org-bibtex-put org-bibtex-type-property-name (downcase (val :type)))
> (dolist (pair entry) (case (car pair) (:title nil) (:type nil) (:key
> (org-bibtex-put org-bibtex-key-property (cdr pair))) (:keywords (if
> org-bibtex-tags-are-keywords (mapc (lambda ... ...) (split-string ...
> ", *")) (org-bibtex-put (car pair) (cdr pair)))) (otherwise
> (org-bibtex-put (car pair) (cdr pair))))) (mapc (function togtag)
> org-bibtex-tags)) (if --cl-letf-bound-- (fset (quote togtag)
> --cl-letf-save--) (fmakunbound (quote togtag))))
>   (let* ((--cl-letf-bound-- (fboundp (quote togtag)))
> (--cl-letf-save-- (and --cl-letf-bound-- (symbol-function (quote
> togtag))))) (unwind-protect (progn (fset (quote togtag) (function*
> (lambda (tag) (block togtag (org-toggle-tag tag ...)))))
> (org-insert-heading) (insert (val :title)) (org-bibtex-put "TITLE"
> (val :title)) (org-bibtex-put org-bibtex-type-property-name (downcase
> (val :type))) (dolist (pair entry) (case (car pair) (:title nil)
> (:type nil) (:key (org-bibtex-put org-bibtex-key-property (cdr pair)))
> (:keywords (if org-bibtex-tags-are-keywords (mapc ... ...)
> (org-bibtex-put ... ...))) (otherwise (org-bibtex-put (car pair) (cdr
> pair))))) (mapc (function togtag) org-bibtex-tags)) (if
> --cl-letf-bound-- (fset (quote togtag) --cl-letf-save--) (fmakunbound
> (quote togtag)))))
>   (letf (((symbol-function (quote togtag)) (function* (lambda (tag)
> (block togtag (org-toggle-tag tag (quote on)))))))
> (org-insert-heading) (insert (val :title)) (org-bibtex-put "TITLE"
> (val :title)) (org-bibtex-put org-bibtex-type-property-name (downcase
> (val :type))) (dolist (pair entry) (case (car pair) (:title nil)
> (:type nil) (:key (org-bibtex-put org-bibtex-key-property (cdr pair)))
> (:keywords (if org-bibtex-tags-are-keywords (mapc (lambda (kw) (togtag
> ...)) (split-string (cdr pair) ", *")) (org-bibtex-put (car pair) (cdr
> pair)))) (otherwise (org-bibtex-put (car pair) (cdr pair))))) (mapc
> (function togtag) org-bibtex-tags))
>   (progn (fset (quote val) (function* (lambda (field) (block val (cdr
> (assoc field entry)))))) (letf (((symbol-function (quote togtag))
> (function* (lambda (tag) (block togtag (org-toggle-tag tag ...))))))
> (org-insert-heading) (insert (val :title)) (org-bibtex-put "TITLE"
> (val :title)) (org-bibtex-put org-bibtex-type-property-name (downcase
> (val :type))) (dolist (pair entry) (case (car pair) (:title nil)
> (:type nil) (:key (org-bibtex-put org-bibtex-key-property (cdr pair)))
> (:keywords (if org-bibtex-tags-are-keywords (mapc (lambda ... ...)
> (split-string ... ", *")) (org-bibtex-put (car pair) (cdr pair))))
> (otherwise (org-bibtex-put (car pair) (cdr pair))))) (mapc (function
> togtag) org-bibtex-tags)))
>   (unwind-protect (progn (fset (quote val) (function* (lambda (field)
> (block val (cdr (assoc field entry)))))) (letf (((symbol-function
> (quote togtag)) (function* (lambda (tag) (block togtag ...)))))
> (org-insert-heading) (insert (val :title)) (org-bibtex-put "TITLE"
> (val :title)) (org-bibtex-put org-bibtex-type-property-name (downcase
> (val :type))) (dolist (pair entry) (case (car pair) (:title nil)
> (:type nil) (:key (org-bibtex-put org-bibtex-key-property (cdr pair)))
> (:keywords (if org-bibtex-tags-are-keywords (mapc ... ...)
> (org-bibtex-put ... ...))) (otherwise (org-bibtex-put (car pair) (cdr
> pair))))) (mapc (function togtag) org-bibtex-tags))) (if
> --cl-letf-bound-- (fset (quote val) --cl-letf-save--) (fmakunbound
> (quote val))))
>   (let* ((--cl-letf-bound-- (fboundp (quote val))) (--cl-letf-save--
> (and --cl-letf-bound-- (symbol-function (quote val)))))
> (unwind-protect (progn (fset (quote val) (function* (lambda (field)
> (block val (cdr ...))))) (letf (((symbol-function (quote togtag))
> (function* (lambda ... ...)))) (org-insert-heading) (insert (val
> :title)) (org-bibtex-put "TITLE" (val :title)) (org-bibtex-put
> org-bibtex-type-property-name (downcase (val :type))) (dolist (pair
> entry) (case (car pair) (:title nil) (:type nil) (:key (org-bibtex-put
> org-bibtex-key-property ...)) (:keywords (if
> org-bibtex-tags-are-keywords ... ...)) (otherwise (org-bibtex-put ...
> ...)))) (mapc (function togtag) org-bibtex-tags))) (if
> --cl-letf-bound-- (fset (quote val) --cl-letf-save--) (fmakunbound
> (quote val)))))
>   (letf (((symbol-function (quote val)) (function* (lambda (field)
> (block val (cdr (assoc field entry))))))) (letf (((symbol-function
> (quote togtag)) (function* (lambda (tag) (block togtag (org-toggle-tag
> tag ...)))))) (org-insert-heading) (insert (val :title))
> (org-bibtex-put "TITLE" (val :title)) (org-bibtex-put
> org-bibtex-type-property-name (downcase (val :type))) (dolist (pair
> entry) (case (car pair) (:title nil) (:type nil) (:key (org-bibtex-put
> org-bibtex-key-property (cdr pair))) (:keywords (if
> org-bibtex-tags-are-keywords (mapc (lambda ... ...) (split-string ...
> ", *")) (org-bibtex-put (car pair) (cdr pair)))) (otherwise
> (org-bibtex-put (car pair) (cdr pair))))) (mapc (function togtag)
> org-bibtex-tags)))
>   (letf* (((symbol-function (quote val)) (function* (lambda (field)
> (block val (cdr (assoc field entry)))))) ((symbol-function (quote
> togtag)) (function* (lambda (tag) (block togtag (org-toggle-tag tag
> (quote on))))))) (org-insert-heading) (insert (val :title))
> (org-bibtex-put "TITLE" (val :title)) (org-bibtex-put
> org-bibtex-type-property-name (downcase (val :type))) (dolist (pair
> entry) (case (car pair) (:title nil) (:type nil) (:key (org-bibtex-put
> org-bibtex-key-property (cdr pair))) (:keywords (if
> org-bibtex-tags-are-keywords (mapc (lambda (kw) (togtag ...))
> (split-string (cdr pair) ", *")) (org-bibtex-put (car pair) (cdr
> pair)))) (otherwise (org-bibtex-put (car pair) (cdr pair))))) (mapc
> (function togtag) org-bibtex-tags))
>   (flet ((val (field) (cdr (assoc field entry))) (togtag (tag)
> (org-toggle-tag tag (quote on)))) (org-insert-heading) (insert (val
> :title)) (org-bibtex-put "TITLE" (val :title)) (org-bibtex-put
> org-bibtex-type-property-name (downcase (val :type))) (dolist (pair
> entry) (case (car pair) (:title nil) (:type nil) (:key (org-bibtex-put
> org-bibtex-key-property (cdr pair))) (:keywords (if
> org-bibtex-tags-are-keywords (mapc (lambda (kw) (togtag ...))
> (split-string (cdr pair) ", *")) (org-bibtex-put (car pair) (cdr
> pair)))) (otherwise (org-bibtex-put (car pair) (cdr pair))))) (mapc
> (function togtag) org-bibtex-tags))
>   (let ((entry (pop *org-bibtex-entries*)) (org-special-properties
> nil)) (flet ((val (field) (cdr (assoc field entry))) (togtag (tag)
> (org-toggle-tag tag (quote on)))) (org-insert-heading) (insert (val
> :title)) (org-bibtex-put "TITLE" (val :title)) (org-bibtex-put
> org-bibtex-type-property-name (downcase (val :type))) (dolist (pair
> entry) (case (car pair) (:title nil) (:type nil) (:key (org-bibtex-put
> org-bibtex-key-property (cdr pair))) (:keywords (if
> org-bibtex-tags-are-keywords (mapc (lambda ... ...) (split-string ...
> ", *")) (org-bibtex-put (car pair) (cdr pair)))) (otherwise
> (org-bibtex-put (car pair) (cdr pair))))) (mapc (function togtag)
> org-bibtex-tags)))
>   org-bibtex-write()
>   call-interactively(org-bibtex-write t nil)
>   execute-extended-command(nil)
>   call-interactively(execute-extended-command nil nil)
> 

  reply	other threads:[~2011-11-24  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24  4:36 BUG org-bibtex error for importing bibtex conference entries Torsten Wagner
2011-11-24  8:09 ` Nick Dokos [this message]
2011-11-24  8:50   ` Torsten Wagner

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=19104.1322122150@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=torsten.wagner@gmail.com \
    /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).