aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNoam Postavsky2017-04-23 22:30:20 -0400
committerNoam Postavsky2017-05-19 18:16:38 -0400
commitacd58c9198c08c3eb631a3f036b4f95073f7fe10 (patch)
tree8b837e0c83559e249d7aee8250edeb483c8748d2 /doc
parent267be4bdc28564a99f45da29e84eb98838117b50 (diff)
downloademacs-acd58c9198c08c3eb631a3f036b4f95073f7fe10.tar.gz
emacs-acd58c9198c08c3eb631a3f036b4f95073f7fe10.zip
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.texi13
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.)
1485Emacs Lisp expression preceding point in the buffer, and displays the 1485Emacs Lisp expression preceding point in the buffer, and displays the
1486value in the echo area. When the result of an evaluation is an 1486value in the echo area. When the result of an evaluation is an
1487integer, it is displayed together with the value in other formats 1487integer, it is displayed together with the value in other formats
1488(octal, hexadecimal, and character). 1488(octal, hexadecimal, and character if
1489@code{eval-expression-print-maximum-character}, described below,
1490allows it).
1489 1491
1490 If @kbd{M-:} or @kbd{C-x C-e} is given a prefix argument, it inserts 1492 If @kbd{M-:} or @kbd{C-x C-e} is given a prefix argument, it inserts
1491the value into the current buffer at point, rather than displaying it 1493the 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
1493is inserted together with its value in other formats (octal, 1495is inserted together with its value in other formats (octal,
1494hexadecimal, and character). Such a prefix argument also prevents 1496hexadecimal, and character). Such a prefix argument also prevents
1495abbreviation of the output according to the variables 1497abbreviation of the output according to the variables
1496@code{eval-expression-print-level} and @code{eval-expression-print-length} 1498@code{eval-expression-print-level} and
1497(see below). 1499@code{eval-expression-print-length} (see below). Similarly, a prefix
1500argument of @code{-1} overrides the effect of
1501@code{eval-expression-print-length}.
1498 1502
1499@kindex C-M-x @r{(Emacs Lisp mode)} 1503@kindex C-M-x @r{(Emacs Lisp mode)}
1500@findex eval-defun 1504@findex eval-defun
@@ -1524,6 +1528,7 @@ eval-buffer} is similar but evaluates the entire buffer.
1524 1528
1525@vindex eval-expression-print-level 1529@vindex eval-expression-print-level
1526@vindex eval-expression-print-length 1530@vindex eval-expression-print-length
1531@vindex eval-expression-print-maximum-character
1527@vindex eval-expression-debug-on-error 1532@vindex eval-expression-debug-on-error
1528 The options @code{eval-expression-print-level} and 1533 The options @code{eval-expression-print-level} and
1529@code{eval-expression-print-length} control the maximum depth and 1534@code{eval-expression-print-length} control the maximum depth and
@@ -1533,6 +1538,8 @@ before abbreviating them. Supplying a zero prefix argument to
1533printed in full. @code{eval-expression-debug-on-error} controls 1538printed in full. @code{eval-expression-debug-on-error} controls
1534whether evaluation errors invoke the debugger when these commands are 1539whether evaluation errors invoke the debugger when these commands are
1535used; its default is @code{t}. 1540used; its default is @code{t}.
1541@code{eval-expression-print-maximum-character} prevents integers which
1542are larger than it from being displayed as characters.
1536 1543
1537@node Lisp Interaction 1544@node Lisp Interaction
1538@section Lisp Interaction Buffers 1545@section Lisp Interaction Buffers