Mercurial > emacs
changeset 17353:71db8e3ee12f
(eval-defun): For defcustom, always set the value.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 10 Apr 1997 05:58:24 +0000 |
parents | 058970c0f57f |
children | 7c7aaf0aeedb |
files | lisp/emacs-lisp/lisp-mode.el |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/emacs-lisp/lisp-mode.el Thu Apr 10 00:37:52 1997 +0000 +++ b/lisp/emacs-lisp/lisp-mode.el Thu Apr 10 05:58:24 1997 +0000 @@ -329,9 +329,14 @@ (end-of-defun) (beginning-of-defun) (read (current-buffer))))) - (if (and (eq (car form) 'defvar) - (cdr-safe (cdr-safe form))) - (setq form (cons 'defconst (cdr form)))) + (cond ((and (eq (car form) 'defvar) + (cdr-safe (cdr-safe form))) + ;; Force variable to be bound. + (setq form (cons 'defconst (cdr form)))) + ((and (eq (car form) 'defcustom) + (default-boundp (nth 1 form))) + ;; Force variable to be bound. + (set-default (nth 1 form) (eval (nth 2 form))))) (prin1 (eval form)))) (defun lisp-comment-indent ()