changeset 37604:bd93cba9ef3e

(custom-file): Signal an error if user-init-file is nil (running -q).
author Gerd Moellmann <gerd@gnu.org>
date Mon, 07 May 2001 14:02:56 +0000
parents df85a76987bb
children 362fea0e7c8b
files lisp/cus-edit.el
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Mon May 07 13:43:10 2001 +0000
+++ b/lisp/cus-edit.el	Mon May 07 14:02:56 2001 +0000
@@ -1993,7 +1993,9 @@
 ;; the global custom one
 (defun custom-comment-show (widget)
   (widget-put widget :comment-shown t)
+  (trace-to-stderr (format "1: %s\n" (widget-value widget)))
   (custom-redraw widget)
+  (trace-to-stderr (format "2: %s\n" (widget-value widget)))
   (widget-setup))
 
 (defun custom-comment-invisible-p (widget)
@@ -3447,11 +3449,12 @@
 
 (defun custom-file ()
   "Return the file name for saving customizations."
-  (setq custom-file
-	(or custom-file
-	    user-init-file
-	    (read-file-name "File for customizations: "
-			    "~/" nil nil ".emacs"))))
+  (if (null user-init-file)
+      ;; Started with -q, i.e. the file containing Custom settings
+      ;; hasn't been read.  Saving settings there would overwrite
+      ;; other settings.
+      (error "Saving settings when running -q would overwrite existing settings")
+    (setq custom-file (or custom-file user-init-file))))
 
 (defun custom-save-delete (symbol)
   "Visit `custom-file' and delete all calls to SYMBOL from it.