diff options
| author | Gerd Moellmann | 2000-07-05 15:16:15 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-07-05 15:16:15 +0000 |
| commit | 105d6be118e80b4430aa986f80ae5d9115d8dc3c (patch) | |
| tree | 259a27e800839c442d79575b48ebbf9595649d14 | |
| parent | 44b6285eb6187d9da56d55fda68f9dcc766fdfb4 (diff) | |
| download | emacs-105d6be118e80b4430aa986f80ae5d9115d8dc3c.tar.gz emacs-105d6be118e80b4430aa986f80ae5d9115d8dc3c.zip | |
(eval-defun-2): Remove parameter
EVAL-DEFUN-ARG-INTERNAL; always print to minibuffer.
(eval-defun): If called with prefix arg, instrument code for
Edebug.
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 74a0aed7eac..4a794883bd9 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -408,7 +408,7 @@ With argument, print output into current buffer." | |||
| 408 | (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) | 408 | (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) |
| 409 | (t form))) | 409 | (t form))) |
| 410 | 410 | ||
| 411 | (defun eval-defun-2 (eval-defun-arg-internal) | 411 | (defun eval-defun-2 () |
| 412 | "Evaluate defun that point is in or before. | 412 | "Evaluate defun that point is in or before. |
| 413 | The value is displayed in the minibuffer. | 413 | The value is displayed in the minibuffer. |
| 414 | If the current defun is actually a call to `defvar', | 414 | If the current defun is actually a call to `defvar', |
| @@ -430,7 +430,7 @@ Return the result of evaluation." | |||
| 430 | ;; variables like `end'. | 430 | ;; variables like `end'. |
| 431 | (apply | 431 | (apply |
| 432 | #'eval-region | 432 | #'eval-region |
| 433 | (let ((standard-output (if eval-defun-arg-internal (current-buffer) t)) | 433 | (let ((standard-output t) |
| 434 | beg end form) | 434 | beg end form) |
| 435 | ;; Read the form from the buffer, and record where it ends. | 435 | ;; Read the form from the buffer, and record where it ends. |
| 436 | (save-excursion | 436 | (save-excursion |
| @@ -450,27 +450,36 @@ Return the result of evaluation." | |||
| 450 | ;; The result of evaluation has been put onto VALUES. So return it. | 450 | ;; The result of evaluation has been put onto VALUES. So return it. |
| 451 | (car values)) | 451 | (car values)) |
| 452 | 452 | ||
| 453 | (defun eval-defun (eval-defun-arg-internal) | 453 | (defun eval-defun (edebug-it) |
| 454 | "Evaluate defun that point is in or before. | 454 | "Evaluate the top-level form containing point, or after point. |
| 455 | The value is displayed in the minibuffer. | ||
| 456 | If the current defun is actually a call to `defvar', | ||
| 457 | then reset the variable using the initial value expression | ||
| 458 | even if the variable already has some other value. | ||
| 459 | \(Normally `defvar' does not change the variable's value | ||
| 460 | if it already has a value.\) | ||
| 461 | 455 | ||
| 462 | With argument, insert value in current buffer after the defun. | 456 | If the current defun is actually a call to `defvar', then reset the |
| 463 | Return the result of evaluation." | 457 | variable using its initial value expression even if the variable |
| 458 | already has some other value. (Normally `defvar' does not change the | ||
| 459 | variable's value if it already has a value.) | ||
| 460 | |||
| 461 | With a prefix argument, instrument the code for Edebug. | ||
| 462 | |||
| 463 | If acting on a `defun' for FUNCTION, and the function was | ||
| 464 | instrumented, `Edebug: FUNCTION' is printed in the minibuffer. If not | ||
| 465 | instrumented, just FUNCTION is printed. | ||
| 466 | |||
| 467 | If not acting on a `defun', the result of evaluation is displayed in | ||
| 468 | the minibuffer." | ||
| 464 | (interactive "P") | 469 | (interactive "P") |
| 465 | (if (null eval-expression-debug-on-error) | 470 | (cond (edebug-it |
| 466 | (eval-defun-2 eval-defun-arg-internal) | 471 | (require 'edebug) |
| 467 | (let ((old-value (make-symbol "t")) new-value value) | 472 | (eval-defun (not edebug-all-defs))) |
| 468 | (let ((debug-on-error old-value)) | 473 | (t |
| 469 | (setq value (eval-defun-2 eval-defun-arg-internal)) | 474 | (if (null eval-expression-debug-on-error) |
| 470 | (setq new-value debug-on-error)) | 475 | (eval-defun-2) |
| 471 | (unless (eq old-value new-value) | 476 | (let ((old-value (make-symbol "t")) new-value value) |
| 472 | (setq debug-on-error new-value)) | 477 | (let ((debug-on-error old-value)) |
| 473 | value))) | 478 | (setq value (eval-defun-2)) |
| 479 | (setq new-value debug-on-error)) | ||
| 480 | (unless (eq old-value new-value) | ||
| 481 | (setq debug-on-error new-value)) | ||
| 482 | value))))) | ||
| 474 | 483 | ||
| 475 | 484 | ||
| 476 | (defun lisp-comment-indent () | 485 | (defun lisp-comment-indent () |