Index: emacs.c
===================================================================
RCS file: /sources/emacs/emacs/src/emacs.c,v
retrieving revision 1.442
diff -c -r1.442 emacs.c
*** emacs.c	5 Aug 2008 17:33:05 -0000	1.442
--- emacs.c	21 Aug 2008 16:01:58 -0000
***************
*** 199,204 ****
--- 199,208 ----
  int display_arg;
  #endif
  
+ #ifdef HAVE_NS
+ extern char ns_no_defaults;
+ #endif
+ 
  /* An address near the bottom of the stack.
     Tells GC how to save a copy of the stack.  */
  char *stack_bottom;
***************
*** 1329,1334 ****
--- 1333,1341 ----
      {
        char *tmp;
        display_arg = 4;
+       ns_no_defaults
+         = argmatch (argv, argc, "-q", "--no-init-file", 6, NULL, &skip_args)
+         || argmatch (argv, argc, "-Q", "--quick", 5, NULL, &skip_args);
  #ifdef NS_IMPL_COCOA
        if (skip_args < argc)
          {
Index: nsfns.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsfns.m,v
retrieving revision 1.22
diff -c -r1.22 nsfns.m
*** nsfns.m	21 Aug 2008 02:48:59 -0000	1.22
--- nsfns.m	21 Aug 2008 16:02:03 -0000
***************
*** 2134,2140 ****
  {
    /* remove appname prefix; TODO: allow for !="Emacs" */
    char *toCheck = class + (!strncmp (class, "Emacs.", 6) ? 6 : 0);
!   const char *res;
    check_ns ();
  
    /* Support emacs-20-style face resources for backwards compatibility */
--- 2134,2140 ----
  {
    /* remove appname prefix; TODO: allow for !="Emacs" */
    char *toCheck = class + (!strncmp (class, "Emacs.", 6) ? 6 : 0);
!   const char *res = NULL;
    check_ns ();
  
    /* Support emacs-20-style face resources for backwards compatibility */
***************
*** 2143,2150 ****
  
  /*fprintf (stderr, "Checking '%s'\n", toCheck); */
    
!   res = [[[NSUserDefaults standardUserDefaults] objectForKey:
!                    [NSString stringWithUTF8String: toCheck]] UTF8String];
    return !res ? NULL :
        (!strncasecmp (res, "YES", 3) ? "true" :
            (!strncasecmp (res, "NO", 2) ? "false" : res));
--- 2143,2153 ----
  
  /*fprintf (stderr, "Checking '%s'\n", toCheck); */
    
!   if (!ns_no_defaults)
!     {
!       res = [[[NSUserDefaults standardUserDefaults] objectForKey:
!                      [NSString stringWithUTF8String: toCheck]] UTF8String];
!     }
    return !res ? NULL :
        (!strncasecmp (res, "YES", 3) ? "true" :
            (!strncasecmp (res, "NO", 2) ? "false" : res));
Index: nsterm.h
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.h,v
retrieving revision 1.14
diff -c -r1.14 nsterm.h
*** nsterm.h	21 Aug 2008 02:49:00 -0000	1.14
--- nsterm.h	21 Aug 2008 16:02:06 -0000
***************
*** 752,757 ****
--- 752,758 ----
  extern int ns_lisp_to_cursor_type ();
  extern Lisp_Object ns_cursor_type_to_lisp (int arg);
  extern Lisp_Object Qnone;
+ extern char ns_no_defaults;
  
  /* XColor defined in dispextern.h (we use color_def->pixel = NSColor id), but
     this causes an #include snafu, so we can't declare it.  */
Index: nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.25
diff -c -r1.25 nsterm.m
*** nsterm.m	21 Aug 2008 02:49:00 -0000	1.25
--- nsterm.m	21 Aug 2008 16:02:19 -0000
***************
*** 152,157 ****
--- 152,160 ----
     the NS interface specifically.  Although a customization group could be
     created, it's more natural to manage them via defaults. */
  
+ /* If set in emacs.c, don't read any defaults on startup. */
+ char ns_no_defaults;
+ 
  /* Specifies which emacs modifier should be generated when NS receives
     the Alternate modifer.  May be Qnone or any of the modifier lisp symbols. */
  Lisp_Object ns_alternate_modifier;
***************
*** 3837,3870 ****
  
    /* Read various user defaults. */
    ns_set_default_prefs ();
!   ns_default ("AlternateModifier", &ns_alternate_modifier,
!              Qnil, Qnil, NO, YES);
!   if (NILP (ns_alternate_modifier))
!     ns_alternate_modifier = Qmeta;
!   ns_default ("CommandModifier", &ns_command_modifier,
!              Qnil, Qnil, NO, YES);
!   if (NILP (ns_command_modifier))
!     ns_command_modifier = Qsuper;
!   ns_default ("ControlModifier", &ns_control_modifier,
!              Qnil, Qnil, NO, YES);
!   if (NILP (ns_control_modifier))
!     ns_control_modifier = Qcontrol;
!   ns_default ("FunctionModifier", &ns_function_modifier,
!              Qnil, Qnil, NO, YES);
!   if (NILP (ns_function_modifier))
!     ns_function_modifier = Qnone;
!   ns_default ("ExpandSpace", &ns_expand_space,
!              make_float (0.5), make_float (0.0), YES, NO);
!   ns_default ("GSFontAntiAlias", &ns_antialias_text,
!              Qt, Qnil, NO, NO);
!   tmp = Qnil;
!   ns_default ("AppleAntiAliasingThreshold", &tmp,
!              make_float (10.0), make_float (6.0), YES, NO);
!   ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp);
!   ns_default ("UseQuickdrawSmoothing", &ns_use_qd_smoothing,
!              Qt, Qnil, NO, NO);
!   ns_default ("UseSystemHighlightColor", &ns_use_system_highlight_color,
!              Qt, Qnil, NO, NO);
    if (EQ (ns_use_system_highlight_color, Qt))
      {
        ns_selection_color = [[NSUserDefaults standardUserDefaults]
--- 3840,3879 ----
  
    /* Read various user defaults. */
    ns_set_default_prefs ();
! 
!   if (!ns_no_defaults)
!     {
!       ns_default ("AlternateModifier", &ns_alternate_modifier,
!                  Qnil, Qnil, NO, YES);
!       ns_default ("CommandModifier", &ns_command_modifier,
!                  Qnil, Qnil, NO, YES);
!       ns_default ("ControlModifier", &ns_control_modifier,
!                  Qnil, Qnil, NO, YES);
!       ns_default ("FunctionModifier", &ns_function_modifier,
!                  Qnil, Qnil, NO, YES);
!       ns_default ("ExpandSpace", &ns_expand_space,
!                  make_float (0.5), make_float (0.0), YES, NO);
!       ns_default ("GSFontAntiAlias", &ns_antialias_text,
!                  Qt, Qnil, NO, NO);
!       tmp = Qnil;
!       ns_default ("AppleAntiAliasingThreshold", &tmp,
!                  make_float (10.0), make_float (6.0), YES, NO);
!       ns_antialias_threshold = NILP (tmp) ? 10.0 : XFLOATINT (tmp);
!       ns_default ("UseQuickdrawSmoothing", &ns_use_qd_smoothing,
!                  Qt, Qnil, NO, NO);
!       ns_default ("UseSystemHighlightColor", &ns_use_system_highlight_color,
!                  Qt, Qnil, NO, NO);
! 
!       if (NILP (ns_alternate_modifier))
!         ns_alternate_modifier = Qmeta;
!       if (NILP (ns_command_modifier))
!         ns_command_modifier = Qsuper;
!       if (NILP (ns_control_modifier))
!         ns_control_modifier = Qcontrol;
!       if (NILP (ns_function_modifier))
!         ns_function_modifier = Qnone;
!     }
! 
    if (EQ (ns_use_system_highlight_color, Qt))
      {
        ns_selection_color = [[NSUserDefaults standardUserDefaults]
