diff options
| author | Richard M. Stallman | 1999-09-14 07:00:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-09-14 07:00:04 +0000 |
| commit | b49df39ddcfc578234530208eba8e288f604db1b (patch) | |
| tree | 3a72b98cc3f6c27b2480c1a7308bd3cfa3540583 | |
| parent | 55f9feda4f89a14e4f4f32d0ce4a4ea7d2ad978e (diff) | |
| download | emacs-b49df39ddcfc578234530208eba8e288f604db1b.tar.gz emacs-b49df39ddcfc578234530208eba8e288f604db1b.zip | |
(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.
| -rw-r--r-- | lisp/simple.el | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 89033f82688..9a77e3de806 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -549,6 +549,24 @@ addition, the encoding is fully shown." | |||
| 549 | 549 | ||
| 550 | (defvar read-expression-history nil) | 550 | (defvar read-expression-history nil) |
| 551 | 551 | ||
| 552 | (defcustom eval-expression-print-level 4 | ||
| 553 | "*Value to use for `print-level' when printing value in `eval-expression'." | ||
| 554 | :group 'lisp | ||
| 555 | :type 'integer | ||
| 556 | :version "21.1") | ||
| 557 | |||
| 558 | (defcustom eval-expression-print-length 12 | ||
| 559 | "*Value to use for `print-length' when printing value in `eval-expression'." | ||
| 560 | :group 'lisp | ||
| 561 | :type 'integer | ||
| 562 | :version "21.1") | ||
| 563 | |||
| 564 | (defcustom eval-expression-debug-on-error t | ||
| 565 | "*Value to use for `debug-on-error' when evaluating in `eval-expression'." | ||
| 566 | :group 'lisp | ||
| 567 | :type 'boolean | ||
| 568 | :version "21.1") | ||
| 569 | |||
| 552 | ;; We define this, rather than making `eval' interactive, | 570 | ;; We define this, rather than making `eval' interactive, |
| 553 | ;; for the sake of completion of names like eval-region, eval-current-buffer. | 571 | ;; for the sake of completion of names like eval-region, eval-current-buffer. |
| 554 | (defun eval-expression (eval-expression-arg | 572 | (defun eval-expression (eval-expression-arg |
| @@ -560,9 +578,12 @@ Value is also consed on to front of the variable `values'." | |||
| 560 | nil read-expression-map t | 578 | nil read-expression-map t |
| 561 | 'read-expression-history) | 579 | 'read-expression-history) |
| 562 | current-prefix-arg)) | 580 | current-prefix-arg)) |
| 563 | (setq values (cons (eval eval-expression-arg) values)) | 581 | (let ((debug-on-error eval-expression-debug-on-error)) |
| 564 | (prin1 (car values) | 582 | (setq values (cons (eval eval-expression-arg) values))) |
| 565 | (if eval-expression-insert-value (current-buffer) t))) | 583 | (let ((print-length eval-expression-print-length) |
| 584 | (print-level eval-expression-print-level)) | ||
| 585 | (prin1 (car values) | ||
| 586 | (if eval-expression-insert-value (current-buffer) t)))) | ||
| 566 | 587 | ||
| 567 | (defun edit-and-eval-command (prompt command) | 588 | (defun edit-and-eval-command (prompt command) |
| 568 | "Prompting with PROMPT, let user edit COMMAND and eval result. | 589 | "Prompting with PROMPT, let user edit COMMAND and eval result. |