changeset 111266:8da6c861bf9f

Fix bug#7299; default value of tool-bar-mode in without-x builds. * src/frame.c (syms_of_frame) <tool-bar-mode>: Default to nil if !HAVE_WINDOW_SYSTEM. * lisp/cus-start.el: Handle standard values via a keyword. Only set version property if specified. (cursor-in-non-selected-windows, menu-bar-mode) (tool-bar-mode, show-trailing-whitespace): Do not specify standard values. (transient-mark-mode, temporary-file-directory): Use :standard.
author Glenn Morris <rgm@gnu.org>
date Sun, 31 Oct 2010 11:26:54 -0700
parents d2e4336159e8
children 7f0afd30f764
files lisp/ChangeLog lisp/cus-start.el src/ChangeLog src/frame.c
diffstat 4 files changed, 32 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Oct 31 11:13:40 2010 -0700
+++ b/lisp/ChangeLog	Sun Oct 31 11:26:54 2010 -0700
@@ -1,3 +1,12 @@
+2010-10-31  Glenn Morris  <rgm@gnu.org>
+
+	* cus-start.el: Handle standard values via a keyword.
+	Only set version property if specified.
+	(cursor-in-non-selected-windows, menu-bar-mode)
+	(tool-bar-mode, show-trailing-whitespace):
+	Do not specify standard values.
+	(transient-mark-mode, temporary-file-directory): Use :standard.
+
 2010-10-31  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* term/x-win.el (x-get-selection-value): New function that gets
--- a/lisp/cus-start.el	Sun Oct 31 11:13:40 2010 -0700
+++ b/lisp/cus-start.el	Sun Oct 31 11:26:54 2010 -0700
@@ -97,12 +97,13 @@
 	     (line-spacing display (choice (const :tag "none" nil) integer)
 			   "22.1")
 	     (cursor-in-non-selected-windows
-	      cursor boolean nil t :tag "Cursor In Non-selected Windows"
+	      cursor boolean nil
+	      :tag "Cursor In Non-selected Windows"
 	      :set #'(lambda (symbol value)
 		       (set-default symbol value)
 		       (force-mode-line-update t)))
 	     (transient-mark-mode editing-basics boolean nil
-				  (not noninteractive)
+				  :standard (not noninteractive)
 				  :initialize custom-initialize-delay
 				  :set custom-set-minor-mode)
 	     ;; callint.c
@@ -179,6 +180,7 @@
 	     (temporary-file-directory
 	      ;; Darwin section added 24.1, does not seem worth :version bump.
 	      files directory nil
+	      :standard
 	      (file-name-as-directory
 	       ;; FIXME ? Should there be Ftemporary_file_directory to do this
 	       ;; more robustly (cf set_local_socket in emacsclient.c).
@@ -218,11 +220,11 @@
 					    (other :tag "hidden by keypress" 1))
 			      "22.1")
 	     (make-pointer-invisible mouse boolean "23.2")
-	     (menu-bar-mode frames boolean nil t
+	     (menu-bar-mode frames boolean nil
 			    ;; FIXME?
 ;			    :initialize custom-initialize-default
 			    :set custom-set-minor-mode)
-	     (tool-bar-mode (frames mouse) boolean nil t
+	     (tool-bar-mode (frames mouse) boolean nil
 ;			    :initialize custom-initialize-default
 			    :set custom-set-minor-mode)
 	     ;; fringe.c
@@ -372,7 +374,7 @@
 				  (other :tag "Always" t))
 				 "23.1")
 	     ;; xdisp.c
-	     (show-trailing-whitespace whitespace-faces boolean nil nil
+	     (show-trailing-whitespace whitespace-faces boolean nil
 				       :safe booleanp)
 	     (scroll-step windows integer)
 	     (scroll-conservatively windows integer)
@@ -448,13 +450,13 @@
 	  group (nth 1 this)
 	  type (nth 2 this)
 	  version (nth 3 this)
+	  rest (nthcdr 4 this)
 	  ;; If we did not specify any standard value expression above,
 	  ;; use the current value as the standard value.
-	  standard (if (nthcdr 4 this)
-		       (nth 4 this)
-		     (when (default-boundp symbol)
-		       (funcall quoter (default-value symbol))))
-	  rest (nthcdr 5 this)
+	  standard (if (setq prop (memq :standard rest))
+		       (cadr prop)
+		     (if (default-boundp symbol)
+			 (funcall quoter (default-value symbol))))
 	  ;; Don't complain about missing variables which are
 	  ;; irrelevant to this platform.
 	  native-p (save-match-data
@@ -508,12 +510,12 @@
 	  (custom-add-to-group group symbol 'custom-variable))
 	;; Set the type.
 	(put symbol 'custom-type type)
-	(put symbol 'custom-version version)
+	(if version (put symbol 'custom-version version))
 	(while rest
 	  (setq prop (car rest)
 		propval (cadr rest)
 		rest (nthcdr 2 rest))
-	  (cond ((memq prop '(:risky :safe :set))) ; handled above
+	  (cond ((memq prop '(:standard :risky :safe :set))) ; handled above
 		((eq prop :tag)
 		 (put symbol 'custom-tag propval))))))))
 
--- a/src/ChangeLog	Sun Oct 31 11:13:40 2010 -0700
+++ b/src/ChangeLog	Sun Oct 31 11:26:54 2010 -0700
@@ -1,3 +1,8 @@
+2010-10-31  Glenn Morris  <rgm@gnu.org>
+
+	* frame.c (syms_of_frame) <tool-bar-mode>:
+	Default to nil if !HAVE_WINDOW_SYSTEM.  (Bug#7299)
+
 2010-10-31  Chong Yidong  <cyd@stupidchicken.com>
 
 	* xterm.c (x_connection_closed): Print informative error message
--- a/src/frame.c	Sun Oct 31 11:13:40 2010 -0700
+++ b/src/frame.c	Sun Oct 31 11:26:54 2010 -0700
@@ -4576,7 +4576,11 @@
 Setting this variable directly does not take effect;
 either customize it (see the info node `Easy Customization')
 or call the function `tool-bar-mode'.  */);
+#ifdef HAVE_WINDOW_SYSTEM
   Vtool_bar_mode = Qt;
+#else
+  Vtool_bar_mode = Qnil;
+#endif
 
   DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
 		 doc: /* Minibufferless frames use this frame's minibuffer.