From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Willemsen Newsgroups: gmane.emacs.help Subject: Re: Executing init script after launching eshell Date: Tue, 27 Mar 2012 10:53:26 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1332865069 18199 80.91.229.3 (27 Mar 2012 16:17:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 27 Mar 2012 16:17:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: C K Kashyap Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 27 18:17:48 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SCZ5f-0002PJ-Q0 for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Mar 2012 18:17:47 +0200 Original-Received: from localhost ([::1]:54902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCZ5e-0002qM-WD for geh-help-gnu-emacs@m.gmane.org; Tue, 27 Mar 2012 12:17:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCS9v-0002hR-Bt for help-gnu-emacs@gnu.org; Tue, 27 Mar 2012 04:53:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCS9p-0006RS-6o for help-gnu-emacs@gnu.org; Tue, 27 Mar 2012 04:53:42 -0400 Original-Received: from r3.smtp1.alwaysdata.com ([176.31.58.10]:48440) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCS9p-0006RB-0z for help-gnu-emacs@gnu.org; Tue, 27 Mar 2012 04:53:37 -0400 Original-Received: from 78-21-105-160.access.telenet.be ([78.21.105.160] helo=localhost) by smtp1.alwaysdata.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1SCS9e-00012q-H1; Tue, 27 Mar 2012 10:53:26 +0200 User-agent: mu4e 0.9.8.2; emacs 24.0.94.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 176.31.58.10 X-Mailman-Approved-At: Tue, 27 Mar 2012 12:17:41 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84115 Archived-At: 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.