Closed malb closed 1 month ago
Can't reproduce... what version did you use previously? One thing to check is your settings for Emacs backups, auto-save-files etc.; in the past that tripped people up sometimes.
Also note, the checklist are really the recommended/required steps; i.e., please do try to reproduce with emacs -Q
.
You're, of course, right, I should have done it with emacs -Q
. Sorry about that. I've now reproduced it with:
emacs -Q -l mu4e-test.el
where mu4e-test.el
is:
(package-initialize)
(add-to-list 'load-path "~/.emacs.d/local/mu4e/")
(require 'mu4e)
(setq mu4e-headers-skip-duplicates t
mu4e-view-show-images t
message-kill-buffer-on-exit t
mu4e-hide-index-messages t
mu4e-auto-retrieve-keys t
message-dont-reply-to-names #'mu4e-personal-or-alternative-address-p
mu4e-completing-read-function 'completing-read
mu4e-compose-switch 'display-buffer
mu4e-split-view 'vertical
mu4e-headers-visible-columns 134
mu4e-headers-visible-lines 16
mu4e-context-policy 'pick-first
mu4e-compose-context-policy 'ask
mu4e-change-filenames-when-moving t
mu4e-confirm-quit nil
mu4e-index-cleanup t
mu4e-view-show-addresses t
mu4e-headers-precise-alignment t
mu4e-compose-complete-only-after nil
mu4e-index-lazy-check nil
mu4e-headers-auto-update nil
mu4e-org-link-query-in-headers-mode t
mu4e-eldoc-support t
mu4e-modeline-support nil)
(setq mu4e-contexts
`( ,(make-mu4e-context
:name "Google Mail"
:enter-func (lambda () (mu4e-message "Switching to Google Mail"))
;; leave-func not defined
:match-func (lambda (msg)
(when msg
(or (mu4e-message-contact-field-matches msg :to "martinralbrecht@googlemail.com")
(mu4e-message-contact-field-matches msg :cc "martinralbrecht@googlemail.com")
(mu4e-message-contact-field-matches msg :from "martinralbrecht@googlemail.com")
(mu4e-message-contact-field-matches msg :to "martinralbrecht@gmail.com")
(mu4e-message-contact-field-matches msg :cc "martinralbrecht@gmail.com")
(mu4e-message-contact-field-matches msg :from "martinralbrecht@gmail.com"))))
:vars `((user-mail-address . "martinralbrecht@googlemail.com")
(send-mail-function . sendmail-send-it)
(sendmail-program . "/usr/sbin/sendmail")
(message-send-mail-function . message-send-mail-with-sendmail)
(mu4e-drafts-folder . "/gmail/[Google Mail]/Drafts")
(mu4e-sent-folder . "/gmail/[Google Mail]/Sent Mail")
(mu4e-trash-folder . "/gmail/[Google Mail]/Bin")
(mu4e-sent-messages-behavior . delete)))))
Maybe some setting in the above is not right?
I've been on master for a while, I think prior to 1.12 it worked as expected for me.
FWIW, I just pulled both emacs-29
and mu
, deinstalled both, rebuilt and installed both, I'm getting the same behaviour still.
If I set mu4e-sent-messages-behavior
to trash
then the draft e-mail is correctly deleted after sending.
Looking at mu4e-draft.el
it seems the only difference between trash
and delete
(which I have set above) is that no Fcc header is written when delete
is set. I presume that triggers some difference in how the emacs machinery treats the draft file?
I think I found it:
--- /home/malb/Software/mu/mu4e/mu4e-draft.el 2024-06-23 17:35:01.105178434 +0100
+++ /home/malb/.emacs.d/local/mu4e/mu4e-draft.el 2024-08-13 09:37:08.569262414 +0100
@@ -461,10 +461,10 @@
;; we end up with a ((buried) buffer here, visiting the
;; fcc-path; not quite sure why. But let's get rid of it (#2681)
(when-let ((buf (find-buffer-visiting fcc-path)))
- (kill-buffer buf))
- ;; remove draft
- (when-let ((draft (buffer-file-name)))
- (mu4e--server-remove draft))))
+ (kill-buffer buf)))
+ ;; remove draft
+ (when-let ((draft (buffer-file-name)))
+ (mu4e--server-remove draft)))
nil t))
In mu4e--compose-before-send
the code block
;; remove draft
(when-let ((draft (buffer-file-name)))
(mu4e--server-remove draft))
is inside
(when-let ((fcc-path (message-field-value "Fcc")))
but when mu4e-sent-messages-behavior
is delete
this path isn't written in mu4e--fcc-path
. The diff above, simply calls the code block outside the (when-let ((fcc-path (message-field-value "Fcc")))
condition.
@malb That looks like a reasonable change, thanks... I pushed a change along these lines, does it fix the issue for you?
Yup, this works, thanks!
Describe the bug
If I save a draft and then send it, it is not deleted. Previously it was.
How to Reproduce
C-x C-s
to save itCan others reproduce this?
Environment
Debian, Emacs 29.4.50 built from source, mu(4e) commit: 67ea98e36ec61cee05a3465b0af4cc992eaf851f
Checklist
master
(otherwise please upgrade)emacs -Q
so I don't think I can tick this box.