diff options
| author | Roland McGrath | 1991-05-01 00:45:54 +0000 |
|---|---|---|
| committer | Roland McGrath | 1991-05-01 00:45:54 +0000 |
| commit | 121f0d57235a50b09d7edfadc0dc0286eff86e8c (patch) | |
| tree | b6a7c164034883a292fff10deccd8e1c135e8a0c | |
| parent | c22ca93bc3ff7029bf25c2eb132272e5365f2d10 (diff) | |
| download | emacs-121f0d57235a50b09d7edfadc0dc0286eff86e8c.tar.gz emacs-121f0d57235a50b09d7edfadc0dc0286eff86e8c.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index e9a05c5abca..4135c0f77e8 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el | |||
| @@ -200,46 +200,34 @@ if that value is non-nil." | |||
| 200 | (lisp-mode-variables nil) | 200 | (lisp-mode-variables nil) |
| 201 | (run-hooks 'lisp-interaction-mode-hook)) | 201 | (run-hooks 'lisp-interaction-mode-hook)) |
| 202 | 202 | ||
| 203 | (defun eval-print-last-sexp (arg) | 203 | (defun eval-print-last-sexp () |
| 204 | "Evaluate sexp before point; print value into current buffer." | 204 | "Evaluate sexp before point; print value into current buffer." |
| 205 | (interactive "P") | 205 | (interactive) |
| 206 | (eval-region | 206 | (eval-last-sexp t)) |
| 207 | (let ((stab (syntax-table))) | ||
| 208 | (unwind-protect | ||
| 209 | (save-excursion | ||
| 210 | (set-syntax-table emacs-lisp-mode-syntax-table) | ||
| 211 | (forward-sexp -1) | ||
| 212 | (point)) | ||
| 213 | (set-syntax-table stab))) | ||
| 214 | (point) | ||
| 215 | (current-buffer))) | ||
| 216 | 207 | ||
| 217 | (defun eval-last-sexp (arg) | 208 | (defun eval-last-sexp (arg) |
| 218 | "Evaluate sexp before point; print value in minibuffer. | 209 | "Evaluate sexp before point; print value in minibuffer. |
| 219 | With argument, print output into current buffer." | 210 | With argument, print output into current buffer." |
| 220 | (interactive "P") | 211 | (interactive "P") |
| 221 | (eval-region | 212 | (prin1 (let ((stab (syntax-table))) |
| 222 | (let ((stab (syntax-table))) | 213 | (eval (unwind-protect |
| 223 | (unwind-protect | 214 | (save-excursion |
| 224 | (save-excursion | 215 | (set-syntax-table emacs-lisp-mode-syntax-table) |
| 225 | (set-syntax-table emacs-lisp-mode-syntax-table) | 216 | (forward-sexp -1) |
| 226 | (forward-sexp -1) | 217 | (read (current-buffer))) |
| 227 | (point)) | 218 | (set-syntax-table stab)))) |
| 228 | (set-syntax-table stab))) | 219 | (if arg (current-buffer) t))) |
| 229 | (point) | ||
| 230 | (if arg (current-buffer) t))) | ||
| 231 | 220 | ||
| 232 | (defun eval-defun (arg) | 221 | (defun eval-defun (arg) |
| 233 | "Evaluate defun that point is in or before. Print value in minibuffer. | 222 | "Evaluate defun that point is in or before. |
| 234 | With argument, edebug-defun it instead, preparing it for source-level | 223 | Print value in minibuffer. |
| 235 | debugging with the electric debugger." | 224 | With argument, insert value in current buffer after the defun." |
| 236 | (interactive "P") | 225 | (interactive "P") |
| 237 | (if arg (edebug-defun) | 226 | (prin1 (eval (save-excursion |
| 238 | (save-excursion | 227 | (end-of-defun) |
| 239 | (end-of-defun) | 228 | (beginning-of-defun) |
| 240 | (let ((end (point))) | 229 | (read (current-buffer)))) |
| 241 | (beginning-of-defun) | 230 | (if arg (current-buffer) t))) |
| 242 | (eval-region (point) end t))))) | ||
| 243 | 231 | ||
| 244 | (defun lisp-comment-indent () | 232 | (defun lisp-comment-indent () |
| 245 | (if (looking-at "\\s<\\s<\\s<") | 233 | (if (looking-at "\\s<\\s<\\s<") |