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: harven
Subject: Re: redirect stdout to emacs scratch
Date: Mon, 08 Dec 2008 20:30:46 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin)

Teemu Likonen <tlikonen@iki.fi> writes:

> Chetan (2008-12-08 07:22 -0800) wrote:
>
>> pagod <dvergnaud@yahoo.com> writes:
>>> pagod> echo "hello, world" | emacs
>
> I believe there is not any nice way to do this.
>
>> 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*>
>
> Another and perhaps more obvious solution is to run shell commands with
> M-1 M-! command while in the *scratch* buffer. For example:
>
>     M-1 M-! echo "foo"
>
> It can actually be any prefix argument for M-!, not just number 1, but
> M-1 is a good choice when ! is in the same key as 1.

As a workaround you can also try the following:

   C-x C-f .scratch
   M-x lisp-interaction-mode
   M-x auto-revert-tail-mode

You get some sort of new scratch buffer called ".scratch". Then you can add
from the command line to this new scratch buffer with:

   echo "my text" >> .scratch

The text should appear in this new scratch buffer within seconds.



reply via email to

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