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


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 32850-done <at> debbugs.gnu.org
Subject: bug#32850: 27.0.50; window-swap-states doesn't swap window prev/next-buffers
Date: Wed, 17 Oct 2018 09:31:37 +0200
> I'd like to make it customizable by using the existing customization in
> the arg WRITABLE of window-state-get and window-persistent-parameters,
> even though formally prev/next-buffers is not a window parameter (maybe
> it should be, I don't know).

Always keep in mind that prev_buffers and next_buffers need special
treatment in mark_object to make sure that dead buffers from window
configurations stored somewhere (for example in a register) get their
entries deleted and can be eventually reclaimed.  This is something I
completely disregarded when writing the original code for navigating
these buffer lists.  Stefan then wrote the code to do that in
mark_object.

> Done, with a small change: even though set-marker is idempotent in regard
> to its POSITION arg (i.e. if POSITION is a marker, it creates an identical
> marker), I added a check to not create a new one.  OTOH, get-buffer is
> idempotent too, but it seems window-state-put never receives a structure
> with buffer objects, and I'm not sure why window-state-get should always
> use buffer-name regardless of the value WRITABLE, i.e. why should it return
> buffer names as strings instead of buffer objects even when WRITABLE is nil?

Maybe because I didn't care about non-writable states back then.  But
you're obviously right.  Buffers can be renamed at will and in that
case we might have a state with a non-existent buffer or even buffers
with names switched and therefore invalid values of start or point.

So yes: Please use a buffer object for non-writable states.

martin




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.