From 2298f9f7d86904ee3b4600eadf7c95cf02acfa21 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Tue, 6 Oct 1998 23:33:04 +0000 Subject: [PATCH] (eval-defun): Return the evaluation result. --- lisp/emacs-lisp/lisp-mode.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 3396071c5e..ab6efd137e 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -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)))) (defun lisp-comment-indent () (if (looking-at "\\s<\\s<\\s<") -- 2.20.1