 (defvar +latex-bibtex-file ""
   "File AUCTeX (specifically RefTeX) uses to search for citations.")
 
-(defvar +latex-bibtex-pdfs-dir ""
+(defvar +latex-bibtex-dir ""
   "Where bibtex files are kept.")
 
 (defvar +latex-indent-level-item-continuation 8
   "Custom indentation level for items in enumeration-type environments")
 
 
-(def-setting! :latex-bibtex-file file
+(def-setting! :latex-bibtex-file (file)
   "Sets the default file RefTeX uses to search for citations."
-  (setq +latex-bibtex-file file))
-
-(def-setting! :latex-bibtex-pdfs dir
-  "Sets the default file AUXTeX uses to search for PDF files associated to citations.."
-  (setq +latex-bibtex-pdfs-dir dir))
+  `(setq +latex-bibtex-file ,file))
+
+(def-setting! :latex-bibtex-dir (dir)
+  "Sets the directory where AUCTeX will search for PDFs associated to BibTeX references."
+  `(setq +latex-bibtex-dir ,dir))
 
 
 (def-package! tex-site

  :when (featurep! :completion helm)
  :commands helm-bibtex
  :config
  (unless (s-blank? +latex-bibtex-file)
    (setq bibtex-completion-bibliography (list (expand-file-name +latex-bibtex-file))))
  (unless (s-blank? +latex-bibtex-pdfs-dir)
    (setq bibtex-completion-library-path (list +latex-bibtex-pdfs-dir)
          bibtex-completion-pdf-field "file"
          bibtex-completion-notes-path (f-expand "notes.org" +latex-bibtex-pdfs-dir)
          bibtex-completion-pdf-open-function
          (lambda (fpath) (async-start-process "open-pdf" "/usr/bin/xdg-open" nil fpath)))))


  :init
  (setq reftex-plug-into-AUCTeX t
        reftex-toc-split-windows-fraction 0.3)
  (unless (string-empty-p +latex-bibtex-file)
    (setq reftex-default-bibliography (list (expand-file-name +latex-bibtex-file))))
  ; Get ReTeX working with biblatex
  ; http://tex.stackexchange.com/questions/31966/setting-up-reftex-with-biblatex-citation-commands/31992#31992
