[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Not loading the Registry settings
From: |
Juanma Barranquero |
Subject: |
Re: Not loading the Registry settings |
Date: |
Tue, 15 Sep 2009 11:26:25 +0200 |
On Tue, Sep 15, 2009 at 03:31, Stefan Monnier <address@hidden> wrote:
> Thanks. The patch below should address this issue (it just moves code
> around).
After your patch, setting the variable in Lisp woks (see code below;
it does not include X changes, only Windows).
The only drawback is that, on Windows, environment variables (HOME,
SHELL, TERM, LANG, PRELOAD_WINSOCK and a few others) can also be
defined in the registry, and they are loaded in
w32.c:init_environment(), so -Q will not affect them. That is bad,
because it negates one of the advantages of this change, i.e., making
emacs -Q more useful for testing.
> Well, I'm not sure if it would be useful, but the name seems to reflect
> more precisely the effect of the variable, and indeed it can later on
> be changed from Lisp, tho it's not clear whether that would be useful.
BTW, the question of whether "emacs -Q -xrm myresouce" should obey
myresource or not is still open.
Juanma
diff --git a/lisp/startup.el b/lisp/startup.el
index 72c185c..3ffc4b8 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -366,8 +366,6 @@ from being initialized."
string)
:group 'auto-save)
-(defvar emacs-quick-startup nil)
-
(defvar emacs-basic-display nil)
(defvar init-file-debug nil)
@@ -799,7 +797,7 @@ opening the first frame (e.g. open a connection to
an X server).")
((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)
@@ -2272,7 +2270,7 @@ A fancy display is used on graphic displays,
normal otherwise."
(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 --git a/src/emacs.c b/src/emacs.c
index 2c14be5..9538e3c 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -239,6 +239,9 @@ int noninteractive;
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 @@ main (int argc, char **argv)
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 @@ was found. */);
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 --git a/src/lisp.h b/src/lisp.h
index 820c258..f837708 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3143,6 +3143,9 @@ void shut_down_emacs P_ ((int, int, Lisp_Object));
/* 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 --git a/src/w32reg.c b/src/w32reg.c
index d2330e7..e31fba0 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -150,6 +150,10 @@ x_get_string_resource (rdb, name, class)
XrmDatabase rdb;
char *name, *class;
{
+ if (inhibit_x_resources)
+ /* --quick was passed, so this is a no-op. */
+ return NULL;
+
if (rdb)
{
char *resource;
- Re: Not loading the Registry settings, (continued)
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/12
- Re: Not loading the Registry settings, Stefan Monnier, 2009/09/12
- Re: Not loading the Registry settings, Miles Bader, 2009/09/12
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/13
- Re: Not loading the Registry settings, Stefan Monnier, 2009/09/14
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/14
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/14
- Re: Not loading the Registry settings, Stefan Monnier, 2009/09/14
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/14
- Re: Not loading the Registry settings, Stefan Monnier, 2009/09/14
- Re: Not loading the Registry settings,
Juanma Barranquero <=
- Re: Not loading the Registry settings, Stefan Monnier, 2009/09/15
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/15
- Message not available
- Re: Not loading the Registry settings, Adrian Robert, 2009/09/14
- Re: Not loading the Registry settings, Juanma Barranquero, 2009/09/17
- Re: Not loading the Registry settings, Adrian Robert, 2009/09/22
Re: Not loading the Registry settings, Adrian Robert, 2009/09/22