From deebb0e98e0334b1efafa2813a85967bf1c8ac90 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 23 Feb 2003 15:16:29 +0000 Subject: [PATCH] (inhibit-startup-hooks): New variable. (normal-top-level): Obey that variable. (command-line-1): Run emacs-startup-hook before term-setup-hook. Set inhibit-startup-hooks too. --- lisp/startup.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/startup.el b/lisp/startup.el index e0fb840c161..51ec459175c 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -270,6 +270,10 @@ It also follows `emacs-startup-hook'. This hook exists for users to set, so as to override the definitions made by the terminal-specific file. Emacs never sets this variable itself.") +(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.") + (defvar keyboard-type nil "The brand of keyboard you are using. This variable is used to define @@ -496,9 +500,10 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." auto-save-list-file-prefix (emacs-pid) (system-name)))))))) - (run-hooks 'emacs-startup-hook) - (and term-setup-hook - (run-hooks 'term-setup-hook)) + (unless inhibit-startup-hooks + (run-hooks 'emacs-startup-hook) + (and term-setup-hook + (run-hooks 'term-setup-hook))) ;; Don't do this if we failed to create the initial frame, ;; for instance due to a dense colormap. @@ -1755,10 +1760,10 @@ normal otherwise." ;; 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)) - ;; Don't let the hook be run twice. - (setq term-setup-hook nil) + (setq inhibit-startup-hooks t) ;; It's important to notice the user settings before we ;; display the startup message; otherwise, the settings -- 2.39.2