From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: Not loading the Registry settings Date: Mon, 14 Sep 2009 02:34:29 +0200 Message-ID: References: <4AAB93D4.8070201@harpegolden.net> <87skerr30v.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1252888514 19067 80.91.229.12 (14 Sep 2009 00:35:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Sep 2009 00:35:14 +0000 (UTC) Cc: David De La Harpe Golden , Stefan Monnier , Emacs developers To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 14 02:35:07 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MmzX8-0003re-Hl for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2009 02:35:06 +0200 Original-Received: from localhost ([127.0.0.1]:46215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmzX7-0007ga-NM for ged-emacs-devel@m.gmane.org; Sun, 13 Sep 2009 20:35:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmzWz-0007gD-RE for emacs-devel@gnu.org; Sun, 13 Sep 2009 20:34:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmzWu-0007ew-Cp for emacs-devel@gnu.org; Sun, 13 Sep 2009 20:34:56 -0400 Original-Received: from [199.232.76.173] (port=55008 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmzWu-0007ee-4c for emacs-devel@gnu.org; Sun, 13 Sep 2009 20:34:52 -0400 Original-Received: from mail-bw0-f220.google.com ([209.85.218.220]:64099) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmzWs-00030Z-4l; Sun, 13 Sep 2009 20:34:50 -0400 Original-Received: by bwz20 with SMTP id 20so1875834bwz.42 for ; Sun, 13 Sep 2009 17:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=ci3jc1rO0D9noTXPWI/N0OyhZ639qJVVyb0mqtyqo6I=; b=pdj6vy6w5bvfKOYcMc0zLXmHUU0e9ZKMXp4N1ecLDJfUoO2oaoEgMoOOWvMLozdd7u d+p6hfxdAqVFK+iMoD7x1UShVkJvyuxaXU4H41V5yvVug/WRPYHLWnqVgEvTOdfXGxr2 c9xWMZeVAoxiyAQiwTPPSYTgWX3lWiFiOWGLM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=dpyaFifYk9zUtp90oc+F+C4Fh1PrW1k2JCF4ARBUVgU4WO05nOXIfyqV5eaRSwAOGm 0vAPeT0EyquQlVV86SnKvNx+Rhowld/9KGaJOIyVXpao3ZSXI4Tu8kSLD+ZAxc1FnD5W sDNm7+bU1fpCOeVEPe3qRuK5GRALn1PN/Le2M= Original-Received: by 10.239.187.212 with SMTP id m20mr218194hbh.209.1252888489102; Sun, 13 Sep 2009 17:34:49 -0700 (PDT) In-Reply-To: <87skerr30v.fsf@catnip.gol.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115289 Archived-At: 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;