GNU bug report logs - #78785
29.3; docs: switch-to-prev-buffer-skip is hard to find

Previous Next

Package: emacs;

Reported by: Chris Hibbert <hibbert <at> mydruthers.com>

Date: Fri, 13 Jun 2025 15:14:02 UTC

Severity: normal

Found in version 29.3

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Drew Adams <drew.adams <at> oracle.com>, Eli Zaretskii <eliz <at> gnu.org>, Chris Hibbert <hibbert <at> mydruthers.com>
Cc: "78785 <at> debbugs.gnu.org" <78785 <at> debbugs.gnu.org>
Subject: bug#78785: 29.3; docs: switch-to-prev-buffer-skip is hard to find
Date: Tue, 17 Jun 2025 12:58:43 +0200
> And please mention it in (elisp) `Window History'.  In Emacs
> 30.1, that doc says nothing about the relation between option
> `switch-to-prev-buffer-skip' and `kill-buffer'.

'kill-buffer' calls 'replace-buffer-in-windows' which is documented in
the Elisp manual as

     This function calls ‘replace-buffer-in-windows’ for cleaning up all
     windows currently displaying the buffer to be killed.

'replace-buffer-in-windows' calls 'switch-to-prev-buffer' documented as

     The replacement buffer in each window is usually chosen via
     ‘switch-to-prev-buffer’ (*note Window History::).

'switch-to-prev-buffer' consults 'switch-to-prev-buffer-skip' documented
as

     The option ‘switch-to-prev-buffer-skip’ described below can be used
     to inhibit switching to certain buffers, for example, to those
     already shown in another window.

> That's
> probably because there's no `kill-buffer-quit-windows' in 30.1,
> but for 30.2+ it should be mentioned, I think.

'kill-buffer-quit-windows' will be in Emacs 31.  You will have to read
its documentation there.

> Doesn't the nil default value of `switch-to-prev-buffer-skip'
> also mean a change in the default behavior for `kill-buffer'?
> If so, one can wonder why the longstanding _default_ behavior
> was changed.  Please mention this change in NEWS.

I don't remember the sequence of events leading to the present behavior.
I'll let Eli decide if mentioning any change in NEWS is needed.

> In addition to those two "related, but different behaviors"
> being coupled in the way you say, there's the coupling of
> previous-buffer behaviors _in general_ with `kill-buffer's
> own use of such a behavior.
>
> In the past this coupling wasn't a problem, but now it seems
> there can be a difference between what a user might want for
> `kill-buffer' and what they might want for other uses of
> previous-buffer handling - no?  How can a user tell Emacs
> what window-handling behavior to use wrt `kill-buffer', and
> distinguish that from the behavior wanted for other
> previous-buffer uses?

The coupling of 'switch-to-prev-buffer', 'quit-window' and 'kill-buffer'
has indeed become tighter because users wanted that.  You will have to
consult the discussions here and on emacs-devel for further details.

martin

This bug report was last modified 58 days ago.

Previous Next


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