Add optimizations to README.md
This commit is contained in:
28
README.md
28
README.md
@@ -131,7 +131,9 @@ Please share your configuration. It could serve as inspiration for other users.
|
|||||||
- [Frequently asked questions](#frequently-asked-questions)
|
- [Frequently asked questions](#frequently-asked-questions)
|
||||||
- [Customizing Scroll Recentering](#customizing-scroll-recentering)
|
- [Customizing Scroll Recentering](#customizing-scroll-recentering)
|
||||||
- [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration)
|
- [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration)
|
||||||
- [Optimization: Disable site-run-file (System-Wide Initialization)](#optimization-disable-site-run-file-system-wide-initialization)
|
- [Optimization: Disabling site-run-file (System-Wide Initialization) and inhibit-default-init](#optimization-disabling-site-run-file-system-wide-initialization-and-inhibit-default-init)
|
||||||
|
- [Optimization: Disable `site-run-file`](#optimization-disable-site-run-file)
|
||||||
|
- [Optimization: Disable `default.el` (`inhibit-default-init`)](#optimization-disable-defaultel-inhibit-default-init)
|
||||||
- [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable)
|
- [How to get the latest version of all packages? (unstable)](#how-to-get-the-latest-version-of-all-packages-unstable)
|
||||||
- [How to use MELPA stable?](#how-to-use-melpa-stable)
|
- [How to use MELPA stable?](#how-to-use-melpa-stable)
|
||||||
- [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations)
|
- [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations)
|
||||||
@@ -2267,7 +2269,14 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
|
|||||||
|
|
||||||
(Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration. However, `emacs-init-time` does not account for the portion of the startup process that occurs after `after-init-time`.)
|
(Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration. However, `emacs-init-time` does not account for the portion of the startup process that occurs after `after-init-time`.)
|
||||||
|
|
||||||
### Optimization: Disable site-run-file (System-Wide Initialization)
|
### Optimization: Disabling site-run-file (System-Wide Initialization) and inhibit-default-init
|
||||||
|
|
||||||
|
Emacs has a two-stage system initialization process:
|
||||||
|
|
||||||
|
1. **`site-start.el` (Pre-Init):** Runs before your configuration. (Controlled by `site-run-file`).
|
||||||
|
2. **`default.el` (Post-Init):** Runs *after* your configuration. This is often used by distributions or sysadmins to provide "fallback" defaults or site-wide overrides that apply to all users.
|
||||||
|
|
||||||
|
#### Optimization: Disable `site-run-file`
|
||||||
|
|
||||||
By default, Emacs loads the `site-start.el` file during the startup sequence. This file is typically managed by the operating system or system administrators to apply global settings, such as Linux distribution-specific packages or environment paths.
|
By default, Emacs loads the `site-start.el` file during the startup sequence. This file is typically managed by the operating system or system administrators to apply global settings, such as Linux distribution-specific packages or environment paths.
|
||||||
|
|
||||||
@@ -2283,6 +2292,21 @@ To guarantee a clean environment and eliminate this overhead, add the following
|
|||||||
|
|
||||||
While `site-start.el` is optional on standard Linux distributions like Ubuntu, Fedora, and Arch, often loading only generic, superfluous settings, it is required on functional operating systems such as NixOS and Guix System. Since these systems isolate every package in a unique directory, the operating system uses `site-start.el` to inject the necessary `load-path` variables, without which Emacs cannot locate its own core dependencies.
|
While `site-start.el` is optional on standard Linux distributions like Ubuntu, Fedora, and Arch, often loading only generic, superfluous settings, it is required on functional operating systems such as NixOS and Guix System. Since these systems isolate every package in a unique directory, the operating system uses `site-start.el` to inject the necessary `load-path` variables, without which Emacs cannot locate its own core dependencies.
|
||||||
|
|
||||||
|
#### Optimization: Disable `default.el` (`inhibit-default-init`)
|
||||||
|
|
||||||
|
While `site-run-file` prevents Emacs from loading system configuration **before** your init file, there is another variable that prevents Emacs from loading system configuration **after** your init file.
|
||||||
|
|
||||||
|
Just like `site-start.el`, the `default.el` file can overwrite your carefully tuned settings and adds unnecessary I/O at startup.
|
||||||
|
|
||||||
|
**To complete your system isolation, add this to your `pre-early-init.el`:**
|
||||||
|
|
||||||
|
```elisp
|
||||||
|
;; Prevent loading of the system-wide default.el file
|
||||||
|
;; This ensures that no system configuration runs *after* your init file.
|
||||||
|
;; NOTE: This must be placed in 'pre-early-init.el'.
|
||||||
|
(setq inhibit-default-init t)
|
||||||
|
```
|
||||||
|
|
||||||
### How to get the latest version of all packages? (unstable)
|
### How to get the latest version of all packages? (unstable)
|
||||||
|
|
||||||
By default, *minimal-emacs.d* is configured to prioritize packages from [GNU ELPA](https://elpa.gnu.org/) and [NonGNU ELPA](https://elpa.nongnu.org/) repositories over [MELPA](https://melpa.org/), ensuring greater stability.
|
By default, *minimal-emacs.d* is configured to prioritize packages from [GNU ELPA](https://elpa.gnu.org/) and [NonGNU ELPA](https://elpa.nongnu.org/) repositories over [MELPA](https://melpa.org/), ensuring greater stability.
|
||||||
|
|||||||
Reference in New Issue
Block a user