jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.35k stars 242 forks source link

fix error <path/a.bib> <path/b.bib> are the same file on open URL #1090

Open daniron26 opened 9 months ago

daniron26 commented 9 months ago

(org-ref-find-bibliography) can return path from config variable, which may contain symbolic links in the path, when it is compared with (org-ref-get-bibtex-key-and-file), which uses (buffer-file-name) to retrieve a bib file path, it returns an absolute path with all symbolic links resolved. Two different paths pointing to the same file leads to the above error and prevents the body of the let clause from executing. Using the file-truename prevents this error.

jkitchin commented 9 months ago

I don't think this is the right solution, you should probably do (mapcar 'file-true (org-ref-find-bibliography)) instead. But, Maybe even better is to fix this in (org-ref-find-bibliography) so that it returns true names.