From 30a4eb7f774547b0c8d334b842d3e590e3d8e4db Mon Sep 17 00:00:00 2001 From: TEC Date: Sat, 24 Sep 2022 20:08:17 +0800 Subject: [PATCH] fix(mu4e): file attachment prompt arguments There are two changes to the default optional read-file-name arguments that should be made for the purpose of attaching files: 1. The optional MUSTMATCH argument should be set, as one can't exactly attach non-existent files. 2. The INITIAL argument should be set to the empty string so that if default-directory is customised for some reason or another that selecting it leads to the expected directory being selected. Without INITIAL or DEFAULT-FILENAME being specified, the current file path will be used, which is never desirable as this is simply a path to the message buffer. --- modules/email/mu4e/autoload/email.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/email/mu4e/autoload/email.el b/modules/email/mu4e/autoload/email.el index a431ad67a..76688581e 100644 --- a/modules/email/mu4e/autoload/email.el +++ b/modules/email/mu4e/autoload/email.el @@ -270,7 +270,7 @@ When otherwise called, open a dired buffer and enable `dired-mu4e-attach-ctrl-c- (pcase major-mode ((or 'mu4e-compose-mode 'org-msg-edit-mode) (let ((mail-buffer (current-buffer)) - (location (read-file-name "Attach: "))) + (location (read-file-name "Attach: " nil nil t ""))) (if (not (file-directory-p location)) (pcase major-mode ('mu4e-compose-mode