unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Drew Adams <drew.adams@oracle.com>
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 17:13:45 +0200	[thread overview]
Message-ID: <87pot7nn86.fsf@gnus.org> (raw)
In-Reply-To: <cd69422b-1f62-4f3d-92cf-2e2a75d972c6@default> (Drew Adams's message of "Wed, 19 Nov 2014 18:50:19 -0800 (PST)")

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

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*

(eval-expression-print-format 'foo)
nil

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2016-04-30 15:13 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 [this message]
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
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=87pot7nn86.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=19114@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).