GNU bug report logs - #74361
[PATCH] New option xref-navigation-display-window-action

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dmitry <at> gutov.dev>

Date: Thu, 14 Nov 2024 22:30:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 31.1

Full log


Message #224 received at 74361 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 74361 <at> debbugs.gnu.org
Subject: Re: bug#74361: [PATCH] New option
 xref-navigation-display-window-action
Date: Sun, 8 Dec 2024 17:55:39 +0100
>> 'display-buffer' per se doesn't care about the current buffer.  The
>> assumption that the selected window also holds the current buffer is
>> nowhere guaranteed.  Just think of 'display-buffer' running from a
>> timer.
>
> I meant the buffer that was current at the beginning of the command:
> (window-buffer (old-selected-window)).

The doc-string of 'old-selected-window' says

  The return value is the window selected the last time window change
  functions were run.

One and the same command may encompass an arbitrary number of redisplays
(think of a command reading the minibuffer) which all may affect the
return value of that function.  So there is no guarantee that
'old-selected-window' will get you what you expect.

martin




This bug report was last modified 171 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.