From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: How to get eshell to do what I used to do with shell Date: Sat, 10 Aug 2024 15:10:11 -0400 Message-ID: <87bk20urcc.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9211"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "Help-gnu-emacs@gnu.org" To: "KARR, DAVID" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 10 21:10:55 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1scrUN-0002IR-5v for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 10 Aug 2024 21:10:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1scrTu-0000m8-TW; Sat, 10 Aug 2024 15:10:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1scrTt-0000m0-Jy for Help-gnu-emacs@gnu.org; Sat, 10 Aug 2024 15:10:25 -0400 Original-Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1scrTk-00057m-7f for Help-gnu-emacs@gnu.org; Sat, 10 Aug 2024 15:10:17 -0400 Original-Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6bb96ef0e8eso17220836d6.2 for ; Sat, 10 Aug 2024 12:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723317013; x=1723921813; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=k+ppp3ztH1akscO8l8rP/OITaY+oL2PjKnoPfsOBIoI=; b=Kj8VO9w7Mn4XNcVGVPUqT9nY+rerM7usCszmEQjkvh/XBUWQbZVgnMKg5BHSoCE95x 8LuvHi50cWffmJ9HRcAqon8327H1GhKC4es1rmKUJ58T4R2P4L0OyA8q1LOkkQVTgi8d sPbmzuropUHMJOodSX4Hzu3EaRrJWbFxJwTJfqZV6kcamr2Tp5hpItg2sGocdawPLSfi FaPnvcKfes2kxHDXKvFbkql6Kdobpz9eWlq5qMN6wPaKZGPkQgziragMsrONr+6szOG1 wgqeZPSH6E0QIpdoin/p6rYqNgyRx9dBZqtkgcC7thY3cJIYqtzJcxKg6/Dg5vyr2SOP xQ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723317013; x=1723921813; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=k+ppp3ztH1akscO8l8rP/OITaY+oL2PjKnoPfsOBIoI=; b=Cn7/rUvdSKU+oFxSPhJt3HgNFuZ2Yq4g9ZG9i5RBu+4/9pdA6H+kc021PML1A1ywUy pRaFu30us08WH1M9eT1lVvHWYuWPdRZCyd491PMsjY53LOBfaLd9oc7LNJVnLZTPDv/r ZtBFANH6QfdaQ7rhUNUvQzFpEean1xivF4JVDCsvKHkXKp7Ee7cUTAgRk4/B2NHWZ6VM Xkv5DCyILjn91KUd9RhVMf3I0DKxOnQHV3s0D1MCFmqkeX1kwoS/T4sBClKY/N89DyKD Tz5VuBdvCprth63HKksP/lfAYfKVyXTdGowLyDu+mjKUzFr5G86ZlUuQi/G00auc4gdp wGHw== X-Gm-Message-State: AOJu0YyRl56HgNF0GC7jHFmCNAsse47ARmEANqqDaYLRkqnZV2v2OOsU qJVI3HGeONX3dywMLMM+JFz5x30p1F6HZRg1yj+l8m8VCybwOC4l X-Google-Smtp-Source: AGHT+IGjBnDf7WVEfNR3D39QUNgSpz118XhYvd1zEan9bcwg6vZdmjTqq/KXlY8bCJlBJLlqMBF45A== X-Received: by 2002:a05:6214:5711:b0:6b9:5d27:92 with SMTP id 6a1803df08f44-6bd78d03781mr58689686d6.8.1723317013353; Sat, 10 Aug 2024 12:10:13 -0700 (PDT) Original-Received: from t530.local ([2600:8806:a801:3150:6232:a925:a650:ba8c]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bd82e35785sm9302736d6.81.2024.08.10.12.10.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 10 Aug 2024 12:10:12 -0700 (PDT) In-Reply-To: (DAVID KARR's message of "Sat, 10 Aug 2024 17:00:44 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=tpeplt@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:147589 Archived-At: "KARR, DAVID" writes: > ... I wrote this little wrapper on "shell" > a couple of decades ago, and it's worked fine since then. I've > briefly looked at "eshell", and it seems like it will do the job, but > I wanted to know whether I can wrap it to do the same things my older > wrapper was doing. > > My old wrapper had these features: > * In a non-shell buffer, execing the main func would either create the > first shell buffer, or go to the first one in the chain, perhaps > called the 0th. > * In a shell buffer, execing the main func would create a new shell in > the chain, using the current directory > * In a shell buffer, execing the "goto-next-shell" func would move to > the next buffer in the chain, or back to 0 if at the end > * In a shell buffer, execing the "find-shell-with-dir" func would take > a string argument and find the next buffer in the chain where the pwd > has that string as a substring > > I think all of these are doable, but I haven't written any elisp for > many years. I see that "default-directory" in each eshell buffer is > set to the current directory, just like in the old shell package. I > wonder if this will work just by changing the name of the function to > execute. Could it be that simple? I guess I'll iterate on that and > come back here for question. 1. In case you are unaware, there is an Info manual for eshell. It is separate from the Emacs user manual and the Emacs Lisp reference manual. If it is installed on your system, then you should be able to read it by evaluating the following expression in Emacs: (info "(eshell) Top") 2. One of the chapters in the Eshell manual is titled "Bugs and Ideas". You might find the answer to your question(s) in this chapter (over 400 lines long), or find that the capability that you want is not yet supported in Eshell. (info "(eshell) Bugs and ideas") -- The lyf so short, the craft so long to lerne. - Geoffrey Chaucer, The Parliament of Birds.