Re: Hiding hidden image

Subject: Re: Hiding hidden image

Date: Thu, 31 Aug 2023 13:17:36 +0000

To: Jon Fineman, notmuch@notmuchmail.org

Cc:

From: David Bremner


David Bremner <david@tethera.net> writes:

> David Bremner <david@tethera.net> writes:
>
>> I also noticed that it does not happen for all png image parts, but the
>> pattern of what works and what does not is also unclear to me so far. I
>> observed that the following function
>>
>> (defun hideit ()
>>   (interactive)
>>   (overlay-put (car (last (overlays-at (point)))) 'invisible t))
>
> I think I'm missing something about overlays. The following code
> does not work (i.e. hide the image) unless I extend the overlay to the
> left.
>
> (let ((buf (get-buffer-create "image-buffer"))
>       (img (find-image '((:type xpm :file "attach.xpm"))))
>       (overlay nil))
>   (switch-to-buffer buf)
>   (insert "0123456789")
>   (insert-image img "x")
>   (insert "0123456789")
>   (insert "\n")
>   (setq overlay (make-overlay 11 12))
>   (overlay-put overlay 'invisible t)
>   (message "props=%s" (overlay-properties overlay)))
>
> This behaviour is the same in Emacs 28.2, unlike the problem Jon
> describes with notmuch-emacs.

If I understand the comment from Emacs developer Eli Zaretskii [1]
correctly, the way that notmuch has been hiding images for the last
decade or so was never really supposed to work.

I have started to investigate an alternative strategy of using the
"undisplayer" functions provided by gnus (see the end of
mm-inline-image). I got as far as (permanently) removing the image, but
not restoring it yet. I suspect this method will be more resource
intensive, but it should not matter much since toggling images is not
something that happens for multiple images at a time.


[1]: https://lists.gnu.org/archive/html/emacs-devel/2023-08/msg00593.html
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: