From e31897edd8d83da385acec5fc6d971d1395c11f9 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 11 Mar 1995 22:42:29 +0000 Subject: (eval-defun): Convert defvar to defconst. --- lisp/emacs-lisp/lisp-mode.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp/lisp-mode.el') 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<") -- cgit v1.2.3