From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: shr using `make-xwidget' incorrectly Date: Thu, 11 Nov 2021 11:38:05 +0800 Message-ID: <87czn71hwi.fsf@yahoo.com> References: <87sfw31mok.fsf.ref@yahoo.com> <87sfw31mok.fsf@yahoo.com> <87fss3e5kc.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11256"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.60 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 11 04:39:26 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 1ml0vt-0002mZ-Jm for ged-emacs-devel@m.gmane-mx.org; Thu, 11 Nov 2021 04:39:25 +0100 Original-Received: from localhost ([::1]:34328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ml0vr-0002gl-RW for ged-emacs-devel@m.gmane-mx.org; Wed, 10 Nov 2021 22:39:23 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ml0us-0001lV-Ar for emacs-devel@gnu.org; Wed, 10 Nov 2021 22:38:22 -0500 Original-Received: from sonic315-22.consmr.mail.ne1.yahoo.com ([66.163.190.148]:33305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ml0up-0001bx-LA for emacs-devel@gnu.org; Wed, 10 Nov 2021 22:38:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1636601897; bh=sCw3HQObkwdR7fLF2gjFlv0oRvOMFM2mT8frlD9DD7Y=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=B1speeKgPZYUM7g/M3bLg8zCffIZU348sO/98gAXVULrm8/6UXiSzb05cNyKnnttyqPU2yYQ3/Ga6+j/UMrnV/tgwj3aJeMujolR3NqTOMpUHx5SLjD/sVgjqyjMt94Fw9EeGhkrMmHEYMqYxZ9Dg/llVJbySJxxNnirjTG5qJ4cprsnrvjEJNWwiOwp152BdxpP0qS3QEsLWFX+t/4ujZ46lm26+J4Av1ICQvOgfTa1QBgV/R2dhQFQF5sd0cST+yexOvNvooB9C4dPPk35YyQwYPR0SQ9C7z7JJna82AY5nlmy8MR7zX36+4as9puPxVekKxGQwPyZlrGwz0ufcQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1636601897; bh=Xk8vIi2aO10qU0sG9xCD6BEMBb7Bp1XPvfA9zba6TMS=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=QqiMrZbb+ZzkUepWbe/sDzCMDWPdqazzHLvbGtLgmgn+VFr/cPmUWlO/Vgu0URYwGkfCm/+4DNVssje2SFDVwnfRmpGSaNZMamLFC9dIJasWliLDpIEFbAltx0uJ6rC6xrTJKQqb/ymH0xzMkYNfAL2zM22oQBGz0wlvUClhItYngnzHn0YuhiD8hmqE9hhD4HU6qtICbvYpTe8oQnn1qfkviAC69gDFiUuKilHdkIilkCnMOKFfAtYUC3tly/UL1znmr6FVKAt2oEE4PYk/j40oFOgpayTqh8e+B9ph+jOdYdcB+JhlF8BW+q0oktkKt0K8kAkfA2hpXs6BLpFTTg== X-YMail-OSG: i58tUrQVM1n2yfhbTMUa7kjZAF.7qzFeJHCMfTtSw7q9Xl4tmRbkGgKMsKb2XBA przy32geGAIUn7PjYLBWqPsvWbc15Cw8xjUbEScDZpphjkTGcvV.z.VEa0qzjI0jUcknfLFpy.kb J3INXVZyKVqbZqbtxxVd8aj7_P3_nLBOFtUtab.lAsELu7a0OATiGPAgM8gx2cSTcwOur4dIQM2p bdi96EOqyLBOgW7728CYlwImZ8TCAzUVChUA3lTGOPKe1KO67qsmp3EGUQtSrr4gYCvO4V4ZrQDd AdKxUcTxl_gHmAfX6KQ.Rz9w15L32J40Jq4PcuC36Le5TgIuFl9mtNyxITMiOWY2uqj6AW2gLbVl komaTFp3_fXWz0HhaKkRsE55Pc8JzDc9qSgNb3w9I2wjux7aC3jQItAlqxDbb.GWFUwPshwxtpLS ot7KDaI0eIHc8FACk3DSxZosw.Yis2ky9JRdee3k62zSFrKNo9iGfnNfnPsay8O7TntWQYk356TW vjUXR8bSejC2A_kt6baba1DL4Cjt061CiRfA8ur0c9e39VRqRbbB4I5gaNKY6sRYNEd2TZXKr4Ms WdaScsG8WGmT11vccOX5IZirbZHIq2Pz9mELc_uxbrKnAjABrbQi4GkTAj45yV.TcWRo2nignu80 MFG6HCYGgzCRP06PTbFwwGfjNpZdFt7WTksNioThDs4MFrX4XrXc9HtjXn6CMfkOaqWowMybSyhD mZvOVGGcgD2Ghqj5obnZ5tkRbdnbKV1C_CKaR1AFSOtiP1cViGqVirLCbmZXT3nL1JiEZkg9kZb7 wbCYEGmb0gwrWMEV5WGFFUjcMsoMGHHINExeTEUQJt X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Thu, 11 Nov 2021 03:38:17 +0000 Original-Received: by kubenode514.mail-prod1.omega.sg3.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 6c26b4ec38e7c89e99b95794d09624ac; Thu, 11 Nov 2021 03:38:10 +0000 (UTC) In-Reply-To: <87fss3e5kc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 11 Nov 2021 04:26:11 +0100") X-Mailer: WebService/1.1.19306 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.190.148; envelope-from=luangruo@yahoo.com; helo=sonic315-22.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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:279215 Archived-At: Lars Ingebrigtsen 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.