plantarum / bibtex-utils

An Emacs package providing additional features for working with BibTeX files & citations
19 stars 4 forks source link

bu-pdf-dir and ways to specify path #4

Closed vkazanov closed 7 years ago

vkazanov commented 7 years ago

On Linux generally there are two ways to specify a path:

  1. (setq bu-pdf-dir "~/Documents/bibtex/pdfs")
  2. (setq bu-pdf-dir "~/Documents/bibtex/pdfs/")

Because the bu-open-doc function just concats path components to check for pdfs in the directory this may result in a broken path: "~/Documents/bibtex/pdfsmykey.pdf".

To avoid this it's generally better to use something like: (concat (file-name-as-directory bu-pdf-dir) (cdr (assoc "=key=" ) ".pdf"). Notice the usage of file-name-as-directory.

I could come up with a patch but the change is trivial :-)

plantarum commented 7 years ago

Done, thanks!