summaryrefslogtreecommitdiff
path: root/devdocs/elisp/startup-summary.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/startup-summary.html
new repository
Diffstat (limited to 'devdocs/elisp/startup-summary.html')
-rw-r--r--devdocs/elisp/startup-summary.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/devdocs/elisp/startup-summary.html b/devdocs/elisp/startup-summary.html
new file mode 100644
index 00000000..6c3a41ba
--- /dev/null
+++ b/devdocs/elisp/startup-summary.html
@@ -0,0 +1,57 @@
+ <h4 class="subsection">Summary: Sequence of Actions at Startup</h4> <p>When Emacs is started up, it performs the following operations (see <code>normal-top-level</code> in <samp>startup.el</samp>): </p> <ol> <li> It adds subdirectories to <code>load-path</code>, by running the file named <samp>subdirs.el</samp> in each directory in the list. Normally, this file adds the directory’s subdirectories to the list, and those are scanned in their turn. The files <samp>subdirs.el</samp> are normally generated automatically when Emacs is installed. </li>
+<li> It loads any <samp>leim-list.el</samp> that it finds in the <code>load-path</code> directories. This file is intended for registering input methods. The search is only for any personal <samp>leim-list.el</samp> files that you may have created; it skips the directories containing the standard Emacs libraries (these should contain only a single <samp>leim-list.el</samp> file, which is compiled into the Emacs executable). </li>
+<li> It sets the variable <code>before-init-time</code> to the value of <code>current-time</code> (see <a href="time-of-day">Time of Day</a>). It also sets <code>after-init-time</code> to <code>nil</code>, which signals to Lisp programs that Emacs is being initialized. </li>
+<li> It sets the language environment and the terminal coding system, if requested by environment variables such as <code>LANG</code>. </li>
+<li> It does some basic parsing of the command-line arguments. </li>
+<li> It loads your early init file (see <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Early-Init-File.html#Early-Init-File">Early Init File</a> in <cite>The GNU Emacs Manual</cite>). This is not done if the options ‘<samp>-q</samp>’, ‘<samp>-Q</samp>’, or ‘<samp>--batch</samp>’ were specified. If the ‘<samp>-u</samp>’ option was specified, Emacs looks for the init file in that user’s home directory instead. </li>
+<li> It calls the function <code>package-activate-all</code> to activate any optional Emacs Lisp package that has been installed. See <a href="packaging-basics">Packaging Basics</a>. However, Emacs doesn’t activate the packages when <code>package-enable-at-startup</code> is <code>nil</code> or when it’s started with one of the options ‘<samp>-q</samp>’, ‘<samp>-Q</samp>’, or ‘<samp>--batch</samp>’. To activate the packages in the latter case, <code>package-activate-all</code> should be called explicitly (e.g., via the ‘<samp>--funcall</samp>’ option). </li>
+<li> If not running in batch mode, it initializes the window system that the variable <code>initial-window-system</code> specifies (see <a href="window-systems">initial-window-system</a>). The initialization function, <code>window-system-initialization</code>, is a <em>generic function</em> (see <a href="generic-functions">Generic Functions</a>) whose actual implementation is different for each supported window system. If the value of <code>initial-window-system</code> is <var>windowsystem</var>, then the appropriate implementation of the initialization function is defined in the file <samp>term/<var>windowsystem</var>-win.el</samp>. This file should have been compiled into the Emacs executable when it was built. </li>
+<li> It runs the normal hook <code>before-init-hook</code>. </li>
+<li> If appropriate, it creates a graphical frame. As part of creating the graphical frame, it initializes the window system specified by <code>initial-frame-alist</code> and <code>default-frame-alist</code> (see <a href="initial-parameters">Initial Parameters</a>) for the graphical frame, by calling the <code>window-system-initialization</code> function for that window system. This is not done in batch (noninteractive) or daemon mode. </li>
+<li> It initializes the initial frame’s faces, and sets up the menu bar and tool bar if needed. If graphical frames are supported, it sets up the tool bar even if the current frame is not a graphical one, since a graphical frame may be created later on. </li>
+<li> It use <code>custom-reevaluate-setting</code> to re-initialize the members of the list <code>custom-delayed-init-variables</code>. These are any pre-loaded user options whose default value depends on the run-time, rather than build-time, context. See <a href="building-emacs">custom-initialize-delay</a>. </li>
+<li> It loads the library <samp>site-start</samp>, if it exists. This is not done if the options ‘<samp>-Q</samp>’ or ‘<samp>--no-site-file</samp>’ were specified. </li>
+<li> It loads your init file (see <a href="init-file">Init File</a>). This is not done if the options ‘<samp>-q</samp>’, ‘<samp>-Q</samp>’, or ‘<samp>--batch</samp>’ were specified. If the ‘<samp>-u</samp>’ option was specified, Emacs looks for the init file in that user’s home directory instead. </li>
+<li> It loads the library <samp>default</samp>, if it exists. This is not done if <code>inhibit-default-init</code> is non-<code>nil</code>, nor if the options ‘<samp>-q</samp>’, ‘<samp>-Q</samp>’, or ‘<samp>--batch</samp>’ were specified. </li>
+<li> It loads your abbrevs from the file specified by <code>abbrev-file-name</code>, if that file exists and can be read (see <a href="abbrev-files">abbrev-file-name</a>). This is not done if the option ‘<samp>--batch</samp>’ was specified. </li>
+<li> It sets the variable <code>after-init-time</code> to the value of <code>current-time</code>. This variable was set to <code>nil</code> earlier; setting it to the current time signals that the initialization phase is over, and, together with <code>before-init-time</code>, provides the measurement of how long it took. </li>
+<li> It runs the normal hook <code>after-init-hook</code>. </li>
+<li> If the buffer <samp>*scratch*</samp> exists and is still in Fundamental mode (as it should be by default), it sets its major mode according to <code>initial-major-mode</code>. </li>
+<li> If started on a text terminal, it loads the terminal-specific Lisp library (see <a href="terminal_002dspecific">Terminal-Specific</a>), and runs the hook <code>tty-setup-hook</code>. This is not done in <code>--batch</code> mode, nor if <code>term-file-prefix</code> is <code>nil</code>. </li>
+<li> It displays the initial echo area message, unless you have suppressed that with <code>inhibit-startup-echo-area-message</code>. </li>
+<li> It processes any command-line options that were not handled earlier. </li>
+<li> It now exits if the option <code>--batch</code> was specified. </li>
+<li> If the <samp>*scratch*</samp> buffer exists and is empty, it inserts <code>(substitute-command-keys initial-scratch-message)</code> into that buffer. </li>
+<li> If <code>initial-buffer-choice</code> is a string, it visits the file (or directory) with that name. If it is a function, it calls the function with no arguments and selects the buffer that it returns. If one file is given as a command line argument, that file is visited and its buffer displayed alongside <code>initial-buffer-choice</code>. If more than one file is given, all of the files are visited and the <samp>*Buffer List*</samp> buffer is displayed alongside <code>initial-buffer-choice</code>. </li>
+<li> It runs <code>emacs-startup-hook</code>. </li>
+<li> It calls <code>frame-notice-user-settings</code>, which modifies the parameters of the selected frame according to whatever the init files specify. </li>
+<li> It runs <code>window-setup-hook</code>. The only difference between this hook and <code>emacs-startup-hook</code> is that this one runs after the previously mentioned modifications to the frame parameters. </li>
+<li> It displays the <em>startup screen</em>, which is a special buffer that contains information about copyleft and basic Emacs usage. This is not done if <code>inhibit-startup-screen</code> or <code>initial-buffer-choice</code> are non-<code>nil</code>, or if the ‘<samp>--no-splash</samp>’ or ‘<samp>-Q</samp>’ command-line options were specified. </li>
+<li> If a daemon was requested, it calls <code>server-start</code>. (On POSIX systems, if a background daemon was requested, it then detaches from the controlling terminal.) See <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server">Emacs Server</a> in <cite>The GNU Emacs Manual</cite>. </li>
+<li> If started by the X session manager, it calls <code>emacs-session-restore</code> passing it as argument the ID of the previous session. See <a href="session-management">Session Management</a>. </li>
+</ol> <p>The following options affect some aspects of the startup sequence. </p> <dl> <dt id="inhibit-startup-screen">User Option: <strong>inhibit-startup-screen</strong>
+</dt> <dd>
+<p>This variable, if non-<code>nil</code>, inhibits the startup screen. In that case, Emacs typically displays the <samp>*scratch*</samp> buffer; but see <code>initial-buffer-choice</code>, below. </p> <p>Do not set this variable in the init file of a new user, or in a way that affects more than one user, as that would prevent new users from receiving information about copyleft and basic Emacs usage. </p> <p><code>inhibit-startup-message</code> and <code>inhibit-splash-screen</code> are aliases for this variable. </p>
+</dd>
+</dl> <dl> <dt id="initial-buffer-choice">User Option: <strong>initial-buffer-choice</strong>
+</dt> <dd><p>If non-<code>nil</code>, this variable is a string that specifies a file or directory for Emacs to display after starting up, instead of the startup screen. If its value is a function, Emacs calls that function which must return a buffer which is then displayed. If its value is <code>t</code>, Emacs displays the <samp>*scratch*</samp> buffer. </p></dd>
+</dl> <dl> <dt id="inhibit-startup-echo-area-message">User Option: <strong>inhibit-startup-echo-area-message</strong>
+</dt> <dd>
+<p>This variable controls the display of the startup echo area message. You can suppress the startup echo area message by adding text with this form to your init file: </p> <div class="example"> <pre class="example">(setq inhibit-startup-echo-area-message
+ "<var>your-login-name</var>")
+</pre>
+</div> <p>Emacs explicitly checks for an expression as shown above in your init file; your login name must appear in the expression as a Lisp string constant. You can also use the Customize interface. Other methods of setting <code>inhibit-startup-echo-area-message</code> to the same value do not inhibit the startup message. This way, you can easily inhibit the message for yourself if you wish, but thoughtless copying of your init file will not inhibit the message for someone else. </p>
+</dd>
+</dl> <dl> <dt id="initial-scratch-message">User Option: <strong>initial-scratch-message</strong>
+</dt> <dd><p>This variable, if non-<code>nil</code>, should be a string, which is treated as documentation to be inserted into the <samp>*scratch*</samp> buffer when Emacs starts up. If it is <code>nil</code>, the <samp>*scratch*</samp> buffer is empty. </p></dd>
+</dl> <p>The following command-line options affect some aspects of the startup sequence. See <a href="https://www.gnu.org/software/emacs/manual/html_node/emacs/Initial-Options.html#Initial-Options">Initial Options</a> in <cite>The GNU Emacs Manual</cite>. </p> <dl compact> <dt><code>--no-splash</code></dt> <dd>
+<p>Do not display a splash screen. </p> </dd> <dt><code>--batch</code></dt> <dd>
+<p>Run without an interactive terminal. See <a href="batch-mode">Batch Mode</a>. </p> </dd> <dt><code>--daemon</code></dt> <dt><code>--bg-daemon</code></dt> <dt><code>--fg-daemon</code></dt> <dd>
+<p>Do not initialize any display; just start a server. (A “background” daemon automatically runs in the background.) </p> </dd> <dt><code>--no-init-file</code></dt> <dt><code>-q</code></dt> <dd>
+<p>Do not load either the init file, or the <samp>default</samp> library. </p> </dd> <dt><code>--no-site-file</code></dt> <dd>
+<p>Do not load the <samp>site-start</samp> library. </p> </dd> <dt><code>--quick</code></dt> <dt><code>-Q</code></dt> <dd><p>Equivalent to ‘<samp>-q --no-site-file --no-splash</samp>’. </p></dd> </dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html</a>
+ </p>
+</div>