unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Eli Zaretskii <eliz@gnu.org>, Drew Adams <drew.adams@oracle.com>
Cc: 38736@debbugs.gnu.org
Subject: bug#38736: 26.3; ellipsis in `*Messages*', doc of `format' etc.
Date: Thu, 26 Dec 2019 09:49:45 -0800 (PST)	[thread overview]
Message-ID: <f0eb6dfc-0544-4e03-9705-5828861f0046@default> (raw)
In-Reply-To: <<838smzvk86.fsf@gnu.org>>

> > > Like I said: eval's doc string documents this
> > > feature,
> >
> > I see nothing in the doc string of `eval' that
> > tells you `%S' in the `message' format string is
> > controlled by `print-length'.  Or even anything
> > close to it.
> 
> Sorry, I meant eval-expression, what is run by M-:.

FWIW, I made it clear that I did not use
`eval-expression' (`M-:):

 >>> How did you get the ellipsis in *Messages*?
 >>
 >> By a call (message "Result: %S" result),
 >> where the value of `result' is a long list.

And when you then said that (message "Result:
%S" result) is "not a call, that's evaluation",
I replied that it was used "in code, in a
function body."

The general point is that a user who wants
to know about the behavior of `message', in
particular for a format string with %S (but
not limited to that), now needs to dig deep
into a chain of doc strings or manual links.

`message', like `format', is very commonly
used.  And (I think) %S may be the most
commonly used %-sequence with `message'.

We now clutter the doc of `message' with info
about ` and ', and to link to the doc for
`format-message'.  That further complicates
trying to understand `message' behavior.

The `message' doc even has this gratuitous
text now:

  To display STRING without special treatment,
  use (message "%s" STRING).

There's no STRING in the function signature.
There's nothing special about a STRING arg,
and %s doesn't just print a STRING as a
string - it prints anything as a string.

Parameter ARGS isn't even described by name.
It's OK that we say that "the rest are data
to be formatted...".  But, especially because
of that sentence about STRING data, it's not
made sufficiently clear that the "data", are
Lisp objects of any kind.

If you really want to have a statement about
using %s to produce string output then just
say that.  Don't show a call to `message'
where the second arg is STRING - that's
misleading.

Here's my suggestion, at this point.  But
perhaps we can do better - I don't have all
the answers.

1. Say that the ARGS are Lisp objects of any
   kind.
2. Say that ARGS are handled by `format-message',
   (alas) and the result is shown as a message.
3. Users can follow the `format-message' link
   to get all the formatting info they need.
4. Don't mention `, ', or %.  That doesn't help
   without more info; it's just noise.
5. If you _do_ show an example using % then use
   %S, and point out that it uses `prin1'.
   (Maybe even say that `prin1' is controlled
   by variables such as `print-level'.)

#3 is a step back from my initial suggestion
for trying to shorten the journey to info about
the `prin1' variables.  #5 might mitigate #3.

I don't have a perfect solution, at this point.

It's _really_ too bad that we had to introduce
`format-message'.  Going from `message' doc to
`format-message' doc works against usability
and understanding.

As opposed to `format', the `format-message'
doc talks only about the new "quoting" hoops.
It forces you to move to the `format' doc to
get the %-sequences info you really need, to
make use of `message' in the most common ways.

The "quoting" stuff should be the last, not
the first, thing you read when trying to
understand `message' and the like.  (And
`format-message' is specifically for
messaging.)

It would be better - if we're forced to send
people to `format-message' first - if its doc
string contained all of the info that's in
the `format' doc, and it added the "quoting"
stuff only at the end.

Better, IOW, for users coming from `message'
and the like to get the main format-control
info (%-sequences) first.

As it stands now, the cart ("quoting") is
put before the horse (%-sequences), when
trying to understand `message' and the like.

I know that we don't want to just duplicate
all the `format' doc.  That's not great.

But `message' is a high-level access point
for using format control strings, and to get
to the important info about those, you now
have to get past the unhelpful, noisy doc of
`format-message'.  If a user stops at that
doc, and doesn't plow forward to the `format'
doc, then the most important messages about
`message' will not get through.

[This would have been avoided as a problem
if `message' had not been co-opted to use
`format-message', i.e., if we had instead
just added a separate function, e.g.,
`message-with-quote-munging', which used
`format-message'.  Alas, that ship has
sailed.]





       reply	other threads:[~2019-12-26 17:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<<<006e6244-dd0a-46a8-8c61-36744b3216de@default>
     [not found] ` <<<<83pngcv5ha.fsf@gnu.org>
     [not found]   ` <<<32378b4e-d158-48d5-a48c-7afde59f5d32@default>
     [not found]     ` <<<83d0ccuxoe.fsf@gnu.org>
     [not found]       ` <<4a9b955a-ac97-41d9-a373-fc37b37581a4@default>
     [not found]         ` <<838smzvk86.fsf@gnu.org>
2019-12-26 17:49           ` Drew Adams [this message]
     [not found] <<<006e6244-dd0a-46a8-8c61-36744b3216de@default>
     [not found] ` <<<83pngcv5ha.fsf@gnu.org>
     [not found]   ` <<32378b4e-d158-48d5-a48c-7afde59f5d32@default>
     [not found]     ` <<83d0ccuxoe.fsf@gnu.org>
2019-12-25 20:54       ` bug#38736: 26.3; ellipsis in `*Messages*', doc of `format' etc Drew Adams
2019-12-26  3:28         ` Eli Zaretskii
     [not found] <<006e6244-dd0a-46a8-8c61-36744b3216de@default>
     [not found] ` <<83pngcv5ha.fsf@gnu.org>
2019-12-25 16:44   ` Drew Adams
2019-12-25 17:23     ` Eli Zaretskii
2019-12-26  3:24       ` Michael Heerdegen
2019-12-26 16:23         ` Eli Zaretskii
2019-12-24 21:02 Drew Adams
2019-12-25 14:34 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0eb6dfc-0544-4e03-9705-5828861f0046@default \
    --to=drew.adams@oracle.com \
    --cc=38736@debbugs.gnu.org \
    --cc=eliz@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 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).