Subject: Re: bug#45844: 27.1; unwanted raising of other frame when emacs is in the backgound and switch-to-buffer is used in a dedicated frame

From: martin rudalics <[email-masked]>
Date: Thu, 14 Jan 2021 08:40:23 +0100

>> And 'pop-to-buffer' makes a new frame because it cannot use the selected
 >> one, raises that frame and even requests input focus for it.
 >
 > There is no need to create a new frame, since the other frame exists in my case,
 > but if pop-to-buffer raises that automatically then it's understandable why
 > it comes to the foreground.
 >
 > A possible solution for this can be checking if pop-to-buffer is called interactively
 > by the user. If so then it calls select-frame-set-input-focus like now, if not
 > then it calls select-frame instead.

Sorry but we can't do that.  `switch-to-buffer' has to provide the
window the next keystroke will be addressed to.  That is carved in
stone.

I still don't understand why you insist on using `switch-to-buffer'
here.  Why don't you just call `display-buffer' if you don't want to
edit that buffer anyway?

martin