Function: bib-master-directory

bib-master-directory is a byte-compiled function defined in bib-cite.el.

Signature

(bib-master-directory)

Documentation

Return the directory associated with the master file.

If no master file, then return current default.

Source Code

;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/bib-cite.el
;;---------------------------------------------------------------------------
;; Multi-file document programming requirements:
;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;; bib-make-bibliography
;;    bib-document-citekeys-obarray needs the master .aux file to extract
;;   citation keys.
;;    Included .aux files (corresponding to \include'd LaTeX files) are
;;   then specified relative to the master-file-directory.
;;
;; bib-get-bibliography (used by interactive commands to extract bib sources)
;;
;;    bibtex source filenames are returned from (LaTeX-bibliography-list)
;;   unformatted.  Since only a single \bibliogragrphy command is allowed
;;   by BiBTeX in a document, it is safe to assume that their path is
;;   relative to the master file's directory (since the path is relative
;;   to where the BiBTeX program is actually ran).
;;

;; (See TeX-check-files, used in TeX-save-document.  All documents related
;;  files are returned by (TeX-style-list) and stored in TeX-active-styles.
;;  Original idea was to search TeX-check-path for files listed in
;;  TeX-active-styles (with possible relative or full paths) that end in .tex.)

(defun bib-master-directory ()
  "Return the directory associated with the master file.
If no master file, then return current default."
  (let ((masterfile (bib-master-file)))
    (if masterfile
        (file-name-directory (expand-file-name (TeX-master-file)))
      default-directory)))