]> code.delx.au - gnu-emacs/commitdiff
(eval-defun): Return the evaluation result.
authorKarl Heuer <kwzh@gnu.org>
Tue, 6 Oct 1998 23:33:04 +0000 (23:33 +0000)
committerKarl Heuer <kwzh@gnu.org>
Tue, 6 Oct 1998 23:33:04 +0000 (23:33 +0000)
lisp/emacs-lisp/lisp-mode.el

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