unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 19114@debbugs.gnu.org
Subject: bug#19114: 25.0.50; doc string of `eval-expression-print-format' is inappropriate
Date: Sat, 30 Apr 2016 18:43:16 +0300	[thread overview]
Message-ID: <83zisbnluz.fsf@gnu.org> (raw)
In-Reply-To: <87pot7nn86.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat,  30 Apr 2016 17:13:45 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Sat, 30 Apr 2016 17:13:45 +0200
> Cc: 19114@debbugs.gnu.org
> 
> Drew Adams <drew.adams@oracle.com> writes:
> 
> > The doc string says "Return a formatted string which is displayed in the
> > echo area..."  This is quite misleading.  It can easily give the
> > impression that this function displays the returned value in the echo
> > area.  THIS function does not with the formatted string, besides
> > returning it.  It displays nothing.  Please DTRT.
> 
> (defun eval-expression-print-format (value)
>   "Format VALUE as a result of evaluated expression.
> Return a formatted string which is displayed in the echo area
> in addition to the value printed by prin1 in functions which
> display the result of expression evaluation."
> 
> I don't know quite what they're trying to express here...

Much ado about nothing, if you ask me.  Replace "is displayed" with
"will be displayed", and I think the intent is more clear.

> But then again, I don't understand the meaning of the function, either:
> 
>   (if (and (integerp value)
> 	   (or (eq standard-output t)
> 	       (zerop (prefix-numeric-value current-prefix-arg))))
>       (let ((char-string
> 	     (if (and (characterp value)
> 		      (char-displayable-p value))
> 		 (prin1-char value))))
>         (if char-string
>             (format " (#o%o, #x%x, %s)" value value char-string)
>           (format " (#o%o, #x%x)" value value)))))
> 
> (eval-expression-print-format 1)
> C-x C-e
> " (#o1, #x1, ?\\C-a)" appears in *Messages*
> 
> (eval-expression-print-format 1)
> C-u C-x C-e
> => nil
> Nothing in *Messages*

Try "C-u 0", like the code says.





  parent reply	other threads:[~2016-04-30 15:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20  2:50 bug#19114: 25.0.50; doc string of `eval-expression-print-format' is inappropriate Drew Adams
2016-04-30 15:13 ` Lars Ingebrigtsen
2016-04-30 15:27   ` Michael Heerdegen
2016-04-30 15:33     ` Lars Ingebrigtsen
2016-05-08 22:50       ` Michael Heerdegen
2016-04-30 15:39   ` Lars Ingebrigtsen
2016-04-30 15:43   ` Eli Zaretskii [this message]
2016-04-30 15:47     ` Lars 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

  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=83zisbnluz.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=19114@debbugs.gnu.org \
    --cc=larsi@gnus.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).