Mercurial > emacs
changeset 10968:bea3ee51b843
(eval-defun): Convert defvar to defconst.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 11 Mar 1995 22:42:29 +0000 |
parents | b53b84b6f46d |
children | c66a0a2a7bb3 |
files | lisp/emacs-lisp/lisp-mode.el |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el Sat Mar 11 22:36:29 1995 +0000 +++ b/lisp/emacs-lisp/lisp-mode.el Sat Mar 11 22:42:29 1995 +0000 @@ -244,11 +244,14 @@ 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<")