Function: eval-expression-print-format

eval-expression-print-format is a byte-compiled function defined in simple.el.gz.

Signature

(eval-expression-print-format VALUE)

Documentation

If VALUE is an integer, return a specially formatted string.

This string will typically look like " (#o1, #x1, ?\\C-a)". If VALUE is not an integer, return nil. This function is used by commands like eval-expression that display the result of expression evaluation.

Probably introduced at or before Emacs version 22.1.

Source Code

;; Defined in /usr/src/emacs/lisp/simple.el.gz
(defun eval-expression-print-format (value)
  "If VALUE is an integer, return a specially formatted string.
This string will typically look like \" (#o1, #x1, ?\\C-a)\".
If VALUE is not an integer, return nil.
This function is used by commands like `eval-expression' that
display the result of expression evaluation."
  (when (integerp value)
    (let ((char-string
           (and (characterp value)
                (<= value eval-expression-print-maximum-character)
                (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)))))