unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#17390: 24.4.50; Doc bug: Batch Mode
@ 2014-05-02 18:11 Johan Bockgård
  2014-05-02 23:42 ` Glenn Morris
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johan Bockgård @ 2014-05-02 18:11 UTC (permalink / raw)
  To: 17390


(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'.)





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

* bug#17390: 24.4.50; Doc bug: Batch Mode
  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
  2018-02-10 14:47 ` Noam Postavsky
  2 siblings, 0 replies; 5+ messages in thread
From: Glenn Morris @ 2014-05-02 23:42 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: 17390

Johan Bockgård wrote:

> This is not correct. Text printed with "`prin1', etc., with `t' as the
> stream" goes to stdout, not stderr. (Unlike `message'.)

To me, it would make more sense for `message' to use stdout too.






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

* bug#17390: 24.4.50; Doc bug: Batch Mode
  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
  2015-10-31 21:52   ` Johan Bockgård
  2018-02-10 14:47 ` Noam Postavsky
  2 siblings, 1 reply; 5+ messages in thread
From: Phil Sainty @ 2015-09-06 11:52 UTC (permalink / raw)
  To: 17390

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.







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

* bug#17390: 24.4.50; Doc bug: Batch Mode
  2015-09-06 11:52 ` Phil Sainty
@ 2015-10-31 21:52   ` Johan Bockgård
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Bockgård @ 2015-10-31 21:52 UTC (permalink / raw)
  To: Phil Sainty; +Cc: 17390

Phil Sainty <psainty@orcon.net.nz> writes:

> I wonder whether it would be sensible at this point to provide a
> completely new option for PRINTCHARFUN which explicitly means stderr

It exists and is called `external-debugging-output'.






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

* bug#17390: 24.4.50; Doc bug: Batch Mode
  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
@ 2018-02-10 14:47 ` Noam Postavsky
  2 siblings, 0 replies; 5+ messages in thread
From: Noam Postavsky @ 2018-02-10 14:47 UTC (permalink / raw)
  To: Johan Bockgård; +Cc: 17390

tags 17390 fixed
close 17390 25.1
quit

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'.)

This was fixed in 25.1.

[1: 565adf2e90]: 2018-02-08 20:32:47 -0500
  Clarify that text-quoting-style doesn't affect *Info* (Bug#24519)
  [...]
  (Batch Mode): Document how text written to standard streams is
encoded.  Fix inaccuracy regarding which output streams are used
by output functions in batch mode.
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=565adf2e90d67de2107343aaf265ec6c3e8fd165





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

end of thread, other threads:[~2018-02-10 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-10-31 21:52   ` Johan Bockgård
2018-02-10 14:47 ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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