all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Opening stdin or pipe
@ 2003-02-25  5:43 Gregory J.
  2003-02-25  8:03 ` Kai Großjohann
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory J. @ 2003-02-25  5:43 UTC (permalink / raw)


I want to be able to pipe data into an Emacs buffer (a new one in a
new Emacs session would be fine). Preferably, I'd use a normal shell
pipeline something like this:

whatever-command | emacs -

I'd be happy enough to use a named pipe like this, though:

mkfifo myfifo
whatever-command > myfifo &
emacs myfifo

It seems the first method is simply not supported (Error: "Option `-'
is ambiguous"). I would have expected the second method to work, but I
get this error: "File exists but cannot be read."

I searched the USENET archive and found this command suggested:

emacs /dev/stdin

(and /dev/stdin does exist under NetBSD), but I get the same error,
"File exists but cannot be read."

A workaround is to run:

mkfifo myfifo
whatever-command > myfifo &
emacs

and then within Emacs create a buffer and run "cat myfifo" via
shell-command (C-u M-!), but this is inconvenient.

Is there any way to accomplish what I described?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Opening stdin or pipe
  2003-02-25  5:43 Opening stdin or pipe Gregory J.
@ 2003-02-25  8:03 ` Kai Großjohann
  0 siblings, 0 replies; 2+ messages in thread
From: Kai Großjohann @ 2003-02-25  8:03 UTC (permalink / raw)


gregoryj@hotpop.com (Gregory J.) writes:

> I want to be able to pipe data into an Emacs buffer (a new one in a
> new Emacs session would be fine). Preferably, I'd use a normal shell
> pipeline something like this:
>
> whatever-command | emacs -

I think it's best to do it the other way round: from within Emacs,
start whatever-command and read its output.

You can start a process synchronously with call-process.  Or you can
start it asynchronously via start-process.

-- 
A preposition is not a good thing to end a sentence with.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-25  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-25  5:43 Opening stdin or pipe Gregory J.
2003-02-25  8:03 ` Kai Großjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.