It's possible to start emacs
with an eshell
buffer focused using the -f
flag as described in this question.
> emacs -nw -f "eshell"
I'm wondering if there's a way of launching eshell
and focusing its buffer using just the .emacs
file.
Using the following files, I've been able to start eshell
automatically, but not to shift focus to its corresponding buffer, named *eshell*
by default.
; .emacs.d/init.el
(eshell)
and
; .emacs.d/init.el
(eshell)
(switch-to-buffer "*eshell*)
Is there a way to switch focus to the eshell
buffer from the .emacs
file without using a command line argument?
switch-to-buffer
becauseeshell
containspop-to-buffer-same-window
. – lawlist Jul 15 '18 at 19:17eshell
normally containpop-to-buffer-same-window
calls? It might be worth having the more verbose/explicit version as an option in case someone wants to try this with not-eshell. – Greg Nisbet Jul 15 '18 at 19:28display-buffer-alist
to control how certain buffers are displayed. There are also libraries that assist users to control how buffers are displayed. I personally prefer the create/locate approach and then I display buffers however/wherever I want. Here are two examples of how I do it: https://emacs.stackexchange.com/a/28730/2287 and https://emacs.stackexchange.com/a/28924/2287 . – lawlist Jul 15 '18 at 19:37