unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tom Willemsen <tom@ryuslash.org>
To: C K Kashyap <ckkashyap@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Executing init script after launching eshell
Date: Tue, 27 Mar 2012 10:53:26 +0200	[thread overview]
Message-ID: <m34ntah1bt.fsf@ryuslash.org> (raw)
In-Reply-To: <CAGdT1gpOjn=wp7eWyUK31Jd7Zv=riqW6gEMJS6Ume4fFj59eKw@mail.gmail.com>

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.

(progn
  (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:

(progn
  (eshell t)
  (eshell/cd "path1")
  (eshell-send-input)
  (eshell t)
  (eshell/cd "path2")
  (eshell-send-input))
 
 > 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	other threads:[~2012-03-27  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27  7:58 Executing init script after launching eshell C K Kashyap
2012-03-27  8:53 ` Tom Willemsen [this message]
2012-03-27 10:26   ` C K Kashyap
2012-03-27 11:21     ` Tom Willemsen
2012-03-27 13:13       ` C K Kashyap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34ntah1bt.fsf@ryuslash.org \
    --to=tom@ryuslash.org \
    --cc=ckkashyap@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).