changeset 85180:8cef7e8125fd

(custom-variable-menu, custom-face-menu) (custom-group-menu): Check init-file-user rather than user-init-file, in case cus-edit is loaded by site-run-file.
author Glenn Morris <rgm@gnu.org>
date Fri, 12 Oct 2007 02:54:13 +0000
parents 8a350c3c191b
children 8bcf0b83a5fe
files lisp/cus-edit.el
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/cus-edit.el	Fri Oct 12 02:50:38 2007 +0000
+++ b/lisp/cus-edit.el	Fri Oct 12 02:54:13 2007 +0000
@@ -2682,7 +2682,12 @@
   `(("Set for Current Session" custom-variable-set
      (lambda (widget)
        (eq (widget-get widget :custom-state) 'modified)))
-    ,@(when (or custom-file user-init-file)
+    ;; Note that in all the backquoted code in this file, we test
+    ;; init-file-user rather than user-init-file.  This is in case
+    ;; cus-edit is loaded by something in site-start.el, because
+    ;; user-init-file is not set at that stage.
+    ;; http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00310.html
+    ,@(when (or custom-file init-file-user)
 	'(("Save for Future Sessions" custom-variable-save
 	   (lambda (widget)
 	     (memq (widget-get widget :custom-state)
@@ -2697,7 +2702,7 @@
 		(get (widget-value widget) 'saved-variable-comment))
 	    (memq (widget-get widget :custom-state)
 		  '(modified set changed rogue)))))
-    ,@(when (or custom-file user-init-file)
+    ,@(when (or custom-file init-file-user)
 	'(("Erase Customization" custom-variable-reset-standard
 	   (lambda (widget)
 	     (and (get (widget-value widget) 'standard-value)
@@ -3371,7 +3376,7 @@
 
 (defvar custom-face-menu
   `(("Set for Current Session" custom-face-set)
-    ,@(when (or custom-file user-init-file)
+    ,@(when (or custom-file init-file-user)
 	'(("Save for Future Sessions" custom-face-save)))
     ("Undo Edits" custom-redraw
      (lambda (widget)
@@ -3380,7 +3385,7 @@
      (lambda (widget)
        (or (get (widget-value widget) 'saved-face)
 	   (get (widget-value widget) 'saved-face-comment))))
-    ,@(when (or custom-file user-init-file)
+    ,@(when (or custom-file init-file-user)
 	'(("Erase Customization" custom-face-reset-standard
 	   (lambda (widget)
 	     (get (widget-value widget) 'face-defface-spec)))))
@@ -3978,7 +3983,7 @@
   `(("Set for Current Session" custom-group-set
      (lambda (widget)
        (eq (widget-get widget :custom-state) 'modified)))
-    ,@(when (or custom-file user-init-file)
+    ,@(when (or custom-file init-file-user)
 	'(("Save for Future Sessions" custom-group-save
 	   (lambda (widget)
 	     (memq (widget-get widget :custom-state) '(modified set))))))
@@ -3988,7 +3993,7 @@
     ("Reset to Saved" custom-group-reset-saved
      (lambda (widget)
        (memq (widget-get widget :custom-state) '(modified set))))
-    ,@(when (or custom-file user-init-file)
+    ,@(when (or custom-file init-file-user)
 	'(("Erase Customization" custom-group-reset-standard
 	   (lambda (widget)
 	     (memq (widget-get widget :custom-state) '(modified set saved)))))))