helm-bibtex
helm-bibtex copied to clipboard
Allow the user to set helm-bibtex-notes-path as list of directories
I have set helm-bibtex-library-path as a list of directories where helm-bibtex look for pdf files, however the notes are not found and the symbol (pencil) does not show up during searching. It seems that I can only set one directory in helm-bibtex-notes-path and not a list as in the previous case. Could this feature be added? Thanks.
I considered adding this earlier but there is one problem with having multiple directories: if you create a new notes file via the "edit notes" action, in which directory should the file be created? Of course, we could prompt the user but personally I would find it annoying if I was prompted for a directory every time I add notes to an article.
Yes, the issue is to find an algorithm which works in most cases. What about a list of directories where the first (car) directory of the list is the default one where the new notes are created unless there is already a pdf file in another directory of helm-bibtex-library-path list. In my case the note file bib-key.org is associated with pdf file bib-key.pdf and it would be good if both files are in the same directory. So first the algorithm for editing or creating new notes would check if a pdf file is already in a directory from the helm-bibtex-library-path, if there is no pdf file and no existing note file then a new note file is created in the first directory from the helm-bibtex-library-path list or something similar... These are my latest thoughts which can be improved. What do you think?
Hm, this would work for some setups but not for others. Suppose someone uses the following directory layout:
/.../my_articles_pdfs/
/.../my_articles_notes/
/.../other_articles_pdfs/
/.../other_articles_notes/
With
(setq helm-bibtex-library-path '("/.../my_articles_pdfs/" "/.../other_articles_pdfs/")
(setq helm-bibtex-notes-path '("/.../my_articles_notes/" "/.../other_articles_notes/")
Notes would then always land in the first directory in helm-bibtex-notes-path
, i.e. my_articles_notes
.
The problem is that the current configuration already gives people a lot of flexibility and it's hard to anticipate how people are going to use these degrees of freedom. The fact that PDFs can also be specified in the file
field and that people can even specify several PDFs for an entry makes things even more complex.
What about this approach: when bibtex-completion-notes-path
is nil, we store the notes file for an entry along with the PDF, if it exists. If no PDF is present we throw an error.