bug-gnu-emacs
[Top][All Lists]
Advanced

[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: Lars Ingebrigtsen
Subject: bug#19114: 25.0.50; doc string of `eval-expression-print-format' is inappropriate
Date: Sat, 30 Apr 2016 17:13:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]