Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: wgreenhouse-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org (W. Greenhouse)
To: info-gnus-english-mXXj517/zsQ@public.gmane.org
Subject: Re: gnus-agent-fetch in batch mode in a cron job
Date: Fri, 22 Feb 2013 06:32:12 +0000	[thread overview]
Message-ID: <87621koo43.fsf@riseup.net> (raw)
In-Reply-To: <87r4k8lvyr.fsf@free.fr>


[-- Attachment #1.1: Type: text/plain, Size: 2126 bytes --]

Hi Julien,

Julien Cubizolles <j.cubizolles-GANU6spQydw@public.gmane.org> 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.

etc.

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
file.

--
Regards,
WGG

[-- Attachment #1.2: Type: application/pgp-signature, Size: 835 bytes --]

[-- Attachment #2: Type: text/plain, Size: 183 bytes --]

_______________________________________________
info-gnus-english mailing list
info-gnus-english-mXXj517/zsQ@public.gmane.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

  reply	other threads:[~2013-02-22  6:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-13 22:08 Julien Cubizolles
2013-02-20 16:39 ` W. Greenhouse
2013-02-22  6:10   ` Julien Cubizolles
2013-02-22  6:32     ` W. Greenhouse [this message]
     [not found]   ` <mailman.20575.1361513992.855.info-gnus-english@gnu.org>
2013-08-01 12:48     ` Lars Magne Ingebrigtsen

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=87621koo43.fsf@riseup.net \
    --to=wgreenhouse-sgozh3hwpm2stnjn9+bgxg@public.gmane.org \
    --cc=info-gnus-english-mXXj517/zsQ@public.gmane.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.
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 NNTP newsgroup(s).