all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: David De La Harpe Golden <david@harpegolden.net>,
	Emacs developers <emacs-devel@gnu.org>,
	Miles Bader <miles@gnu.org>
Subject: Re: Not loading the Registry settings
Date: Mon, 14 Sep 2009 21:31:24 -0400	[thread overview]
Message-ID: <jwvd45t572r.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <f7ccd24b0909141524k43000002t6f978989320f7fcd@mail.gmail.com> (Juanma Barranquero's message of "Tue, 15 Sep 2009 00:24:06 +0200")

>> 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)





  reply	other threads:[~2009-09-15  1:31 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
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 [this message]
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=jwvd45t572r.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=david@harpegolden.net \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=miles@gnu.org \
    /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.