unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* reading from standard input in batch mode
@ 2018-05-22 20:16 Eric Abrahamsen
  2018-05-22 20:44 ` Eric Abrahamsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2018-05-22 20:16 UTC (permalink / raw)
  To: help-gnu-emacs

I'm trying to figure out how batch mode works, and I want to do
something very simple: call a subordinate emacs process, passing it a
string, and have it write the string to a file. It's not working but I
don't know how to debug this.

In boomerang.el:

(defun boomerang ()
  (let ((msg (read)))
    (append-to-file msg
		    nil
		    "/home/eric/tmp/results.txt")))

In my main emacs:

(shell-command
"emacs -Q --batch -l boomerang.el -f boomerang \"hi there\"")

The subordinate emacs starts and finishes (returning 255, which just
came up on a thread in emacs.devel, I think), but no file is written. As
far as I know, `read' should be reading from standard-input in this
case. What am I doing wrong?

Thanks,
Eric




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

end of thread, other threads:[~2018-05-22 21:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-22 20:16 reading from standard input in batch mode Eric Abrahamsen
2018-05-22 20:44 ` Eric Abrahamsen
2018-05-22 20:49   ` Eric Abrahamsen
2018-05-22 20:50   ` Noam Postavsky
2018-05-22 21:07     ` Eric Abrahamsen
2018-05-22 21:18       ` Eric Abrahamsen
2018-05-22 21:26       ` Noam Postavsky
2018-05-22 21:52         ` Eric Abrahamsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).