Function: bib-bibliography-list

bib-bibliography-list is a byte-compiled function defined in bib-cite.el.

Signature

(bib-bibliography-list)

Documentation

Return list of bib files listed in first \bibliography command in buffer.

Similar output to AUCTeX's LaTeX-bibliography-list The first element may contain trailing whitespace (if there was any in input) although BiBTeX doesn't allow it!

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/bib-cite.el
(defun bib-bibliography-list ()
  "Return list of bib files listed in first \\bibliography command in buffer.
Similar output to AUCTeX's LaTeX-bibliography-list
The first element may contain trailing whitespace (if there was any in input)
although BiBTeX doesn't allow it!"
  (save-excursion
    (goto-char 1)
    (if (not (re-search-forward "^[ \t]*\\\\bibliography{[ \t]*\\([^},]+\\)"
                                nil t))
        (error "Sorry, can't find \\bibliography command anywhere")
      (let ((the-list (list (match-string 1)))
            (doNext t))
        (while doNext
          (if (looking-at ",")
              (setq the-list
                    (append the-list
                            (list (buffer-substring
                                   (progn (skip-chars-forward ", ")(point))
                                   (progn (re-search-forward "[,}]" nil t)
                                          (backward-char 1)
                                          (skip-chars-backward ", ")
                                          (point))))))
            (setq doNext nil)))
        (mapcar #'list the-list)))))