* How to get a read-only prompt in emacs shell
@ 2002-06-14 1:06 vnsingh
2002-06-14 7:32 ` Marco Baringer
0 siblings, 1 reply; 3+ messages in thread
From: vnsingh @ 2002-06-14 1:06 UTC (permalink / raw)
Hi,
I extensively invoke a Unix shell within emacs to execute any Unix commands
or run a script.
But I notice when I press backspace the prompt also gets edited or if enter
C-a which I expect
to get to beginning of cmd, it goes to beginning of prompt.
Is there any way emacs can know the prompt is read-only and that it is a
prompt.
That is, can it behave like a shell where the prompt is a prompt and not
just some text.
Could you please help me on how to do this.
I am a novice user of emacs and I have beginning to love it.
Three cheers to your work.
- Thanks,
Vish
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to get a read-only prompt in emacs shell
2002-06-14 1:06 How to get a read-only prompt in emacs shell vnsingh
@ 2002-06-14 7:32 ` Marco Baringer
[not found] ` <m3y9dhsymd.fsf@latakia.dyndns.org>
0 siblings, 1 reply; 3+ messages in thread
From: Marco Baringer @ 2002-06-14 7:32 UTC (permalink / raw)
vnsingh <vnsingh@micron.com> writes:
> Hi,
>
> I extensively invoke a Unix shell within emacs to execute any Unix commands
> or run a script.
> But I notice when I press backspace the prompt also gets edited or if enter
> C-a which I expect
> to get to beginning of cmd, it goes to beginning of prompt.
> Is there any way emacs can know the prompt is read-only and that it is a
> prompt.
> That is, can it behave like a shell where the prompt is a prompt and not
> just some text.
>
eshell.
on emacs 21 M-x eshell, on earlier emacsen you'll have to get the
elisp files from somewhere.
--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There's a crack in everything.
It's how the light gets in.
-Isonard Cohen
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: How to get a read-only prompt in emacs shell
[not found] ` <m3y9dhsymd.fsf@latakia.dyndns.org>
@ 2002-06-14 15:57 ` Marco Baringer
0 siblings, 0 replies; 3+ messages in thread
From: Marco Baringer @ 2002-06-14 15:57 UTC (permalink / raw)
ruhl@4dv.net (Robert Uhl <ruhl@4dv.net>) writes:
> e.baringer@studenti.to.it (Marco Baringer) writes:
> >
> > eshell.
>
> Not too bad. C-a doesn't make sense, though--it goes to the beginning
> of the line, not the beginning of the command-prompt (so the familiar
> C-a C-k doesn't work). Maybe I'll take a look at it when I get a
> round tuit.
my bad, i often forget where the emacs distribution ends and where my
.emacs begins. add this to your .emacs:
(add-hook 'eshell-mode-hook '(lambda ()
(local-set-key (kbd "C-a")
'(lambda ()
(interactive)
(beginning-of-line)
(search-forward-regexp eshell-prompt-regexp)))))
or for shell-mode (i haven't tested this as i don't use shell-mode)
(add-hook 'shell-mode-hook '(lambda ()
(local-set-key (kbd "C-a")
'(lambda ()
(interactive)
(beginning-of-line)
(search-forward-regexp shell-prompt-pattern)))))
> --
> Robert Uhl <ruhl@4dv.net>
> I won't insult your intelligence by suggesting that you really believe
> what you just said. --William F. Buckley, Jr.
>
--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There's a crack in everything.
It's how the light gets in.
-Isonard Cohen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-06-14 15:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-14 1:06 How to get a read-only prompt in emacs shell vnsingh
2002-06-14 7:32 ` Marco Baringer
[not found] ` <m3y9dhsymd.fsf@latakia.dyndns.org>
2002-06-14 15:57 ` Marco Baringer
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).