sly
sly copied to clipboard
sly-mrepl should default DISPLAY-ACTION to pop-to-buffer-same-window when called interactively
Hello,
sly-mrepl defaults DISPLAY-ACTION to switch-to-buffer when called interactively, but that means you can't use display-buffer-alist to customise the behaviour of C-c C-z, and you can't do things like C-x 4 4 C-c C-z, C-x 5 5 C-c C-z etc. using those new bindings in Emacs 28. So I'd like to propose that it default DISPLAY-ACTION to pop-to-buffer-same-window, to enable those other things to work.
Thanks.
Seems reasonable, but can you explain if it would change the current behavior for those who don't customize it?
Hello,
On Sat 06 Mar 2021 at 08:20PM -08, João Távora wrote:
Seems reasonable, but can you explain if it would change the current behavior for those who don't customize it?
It wouldn't -- if nothing in display-buffer-alist refers to the sly repl, then it will behave exactly the same as switch-to-buffer.
-- Sean Whitton
It wouldn't -- if nothing in display-buffer-alist refers to the sly repl, then it will behave exactly the same as switch-to-buffer.
There are still two details, though:
- The default value of display action is not
switch-to-buffer
, rather a function based on it. - If we substitute
switch-to-buffer
forpop-to-buffer-same-window
it does seem to work backward compatibly, except that I'm not sure it if won't break in Emacs 25. Maybe you could test?
Thanks
I tested replacing the call to switch-to-buffer with one to pop-to-buffer-same-window within interactive form, in Emacs 25, and it works as expected: no change unless display-buffer-alist refers to sly-mrepl buffers. So seems like this change is a safe one to make.