emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* BUG org-bibtex error for importing bibtex conference entries
@ 2011-11-24  4:36 Torsten Wagner
  2011-11-24  8:09 ` Nick Dokos
  0 siblings, 1 reply; 3+ messages in thread
From: Torsten Wagner @ 2011-11-24  4:36 UTC (permalink / raw)
  To: Org Mode Mailing List

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}
}

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.

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-24  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-24  4:36 BUG org-bibtex error for importing bibtex conference entries Torsten Wagner
2011-11-24  8:09 ` Nick Dokos
2011-11-24  8:50   ` Torsten Wagner

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).