From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.bugs Subject: bug#69837: 29.2; vtable-update-object only works in visible windows Date: Thu, 21 Mar 2024 03:36:02 -0500 Message-ID: <8e2fb7a9-202e-45c9-ab2d-c2cd6395d590@alphapapa.net> References: <1388eaa8-ae65-43f9-9438-d5bab59f20d8@alphapapa.net> <867ci15q8l.fsf@gnu.org> <525dbe6a-b673-4993-aace-169d09c6b8f0@alphapapa.net> <86h6h34gj6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------NRnrhQQONKbAk4B0uuD49IjU" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24022"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 69837@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 21 09:36:39 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rnDug-00063z-IZ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Mar 2024 09:36:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnDuS-0006Ke-4p; Thu, 21 Mar 2024 04:36:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnDuQ-0006KM-HL for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 04:36:22 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnDuQ-0000o8-95 for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 04:36:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnDv4-0003Kp-3O for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 04:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Adam Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Mar 2024 08:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69837 X-GNU-PR-Package: emacs Original-Received: via spool by 69837-submit@debbugs.gnu.org id=B69837.171101021212802 (code B ref 69837); Thu, 21 Mar 2024 08:37:02 +0000 Original-Received: (at 69837) by debbugs.gnu.org; 21 Mar 2024 08:36:52 +0000 Original-Received: from localhost ([127.0.0.1]:34235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnDuu-0003KQ-Ca for submit@debbugs.gnu.org; Thu, 21 Mar 2024 04:36:52 -0400 Original-Received: from hedgehog.birch.relay.mailchannels.net ([23.83.209.81]:34945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnDuq-0003KD-NX for 69837@debbugs.gnu.org; Thu, 21 Mar 2024 04:36:50 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 90387760717; Thu, 21 Mar 2024 08:36:07 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a313.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 0BFCF76113A; Thu, 21 Mar 2024 08:36:04 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1711010164; a=rsa-sha256; cv=none; b=yj2a6M6ioJV3sbj8H3jvLXgMzu2ymal+HJFOJGR1q2ZVYsXXFOkQKlnTtdjzZUQaonbn8T 41/xNhWDAMXxxRh6SyRc1ok+hqunK6Es0H3VE8nOpgz4GFfNMbTrKvgXxGjPwRusSaoI5z Hl6CHatgA5wCQWVSnwurjHaWtyAM35rS9vNR1ezazYKnVFEb60k1ak1ZTeTeBDrp7hmqgF 6Z/tum0lfQE+94744qYx3UuUEXJkWsddqNcnJhxt0qDrZ7RPabmaFvtAJC/5fLdSomMGei JVFlx/6D4nyIzgD1aJXKjNGr0bY422DrsNCYYoaYG0iJIqhPke+0PJfipYTRcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1711010164; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=oie3e9rXs64Zbj6h313lMhBrxfgUWAnHpHfOo56/8A4=; b=EBswDzSCfqA23zVKNeWVFpWfEf7zP+hSG0/aOb7yq8rsT4veUJp6b8SiSGMMxahi7KUWI5 SgpJKHoMQ7lXBJSlBuKOp4aoZBiadmFLtigay0WlF7w2rmVTmqB5CxqE+ezyGriattzpMt WNe2SimYwAvZ7RggsHNVqm9AwrxHzoinM/Tt/TbzyB4/iO+vXOp1zzpJNEHtlPXM5PNiAv s2vpa4WBiDgIif1bUltZhCeUtlOje4OosO/6GIRl2nfinqO9+IcIu5q+04DmYspkhD9gZp EfdvkG6XWcWgMYv5TZ/RRfcEILBRNRG1z7CUaiUxkZRdy0eVP2aI4i72P523oA== ARC-Authentication-Results: i=1; rspamd-76c7995f89-pdfmt; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Whimsical-Shoe: 389bafb731a68e39_1711010167369_468376420 X-MC-Loop-Signature: 1711010167369:3584957367 X-MC-Ingress-Time: 1711010167369 Original-Received: from pdx1-sub0-mail-a313.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.119.164.55 (trex/6.9.2); Thu, 21 Mar 2024 08:36:07 +0000 Original-Received: from [10.43.2.138] (unknown [193.56.116.15]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a313.dreamhost.com (Postfix) with ESMTPSA id 4V0f1b4Gq7z5h; Thu, 21 Mar 2024 01:36:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1711010163; bh=oie3e9rXs64Zbj6h313lMhBrxfgUWAnHpHfOo56/8A4=; h=Content-Type:Date:Subject:To:Cc:From; b=CNcgkFryDiKEjanZFdUlE39LIRfKXQ5pxI5dKMF9KsfitY1O1xXFVB/2SruR+bid+ kw97iaKb9UqOpofMUb3LKWf9Zl08xNohI32IadhdBXPGevgb60V1IJZolDegJfcPP/ clnLnzMwiyi2hs8DmrQbRmD5vMBAwMbXaXY0dwj2aZ0ZiTLk3PM+UHagTY6nhI60hN VeqUNfWhNcIWKRcTfhQC44czWRvlYVrTnGTuj1LdkQ196NTE1jbCA+hcqgKDz2zbSl FvE5Yf9AjvxTQRkmOSJwTwaj8EY9xTOFUgYZtOA9015M7DIJhIdeTS6CvyksETvF2y jD3065cFJ5n8A== Content-Language: en-US In-Reply-To: <86h6h34gj6.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281886 Archived-At: This is a multi-part message in MIME format. --------------NRnrhQQONKbAk4B0uuD49IjU Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Eli, FWIW, I did some hacking on listen.el attempting to further understand and work around this problem, and I've found what seems to be a usable workaround (for my purposes, anyway). The attached code defines a macro within which I call `listen-queue--vtable-update-object' (which merely incorporates the fix to `vtable-update-object' from bug#69664). As well, I wrap `make-vtable' in a function that also sets two buffer-local variables to the values of `frame-terminal' and `window-width' at the time of the vtable's creation. The macro locally overrides the functions `frame-terminal' and `window-width' to return those saved values. This allows the cache key to match unconditionally, which allows the vtable's objects to be updated even when its buffer is not visible. In my limited testing, it seems to work fine. In my estimation, the consequences of doing this in the worst case would be that the rows for the updated objects might be drawn with some columns at a slightly incorrect width, which is easily rectified by reverting the table (usually bound to "g"). As well, that worst case (e.g. imagining a vtable whose buffer might be initially displayed on one terminal/monitor and later on another with different characteristics) would seem to be relatively rare (so for my project, it seems like an obviously good thing to do). For Emacs itself, I'm not sure what the best fix would be. I suppose a workaround like this could be implemented as a fallback in case the cache key misses; it would seem better to update the object potentially sub-optimally than to error and not update it at all. Another possibility would be to ignore the frame-terminal and window-width in the cache key altogether (i.e. so they would always be assumed to be the same), but I'm sure that Lars did it this way for a reason, so that would seem unwise. Let me know how you'd like me to proceed. Thanks, Adam --------------NRnrhQQONKbAk4B0uuD49IjU Content-Type: text/x-emacs-lisp; charset=UTF-8; name="example.el" Content-Disposition: attachment; filename="example.el" Content-Transfer-Encoding: base64 KGNsLWRlZm1hY3JvIGxpc3Rlbi13aXRoLXZ0YWJsZS1hdCAocG9zaXRpb24gJnJlc3QgYm9k eSkKICAiRklYTUU6IERvY3N0cmluZy4iCiAgKGRlY2xhcmUgKGluZGVudCBkZWZ1bikpCiAg KGxldCAoKHBvc2l0aW9u4bWlIChnZW5zeW0pKSkKICAgIGAobGV0ICgoLHBvc2l0aW9u4bWl ICxwb3NpdGlvbikpCiAgICAgICAoc2F2ZS1leGN1cnNpb24KICAgICAgICAgKGdvdG8tY2hh ciAscG9zaXRpb27htaUpCiAgICAgICAgIChjbC1sZXRmKiAoKChzeW1ib2wtZnVuY3Rpb24g J2ZyYW1lLXRlcm1pbmFsKQogICAgICAgICAgICAgICAgICAgICAobGFtYmRhICgmb3B0aW9u YWwgXykKICAgICAgICAgICAgICAgICAgICAgICBsaXN0ZW4tdnRhYmxlLWZyYW1lLXRlcm1p bmFsKSkKICAgICAgICAgICAgICAgICAgICAoKHN5bWJvbC1mdW5jdGlvbiAnd2luZG93LXdp ZHRoKQogICAgICAgICAgICAgICAgICAgICAobGFtYmRhICgmb3B0aW9uYWwgXyBfKQogICAg ICAgICAgICAgICAgICAgICAgIGxpc3Rlbi12dGFibGUtd2luZG93LXdpZHRoKSkKICAgICAg ICAgICAgICAgICAgICAodGFibGUgKHZ0YWJsZS1jdXJyZW50LXRhYmxlKSkKICAgICAgICAg ICAgICAgICAgICAoKHN5bWJvbC1mdW5jdGlvbiAndnRhYmxlLWN1cnJlbnQtdGFibGUpCiAg ICAgICAgICAgICAgICAgICAgIChsYW1iZGEgKCkKICAgICAgICAgICAgICAgICAgICAgICB0 YWJsZSkpCiAgICAgICAgICAgICAgICAgICAgKChzeW1ib2wtZnVuY3Rpb24gJ3Z0YWJsZS0t cmVjb21wdXRlLW51bWVyaWNhbCkKICAgICAgICAgICAgICAgICAgICAgIydsaXN0ZW4tcXVl dWUtLXZ0YWJsZS0tcmVjb21wdXRlLW51bWVyaWNhbCkpCiAgICAgICAgICAgLEBib2R5KSkp KSkKCihkZWZ2YXItbG9jYWwgbGlzdGVuLXZ0YWJsZS1mcmFtZS10ZXJtaW5hbCBuaWwpCihk ZWZ2YXItbG9jYWwgbGlzdGVuLXZ0YWJsZS13aW5kb3ctd2lkdGggbmlsKQoKKGRlZnVuIGxp c3Rlbi1tYWtlLXZ0YWJsZSAoJnJlc3QgYXJncykKICAoYXBwbHkgIydtYWtlLXZ0YWJsZSBh cmdzKQogIChzZXRxLWxvY2FsIGxpc3Rlbi12dGFibGUtZnJhbWUtdGVybWluYWwgKGZyYW1l LXRlcm1pbmFsKQogICAgICAgICAgICAgIGxpc3Rlbi12dGFibGUtd2luZG93LXdpZHRoICh3 aW5kb3ctd2lkdGgpKSkK --------------NRnrhQQONKbAk4B0uuD49IjU--