1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-25 10:47:12 +00:00

improved warnings of bibtex errors during multi-headline export

* lisp/org-bibtex.el (org-bibtex): Now catches bibtex errors and
  directs the user to the location of the error.
This commit is contained in:
Eric Schulte 2011-11-29 08:56:27 -07:00
parent 0b51c3d6a9
commit e902a75a23

View File

@ -525,9 +525,20 @@ Headlines are exported using `org-bibtex-export-headline'."
"Bibtex file: " nil nil nil
(file-name-nondirectory
(concat (file-name-sans-extension (buffer-file-name)) ".bib")))))
(let ((bibtex-entries (remove nil (org-map-entries #'org-bibtex-headline))))
(with-temp-file filename
(insert (mapconcat #'identity bibtex-entries "\n")))))
((lambda (error-point)
(when error-point
(goto-char error-point)
(message "Bibtex error at %S" (nth 4 (org-heading-components)))))
(catch 'bib
(let ((bibtex-entries (remove nil (org-map-entries
(lambda ()
(condition-case foo
(org-bibtex-headline)
(error (throw 'bib (point)))))))))
(with-temp-file filename
(insert (mapconcat #'identity bibtex-entries "\n")))
(message "Successfully exported %d bibtex entries to %s"
(length bibtex-entries) filename) nil))))
(defun org-bibtex-check (&optional optional)
"Check the current headline for required fields.