From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: shr using `make-xwidget' incorrectly Date: Thu, 11 Nov 2021 04:26:11 +0100 Message-ID: <87fss3e5kc.fsf@gnus.org> References: <87sfw31mok.fsf.ref@yahoo.com> <87sfw31mok.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35444"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Po Lu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 11 04:27:01 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ml0jr-00090P-KO for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 04:26:59 +0100 Original-Received: from localhost ([::1]:58672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ml0jq-0007DU-E3 for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Nov 2021 22:26:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml0jH-00068o-1I for emacs-devel@gnu.org; Wed, 10 Nov 2021 22:26:23 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=38564 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml0jF-00005M-ED for emacs-devel@gnu.org; Wed, 10 Nov 2021 22:26:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6Mxg2C5jFNsCBs2dSA76jlMHQe5DxafnsgzQQ7F115Q=; b=KGTkhhYmHMM4Yr1etU5iVxCnwe y/bP6WxgnoGxlDX3v9pN20cb7BK2/XjlT4dMFoTjYdQ9OTRStvzCQQ49Ww9puP45sx/Ucr/MRw34S WnyPotrQ5lJWWtLvWa0rVPZ+9evZX3/7c5B1mQopprzvjVa6lYaNjz8aOjXP0HcmlIos=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ml0jA-0001r0-5I; Thu, 11 Nov 2021 04:26:19 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEVKLCVPLCORZE60 ln7///8IGfnBAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+ULCwIsAv43SG0AAAF7SURBVDjLnZPbecMg DIUFXQBpAkss0MD+u+UIgQ1t+lISXz5+ju4m8sXMheJtPsfKGiBtYDxaA+CUBbu3EueMzBWcK+5S SEoA6larmTWr+GM1NQ1Qe++ttZe11jvAq9sAr3FcrSXDfayhsG9iQVwFLljhazmvl6cB8NWrtQ1g pUGG7iMIYfkDMH0AttVsAYEDMfsB2PeUkQCuEkenwsG8gkwgSC5ylgOQ+AaKCHMs1wHuJSgURdO8 JSYakKetUGQPKVudTnbnEEgNSZiaecC5aDRCd4DzHi5a2ZzeILHXW7zDw1q5o0KdFNNVretSBMiY J0qXR9Rsz8PfvegiHu71APhIiCp5cWWWdzo33KIksyEBxEEMo6luCo9FvYO1rX6EjyLjuAfBuyni 0Tux7atJtI0JIJ+K2IcGfnifRFpjpc/E7abQimfinn1vCK5TwZnHRyMo12nKR45H1Kct7wnT+g5O gn2Jz2CBmRDj5xlS+qUow9YqxgbudP+53hVgPjdMzr2BAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIx LTExLTExVDAyOjQ0OjAyKzAwOjAwzg6UZAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMS0xMVQw Mjo0NDowMiswMDowML9TLNgAAAAASUVORK5CYII= X-Now-Playing: Fairport Convention's _Come All Ye (5)_: "Reynard the Fox" In-Reply-To: <87sfw31mok.fsf@yahoo.com> (Po Lu's message of "Thu, 11 Nov 2021 09:54:51 +0800") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279214 Archived-At: Po Lu 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. > Which reminds me of another problem (in the Emacs 28 xwidget code as > well): If an xwidget's buffer is killed, but references to it still > exist somewhere, crashes can happen, because the GTK resources allocated > to the xwidget are killed in `kill_buffer_xwidgets' and not during > garbage collection. Yes, I've experienced that once already while testing. > 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. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no