(eval-defun-2): Remove parameter
EVAL-DEFUN-ARG-INTERNAL; always print to minibuffer. (eval-defun): If called with prefix arg, instrument code for Edebug.
This commit is contained in:
parent
44b6285eb6
commit
105d6be118
1 changed files with 30 additions and 21 deletions
|
@ -408,7 +408,7 @@ With argument, print output into current buffer."
|
||||||
(cons 'progn (mapcar 'eval-defun-1 (cdr form))))
|
(cons 'progn (mapcar 'eval-defun-1 (cdr form))))
|
||||||
(t form)))
|
(t form)))
|
||||||
|
|
||||||
(defun eval-defun-2 (eval-defun-arg-internal)
|
(defun eval-defun-2 ()
|
||||||
"Evaluate defun that point is in or before.
|
"Evaluate defun that point is in or before.
|
||||||
The value is displayed in the minibuffer.
|
The value is displayed in the minibuffer.
|
||||||
If the current defun is actually a call to `defvar',
|
If the current defun is actually a call to `defvar',
|
||||||
|
@ -430,7 +430,7 @@ Return the result of evaluation."
|
||||||
;; variables like `end'.
|
;; variables like `end'.
|
||||||
(apply
|
(apply
|
||||||
#'eval-region
|
#'eval-region
|
||||||
(let ((standard-output (if eval-defun-arg-internal (current-buffer) t))
|
(let ((standard-output t)
|
||||||
beg end form)
|
beg end form)
|
||||||
;; Read the form from the buffer, and record where it ends.
|
;; Read the form from the buffer, and record where it ends.
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -450,27 +450,36 @@ Return the result of evaluation."
|
||||||
;; The result of evaluation has been put onto VALUES. So return it.
|
;; The result of evaluation has been put onto VALUES. So return it.
|
||||||
(car values))
|
(car values))
|
||||||
|
|
||||||
(defun eval-defun (eval-defun-arg-internal)
|
(defun eval-defun (edebug-it)
|
||||||
"Evaluate defun that point is in or before.
|
"Evaluate the top-level form containing point, or after point.
|
||||||
The value is displayed in the minibuffer.
|
|
||||||
If the current defun is actually a call to `defvar',
|
|
||||||
then reset the variable using the initial value expression
|
|
||||||
even if the variable already has some other value.
|
|
||||||
\(Normally `defvar' does not change the variable's value
|
|
||||||
if it already has a value.\)
|
|
||||||
|
|
||||||
With argument, insert value in current buffer after the defun.
|
If the current defun is actually a call to `defvar', then reset the
|
||||||
Return the result of evaluation."
|
variable using its initial value expression even if the variable
|
||||||
|
already has some other value. (Normally `defvar' does not change the
|
||||||
|
variable's value if it already has a value.)
|
||||||
|
|
||||||
|
With a prefix argument, instrument the code for Edebug.
|
||||||
|
|
||||||
|
If acting on a `defun' for FUNCTION, and the function was
|
||||||
|
instrumented, `Edebug: FUNCTION' is printed in the minibuffer. If not
|
||||||
|
instrumented, just FUNCTION is printed.
|
||||||
|
|
||||||
|
If not acting on a `defun', the result of evaluation is displayed in
|
||||||
|
the minibuffer."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(if (null eval-expression-debug-on-error)
|
(cond (edebug-it
|
||||||
(eval-defun-2 eval-defun-arg-internal)
|
(require 'edebug)
|
||||||
(let ((old-value (make-symbol "t")) new-value value)
|
(eval-defun (not edebug-all-defs)))
|
||||||
(let ((debug-on-error old-value))
|
(t
|
||||||
(setq value (eval-defun-2 eval-defun-arg-internal))
|
(if (null eval-expression-debug-on-error)
|
||||||
(setq new-value debug-on-error))
|
(eval-defun-2)
|
||||||
(unless (eq old-value new-value)
|
(let ((old-value (make-symbol "t")) new-value value)
|
||||||
(setq debug-on-error new-value))
|
(let ((debug-on-error old-value))
|
||||||
value)))
|
(setq value (eval-defun-2))
|
||||||
|
(setq new-value debug-on-error))
|
||||||
|
(unless (eq old-value new-value)
|
||||||
|
(setq debug-on-error new-value))
|
||||||
|
value)))))
|
||||||
|
|
||||||
|
|
||||||
(defun lisp-comment-indent ()
|
(defun lisp-comment-indent ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue