helm-bibtex
helm-bibtex copied to clipboard
copy multiple PFDs of selections
When I select multiple entries, how can I copy their PDFs to a particular directory (similar to F6 that is used to copy their bibtex to a particular file)
Thanks so much
This feature does not exist at the moment but it wouldn't be to hard to add a new action for this. If you want to try implementing this, I'd be happy to give you feedback on your code.
Unfortunately l am not fluent in lisp. Do you have a fast recipe to do my job
On Jan 20, 2018 6:35 PM, "Titus von der Malsburg" [email protected] wrote:
This feature does not exist at the moment but it wouldn't be to hard to add a new action for this. If you want to try implementing this, I'd be happy to give you feedback on your code.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tmalsburg/helm-bibtex/issues/224#issuecomment-359183977, or mute the thread https://github.com/notifications/unsubscribe-auth/ALpbzQVLuO_kcMxSoQc7Rslobkzt4H-Nks5tMhXZgaJpZM4Rle4e .
This may be useful someday. Here's a first sketch.
(helm-add-action-to-source
"Rename PDFs" 'helm-bibtex-rename-pdfs
helm-source-bibtex 1)
(defun helm-bibtex-rename-pdfs (_candidate)
"Rename selected candidates to a new location."
(let* ((keys (helm-marked-candidates))
(pdfs (mapcar (lambda (key)
(concat
bibtex-completion-library-path
key
bibtex-completion-pdf-extension))
keys))
(dir (read-directory-name "Select new directory: ")))
(when (yes-or-no-p (format "Move files to %s?" dir))
(mapcar (lambda (pdf)
(rename-file pdf dir))
pdfs)
(message "Done"))))
Thank you, Jonathan! This is indeed very useful.
Hi, I use above codes in my emacs config file, but have an error as follows, Wrong type argument: characterp, "/home/fg/MEGA/bibtex-pdfs" Please help me.
Are you using Files field in your bibtex entries? Try changing the pdfs part to:
(pdfs (mapcar (lambda (key)
(car (bibtex-completion-find-pdf key)))
keys))