mu4e: add action mu4e-action-copy-message-file-path

Allow for copying the file path of the current message; useful for
developers.
This commit is contained in:
djcb 2017-08-27 17:35:23 +03:00
parent 3a8748c549
commit 95d68b4741
1 changed files with 15 additions and 3 deletions

View File

@ -94,11 +94,13 @@ return the filename."
(while (re-search-forward (format "src=\"cid:%s\"" (while (re-search-forward (format "src=\"cid:%s\""
(plist-get attachment :cid)) nil t) (plist-get attachment :cid)) nil t)
(if (plist-get attachment :temp) (if (plist-get attachment :temp)
(replace-match (format "src=\"%s\"" (plist-get attachment :temp))) (replace-match (format "src=\"%s\""
(plist-get attachment :temp)))
(replace-match (format "src=\"%s%s\"" temporary-file-directory (replace-match (format "src=\"%s%s\"" temporary-file-directory
(plist-get attachment :name))) (plist-get attachment :name)))
(let ((tmp-attachment-name (format "%s%s" temporary-file-directory (let ((tmp-attachment-name
(plist-get attachment :name)))) (format "%s%s" temporary-file-directory
(plist-get attachment :name))))
(mu4e~proc-extract 'save (mu4e-message-field msg :docid) (mu4e~proc-extract 'save (mu4e-message-field msg :docid)
(plist-get attachment :index) (plist-get attachment :index)
mu4e-decryption-policy tmp-attachment-name) mu4e-decryption-policy tmp-attachment-name)
@ -160,6 +162,16 @@ with `mu4e-compose-attach-captured-message'."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun mu4e-action-copy-message-file-path (msg)
"Save the full path the message file for the current message to
the kill-ring."
(kill-new (mu4e-message-field msg :path)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar mu4e-org-contacts-file nil (defvar mu4e-org-contacts-file nil