summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-03-11 22:42:29 +0000
committerRichard M. Stallman <rms@gnu.org>1995-03-11 22:42:29 +0000
commite31897edd8d83da385acec5fc6d971d1395c11f9 (patch)
treea1a0b089442740598ddbbd3d2eab76b5894b2421
parent3cb719bd3bb90d9b1c15517919d463d24bf174ce (diff)
downloademacs-e31897edd8d83da385acec5fc6d971d1395c11f9.tar.gz
(eval-defun): Convert defvar to defconst.
-rw-r--r--lisp/emacs-lisp/lisp-mode.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 7d9fbf108dd..99b1d49f32f 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -244,11 +244,14 @@ With argument, print output into current buffer."
Print value in minibuffer.
With argument, insert value in current buffer after the defun."
(interactive "P")
- (let ((standard-output (if eval-defun-arg-internal (current-buffer) t)))
- (prin1 (eval (save-excursion
- (end-of-defun)
- (beginning-of-defun)
- (read (current-buffer)))))))
+ (let ((standard-output (if eval-defun-arg-internal (current-buffer) t))
+ (form (save-excursion
+ (end-of-defun)
+ (beginning-of-defun)
+ (read (current-buffer)))))
+ (if (eq (car form) 'defvar)
+ (setq form (cons 'defconst (cdr form))))
+ (prin1 (eval form))))
(defun lisp-comment-indent ()
(if (looking-at "\\s<\\s<\\s<")