From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69837: 29.2; vtable-update-object only works in visible windows Date: Mon, 18 Mar 2024 19:05:17 +0200 Message-ID: <86h6h34gj6.fsf@gnu.org> References: <1388eaa8-ae65-43f9-9438-d5bab59f20d8@alphapapa.net> <867ci15q8l.fsf@gnu.org> <525dbe6a-b673-4993-aace-169d09c6b8f0@alphapapa.net> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31556"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 69837@debbugs.gnu.org To: Adam Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 18 18:25:47 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 1rmGk4-0007v2-VZ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 18 Mar 2024 18:25:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rmGjn-00071y-86; Mon, 18 Mar 2024 13:25: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 1rmGjl-00071a-Cw for bug-gnu-emacs@gnu.org; Mon, 18 Mar 2024 13:25: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 1rmGjl-0000bl-22 for bug-gnu-emacs@gnu.org; Mon, 18 Mar 2024 13:25:25 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rmGkM-0006s8-KA for bug-gnu-emacs@gnu.org; Mon, 18 Mar 2024 13:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 18 Mar 2024 17:26: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.171078271426306 (code B ref 69837); Mon, 18 Mar 2024 17:26:02 +0000 Original-Received: (at 69837) by debbugs.gnu.org; 18 Mar 2024 17:25:14 +0000 Original-Received: from localhost ([127.0.0.1]:34733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmGjZ-0006qD-Fk for submit@debbugs.gnu.org; Mon, 18 Mar 2024 13:25:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rmGVi-0006Dv-0Y for 69837@debbugs.gnu.org; Mon, 18 Mar 2024 13:10:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rmGQP-00050j-CD; Mon, 18 Mar 2024 13:05:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=YZKX0PyxUFcsFkvBy3d4ONUAUNNqDaX+GLfwlNy/NwM=; b=Ovtzzf5XCL/C TBkab9g2l8GuDJdttMmQytCpTUZkZIKqK6N29pCVS/4cIiJrXEFnekZa4GbdRgRbBBj8LSfemZRC7 bS9PPbMrC8tzDymNTPNkWZfp/0Mj4Z8p/eUg3pOWK3c+1s8K3bpzkoh8wCXZZmNmgJEvw4ZCBwWKm 2t9Ax/7Hi90przBBUnDdr2XLYFDOYD7AZSqF+icLnbqrop1661kW1oqFsWY5jyESzum6YQfG4XfqL EhDrBJNAdDjUwsmBEziSAyzI6Iae+9KDRJxwpMuLdKyKA3UOFNv2y3fmVwAFjrh3o3K1TFuECJbd4 w4byaG+ylFhNwhel+uoqoQ==; In-Reply-To: <525dbe6a-b673-4993-aace-169d09c6b8f0@alphapapa.net> (message from Adam Porter on Sun, 17 Mar 2024 21:05:56 -0500) 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:281813 Archived-At: > Date: Sun, 17 Mar 2024 21:05:56 -0500 > Cc: 69837@debbugs.gnu.org > From: Adam Porter > > 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: I'm sorry, I'm not familiar with the design of vtable, so I will have to ask you possibly stupid questions. Apologies in advance. > 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. Is this cache used just to speed up something (and so if the object is not in the cache, Emacs will just work harder to obtain the same information), or is finding the object in the cache absolutely necessary for working with the object? > 2. In the process of doing that, it calls vtable--cache-key, which > returns a cons cell containing the frame-terminal and window-width. If working with an object needs its window-width, does it mean objects are tightly coupled to their windows? If so, what happens when the user or Emacs resizes the window? are the cached objects recomputed to reflect that? > 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. This again seems to imply that an object is tightly coupled to its window, and changes affecting the window must recompute the cached value. Right? Are these keys (window-width, terminal, etc.) only used to look up the object, or are they needed for processing the objects as well? > > 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. It doesn't have to be code, it could be a (possibly long) list of instructions what to type.