unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "KARR, DAVID" <dk068x@att.com>
To: tpeplt <tpeplt@gmail.com>
Cc: "Help-gnu-emacs@gnu.org" <Help-gnu-emacs@gnu.org>
Subject: RE: How to get eshell to do what I used to do with shell
Date: Sat, 10 Aug 2024 19:52:48 +0000	[thread overview]
Message-ID: <DM3PR02MB102560F5AA25E232F2105ED0D9DBB2@DM3PR02MB10256.namprd02.prod.outlook.com> (raw)
In-Reply-To: <87bk20urcc.fsf@gmail.com>

(Hope top post is ok, Outlook doesn’t make it easy to configure different ways to include the replying post, per mailing list.)

Yes, I’m familiar with Info, I just hadn’t read the eshell section before. I’ve only started to run through it, but I have two questions right off.

Section 1.1 mentions an obscure way of filtering ls output, using an example like “ls -lt **/*.doc(Lk+100aM+6)”. I couldn’t get any variation of that to work. It’s not clear whether it’s saying that is eshell functionality, or something about the  most common implementations of “ls”.

When I do something simple like this: “ls -l | grep "txt" | sort”, all the output lines are prefixed with “(standard input):”.  I haven’t searched through the info manual yet, but I asked github copilot about this, and it said that “eshell/grep” instead of “grep” would fix that, but that didn’t work either (I don’t expect everything from copilot to be 100% accurate).

From: tpeplt <tpeplt@gmail.com>
Sent: Saturday, August 10, 2024 12:10 PM
To: KARR, DAVID <dk068x@att.com>
Cc: Help-gnu-emacs@gnu.org
Subject: Re: How to get eshell to do what I used to do with shell

ZjQcmQRYFpfptBannerEnd

"KARR, DAVID" <dk068x@att.com<mailto:dk068x@att.com>> 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.

  reply	other threads:[~2024-08-10 19:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-10 17:00 How to get eshell to do what I used to do with shell KARR, DAVID
2024-08-10 19:10 ` tpeplt
2024-08-10 19:52   ` KARR, DAVID [this message]
2024-08-10 22:32     ` tpeplt
2024-08-11 11:27     ` Joel Reicher
2024-08-10 21:01 ` James Thomas
2024-08-10 21:06   ` KARR, DAVID
2024-08-11  9:49     ` James Thomas

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=DM3PR02MB102560F5AA25E232F2105ED0D9DBB2@DM3PR02MB10256.namprd02.prod.outlook.com \
    --to=dk068x@att.com \
    --cc=Help-gnu-emacs@gnu.org \
    --cc=tpeplt@gmail.com \
    /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).