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

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

Re: reading from standard input in batch mode


From: Eric Abrahamsen
Subject: Re: reading from standard input in batch mode
Date: Tue, 22 May 2018 13:44:37 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> 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?

I figured it out, it should have been (read t). Ignore me!




reply via email to

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