djcb / mu

maildir indexer/searcher + emacs mail client + guile bindings
http://www.djcbsoftware.nl/code/mu
GNU General Public License v3.0
1.59k stars 384 forks source link

[mu4e bug] Garbled headers when editing a saved msg with no body #2714

Open jman-schief opened 3 weeks ago

jman-schief commented 3 weeks ago

When I edit a previously saved message that has no body, the email headers gets mixed up.

How to Reproduce

The text --text follows this line-- is somehow attached when the buffer with the editable email is created because it is not present in the saved draft.

If I add something in the body the issue does not reproduce.

Variant of this bug

Environment

Checklist

Thank you!

jman-schief commented 3 weeks ago

I think also related to #2661

djcb commented 2 weeks ago

Unable to reproduce. Are you using Doom's special mu4e version?

jman-schief commented 2 weeks ago

Unable to reproduce. Are you using Doom's special mu4e version?

Thanks for investigating. I'm pretty sure that Doom Emacs does not customize mu4e (not anymore in any case). I install the mu4e Debian package and the mu4e configuration lives completely in my own elisp files.

When composing an email I don't see any major or minor mode that could be the culprit of interfering, here's the output of describe-mode:

Minor modes enabled in this buffer: Abbrev Apheleia Auto-Fill Auto-Save Better-Jumper-Local Company
Display-Line-Numbers Dtrt-Indent Eldoc Flymake Flymake-Popon Font-Lock Hl-Line Mml Mu4e-Context
Smartparens Undo-Fu-Session Vi-Tilde-Fringe Visual-Line Whitespace Ws-Butler Yas

The major mode is mu4e:compose mode defined in mu4e-compose.el

Unsure if it helps: I enabled toggle-debug-on-error and when I try the "Variant of this bug" (explained above) I see:

Debugger entered--Lisp error: (search-failed "^--text follows this line--$")
   message-position-on-field("Subject")
   message-goto-subject()
   mu4e--jump-to-a-reasonable-place()
   mu4e--prepare-draft-buffer(edit nil)
   mu4e--draft(edit #f(compiled-function () #<bytecode 0xc61a197c12512c4>))
   mu4e-compose-edit()
   funcall-interactively(mu4e-compose-edit)
   command-execute(mu4e-compose-edit)

If I have time, I'll try to install mu4e on a vanilla Emacs ...

djcb commented 2 days ago

I tried with emacs-29.4 as well as with 28.2 and no further customizations, and I can't reproduce the misbehavior. I.e.,

/usr/local/bin/emacs-29.4 -Q --eval "(progn (add-to-list 'load-path \"~/Sources/mu/build/mu4e\") (setq mu4e-mu-binary \"~/Sources/mu/build/mu/mu\") (require 'mu4e) (mu4e))"

can you try that as well? (change the paths as needed). Thanks.