[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shr using `make-xwidget' incorrectly

From: Po Lu
Subject: Re: shr using `make-xwidget' incorrectly
Date: Thu, 11 Nov 2021 11:38:05 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Lars, you might want to know that `make-xwidget', invoked without a
>> buffer argument, will create an xwidget attached to the current buffer.
>> That xwidget won't be killed until you kill the buffer it's attached to.

> Can't we fix that, though?  The xwidget code could check whether it's
> still displayed and then kill itself it it's not.  It could work along
> the lines of the `evaporate' overlay property mechanism, perhaps.

It's not a bug, but how xwidgets are designed, not unlike asynch
processes that have a buffer.

I find nothing wrong with this design of the xwidget system.

However, randomly killing xwidgets based on whether or not they are
displayed would be undesirable: xwidgets have a lot of state that cannot
be reconstituted through recreating them, and creating them takes a long
time and a lot of memory.

>> I think the best thing to do in this case would be to introduce a
>> `dead' state for xwidgets, not unlike killed buffers and dead frames,
>> which an xwidget is set to after being killed.
>> Then, performing any sort of operation on a killed xwidget can either
>> throw an error, or do nothing.

> Sounds good to me.

Nice, I'll start working on it.  Thanks.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]