Commit 2298f9f7 authored by Karl Heuer's avatar Karl Heuer

(eval-defun): Return the evaluation result.

parent 5577e2b2
...@@ -339,7 +339,8 @@ With argument, print output into current buffer." ...@@ -339,7 +339,8 @@ With argument, print output into current buffer."
(defun eval-defun (eval-defun-arg-internal) (defun eval-defun (eval-defun-arg-internal)
"Evaluate defun that point is in or before. "Evaluate defun that point is in or before.
Print value in minibuffer. Print value in minibuffer.
With argument, insert value in current buffer after the defun." With argument, insert value in current buffer after the defun.
Return the result of evaluation."
(interactive "P") (interactive "P")
(let ((standard-output (if eval-defun-arg-internal (current-buffer) t)) (let ((standard-output (if eval-defun-arg-internal (current-buffer) t))
beg end form) beg end form)
...@@ -367,7 +368,10 @@ With argument, insert value in current buffer after the defun." ...@@ -367,7 +368,10 @@ With argument, insert value in current buffer after the defun."
;; Skipping to the end of the specified region ;; Skipping to the end of the specified region
;; will make eval-region return. ;; will make eval-region return.
(goto-char end) (goto-char end)
form))))) form))
;; The result of evaluation has been put onto VALUES.
;; So return it.
(car values))))
(defun lisp-comment-indent () (defun lisp-comment-indent ()
(if (looking-at "\\s<\\s<\\s<") (if (looking-at "\\s<\\s<\\s<")
......
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