all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: 17390@debbugs.gnu.org
Subject: bug#17390: 24.4.50; Doc bug: Batch Mode
Date: Sun, 06 Sep 2015 23:52:00 +1200	[thread overview]
Message-ID: <55EC28E0.5030900@orcon.net.nz> (raw)
In-Reply-To: <87siosqcdi.fsf@gnu.org>

Johan Bockgård <bojohan@gnu.org> writes:
 > (info "(elisp) Batch Mode") says:
 >
 >     Any Lisp program output that would normally go to the echo
 >     area, either using `message', or using `prin1', etc., with
 >     `t' as the stream, goes instead to Emacs's standard error
 >     descriptor when in batch mode.
 >
 > This is not correct. Text printed with "`prin1', etc., with `t' as the
 > stream" goes to stdout, not stderr. (Unlike `message'.)


Glenn Morris <rgm@gnu.org> writes:
 > To me, it would make more sense for `message' to use stdout too.


This bug is still in effect (although it's not clear to me that the
documentation should be considered to be what is in error?)

It does seems initially intuitive that `message' would go to stdout,
but having it go to stderr certainly makes more sense in the context
of what the documentation claims -- that output written to the echo
area (eq PRINTCHARFUN t) is treated as stderr.

At present, `message' seems to be the *only* way of getting output to
stderr in batch mode, which isn't ideal, as you don't get the same
choice of output formats that you have with all the prin* functions.

e.g. The documentation suggests that (princ "foo\n") would write to
stdout, and (princ "foo\n" t) would write to stderr, which would seem
useful, and much nicer than everything except `message' writing to
stdout.


However I do note that the functions accepting a PRINTCHARFUN argument
tend to say that it will, when `nil', default to the value of
`standard-output'; and that latter value (whether in batch mode or
not) defaults to `t' -- precisely what is supposed to mean stderr!


As such, this seems a bit messy; but given that the bug looks to have
been in effect for quite a while now (23.4 behaves the same way), I
wonder whether it would be sensible at this point to provide a
completely new option for PRINTCHARFUN which explicitly means stderr
(or indirectly, via a new `standard-error' variable, seeing as how we
have both `standard-input' and `standard-output' vars, but no -error).

That way we'd regain(??) the ability to send arbitrary prin* output
to stderr in batch mode, without messing with the existing behaviour.


Whether or not `message' continued to write to stderr would be a
separate question, and I'm not sure what the right answer is, but it
would certainly be a backwards-incompatible change.







  parent reply	other threads:[~2015-09-06 11:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-02 18:11 bug#17390: 24.4.50; Doc bug: Batch Mode Johan Bockgård
2014-05-02 23:42 ` Glenn Morris
2015-09-06 11:52 ` Phil Sainty [this message]
2015-10-31 21:52   ` Johan Bockgård
2018-02-10 14:47 ` Noam Postavsky

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=55EC28E0.5030900@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=17390@debbugs.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.