mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
0x%x → %#x in elisp formats
* lisp/emacs-lisp/cl-print.el (cl-print-object): * lisp/profiler.el (profiler-format-entry): * lisp/progmodes/hideif.el (hif-evaluate-macro): Prefer %#x to 0x%x in elisp formats when formatting arbitrary integers, as it’ll produce more-readable output with negative args should we change how negative values are printed with %x.
This commit is contained in:
parent
109cb1520c
commit
57c4bc146b
3 changed files with 6 additions and 6 deletions
|
|
@ -109,7 +109,7 @@ call other entry points instead, such as `cl-prin1'."
|
||||||
(princ (hash-table-count object) stream)
|
(princ (hash-table-count object) stream)
|
||||||
(princ "/" stream)
|
(princ "/" stream)
|
||||||
(princ (hash-table-size object) stream)
|
(princ (hash-table-size object) stream)
|
||||||
(princ (format " 0x%x" (sxhash object)) stream)
|
(princ (format " %#x" (sxhash object)) stream)
|
||||||
(princ ">" stream))
|
(princ ">" stream))
|
||||||
|
|
||||||
(define-button-type 'help-byte-code
|
(define-button-type 'help-byte-code
|
||||||
|
|
@ -166,7 +166,7 @@ into a button whose action shows the function's disassembly.")
|
||||||
(let ((button-start (and cl-print-compiled-button
|
(let ((button-start (and cl-print-compiled-button
|
||||||
(bufferp stream)
|
(bufferp stream)
|
||||||
(with-current-buffer stream (point)))))
|
(with-current-buffer stream (point)))))
|
||||||
(princ (format "#<bytecode 0x%x>" (sxhash object)) stream)
|
(princ (format "#<bytecode %#x>" (sxhash object)) stream)
|
||||||
(when (eq cl-print-compiled 'static)
|
(when (eq cl-print-compiled 'static)
|
||||||
(princ " " stream)
|
(princ " " stream)
|
||||||
(cl-print-object (aref object 2) stream))
|
(cl-print-object (aref object 2) stream))
|
||||||
|
|
|
||||||
|
|
@ -105,13 +105,13 @@
|
||||||
"Format ENTRY in human readable string. ENTRY would be a
|
"Format ENTRY in human readable string. ENTRY would be a
|
||||||
function name of a function itself."
|
function name of a function itself."
|
||||||
(cond ((memq (car-safe entry) '(closure lambda))
|
(cond ((memq (car-safe entry) '(closure lambda))
|
||||||
(format "#<lambda 0x%x>" (sxhash entry)))
|
(format "#<lambda %#x>" (sxhash entry)))
|
||||||
((byte-code-function-p entry)
|
((byte-code-function-p entry)
|
||||||
(format "#<compiled 0x%x>" (sxhash entry)))
|
(format "#<compiled %#x>" (sxhash entry)))
|
||||||
((or (subrp entry) (symbolp entry) (stringp entry))
|
((or (subrp entry) (symbolp entry) (stringp entry))
|
||||||
(format "%s" entry))
|
(format "%s" entry))
|
||||||
(t
|
(t
|
||||||
(format "#<unknown 0x%x>" (sxhash entry)))))
|
(format "#<unknown %#x>" (sxhash entry)))))
|
||||||
|
|
||||||
(defun profiler-fixup-entry (entry)
|
(defun profiler-fixup-entry (entry)
|
||||||
(if (symbolp entry)
|
(if (symbolp entry)
|
||||||
|
|
|
||||||
|
|
@ -1625,7 +1625,7 @@ not be expanded."
|
||||||
((integerp result)
|
((integerp result)
|
||||||
(if (or (= 0 result) (= 1 result))
|
(if (or (= 0 result) (= 1 result))
|
||||||
(message "%S <= `%s'" result exprstring)
|
(message "%S <= `%s'" result exprstring)
|
||||||
(message "%S (0x%x) <= `%s'" result result exprstring)))
|
(message "%S (%#x) <= `%s'" result result exprstring)))
|
||||||
((null result) (message "%S <= `%s'" 'false exprstring))
|
((null result) (message "%S <= `%s'" 'false exprstring))
|
||||||
((eq t result) (message "%S <= `%s'" 'true exprstring))
|
((eq t result) (message "%S <= `%s'" 'true exprstring))
|
||||||
(t (message "%S <= `%s'" result exprstring)))
|
(t (message "%S <= `%s'" result exprstring)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue