]> git.eshelyaron.com Git - emacs.git/commitdiff
(eval-defun): Convert defvar to defconst.
authorRichard M. Stallman <rms@gnu.org>
Sat, 11 Mar 1995 22:42:29 +0000 (22:42 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 11 Mar 1995 22:42:29 +0000 (22:42 +0000)
lisp/emacs-lisp/lisp-mode.el

index 7d9fbf108ddc0be08dfbdc4c5ee6ece0d5df0202..99b1d49f32f8f1268c13b5f7a800d4dfc304c6a6 100644 (file)
@@ -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))))
 \f
 (defun lisp-comment-indent ()
   (if (looking-at "\\s<\\s<\\s<")