]> git.eshelyaron.com Git - emacs.git/commitdiff
(eval-defun): For defcustom, always set the value.
authorRichard M. Stallman <rms@gnu.org>
Thu, 10 Apr 1997 05:58:24 +0000 (05:58 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 10 Apr 1997 05:58:24 +0000 (05:58 +0000)
lisp/emacs-lisp/lisp-mode.el

index ebdee0673eebb5b4e5b181ced8df5e902bf62841..be328b30329ab0b7c3e8b1e5c8e6b9001ce45ff7 100644 (file)
@@ -329,9 +329,14 @@ With argument, insert value in current buffer after the defun."
                (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))))
 \f
 (defun lisp-comment-indent ()