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] headers scrolled off the top of the window when viewing message in mu4e:view #2683

Closed jaknel closed 3 months ago

jaknel commented 3 months ago

Describe the bug

The buffer is scrolled within the window such that the first few headers are not visible when first selecting a message to read. Expected behavior is that all headers are visible on first opening an email. M-x gnus-article-hide-headers reformats the buffer headers as I would expect, but does delete the Mu4e added Flags and Maildir headers. I think the issue is in this function and possibly at this line: https://github.com/djcb/mu/blob/9316d8955be4ac1e1e065e440b2ae2a990e30eed/mu4e/mu4e-view.el#L803 where gnus-treatment-function-alist gets redefined but I haven't figured out a solution.

Example

When opening a sample email these are the three headers visible:

Date: Fri, 5 Apr 2024 09:55:53 -0400 (43 minutes, 45 seconds ago) Flags: seen, personal Maildir:

However when scrolling to the top of the email the message has these headers: From: Subject: To: CC: Date: Fri, 5 Apr 2024 09:55:53 -0400 (43 minutes, 45 seconds ago) Flags: seen, personal Maildir:

How to Reproduce

  1. started emacs -Q
  2. (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/mu4e")
  3. M-x load-library RET mu4e RET
  4. M-x mu4e
  5. select an email to read
  6. Scroll up to see all headers.

Environment Ubuntu Linux

mu master 9316d8955be4ac1e1e065e440b2ae2a990e30eed (4/5/2024) emacs master ce29ae32d0b05cedbc9ba65c1a347ab7c34420ad (3/18/2024)

djcb commented 3 months ago

Hmmm, that code snippet is years old; OTOH earlier this week people mentioned suddenly seeing this behavior. I can't reproduce with my normal daily-driver emacs, but I can with the steps-to-reproduce... I'll but a fix in place. Thanks!

jaknel commented 3 months ago

Thanks. Tested the patch and works for me.