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

From: martin rudalics <[email-masked]>
Date: Sun, 29 Sep 2024 16:17:08 +0200

> If you mean that Emacs switches to a buffer whose name matches
 > switch-to-prev-buffer-skip-regexp when there are no other buffers to
 > show, then this is the intended behavior, I think.  Martin, am I
 > right?

I don't know about 'switch-to-prev-buffer-skip-regexp'.  Here I have
set 'switch-to-prev-buffer-skip' to the function

(defun skip-undisplayed-buffers (_window buffer _bury-or-kill)
   "Function for `switch-to-prev-buffer-skip'.
Skip BUFFER if it has never been displayed before."
   (zerop (buffer-local-value 'buffer-display-count buffer)))

(setq switch-to-prev-buffer-skip 'skip-undisplayed-buffers)

Now with emacs -Q evaluate that in *scratch* and do C-x <left>.  Gets me
"No previous buffer" and *scratch* stays.  I think the same should
happen if 'switch-to-prev-buffer-skip-regexp' matches *Messages*.  What
is the value of that variable?

martin