From mboxrd@z Thu Jan 1 00:00:00 1970 From: Torsten Wagner Subject: BUG org-bibtex error for importing bibtex conference entries Date: Thu, 24 Nov 2011 13:36:06 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTR2e-0004dK-Sk for emacs-orgmode@gnu.org; Wed, 23 Nov 2011 23:36:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTR2d-0001Hi-BM for emacs-orgmode@gnu.org; Wed, 23 Nov 2011 23:36:08 -0500 Received: from mail-gy0-f169.google.com ([209.85.160.169]:37516) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTR2d-0001He-7m for emacs-orgmode@gnu.org; Wed, 23 Nov 2011 23:36:07 -0500 Received: by ghrr17 with SMTP id r17so2596084ghr.0 for ; Wed, 23 Nov 2011 20:36:06 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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)