all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Pascal J. Bourguignon" <pjb@informatimago.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Read from stdin in non-batch mode
Date: Sat, 19 Oct 2013 17:32:26 +0200	[thread overview]
Message-ID: <871u3hjmyd.fsf@informatimago.com> (raw)
In-Reply-To: mailman.4294.1382172228.10748.help-gnu-emacs@gnu.org

Thorsten Jolitz <tjolitz@gmail.com> writes:

> Hi List,
>
> how can I (directly) achieve this behaviour in non-batch mode?
>
> ,-------------------------------------------------------------------------
> | t used as a stream means that the input is read from the minibuffer.
> | [...]. If Emacs is running in batch mode, standard input is used
> | instead of the minibuffer. For example,
> |
> |           (message "%s" (read t))
> |
> | will read a Lisp expression from standard input and print the result to
> | standard output.
> `-------------------------------------------------------------------------
>
>>From the manual it seems that I have to either pipe in/output through a
> buffer or write a function - there is no input-stream 'stdin' and no
> output-stream 'stdout' mentioned that would allow for the bahaviour
> described above.

There's no stdin, because that's where the keys you're typing
interactively are coming from, normally.

Now, on linux, the program could use /dev/tty for interactive terminal
I/O instead of /dev/stdin, so you could both read a stdin file and have
terminal interaction.  But this is specific to linux (AFAIK).

Of course, with X, the keys come from the the X server instead of the
terminal, so again, stdin would be free for an input stream.

But this would require a special case, compared to running emacs in a
terminal on a non linux system.  I guess you will have to patch emacs to
get it.

-- 
__Pascal Bourguignon__
http://www.informatimago.com/


       reply	other threads:[~2013-10-19 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4294.1382172228.10748.help-gnu-emacs@gnu.org>
2013-10-19 15:32 ` Pascal J. Bourguignon [this message]
2013-10-19 16:25   ` Read from stdin in non-batch mode Thorsten Jolitz
2013-10-19  8:43 Thorsten Jolitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871u3hjmyd.fsf@informatimago.com \
    --to=pjb@informatimago.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.