org-bibtex.el (org-bibtex-headline): Don't throw an error

* org-bibtex.el (org-bibtex-headline): Don't throw an error
when trying to add a keyword field to a BibTeX entry that is
not known by BibTeX or defined by the user.

Thanks to Leonard Randall for reporting this and suggesting a fix.
This commit is contained in:
Bastien Guerry 2014-04-19 16:40:11 +02:00
parent 0afb088207
commit aff6a10aac

View file

@ -371,7 +371,7 @@ This variable is relevant only if `org-bibtex-tags-are-keywords' is t."
(bibtex-beginning-of-entry) (bibtex-beginning-of-entry)
(if (re-search-forward "keywords.*=.*{\\(.*\\)}" nil t) (if (re-search-forward "keywords.*=.*{\\(.*\\)}" nil t)
(progn (goto-char (match-end 1)) (insert ", ")) (progn (goto-char (match-end 1)) (insert ", "))
(bibtex-make-field "keywords" t t)) (ignore-errors (bibtex-make-field "keywords" t t)))
(insert (mapconcat #'identity tags ", "))) (insert (mapconcat #'identity tags ", ")))
(buffer-string)))))) (buffer-string))))))