# HG changeset patch # User Juanma Barranquero # Date 1253228681 0 # Node ID 4cbb223d0b1c11e211f81cfcc5e09380ce2540bf # Parent b97679d5a9af552fae8c5430120a493173aa1479 The --quick command line option now ignores X resources and Registry settings. * etc/NEWS: Mention new behavior of -Q and new variable `inhibit-x-resources'. * lisp/startup.el (emacs-quick-startup): Remove variable and all uses. (command-line): Set `inhibit-x-resources' instead. (command-line-1): Use `inhibit-x-resources' instead. * src/emacs.c (inhibit_x_resources): New variable. (main) [HAVE_NS]: Don't process --quick command line option. (syms_of_emacs) : DEFVAR_BOOL it. * src/lisp.h (inhibit_x_resources): Declare it extern. * src/w32reg.c (x_get_string_resource): * src/xrdb.c (x_get_string_resource): Obey inhibit_x_resources. diff -r b97679d5a9af -r 4cbb223d0b1c etc/ChangeLog --- a/etc/ChangeLog Thu Sep 17 20:47:48 2009 +0000 +++ b/etc/ChangeLog Thu Sep 17 23:04:41 2009 +0000 @@ -1,3 +1,8 @@ +2009-09-15 Juanma Barranquero + + * NEWS: Mention new behavior of -Q and new variable + `inhibit-x-resources'. + 2009-09-13 Chong Yidong * PROBLEMS: Document Athena/Lucid internationalization diff -r b97679d5a9af -r 4cbb223d0b1c etc/NEWS --- a/etc/NEWS Thu Sep 17 20:47:48 2009 +0000 +++ b/etc/NEWS Thu Sep 17 23:04:41 2009 +0000 @@ -38,6 +38,11 @@ * Changes in Emacs 23.2 +** Command-line option -Q (--quick) now also disables loading X resources. +On Windows, Registry settings are ignored, though environment variables set +on the Registry are still honored. The new variable `inhibit-x-resources' +shows whether X resources were loaded or not. + ** New completion-style `initials' to complete M-x lch to list-command-history. ** Unibyte sessions are declared obsolete. diff -r b97679d5a9af -r 4cbb223d0b1c lisp/ChangeLog --- a/lisp/ChangeLog Thu Sep 17 20:47:48 2009 +0000 +++ b/lisp/ChangeLog Thu Sep 17 23:04:41 2009 +0000 @@ -1,3 +1,9 @@ +2009-09-17 Juanma Barranquero + + * startup.el (emacs-quick-startup): Remove variable and all uses. + (command-line): Set `inhibit-x-resources' instead. + (command-line-1): Use `inhibit-x-resources' instead. + 2009-09-17 Chong Yidong * subr.el: Fix last change to avoid using the `unless' macro, diff -r b97679d5a9af -r 4cbb223d0b1c lisp/startup.el --- a/lisp/startup.el Thu Sep 17 20:47:48 2009 +0000 +++ b/lisp/startup.el Thu Sep 17 23:04:41 2009 +0000 @@ -366,8 +366,6 @@ string) :group 'auto-save) -(defvar emacs-quick-startup nil) - (defvar emacs-basic-display nil) (defvar init-file-debug nil) @@ -799,7 +797,7 @@ ((member argi '("-Q" "-quick")) (setq init-file-user nil site-run-file nil - emacs-quick-startup t)) + inhibit-x-resources t)) ((member argi '("-D" "-basic-display")) (setq no-blinking-cursor t emacs-basic-display t) @@ -2274,7 +2272,7 @@ (if (or inhibit-startup-screen initial-buffer-choice noninteractive - emacs-quick-startup) + inhibit-x-resources) ;; Not displaying a startup screen. If 3 or more files ;; visited, and not all visible, show user what they all are. diff -r b97679d5a9af -r 4cbb223d0b1c src/ChangeLog --- a/src/ChangeLog Thu Sep 17 20:47:48 2009 +0000 +++ b/src/ChangeLog Thu Sep 17 23:04:41 2009 +0000 @@ -1,3 +1,14 @@ +2009-09-17 Juanma Barranquero + + * emacs.c (inhibit_x_resources): New variable. + (main) [HAVE_NS]: Don't process --quick command line option. + (syms_of_emacs) : DEFVAR_BOOL it. + + * lisp.h (inhibit_x_resources): Declare it extern. + + * w32reg.c (x_get_string_resource): + * xrdb.c (x_get_string_resource): Obey inhibit_x_resources. + 2009-09-17 Eli Zaretskii * Makefile.in (MSDOS_SUPPORT, SOME_MACHINE_LISP): Add diff -r b97679d5a9af -r 4cbb223d0b1c src/emacs.c --- a/src/emacs.c Thu Sep 17 20:47:48 2009 +0000 +++ b/src/emacs.c Thu Sep 17 23:04:41 2009 +0000 @@ -239,6 +239,9 @@ int noninteractive1; +/* Nonzero means Emacs was run in --quick mode. */ +int inhibit_x_resources; + /* Name for the server started by the daemon.*/ static char *daemon_name; @@ -1483,11 +1486,6 @@ ns_no_defaults = 1; skip_args--; } - if (argmatch (argv, argc, "-Q", "--quick", 5, NULL, &skip_args)) - { - ns_no_defaults = 1; - skip_args--; - } #ifdef NS_IMPL_COCOA if (skip_args < argc) { @@ -2680,6 +2678,10 @@ This is nil during initialization. */); Vafter_init_time = Qnil; + DEFVAR_BOOL ("inhibit-x-resources", &inhibit_x_resources, + doc: /* If non-nil, X resources and Windows Registry settings are not used. */); + inhibit_x_resources = 0; + /* Make sure IS_DAEMON starts up as false. */ daemon_pipe[1] = 0; } diff -r b97679d5a9af -r 4cbb223d0b1c src/lisp.h --- a/src/lisp.h Thu Sep 17 20:47:48 2009 +0000 +++ b/src/lisp.h Thu Sep 17 23:04:41 2009 +0000 @@ -3143,6 +3143,9 @@ /* Nonzero means don't do interactive redisplay and don't change tty modes */ extern int noninteractive; +/* Nonzero means don't load X resources or Windows Registry settings. */ +extern int inhibit_x_resources; + /* Pipe used to send exit notification to the daemon parent at startup. */ extern int daemon_pipe[2]; diff -r b97679d5a9af -r 4cbb223d0b1c src/w32reg.c --- a/src/w32reg.c Thu Sep 17 20:47:48 2009 +0000 +++ b/src/w32reg.c Thu Sep 17 23:04:41 2009 +0000 @@ -76,7 +76,7 @@ return NULL; } -LPBYTE +static LPBYTE w32_get_string_resource (name, class, dwexptype) char *name, *class; DWORD dwexptype; @@ -160,6 +160,10 @@ return resource; } + if (inhibit_x_resources) + /* --quick was passed, so this is a no-op. */ + return NULL; + return (w32_get_string_resource (name, class, REG_SZ)); } diff -r b97679d5a9af -r 4cbb223d0b1c src/xrdb.c --- a/src/xrdb.c Thu Sep 17 20:47:48 2009 +0000 +++ b/src/xrdb.c Thu Sep 17 23:04:41 2009 +0000 @@ -693,6 +693,10 @@ { XrmValue value; + if (inhibit_x_resources) + /* --quick was passed, so this is a no-op. */ + return NULL; + if (x_get_resource (rdb, name, class, x_rm_string, &value)) return (char *) value.addr;