Created
September 16, 2013 03:15
-
-
Save mardukbp/6576377 to your computer and use it in GitHub Desktop.
Attach PDF from ebib to email in mu4e/gnus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun ebib-attach-file () | |
"Attach file to gnus/mu4e composition buffer" | |
(interactive) | |
(ebib-execute-when | |
((entries) | |
(let ((filename (to-raw (car (ebib-get-field-value ebib-standard-file-field | |
(edb-cur-entry ebib-cur-db)))))) | |
(if filename | |
(ebib-dired-attach filename) | |
(error "Field `%s' is empty" ebib-standard-file-field)))) | |
((default) | |
(beep)))) | |
(defun ebib-dired-attach (file) | |
"Attach FILENAME using gnus-dired-attach." | |
(let ((file-full-path | |
(or (locate-file file ebib-file-search-dirs) | |
(locate-file (file-name-nondirectory file) ebib-file-search-dirs) | |
(expand-file-name file)))) | |
(if (file-exists-p file-full-path) | |
(progn | |
(gnus-dired-attach (cons file-full-path '())) | |
(ebib-lower)) | |
(error "File not found: `%s'" file-full-path)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment