Subject: Re: bug#32790: 27.0.50; point jumps unexpectedly after delete-window

From: martin rudalics <[email-masked]>
Date: Wed, 28 Nov 2018 09:33:16 +0100

> +  "If non-nil, have `switch-to-buffer' run `pop-to-buffer-same-window'.
 > +This means that when switching the buffer it respects display actions
 > +specified for `display-buffer'.  So `switch-to-buffer' will display the
 > +buffer in the window specified by the ACTION argument of `display-buffer',
 > +or by the rules in `display-buffer-alist' and other related variables."

I don't think this is right because 'switch-to-buffer' does not have a
display action it can pass to 'display-buffer'.  The behavior is
subject to 'display-buffer-overriding-action', 'display-buffer-alist'
and other related variables alone IIUC.

Furthermore, the doc-string of 'switch-to-buffer' should be amended
like:

If the option 'switch-to-buffer-obey-display-actions' is non-nil, run
the function 'pop-to-buffer-same-window' instead.  This may display
the buffer in an arbitrary window as specified by
'display-buffer-overriding-action', 'display-buffer-alist' and other
display related variables.  If this results in displaying the buffer
in the selected window, window start and point are adjusted as
prescribed by the option `switch-to-buffer-preserve-window-point'.
Otherwise, these are left alone.

And the following part of the doc-string

   If optional argument FORCE-SAME-WINDOW is non-nil, the buffer
   must be displayed in the selected window when called
   non-interactively; if that is impossible, signal an error rather
   than calling `pop-to-buffer'.

is presumably invalid when 'switch-to-buffer-obey-display-actions' is
non-nil.  Right?

martin