* [ shell buffer ] How not to split the current window?
@ 2017-08-30 9:24 Philippe Chauvat
2017-08-31 1:04 ` Michael Heerdegen
0 siblings, 1 reply; 10+ messages in thread
From: Philippe Chauvat @ 2017-08-30 9:24 UTC (permalink / raw)
To: help-gnu-emacs
Hello
Not new to emacs but pretty old to lisp and other emacs programming
stuffs. I am running the following emacs version.
GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.17)
of 2017-08-01, modified by Debian
Copyright (C) 2017 Free Software Foundation, Inc.
since a previous update, when using M-x shell, the shell opens in a new
buffer, splitting the window. Therefore, using C-x b don't send me back
to the original buffer but to a third one. This is really not useful for
me and I would be glad that M-x shell just open a new buffer, as it
would do for other matters, without splitting the existing one.
I read the doc, probably not enough, I read the mailing list archive,
and did not find anything. Any help would be welcome.
Cheers
Philippe
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ shell buffer ] How not to split the current window?
2017-08-30 9:24 [ shell buffer ] How not to split the current window? Philippe Chauvat
@ 2017-08-31 1:04 ` Michael Heerdegen
2017-08-31 7:37 ` Philippe Chauvat
0 siblings, 1 reply; 10+ messages in thread
From: Michael Heerdegen @ 2017-08-31 1:04 UTC (permalink / raw)
To: Philippe Chauvat; +Cc: help-gnu-emacs
Hi Philippe,
AFAIU it sounds like you want an entry in `display-buffer-alist', e.g.
(add-to-list 'display-buffer-alist
'("^\\*shell\\*" . (display-buffer-same-window)))
HTH,
Michael.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ shell buffer ] How not to split the current window?
2017-08-31 1:04 ` Michael Heerdegen
@ 2017-08-31 7:37 ` Philippe Chauvat
2017-08-31 10:41 ` Michael Heerdegen
0 siblings, 1 reply; 10+ messages in thread
From: Philippe Chauvat @ 2017-08-31 7:37 UTC (permalink / raw)
To: help-gnu-emacs
Hello all,
Thanks a lot for the answers you already sent. Actually, looking at
them, I would say, I'd like to have something like:
- M-x shell == open a shell and make the buffer the only one displayed.
Or,
M-x shell (redefined) = M-x shell (current version splitting the buffer)
+ C-x 1 (making the shell buffer the only one displayed).
Cheers
Philippe
Le 31/08/2017 à 03:04, Michael Heerdegen a écrit :
> Hi Philippe,
>
> AFAIU it sounds like you want an entry in `display-buffer-alist', e.g.
>
> (add-to-list 'display-buffer-alist
> '("^\\*shell\\*" . (display-buffer-same-window)))
>
>
> HTH,
>
> Michael.
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ shell buffer ] How not to split the current window?
2017-08-31 7:37 ` Philippe Chauvat
@ 2017-08-31 10:41 ` Michael Heerdegen
2017-08-31 12:36 ` Philippe Chauvat
0 siblings, 1 reply; 10+ messages in thread
From: Michael Heerdegen @ 2017-08-31 10:41 UTC (permalink / raw)
To: Philippe Chauvat; +Cc: help-gnu-emacs
Philippe Chauvat <pchauvat@laposte.net> writes:
> M-x shell (redefined) = M-x shell (current version splitting the buffer)
> + C-x 1 (making the shell buffer the only one displayed).
I would still do that with `display-buffer-alist' (instead of advising
the function), e.g.
(add-to-list
'display-buffer-alist
`("^\\*shell\\*" .
(,(defun my-display-shell-buffer-whole-frame (buffer alist)
(prog1 (display-buffer-same-window buffer alist)
(delete-other-windows))))))
Michael.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ shell buffer ] How not to split the current window?
2017-08-31 10:41 ` Michael Heerdegen
@ 2017-08-31 12:36 ` Philippe Chauvat
0 siblings, 0 replies; 10+ messages in thread
From: Philippe Chauvat @ 2017-08-31 12:36 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
Hi Michael,
It is just working fine. Thanks a lot. I wish my lisp skills were still
there :)
Best
Philippe
Le 31/08/2017 à 12:41, Michael Heerdegen a écrit :
> (add-to-list
> 'display-buffer-alist
> `("^\\*shell\\*" .
> (,(defun my-display-shell-buffer-whole-frame (buffer alist)
> (prog1 (display-buffer-same-window buffer alist)
> (delete-other-windows))))))
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <mailman.14045.1504100225.21957.help-gnu-emacs@gnu.org>]
* Re: [ shell buffer ] How not to split the current window?
[not found] <mailman.14045.1504100225.21957.help-gnu-emacs@gnu.org>
@ 2017-08-30 14:07 ` HASM
2017-08-30 19:38 ` Oleg Pykhalov
[not found] ` <mailman.14066.1504121908.21957.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 10+ messages in thread
From: HASM @ 2017-08-30 14:07 UTC (permalink / raw)
To: help-gnu-emacs
> since a previous update, when using M-x shell, the shell opens in a new
> buffer, splitting the window.
You could do:
(add-hook 'shell-mode-hook 'delete-other-windows)
but that will only work the first time that "shell" buffer is created,
not if there is one already.
For the later case you may need to change the shell defun and add a call
to delete-other-windows after the pop-to-buffer (though I didn't test
it.)
-- HASM
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [ shell buffer ] How not to split the current window?
2017-08-30 14:07 ` HASM
@ 2017-08-30 19:38 ` Oleg Pykhalov
[not found] ` <mailman.14066.1504121908.21957.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 10+ messages in thread
From: Oleg Pykhalov @ 2017-08-30 19:38 UTC (permalink / raw)
To: help-gnu-emacs
HASM <hasm@example.invalid> writes:
>> since a previous update, when using M-x shell, the shell opens in a new
>> buffer, splitting the window.
>
> You could do:
>
> (add-hook 'shell-mode-hook 'delete-other-windows)
>
> but that will only work the first time that "shell" buffer is created,
> not if there is one already.
Also you could make a key binding to (switch-to-buffer "*shell*").
> For the later case you may need to change the shell defun and add a call
> to delete-other-windows after the pop-to-buffer (though I didn't test
> it.)
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <mailman.14066.1504121908.21957.help-gnu-emacs@gnu.org>]
* Re: [ shell buffer ] How not to split the current window?
[not found] ` <mailman.14066.1504121908.21957.help-gnu-emacs@gnu.org>
@ 2017-08-30 23:23 ` notbob
2017-08-31 0:00 ` John Mastro
[not found] ` <mailman.14080.1504137681.21957.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 10+ messages in thread
From: notbob @ 2017-08-30 23:23 UTC (permalink / raw)
To: help-gnu-emacs
On 2017-08-30, Oleg Pykhalov <go.wigust@gmail.com> wrote:
> Also you could make a key binding to (switch-to-buffer "*shell*").
It already exists.
C-x C-o (small oh) will move the cursor to the "other" window,
whatever that other window may be. This can be invoked indefinitely
between the two open windows, moving the cursor back and forth between
the two, while leaving both windows open.
If you use C-x C-0 (zero), it will move the cursor to the "other"
window and CLOSE the window the cursor is currently in. C-x C-1 (one)
will CLOSEY the other window while keeping current window open and the
cursor in the window the cursor is currently in. Whew!
I don't know much about emacs, but I do know that! ;)
nb
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-08-31 12:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-30 9:24 [ shell buffer ] How not to split the current window? Philippe Chauvat
2017-08-31 1:04 ` Michael Heerdegen
2017-08-31 7:37 ` Philippe Chauvat
2017-08-31 10:41 ` Michael Heerdegen
2017-08-31 12:36 ` Philippe Chauvat
[not found] <mailman.14045.1504100225.21957.help-gnu-emacs@gnu.org>
2017-08-30 14:07 ` HASM
2017-08-30 19:38 ` Oleg Pykhalov
[not found] ` <mailman.14066.1504121908.21957.help-gnu-emacs@gnu.org>
2017-08-30 23:23 ` notbob
2017-08-31 0:00 ` John Mastro
[not found] ` <mailman.14080.1504137681.21957.help-gnu-emacs@gnu.org>
2017-08-31 0:04 ` notbob
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).