help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: EShell Alias for a 'cd' followed by 'ls'


From: Dan Hitt
Subject: Re: EShell Alias for a 'cd' followed by 'ls'
Date: Wed, 18 Nov 2020 20:56:31 -0800

On Wed, Nov 18, 2020 at 8:43 PM Dan Hitt <dan.hitt@gmail.com> wrote:

>
>
> On Wed, Nov 18, 2020 at 8:11 PM Christopher Dimech <dimech@gmx.com> wrote:
>
>> Have not found it useful.  Have tried the following.
>>
>> alias cl 'cd $* && ls $*'
>>
>
> Actually, it looks like it should be:
>
> alias cl 'cd $* ; ls'
>
> That works for me, and has the very surprising benefit that it propagates
> to all shells running in emacs, as well as working in new emacses started
> separately from the original one.
>
> So some pretty powerful, heady stuff.
>
> Thanks Stefan for pointing out the path.
>
> dan
>

Sorry for making a crusade out of this topic, but one more little piece of
data.

It looks like this works by writing the file ~/.emacs/eshell/alias

But in the file it is stored without the single quotation marks.

However, if you try to interactively define the alias without the single
quotation marks, it does not work.  Rather, what you get is two commands:
the alias, and then the ls.

So however eshell is reading the the alias file seems to not be the same as
the way it reads the command line.

Anyhow, i'll take my oar out of the water now, thanks again Stefan and
Christopher for the information.

dan


>
>
>>
>>
>> > Sent: Thursday, November 19, 2020 at 4:54 AM
>> > From: "Stefan Kangas" <stefan@marxist.se>
>> > To: "Christopher Dimech" <dimech@gmx.com>, "Help Gnu Emacs" <
>> help-gnu-emacs@gnu.org>
>> > Subject: Re: EShell Alias for a 'cd' followed by 'ls'
>> >
>> > Christopher Dimech <dimech@gmx.com> writes:
>> >
>> > > I would like to use Eshell to call an alias 'cl' that does
>> > > a 'cd' to a directory followed by an 'ls'.  But I do not know
>> > > how to achieve it.
>> >
>> > I recommend familiarizing yourself with Info, reachable via `C-h i'.
>> >
>> > You can find the Eshell manual using `m eshell RET' where you should be
>> > able to find the information you are looking for using `i alias RET'.
>> >
>> > Happy to help.
>> >
>>
>>


reply via email to

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