changeset 248:287cf3ae183a

*** empty log message ***
author Roland McGrath <roland@gnu.org>
date Wed, 01 May 1991 00:45:54 +0000
parents 8b9aa51c8a69
children 43cdaf2db624
files lisp/emacs-lisp/lisp-mode.el
diffstat 1 files changed, 19 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el	Tue Apr 30 14:08:18 1991 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Wed May 01 00:45:54 1991 +0000
@@ -200,46 +200,34 @@
   (lisp-mode-variables nil)
   (run-hooks 'lisp-interaction-mode-hook))
 
-(defun eval-print-last-sexp (arg)
+(defun eval-print-last-sexp ()
   "Evaluate sexp before point; print value into current buffer."
-  (interactive "P")
-  (eval-region
-    (let ((stab (syntax-table)))
-      (unwind-protect
-	  (save-excursion
-	    (set-syntax-table emacs-lisp-mode-syntax-table)
-	    (forward-sexp -1)
-	    (point))
-	(set-syntax-table stab)))
-    (point)
-    (current-buffer)))
+  (interactive)
+  (eval-last-sexp t))
 
 (defun eval-last-sexp (arg)
   "Evaluate sexp before point; print value in minibuffer.
 With argument, print output into current buffer."
   (interactive "P")
-  (eval-region
-    (let ((stab (syntax-table)))
-      (unwind-protect
-	  (save-excursion
-	    (set-syntax-table emacs-lisp-mode-syntax-table)
-	    (forward-sexp -1)
-	    (point))
-	(set-syntax-table stab)))
-    (point)
-    (if arg (current-buffer) t)))
+  (prin1 (let ((stab (syntax-table)))
+	   (eval (unwind-protect
+		     (save-excursion
+		       (set-syntax-table emacs-lisp-mode-syntax-table)
+		       (forward-sexp -1)
+		       (read (current-buffer)))
+		   (set-syntax-table stab))))
+	 (if arg (current-buffer) t)))
 
 (defun eval-defun (arg)
-  "Evaluate defun that point is in or before.  Print value in minibuffer.
-With argument, edebug-defun it instead, preparing it for source-level
-debugging with the electric debugger."
+  "Evaluate defun that point is in or before.
+Print value in minibuffer.
+With argument, insert value in current buffer after the defun."
   (interactive "P")
-  (if arg (edebug-defun)
-    (save-excursion
-      (end-of-defun)
-      (let ((end (point)))
-	(beginning-of-defun)
-	(eval-region (point) end t)))))
+  (prin1 (eval (save-excursion
+		 (end-of-defun)
+		 (beginning-of-defun)
+		 (read (current-buffer))))
+	 (if arg (current-buffer) t)))
 
 (defun lisp-comment-indent ()
   (if (looking-at "\\s<\\s<\\s<")