[PATCH 1/4] emacs: save undisplayer function for MIME parts

2023-09-16 Thread David Bremner
For some kinds of MIME parts (at least images), our trickery with overlays will not work, so save the more drastic function created by Gnus that actually deletes the part from the buffer. In an ideal world we would return this function as (part of) a value, but here the call stack is too

[PATCH 4/4] emacs/show: special case toggling display of images

2023-09-16 Thread David Bremner
According to emacs upstream [1], we can't expect overlay invisibility and images to get along. This commit uses the previously stashed undisplayer functions to actually remove the images from the buffer. When the image is toggled, it is essentially redisplayed from scratch, using the previously

[PATCH 3/4] emacs: save image redisplay data during non-lazy display

2023-09-16 Thread David Bremner
This data will eventually be used to redisplay hidden images. A certain amount of refactoring is done here to avoid code duplication. --- emacs/notmuch-show.el | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index

[PATCH 2/4] emacs/show: save redisplay redisplay data when showing lazy part.

2023-09-16 Thread David Bremner
This data will be used to redisplay an image that is hidden by deleting it from the buffer. We cannot easily delay until the image is hidden, as we won't have the original data at that point. --- emacs/notmuch-show.el | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

Fix image toggling for emacs 29.1

2023-09-16 Thread David Bremner
This obsoletes the WIP patch at id:20230903114215.60583-1-da...@tethera.net The main changes are breaking the patch up into more managable pieces, and only saving redisplay data for images. I am more or less satisfied with the performance impact of this change. I ran the following test

Re: automatically changing FCC when From changes (or fill FCC only when sending)

2023-09-16 Thread David Bremner
David Pinto writes: > > My case is that I have multiple email accounts and want the sent > messages saved on different directories based on the "From" address. > I've setup 'notmuch-fcc-dirs' accordingly. Now, when I start > composing a message (notmuch-user-agent), the FCC header is set to >

[PATCH] devel/nmweb: read mail files in binary mode.

2023-09-16 Thread David Bremner
"ju" reported on IRC that browsing https://nmbug.notmuchmail.org/nmweb/show/20160719094205.qmf5sjnja6crt5t3%40gotlib crashed. The underlying issue is that python3 defaults to utf8 decoding files unless they are opened in binary mode. The file in question (in the nmbug archive; it depends a

automatically changing FCC when From changes (or fill FCC only when sending)

2023-09-16 Thread David Pinto
Hi everyone I've recently started using notmuch and I've found it works amazing. It's so fast! Thank you. However, I've been struggling a lot with saving sent messages in the right place (Emacs notmuch-user-agent). I think I finally got to the bottom of it and maybe I just had the wrong