unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Adam Porter <adam@alphapapa.net>
Cc: 69837@debbugs.gnu.org
Subject: bug#69837: 29.2; vtable-update-object only works in visible windows
Date: Mon, 18 Mar 2024 19:05:17 +0200	[thread overview]
Message-ID: <86h6h34gj6.fsf@gnu.org> (raw)
In-Reply-To: <525dbe6a-b673-4993-aace-169d09c6b8f0@alphapapa.net> (message from Adam Porter on Sun, 17 Mar 2024 21:05:56 -0500)

> Date: Sun, 17 Mar 2024 21:05:56 -0500
> Cc: 69837@debbugs.gnu.org
> From: Adam Porter <adam@alphapapa.net>
> 
> Hi Eli,
> 
> On 3/17/24 01:25, Eli Zaretskii wrote:
> >> Date: Sat, 16 Mar 2024 22:41:37 -0500
> >> From: Adam Porter <adam@alphapapa.net>
> >>
> >> 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.





  reply	other threads:[~2024-03-18 17:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-17  3:41 bug#69837: 29.2; vtable-update-object only works in visible windows Adam Porter
2024-03-17  6:25 ` Eli Zaretskii
2024-03-18  2:05   ` Adam Porter
2024-03-18 17:05     ` Eli Zaretskii [this message]
2024-03-20  1:41       ` Adam Porter
2024-03-21  8:36       ` Adam Porter
2024-04-06 11:22         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86h6h34gj6.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69837@debbugs.gnu.org \
    --cc=adam@alphapapa.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).