aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-05-07 14:02:56 +0000
committerGerd Moellmann2001-05-07 14:02:56 +0000
commit6a239292f7b24a82ecbc0969cc3d00d16a566c1d (patch)
treee6df64c6c85ba9ca42bcaac09748d1d60b22daf3
parent18f534df4dbd66cc5f076c1226d9951058487d77 (diff)
downloademacs-6a239292f7b24a82ecbc0969cc3d00d16a566c1d.tar.gz
emacs-6a239292f7b24a82ecbc0969cc3d00d16a566c1d.zip
(custom-file): Signal an error if user-init-file is
nil (running -q).
-rw-r--r--lisp/cus-edit.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 6f0ca3a591b..ae4f995df07 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -1993,7 +1993,9 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
1993;; the global custom one 1993;; the global custom one
1994(defun custom-comment-show (widget) 1994(defun custom-comment-show (widget)
1995 (widget-put widget :comment-shown t) 1995 (widget-put widget :comment-shown t)
1996 (trace-to-stderr (format "1: %s\n" (widget-value widget)))
1996 (custom-redraw widget) 1997 (custom-redraw widget)
1998 (trace-to-stderr (format "2: %s\n" (widget-value widget)))
1997 (widget-setup)) 1999 (widget-setup))
1998 2000
1999(defun custom-comment-invisible-p (widget) 2001(defun custom-comment-invisible-p (widget)
@@ -3447,11 +3449,12 @@ to the new custom file. This will preserve your existing customizations."
3447 3449
3448(defun custom-file () 3450(defun custom-file ()
3449 "Return the file name for saving customizations." 3451 "Return the file name for saving customizations."
3450 (setq custom-file 3452 (if (null user-init-file)
3451 (or custom-file 3453 ;; Started with -q, i.e. the file containing Custom settings
3452 user-init-file 3454 ;; hasn't been read. Saving settings there would overwrite
3453 (read-file-name "File for customizations: " 3455 ;; other settings.
3454 "~/" nil nil ".emacs")))) 3456 (error "Saving settings when running -q would overwrite existing settings")
3457 (setq custom-file (or custom-file user-init-file))))
3455 3458
3456(defun custom-save-delete (symbol) 3459(defun custom-save-delete (symbol)
3457 "Visit `custom-file' and delete all calls to SYMBOL from it. 3460 "Visit `custom-file' and delete all calls to SYMBOL from it.