helm-bibtex
helm-bibtex copied to clipboard
Edit notes with filename other than BibtexKey.org
I have a bibtex file generated with Mendeley with a file field. I am using pdf-tools to annotate and the note file is the same file name (long name instead of key.org) with ORG extension. I can open pdf, doi etc, however, Edit notes will open an empty file with bibtexKey.org. I tried with my limited knowledge about elisp, with no avail. Can somebody help? The following is what I did.
(defun my/org-ref-open-notes-at-point (key)
"Open the pdf for bibtex key under point if it exists."
(interactive)
(let* ((pdf-file (car (bibtex-completion-find-pdf-in-fieldk key))))
(find-file (replace-regexp-in-string "\\(.*\\).pdf" "\\1.org" pdf-file)))
)
(setq bibtex-completion-edit-notes 'my/org-ref-open-notes-at-point)
There is no support for this currently. Why don't you use <BibtexKey>.pdf
for your PDFs? Would make everything so much easier. Parsing of the bibliography also would be faster.
Also what's wrong with your code? I haven't tried it but the approach looks reasonable.