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: Sun, 17 Mar 2024 21:05:56 -0500 Message-ID: <525dbe6a-b673-4993-aace-169d09c6b8f0@alphapapa.net> References: <1388eaa8-ae65-43f9-9438-d5bab59f20d8@alphapapa.net> <867ci15q8l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15980"; 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 Mon Mar 18 03:06:48 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 1rm2Ok-0003vu-LK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Mar 2024 03:06:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rm2OR-0004Ns-Nn; Sun, 17 Mar 2024 22:06:27 -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 1rm2OP-0004Ni-GA for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2024 22:06:25 -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 1rm2OP-0005fB-8R for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2024 22:06:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rm2P0-0003Pi-E6 for bug-gnu-emacs@gnu.org; Sun, 17 Mar 2024 22:07: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: Mon, 18 Mar 2024 02:07: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.171072760013091 (code B ref 69837); Mon, 18 Mar 2024 02:07:02 +0000 Original-Received: (at 69837) by debbugs.gnu.org; 18 Mar 2024 02:06:40 +0000 Original-Received: from localhost ([127.0.0.1]:53541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rm2Od-0003P5-QK for submit@debbugs.gnu.org; Sun, 17 Mar 2024 22:06:40 -0400 Original-Received: from dormouse.elm.relay.mailchannels.net ([23.83.212.50]:47343) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rm2Ob-0003Ov-6e for 69837@debbugs.gnu.org; Sun, 17 Mar 2024 22:06:38 -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 258C98410BC; Mon, 18 Mar 2024 02:05:58 +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 BC12984147F; Mon, 18 Mar 2024 02:05:57 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1710727557; a=rsa-sha256; cv=none; b=lVc2EDPyPcuZGqmkcfbHMf5vW1VJ7mz9A+CpAqDrr6t4+nsJGYI4VbOb7feGEq5OY79nUT d7FOWybt8szWRK0oRFxlEw+sm+GTOggLAtzDgWTN+HX5x2fflrrQGukhS2ro7G3Rz9oGNx 9STr2qYQ7y/jnRIE4oJOyC/O5RwVlmWUo7OCbi0ECaqDwAkSpfkVfDL+FHv5FrZNlCkuAA EctCRglZ9iQsdSUsfPOisiUHIRpD+qFsocW8RRGQTLuCfmzUDP9VEYmjcP98GYhsEfIewh 0aFiVtMwn2KU6lFsq67jp57bOV0XQcjj03XSUTFDBWBVUey84hdIwtqM67KHtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1710727557; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6z/yOJ423feOtGwHvCPC4ZgGT+nVfho2j6BY+6Dbnwg=; b=oMoROOHjEsUrbJqiC0Z/NGEj0ilBaFYDnC2sFiT64sgDvX+so6D8O7Xf1wB6+r5nQSCWJt zi/EFq3e2kQTZEeA+IPV70128+jQTYO7p56sZN81YbktxPQmTAFB3S4BUiQdSUdAdfTxMG CnXYtf3TjMIwU6lGyTcXTusn/TrJQVlJxc94e8j79uEZaVkBEYNKHnadWL6dFB0HpTk96d cmaNRUQHRuu2USok/crABzJrOSUnVRMnfCgobQnbkJX/CYQZyR7Iu2fYtfS94Nk1tjK3Yg Dj1ZW8tfp0j+eS7+2ipR3qbgYV8r1RqW5dch77FF11XBPYhtUdJcPBz1z3kNPg== ARC-Authentication-Results: i=1; rspamd-b46fcdc5-ctgkd; 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-Reign-Illegal: 1ce814c47c7d6b43_1710727558006_377840532 X-MC-Loop-Signature: 1710727558006:3868035229 X-MC-Ingress-Time: 1710727558006 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.99.130.139 (trex/6.9.2); Mon, 18 Mar 2024 02:05:58 +0000 Original-Received: from [10.28.0.30] (unknown [45.131.192.18]) (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 4TydVs2DnMz7w; Sun, 17 Mar 2024 19:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1710727557; bh=6z/yOJ423feOtGwHvCPC4ZgGT+nVfho2j6BY+6Dbnwg=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=ceZWCDkT6wmxKqMkGQtg71ryzBq7CxJtPMG5NB2hAaMpQ9iUa7056xtlS6zFzSaV+ HBuDs5e4ajlL1iDWKvruXFiS6eaq63tfKtCCg8ZAISps0cyqBTqKW3TgN+qI8ZCuwB NY4lsXo5mGA7nzcLusJ/mdnI8xciff85LkvZsRqouVo+75EKGZsCCBzP4IGbmLPQ45 zEUH2mE6/fxBlHN2Q5CRb6jOwy4OQjCGiFQPasbSxO+9gRa7Hlhjl1e6pQx5fDlfFC 8jmMUwF/xpOp3UUUyPgXO/Z0s1vW5SDeEoz1XnSGDEQOCMTREK33Jmx8/XXfA20vt4 Il9JEd+WEddyA== Content-Language: en-US In-Reply-To: <867ci15q8l.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:281788 Archived-At: Hi Eli, On 3/17/24 01:25, Eli Zaretskii wrote: >> Date: Sat, 16 Mar 2024 22:41:37 -0500 >> From: Adam Porter >> >> I've discovered that `vtable-update-object' only works in buffers that >> are in visible windows. When trying to update vtables in buffers that >> aren't, the object being updated or replaced fails to be found in the >> cache, apparently because `vtable--cache-key' uses `window-width' in its >> value (so maybe if, when the vtable buffer is not visible, the selected >> window happens to have the same width as the window in which the vtable >> buffer was previously displayed, it will work by chance). > > Does using with-selected-window help to solve the issue? Sometimes, but not reliably, because it doesn't matter whether the window is selected (and the buffer might not have a window, anyway). I'll try to give a step-by-step explanation: 1. vtable-update-object looks in the vtable's cache to find the cached information about the representation of the object being updated or replaced. 2. In the process of doing that, it calls vtable--cache-key, which returns a cons cell containing the frame-terminal and window-width. 3. So if the selected frame is on the same terminal, and the selected window has the same width, as the ones when the vtable was last generated, the cache key will match. This will allow vtable-update-object to access the cached values and look for the object in them. But if the terminal is different, or if the selected window's width is different, the cache key will be different, so vtable-update-object will fail, even when it could potentially succeed. In my case, the vtable's buffer is (or can be) in a window that is in a non-current tab (using tab-bar-mode) in the same frame, so its window is not visible. And so if the selected window in the current tab has the same width as the vtable's window, vtable-update-object may work. But if the widths don't match, it will fail. (I suppose it may also fail if the vtable's buffer's window is visible but has changed width since the vtable was generated, but I haven't tested that.) > If not, can you show a recipe, starting from "emacs -Q", that > reproduces the problem, so we could study it in more detail? I had hoped to avoid writing that much code to demonstrate it. But if the explanation above doesn't suffice, let me know and I will. Thanks, Adam