GNU bug report logs - #32850
27.0.50; window-swap-states doesn't swap window prev/next-buffers

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Thu, 27 Sep 2018 00:06:02 UTC

Severity: minor

Found in version 27.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


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

From: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 32850 <at> debbugs.gnu.org
Subject: Re: bug#32850: 27.0.50;
 window-swap-states doesn't swap window prev/next-buffers
Date: Fri, 19 Oct 2018 01:37:11 +0300
>> When testing the previous patch, I noticed that killed buffers automatically
>> disappear from prev/next-buffers lists, so there are no #<killed buffer> remains.
>> Is it handled by code in kill-buffer?
>
> 'kill-buffer' calls 'replace-buffer-in-windows' which, if the window
> doesn't show the buffer, calls 'unrecord-window-buffer' which removes
> the buffer from the respective lists.  But 'replace-buffer-in-windows'
> handles only live windows, it can't look into window configurations.

If we had a function that can look into window states, then a user
could put it on kill-buffer-hook to look into window states stored
in user variables.  It would be useful to have a function to check if
a buffer exists in window state: often there is a need not to kill
a buffer if it's stored in some window state variable (so restoring
a saved window state will always show the same buffers as before).

>> What do you think about creating new functions to convert the existing
>> states from non-writable to writable and back?  Then in the same session
>> it would be more optimal to use window states with buffer/mark objects,
>> and states to save to the desktop could be serialized by such functions.
>
> It would be interesting to have such a thing.  One could use it to
> handle conversion of non-writable objects to writable ones (I always
> wondered how desktop would handle non-writable values in say
> 'dedicated' or a window parameter) and back.  But we don't yet have a
> sufficiently reliable mechanism for providing a serializable value for
> a number of our objects - in particular windows and frames.

A serializable value of window objects are window states.  By analogy with
the eq/equal dichotomy, window objects can be compared with ‘eq’, and
window states with ‘equal’.




This bug report was last modified 6 years and 183 days ago.

Previous Next


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