emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116890: Simplify treatment of some startup hooks


From: Glenn Morris
Subject: [Emacs-diffs] trunk r116890: Simplify treatment of some startup hooks
Date: Thu, 27 Mar 2014 20:57:27 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116890
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Thu 2014-03-27 16:57:23 -0400
message:
  Simplify treatment of some startup hooks
  
  * lisp/startup.el (inhibit-startup-hooks): Doc tweak.
  (normal-top-level): Simplify running of hooks.
  For window-setup-hook, respect inhibit-startup-hooks.
  (command-line-1): Don't set window-setup-hook to nil.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/startup.el                startup.el-20091113204419-o5vbwnq5f7feedwu-260
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-03-27 19:00:49 +0000
+++ b/lisp/ChangeLog    2014-03-27 20:57:23 +0000
@@ -1,5 +1,10 @@
 2014-03-27  Glenn Morris  <address@hidden>
 
+       * startup.el (inhibit-startup-hooks): Doc tweak.
+       (normal-top-level): Simplify running of hooks.
+       For window-setup-hook, respect inhibit-startup-hooks.
+       (command-line-1): Don't set window-setup-hook to nil.
+
        Allow selective autoloading from obsolete/ directory.
        * Makefile.in (obsolete-autoloads): New rule.
        (autoloads): Run obsolete-autoloads.

=== modified file 'lisp/startup.el'
--- a/lisp/startup.el   2014-03-22 23:47:20 +0000
+++ b/lisp/startup.el   2014-03-27 20:57:23 +0000
@@ -292,8 +292,9 @@
 `tty-setup-hook' instead." "24.4")
 
 (defvar inhibit-startup-hooks nil
-  "Non-nil means don't run `term-setup-hook' and `emacs-startup-hook'.
-This is because we already did so.")
+  "Non-nil means don't run some startup hooks, because we already did.
+Currently this applies to: `emacs-startup-hook', `term-setup-hook',
+and `window-setup-hook'.")
 
 (defvar keyboard-type nil
   "The brand of keyboard you are using.
@@ -644,9 +645,7 @@
                                       (emacs-pid)
                                       (system-name))))))))
        (unless inhibit-startup-hooks
-         (run-hooks 'emacs-startup-hook)
-         (and term-setup-hook
-              (run-hooks 'term-setup-hook)))
+         (run-hooks 'emacs-startup-hook 'term-setup-hook))
 
        ;; Don't do this if we failed to create the initial frame,
        ;; for instance due to a dense colormap.
@@ -682,8 +681,8 @@
        ;; Now we know the user's default font, so add it to the menu.
        (if (fboundp 'font-menu-add-default)
            (font-menu-add-default))
-       (and window-setup-hook
-            (run-hooks 'window-setup-hook))))
+       (unless inhibit-startup-hooks
+         (run-hooks 'window-setup-hook))))
     ;; Subprocesses of Emacs do not have direct access to the terminal, so
     ;; unless told otherwise they should only assume a dumb terminal.
     ;; We are careful to do it late (after term-setup-hook), although the
@@ -2431,10 +2430,7 @@
       ;; If there are no switches to process, we might as well
       ;; run this hook now, and there may be some need to do it
       ;; before doing any output.
-      (run-hooks 'emacs-startup-hook)
-      (and term-setup-hook
-          (run-hooks 'term-setup-hook))
-      (setq inhibit-startup-hooks t)
+      (run-hooks 'emacs-startup-hook 'term-setup-hook)
 
       ;; It's important to notice the user settings before we
       ;; display the startup message; otherwise, the settings
@@ -2446,10 +2442,9 @@
       ;; If there are no switches to process, we might as well
       ;; run this hook now, and there may be some need to do it
       ;; before doing any output.
-      (when window-setup-hook
-       (run-hooks 'window-setup-hook)
-       ;; Don't let the hook be run twice.
-       (setq window-setup-hook nil))
+      (run-hooks 'window-setup-hook)
+
+      (setq inhibit-startup-hooks t)
 
       ;; ;; Do this now to avoid an annoying delay if the user
       ;; ;; clicks the menu bar during the sit-for.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]