diff options
author | Juri Linkov <juri@linkov.net> | 2020-10-31 22:11:02 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2020-10-31 22:11:02 +0200 |
commit | 5d9e456c3ed3dcefe6bf48e24a1a8f275fc887cb (patch) | |
tree | fc7e141fbde3a524969741ecbc91614c67550503 /doc | |
parent | c307c9648d541338814fe541389ea8c7a1cf50a5 (diff) | |
download | emacs-5d9e456c3ed3dcefe6bf48e24a1a8f275fc887cb.tar.gz |
New variable integer-output-format to print integers as characters (bug#44155)
* doc/lispref/streams.texi (Output Variables): Add integer-output-format.
* src/print.c (print_object): In case of Lisp_Int, print integers
as characters when Vinteger_output_format is Qt, and in hex format
when Vinteger_output_format is 16.
(Vinteger_output_format): New variable.
* test/src/print-tests.el (print-integer-output-format): New test.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lispref/streams.texi | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index 2cd61ad04fc..f171f137790 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -902,3 +902,11 @@ variable. The string should hold a @samp{%}-specification to be used in the C function @code{sprintf}. For further restrictions on what you can use, see the variable's documentation string. @end defvar + +@defvar integer-output-format +This variable specifies how to print integer numbers. The default is +@code{nil}, meaning use the decimal format. When bound to @code{t}, +print integers as characters when an integer represents a character +(@pxref{Basic Char Syntax}). When bound to the number @code{16}, +print non-negative integers in the hexadecimal format. +@end defvar |