From 57c4bc146b7e17b6f662604047cb5d10982f962c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 23 Jul 2018 00:57:06 -0700 Subject: [PATCH] =?utf8?q?0x%x=20=E2=86=92=20%#x=20in=20elisp=20formats?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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. --- lisp/emacs-lisp/cl-print.el | 4 ++-- lisp/profiler.el | 6 +++--- lisp/progmodes/hideif.el | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 1eae8faf236..bf5b1e878d5 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -109,7 +109,7 @@ call other entry points instead, such as `cl-prin1'." (princ (hash-table-count object) stream) (princ "/" stream) (princ (hash-table-size object) stream) - (princ (format " 0x%x" (sxhash object)) stream) + (princ (format " %#x" (sxhash object)) stream) (princ ">" stream)) (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 (bufferp stream) (with-current-buffer stream (point))))) - (princ (format "#" (sxhash object)) stream) + (princ (format "#" (sxhash object)) stream) (when (eq cl-print-compiled 'static) (princ " " stream) (cl-print-object (aref object 2) stream)) diff --git a/lisp/profiler.el b/lisp/profiler.el index eaeb69793fb..41dea68bd13 100644 --- a/lisp/profiler.el +++ b/lisp/profiler.el @@ -105,13 +105,13 @@ "Format ENTRY in human readable string. ENTRY would be a function name of a function itself." (cond ((memq (car-safe entry) '(closure lambda)) - (format "#" (sxhash entry))) + (format "#" (sxhash entry))) ((byte-code-function-p entry) - (format "#" (sxhash entry))) + (format "#" (sxhash entry))) ((or (subrp entry) (symbolp entry) (stringp entry)) (format "%s" entry)) (t - (format "#" (sxhash entry))))) + (format "#" (sxhash entry))))) (defun profiler-fixup-entry (entry) (if (symbolp entry) diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index ce7127a3d77..24ad2ff6c75 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -1625,7 +1625,7 @@ not be expanded." ((integerp result) (if (or (= 0 result) (= 1 result)) (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)) ((eq t result) (message "%S <= `%s'" 'true exprstring)) (t (message "%S <= `%s'" result exprstring))) -- 2.39.2