[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#19114: 25.0.50; doc string of `eval-expression-print-format' is inap
From: |
Eli Zaretskii |
Subject: |
bug#19114: 25.0.50; doc string of `eval-expression-print-format' is inappropriate |
Date: |
Sat, 30 Apr 2016 18:43:16 +0300 |
> 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.