reddit / emacs

How to automatically collapse attachments in message/notmuch-show mode?

emax-gomax · 2022-07-24 21:10
Hi, does anyone know if there's an option to prevent message-mode auto expanding plain text attachments? I recently started contributing to a project that uses mailing lists. I manage my mail with notmuch, but I'm finding it very hard to focus on the content of my messages whe reading when I inadvertently scroll into a large attachment such as a patch. I'd prefer to just keep these minimised by default like pdf attachments and expand them if I'm interested. Anyone know how?
[deleted] · 2022-07-24 22:37
[deleted]
emax-gomax · 2022-07-24 23:27
I think I have a good understanding of the different options, in fact I'm currently contributing a patch to notmuch upstream. What I'm asking for is the ability to reduce the amount of noise in notmuch-show buffers related to attachments. I'm aware notmuch-show is derived from message-mode which is why my title and description references both. If there is a customization option for this I'd expect it to be in message-mode not the notmuch wrapper, however ive referenced both in case theres a notmuch specific option someone could share which would work fine. Either way if you believe there's an option in notmuc that strips out attachments from notmuch-show (this isn't what I want but it's the only thing I can think you meant by this comment) then I'm open to hearing about it. Beyond that the only other thing that springs to mind is searching more specifically about what mail I'm after which doesn't apply here because I'm not trying to find mail, I'm trying to read mail I already have.
karthink · 2022-07-25 06:59
(setq mm-inline-override-types '("text/x-diff" "text/x-patch")) Add any other mimetypes to this list that you want to hide by default.
emax-gomax · 2022-07-25 18:53
This works, thank you :-)
karthink · 2022-07-26 23:36
I'm not a notmuch power user: you might be interested in [how I found this variable](https://www.youtube.com/watch?v=UP2dFk5_ytY).
emax-gomax · 2022-07-27 16:42
Thanks, you even found a fix for the patches not being expandable when using the override variable. I was probably just gonna accept that not being changeable but this was great.
karthink · 2022-07-27 20:34
> Thanks, you even found a fix for... I guess there's a fix for almost any problem in Emacs. I neglected to mention in the video that this flexibility comes with downsides -- config code (like the defadvice in the video) that might break when there's an update, Emacs running slower, introducing mystery bugs, and developing an incorrigible urge to tinker with Emacs instead of getting on with life. :)