diff options
author | Noam Postavsky <npostavs@gmail.com> | 2017-04-23 22:30:20 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-05-19 18:16:38 -0400 |
commit | acd58c9198c08c3eb631a3f036b4f95073f7fe10 (patch) | |
tree | 8b837e0c83559e249d7aee8250edeb483c8748d2 /doc | |
parent | 267be4bdc28564a99f45da29e84eb98838117b50 (diff) | |
download | emacs-acd58c9198c08c3eb631a3f036b4f95073f7fe10.tar.gz |
Limit integers printed as characters (Bug#16828)
* lisp/simple.el (eval-expression-print-maximum-character): New
variable.
(eval-expression-print-format): Only display value as character if
it's less than or equal to `eval-expression-print-maximum-character'.
(eval-expression-get-print-arguments): Check
eval-expression-print-maximum-character, allow negative arg to
override it.
(eval-expression):
* lisp/progmodes/elisp-mode.el (elisp--eval-last-sexp):
(elisp--eval-last-sexp-print-value): Handle new variable.
* doc/emacs/building.texi (Lisp Eval): Document new variable and
behavior.
* etc/NEWS: Announce it.
* test/lisp/progmodes/elisp-mode-tests.el
(eval-last-sexp-print-format-small-int)
(eval-last-sexp-print-format-small-int-echo)
(eval-last-sexp-print-format-large-int)
(eval-last-sexp-print-format-large-int-echo):
* test/lisp/simple-tests.el (eval-expression-print-format-small-int)
(eval-expression-print-format-small-int-echo)
(eval-expression-print-format-large-int)
(eval-expression-print-format-large-int-echo): New tests.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/emacs/building.texi | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index ba8eae07591..f7eb8fe9eaf 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi @@ -1485,7 +1485,9 @@ expression.) Emacs Lisp expression preceding point in the buffer, and displays the value in the echo area. When the result of an evaluation is an integer, it is displayed together with the value in other formats -(octal, hexadecimal, and character). +(octal, hexadecimal, and character if +@code{eval-expression-print-maximum-character}, described below, +allows it). If @kbd{M-:} or @kbd{C-x C-e} is given a prefix argument, it inserts the value into the current buffer at point, rather than displaying it @@ -1493,8 +1495,10 @@ in the echo area. If the prefix argument is zero, any integer output is inserted together with its value in other formats (octal, hexadecimal, and character). Such a prefix argument also prevents abbreviation of the output according to the variables -@code{eval-expression-print-level} and @code{eval-expression-print-length} -(see below). +@code{eval-expression-print-level} and +@code{eval-expression-print-length} (see below). Similarly, a prefix +argument of @code{-1} overrides the effect of +@code{eval-expression-print-length}. @kindex C-M-x @r{(Emacs Lisp mode)} @findex eval-defun @@ -1524,6 +1528,7 @@ eval-buffer} is similar but evaluates the entire buffer. @vindex eval-expression-print-level @vindex eval-expression-print-length +@vindex eval-expression-print-maximum-character @vindex eval-expression-debug-on-error The options @code{eval-expression-print-level} and @code{eval-expression-print-length} control the maximum depth and @@ -1533,6 +1538,8 @@ before abbreviating them. Supplying a zero prefix argument to printed in full. @code{eval-expression-debug-on-error} controls whether evaluation errors invoke the debugger when these commands are used; its default is @code{t}. +@code{eval-expression-print-maximum-character} prevents integers which +are larger than it from being displayed as characters. @node Lisp Interaction @section Lisp Interaction Buffers |