[Top][All Lists]

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

Re: gnus-agent-fetch in batch mode in a cron job

From: W. Greenhouse
Subject: Re: gnus-agent-fetch in batch mode in a cron job
Date: Fri, 22 Feb 2013 06:32:12 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Hi Julien,

Julien Cubizolles <> writes:

> From what I understand Emacs outputs the whole *Messages* buffer to
> stdout. So there is nothing the shell can do to sort error messages from
> information messages. Is that right ?

Hrm, you're not quite correct, but I'm not sure it actually matters.
From (info "(emacs) Initial Options"):

> `-batch'
> `--batch'
>      Run Emacs in "batch mode".  Batch mode is used for running
>      programs written in Emacs Lisp from shell scripts, makefiles, and
>      so on.  To invoke a Lisp program, use the `-batch' option in
>      conjunction with one or more of `-l', `-f' or `--eval' (*note
>      Action Arguments::).  *Note Command Example::, for an example.

>      In batch mode, Emacs does not display the text being edited, and
>      the standard terminal interrupt characters such as `C-z' and `C-c'
>      have their usual effect.  Emacs functions that normally print a
>      message in the echo area will print to either the standard output
>      stream (`stdout') or the standard error stream (`stderr') instead.
>      (To be precise, functions like `prin1', `princ' and `print' print
>      to `stdout', while `message' and `error' print to `stderr'.)
>      Functions that normally read keyboard input from the minibuffer
>      take their input from the terminal's standard input stream
>      (`stdin') instead.


So which file descriptor emacs --batch sends printed output to does
actually depend on the function being called.  And looking at the source
of gnus-agent, it does look like functions like `signal' and `error' are
consistently used as they should be, for actual network errors--which is
good.  However, `message' is also used frequently, e.g. for the
"Checking new news..." in `gnus-group-check-new-news.'  So it's not
guaranteed that stderr will only contain errors.  So, you might actually
be better off either redirecting all output to /dev/null (as the example
in (info "(gnus) Batching Agents") does), or else redirect to a log


Attachment: pgpdQQJB4m02e.pgp
Description: PGP signature

reply via email to

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