From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Not loading the Registry settings Date: Mon, 14 Sep 2009 21:31:24 -0400 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=us-ascii X-Trace: ger.gmane.org 1252978320 16530 80.91.229.12 (15 Sep 2009 01:32:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Sep 2009 01:32:00 +0000 (UTC) Cc: David De La Harpe Golden , Emacs developers , Miles Bader To: Juanma Barranquero Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 15 03:31:52 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 1MnMtb-0003mw-Pe for ged-emacs-devel@m.gmane.org; Tue, 15 Sep 2009 03:31:52 +0200 Original-Received: from localhost ([127.0.0.1]:41167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnMta-0002vS-Pw for ged-emacs-devel@m.gmane.org; Mon, 14 Sep 2009 21:31:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MnMtV-0002ts-BE for emacs-devel@gnu.org; Mon, 14 Sep 2009 21:31:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MnMtQ-0002tZ-QM for emacs-devel@gnu.org; Mon, 14 Sep 2009 21:31:44 -0400 Original-Received: from [199.232.76.173] (port=53834 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MnMtQ-0002tW-La for emacs-devel@gnu.org; Mon, 14 Sep 2009 21:31:40 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:62968 helo=ironport2-out.pppoe.ca) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MnMtO-0001bS-Je; Mon, 14 Sep 2009 21:31:38 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAOaLrkpFpZBe/2dsb2JhbACBU9pfhBcFgVaGHg X-IronPort-AV: E=Sophos;i="4.44,386,1249272000"; d="scan'208";a="45689900" Original-Received: from 69-165-144-94.dsl.teksavvy.com (HELO pastel.home) ([69.165.144.94]) by ironport2-out.pppoe.ca with ESMTP; 14 Sep 2009 21:29:44 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AA7218ECB; Mon, 14 Sep 2009 21:31:24 -0400 (EDT) In-Reply-To: (Juanma Barranquero's message of "Tue, 15 Sep 2009 00:24:06 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:115327 Archived-At: >> but I'd first like to understand which initializations take place too >> early to be affected by Lisp code. > Attached is a backtrace of the first call to > w32reg.c:x_get_string_resource on an emacs -Q run. Thanks. The patch below should address this issue (it just moves code around). > As for the Lisp variable, `inhibit-x-resources' suggests that it can > be toggled by the user or lisp code. Is that the intended effect? 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. Stefan === modified file 'lisp/startup.el' --- lisp/startup.el 2009-09-13 04:07:30 +0000 +++ lisp/startup.el 2009-09-15 01:28:52 +0000 @@ -727,44 +727,6 @@ (setq eol-mnemonic-dos "(DOS)" eol-mnemonic-mac "(Mac)"))) - ;; Make sure window system's init file was loaded in loadup.el if - ;; using a window system. - (condition-case error - (unless noninteractive - (if (and initial-window-system - (not (featurep - (intern - (concat (symbol-name initial-window-system) "-win"))))) - (error "Unsupported window system `%s'" initial-window-system)) - ;; Process window-system specific command line parameters. - (setq command-line-args - (funcall - (or (cdr (assq initial-window-system handle-args-function-alist)) - (error "Unsupported window system `%s'" initial-window-system)) - command-line-args)) - ;; Initialize the window system. (Open connection, etc.) - (funcall - (or (cdr (assq initial-window-system window-system-initialization-alist)) - (error "Unsupported window system `%s'" initial-window-system)))) - ;; If there was an error, print the error message and exit. - (error - (princ - (if (eq (car error) 'error) - (apply 'concat (cdr error)) - (if (memq 'file-error (get (car error) 'error-conditions)) - (format "%s: %s" - (nth 1 error) - (mapconcat (lambda (obj) (prin1-to-string obj t)) - (cdr (cdr error)) ", ")) - (format "%s: %s" - (get (car error) 'error-message) - (mapconcat (lambda (obj) (prin1-to-string obj t)) - (cdr error) ", ")))) - 'external-debugging-output) - (terpri 'external-debugging-output) - (setq initial-window-system nil) - (kill-emacs))) - (set-locale-environment nil) ;; Convert preloaded file names in load-history to absolute. @@ -869,6 +831,44 @@ (and command-line-args (setcdr command-line-args args))) + ;; Make sure window system's init file was loaded in loadup.el if + ;; using a window system. + (condition-case error + (unless noninteractive + (if (and initial-window-system + (not (featurep + (intern + (concat (symbol-name initial-window-system) "-win"))))) + (error "Unsupported window system `%s'" initial-window-system)) + ;; Process window-system specific command line parameters. + (setq command-line-args + (funcall + (or (cdr (assq initial-window-system handle-args-function-alist)) + (error "Unsupported window system `%s'" initial-window-system)) + command-line-args)) + ;; Initialize the window system. (Open connection, etc.) + (funcall + (or (cdr (assq initial-window-system window-system-initialization-alist)) + (error "Unsupported window system `%s'" initial-window-system)))) + ;; If there was an error, print the error message and exit. + (error + (princ + (if (eq (car error) 'error) + (apply 'concat (cdr error)) + (if (memq 'file-error (get (car error) 'error-conditions)) + (format "%s: %s" + (nth 1 error) + (mapconcat (lambda (obj) (prin1-to-string obj t)) + (cdr (cdr error)) ", ")) + (format "%s: %s" + (get (car error) 'error-message) + (mapconcat (lambda (obj) (prin1-to-string obj t)) + (cdr error) ", ")))) + 'external-debugging-output) + (terpri 'external-debugging-output) + (setq initial-window-system nil) + (kill-emacs))) + (run-hooks 'before-init-hook) (if (daemonp)