[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Executing init script after launching eshell

From: Tom Willemsen
Subject: Re: Executing init script after launching eshell
Date: Tue, 27 Mar 2012 10:53:26 +0200
User-agent: mu4e; emacs

Hey Kashyap,

On Tue 27 Mar 2012 09:58:46 AM CEST, C K Kashyap wrote:

 > Hi All,
 > Here's what I'd like to be doing - When I start emacs, I typically open up
 > multiple eshells to do different kinds of compilation etc. Is there  a way
 > to retain the "session" in such a manner that all open eshells are also
 > retained.
 > As a workaround I was attempting to write a script that would open up the
 > necessary eshells -
 > (progn
 >    (eshell)
 >    (rename-buffer "b1")
 >     (insert "cd path1\n")
 >     (eshell)
 >    (rename-buffer "b2")
 >     (insert "cd path2\n")
 > )

Maybe the following could work, it seems to do what you want when I try
it here.

  (let ((default-directory "path1"))
    (eshell t)
    (rename-buffer "b1"))
  (let ((default-directory "path2"))
    (eshell t)
    (rename-buffer "b2")))

I don't know if using `default-directory' like that is such a great
idea, but it looks slightly better than the result of:

  (eshell t)
  (eshell/cd "path1")
  (eshell t)
  (eshell/cd "path2")
 > The problem is that I am not able to cd into the right place in eshell
 > using (insert "cd path1\n") !!!

That seems to be because you don't use `eshell-send-input'

Hope it helps in some small way.             

reply via email to

[Prev in Thread] Current Thread [Next in Thread]