Subject: Re: bug#73545: 30.0.91; Strange behaviour on switch-to-next-buffer

From: martin rudalics <[email-masked]>
Date: Fri, 4 Oct 2024 10:07:47 +0200

> I just found a bit strange the default behaviour (I guess I am biased by
 > my use case) being this way.

Historical reasons.  'switch-to-prev-buffer-skip' appeared in Emacs 27.1
and at that time I decided that if and only if it is a function it will
make sure that the buffer is never switched to.  More or less to avoid
that peoples shoot themselves in their feet.

'switch-to-prev-buffer-skip-regexp' was added in Emacs 29.1 introducing
the following design error (which I wouldn't propose to exploit).  With
emacs -Q do:

(setq switch-to-prev-buffer-skip-regexp "\\*[^*]+\\*")
(setq switch-to-prev-buffer-skip 'ignore)
C-x <left>

The fact that 'switch-to-prev-buffer-skip' was set to a function that
does nothing makes 'switch-to-prev-buffer-skip-regexp' miraculously
work when there are no other buffers left ...

'switch-to-prev-buffer-skip-regexp' should never have been added in the
first place.  Rather 'switch-to-prev-buffer-skip' should have been given
an optional regexp value.  But now it's too late to change that.

martin