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

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

Re: "M-x shell" (was: Re: Redirecting the output of a commend in "shell"


From: Robert Thorpe
Subject: Re: "M-x shell" (was: Re: Redirecting the output of a commend in "shell" into a buffer)
Date: Tue, 09 Sep 2014 00:20:55 +0100

Emanuel Berg <embe8573@student.uu.se> writes:

> Robert Thorpe <rt@robertthorpeconsulting.com> writes:
>
>> You could modify these or advice them. Or you could
>> rebind RET. For example, suppose you create a new
>> "pseudo-command" called "buf". You write: "buf ls
>> RET" in the shell buffer. Your function finds the
>> "buf" at the beginning of the command string. It then
>> cuts out the rest and sends it to shell-command which
>> puts it in a separate buffer.
>
> Welcome back Mr. Thorpe, yes, but that would be
> in-Emacs, right? If so, isn't the eshell better?

Yes, but eshell has some disadvantages.  The error messages aren't very
clear.  That's a problem for me because I make a lot of mistakes using
the shell. Also, I sometimes use MS Windows where it's useful to have
M-x shell go to the Windows shell (cmd.exe).  Some other people may want
to do it because they use a different shell and eshell mostly immitates
bash.

Looking at the code a bit more I think it's best to do it this way:
* Rebind RET to a new function (only in shell mode, not in comint).
* In the new function filter out all the special commands & deal with
them.
* In the new function pass through everything else to comint-send-input.

BR,
Robert Thorpe



reply via email to

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