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

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

Re: redirect stdout to emacs scratch


From: Chetan
Subject: Re: redirect stdout to emacs scratch
Date: Mon, 08 Dec 2008 11:09:43 -0800
User-agent: Emacs Gnus

Chetan <Chetan.xspam@xspam.sbcglobal.net> writes:

> pagod <dvergnaud@yahoo.com> writes:
>
>> hi everyone!
>>
>> this is probably a very easy question (there has to be a way!), but i
>> haven't been able to find the answer, so i'm turning to this forum, hoping
>> someone can give me a hint!
>>
>> what i want to do is very simple: i want to be able to redirect the stdout
>> of any program on the command line into emacs' scratch buffer -- the way it
>> works with less or joe or whatever. i want to do it with emacs because i'm
>> used to using it and i need syntax coloring, but when i try it i get the
>> message "standard input is not a tty". then what is it? the way i've tried
>> it is quite the usual way:
>>
>> pagod> echo "hello, world" | emacs
>> emacs: standard input is not a tty
>>
>> my emacs is aliased to "emacs -nw" because i'm in a terminal, so the option
>> is assumed by default anyway. i'm using the no-window version of emacs
>> because i run it from within an ssh session running zsh on a linux server,
>> connecting using putty from a windows workstation. emacs version is 22.2.1,
>> running in a SuSE 11.0.
>>
>> it'd be great if someone could help me do that!
>>
>> thx a lot
>>
>> David
>
> Do you really need to do it this way? You can run it quite simply
> within the eshell prompt inside emacs.
> M-x eshell
> eshell$ echo "foo" >> #<buffer *scratch*>
> eshell$ myprog >> #<buffer *scratch*>
> echell$ echo "bar" >> #<buffer *scratch*>

I forgot to mention that you could use echo -n foo to get the output
terminated with a newline.

With eshell, commands written with elisp are used where possible, so
you may be able to do something that is not possible using external
commands alone. I use W32 and these commands work even if there are no
external executables available.




reply via email to

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