From: Juanma Barranquero <lekktu@gmail.com>
To: Miles Bader <miles@gnu.org>
Cc: David De La Harpe Golden <david@harpegolden.net>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: Not loading the Registry settings
Date: Mon, 14 Sep 2009 02:34:29 +0200 [thread overview]
Message-ID: <f7ccd24b0909131734o32b87e9bh3ffc235e4933e6d7@mail.gmail.com> (raw)
In-Reply-To: <87skerr30v.fsf@catnip.gol.com>
This a sample patch, not nearly ready (no docs, for example), just to
check whether I'm going in the right direction. It is the simplest
patch that works on Windows.
Comments:
- It piggybacks on -Q, as Stefan suggested. Personally I think (but
not very strongly) that a new option would be clearer.
- It basically turns w32reg:x_get_string_resource() into a no-op.
Would the same approach for xrdb:x_get_string_resource() work? In
particular, in the ~/.Xdefaults case mentioned by Miles?
- As defined, it is an irreversible operation. Once -Q is used,
x_get_string_resource is a no-op for the duration of the Emacs
instance. I've assumed that is the intended effect.
Thoughts?
Juanma
diff --git a/src/emacs.c b/src/emacs.c
index 2c14be5..2f25248 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -239,6 +239,9 @@ int noninteractive;
int noninteractive1;
+/* Nonzero means Emacs was started with --quick. */
+int emacs_quick_startup;
+
/* Name for the server started by the daemon.*/
static char *daemon_name;
@@ -1472,6 +1475,16 @@ main (int argc, char **argv)
no_loadup
= argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
+ /* Check the -quick switch, which means don't load init or site files, nor X
+ settings or Windows registry, and no splash; but pass it back
for startup.el. */
+ if (argmatch (argv, argc, "-Q", "--quick", 5, NULL, &skip_args))
+ {
+ emacs_quick_startup = 1;
+ skip_args--;
+ }
+ else
+ emacs_quick_startup = 0;
+
#ifdef HAVE_NS
ns_alloc_autorelease_pool();
if (!noninteractive)
diff --git a/src/lisp.h b/src/lisp.h
index 820c258..38e4854 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3128,6 +3128,7 @@ extern Lisp_Object Vinvocation_name,
Vinvocation_directory;
extern Lisp_Object Vbefore_init_time, Vafter_init_time;
extern Lisp_Object Vinstallation_directory;
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
+extern int emacs_quick_startup;
EXFUN (Fkill_emacs, 1);
#if HAVE_SETLOCALE
void fixup_locale P_ ((void));
diff --git a/src/w32reg.c b/src/w32reg.c
index d2330e7..89294f8 100644
--- a/src/w32reg.c
+++ b/src/w32reg.c
@@ -150,6 +150,9 @@ x_get_string_resource (rdb, name, class)
XrmDatabase rdb;
char *name, *class;
{
+ /* --quick was passed, so this is a no-op. */
+ if (emacs_quick_startup) return NULL;
+
if (rdb)
{
char *resource;
next prev parent reply other threads:[~2009-09-14 0:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-12 11:45 Not loading the Registry settings Juanma Barranquero
2009-09-12 12:28 ` David De La Harpe Golden
2009-09-12 12:50 ` Adrian Robert
2009-09-12 14:22 ` Juanma Barranquero
2009-09-12 19:14 ` Stefan Monnier
2009-09-13 2:29 ` Miles Bader
2009-09-14 0:34 ` Juanma Barranquero [this message]
2009-09-14 13:29 ` Stefan Monnier
2009-09-14 13:48 ` Juanma Barranquero
2009-09-14 13:54 ` Juanma Barranquero
2009-09-14 21:53 ` Stefan Monnier
2009-09-14 22:24 ` Juanma Barranquero
2009-09-15 1:31 ` Stefan Monnier
2009-09-15 9:26 ` Juanma Barranquero
2009-09-15 13:34 ` Stefan Monnier
2009-09-15 14:27 ` Juanma Barranquero
2009-09-14 14:51 ` Adrian Robert
[not found] ` <jwv63bl5onb.fsf-monnier+emacs@gnu.org>
2009-09-14 19:39 ` Adrian Robert
2009-09-17 23:09 ` Juanma Barranquero
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7ccd24b0909131734o32b87e9bh3ffc235e4933e6d7@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=david@harpegolden.net \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.