Commit b49df39d authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(eval-expression-print-level): New variable.

(eval-expression-print-length): New variable.
(eval-expression-debug-on-error): New variable.
(eval-expression): Bind print-level, print-length and
debug-on-error from those vars.
parent 55f9feda
......@@ -549,6 +549,24 @@ addition, the encoding is fully shown."
(defvar read-expression-history nil)
(defcustom eval-expression-print-level 4
"*Value to use for `print-level' when printing value in `eval-expression'."
:group 'lisp
:type 'integer
:version "21.1")
(defcustom eval-expression-print-length 12
"*Value to use for `print-length' when printing value in `eval-expression'."
:group 'lisp
:type 'integer
:version "21.1")
(defcustom eval-expression-debug-on-error t
"*Value to use for `debug-on-error' when evaluating in `eval-expression'."
:group 'lisp
:type 'boolean
:version "21.1")
;; We define this, rather than making `eval' interactive,
;; for the sake of completion of names like eval-region, eval-current-buffer.
(defun eval-expression (eval-expression-arg
......@@ -560,9 +578,12 @@ Value is also consed on to front of the variable `values'."
nil read-expression-map t
(setq values (cons (eval eval-expression-arg) values))
(let ((debug-on-error eval-expression-debug-on-error))
(setq values (cons (eval eval-expression-arg) values)))
(let ((print-length eval-expression-print-length)
(print-level eval-expression-print-level))
(prin1 (car values)
(if eval-expression-insert-value (current-buffer) t)))
(if eval-expression-insert-value (current-buffer) t))))
(defun edit-and-eval-command (prompt command)
"Prompting with PROMPT, let user edit COMMAND and eval result.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment