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

From: Eli Zaretskii <[email-masked]>
Date: Sat, 05 Oct 2024 13:31:48 +0300

> Date: Sun, 29 Sep 2024 17:49:35 +0200
> From: martin rudalics <[email-masked]>
> Cc: [email-masked]
> 
>  > What
>  > is the value of that variable?
> 
> Found as:
> 
> (setq switch-to-prev-buffer-skip-regexp "\\*[^*]+\\*")
> 
> And the explanation is this snippet from 'switch-to-prev-buffer':
> 
>        (when (and skipped (not (functionp switch-to-prev-buffer-skip)))
>          ;; Show first skipped buffer, unless skip was a function.
> 	(setq new-buffer skipped)
> 	(set-window-buffer-start-and-point window new-buffer)))
> 
> That is, if the regexp excludes a specific buffer but
> 'switch-to-prev-buffer' didn't find another suitable buffer, it switches
> to the first excluded buffer.  The Elisp manual is clear about this:
> 
>       This user option should be either a regular expression or a list of
>       regular expressions.  Buffers whose names match one of those
>       regular expressions will be ignored by ‘switch-to-prev-buffer’ and
>       ‘switch-to-next-buffer’ (except when there’s no other buffer to
>       switch to).

Thanks, I've now added this caveat to the variable's doc string, and
I'm therefore closing this bug.