diff options
| author | Paul Eggert | 2018-07-23 00:57:06 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-07-23 01:10:07 -0700 |
| commit | 57c4bc146b7e17b6f662604047cb5d10982f962c (patch) | |
| tree | 7dd14e74987d90030468e71ca7ca5929dfd06a8c | |
| parent | 109cb1520c690038d387aa290bb03261f7c5a1f6 (diff) | |
| download | emacs-57c4bc146b7e17b6f662604047cb5d10982f962c.tar.gz emacs-57c4bc146b7e17b6f662604047cb5d10982f962c.zip | |
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.
| -rw-r--r-- | lisp/emacs-lisp/cl-print.el | 4 | ||||
| -rw-r--r-- | lisp/profiler.el | 6 | ||||
| -rw-r--r-- | 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'." | |||
| 109 | (princ (hash-table-count object) stream) | 109 | (princ (hash-table-count object) stream) |
| 110 | (princ "/" stream) | 110 | (princ "/" stream) |
| 111 | (princ (hash-table-size object) stream) | 111 | (princ (hash-table-size object) stream) |
| 112 | (princ (format " 0x%x" (sxhash object)) stream) | 112 | (princ (format " %#x" (sxhash object)) stream) |
| 113 | (princ ">" stream)) | 113 | (princ ">" stream)) |
| 114 | 114 | ||
| 115 | (define-button-type 'help-byte-code | 115 | (define-button-type 'help-byte-code |
| @@ -166,7 +166,7 @@ into a button whose action shows the function's disassembly.") | |||
| 166 | (let ((button-start (and cl-print-compiled-button | 166 | (let ((button-start (and cl-print-compiled-button |
| 167 | (bufferp stream) | 167 | (bufferp stream) |
| 168 | (with-current-buffer stream (point))))) | 168 | (with-current-buffer stream (point))))) |
| 169 | (princ (format "#<bytecode 0x%x>" (sxhash object)) stream) | 169 | (princ (format "#<bytecode %#x>" (sxhash object)) stream) |
| 170 | (when (eq cl-print-compiled 'static) | 170 | (when (eq cl-print-compiled 'static) |
| 171 | (princ " " stream) | 171 | (princ " " stream) |
| 172 | (cl-print-object (aref object 2) stream)) | 172 | (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 @@ | |||
| 105 | "Format ENTRY in human readable string. ENTRY would be a | 105 | "Format ENTRY in human readable string. ENTRY would be a |
| 106 | function name of a function itself." | 106 | function name of a function itself." |
| 107 | (cond ((memq (car-safe entry) '(closure lambda)) | 107 | (cond ((memq (car-safe entry) '(closure lambda)) |
| 108 | (format "#<lambda 0x%x>" (sxhash entry))) | 108 | (format "#<lambda %#x>" (sxhash entry))) |
| 109 | ((byte-code-function-p entry) | 109 | ((byte-code-function-p entry) |
| 110 | (format "#<compiled 0x%x>" (sxhash entry))) | 110 | (format "#<compiled %#x>" (sxhash entry))) |
| 111 | ((or (subrp entry) (symbolp entry) (stringp entry)) | 111 | ((or (subrp entry) (symbolp entry) (stringp entry)) |
| 112 | (format "%s" entry)) | 112 | (format "%s" entry)) |
| 113 | (t | 113 | (t |
| 114 | (format "#<unknown 0x%x>" (sxhash entry))))) | 114 | (format "#<unknown %#x>" (sxhash entry))))) |
| 115 | 115 | ||
| 116 | (defun profiler-fixup-entry (entry) | 116 | (defun profiler-fixup-entry (entry) |
| 117 | (if (symbolp entry) | 117 | (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." | |||
| 1625 | ((integerp result) | 1625 | ((integerp result) |
| 1626 | (if (or (= 0 result) (= 1 result)) | 1626 | (if (or (= 0 result) (= 1 result)) |
| 1627 | (message "%S <= `%s'" result exprstring) | 1627 | (message "%S <= `%s'" result exprstring) |
| 1628 | (message "%S (0x%x) <= `%s'" result result exprstring))) | 1628 | (message "%S (%#x) <= `%s'" result result exprstring))) |
| 1629 | ((null result) (message "%S <= `%s'" 'false exprstring)) | 1629 | ((null result) (message "%S <= `%s'" 'false exprstring)) |
| 1630 | ((eq t result) (message "%S <= `%s'" 'true exprstring)) | 1630 | ((eq t result) (message "%S <= `%s'" 'true exprstring)) |
| 1631 | (t (message "%S <= `%s'" result exprstring))) | 1631 | (t (message "%S <= `%s'" result exprstring))) |