From f640bc55957b5cde3bb3c7b45ecc04c03878ac24 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 26 Feb 2025 00:32:38 -0500
Subject: [PATCH 001/172] Update package-archive-priorities
---
early-init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index b9f656f..a455b1a 100644
--- a/early-init.el
+++ b/early-init.el
@@ -324,7 +324,7 @@ minimalistic appearance during startup.")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
- ("stable" . 70)
+ ("melpa-stable" . 70)
("melpa" . 0)))
;;; Load post-early-init.el
From f987325537b07be7a672c4fa36c129d47f9255aa Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 08:30:17 -0500
Subject: [PATCH 002/172] Closes #29: Auto-revert in *Buffer List* moves the
cursor to the beginning of the buffer.
---
init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.el b/init.el
index 8b9b90a..65c4f8e 100644
--- a/init.el
+++ b/init.el
@@ -198,6 +198,7 @@
;; Revert other buffers (e.g, Dired)
(setq global-auto-revert-non-file-buffers t)
+(setq global-auto-revert-ignore-modes '(Buffer-menu-mode)) ; Resolve issue #29
;;; recentf
From 594326768198d903d4f7ea49a27a9492ea9e88a4 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 08:59:49 -0500
Subject: [PATCH 003/172] Closes #30: Increase undo limits to prevent early
truncation of undo history
---
init.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/init.el b/init.el
index 65c4f8e..66e7bbc 100644
--- a/init.el
+++ b/init.el
@@ -25,6 +25,14 @@
;; Don't ping things that look like domain names.
(setq ffap-machine-p-known 'reject)
+;;; Undo/redo
+
+;; Increase undo limits to prevent early garbage collection from aggressively
+;; truncating undo history
+(setq undo-limit (* 13 160000)
+ undo-strong-limit (* 13 240000)
+ undo-outer-limit (* 13 24000000))
+
;;; package.el
(when (bound-and-true-p minimal-emacs-package-initialize-and-refresh)
From 730d248a2df5bde13ed5d203c5bcf0cfe87c150f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 09:02:10 -0500
Subject: [PATCH 004/172] Closes #31: Remove warnings for narrow-to-region,
upcase-region, downcase-region...
---
init.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/init.el b/init.el
index 66e7bbc..0a0ac12 100644
--- a/init.el
+++ b/init.el
@@ -552,6 +552,15 @@
(setq dabbrev-ignored-buffer-modes
'(archive-mode image-mode docview-mode tags-table-mode pdf-view-mode))
+;;; Remove warnings from narrow-to-region, upcase-region...
+
+(put 'narrow-to-region 'disabled nil)
+(put 'upcase-region 'disabled nil)
+(put 'downcase-region 'disabled nil)
+(put 'erase-buffer 'disabled nil)
+(put 'scroll-left 'disabled nil)
+(put 'dired-find-alternate-file 'disabled nil)
+
;;; Load post init
(minimal-emacs-load-user-init "post-init.el")
From 906d7178739a750cf148d2fb3f8b2dd0a6881fb8 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 09:29:19 -0500
Subject: [PATCH 005/172] Update README.md
---
README.md | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 7283a03..cc37f5e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,5 @@
# minimal-emacs.d - Emacs Configuration with Better Defaults and Optimized Startup
[](https://www.gnu.org/licenses/gpl-3.0)
-
The **minimal-emacs.d** project is a customizable Emacs base that provides **better Emacs defaults and optimized startup**, intended to serve as a solid foundation for a vanilla Emacs configuration.
@@ -12,9 +11,7 @@ Here’s what the **minimal-emacs.d** configuration provides:
*(More information about the features can be found here: [Features](#features))*
-Creating *minimal-emacs.d* `init.el` and `early-init.el` involved extensive research and testing to find the best parameters and optimizations for an Emacs init file. The concept behind *minimal-emacs.d* is to provide a clean, bloat-free, fast base.
-
-The **minimal-emacs.d** only enables features, providing a minimal base that is optimized. From there, users are encouraged to consult this README.md to customize and extend the configuration based on their specific needs. (Read: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))
+Creating *minimal-emacs.d* `init.el` and `early-init.el` involved extensive research and testing to find the best parameters and optimizations for an Emacs init file. The concept behind *minimal-emacs.d* is to provide a clean, bloat-free, fast base. The **minimal-emacs.d** provides a minimal base that is optimized. From there, users are encouraged to consult this README.md to customize and extend the configuration based on their specific needs. (Read: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))
The author is using **[minimal-emacs.d](https://github.com/jamescherti/minimal-emacs.d)** as his `early-init.el` and `init.el`. He is using 146 packages ([Here are some of the packages the author is using](https://www.jamescherti.com/essential-emacs-packages/)) and his Emacs configuration starts in 0.22 seconds:

From be36938fd1edbce0e3ee87e239286de2a4ac0697 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 09:42:39 -0500
Subject: [PATCH 006/172] Update README.md
---
README.md | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/README.md b/README.md
index cc37f5e..e6758f5 100644
--- a/README.md
+++ b/README.md
@@ -428,11 +428,7 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency
:commands (undo-fu-only-undo
undo-fu-only-redo
undo-fu-only-redo-all
- undo-fu-disable-checkpoint)
- :custom
- ;; 3 times the default values
- (undo-limit (* 3 160000))
- (undo-strong-limit (* 3 240000)))
+ undo-fu-disable-checkpoint))
(use-package undo-fu-session
:ensure t
From ce4582d1bdcb2ddaebb7d751db426f9209e77c29 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 10:12:37 -0500
Subject: [PATCH 007/172] Add
remote-file-name-inhibit-delete-by-moving-to-trash
---
init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.el b/init.el
index 0a0ac12..857f21e 100644
--- a/init.el
+++ b/init.el
@@ -130,6 +130,7 @@
;; Delete by moving to trash in interactive mode
(setq delete-by-moving-to-trash (not noninteractive))
+(setq remote-file-name-inhibit-delete-by-moving-to-trash t)
;; Disable the warning "X and Y are the same file". Ignoring this warning is
;; acceptable since it will redirect you to the existing buffer regardless.
From 0768ad04abdb339d45bce0397c1660d468f42db3 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 10:19:25 -0500
Subject: [PATCH 008/172] Enhance native-comp and warnings defaults
---
README.md | 2 --
early-init.el | 5 +++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e6758f5..9ee8155 100644
--- a/README.md
+++ b/README.md
@@ -727,8 +727,6 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
2. You can also add the following to `~/.emacs.d/post-init.el`:
```emacs-lisp
-;; Hide warnings and display only errors
-(setq warning-minimum-level :error)
;; Display of line numbers in the buffer:
;; (display-line-numbers-mode 1)
diff --git a/early-init.el b/early-init.el
index a455b1a..8f536f9 100644
--- a/early-init.el
+++ b/early-init.el
@@ -107,6 +107,8 @@ minimalistic appearance during startup.")
;; Set-language-environment sets default-input-method, which is unwanted.
(setq default-input-method nil)
+(setq warning-minimum-level (if minimal-emacs-debug :warning :error))
+
;;; Performance
;; Font compacting can be very resource-intensive, especially when rendering
@@ -251,6 +253,9 @@ minimalistic appearance during startup.")
;; Suppress compiler warnings and don't inundate users with their popups.
(setq native-comp-async-report-warnings-errors
(or minimal-emacs-debug 'silent))
+(setq native-comp-verbose (if minimal-emacs-debug 1 0)
+ native-comp-debug (if minimal-emacs-debug 1 0))
+(setq native-comp-jit-compilation t)
(setq native-comp-warning-on-missing-source minimal-emacs-debug)
(setq debug-on-error minimal-emacs-debug
From 1aab3d72578a321f9373f0244b4768c8bb427402 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 10:30:57 -0500
Subject: [PATCH 009/172] Enhance scrolling and buffer processes
---
init.el | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/init.el b/init.el
index 857f21e..2cbb22f 100644
--- a/init.el
+++ b/init.el
@@ -20,15 +20,15 @@
;;; Before package
;; Increase how much is read from processes in a single chunk
-(setq read-process-output-max (* 1024 1024)) ; 1024kb
+(setq read-process-output-max (* 2 1024 1024)) ; 1024kb
+
+(setq process-adaptive-read-buffering nil)
;; Don't ping things that look like domain names.
(setq ffap-machine-p-known 'reject)
;;; Undo/redo
-;; Increase undo limits to prevent early garbage collection from aggressively
-;; truncating undo history
(setq undo-limit (* 13 160000)
undo-strong-limit (* 13 240000)
undo-outer-limit (* 13 24000000))
@@ -115,8 +115,7 @@
;; but may reduce visual feedback.
(setq redisplay-skip-fontification-on-input t)
-;; Collects and displays all available documentation immediately, even if
-;; multiple sources provide it. It concatenates the results.
+;; Collects and displays all available documentation immediately
(setq eldoc-documentation-strategy 'eldoc-documentation-compose-eagerly)
;; Disable truncation of printed s-expressions in the message buffer
@@ -232,9 +231,7 @@
;;; savehist
;; `savehist-mode' is an Emacs feature that preserves the minibuffer history
-;; between sessions. It saves the history of inputs in the minibuffer, such as
-;; commands, search strings, and other prompts, to a file. This allows users to
-;; retain their minibuffer history across Emacs restarts.
+;; between sessions.
(setq history-length 300)
(setq savehist-save-minibuffer-history t) ;; Default
@@ -277,7 +274,7 @@
;; window is never automatically recentered. The default value of 0 triggers
;; recentering too aggressively. Setting it to 10 reduces excessive recentering
;; and only recenters the window when scrolling significantly off-screen.
-(setq scroll-conservatively 10)
+(setq scroll-conservatively 101)
;; Enables smooth scrolling by making Emacs scroll the window by 1 line whenever
;; the cursor moves off the visible screen.
From 2c31d233e048bda095d2e4c2b5bbad12d8411d2f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 15:26:38 -0500
Subject: [PATCH 010/172] Closes #33: Add savehist-additional-variables
---
init.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init.el b/init.el
index 2cbb22f..5fc7c02 100644
--- a/init.el
+++ b/init.el
@@ -234,6 +234,11 @@
;; between sessions.
(setq history-length 300)
(setq savehist-save-minibuffer-history t) ;; Default
+(setq savehist-additional-variables
+ '(kill-ring ; clipboard
+ register-alist ; macros
+ mark-ring global-mark-ring ; marks
+ search-ring regexp-search-ring)) ; searches
;;; Frames and windows
From bad3433c32db76564e43ae654c439aec9be87094 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 16:53:30 -0500
Subject: [PATCH 011/172] Move dired-omit-files to the README.md file
---
README.md | 12 ++++++++++++
init.el | 10 ----------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index 9ee8155..ff68357 100644
--- a/README.md
+++ b/README.md
@@ -787,6 +787,18 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
;; modification date, etc.) and all the files in the `dired-omit-files' regular
;; expression for a cleaner display.
(add-hook 'dired-mode-hook #'dired-hide-details-mode)
+
+;; Hide files from dired
+(setq dired-omit-files (concat "\\`[.]\\'"
+ "\\|\\(?:\\.js\\)?\\.meta\\'"
+ "\\|\\.\\(?:elc|a\\|o\\|pyc\\|pyo\\|swp\\|class\\)\\'"
+ "\\|^\\.DS_Store\\'"
+ "\\|^\\.\\(?:svn\\|git\\)\\'"
+ "\\|^\\.ccls-cache\\'"
+ "\\|^__pycache__\\'"
+ "\\|^\\.project\\(?:ile\\)?\\'"
+ "\\|^flycheck_.*"
+ "\\|^flymake_.*"))
(add-hook 'dired-mode-hook #'dired-omit-mode)
;; Enable on-the-fly spell checking (Flyspell mode).
diff --git a/init.el b/init.el
index 5fc7c02..04d2ef6 100644
--- a/init.el
+++ b/init.el
@@ -431,16 +431,6 @@
;; dired-omit-mode
(setq dired-omit-verbose nil)
-(setq dired-omit-files (concat "\\`[.]\\'"
- "\\|\\(?:\\.js\\)?\\.meta\\'"
- "\\|\\.\\(?:elc|a\\|o\\|pyc\\|pyo\\|swp\\|class\\)\\'"
- "\\|^\\.DS_Store\\'"
- "\\|^\\.\\(?:svn\\|git\\)\\'"
- "\\|^\\.ccls-cache\\'"
- "\\|^__pycache__\\'"
- "\\|^\\.project\\(?:ile\\)?\\'"
- "\\|^flycheck_.*"
- "\\|^flymake_.*"))
;; ls-lisp
(setq ls-lisp-verbosity nil)
From 08f077545a0f45a1701333406fd1afe8be77a752 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Feb 2025 17:16:27 -0500
Subject: [PATCH 012/172] Update dired-omit-files
---
init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.el b/init.el
index 04d2ef6..0971262 100644
--- a/init.el
+++ b/init.el
@@ -431,6 +431,7 @@
;; dired-omit-mode
(setq dired-omit-verbose nil)
+(setq dired-omit-files (concat "\\`[.]\\'"))
;; ls-lisp
(setq ls-lisp-verbosity nil)
From de071d0ea57d16944e5d313da43fa663ddbaf6ad Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 28 Feb 2025 08:39:47 -0500
Subject: [PATCH 013/172] Remove the warning when the user attempts to use
list-timers
---
init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.el b/init.el
index 0971262..656b0dd 100644
--- a/init.el
+++ b/init.el
@@ -548,6 +548,7 @@
;;; Remove warnings from narrow-to-region, upcase-region...
+(put 'list-timers 'disabled nil)
(put 'narrow-to-region 'disabled nil)
(put 'upcase-region 'disabled nil)
(put 'downcase-region 'disabled nil)
From 8ddef1be9971d95fe3d5e506ba448dd2107ce3eb Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 1 Mar 2025 22:04:41 -0500
Subject: [PATCH 014/172] Update README.md
---
README.md | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
diff --git a/README.md b/README.md
index ff68357..cdf854d 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,8 @@ The author is using **[minimal-emacs.d](https://github.com/jamescherti/minimal-e
- [Session Management](#session-management)
- [Code completion with corfu](#code-completion-with-corfu)
- [Inhibit the mouse](#inhibit-the-mouse)
+ - [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
+ - [Enhance the Elisp development experience](#enhance-the-elisp-development-experience)
- [How to configure straight.el?](#how-to-configure-straightel)
- [How to configure elpaca (package manager)](#how-to-configure-elpaca-package-manager)
- [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
@@ -641,6 +643,110 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`:
NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed.
+### A better Emacs *help* buffer
+
+Helpful is an alternative to the built-in Emacs help that provides much more contextual information.
+
+To configure **helpful**, add the following to `~/.emacs.d/post-init.el`:
+```emacs-lisp
+(use-package helpful
+ :defer t
+ :commands (helpful-callable
+ helpful-variable
+ helpful-key
+ helpful-command
+ helpful-at-point
+ helpful-function)
+ :bind
+ ([remap describe-command] . helpful-command)
+ ([remap describe-function] . helpful-callable)
+ ([remap describe-key] . helpful-key)
+ ([remap describe-symbol] . helpful-symbol)
+ ([remap describe-variable] . helpful-variable)
+ :custom
+ (helpful-max-buffers 7))
+```
+
+### Enhance the Elisp development experience
+
+To enhance the Elisp development experience, add the following to `~/.emacs.d/post-init.el`:
+```emacs-lisp
+;; Enables automatic indentation of code while typing
+(use-package aggressive-indent
+ :ensure t
+ :defer t
+ :commands aggressive-indent-mode
+ :hook
+ (emacs-lisp-mode . aggressive-indent-mode))
+
+;; Highlights function and variable definitions in Emacs Lisp mode
+(use-package highlight-defined
+ :ensure t
+ :defer t
+ :commands highlight-defined-mode
+ :hook
+ (emacs-lisp-mode . highlight-defined-mode))
+
+;; Enables structured editing of S-expressions in Lisp-like languages
+(use-package paredit
+ :ensure t
+ :defer t
+ :commands paredit-mode
+ :hook
+ (emacs-lisp-mode . paredit-mode)
+ :config
+ (define-key paredit-mode-map (kbd "RET") nil))
+
+;; For paredit+Evil mode users: enhances paredit with Evil mode compatibility
+;; --------------------------------------------------------------------------
+;; (use-package enhanced-evil-paredit
+;; :ensure t
+;; :defer t
+;; :commands enhanced-evil-paredit-mode
+;; :hook
+;; (paredit-mode . enhanced-evil-paredit-mode))
+
+```
+
+Other optional packages that may be useful include:
+```emacs-lisp
+;; Displays visible indicators for page breaks
+(use-package page-break-lines
+ :ensure t
+ :defer t
+ :commands (page-break-lines-mode
+ global-page-break-lines-mode)
+ :hook
+ (emacs-lisp-mode . page-break-lines-mode))
+
+;; Highlights escape sequences in strings for better visibility
+(use-package easy-escape
+ :ensure t
+ :defer t
+ :commands easy-escape-minor-mode
+ :config
+ (set-face-attribute 'easy-escape-face nil :foreground "red"))
+
+;; Provides automatic formatting for Emacs Lisp code
+(use-package elisp-autofmt
+ :ensure t
+ :defer t
+ :commands (elisp-autofmt-mode
+ elisp-autofmt-buffer
+ elisp-autofmt-region))
+
+;; Provides functions to find references to functions, macros, variables,
+;; special forms, and symbols in Emacs Lisp
+(use-package elisp-refs
+ :ensure t
+ :defer t
+ :commands (elisp-refs-function
+ elisp-refs-macro
+ elisp-refs-variable
+ elisp-refs-special
+ elisp-refs-symbol))
+```
+
### How to configure straight.el?
[Add the straight.el bootstrap code](https://github.com/radian-software/straight.el?tab=readme-ov-file#getting-started) to `~/.emacs.d/pre-init.el`:
From 75b2b8f4b400bb945c1a03d34a543d40325b0802 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 1 Mar 2025 22:07:00 -0500
Subject: [PATCH 015/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index cdf854d..87bcbf9 100644
--- a/README.md
+++ b/README.md
@@ -687,7 +687,7 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po
:hook
(emacs-lisp-mode . highlight-defined-mode))
-;; Enables structured editing of S-expressions in Lisp-like languages
+;; Prevent parenthesis imbalance
(use-package paredit
:ensure t
:defer t
From 65b83b231039494f3b23b6918e42a1a249fab154 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 13:09:14 -0500
Subject: [PATCH 016/172] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 87bcbf9..ece1cca 100644
--- a/README.md
+++ b/README.md
@@ -163,6 +163,7 @@ A common solution to this issue is installing the no-littering package; however,
An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`:
``` emacs-lisp
;; Reducing clutter in ~/.emacs.d by redirecting files to ~/emacs.d/var/
+;; IMPORTANT: This part should be in the pre-early-init.el file
(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory))
(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir))
(setq user-emacs-directory minimal-emacs-var-dir)
From fe2dc6c2f2907219ad2ce1a66728953e490d9c33 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 13:26:29 -0500
Subject: [PATCH 017/172] Add native-comp-async-query-on-exit
---
init.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/init.el b/init.el
index 656b0dd..f42bb6b 100644
--- a/init.el
+++ b/init.el
@@ -27,6 +27,11 @@
;; Don't ping things that look like domain names.
(setq ffap-machine-p-known 'reject)
+;; Ask the user whether to terminate asynchronous compilations on exit.
+;; This prevents native compilation from leaving temporary files in /tmp.
+(setq native-comp-async-query-on-exit t)
+(setq confirm-kill-processes t) ; Required for `native-comp-async-query-on-exit'
+
;;; Undo/redo
(setq undo-limit (* 13 160000)
From ce1a5e179705d8cbcc11fb8b467615267af1da62 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 13:27:57 -0500
Subject: [PATCH 018/172] Add native-comp-async-query-on-exit
---
init.el | 1 -
1 file changed, 1 deletion(-)
diff --git a/init.el b/init.el
index f42bb6b..bb2b4b6 100644
--- a/init.el
+++ b/init.el
@@ -30,7 +30,6 @@
;; Ask the user whether to terminate asynchronous compilations on exit.
;; This prevents native compilation from leaving temporary files in /tmp.
(setq native-comp-async-query-on-exit t)
-(setq confirm-kill-processes t) ; Required for `native-comp-async-query-on-exit'
;;; Undo/redo
From e46fcad092fb4af9dbd6ce7086d4d9a7ce927135 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 14:25:49 -0500
Subject: [PATCH 019/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ece1cca..64c78d5 100644
--- a/README.md
+++ b/README.md
@@ -171,7 +171,7 @@ An alternative lightweight approach is to simply change the default `~/.emacs.d`
### How to prevent minimal-emacs.d from saving custom.el?
-To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device`:
+To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`:
``` emacs-lisp
(setq custom-file null-device)
```
From 05f25af9f57eeb67512f3a1236c70abd896af1d6 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 19:59:25 -0500
Subject: [PATCH 020/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 64c78d5..dfb844c 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# minimal-emacs.d - Emacs Configuration with Better Defaults and Optimized Startup
+# minimal-emacs.d - A Customizable Emacs Base that Provides Better Defaults and Optimized Startup
[](https://www.gnu.org/licenses/gpl-3.0)
The **minimal-emacs.d** project is a customizable Emacs base that provides **better Emacs defaults and optimized startup**, intended to serve as a solid foundation for a vanilla Emacs configuration.
@@ -21,7 +21,7 @@ The author is using **[minimal-emacs.d](https://github.com/jamescherti/minimal-e
## Table of Contents
-- [minimal-emacs.d - Emacs Configuration with Better Defaults and Optimized Startup](#minimal-emacsd---emacs-configuration-with-better-defaults-and-optimized-startup)
+- [minimal-emacs.d - A Customizable Emacs Base that Provides Better Defaults and Optimized Startup](#minimal-emacsd---a-customizable-emacs-base-that-provides-better-defaults-and-optimized-startup)
- [Install minimal-emacs.d](#install-minimal-emacsd)
- [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd)
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
From 43ece5686fb23020cbebd290f1074ea862ee84e8 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:12:31 -0500
Subject: [PATCH 021/172] Update README.md
---
README.md | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index dfb844c..afbde4f 100644
--- a/README.md
+++ b/README.md
@@ -1,22 +1,27 @@
# minimal-emacs.d - A Customizable Emacs Base that Provides Better Defaults and Optimized Startup
[](https://www.gnu.org/licenses/gpl-3.0)
-The **minimal-emacs.d** project is a customizable Emacs base that provides **better Emacs defaults and optimized startup**, intended to serve as a solid foundation for a vanilla Emacs configuration.
+The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
-Here’s what the **minimal-emacs.d** configuration provides:
-- Optimizations to speed up both startup and overall usage of Emacs,
-- Improved default Emacs settings, including user experience enhancements, UI element management, optimized garbage collection, better configurations for built-in packages, etc.,
-- Provides the user with complete control over selecting major and minor modes (*minimal-emacs.d* does not enable modes by default, allowing users to choose which modes to activate).
-- This README.md, which offers extensive recommendations for customizing your Emacs configuration.
+Why minimal-emacs.d?
+- **Minimal yet powerful:** No unnecessary abstractions, just a solid starting point.
+- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
+- **No forced modes:** Unlike larger frameworks, minimal-emacs.d doesn’t preconfigure your environment. YOU decide the modes to enable.
+- **Customizable foundation:** Designed to be extended, not replaced. (This README.md offers extensive recommendations for customizing your minimal-emacs.d configuration.)
*(More information about the features can be found here: [Features](#features))*
-Creating *minimal-emacs.d* `init.el` and `early-init.el` involved extensive research and testing to find the best parameters and optimizations for an Emacs init file. The concept behind *minimal-emacs.d* is to provide a clean, bloat-free, fast base. The **minimal-emacs.d** provides a minimal base that is optimized. From there, users are encouraged to consult this README.md to customize and extend the configuration based on their specific needs. (Read: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))
+Building *minimal-emacs.d*’s `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. The goal? A **clean, bloat-free, and highly efficient** base that **prioritizes speed and flexibility** without unnecessary overhead.
-The author is using **[minimal-emacs.d](https://github.com/jamescherti/minimal-emacs.d)** as his `early-init.el` and `init.el`. He is using 146 packages ([Here are some of the packages the author is using](https://www.jamescherti.com/essential-emacs-packages/)) and his Emacs configuration starts in 0.22 seconds:
+With *minimal-emacs.d*, you start with a **minimal yet optimized** foundation, designed to be extended. Instead of battling preconfigured complexity, you’re free to adapt it to your needs. **(Reminder: [Never modify `init.el` or `early-init.el`—customize these files instead.](#never-modify-initel-and-early-initel-modify-these-instead))**
+
+The author uses **[minimal-emacs.d](https://github.com/jamescherti/minimal-emacs.d)** as his `early-init.el` and `init.el`, alongside **146 packages** ([See some of them here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:

-(The optimizations in *minimal-emacs.d* significantly contribute to speeding up Emacs startup. Additional factors include deferring package loading when not necessary on startup by using `:defer t` with `use-package`, and using [compile-angel](https://github.com/jamescherti/compile-angel.el) to ensure all `.el` files are byte-compiled and native-compiled. The author also regularly uses `M-x list-timers` and `M-x describe-mode` for each file type to ensure only essential modes and timers are active, which helps optimize Emacs' performance)
+The optimizations in *minimal-emacs.d* play a key role in **drastically improving startup time**, but additional techniques contribute as well:
+- **Defer package loading** – Using `:defer t` in `use-package` ensures unnecessary packages don’t load at startup.
+- **Byte and native compilation** – [compile-angel](https://github.com/jamescherti/compile-angel.el) keeps `.el` files optimized for performance.
+- **Aggressive runtime trimming** – Regular use of `M-x list-timers` and `M-x describe-mode` ensures that only **essential timers and modes** remain active.
## Table of Contents
From 0ba9d40cc94ddafeb1e20da7519ece727ad63e31 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:17:24 -0500
Subject: [PATCH 022/172] Update README.md
---
README.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index afbde4f..d5c5dbb 100644
--- a/README.md
+++ b/README.md
@@ -3,19 +3,19 @@
The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
-Why minimal-emacs.d?
-- **Minimal yet powerful:** No unnecessary abstractions, just a solid starting point.
+**Why minimal-emacs.d?**
+- **Minimal yet powerful:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
-- **No forced modes:** Unlike larger frameworks, minimal-emacs.d doesn’t preconfigure your environment. YOU decide the modes to enable.
-- **Customizable foundation:** Designed to be extended, not replaced. (This README.md offers extensive recommendations for customizing your minimal-emacs.d configuration.)
+- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn’t preconfigure your environment. YOU decide the global/minor modes to enable.
+- **Customizable foundation:** Designed to be extended, not replaced. (This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration.)
*(More information about the features can be found here: [Features](#features))*
-Building *minimal-emacs.d*’s `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. The goal? A **clean, bloat-free, and highly efficient** base that **prioritizes speed and flexibility** without unnecessary overhead.
+Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. The goal? A **clean, bloat-free, and highly efficient** base that **prioritizes speed and flexibility** without unnecessary overhead.
-With *minimal-emacs.d*, you start with a **minimal yet optimized** foundation, designed to be extended. Instead of battling preconfigured complexity, you’re free to adapt it to your needs. **(Reminder: [Never modify `init.el` or `early-init.el`—customize these files instead.](#never-modify-initel-and-early-initel-modify-these-instead))**
+With *minimal-emacs.d*, you start with a **minimal yet optimized** foundation, designed to be extended. Instead of battling preconfigured complexity, you’re free to adapt it to your needs. **(Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))**
-The author uses **[minimal-emacs.d](https://github.com/jamescherti/minimal-emacs.d)** as his `early-init.el` and `init.el`, alongside **146 packages** ([See some of them here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
+The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:

The optimizations in *minimal-emacs.d* play a key role in **drastically improving startup time**, but additional techniques contribute as well:
From ef573856150239c90f4cba52ddddb49405498013 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:22:48 -0500
Subject: [PATCH 023/172] Update README.md
---
README.md | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index d5c5dbb..bcd569c 100644
--- a/README.md
+++ b/README.md
@@ -3,26 +3,19 @@
The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
+Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file.
+
**Why minimal-emacs.d?**
- **Minimal yet powerful:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
-- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn’t preconfigure your environment. YOU decide the global/minor modes to enable.
-- **Customizable foundation:** Designed to be extended, not replaced. (This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration.)
+- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn't enable modes. YOU decide the global/minor modes to enable.
+- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead)
*(More information about the features can be found here: [Features](#features))*
-Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. The goal? A **clean, bloat-free, and highly efficient** base that **prioritizes speed and flexibility** without unnecessary overhead.
-
-With *minimal-emacs.d*, you start with a **minimal yet optimized** foundation, designed to be extended. Instead of battling preconfigured complexity, you’re free to adapt it to your needs. **(Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))**
-
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:

-The optimizations in *minimal-emacs.d* play a key role in **drastically improving startup time**, but additional techniques contribute as well:
-- **Defer package loading** – Using `:defer t` in `use-package` ensures unnecessary packages don’t load at startup.
-- **Byte and native compilation** – [compile-angel](https://github.com/jamescherti/compile-angel.el) keeps `.el` files optimized for performance.
-- **Aggressive runtime trimming** – Regular use of `M-x list-timers` and `M-x describe-mode` ensures that only **essential timers and modes** remain active.
-
## Table of Contents
@@ -520,7 +513,7 @@ Evil-snipe provides 2-character motions for quickly jumping around text compared
### Configuring LSP Servers with Eglot (built-in)
-To set up Language Server Protocol (LSP) servers using Eglot, you can configure it in your Emacs setup as follows. This configuration ensures minimal disruption from Eglot’s progress reporting and optimizes performance by disabling unnecessary logging.
+To set up Language Server Protocol (LSP) servers using Eglot, you can configure it in your Emacs setup as follows. This configuration ensures minimal disruption from Eglot's progress reporting and optimizes performance by disabling unnecessary logging.
To configure `eglot`, add the following to `~/.emacs.d/post-init.el`:
``` emacs-lisp
@@ -1108,7 +1101,7 @@ Other Emacs packages by the same author:
- [compile-angel.el](https://github.com/jamescherti/compile-angel.el): **Speed up Emacs!** This package guarantees that all .el files are both byte-compiled and native-compiled, which significantly speeds up Emacs.
- [outline-indent.el](https://github.com/jamescherti/outline-indent.el): An Emacs package that provides a minor mode that enables code folding and outlining based on indentation levels for various indentation-based text files, such as YAML, Python, and other indented text files.
- [easysession.el](https://github.com/jamescherti/easysession.el): Easysession is lightweight Emacs session manager that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, the tab-bar, and the Emacs frames (with or without the Emacs frames size, width, and height).
-- [vim-tab-bar.el](https://github.com/jamescherti/vim-tab-bar.el): Make the Emacs tab-bar Look Like Vim’s Tab Bar.
+- [vim-tab-bar.el](https://github.com/jamescherti/vim-tab-bar.el): Make the Emacs tab-bar Look Like Vim's Tab Bar.
- [elispcomp](https://github.com/jamescherti/elispcomp): A command line tool that allows compiling Elisp code directly from the terminal or from a shell script. It facilitates the generation of optimized .elc (byte-compiled) and .eln (native-compiled) files.
- [tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el): The Tomorrow Night Deepblue Emacs theme is a beautiful deep blue variant of the Tomorrow Night theme, which is renowned for its elegant color palette that is pleasing to the eyes. It features a deep blue background color that creates a calming atmosphere. The theme is also a great choice for those who miss the blue themes that were trendy a few years ago.
- [Ultyas](https://github.com/jamescherti/ultyas/): A command-line tool designed to simplify the process of converting code snippets from UltiSnips to YASnippet format.
From 3895b25d9f63b186211ed4287dc6c4de072437f6 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:23:11 -0500
Subject: [PATCH 024/172] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index bcd569c..d42668f 100644
--- a/README.md
+++ b/README.md
@@ -14,6 +14,7 @@ Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **ext
*(More information about the features can be found here: [Features](#features))*
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
+

From bfb59c238a8b21b2351acb0628c51c7f2fc411bd Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:24:52 -0500
Subject: [PATCH 025/172] Update README.md
---
README.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/README.md b/README.md
index d42668f..15409c7 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
-Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file.
+Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)*
**Why minimal-emacs.d?**
- **Minimal yet powerful:** A solid starting point.
@@ -11,8 +11,6 @@ Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **ext
- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn't enable modes. YOU decide the global/minor modes to enable.
- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead)
-*(More information about the features can be found here: [Features](#features))*
-
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:

From d5f120739c9ce46f75933a4cd5a6767356570507 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:26:32 -0500
Subject: [PATCH 026/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 15409c7..ff43c4b 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **ext
- **Minimal yet powerful:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn't enable modes. YOU decide the global/minor modes to enable.
-- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead)
+- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
From 45b407c8132eb126b5c6fd6741fcf7f9a6870d34 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:29:13 -0500
Subject: [PATCH 027/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index ff43c4b..78fc401 100644
--- a/README.md
+++ b/README.md
@@ -64,8 +64,8 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
## Install minimal-emacs.d
-- **Important:** Ensure that the *~/.emacs* and *~/.emacs.el* files do not exist. These files takes precedence over *init.el*, causing Emacs to ignore the *init.el* file that is in the *~/.emacs.d/* directory or any other directory specified with the *--init-directory* Emacs command-line argument. This behavior is due to the way Emacs searches for initialization files ([more information](https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init)). **Simply delete the *~/.emacs* and *~/.emacs.el* files avoid this issue.**
-- Prerequisite: git
+- **Important:** Ensure that the `~/.emacs` and `~/.emacs.el` files do not exist. These files cause Emacs to ignore `~/.emacs.d/init.el`. This behavior is due to the way Emacs searches for initialization files ([more information](https://www.gnu.org/software/emcs/manual/html_node/emacs/Find-Init.html#Find-Init)). **Simply delete the *~/.emacs* and *~/.emacs.el* files avoid this issue.**
+- **Prerequisite:** git
### Install minimal-emacs.d into `~/.emacs.d`
From fccc7fb9898db0a611a68d512323b361bc0cff96 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:32:32 -0500
Subject: [PATCH 028/172] Update README.md
---
README.md | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 78fc401..c6014f3 100644
--- a/README.md
+++ b/README.md
@@ -131,13 +131,9 @@ These settings control the visibility of dialogs, context menus, toolbars, menu
### Compile-Angel - Speed up Emacs by Automatically Byte-compiling and Native-compiling all .el files
-The [compile-angel.el](https://github.com/jamescherti/compile-angel.el) package automatically byte-compiles and native-compiles Emacs Lisp libraries. It offers:
-- `(compile-angel-on-load-mode)`: A global mode that compiles .el files before they are loaded.
-- `(compile-angel-on-save-local-mode)`: A local mode that compiles .el files whenever the user saves them.
+The [compile-angel.el](https://github.com/jamescherti/compile-angel.el) ensures all libraries are byte-compiled and native-compiled**. Byte-compilation reduces the overhead of loading Emacs Lisp code at runtime, while native compilation optimizes performance by generating machine code specific to your system.
-The *compile-angel* modes **speed up Emacs by ensuring all libraries are byte-compiled and native-compiled**. Byte-compilation reduces the overhead of loading Emacs Lisp code at runtime, while native compilation optimizes performance by generating machine code specific to your system.
-
-To install compile-angel, add the following code **at the very beginning of your ~/.emacs.d/post-init.el init.el file, before all other packages**:
+To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
```emacs-lisp
(use-package compile-angel
:ensure t
@@ -147,8 +143,11 @@ To install compile-angel, add the following code **at the very beginning of your
;; Drawback: The minibuffer will not display compile-angel's actions.
(setq compile-angel-verbose t)
- (compile-angel-on-load-mode)
- (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode))
+ ;; A local mode that compiles .el files whenever the user saves them.
+ ;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
+
+ ;; A global mode that compiles .el files before they are loaded.
+ (compile-angel-on-load-mode))
```
### Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`
From 4da7ae8c016c8215baaaade13fca617efafd4fd8 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:35:48 -0500
Subject: [PATCH 029/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index c6014f3..761bbc1 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Why did the author develop minimal-emacs.d?](#why-did-the-author-develop-minimal-emacsd)
- [How to keep minimal-emacs.d pre-\*.el and post-\*.el files in a separate directory?](#how-to-keep-minimal-emacsd-pre-el-and-post-el-files-in-a-separate-directory)
- [How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase?](#how-to-make-minimal-emacsd-install-packages-in-the-early-init-phase-instead-of-the-init-phase)
- - [Are there any comments from users?](#are-there-any-comments-from-users)
+ - [Comments from users](#comments-from-users)
- [Features](#features)
- [Author and license](#author-and-license)
- [Links](#links)
@@ -1023,7 +1023,7 @@ To install and load packages during the early-init phase, add the following to `
A drawback of using the early-init phase instead of init is that if a package fails (e.g, due to a network issue), no output will be displayed in the Emacs GUI. You will need to open a terminal to view Emacs's stdout for error messages.
-### Are there any comments from users?
+### Comments from users
- [JamesBrickley (Shout out to this starter-kit: Minimal-Emacs )](https://www.reddit.com/r/emacs/comments/1epz7qn/shout_out_to_this_starterkit_minimalemacs/) appreciates that *minimal-emacs.d* provides an optimized *early-init.el* and *init.el* for fast startup times and sensible default settings. He highlights that the project includes all the essential configurations needed for a well-tuned Emacs setup, eliminating the need to sift through conflicting advice on topics like garbage collection optimization. While he has encountered similar settings before, he also discovered new optimizations he had not seen elsewhere.
- [Leading_Ad6415 commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lmw7ijd/) that after switching to *minimal-emacs.d*, their configuration execution time decreased from 3 seconds to just 1 second by simply replacing their `init.el` and `early-init.el` files with those from the project.
From a34306aa92dea12854b3cc0895584a80364bc824 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:38:22 -0500
Subject: [PATCH 030/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 761bbc1..e06c78e 100644
--- a/README.md
+++ b/README.md
@@ -587,6 +587,8 @@ Corfu enhances in-buffer completion by displaying a compact popup with current c
Cape, or Completion At Point Extensions, extends the capabilities of in-buffer completion. It integrates with Corfu or the default completion UI, by providing additional backends through completion-at-point-functions.
+
+
To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`:
``` emacs-lisp
(use-package corfu
From 7ad2f651fa9b3e83170a68fe9b591df9ad79fe27 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:41:42 -0500
Subject: [PATCH 031/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index e06c78e..7ed8cb8 100644
--- a/README.md
+++ b/README.md
@@ -228,6 +228,8 @@ To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
Vertico, Consult, and Embark collectively enhance Emacs' completion and navigation capabilities. Vertico provides a vertical completion interface, making it easier to navigate and select from completion candidates (e.g., when `M-x` is pressed). Consult offers a suite of commands for efficient searching, previewing, and interacting with buffers, file contents, and more, improving various tasks. Embark integrates with these tools to provide context-sensitive actions and quick access to commands based on the current selection, further improving user efficiency and workflow within Emacs. Together, they create a cohesive and powerful environment for managing completions and interactions.
+
+
Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and Embark:
``` emacs-lisp
(use-package vertico
From c0187a1d646108b0173f5c4970c6186f5e90bd8c Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:45:17 -0500
Subject: [PATCH 032/172] Update README.md
---
README.md | 110 +++++++++++++++++++++++++++---------------------------
1 file changed, 55 insertions(+), 55 deletions(-)
diff --git a/README.md b/README.md
index 7ed8cb8..9613fb1 100644
--- a/README.md
+++ b/README.md
@@ -31,13 +31,13 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Optimization: Native Compilation](#optimization-native-compilation)
- - [How to configure vterm](#how-to-configure-vterm)
+ - [Code completion with corfu](#code-completion-with-corfu)
- [How to configure Vertico, Consult, and Embark](#how-to-configure-vertico-consult-and-embark)
- [Code Folding](#code-folding)
+ - [How to configure vterm](#how-to-configure-vterm)
- [How to configure Vim keybindings using Evil?](#how-to-configure-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
- [Session Management](#session-management)
- - [Code completion with corfu](#code-completion-with-corfu)
- [Inhibit the mouse](#inhibit-the-mouse)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhance the Elisp development experience](#enhance-the-elisp-development-experience)
@@ -207,22 +207,48 @@ Check if native compilation is enabled by evaluating `(native-comp-available-p)`
Native compilation can greatly enhance performance by translating Emacs Lisp code into native machine code, leading to faster execution and improved responsiveness.
-### How to configure vterm
+### Code completion with corfu
-The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
+Corfu enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down.
-To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
+Cape, or Completion At Point Extensions, extends the capabilities of in-buffer completion. It integrates with Corfu or the default completion UI, by providing additional backends through completion-at-point-functions.
+
+
+
+To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`:
``` emacs-lisp
-(use-package vterm
+(use-package corfu
:ensure t
:defer t
- :commands vterm
- :config
- ;; Speed up vterm
- (setq vterm-timer-delay 0.01))
-```
+ :commands (corfu-mode global-corfu-mode)
-(Note that the `emacs-vterm` Emacs package requires compilation of its C components, which includes the gcc compiler and the `libvterm` library. On Debian or Ubuntu systems, the necessary packages can be installed with: `sudo apt-get install build-essential libvterm-dev libtool-bin cmake`)
+ :hook ((prog-mode . corfu-mode)
+ (shell-mode . corfu-mode)
+ (eshell-mode . corfu-mode))
+
+ :custom
+ ;; Hide commands in M-x which do not apply to the current mode.
+ (read-extended-command-predicate #'command-completion-default-include-p)
+ ;; Disable Ispell completion function. As an alternative try `cape-dict'.
+ (text-mode-ispell-word-completion nil)
+ (tab-always-indent 'complete)
+
+ ;; Enable Corfu
+ :config
+ (global-corfu-mode))
+
+(use-package cape
+ :ensure t
+ :defer t
+ :commands (cape-dabbrev cape-file cape-elisp-block)
+ :bind ("C-c p" . cape-prefix-map)
+ :init
+ ;; Add to the global default value of `completion-at-point-functions' which is
+ ;; used by `completion-at-point'.
+ (add-hook 'completion-at-point-functions #'cape-dabbrev)
+ (add-hook 'completion-at-point-functions #'cape-file)
+ (add-hook 'completion-at-point-functions #'cape-elisp-block))
+```
### How to configure Vertico, Consult, and Embark
@@ -398,6 +424,23 @@ In addition to code folding, *outline-indent* also allows: moving indented block

+### How to configure vterm
+
+The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
+
+To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
+``` emacs-lisp
+(use-package vterm
+ :ensure t
+ :defer t
+ :commands vterm
+ :config
+ ;; Speed up vterm
+ (setq vterm-timer-delay 0.01))
+```
+
+(Note that the `emacs-vterm` Emacs package requires compilation of its C components, which includes the gcc compiler and the `libvterm` library. On Debian or Ubuntu systems, the necessary packages can be installed with: `sudo apt-get install build-essential libvterm-dev libtool-bin cmake`)
+
### How to configure Vim keybindings using Evil?
Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up Evil mode:
@@ -583,49 +626,6 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`:
(add-hook 'emacs-startup-hook #'easysession-save-mode 103))
```
-### Code completion with corfu
-
-Corfu enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down.
-
-Cape, or Completion At Point Extensions, extends the capabilities of in-buffer completion. It integrates with Corfu or the default completion UI, by providing additional backends through completion-at-point-functions.
-
-
-
-To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`:
-``` emacs-lisp
-(use-package corfu
- :ensure t
- :defer t
- :commands (corfu-mode global-corfu-mode)
-
- :hook ((prog-mode . corfu-mode)
- (shell-mode . corfu-mode)
- (eshell-mode . corfu-mode))
-
- :custom
- ;; Hide commands in M-x which do not apply to the current mode.
- (read-extended-command-predicate #'command-completion-default-include-p)
- ;; Disable Ispell completion function. As an alternative try `cape-dict'.
- (text-mode-ispell-word-completion nil)
- (tab-always-indent 'complete)
-
- ;; Enable Corfu
- :config
- (global-corfu-mode))
-
-(use-package cape
- :ensure t
- :defer t
- :commands (cape-dabbrev cape-file cape-elisp-block)
- :bind ("C-c p" . cape-prefix-map)
- :init
- ;; Add to the global default value of `completion-at-point-functions' which is
- ;; used by `completion-at-point'.
- (add-hook 'completion-at-point-functions #'cape-dabbrev)
- (add-hook 'completion-at-point-functions #'cape-file)
- (add-hook 'completion-at-point-functions #'cape-elisp-block))
-```
-
### Inhibit the mouse
The **inhibit-mouse** package disables mouse input in Emacs.
From bc3c35c0b623aef8db7a1eb61f11308825ca1940 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:46:55 -0500
Subject: [PATCH 033/172] Update README.md
---
README.md | 43 +++++++++++++++++++------------------------
1 file changed, 19 insertions(+), 24 deletions(-)
diff --git a/README.md b/README.md
index 9613fb1..11f97da 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,6 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Customizations](#customizations)
- [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead)
- [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips)
- - [Compile-Angel - Speed up Emacs by Automatically Byte-compiling and Native-compiling all .el files](#compile-angel---speed-up-emacs-by-automatically-byte-compiling-and-native-compiling-all-el-files)
- [Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar)
- [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
@@ -129,27 +128,6 @@ To customize your Emacs setup to include various user interface elements, you ca
These settings control the visibility of dialogs, context menus, toolbars, menu bars, and tooltips.
-### Compile-Angel - Speed up Emacs by Automatically Byte-compiling and Native-compiling all .el files
-
-The [compile-angel.el](https://github.com/jamescherti/compile-angel.el) ensures all libraries are byte-compiled and native-compiled**. Byte-compilation reduces the overhead of loading Emacs Lisp code at runtime, while native compilation optimizes performance by generating machine code specific to your system.
-
-To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
-```emacs-lisp
-(use-package compile-angel
- :ensure t
- :demand t
- :config
- ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
- ;; Drawback: The minibuffer will not display compile-angel's actions.
- (setq compile-angel-verbose t)
-
- ;; A local mode that compiles .el files whenever the user saves them.
- ;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
-
- ;; A global mode that compiles .el files before they are loaded.
- (compile-angel-on-load-mode))
-```
-
### Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`
Emacs, by default, stores various configuration files, caches, backups, and other data in the `~/.emacs.d` directory. Over time, this directory can become cluttered with numerous files, making it difficult to manage and maintain.
@@ -203,9 +181,26 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
### Optimization: Native Compilation
-Check if native compilation is enabled by evaluating `(native-comp-available-p)` in Emacs. If the result is non-nil, it indicates that native compilation is active.
+Native compilation can greatly enhance performance by translating Emacs Lisp code into native machine code, leading to faster execution and improved responsiveness. Check if native compilation is enabled by evaluating `(native-comp-available-p)` in Emacs. If the result is non-nil, it indicates that native compilation is active.
-Native compilation can greatly enhance performance by translating Emacs Lisp code into native machine code, leading to faster execution and improved responsiveness.
+Also, ensures all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el).
+
+To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
+```emacs-lisp
+(use-package compile-angel
+ :ensure t
+ :demand t
+ :config
+ ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
+ ;; Drawback: The minibuffer will not display compile-angel's actions.
+ (setq compile-angel-verbose t)
+
+ ;; A local mode that compiles .el files whenever the user saves them.
+ ;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
+
+ ;; A global mode that compiles .el files before they are loaded.
+ (compile-angel-on-load-mode))
+```
### Code completion with corfu
From e7fb57cbbf6324b9b7d1098f8211b4ae792fef66 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:48:43 -0500
Subject: [PATCH 034/172] Update README.md
---
README.md | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 11f97da..74f1d6d 100644
--- a/README.md
+++ b/README.md
@@ -181,11 +181,9 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
### Optimization: Native Compilation
-Native compilation can greatly enhance performance by translating Emacs Lisp code into native machine code, leading to faster execution and improved responsiveness. Check if native compilation is enabled by evaluating `(native-comp-available-p)` in Emacs. If the result is non-nil, it indicates that native compilation is active.
+1. Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
-Also, ensures all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el).
-
-To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
+2. **Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el).** To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
```emacs-lisp
(use-package compile-angel
:ensure t
From ca46d240f85080fcd2438c3ae8fcaa0716beae59 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:49:16 -0500
Subject: [PATCH 035/172] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 74f1d6d..18e2bf8 100644
--- a/README.md
+++ b/README.md
@@ -181,7 +181,9 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
### Optimization: Native Compilation
-1. Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
+Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness.
+
+1. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
2. **Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el).** To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
```emacs-lisp
From b4b67a1b8ffb4c3e8926db52d7e9bccd8e1a9a4b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:50:15 -0500
Subject: [PATCH 036/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 18e2bf8..b4137f3 100644
--- a/README.md
+++ b/README.md
@@ -185,7 +185,7 @@ Native compilation enhances Emacs performance by converting Elisp code into nati
1. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
-2. **Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el).** To install compile-angel, add the following code **at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages**:
+2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages:
```emacs-lisp
(use-package compile-angel
:ensure t
From e8204196ca5942e186ec10b274f50926beca8f8e Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:50:54 -0500
Subject: [PATCH 037/172] Update README.md
---
README.md | 48 ++++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/README.md b/README.md
index b4137f3..aee08dc 100644
--- a/README.md
+++ b/README.md
@@ -28,8 +28,8 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips)
- [Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar)
- [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel)
- - [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Optimization: Native Compilation](#optimization-native-compilation)
+ - [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Code completion with corfu](#code-completion-with-corfu)
- [How to configure Vertico, Consult, and Embark](#how-to-configure-vertico-consult-and-embark)
- [Code Folding](#code-folding)
@@ -150,6 +150,29 @@ To prevent Emacs from saving customization information to a custom file, set `cu
(setq custom-file null-device)
```
+### Optimization: Native Compilation
+
+Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness.
+
+1. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
+
+2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages:
+```emacs-lisp
+(use-package compile-angel
+ :ensure t
+ :demand t
+ :config
+ ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
+ ;; Drawback: The minibuffer will not display compile-angel's actions.
+ (setq compile-angel-verbose t)
+
+ ;; A local mode that compiles .el files whenever the user saves them.
+ ;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
+
+ ;; A global mode that compiles .el files before they are loaded.
+ (compile-angel-on-load-mode))
+```
+
### How to activate recentf, savehist, saveplace, and auto-revert?
The recentf, savehist, saveplace, and auto-revert built-in packages are already configured by *minimal-emacs.d*. All you need to do is activate them by adding the following to `~/.emacs.d/post-init.el`:
@@ -179,29 +202,6 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
(add-hook 'after-init-hook #'save-place-mode)
```
-### Optimization: Native Compilation
-
-Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness.
-
-1. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
-
-2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages:
-```emacs-lisp
-(use-package compile-angel
- :ensure t
- :demand t
- :config
- ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
- ;; Drawback: The minibuffer will not display compile-angel's actions.
- (setq compile-angel-verbose t)
-
- ;; A local mode that compiles .el files whenever the user saves them.
- ;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
-
- ;; A global mode that compiles .el files before they are loaded.
- (compile-angel-on-load-mode))
-```
-
### Code completion with corfu
Corfu enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down.
From f9b464d4890a89063145479f63a1dddddb5416e2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 20:52:16 -0500
Subject: [PATCH 038/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index aee08dc..1656b15 100644
--- a/README.md
+++ b/README.md
@@ -158,6 +158,8 @@ Native compilation enhances Emacs performance by converting Elisp code into nati
2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages:
```emacs-lisp
+;; Ensure adding the following compile-angel code at the very beginning
+;; of your `~/.emacs.d/post-init.el` file, before all other packages.
(use-package compile-angel
:ensure t
:demand t
From 89fa53e9b34b3cc74488ff6a50116190e6dac3e1 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 21:14:01 -0500
Subject: [PATCH 039/172] Update README.md
---
README.md | 47 +++++++++++++++++++++++++++++++++++------------
1 file changed, 35 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 1656b15..a09f9eb 100644
--- a/README.md
+++ b/README.md
@@ -31,17 +31,18 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Optimization: Native Compilation](#optimization-native-compilation)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Code completion with corfu](#code-completion-with-corfu)
- - [How to configure Vertico, Consult, and Embark](#how-to-configure-vertico-consult-and-embark)
+ - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code Folding](#code-folding)
- - [How to configure vterm](#how-to-configure-vterm)
- - [How to configure Vim keybindings using Evil?](#how-to-configure-vim-keybindings-using-evil)
+ - [Configuring vterm](#configuring-vterm)
+ - [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
- [Session Management](#session-management)
+ - [Configuring org-mode](#configuring-org-mode)
- [Inhibit the mouse](#inhibit-the-mouse)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- - [Enhance the Elisp development experience](#enhance-the-elisp-development-experience)
- - [How to configure straight.el?](#how-to-configure-straightel)
- - [How to configure elpaca (package manager)](#how-to-configure-elpaca-package-manager)
+ - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
+ - [Configuring straight.el?](#configuring-straightel)
+ - [Configuring elpaca (package manager)](#configuring-elpaca-package-manager)
- [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
- [Frequently asked questions](#frequently-asked-questions)
- [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations)
@@ -247,7 +248,7 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`:
(add-hook 'completion-at-point-functions #'cape-elisp-block))
```
-### How to configure Vertico, Consult, and Embark
+### Configuring Vertico, Consult, and Embark
Vertico, Consult, and Embark collectively enhance Emacs' completion and navigation capabilities. Vertico provides a vertical completion interface, making it easier to navigate and select from completion candidates (e.g., when `M-x` is pressed). Consult offers a suite of commands for efficient searching, previewing, and interacting with buffers, file contents, and more, improving various tasks. Embark integrates with these tools to provide context-sensitive actions and quick access to commands based on the current selection, further improving user efficiency and workflow within Emacs. Together, they create a cohesive and powerful environment for managing completions and interactions.
@@ -421,7 +422,7 @@ In addition to code folding, *outline-indent* also allows: moving indented block

-### How to configure vterm
+### Configuring vterm
The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
@@ -438,7 +439,7 @@ To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
(Note that the `emacs-vterm` Emacs package requires compilation of its C components, which includes the gcc compiler and the `libvterm` library. On Debian or Ubuntu systems, the necessary packages can be installed with: `sudo apt-get install build-essential libvterm-dev libtool-bin cmake`)
-### How to configure Vim keybindings using Evil?
+### Configuring Vim keybindings using Evil?
Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up Evil mode:
@@ -623,6 +624,28 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`:
(add-hook 'emacs-startup-hook #'easysession-save-mode 103))
```
+### Configuring org-mode
+
+To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`:
+```elisp
+(use-package org
+ :ensure t
+ :defer t
+ :commands (org-mode org-version)
+ :mode
+ ("\\.org\\'" . org-mode)
+ :custom
+ (org-hide-leading-stars t)
+ (org-startup-indented t)
+ (org-adapt-indentation nil)
+ (org-edit-src-content-indentation 0)
+ (org-startup-truncated nil)
+ (org-fontify-done-headline t)
+ (org-fontify-todo-headline t)
+ (org-fontify-whole-heading-line t)
+ (org-fontify-quote-and-verse-blocks t))
+```
+
### Inhibit the mouse
The **inhibit-mouse** package disables mouse input in Emacs.
@@ -665,7 +688,7 @@ To configure **helpful**, add the following to `~/.emacs.d/post-init.el`:
(helpful-max-buffers 7))
```
-### Enhance the Elisp development experience
+### Enhancing the Elisp development experience
To enhance the Elisp development experience, add the following to `~/.emacs.d/post-init.el`:
```emacs-lisp
@@ -745,7 +768,7 @@ Other optional packages that may be useful include:
elisp-refs-symbol))
```
-### How to configure straight.el?
+### Configuring straight.el?
[Add the straight.el bootstrap code](https://github.com/radian-software/straight.el?tab=readme-ov-file#getting-started) to `~/.emacs.d/pre-init.el`:
``` emacs-lisp
@@ -767,7 +790,7 @@ Other optional packages that may be useful include:
(load bootstrap-file nil 'nomessage))
```
-### How to configure elpaca (package manager)
+### Configuring elpaca (package manager)
Add to `~/.emacs.d/pre-early-init.el`:
```elisp
From b10686726ec78f5cfd747be344ce4ee1f44dcfb3 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 5 Mar 2025 11:54:39 -0500
Subject: [PATCH 040/172] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index a09f9eb..a041dd7 100644
--- a/README.md
+++ b/README.md
@@ -65,6 +65,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
## Install minimal-emacs.d
- **Important:** Ensure that the `~/.emacs` and `~/.emacs.el` files do not exist. These files cause Emacs to ignore `~/.emacs.d/init.el`. This behavior is due to the way Emacs searches for initialization files ([more information](https://www.gnu.org/software/emcs/manual/html_node/emacs/Find-Init.html#Find-Init)). **Simply delete the *~/.emacs* and *~/.emacs.el* files avoid this issue.**
+- **Debug:** If a package or any other functionality is not working as expected, start Emacs with `emacs --debug-init` to enable debug mode and obtain the backtrace.
- **Prerequisite:** git
### Install minimal-emacs.d into `~/.emacs.d`
From 1cf068590637600984bde6b57a10150ad99454e4 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 14:27:13 -0500
Subject: [PATCH 041/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index a041dd7..f28bc5a 100644
--- a/README.md
+++ b/README.md
@@ -145,6 +145,8 @@ An alternative lightweight approach is to simply change the default `~/.emacs.d`
(setq user-emacs-directory minimal-emacs-var-dir)
```
+IMPORTANT: The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files.
+
### How to prevent minimal-emacs.d from saving custom.el?
To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`:
From 69e524c71f5a8c0283632f612d31cf58c67b42b7 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 14:27:47 -0500
Subject: [PATCH 042/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f28bc5a..7680a01 100644
--- a/README.md
+++ b/README.md
@@ -145,7 +145,7 @@ An alternative lightweight approach is to simply change the default `~/.emacs.d`
(setq user-emacs-directory minimal-emacs-var-dir)
```
-IMPORTANT: The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files.
+**IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files.
### How to prevent minimal-emacs.d from saving custom.el?
From 16069e068fd14faf04b03183a032986f3f5e1972 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 2 Mar 2025 14:38:47 -0500
Subject: [PATCH 043/172] Update comments and the order of the settings
---
init.el | 81 +++++++++++++++++++++------------------------------------
1 file changed, 30 insertions(+), 51 deletions(-)
diff --git a/init.el b/init.el
index bb2b4b6..0081b32 100644
--- a/init.el
+++ b/init.el
@@ -116,7 +116,6 @@
(setq truncate-string-ellipsis "…")
;; Improve Emacs' responsiveness by delaying syntax highlighting during input
-;; but may reduce visual feedback.
(setq redisplay-skip-fontification-on-input t)
;; Collects and displays all available documentation immediately
@@ -135,12 +134,10 @@
(setq delete-by-moving-to-trash (not noninteractive))
(setq remote-file-name-inhibit-delete-by-moving-to-trash t)
-;; Disable the warning "X and Y are the same file". Ignoring this warning is
-;; acceptable since it will redirect you to the existing buffer regardless.
+;; Ignoring this is acceptable since it will redirect to the buffer regardless.
(setq find-file-suppress-same-file-warnings t)
-;; Resolve symlinks when opening files, so that any operations are conducted
-;; from the file's true directory (like `find-file').
+;; Resolve symlinks so that operations are conducted from the file's directory
(setq find-file-visit-truename t
vc-follow-symlinks t)
@@ -160,8 +157,7 @@
;;; Backup files
-;; Avoid generating backups or lockfiles to prevent creating world-readable
-;; copies of files.
+;; Avoid backups or lockfiles to prevent creating world-readable copies of files
(setq create-lockfiles nil)
(setq make-backup-files nil)
@@ -200,10 +196,12 @@
;; Auto save options
(setq kill-buffer-delete-auto-save-files t)
+;; Remove duplicates from the kill ring to reduce clutter
+(setq kill-do-not-save-duplicates t)
+
;;; Auto revert
-;; Auto-revert in Emacs is a feature that automatically updates the
-;; contents of a buffer to reflect changes made to the underlying file
-;; on disk.
+;; Auto-revert in Emacs is a feature that automatically updates the contents of
+;; a buffer to reflect changes made to the underlying file.
(setq revert-without-query (list ".") ; Do not prompt
auto-revert-stop-on-user-input nil
auto-revert-verbose t)
@@ -214,9 +212,8 @@
;;; recentf
-;; `recentf' is an Emacs package that maintains a list of recently
-;; accessed files, making it easier to reopen files you have worked on
-;; recently.
+;; `recentf' is an that maintains a list of recently accessed files, making it
+;; easier to reopen files you have worked on recently.
(setq recentf-max-saved-items 300) ; default is 20
(setq recentf-max-menu-items 15)
(setq recentf-auto-cleanup (if (daemonp) 300 'never))
@@ -227,8 +224,7 @@
;;; saveplace
;; `save-place-mode' enables Emacs to remember the last location within a file
-;; upon reopening. This feature is particularly beneficial for resuming work at
-;; the precise point where you previously left off.
+;; upon reopening.
(setq save-place-file (expand-file-name "saveplace" user-emacs-directory))
(setq save-place-limit 600)
@@ -276,22 +272,19 @@
;; window.
(setq scroll-preserve-screen-position t)
-;; Emacs spends excessive time recentering the screen when the cursor moves more
-;; than N lines past the window edges (where N is the value of
-;; `scroll-conservatively`). This can be particularly slow in larger files
-;; during extensive scrolling. If `scroll-conservatively` is set above 100, the
-;; window is never automatically recentered. The default value of 0 triggers
-;; recentering too aggressively. Setting it to 10 reduces excessive recentering
-;; and only recenters the window when scrolling significantly off-screen.
+;; Emacs spends excessive time recentering when the cursor moves more than N
+;; lines past the window edges (N is the value of `scroll-conservatively'). This
+;; can be slow in larger files. If `scroll-conservatively' is set above 100, the
+;; window is never automatically recentered.
(setq scroll-conservatively 101)
;; Enables smooth scrolling by making Emacs scroll the window by 1 line whenever
;; the cursor moves off the visible screen.
(setq scroll-step 1)
-;; Reduce cursor lag by :
-;; 1. Prevent automatic adjustments to `window-vscroll' for long lines.
-;; 2. Resolve the issue of random half-screen jumps during scrolling.
+;; Reduce cursor lag by:
+;; 1. Preventing automatic adjustments to `window-vscroll' for long lines.
+;; 2. Resolving the issue of random half-screen jumps during scrolling.
(setq auto-window-vscroll nil)
;; Number of lines of margin at the top and bottom of a window.
@@ -314,8 +307,6 @@
;; The blinking cursor is distracting and interferes with cursor settings in
;; some minor modes that try to change it buffer-locally (e.g., Treemacs).
-;; Additionally, it can cause freezing, especially on macOS, for users with
-;; customized and colored cursors.
(blink-cursor-mode -1)
;; Don't blink the paren matching the one at point, it's too distracting.
@@ -370,38 +361,30 @@
(setq read-extended-command-predicate #'command-completion-default-include-p)
;; Enable multi-line commenting which ensures that `comment-indent-new-line'
-;; properly continues comments onto new lines, which is useful for writing
-;; longer comments or docstrings that span multiple lines.
+;; properly continues comments onto new lines.
(setq comment-multi-line t)
+;; Ensures that empty lines within the commented region are also commented out.
+;; This prevents unintended visual gaps and maintains a consistent appearance.
+(setq comment-empty-lines t)
+
;; We often split terminals and editor windows or place them side-by-side,
;; making use of the additional horizontal space.
(setq-default fill-column 80)
-;; Disable the obsolete practice of end-of-line spacing from the
-;; typewriter era.
+;; Disable the obsolete practice of end-of-line spacing from the typewriter era.
(setq sentence-end-double-space nil)
-;; According to the POSIX, a line is defined as "a sequence of zero or
-;; more non-newline characters followed by a terminating newline".
+;; According to the POSIX, a line is defined as "a sequence of zero or more
+;; non-newline characters followed by a terminating newline".
(setq require-final-newline t)
-;; Remove duplicates from the kill ring to reduce clutter
-(setq kill-do-not-save-duplicates t)
-
-;; Ensures that empty lines within the commented region are also commented out.
-;; This prevents unintended visual gaps and maintains a consistent appearance,
-;; ensuring that comments apply uniformly to all lines, including those that are
-;; otherwise empty.
-(setq comment-empty-lines t)
-
;; Eliminate delay before highlighting search matches
(setq lazy-highlight-initial-delay 0)
;;; Modeline
-;; Setting `display-time-default-load-average' to nil makes Emacs omit the load
-;; average information from the mode line.
+;; Makes Emacs omit the load average information from the mode line.
(setq display-time-default-load-average nil)
;; Display the current line and column numbers in the mode line
@@ -552,13 +535,9 @@
;;; Remove warnings from narrow-to-region, upcase-region...
-(put 'list-timers 'disabled nil)
-(put 'narrow-to-region 'disabled nil)
-(put 'upcase-region 'disabled nil)
-(put 'downcase-region 'disabled nil)
-(put 'erase-buffer 'disabled nil)
-(put 'scroll-left 'disabled nil)
-(put 'dired-find-alternate-file 'disabled nil)
+(dolist (cmd '(list-timers narrow-to-region upcase-region downcase-region
+ erase-buffer scroll-left dired-find-alternate-file))
+ (put cmd 'disabled nil))
;;; Load post init
(minimal-emacs-load-user-init "post-init.el")
From 5a8fae45221cfdf30e7f899dd2bb68a108f81b19 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 5 Mar 2025 12:39:33 -0500
Subject: [PATCH 044/172] Add: auto-save-no-message
---
init.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/init.el b/init.el
index 0081b32..4fec987 100644
--- a/init.el
+++ b/init.el
@@ -182,6 +182,7 @@
;; `recover-file' or `recover-session' functions can be used to restore
;; auto-saved data.
(setq auto-save-default t)
+(setq auto-save-no-message t)
;; Do not auto-disable auto-save after deleting large chunks of
;; text. The purpose of auto-save is to provide a failsafe, and
From 944c74ef6a11ea1c7832922184e2112c83b888a2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 07:54:14 -0500
Subject: [PATCH 045/172] Disable auto-save and document it in README.md
---
README.md | 13 +++++++++++++
init.el | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 7680a01..9d548cf 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel)
- [Optimization: Native Compilation](#optimization-native-compilation)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
+ - [Activating autosave](#activating-autosave)
- [Code completion with corfu](#code-completion-with-corfu)
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code Folding](#code-folding)
@@ -208,6 +209,18 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
(add-hook 'after-init-hook #'save-place-mode)
```
+### Activating autosave
+
+Auto-save helps prevent data loss in case of crashes. You can restore auto-saved data using the `recover-file` or `recover-session` functions.
+
+To enable autosave, add the following to `~/.emacs.d/post-init.el`:
+
+```emacs-lisp
+;; Enable auto-save to prevent data loss. Use `recover-file` or
+;; `recover-session` to restore unsaved changes.
+(setq auto-save-default t)
+```
+
### Code completion with corfu
Corfu enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down.
diff --git a/init.el b/init.el
index 4fec987..a6fc989 100644
--- a/init.el
+++ b/init.el
@@ -181,7 +181,7 @@
;; Enable auto-save to safeguard against crashes or data loss. The
;; `recover-file' or `recover-session' functions can be used to restore
;; auto-saved data.
-(setq auto-save-default t)
+(setq auto-save-default nil)
(setq auto-save-no-message t)
;; Do not auto-disable auto-save after deleting large chunks of
From 5e4be5b8b23ec20c9f468e71adcea127581c9edd Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 08:04:57 -0500
Subject: [PATCH 046/172] Update README.md: code folding
---
README.md | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 9d548cf..38300da 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Activating autosave](#activating-autosave)
- [Code completion with corfu](#code-completion-with-corfu)
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- - [Code Folding](#code-folding)
+ - [Code folding](#code-folding)
- [Configuring vterm](#configuring-vterm)
- [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
@@ -412,26 +412,35 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E
(setq consult-narrow-key "<"))
```
-### Code Folding
+### Code folding
-The **outline-indent** Emacs package provides a minor mode that enables code folding based on indentation levels:
+The built-in `outline-minor-mode` provides structured code folding in modes such as Emacs Lisp and Python, allowing users to collapse and expand sections based on headings or indentation levels. This feature enhances navigation and improves the management of large files with hierarchical structures.
+
+Alternatively, `hs-minor-mode` offers basic code folding for blocks defined by curly braces, functions, or other language-specific delimiters. However, for more flexible folding that supports multiple nested levels, `outline-minor-mode` is generally the preferred choice, as it enables finer control over section visibility in deeply structured code.
+
+For example, to enable `outline-minor-mode` in Emacs Lisp:
+
+``` emacs-lisp
+(add-hook 'emacs-lisp-mode-hook #'outline-minor-mode)
+```
+
+For folding based on indentation levels, the **[outline-indent @GitHub](https://github.com/jamescherti/outline-indent.el)** Emacs package provides a minor mode that enables folding according to the indentation structure:
```elisp
(use-package outline-indent
:ensure t
:defer t
:commands outline-indent-minor-mode
+ :custom
+ (outline-indent-ellipsis " ▼ ")
+
:init
;; The minor mode can also be automatically activated for a certain modes.
- ;; For example for Python and YAML:
(add-hook 'python-mode-hook #'outline-indent-minor-mode)
(add-hook 'python-ts-mode-hook #'outline-indent-minor-mode)
(add-hook 'yaml-mode-hook #'outline-indent-minor-mode)
- (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode)
-
- :custom
- (outline-indent-ellipsis " ▼ "))
+ (add-hook 'yaml-ts-mode-hook #'outline-indent-minor-mode))
```
In addition to code folding, *outline-indent* also allows: moving indented blocks up and down, indenting/unindenting to adjust indentation levels, inserting a new line with the same indentation level as the current line, Move backward/forward to the indentation level of the current line, and more.
From 42f4458695b3d9e04186a3cd84607aef04ee0e9a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 08:19:27 -0500
Subject: [PATCH 047/172] Update README.md: auto save
---
README.md | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 38300da..28defa1 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,8 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Optimization: Native Compilation](#optimization-native-compilation)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Activating autosave](#activating-autosave)
+ - [auto-save-mode (Prevent data loss in case of crashes)](#auto-save-mode-prevent-data-loss-in-case-of-crashes)
+ - [auto-save-visited-mode (Save file buffers after a few seconds of inactivity)](#auto-save-visited-mode-save-file-buffers-after-a-few-seconds-of-inactivity)
- [Code completion with corfu](#code-completion-with-corfu)
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code folding](#code-folding)
@@ -211,14 +213,30 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
### Activating autosave
-Auto-save helps prevent data loss in case of crashes. You can restore auto-saved data using the `recover-file` or `recover-session` functions.
+#### auto-save-mode (Prevent data loss in case of crashes)
+
+Enabling `auto-save-mode` mitigates the risk of data loss in the event of a crash. Auto-saved data can be recovered using the `recover-file` or `recover-session` functions.
To enable autosave, add the following to `~/.emacs.d/post-init.el`:
```emacs-lisp
-;; Enable auto-save to prevent data loss. Use `recover-file` or
-;; `recover-session` to restore unsaved changes.
+;; Enable `auto-save-mode' to prevent data loss. Use `recover-file' or
+;; `recover-session' to restore unsaved changes.
(setq auto-save-default t)
+
+(setq auto-save-interval 300)
+(setq auto-save-timeout 30)
+```
+
+#### auto-save-visited-mode (Save file buffers after a few seconds of inactivity)
+
+When `auto-save-visited-mode` is enabled, Emacs will auto-save file-visiting buffers after a certain amount of idle time if the user forgets to save it with `save-buffer` or `C-x s` for example.
+
+This is different from `auto-save-mode`: `auto-save-mode` periodically saves all modified buffers, creating backup files, including those not associated with a file, while `auto-save-visited-mode` only saves file-visiting buffers after a period of idle time, directly saving to the file itself without creating backup files.
+
+``` emacs-lisp
+(setq auto-save-visited-interval 5) ; Save after 5 seconds if inactivity
+(auto-save-visited-mode 1)
```
### Code completion with corfu
From d0621e742c20ec1cb8c900165d75f2bf0a689f8b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 08:52:56 -0500
Subject: [PATCH 048/172] Update README.md
---
README.md | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/README.md b/README.md
index 28defa1..31ead54 100644
--- a/README.md
+++ b/README.md
@@ -48,6 +48,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Configuring elpaca (package manager)](#configuring-elpaca-package-manager)
- [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
- [Frequently asked questions](#frequently-asked-questions)
+ - [How to give more priority to MELPA over MELPA stable?](#how-to-give-more-priority-to-melpa-over-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 Emacs customizations?](#how-to-load-emacs-customizations)
- [How to increase gc-cons-threshold?](#how-to-increase-gc-cons-threshold)
@@ -981,6 +982,31 @@ It is also recommended to read the following articles:
## Frequently asked questions
+### How to give more priority to MELPA over MELPA stable?
+
+By default, the *minimal-emacs.d* configuration assigns specific priorities to various package archives, which determines the order in which packages are fetched from these archives. The default priorities are as follows:
+
+```elisp
+(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
+ ("nongnu" . 80)
+ ("melpa-stable" . 70)
+ ("melpa" . 0)))
+```
+
+In this configuration, the GNU, Nongnu, and MELPA Stable archives (which contain stable versions of MELPA packages) are assigned higher priorities than MELPA (which contains the latest versions of packages). As a result, packages will be fetched from MELPA Stable before MELPA.
+
+To prioritize MELPA over MELPA Stable, to access bleeding-edge package versions, you can adjust the `package-archive-priorities` variable accordingly:
+
+```elisp
+(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
+ ("nongnu" . 80)
+ ("melpa-stable" . 70)
+ ;; MELPA priority has been changed to 75
+ ("melpa" . 75)))
+```
+
+This change increases MELPA's priority to 75, above MELPA Stable's priority of 70, ensuring that MELPA is preferred for package installations over MELPA Stable.
+
### How to load a local lisp file for machine-specific configurations?
Add the following line to the end of your `post-init.el` file:
From 014da78e6f0e7dc3e53a7d93d14df3575b921be4 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 08:56:06 -0500
Subject: [PATCH 049/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 31ead54..e813305 100644
--- a/README.md
+++ b/README.md
@@ -984,6 +984,8 @@ It is also recommended to read the following articles:
### How to give more priority to MELPA over MELPA stable?
+**Warning:** MELPA Stable is generally more reliable and thoroughly tested, as it contains stable versions of packages. On the other hand, MELPA provides bleeding-edge versions, which often include new features but may also introduce changes that could potentially break functionality. The author of *minimal-emacs.d* uses MELPA over MELPA Stable without encountering issues, but this is provided as a caution to allow you to make an informed decision based on your stability versus feature needs.
+
By default, the *minimal-emacs.d* configuration assigns specific priorities to various package archives, which determines the order in which packages are fetched from these archives. The default priorities are as follows:
```elisp
From 1b06666446c169b8a41a4a2391b67df70f2f1db5 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 09:02:14 -0500
Subject: [PATCH 050/172] Update README.md
---
README.md | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e813305..fefb50d 100644
--- a/README.md
+++ b/README.md
@@ -1000,6 +1000,14 @@ In this configuration, the GNU, Nongnu, and MELPA Stable archives (which contain
To prioritize MELPA over MELPA Stable, to access bleeding-edge package versions, you can adjust the `package-archive-priorities` variable accordingly:
```elisp
+;; This change increases MELPA's priority to 75, above MELPA Stable's
+;; priority of 70, ensuring that MELPA is preferred for package installations
+;; over MELPA Stable.
+;;
+;; MELPA Stable offers reliable, tested versions, while MELPA provides newer
+;; features at the risk of potential instability; for your information,
+;; the author of minimal-emacs.d has been using MELPA (and not MELPA stable)
+;; for years without any major issues.
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
("melpa-stable" . 70)
@@ -1007,8 +1015,6 @@ To prioritize MELPA over MELPA Stable, to access bleeding-edge package versions,
("melpa" . 75)))
```
-This change increases MELPA's priority to 75, above MELPA Stable's priority of 70, ensuring that MELPA is preferred for package installations over MELPA Stable.
-
### How to load a local lisp file for machine-specific configurations?
Add the following line to the end of your `post-init.el` file:
From 6444c9ad2d10e13ae1cde80f415f7fca9e68faca Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 11:20:46 -0500
Subject: [PATCH 051/172] Update README.md: add doom-themes
---
README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/README.md b/README.md
index fefb50d..a6ba2e4 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Code completion with corfu](#code-completion-with-corfu)
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code folding](#code-folding)
+ - [Doom themes](#doom-themes)
- [Configuring vterm](#configuring-vterm)
- [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
@@ -466,6 +467,55 @@ In addition to code folding, *outline-indent* also allows: moving indented block

+### Doom themes
+
+The `doom-themes` package is an extensive collection of high-quality, visually appealing themes for Emacs, designed to offer a sleek and modern aesthetic, while drawing inspiration from popular community themes. It provides a wide range of color schemes suitable for various work environments and personal preferences, ensuring that users can enhance their Emacs experience with ease.
+
+To install and configure the `doom-themes` package, add the following configuration to the `~/.emacs.d/post-init.el` file, ensuring that the themes are available for use as soon as Emacs starts:
+
+```emacs-lisp
+(use-package doom-themes
+ :ensure t
+ :custom
+ (doom-themes-enable-bold t) ; if nil, bold is universally disabled
+ (doom-themes-enable-italic t) ; if nil, italics is universally disabled
+
+ :config
+ ;; Default theme:
+ (load-theme 'doom-one t)
+
+ ;; Alternative themes:
+ ;; -------------------
+ ;; (load-theme 'doom-gruvbox-light t)
+ ;; (load-theme 'doom-one t)
+ ;; (load-theme 'doom-1337 t)
+ ;; (load-theme 'doom-gruvbox t)
+ ;; (load-theme 'doom-solarized-light t)
+ ;; (load-theme 'doom-tomorrow-night t)
+ ;; (load-theme 'doom-tomorrow-day t)
+ ;; (load-theme 'doom-snazzy t)
+ ;; (load-theme 'doom-ir-black t)
+ ;; (load-theme 'doom-ayu-dark t)
+ ;; (load-theme 'doom-acario-light t)
+
+ ;; Enable custom neotree theme (nerd-icons must be installed):
+ ;; -----------------------------------------------------------
+ ;; (doom-themes-neotree-config)
+
+ ;; Treemacs users (use "doom-colors" for less minimal icon theme):
+ ;; ---------------------------------------------------------------
+ ;; (setq doom-themes-treemacs-theme "doom-atom")
+ ;; (doom-themes-treemacs-config)
+
+ ;; Enable flashing mode-line on errors:
+ ;; ------------------------------------
+ (doom-themes-visual-bell-config)
+
+ ;; Improves org-mode's native fontification:
+ ;; -----------------------------------------
+ (doom-themes-org-config))
+```
+
### Configuring vterm
The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
From 0b5690fdb02b3cb55d0d5c15fc50adea5ce3b761 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 11:27:01 -0500
Subject: [PATCH 052/172] Update README.md
---
README.md | 206 ++++++++++++++++++++++++++++--------------------------
1 file changed, 105 insertions(+), 101 deletions(-)
diff --git a/README.md b/README.md
index a6ba2e4..cf8f928 100644
--- a/README.md
+++ b/README.md
@@ -23,10 +23,9 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd)
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
- [Update minimal-emacs.d](#update-minimal-emacsd)
- - [Customizations](#customizations)
+ - [Customizations: post-init.el](#customizations-post-initel)
- [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead)
- [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips)
- - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar)
- [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel)
- [Optimization: Native Compilation](#optimization-native-compilation)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
@@ -45,9 +44,11 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Inhibit the mouse](#inhibit-the-mouse)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
+ - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
+ - [Customizations: pre-early-init.el](#customizations-pre-early-initel)
+ - [Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar)
- [Configuring straight.el?](#configuring-straightel)
- [Configuring elpaca (package manager)](#configuring-elpaca-package-manager)
- - [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
- [Frequently asked questions](#frequently-asked-questions)
- [How to give more priority to MELPA over MELPA stable?](#how-to-give-more-priority-to-melpa-over-melpa-stable)
- [How to load a local lisp file for machine-specific configurations?](#how-to-load-a-local-lisp-file-for-machine-specific-configurations)
@@ -101,7 +102,7 @@ To keep your Emacs configuration up to date, you can pull the latest changes fro
git -C ~/.emacs.d pull
```
-## Customizations
+## Customizations: post-init.el
### Never modify init.el and early-init.el. Modify these instead...
**The `init.el` and `early-init.el` files should never be modified directly** because they are intended to be managed by Git during an update.
@@ -135,23 +136,6 @@ To customize your Emacs setup to include various user interface elements, you ca
These settings control the visibility of dialogs, context menus, toolbars, menu bars, and tooltips.
-### Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`
-
-Emacs, by default, stores various configuration files, caches, backups, and other data in the `~/.emacs.d` directory. Over time, this directory can become cluttered with numerous files, making it difficult to manage and maintain.
-
-A common solution to this issue is installing the no-littering package; however, this package is not essential.
-
-An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`:
-``` emacs-lisp
-;; Reducing clutter in ~/.emacs.d by redirecting files to ~/emacs.d/var/
-;; IMPORTANT: This part should be in the pre-early-init.el file
-(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory))
-(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir))
-(setq user-emacs-directory minimal-emacs-var-dir)
-```
-
-**IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files.
-
### How to prevent minimal-emacs.d from saving custom.el?
To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`:
@@ -862,86 +846,6 @@ Other optional packages that may be useful include:
elisp-refs-symbol))
```
-### Configuring straight.el?
-
-[Add the straight.el bootstrap code](https://github.com/radian-software/straight.el?tab=readme-ov-file#getting-started) to `~/.emacs.d/pre-init.el`:
-``` emacs-lisp
-;; Straight bootstrap
-(defvar bootstrap-version)
-(let ((bootstrap-file
- (expand-file-name
- "straight/repos/straight.el/bootstrap.el"
- (or (bound-and-true-p straight-base-dir)
- user-emacs-directory)))
- (bootstrap-version 7))
- (unless (file-exists-p bootstrap-file)
- (with-current-buffer
- (url-retrieve-synchronously
- "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
- 'silent 'inhibit-cookies)
- (goto-char (point-max))
- (eval-print-last-sexp)))
- (load bootstrap-file nil 'nomessage))
-```
-
-### Configuring elpaca (package manager)
-
-Add to `~/.emacs.d/pre-early-init.el`:
-```elisp
-;; By default, minimal-emacs-package-initialize-and-refresh is set to t, which
-;; makes minimal-emacs.d call the built-in package manager. Since Elpaca will
-;; replace the package manager, there is no need to call it.
-(setq minimal-emacs-package-initialize-and-refresh nil)
-```
-
-(According to arthsmn, a *minimal-emacs.d* user, the change above also improves startup time. [In this user's case](https://github.com/jamescherti/minimal-emacs.d/pull/22), the startup time decreased from 1.06 seconds to 0.56 seconds.)
-
-And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`:
-```elisp
-(defvar elpaca-installer-version 0.9)
-(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
-(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
-(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
-(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
- :ref nil :depth 1 :inherit ignore
- :files (:defaults "elpaca-test.el" (:exclude "extensions"))
- :build (:not elpaca--activate-package)))
-(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
- (build (expand-file-name "elpaca/" elpaca-builds-directory))
- (order (cdr elpaca-order))
- (default-directory repo))
- (add-to-list 'load-path (if (file-exists-p build) build repo))
- (unless (file-exists-p repo)
- (make-directory repo t)
- (when (< emacs-major-version 28) (require 'subr-x))
- (condition-case-unless-debug err
- (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
- ((zerop (apply #'call-process `("git" nil ,buffer t "clone"
- ,@(when-let* ((depth (plist-get order :depth)))
- (list (format "--depth=%d" depth) "--no-single-branch"))
- ,(plist-get order :repo) ,repo))))
- ((zerop (call-process "git" nil buffer t "checkout"
- (or (plist-get order :ref) "--"))))
- (emacs (concat invocation-directory invocation-name))
- ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
- "--eval" "(byte-recompile-directory \".\" 0 'force)")))
- ((require 'elpaca))
- ((elpaca-generate-autoloads "elpaca" repo)))
- (progn (message "%s" (buffer-string)) (kill-buffer buffer))
- (error "%s" (with-current-buffer buffer (buffer-string))))
- ((error) (warn "%s" err) (delete-directory repo 'recursive))))
- (unless (require 'elpaca-autoloads nil t)
- (require 'elpaca)
- (elpaca-generate-autoloads "elpaca" repo)
- (load "./elpaca-autoloads")))
-(add-hook 'after-init-hook #'elpaca-process-queues)
-(elpaca `(,@elpaca-order))
-
-;; Optional: Install use-package support
-(elpaca elpaca-use-package
- (elpaca-use-package-mode))
-```
-
### Which other customizations can be interesting to add?
1. Read the following article from the same author: [Essential Emacs Packages for Efficient Software Development and Text Editing](https://www.jamescherti.com/essential-emacs-packages/)
@@ -1030,6 +934,106 @@ It is also recommended to read the following articles:
- [Automating Table of Contents Update for Markdown Documents (e.g., README.md)](https://www.jamescherti.com/emacs-markdown-table-of-contents-update-before-save/)
- [Maintaining proper indentation in indentation-sensitive programming languages](https://www.jamescherti.com/elisp-code-and-emacs-packages-for-maintaining-proper-indentation-in-indentation-sensitive-languages-such-as-python-or-yaml/)
+
+## Customizations: pre-early-init.el
+
+### Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`
+
+Emacs, by default, stores various configuration files, caches, backups, and other data in the `~/.emacs.d` directory. Over time, this directory can become cluttered with numerous files, making it difficult to manage and maintain.
+
+A common solution to this issue is installing the no-littering package; however, this package is not essential.
+
+An alternative lightweight approach is to simply change the default `~/.emacs.d` directory to `~/.emacs.d/var/`, which will contain all the files that Emacs typically stores in the base directory. This can be accomplished by adding the following code to `~/.emacs.d/pre-early-init.el`:
+``` emacs-lisp
+;; Reducing clutter in ~/.emacs.d by redirecting files to ~/emacs.d/var/
+;; IMPORTANT: This part should be in the pre-early-init.el file
+(setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory))
+(setq package-user-dir (expand-file-name "elpa" minimal-emacs-var-dir))
+(setq user-emacs-directory minimal-emacs-var-dir)
+```
+
+**IMPORTANT:** The code above should be added to `~/.emacs.d/pre-early-init.el`, not the other files, as it modifies the behavior of all subsequent init files.
+
+### Configuring straight.el?
+
+[Add the straight.el bootstrap code](https://github.com/radian-software/straight.el?tab=readme-ov-file#getting-started) to `~/.emacs.d/pre-init.el`:
+``` emacs-lisp
+;; Straight bootstrap
+(defvar bootstrap-version)
+(let ((bootstrap-file
+ (expand-file-name
+ "straight/repos/straight.el/bootstrap.el"
+ (or (bound-and-true-p straight-base-dir)
+ user-emacs-directory)))
+ (bootstrap-version 7))
+ (unless (file-exists-p bootstrap-file)
+ (with-current-buffer
+ (url-retrieve-synchronously
+ "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
+ 'silent 'inhibit-cookies)
+ (goto-char (point-max))
+ (eval-print-last-sexp)))
+ (load bootstrap-file nil 'nomessage))
+```
+
+### Configuring elpaca (package manager)
+
+Add to `~/.emacs.d/pre-early-init.el`:
+```elisp
+;; By default, minimal-emacs-package-initialize-and-refresh is set to t, which
+;; makes minimal-emacs.d call the built-in package manager. Since Elpaca will
+;; replace the package manager, there is no need to call it.
+(setq minimal-emacs-package-initialize-and-refresh nil)
+```
+
+(According to arthsmn, a *minimal-emacs.d* user, the change above also improves startup time. [In this user's case](https://github.com/jamescherti/minimal-emacs.d/pull/22), the startup time decreased from 1.06 seconds to 0.56 seconds.)
+
+And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`:
+```elisp
+(defvar elpaca-installer-version 0.9)
+(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
+(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
+(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
+(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git"
+ :ref nil :depth 1 :inherit ignore
+ :files (:defaults "elpaca-test.el" (:exclude "extensions"))
+ :build (:not elpaca--activate-package)))
+(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory))
+ (build (expand-file-name "elpaca/" elpaca-builds-directory))
+ (order (cdr elpaca-order))
+ (default-directory repo))
+ (add-to-list 'load-path (if (file-exists-p build) build repo))
+ (unless (file-exists-p repo)
+ (make-directory repo t)
+ (when (< emacs-major-version 28) (require 'subr-x))
+ (condition-case-unless-debug err
+ (if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
+ ((zerop (apply #'call-process `("git" nil ,buffer t "clone"
+ ,@(when-let* ((depth (plist-get order :depth)))
+ (list (format "--depth=%d" depth) "--no-single-branch"))
+ ,(plist-get order :repo) ,repo))))
+ ((zerop (call-process "git" nil buffer t "checkout"
+ (or (plist-get order :ref) "--"))))
+ (emacs (concat invocation-directory invocation-name))
+ ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch"
+ "--eval" "(byte-recompile-directory \".\" 0 'force)")))
+ ((require 'elpaca))
+ ((elpaca-generate-autoloads "elpaca" repo)))
+ (progn (message "%s" (buffer-string)) (kill-buffer buffer))
+ (error "%s" (with-current-buffer buffer (buffer-string))))
+ ((error) (warn "%s" err) (delete-directory repo 'recursive))))
+ (unless (require 'elpaca-autoloads nil t)
+ (require 'elpaca)
+ (elpaca-generate-autoloads "elpaca" repo)
+ (load "./elpaca-autoloads")))
+(add-hook 'after-init-hook #'elpaca-process-queues)
+(elpaca `(,@elpaca-order))
+
+;; Optional: Install use-package support
+(elpaca elpaca-use-package
+ (elpaca-use-package-mode))
+```
+
## Frequently asked questions
### How to give more priority to MELPA over MELPA stable?
From 2bef2c2ba9224b30e652be351d2c9f29d1fcb328 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 11:32:49 -0500
Subject: [PATCH 053/172] Update README.md
---
README.md | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index cf8f928..4d89e8f 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@ Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **ext
- **Minimal yet powerful:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn't enable modes. YOU decide the global/minor modes to enable.
-- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead))
+- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead))
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
@@ -23,10 +23,10 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd)
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
- [Update minimal-emacs.d](#update-minimal-emacsd)
- - [Customizations: post-init.el](#customizations-post-initel)
- - [Never modify init.el and early-init.el. Modify these instead...](#never-modify-initel-and-early-initel-modify-these-instead)
+ - [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead)
+ - [Customizations: UI](#customizations-ui)
- [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips)
- - [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel)
+ - [Customizations: Packages](#customizations-packages)
- [Optimization: Native Compilation](#optimization-native-compilation)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Activating autosave](#activating-autosave)
@@ -44,6 +44,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Inhibit the mouse](#inhibit-the-mouse)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
+ - [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel)
- [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
- [Customizations: pre-early-init.el](#customizations-pre-early-initel)
- [Reducing clutter in `~/.emacs.d` by redirecting files to `~/emacs.d/var/`](#reducing-clutter-in-emacsd-by-redirecting-files-to-emacsdvar)
@@ -102,9 +103,8 @@ To keep your Emacs configuration up to date, you can pull the latest changes fro
git -C ~/.emacs.d pull
```
-## Customizations: post-init.el
-### Never modify init.el and early-init.el. Modify these instead...
+## Customizations: Never modify init.el and early-init.el. Modify these instead...
**The `init.el` and `early-init.el` files should never be modified directly** because they are intended to be managed by Git during an update.
The minimal-emacs.d init files support additional customization files that are loaded at different stages of the Emacs startup process. These files allow you to further customize the initialization sequence:
@@ -124,6 +124,8 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
(Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.)
+## Customizations: UI
+
### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?
**Note:** Enabling the tool-bar, menu-bar, and similar UI elements may slightly increase your startup time.
@@ -136,12 +138,7 @@ To customize your Emacs setup to include various user interface elements, you ca
These settings control the visibility of dialogs, context menus, toolbars, menu bars, and tooltips.
-### How to prevent minimal-emacs.d from saving custom.el?
-
-To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`:
-``` emacs-lisp
-(setq custom-file null-device)
-```
+## Customizations: Packages
### Optimization: Native Compilation
@@ -846,6 +843,13 @@ Other optional packages that may be useful include:
elisp-refs-symbol))
```
+### Preventing Emacs from saving custom.el
+
+To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`:
+``` emacs-lisp
+(setq custom-file null-device)
+```
+
### Which other customizations can be interesting to add?
1. Read the following article from the same author: [Essential Emacs Packages for Efficient Software Development and Text Editing](https://www.jamescherti.com/essential-emacs-packages/)
From 224fb1216b50de66b510b4c82a7a5c741a31202f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 12:11:14 -0500
Subject: [PATCH 054/172] Closes #40: Add function that verifies that the Emacs
config has loaded.
---
README.md | 2 +-
early-init.el | 21 ++++++++++++++++-----
init.el | 2 ++
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 4d89e8f..aa240b7 100644
--- a/README.md
+++ b/README.md
@@ -931,7 +931,7 @@ To prevent Emacs from saving customization information to a custom file, set `cu
(add-hook 'dired-mode-hook #'dired-omit-mode)
;; Enable on-the-fly spell checking (Flyspell mode).
-(add-hook text-mode-hook #'flyspell-mode)
+(add-hook 'text-mode-hook #'flyspell-mode)
```
It is also recommended to read the following articles:
diff --git a/early-init.el b/early-init.el
index 8f536f9..8eb7c1f 100644
--- a/early-init.el
+++ b/early-init.el
@@ -71,18 +71,29 @@ minimalistic appearance during startup.")
;;; Load pre-early-init.el
+(defvar minimal-emacs--success nil)
+(defvar minimal-emacs--stage "early-init.el")
+(defun minimal-emacs--check-success ()
+ "Verify that the Emacs configuration has loaded successfully."
+ (unless minimal-emacs--success
+ (error (concat "Configuration error in: '%s'. Debug by starting Emacs "
+ "with: emacs --debug-init")
+ minimal-emacs--stage)))
+(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
+
;; Prefer loading newer compiled files
(setq load-prefer-newer t)
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
- (let ((user-init-file
- (expand-file-name filename
- minimal-emacs-user-directory)))
- (when (file-exists-p user-init-file)
- (load user-init-file nil t t))))
+ (let ((init-file (expand-file-name filename
+ minimal-emacs-user-directory)))
+ (when (file-exists-p init-file)
+ (setq minimal-emacs--stage init-file)
+ (load init-file nil t t))))
(minimal-emacs-load-user-init "pre-early-init.el")
+(setq minimal-emacs--stage "early-init.el")
(setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory))
diff --git a/init.el b/init.el
index a6fc989..62046e3 100644
--- a/init.el
+++ b/init.el
@@ -16,6 +16,7 @@
;;; Load pre-init.el
(minimal-emacs-load-user-init "pre-init.el")
+(setq minimal-emacs--stage "init.el")
;;; Before package
@@ -542,6 +543,7 @@
;;; Load post init
(minimal-emacs-load-user-init "post-init.el")
+(setq minimal-emacs--success t)
(provide 'init)
;;; init.el ends here
From 546c8b82c1f05bcc25e7019106728b2bc3d276e9 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 12:29:03 -0500
Subject: [PATCH 055/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index aa240b7..4427684 100644
--- a/README.md
+++ b/README.md
@@ -1234,9 +1234,9 @@ A drawback of using the early-init phase instead of init is that if a package fa
- Configures smooth scrolling and cursor behavior for a more seamless editing experience.
10. **Miscellaneous**
- - Configure recentf, savehist, and auto-save
+ - Verifies that the Emacs configuration has loaded successfully and issues a warning if there are any issues.
+ - Configure and optimize settings for Eglot, recentf, savehist, auto-save, and others without enabling the modes themselves. This modifies the behavior and preferences to improve performance and usability.
- Configure Ediff to use a single frame and split windows horizontally
- - Optimize Eglot
## Author and license
From 5bd2dbb4851bd7f12195679aedbd001c6284280f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 12:30:57 -0500
Subject: [PATCH 056/172] Release: 1.2.0
---
early-init.el | 2 +-
init.el | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/early-init.el b/early-init.el
index 8eb7c1f..c462db4 100644
--- a/early-init.el
+++ b/early-init.el
@@ -4,7 +4,7 @@
;; URL: https://github.com/jamescherti/minimal-emacs.d
;; Package-Requires: ((emacs "29.1"))
;; Keywords: maint
-;; Version: 1.1.2
+;; Version: 1.2.0
;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Commentary:
diff --git a/init.el b/init.el
index 62046e3..9b3f9c5 100644
--- a/init.el
+++ b/init.el
@@ -4,7 +4,7 @@
;; URL: https://github.com/jamescherti/minimal-emacs.d
;; Package-Requires: ((emacs "29.1"))
;; Keywords: maint
-;; Version: 1.1.2
+;; Version: 1.2.0
;; SPDX-License-Identifier: GPL-3.0-or-later
;;; Commentary:
From 3de457c5f67d57d16fc1897528859c16152de86c Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 12:33:09 -0500
Subject: [PATCH 057/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 4427684..fca8879 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# minimal-emacs.d - A Customizable Emacs Base that Provides Better Defaults and Optimized Startup
[](https://www.gnu.org/licenses/gpl-3.0)
-The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
+The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base (`init.el` and `early-init.el`) that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)*
From c0f71c6c8ec44f6916dddbec94e1f4a39a457c60 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 15:36:29 -0500
Subject: [PATCH 058/172] Remove scroll-step
---
init.el | 4 ----
1 file changed, 4 deletions(-)
diff --git a/init.el b/init.el
index 9b3f9c5..8c12efb 100644
--- a/init.el
+++ b/init.el
@@ -280,10 +280,6 @@
;; window is never automatically recentered.
(setq scroll-conservatively 101)
-;; Enables smooth scrolling by making Emacs scroll the window by 1 line whenever
-;; the cursor moves off the visible screen.
-(setq scroll-step 1)
-
;; Reduce cursor lag by:
;; 1. Preventing automatic adjustments to `window-vscroll' for long lines.
;; 2. Resolving the issue of random half-screen jumps during scrolling.
From cd9ec4cd56371a15b6da286af010c0033352c29d Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 15:37:47 -0500
Subject: [PATCH 059/172] Add next-screen-context-lines
---
init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/init.el b/init.el
index 8c12efb..fea0dc3 100644
--- a/init.el
+++ b/init.el
@@ -288,6 +288,9 @@
;; Number of lines of margin at the top and bottom of a window.
(setq scroll-margin 0)
+;; Number of lines of continuity when scrolling by screenfuls.
+(setq next-screen-context-lines 0)
+
;; Horizontal scrolling
(setq hscroll-margin 2
hscroll-step 1)
From 681f6cbc9b08b82aaed5d0be610f14aee22ed29d Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 15:51:57 -0500
Subject: [PATCH 060/172] Update README.md
---
README.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/README.md b/README.md
index fca8879..bc38a78 100644
--- a/README.md
+++ b/README.md
@@ -932,6 +932,22 @@ To prevent Emacs from saving customization information to a custom file, set `cu
;; Enable on-the-fly spell checking (Flyspell mode).
(add-hook 'text-mode-hook #'flyspell-mode)
+
+;; Configures Aspell's suggestion mode to "ultra", which provides more
+;; aggressive and detailed suggestions for misspelled words. The language
+;; is set to "en_US" for US English, which can be replaced with your desired
+;; language code (e.g., "en_GB" for British English, "de_DE" for German).
+(setq ispell-program-name "aspell")
+(setq ispell-extra-args '("--sug-mode=ultra" "--lang=en_US"))
+
+;; Configure Emacs to ask for confirmation before exiting
+(setq confirm-kill-emacs 'y-or-n-p)
+
+;; Enabled backups save your changes to a file intermittently
+(setq make-backup-files t)
+(setq vc-make-backup-files t)
+(setq kept-old-versions 10)
+(setq kept-new-versions 10)
```
It is also recommended to read the following articles:
From 26ce57d8b23cd466ed167da24f4f951ce0d712bc Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 18:57:05 -0500
Subject: [PATCH 061/172] Update README.md
---
README.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index bc38a78..96c1446 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
-# minimal-emacs.d - A Customizable Emacs Base that Provides Better Defaults and Optimized Startup
+# *minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup
[](https://www.gnu.org/licenses/gpl-3.0)
-The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base (`init.el` and `early-init.el`) that gives you full control over your configuration (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own Emacs setup.
+The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup.
-Building *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs init file. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)*
+Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)*
-**Why minimal-emacs.d?**
-- **Minimal yet powerful:** A solid starting point.
+If you're looking for the ideal starter kit to customize Emacs, you've found it. The *minimal-emacs.d* project is:
+- **Minimal yet effective:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
-- **No forced modes:** Unlike larger frameworks, *minimal-emacs.d* doesn't enable modes. YOU decide the global/minor modes to enable.
+- **No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* doesn't enable modes. **YOU decide** the global/minor modes to enable.
- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead))
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
@@ -18,7 +18,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
## Table of Contents
-- [minimal-emacs.d - A Customizable Emacs Base that Provides Better Defaults and Optimized Startup](#minimal-emacsd---a-customizable-emacs-base-that-provides-better-defaults-and-optimized-startup)
+- [*minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup](#minimal-emacsd---a-customizable-emacs-initel-and-early-initel-that-provides-better-defaults-and-faster-startup)
- [Install minimal-emacs.d](#install-minimal-emacsd)
- [Install minimal-emacs.d into `~/.emacs.d`](#install-minimal-emacsd-into-emacsd)
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
From 6ee088c8cb246575d7fa919b7a2b736322ca8375 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 18:59:47 -0500
Subject: [PATCH 062/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 96c1446..c432a47 100644
--- a/README.md
+++ b/README.md
@@ -425,7 +425,7 @@ For example, to enable `outline-minor-mode` in Emacs Lisp:
(add-hook 'emacs-lisp-mode-hook #'outline-minor-mode)
```
-For folding based on indentation levels, the **[outline-indent @GitHub](https://github.com/jamescherti/outline-indent.el)** Emacs package provides a minor mode that enables folding according to the indentation structure:
+For folding based on indentation levels, the **[outline-indent](https://github.com/jamescherti/outline-indent.el)** Emacs package provides a minor mode that enables folding according to the indentation structure:
```elisp
(use-package outline-indent
:ensure t
From fc4d969cf15c9ab17a827d574819a0f39c533fc3 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 19:00:24 -0500
Subject: [PATCH 063/172] Update README.md
---
README.md | 50 --------------------------------------------------
1 file changed, 50 deletions(-)
diff --git a/README.md b/README.md
index c432a47..2eea4a5 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,6 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Code completion with corfu](#code-completion-with-corfu)
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code folding](#code-folding)
- - [Doom themes](#doom-themes)
- [Configuring vterm](#configuring-vterm)
- [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
@@ -448,55 +447,6 @@ In addition to code folding, *outline-indent* also allows: moving indented block

-### Doom themes
-
-The `doom-themes` package is an extensive collection of high-quality, visually appealing themes for Emacs, designed to offer a sleek and modern aesthetic, while drawing inspiration from popular community themes. It provides a wide range of color schemes suitable for various work environments and personal preferences, ensuring that users can enhance their Emacs experience with ease.
-
-To install and configure the `doom-themes` package, add the following configuration to the `~/.emacs.d/post-init.el` file, ensuring that the themes are available for use as soon as Emacs starts:
-
-```emacs-lisp
-(use-package doom-themes
- :ensure t
- :custom
- (doom-themes-enable-bold t) ; if nil, bold is universally disabled
- (doom-themes-enable-italic t) ; if nil, italics is universally disabled
-
- :config
- ;; Default theme:
- (load-theme 'doom-one t)
-
- ;; Alternative themes:
- ;; -------------------
- ;; (load-theme 'doom-gruvbox-light t)
- ;; (load-theme 'doom-one t)
- ;; (load-theme 'doom-1337 t)
- ;; (load-theme 'doom-gruvbox t)
- ;; (load-theme 'doom-solarized-light t)
- ;; (load-theme 'doom-tomorrow-night t)
- ;; (load-theme 'doom-tomorrow-day t)
- ;; (load-theme 'doom-snazzy t)
- ;; (load-theme 'doom-ir-black t)
- ;; (load-theme 'doom-ayu-dark t)
- ;; (load-theme 'doom-acario-light t)
-
- ;; Enable custom neotree theme (nerd-icons must be installed):
- ;; -----------------------------------------------------------
- ;; (doom-themes-neotree-config)
-
- ;; Treemacs users (use "doom-colors" for less minimal icon theme):
- ;; ---------------------------------------------------------------
- ;; (setq doom-themes-treemacs-theme "doom-atom")
- ;; (doom-themes-treemacs-config)
-
- ;; Enable flashing mode-line on errors:
- ;; ------------------------------------
- (doom-themes-visual-bell-config)
-
- ;; Improves org-mode's native fontification:
- ;; -----------------------------------------
- (doom-themes-org-config))
-```
-
### Configuring vterm
The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
From 016c36fac81d6e456a0d1bd227e6706d242c4717 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 19:42:26 -0500
Subject: [PATCH 064/172] Update README.md
---
README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/README.md b/README.md
index 2eea4a5..d377d6d 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Code completion with corfu](#code-completion-with-corfu)
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code folding](#code-folding)
+ - [Changing the default theme](#changing-the-default-theme)
- [Configuring vterm](#configuring-vterm)
- [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
@@ -447,6 +448,48 @@ In addition to code folding, *outline-indent* also allows: moving indented block

+### Changing the default theme
+
+For instance, to switch to a darker theme, add the following to the `~/.emacs.d/post-init.el` file:
+
+```emacs-lisp
+(mapc #'disable-theme custom-enabled-themes) ; Disable all active themes
+(load-theme 'tango-dark t) ; Load the built-in tango-dark theme
+```
+
+Emacs includes several built-in themes that you can use without installing additional packages:
+
+- `tango-dark`: Face colors using the Tango palette (dark background).
+- `tango`: Face colors using the Tango palette (light background).
+- `modus-operandi`
+- `modus-operandi-deuteranopia`
+- `modus-operandi-tinted`
+- `modus-operandi-tritanopia`
+- `modus-vivendi`
+- `modus-vivendi-deuteranopia`
+- `modus-vivendi-tinted`
+- `modus-vivendi-tritanopia`
+- `tsdh-dark`: A dark theme used and created by Tassilo Horn.
+- `tsdh-light`: A light Emacs theme.
+- `adwaita`: Face colors similar to the default theme of Gnome 3 (Adwaita).
+- `deeper-blue`: Face colors using a deep blue background.
+- `dichromacy`: Face colors suitable for red/green color-blind users.
+- `leuven-dark`: Face colors with a dark background.
+- `leuven`: Face colors with a light background.
+- `light-blue`: Face colors utilizing a light blue background.
+- `manoj-dark`: Very high contrast faces with a black background.
+- `misterioso`: Predominantly blue/cyan faces on a dark cyan background.
+- `wheatgrass`: High-contrast green/blue/brown faces on a black background.
+- `whiteboard`: Face colors similar to markers on a whiteboard.
+- `wombat`: Medium-contrast faces with a dark gray background.
+
+(To experiment with different themes, use `M-x customize-themes`.)
+
+If you're interested in exploring third-party Emacs themes, consider the following:
+- `ef-themes` (available on MELPA): A collection of light and dark themes for GNU Emacs, designed to offer colorful yet highly legible options. They are aimed at users seeking something with more visual flair compared to the more minimalist *modus-themes*.
+- `doom-themes` (available on MELPA): An extensive collection of high-quality, visually appealing themes for Emacs, designed to offer a sleek and modern aesthetic, while drawing inspiration from popular community themes.
+- `tomorrow-night-deepblue-theme` (available on MELPA): A beautiful deep blue variant of the Tomorrow Night theme, which is renowned for its elegant color palette. It features a deep blue background color that creates a calming atmosphere. This theme is a great choice for those who miss the blue themes that were trendy a few years ago. (The theme was inspired by classic text editors such as QuickBASIC, RHIDE, and Turbo Pascal, as well as tools such as Midnight Commander.)
+
### Configuring vterm
The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
@@ -457,6 +500,10 @@ To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
:ensure t
:defer t
:commands vterm
+ :custom
+ ;; Important: Ensure the following dependencies are installed:
+ ;; A 'C' compiler, cmake, libtool-bin, and libvterm
+ (vterm-always-compile-module t) ; Auto-compile libvterm
:config
;; Speed up vterm
(setq vterm-timer-delay 0.01))
From 81b1b0558252a35328282168f35760cb89fbc606 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 20:20:16 -0500
Subject: [PATCH 065/172] Update README.md
---
README.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index d377d6d..e52601c 100644
--- a/README.md
+++ b/README.md
@@ -450,13 +450,15 @@ In addition to code folding, *outline-indent* also allows: moving indented block
### Changing the default theme
-For instance, to switch to a darker theme, add the following to the `~/.emacs.d/post-init.el` file:
+For instance, to switch to a another theme than the default one, add the following to the `~/.emacs.d/post-init.el` file:
```emacs-lisp
(mapc #'disable-theme custom-enabled-themes) ; Disable all active themes
-(load-theme 'tango-dark t) ; Load the built-in tango-dark theme
+(load-theme 'modus-operandi t) ; Load the built-in theme
```
+(If you prefer dark themes, replace `modus-operandi` with `modus-vivendi`.)
+
Emacs includes several built-in themes that you can use without installing additional packages:
- `tango-dark`: Face colors using the Tango palette (dark background).
From c800483b72de03a7b8b24770db78bd79e4ffddb6 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 20:46:52 -0500
Subject: [PATCH 066/172] Update README.md
---
README.md | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index e52601c..ae68fb6 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,8 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid

+*(The theme shown in the screenshot above is the *[tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el)*, available on MELPA.)*
+
## Table of Contents
@@ -461,8 +463,8 @@ For instance, to switch to a another theme than the default one, add the followi
Emacs includes several built-in themes that you can use without installing additional packages:
-- `tango-dark`: Face colors using the Tango palette (dark background).
-- `tango`: Face colors using the Tango palette (light background).
+- `tango-dark` (Face colors using the Tango palette. Dark background.)
+- `tango` (Face colors using the Tango palette. Light background.)
- `modus-operandi`
- `modus-operandi-deuteranopia`
- `modus-operandi-tinted`
@@ -471,19 +473,19 @@ Emacs includes several built-in themes that you can use without installing addit
- `modus-vivendi-deuteranopia`
- `modus-vivendi-tinted`
- `modus-vivendi-tritanopia`
-- `tsdh-dark`: A dark theme used and created by Tassilo Horn.
-- `tsdh-light`: A light Emacs theme.
-- `adwaita`: Face colors similar to the default theme of Gnome 3 (Adwaita).
-- `deeper-blue`: Face colors using a deep blue background.
-- `dichromacy`: Face colors suitable for red/green color-blind users.
-- `leuven-dark`: Face colors with a dark background.
-- `leuven`: Face colors with a light background.
-- `light-blue`: Face colors utilizing a light blue background.
-- `manoj-dark`: Very high contrast faces with a black background.
-- `misterioso`: Predominantly blue/cyan faces on a dark cyan background.
-- `wheatgrass`: High-contrast green/blue/brown faces on a black background.
-- `whiteboard`: Face colors similar to markers on a whiteboard.
-- `wombat`: Medium-contrast faces with a dark gray background.
+- `tsdh-dark` (A dark theme used and created by Tassilo Horn.)
+- `tsdh-light` (A light Emacs theme.)
+- `adwaita` (Face colors similar to the default theme of Gnome 3 / Adwaita.)
+- `deeper-blue` (Face colors using a deep blue background.)
+- `dichromacy` (Face colors suitable for red/green color-blind users.)
+- `leuven-dark` (Face colors with a dark background.)
+- `leuven` (Face colors with a light background.)
+- `light-blue` (Face colors utilizing a light blue background.)
+- `manoj-dark` (Very high contrast faces with a black background.)
+- `misterioso` (Predominantly blue/cyan faces on a dark cyan background.)
+- `wheatgrass` (High-contrast green/blue/brown faces on a black background.)
+- `whiteboard` (Face colors similar to markers on a whiteboard.)
+- `wombat` (Medium-contrast faces with a dark gray background.)
(To experiment with different themes, use `M-x customize-themes`.)
From 0a0487dc35efd2c02d374f28d9f1739229caebe6 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 20:53:34 -0500
Subject: [PATCH 067/172] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index ae68fb6..922ba1b 100644
--- a/README.md
+++ b/README.md
@@ -146,7 +146,9 @@ These settings control the visibility of dialogs, context menus, toolbars, menu
Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness.
-1. To check if native compilation is enabled, evaluate `(native-comp-available-p)` in Emacs. A non-nil result indicates that native compilation is active.
+1. To check if native compilation is enabled, evaluate:
+ `(native-comp-available-p)`
+ (A non-nil result indicates that native compilation is active.)
2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages:
```emacs-lisp
From 05b23dc699fcee40046d2d5350f07c4ec80fbe4d Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 20:54:29 -0500
Subject: [PATCH 068/172] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 922ba1b..03cea73 100644
--- a/README.md
+++ b/README.md
@@ -147,7 +147,9 @@ These settings control the visibility of dialogs, context menus, toolbars, menu
Native compilation enhances Emacs performance by converting Elisp code into native machine code, resulting in faster execution and improved responsiveness.
1. To check if native compilation is enabled, evaluate:
- `(native-comp-available-p)`
+ ```elisp
+ (native-comp-available-p)
+ ```
(A non-nil result indicates that native compilation is active.)
2. Ensure all libraries are byte-compiled and native-compiled using [compile-angel.el](https://github.com/jamescherti/compile-angel.el). To install compile-angel, add the following code at the very beginning of your `~/.emacs.d/post-init.el` file, before all other packages:
From 55440f73057b65fc2b1d672047b0b2c9d3ceaba7 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 6 Mar 2025 21:06:14 -0500
Subject: [PATCH 069/172] Update README.md
---
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 03cea73..a7b7931 100644
--- a/README.md
+++ b/README.md
@@ -26,9 +26,9 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
- [Update minimal-emacs.d](#update-minimal-emacsd)
- [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead)
- - [Customizations: UI](#customizations-ui)
+ - [Customizations: UI (pre-early-init.el)](#customizations-ui-pre-early-initel)
- [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips)
- - [Customizations: Packages](#customizations-packages)
+ - [Customizations: Packages (post-init.el)](#customizations-packages-post-initel)
- [Optimization: Native Compilation](#optimization-native-compilation)
- [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert)
- [Activating autosave](#activating-autosave)
@@ -126,7 +126,7 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
(Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.)
-## Customizations: UI
+## Customizations: UI (pre-early-init.el)
### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?
@@ -140,7 +140,7 @@ To customize your Emacs setup to include various user interface elements, you ca
These settings control the visibility of dialogs, context menus, toolbars, menu bars, and tooltips.
-## Customizations: Packages
+## Customizations: Packages (post-init.el)
### Optimization: Native Compilation
From 746cd002a4e49d8a0e9ffd305c7e71bc8c90869e Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 7 Mar 2025 09:07:00 -0500
Subject: [PATCH 070/172] Update README.md
---
README.md | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/README.md b/README.md
index a7b7931..a780af9 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,8 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
*(The theme shown in the screenshot above is the *[tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el)*, available on MELPA.)*
+In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:defer t` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md).
+
## Table of Contents
@@ -53,6 +55,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
- [Configuring straight.el?](#configuring-straightel)
- [Configuring elpaca (package manager)](#configuring-elpaca-package-manager)
- [Frequently asked questions](#frequently-asked-questions)
+ - [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration)
- [How to give more priority to MELPA over MELPA stable?](#how-to-give-more-priority-to-melpa-over-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 Emacs customizations?](#how-to-load-emacs-customizations)
@@ -1061,6 +1064,23 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
## Frequently asked questions
+### How to display Emacs startup duration?
+
+To measure and display the time taken for Emacs to start, you can use the following Emacs Lisp function. This function will report both the startup duration and the number of garbage collections that occurred during initialization.
+
+Add the following to your `~/.emacs.d/pre-early-init.el` file:
+```emacs-lisp
+(defun display-startup-time ()
+ "Display the startup duration and number of garbage collections."
+ (message "Emacs loaded in %.2f seconds with %d garbage collections."
+ (time-to-seconds (time-since before-init-time))
+ gcs-done))
+
+(add-hook 'emacs-startup-hook #'display-startup-time 100)
+```
+
+(Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration.)
+
### How to give more priority to MELPA over MELPA stable?
**Warning:** MELPA Stable is generally more reliable and thoroughly tested, as it contains stable versions of packages. On the other hand, MELPA provides bleeding-edge versions, which often include new features but may also introduce changes that could potentially break functionality. The author of *minimal-emacs.d* uses MELPA over MELPA Stable without encountering issues, but this is provided as a caution to allow you to make an informed decision based on your stability versus feature needs.
From 636428e0ad1f1d46faaccb9074b68ff28cb1e251 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 7 Mar 2025 22:31:39 -0500
Subject: [PATCH 071/172] Remove dired-auto-revert-buffer
---
init.el | 2 --
1 file changed, 2 deletions(-)
diff --git a/init.el b/init.el
index fea0dc3..90614b1 100644
--- a/init.el
+++ b/init.el
@@ -408,8 +408,6 @@
dired-recursive-deletes 'top
dired-recursive-copies 'always
dired-create-destination-dirs 'ask
- ;; Revert the Dired buffer without prompting.
- dired-auto-revert-buffer #'dired-buffer-stale-p
image-dired-thumb-size 150)
(setq dired-vc-rename-file t)
From cf16ecf1d5e8ad35e0360951763eff6aebf72b61 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 7 Mar 2025 22:36:23 -0500
Subject: [PATCH 072/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a780af9..bc92b6c 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of *
If you're looking for the ideal starter kit to customize Emacs, you've found it. The *minimal-emacs.d* project is:
- **Minimal yet effective:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
-- **No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* doesn't enable modes. **YOU decide** the global/minor modes to enable.
+- **No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable and which packages to load with `require`.
- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead))
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
From 8f8134a07231be0a374bc8e7a3020e1189bfa938 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 7 Mar 2025 23:10:44 -0500
Subject: [PATCH 073/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index bc92b6c..7fb4a1d 100644
--- a/README.md
+++ b/README.md
@@ -1079,7 +1079,7 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
(add-hook 'emacs-startup-hook #'display-startup-time 100)
```
-(Alternatively, you may use the built-in `M-x emacs-init-time` command to obtain the startup duration.)
+(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`.)
### How to give more priority to MELPA over MELPA stable?
From 3ecc85aa721d0fe9fce4472078d32b13bd61a1e3 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 09:21:27 -0500
Subject: [PATCH 074/172] Enhance minimal-emacs--check-success and update
README.md
---
README.md | 2 +-
early-init.el | 26 ++++++++++++++++++--------
init.el | 1 +
3 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 7fb4a1d..52f748f 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid
*(The theme shown in the screenshot above is the *[tomorrow-night-deepblue-theme.el](https://github.com/jamescherti/tomorrow-night-deepblue-theme.el)*, available on MELPA.)*
-In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:defer t` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md).
+In addition to *minimal-emacs.d*, startup speed is influenced by your computer's processing power and disk speed. To establish a baseline, start Emacs with only *minimal-emacs.d* and no additional configurations, then run `M-x emacs-init-time`. Incrementally modify your init files and observe the impact on startup time. For consistent comparisons, always test on the same computer and Emacs version. It's also important to ensure that all packages are deferred using `:defer t` and `:commands`, which makes Emacs load them only when needed (see additional examples in this README.md). While startup time is important, other factors, like native compilation, are even more important. Although native compilation may introduce some brief initial and negligible initial delay, it is beneficial in the long run as it significantly speeds up Emacs.
## Table of Contents
diff --git a/early-init.el b/early-init.el
index c462db4..f43d019 100644
--- a/early-init.el
+++ b/early-init.el
@@ -32,7 +32,7 @@ turned on.")
(defvar minimal-emacs-frame-title-format "%b – Emacs"
"Template for displaying the title bar of visible and iconified frame.")
-(defvar minimal-emacs-debug nil
+(defvar minimal-emacs-debug (bound-and-true-p init-file-debug)
"Non-nil to enable debug.")
(defvar minimal-emacs-gc-cons-threshold (* 16 1024 1024)
@@ -71,25 +71,35 @@ minimalistic appearance during startup.")
;;; Load pre-early-init.el
+;; Prefer loading newer compiled files
+(setq load-prefer-newer t)
+
(defvar minimal-emacs--success nil)
(defvar minimal-emacs--stage "early-init.el")
(defun minimal-emacs--check-success ()
"Verify that the Emacs configuration has loaded successfully."
(unless minimal-emacs--success
- (error (concat "Configuration error in: '%s'. Debug by starting Emacs "
- "with: emacs --debug-init")
- minimal-emacs--stage)))
-(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
+ (cond
+ ((let ((user-init-basename (file-name-nondirectory user-init-file)))
+ (and (not (string= user-init-basename "init.el"))
+ (not (string= user-init-basename "early-init.el"))))
+ (error (concat "Emacs ignored loading 'init.el'. Please ensure "
+ "that files such as ~/.emacs or ~/.emacs.el do not exist, "
+ "as they may be preventing Emacs from loading the"
+ " 'init.el' file.")
+ (expand-file-name "init.el" minimal-emacs-user-directory)))
-;; Prefer loading newer compiled files
-(setq load-prefer-newer t)
+ (error (concat "Configuration error in: '%s'. Debug by starting Emacs "
+ "with: emacs --debug-init")
+ minimal-emacs--stage))))
+(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
(let ((init-file (expand-file-name filename
minimal-emacs-user-directory)))
(when (file-exists-p init-file)
- (setq minimal-emacs--stage init-file)
+ (setq minimal-emacs--stage (file-name-nondirectory init-file))
(load init-file nil t t))))
(minimal-emacs-load-user-init "pre-early-init.el")
diff --git a/init.el b/init.el
index 90614b1..52bdf57 100644
--- a/init.el
+++ b/init.el
@@ -15,6 +15,7 @@
;;; Code:
;;; Load pre-init.el
+(setq minimal-emacs--stage "init.el")
(minimal-emacs-load-user-init "pre-init.el")
(setq minimal-emacs--stage "init.el")
From 9fc291ff0e511a1e39a52d64f2f51c1e0b4ee4b2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 09:29:14 -0500
Subject: [PATCH 075/172] Remove duplicate setting: native-comp-jit-compilation
---
early-init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/early-init.el b/early-init.el
index f43d019..c6f9168 100644
--- a/early-init.el
+++ b/early-init.el
@@ -266,7 +266,7 @@ minimalistic appearance during startup.")
(native-comp-available-p))
;; Activate `native-compile'
(setq native-comp-jit-compilation t
- native-comp-deferred-compilation t ; Obsolete since Emacs 29.1
+ native-comp-deferred-compilation t
package-native-compile t)
;; Deactivate the `native-compile' feature if it is not available
(setq features (delq 'native-compile features)))
@@ -276,7 +276,6 @@ minimalistic appearance during startup.")
(or minimal-emacs-debug 'silent))
(setq native-comp-verbose (if minimal-emacs-debug 1 0)
native-comp-debug (if minimal-emacs-debug 1 0))
-(setq native-comp-jit-compilation t)
(setq native-comp-warning-on-missing-source minimal-emacs-debug)
(setq debug-on-error minimal-emacs-debug
From 58b10227f6ecd9fc13eaf5c6df15e8e89d6b8bd9 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 09:31:22 -0500
Subject: [PATCH 076/172] Group Native Compilation and Byte Compilation setq
---
early-init.el | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/early-init.el b/early-init.el
index c6f9168..897a00d 100644
--- a/early-init.el
+++ b/early-init.el
@@ -271,18 +271,15 @@ minimalistic appearance during startup.")
;; Deactivate the `native-compile' feature if it is not available
(setq features (delq 'native-compile features)))
-;; Suppress compiler warnings and don't inundate users with their popups.
-(setq native-comp-async-report-warnings-errors
- (or minimal-emacs-debug 'silent))
-(setq native-comp-verbose (if minimal-emacs-debug 1 0)
+(setq native-comp-warning-on-missing-source minimal-emacs-debug
+ native-comp-async-report-warnings-errors (or minimal-emacs-debug 'silent)
+ native-comp-verbose (if minimal-emacs-debug 1 0)
native-comp-debug (if minimal-emacs-debug 1 0))
-(setq native-comp-warning-on-missing-source minimal-emacs-debug)
-(setq debug-on-error minimal-emacs-debug
- jka-compr-verbose minimal-emacs-debug)
-
-(setq byte-compile-warnings minimal-emacs-debug)
-(setq byte-compile-verbose minimal-emacs-debug)
+(setq debug-on-error minimal-emacs-debug)
+(setq jka-compr-verbose minimal-emacs-debug)
+(setq byte-compile-warnings minimal-emacs-debug
+ byte-compile-verbose minimal-emacs-debug)
;;; UI elements
From f6ccac0ac53d53cc1db93267926578b495b76b73 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 09:32:53 -0500
Subject: [PATCH 077/172] Expand the coverage of debug-on-error to include more
code
---
early-init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index 897a00d..928b1c0 100644
--- a/early-init.el
+++ b/early-init.el
@@ -73,6 +73,7 @@ minimalistic appearance during startup.")
;; Prefer loading newer compiled files
(setq load-prefer-newer t)
+(setq debug-on-error minimal-emacs-debug)
(defvar minimal-emacs--success nil)
(defvar minimal-emacs--stage "early-init.el")
@@ -276,7 +277,6 @@ minimalistic appearance during startup.")
native-comp-verbose (if minimal-emacs-debug 1 0)
native-comp-debug (if minimal-emacs-debug 1 0))
-(setq debug-on-error minimal-emacs-debug)
(setq jka-compr-verbose minimal-emacs-debug)
(setq byte-compile-warnings minimal-emacs-debug
byte-compile-verbose minimal-emacs-debug)
From eb4495f0633031c34096475718df4123eea4a5f2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 09:34:14 -0500
Subject: [PATCH 078/172] Modify use-package-expand-minimally using
minimal-emacs-debug
---
early-init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index 928b1c0..dfea2f0 100644
--- a/early-init.el
+++ b/early-init.el
@@ -333,7 +333,7 @@ minimalistic appearance during startup.")
;; Setting use-package-expand-minimally to (t) results in a more compact output
;; that emphasizes performance over clarity.
-(setq use-package-expand-minimally (not noninteractive))
+(setq use-package-expand-minimally (not minimal-emacs-debug))
(setq use-package-minimum-reported-time (if minimal-emacs-debug 0 0.1))
(setq use-package-verbose minimal-emacs-debug)
From b885979496e81753350bc032a45bc6f474ff3b30 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 10:15:03 -0500
Subject: [PATCH 079/172] Update README.md
---
README.md | 50 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/README.md b/README.md
index 52f748f..e6f1029 100644
--- a/README.md
+++ b/README.md
@@ -41,6 +41,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Code folding](#code-folding)
- [Changing the default theme](#changing-the-default-theme)
- [Configuring vterm](#configuring-vterm)
+ - [Enhancing undo/redo](#enhancing-undoredo)
- [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
- [Session Management](#session-management)
@@ -522,6 +523,38 @@ To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
(Note that the `emacs-vterm` Emacs package requires compilation of its C components, which includes the gcc compiler and the `libvterm` library. On Debian or Ubuntu systems, the necessary packages can be installed with: `sudo apt-get install build-essential libvterm-dev libtool-bin cmake`)
+### Enhancing undo/redo
+
+The undo-fu package is a lightweight wrapper around Emacs' built-in undo system, providing more convenient undo/redo functionality while preserving access to the full undo history. The undo-fu-session package complements undo-fu by enabling the saving and restoration of undo history across Emacs sessions, even after restarting.
+
+The default undo system in Emacs has two main issues that undo-fu fixes:
+
+1. **Redo requires two steps**: To redo an action after undoing, you need to press a key twice, which can be annoying and inefficient.
+2. **Accidental over-redo**: When redoing, it's easy to go too far back, past the point where you started the undo, which makes it hard to return to the exact state you wanted to restore.
+
+To install and configure these packages, add the following to `~/.emacs.d/post-init.el`:
+```emacs-lisp
+;; The undo-fu package is a lightweight wrapper around Emacs' built-in undo
+;; system, providing more convenient undo/redo functionality.
+(use-package undo-fu
+ :defer t
+ :commands (undo-fu-only-undo
+ undo-fu-only-redo
+ undo-fu-only-redo-all
+ undo-fu-disable-checkpoint)
+ :config
+ (global-unset-key (kbd "C-z"))
+ (global-set-key (kbd "C-z") 'undo-fu-only-undo)
+ (global-set-key (kbd "C-S-z") 'undo-fu-only-redo))
+
+;; The undo-fu-session package complements undo-fu by enabling the saving
+;; and restoration of undo history across Emacs sessions, even after restarting.
+(use-package undo-fu-session
+ :defer t
+ :commands undo-fu-session-global-mode
+ :hook (after-init . undo-fu-session-global-mode))
+```
+
### Configuring Vim keybindings using Evil?
Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up Evil mode:
@@ -530,10 +563,12 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency
;; evil-want-keybinding must be declared before Evil and Evil Collection
(setq evil-want-keybinding nil)
+;; Vim emulation
(use-package evil
:ensure t
:init
- (setq evil-undo-system 'undo-fu)
+ ;; Uncomment the following if you are using undo-fu
+ ;; (setq evil-undo-system 'undo-fu)
(setq evil-want-integration t)
(setq evil-want-keybinding nil)
:custom
@@ -548,22 +583,11 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency
:config
(evil-collection-init))
-(use-package undo-fu
- :ensure t
- :commands (undo-fu-only-undo
- undo-fu-only-redo
- undo-fu-only-redo-all
- undo-fu-disable-checkpoint))
-
-(use-package undo-fu-session
- :ensure t
- :config
- (undo-fu-session-global-mode))
-
```
You can also use the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el) Emacs package to `~/.emacs.d/post-init.el` to give the built-in Emacs tab-bar a style similar to Vim's tabbed browsing interface:
``` emacs-lisp
+;; Give Emacs tab-bar a style similar to Vim's
(use-package vim-tab-bar
:ensure t
:commands vim-tab-bar-mode
From e44aa459d5eb5af2f868dc490e4d05efca308915 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 8 Mar 2025 10:18:05 -0500
Subject: [PATCH 080/172] Update display-startup-time in the README.md file
---
README.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index e6f1029..5d37fbd 100644
--- a/README.md
+++ b/README.md
@@ -1095,9 +1095,10 @@ To measure and display the time taken for Emacs to start, you can use the follow
Add the following to your `~/.emacs.d/pre-early-init.el` file:
```emacs-lisp
(defun display-startup-time ()
- "Display the startup duration and number of garbage collections."
- (message "Emacs loaded in %.2f seconds with %d garbage collections."
+ "Display the startup time and number of garbage collections."
+ (message "Emacs loaded in %.2f seconds (Init only: %.2fs) with %d garbage collections."
(time-to-seconds (time-since before-init-time))
+ (float-time (time-subtract after-init-time before-init-time))
gcs-done))
(add-hook 'emacs-startup-hook #'display-startup-time 100)
From 2e95fff1cbe6b8f4bc86bd71b51d51364b084106 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:08:54 -0400
Subject: [PATCH 081/172] Update README.md
---
README.md | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/README.md b/README.md
index 5d37fbd..7de91e5 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,6 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark)
- [Code folding](#code-folding)
- [Changing the default theme](#changing-the-default-theme)
- - [Configuring vterm](#configuring-vterm)
- [Enhancing undo/redo](#enhancing-undoredo)
- [Configuring Vim keybindings using Evil?](#configuring-vim-keybindings-using-evil)
- [Configuring LSP Servers with Eglot (built-in)](#configuring-lsp-servers-with-eglot-built-in)
@@ -502,27 +501,6 @@ If you're interested in exploring third-party Emacs themes, consider the followi
- `doom-themes` (available on MELPA): An extensive collection of high-quality, visually appealing themes for Emacs, designed to offer a sleek and modern aesthetic, while drawing inspiration from popular community themes.
- `tomorrow-night-deepblue-theme` (available on MELPA): A beautiful deep blue variant of the Tomorrow Night theme, which is renowned for its elegant color palette. It features a deep blue background color that creates a calming atmosphere. This theme is a great choice for those who miss the blue themes that were trendy a few years ago. (The theme was inspired by classic text editors such as QuickBASIC, RHIDE, and Turbo Pascal, as well as tools such as Midnight Commander.)
-### Configuring vterm
-
-The `emacs-libvterm` package is a terminal emulator integrated into GNU Emacs. Built on libvterm, a C library, it offers superior performance compared to Elisp-based alternatives. This compiled code approach enables `emacs-libvterm` to handle large outputs efficiently, providing a fast and feature-complete terminal experience within Emacs.
-
-To configure `emacs-vterm`, add the following to `~/.emacs.d/post-init.el`:
-``` emacs-lisp
-(use-package vterm
- :ensure t
- :defer t
- :commands vterm
- :custom
- ;; Important: Ensure the following dependencies are installed:
- ;; A 'C' compiler, cmake, libtool-bin, and libvterm
- (vterm-always-compile-module t) ; Auto-compile libvterm
- :config
- ;; Speed up vterm
- (setq vterm-timer-delay 0.01))
-```
-
-(Note that the `emacs-vterm` Emacs package requires compilation of its C components, which includes the gcc compiler and the `libvterm` library. On Debian or Ubuntu systems, the necessary packages can be installed with: `sudo apt-get install build-essential libvterm-dev libtool-bin cmake`)
-
### Enhancing undo/redo
The undo-fu package is a lightweight wrapper around Emacs' built-in undo system, providing more convenient undo/redo functionality while preserving access to the full undo history. The undo-fu-session package complements undo-fu by enabling the saving and restoration of undo history across Emacs sessions, even after restarting.
From 20be0215b6a0d40d1a41e04be89336e1d33ecc7b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:19:11 -0400
Subject: [PATCH 082/172] Update README.md
---
README.md | 8 --------
1 file changed, 8 deletions(-)
diff --git a/README.md b/README.md
index 7de91e5..7f51f9d 100644
--- a/README.md
+++ b/README.md
@@ -825,14 +825,6 @@ Other optional packages that may be useful include:
:hook
(emacs-lisp-mode . page-break-lines-mode))
-;; Highlights escape sequences in strings for better visibility
-(use-package easy-escape
- :ensure t
- :defer t
- :commands easy-escape-minor-mode
- :config
- (set-face-attribute 'easy-escape-face nil :foreground "red"))
-
;; Provides automatic formatting for Emacs Lisp code
(use-package elisp-autofmt
:ensure t
From cf1712dd5f350836becfaef2737116b7f743f4c0 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:23:10 -0400
Subject: [PATCH 083/172] Update README.md
---
README.md | 8 --------
1 file changed, 8 deletions(-)
diff --git a/README.md b/README.md
index 7f51f9d..34cbd40 100644
--- a/README.md
+++ b/README.md
@@ -825,14 +825,6 @@ Other optional packages that may be useful include:
:hook
(emacs-lisp-mode . page-break-lines-mode))
-;; Provides automatic formatting for Emacs Lisp code
-(use-package elisp-autofmt
- :ensure t
- :defer t
- :commands (elisp-autofmt-mode
- elisp-autofmt-buffer
- elisp-autofmt-region))
-
;; Provides functions to find references to functions, macros, variables,
;; special forms, and symbols in Emacs Lisp
(use-package elisp-refs
From 78df9ae0653d5ae720b70dc6a749e3a5dbc86012 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:24:54 -0400
Subject: [PATCH 084/172] Update README.md
---
README.md | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 34cbd40..ed54ace 100644
--- a/README.md
+++ b/README.md
@@ -792,7 +792,10 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po
:commands highlight-defined-mode
:hook
(emacs-lisp-mode . highlight-defined-mode))
+```
+Other optional packages that may be useful include:
+```emacs-lisp
;; Prevent parenthesis imbalance
(use-package paredit
:ensure t
@@ -812,10 +815,6 @@ To enhance the Elisp development experience, add the following to `~/.emacs.d/po
;; :hook
;; (paredit-mode . enhanced-evil-paredit-mode))
-```
-
-Other optional packages that may be useful include:
-```emacs-lisp
;; Displays visible indicators for page breaks
(use-package page-break-lines
:ensure t
From 7bbdaa2f35034e43adc6dbd06b8d8ad0be74dd03 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:27:45 -0400
Subject: [PATCH 085/172] Update README.md
---
README.md | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/README.md b/README.md
index ed54ace..c4b9442 100644
--- a/README.md
+++ b/README.md
@@ -587,16 +587,6 @@ You can also add `vdiff`, a package that provides Vimdiff-like functionality to
(vdiff-only-highlight-refinements t))
```
-The `evil-visualstar` package allows using `*` or `#` search from the visual selection:
-``` emacs-lisp
-(use-package evil-visualstar
- :after evil
- :ensure t
- :defer t
- :commands global-evil-visualstar-mode
- :hook (after-init . global-evil-visualstar-mode))
-```
-
The `evil-surround` package simplifies handling surrounding characters, such as parentheses, brackets, quotes, etc. It provides key bindings to easily add, change, or delete these surrounding characters in pairs. For instance, you can surround the currently selected text with double quotes in visual state using `S"` or `gS"`:
``` emacs-lisp
(use-package evil-surround
From 24310b4ef1dd4429a1dac824f3e52cf6d567da5b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:34:30 -0400
Subject: [PATCH 086/172] Update README.md
---
README.md | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/README.md b/README.md
index c4b9442..54044e6 100644
--- a/README.md
+++ b/README.md
@@ -572,21 +572,6 @@ You can also use the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el
:hook (after-init . vim-tab-bar-mode))
```
-You can also add `vdiff`, a package that provides Vimdiff-like functionality to Emacs:
-``` emacs-lisp
-(use-package vdiff
- :ensure t
- :defer t
- :commands (vdiff-buffers
- vdiff-buffers3
- vdiff-quit
- vdiff-files
- vdiff-files3)
- :custom
- (vdiff-auto-refine t)
- (vdiff-only-highlight-refinements t))
-```
-
The `evil-surround` package simplifies handling surrounding characters, such as parentheses, brackets, quotes, etc. It provides key bindings to easily add, change, or delete these surrounding characters in pairs. For instance, you can surround the currently selected text with double quotes in visual state using `S"` or `gS"`:
``` emacs-lisp
(use-package evil-surround
From 9c46722e41651fbafa5a01596485f8246c52c6af Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 09:48:32 -0400
Subject: [PATCH 087/172] Update README.md
---
README.md | 24 ++++++------------------
1 file changed, 6 insertions(+), 18 deletions(-)
diff --git a/README.md b/README.md
index 54044e6..3b82d3b 100644
--- a/README.md
+++ b/README.md
@@ -538,29 +538,25 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i
Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up Evil mode:
``` emacs-lisp
-;; evil-want-keybinding must be declared before Evil and Evil Collection
-(setq evil-want-keybinding nil)
-
;; Vim emulation
(use-package evil
:ensure t
+ :defer t
+ :commands (evil-mode evil-define-key)
+ :hook (after-init . evil-mode)
:init
;; Uncomment the following if you are using undo-fu
;; (setq evil-undo-system 'undo-fu)
+
+ ;; Required by evil-collection
(setq evil-want-integration t)
- (setq evil-want-keybinding nil)
- :custom
- (evil-want-Y-yank-to-eol t)
- :config
- (evil-select-search-module 'evil-search-module 'evil-search)
- (evil-mode 1))
+ (setq evil-want-keybinding nil))
(use-package evil-collection
:after evil
:ensure t
:config
(evil-collection-init))
-
```
You can also use the [vim-tab-bar](https://github.com/jamescherti/vim-tab-bar.el) Emacs package to `~/.emacs.d/post-init.el` to give the built-in Emacs tab-bar a style similar to Vim's tabbed browsing interface:
@@ -604,14 +600,6 @@ You can also add the following code to enable commenting and uncommenting by pre
(evil-define-key 'normal 'global (kbd "gc") 'my-evil-comment-or-uncomment))
```
-Evil-snipe provides 2-character motions for quickly jumping around text compared to Evil's built-in f/F/t/T motions, incrementally highlighting candidate targets as you type. By default, snipe only binds s (forward) and S (backward) to evil-snipe-s and evil-snipe-S, respectively. In operator mode, snipe is bound to z/Z and x/X (exclusive):
-``` emacs-lisp
-(use-package evil-snipe
- :defer t
- :commands evil-snipe-mode
- :hook (after-init . evil-snipe-mode))
-```
-
### Configuring LSP Servers with Eglot (built-in)
To set up Language Server Protocol (LSP) servers using Eglot, you can configure it in your Emacs setup as follows. This configuration ensures minimal disruption from Eglot's progress reporting and optimizes performance by disabling unnecessary logging.
From f7dd627478e57fe9841222d9271762b5141fb2f2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 12:18:17 -0400
Subject: [PATCH 088/172] Update README.md
---
README.md | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 3b82d3b..5a5f0d3 100644
--- a/README.md
+++ b/README.md
@@ -539,18 +539,19 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency
``` emacs-lisp
;; Vim emulation
+(eval-when-compile
+ ;; Required by evil-collection
+ (setq evil-want-integration t)
+ (setq evil-want-keybinding nil))
+
+;; Uncomment the following if you are using undo-fu
+;; (setq evil-undo-system 'undo-fu)
+
(use-package evil
:ensure t
:defer t
:commands (evil-mode evil-define-key)
- :hook (after-init . evil-mode)
- :init
- ;; Uncomment the following if you are using undo-fu
- ;; (setq evil-undo-system 'undo-fu)
-
- ;; Required by evil-collection
- (setq evil-want-integration t)
- (setq evil-want-keybinding nil))
+ :hook (after-init . evil-mode))
(use-package evil-collection
:after evil
From 0be609bd24f0886cc5c3950c42b0c5483aba0721 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 9 Mar 2025 13:19:14 -0400
Subject: [PATCH 089/172] Update README.md
---
README.md | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 5a5f0d3..ac309e1 100644
--- a/README.md
+++ b/README.md
@@ -538,15 +538,14 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i
Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up Evil mode:
``` emacs-lisp
-;; Vim emulation
-(eval-when-compile
- ;; Required by evil-collection
- (setq evil-want-integration t)
- (setq evil-want-keybinding nil))
+;; Required by evil-collection
+(setq evil-want-integration t)
+(setq evil-want-keybinding nil)
;; Uncomment the following if you are using undo-fu
;; (setq evil-undo-system 'undo-fu)
+;; Vim emulation
(use-package evil
:ensure t
:defer t
From 34e926b26cf082b5847cf6d5a9e42a3b785b4aa0 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Mon, 10 Mar 2025 11:41:05 -0400
Subject: [PATCH 090/172] Update minimal-emacs--check-success
---
early-init.el | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/early-init.el b/early-init.el
index dfea2f0..6aef9ab 100644
--- a/early-init.el
+++ b/early-init.el
@@ -81,18 +81,9 @@ minimalistic appearance during startup.")
"Verify that the Emacs configuration has loaded successfully."
(unless minimal-emacs--success
(cond
- ((let ((user-init-basename (file-name-nondirectory user-init-file)))
- (and (not (string= user-init-basename "init.el"))
- (not (string= user-init-basename "early-init.el"))))
- (error (concat "Emacs ignored loading 'init.el'. Please ensure "
- "that files such as ~/.emacs or ~/.emacs.el do not exist, "
- "as they may be preventing Emacs from loading the"
- " 'init.el' file.")
- (expand-file-name "init.el" minimal-emacs-user-directory)))
-
- (error (concat "Configuration error in: '%s'. Debug by starting Emacs "
- "with: emacs --debug-init")
- minimal-emacs--stage))))
+ (t (error (concat "Configuration error in: '%s'. Debug by starting Emacs "
+ "with: emacs --debug-init")
+ minimal-emacs--stage)))))
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
(defun minimal-emacs-load-user-init (filename)
From ef460b51e875bb7f6bb2b17f89037d2c92e9efc6 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Mon, 10 Mar 2025 22:38:15 -0400
Subject: [PATCH 091/172] Update README.md
---
README.md | 45 ++++++++++++++++++++++++++++++++++++++-------
1 file changed, 38 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index ac309e1..ff2ab55 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Session Management](#session-management)
- [Configuring org-mode](#configuring-org-mode)
- [Inhibit the mouse](#inhibit-the-mouse)
+ - [Spell checker](#spell-checker)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
- [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel)
@@ -712,6 +713,43 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`:
NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed.
+### Spell checker
+
+The `flyspell` package is a built-in Emacs minor mode that provides on-the-fly spell checking. It highlights misspelled words as you type, offering interactive corrections. In text modes, it checks the entire buffer, while in programming modes, it typically checks only comments and strings. It integrates with external spell checkers like `aspell`, `hunspell`, or `ispell` to provide suggestions and corrections.
+
+To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`:
+``` emacs-lisp
+(use-package ispell
+ :ensure nil
+ :defer t
+ :commands (ispell ispell-minor-mode)
+ :custom
+ ;; Set the ispell program name to aspell
+ (ispell-program-name "aspell")
+
+ ;; Configures Aspell's suggestion mode to "ultra", which provides more
+ ;; aggressive and detailed suggestions for misspelled words. The language
+ ;; is set to "en_US" for US English, which can be replaced with your desired
+ ;; language code (e.g., "en_GB" for British English, "de_DE" for German).
+ (ispell-extra-args '("--sug-mode=ultra" "--lang=en_US")))
+
+(use-package flyspell
+ :ensure nil
+ :defer t
+ :commands flyspell-mode
+ :hook
+ ((text-mode . flyspell-mode)
+ (prog-mode . flyspell-prog-mode))
+ :config
+ ;; Remove strings from Flyspell
+ (setq flyspell-prog-text-faces (delq 'font-lock-string-face
+ flyspell-prog-text-faces))
+
+ ;; Remove docstrings from Flyspell
+ (setq flyspell-prog-text-faces (delq 'font-lock-doc-face
+ flyspell-prog-text-faces)))
+```
+
### A better Emacs *help* buffer
Helpful is an alternative to the built-in Emacs help that provides much more contextual information.
@@ -889,13 +927,6 @@ To prevent Emacs from saving customization information to a custom file, set `cu
;; Enable on-the-fly spell checking (Flyspell mode).
(add-hook 'text-mode-hook #'flyspell-mode)
-;; Configures Aspell's suggestion mode to "ultra", which provides more
-;; aggressive and detailed suggestions for misspelled words. The language
-;; is set to "en_US" for US English, which can be replaced with your desired
-;; language code (e.g., "en_GB" for British English, "de_DE" for German).
-(setq ispell-program-name "aspell")
-(setq ispell-extra-args '("--sug-mode=ultra" "--lang=en_US"))
-
;; Configure Emacs to ask for confirmation before exiting
(setq confirm-kill-emacs 'y-or-n-p)
From c52d9468b3bb61de83dd2817dc3c482badd2ed4a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 11 Mar 2025 12:09:37 -0400
Subject: [PATCH 092/172] Update README.md
---
README.md | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index ff2ab55..a3e0846 100644
--- a/README.md
+++ b/README.md
@@ -738,14 +738,19 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`:
:defer t
:commands flyspell-mode
:hook
- ((text-mode . flyspell-mode)
- (prog-mode . flyspell-prog-mode))
+ ((prog-mode . flyspell-prog-mode)
+ (text-mode . (lambda()
+ (if (or (derived-mode-p 'yaml-mode)
+ (derived-mode-p 'yaml-ts-mode)
+ (derived-mode-p 'ansible-mode))
+ (flyspell-prog-mode)
+ (flyspell-mode 1)))))
:config
;; Remove strings from Flyspell
(setq flyspell-prog-text-faces (delq 'font-lock-string-face
flyspell-prog-text-faces))
- ;; Remove docstrings from Flyspell
+ ;; Remove doc from Flyspell
(setq flyspell-prog-text-faces (delq 'font-lock-doc-face
flyspell-prog-text-faces)))
```
@@ -924,9 +929,6 @@ To prevent Emacs from saving customization information to a custom file, set `cu
"\\|^flymake_.*"))
(add-hook 'dired-mode-hook #'dired-omit-mode)
-;; Enable on-the-fly spell checking (Flyspell mode).
-(add-hook 'text-mode-hook #'flyspell-mode)
-
;; Configure Emacs to ask for confirmation before exiting
(setq confirm-kill-emacs 'y-or-n-p)
From a866f750be27ff694be31a2344a5e17dc21748cc Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 11 Mar 2025 14:27:13 -0400
Subject: [PATCH 093/172] Refactor minimal-emacs.d
---
.github/workflows/ci.yml | 42 +++++
.gitignore | 1 +
README.md | 2 +
early-init.el | 374 ++++++++++++++++++++++-----------------
init.el | 49 +++--
5 files changed, 283 insertions(+), 185 deletions(-)
create mode 100644 .github/workflows/ci.yml
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..33a3756
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,42 @@
+---
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This file is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Emacs. If not, see .
+#
+
+name: CI
+on: [push, pull_request]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ emacs-version:
+ - 29.1
+ - 29.4
+ - 30.1
+ python-version:
+ - 3.11
+ steps:
+ # Cask
+ - uses: actions/checkout@v2
+ - uses: purcell/setup-emacs@master
+ with:
+ version: ${{ matrix.emacs-version }}
+
+ - name: Compile
+ run: |
+ LISP_ERR_ON_WARN="(setq byte-compile-error-on-warn t) (setq byte-compile-warnings '(not obsolete free-vars))"
+ emacs -batch -L . --eval "(progn $LISP_ERR_ON_WARN )" -f batch-byte-compile early-init.el
+ emacs -batch -L . --eval "(progn $LISP_ERR_ON_WARN (load \"early-init.el\" nil t t) )" -f batch-byte-compile init.el
diff --git a/.gitignore b/.gitignore
index e787da3..85d862e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@
!early-init.el
!init.el
!.images/
+!.github/
!.LICENSE
diff --git a/README.md b/README.md
index a3e0846..eaa7aba 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,6 @@
# *minimal-emacs.d* - A Customizable Emacs `init.el` and `early-init.el` that Provides Better Defaults and Faster Startup
+
+
[](https://www.gnu.org/licenses/gpl-3.0)
The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup.
diff --git a/early-init.el b/early-init.el
index 6aef9ab..71b2364 100644
--- a/early-init.el
+++ b/early-init.el
@@ -1,4 +1,4 @@
-;;; early-init.el --- Early Init -*- no-byte-compile: t; lexical-binding: t; -*-
+;;; early-init.el --- Early Init -*- lexical-binding: t; -*-
;; Author: James Cherti
;; URL: https://github.com/jamescherti/minimal-emacs.d
@@ -18,16 +18,12 @@
(defvar minimal-emacs-ui-features '()
"List of user interface features to disable in minimal Emacs setup.
-
This variable holds a list Emacs UI features that can be enabled:
- `context-menu`: Enables the context menu in graphical environments.
- `tool-bar`: Enables the tool bar in graphical environments.
- `menu-bar`: Enables the menu bar in graphical environments.
- `dialogs`: Enables both file dialogs and dialog boxes.
-- `tooltips`: Enables tooltips.
-
-Each feature in the list corresponds to a specific UI component that can be
-turned on.")
+- `tooltips`: Enables tooltips.")
(defvar minimal-emacs-frame-title-format "%b – Emacs"
"Template for displaying the title bar of visible and iconified frame.")
@@ -60,7 +56,9 @@ By disabling startup messages, this slightly enhances performance and provides a
cleaner startup. The tradeoff is that you won't be informed of the progress or
any relevant activities during startup.")
-(defvar minimal-emacs-disable-mode-line-during-startup nil
+(defvar minimal-emacs--optimize-file-name-handler-alist t)
+
+(defvar minimal-emacs-disable-mode-line-during-startup t
"Disable the mode line during startup to improve performance.
This reduces visual clutter and slightly enhances startup performance. The
tradeoff is that the mode line is hidden during the startup phase, giving a more
@@ -81,9 +79,16 @@ minimalistic appearance during startup.")
"Verify that the Emacs configuration has loaded successfully."
(unless minimal-emacs--success
(cond
- (t (error (concat "Configuration error in: '%s'. Debug by starting Emacs "
- "with: emacs --debug-init")
- minimal-emacs--stage)))))
+ ((and (or (string= minimal-emacs--stage "pre-early-init.el")
+ (string= minimal-emacs--stage "early-init.el")
+ (string= minimal-emacs--stage "post-early-init.el"))
+ (or (file-exists-p (expand-file-name "~/.emacs.el"))
+ (file-exists-p (expand-file-name "~/.emacs"))))
+ (error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file"))
+
+ (t
+ (error "Configuration error in: '%s'. Debug by starting Emacs with: emacs --debug-init"
+ minimal-emacs--stage)))))
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
(defun minimal-emacs-load-user-init (filename)
@@ -92,7 +97,7 @@ minimalistic appearance during startup.")
minimal-emacs-user-directory)))
(when (file-exists-p init-file)
(setq minimal-emacs--stage (file-name-nondirectory init-file))
- (load init-file nil t t))))
+ (load init-file nil t))))
(minimal-emacs-load-user-init "pre-early-init.el")
(setq minimal-emacs--stage "early-init.el")
@@ -105,152 +110,16 @@ minimalistic appearance during startup.")
;; Garbage collection significantly affects startup times. This setting delays
;; garbage collection during startup but will be reset later.
+(setq garbage-collection-messages minimal-emacs-debug)
+
+(defun minimal-emacs--restore-gc-cons-threshold ()
+ "Restore `minimal-emacs-gc-cons-threshold'."
+ (setq gc-cons-threshold minimal-emacs-gc-cons-threshold))
+
(when minimal-emacs-optimize-startup-gc
(setq gc-cons-threshold most-positive-fixnum)
-
- (defun minimal-emacs--restore-gc-cons-threshold ()
- "Restore `minimal-emacs-gc-cons-threshold'."
- (setq gc-cons-threshold minimal-emacs-gc-cons-threshold))
(add-hook 'emacs-startup-hook #'minimal-emacs--restore-gc-cons-threshold 105))
-;;; Misc
-
-(set-language-environment "UTF-8")
-
-;; Set-language-environment sets default-input-method, which is unwanted.
-(setq default-input-method nil)
-
-(setq warning-minimum-level (if minimal-emacs-debug :warning :error))
-
-;;; Performance
-
-;; Font compacting can be very resource-intensive, especially when rendering
-;; icon fonts on Windows. This will increase memory usage.
-(setq inhibit-compacting-font-caches t)
-
-(unless (daemonp)
- (let ((old-value (default-toplevel-value 'file-name-handler-alist)))
- ;; Determine the state of bundled libraries using calc-loaddefs.el.
- ;; If compressed, retain the gzip handler in `file-name-handler-alist`.
- ;; If compiled or neither, omit the gzip handler during startup for
- ;; improved startup and package load time.
- (set-default-toplevel-value 'file-name-handler-alist
- (if (eval-when-compile
- (locate-file-internal "calc-loaddefs.el"
- load-path))
- nil
- (list (rassq 'jka-compr-handler old-value))))
- ;; Ensure the new value persists through any current let-binding.
- (put 'file-name-handler-alist 'initial-value old-value)
- ;; Emacs processes command-line files very early in startup. These files may
- ;; include special paths like TRAMP paths, so restore
- ;; `file-name-handler-alist' for this stage of initialization.
- (define-advice command-line-1 (:around (fn args-left) respect-file-handlers)
- (let ((file-name-handler-alist
- (if args-left old-value file-name-handler-alist)))
- (funcall fn args-left)))
-
- ;; Restore the old value to reset it as needed.
- (defun minimal-emacs--restore-file-name-handler-alist ()
- "Restore `file-name-handler-alist'."
- (set-default-toplevel-value
- 'file-name-handler-alist
- ;; Merge instead of overwrite to preserve any changes made since startup.
- (delete-dups (append file-name-handler-alist old-value))))
-
- (add-hook
- 'emacs-startup-hook #'minimal-emacs--restore-file-name-handler-alist 101))
-
- (unless noninteractive
- (unless minimal-emacs-debug
- (when minimal-emacs-inhibit-redisplay-during-startup
- ;; Suppress redisplay and redraw during startup to avoid delays and
- ;; prevent flashing an unstyled Emacs frame.
- (defun minimal-emacs--reset-inhibit-redisplay ()
- (setq-default inhibit-redisplay nil)
- (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay))
-
- (setq-default inhibit-redisplay t)
- (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay -100))
-
- (when minimal-emacs-inhibit-message-during-startup
- (defun minimal-emacs--reset-inhibit-message ()
- (setq-default inhibit-message nil)
- (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message))
-
- (setq-default inhibit-message t)
- (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message -100))
-
- (put 'mode-line-format
- 'initial-value (default-toplevel-value 'mode-line-format))
- (when minimal-emacs-disable-mode-line-during-startup
- (setq-default mode-line-format nil)
- (dolist (buf (buffer-list))
- (with-current-buffer buf
- (setq mode-line-format nil))))
-
- (defun minimal-emacs--startup-load-user-init-file (fn &rest args)
- "Advice for startup--load-user-init-file to reset mode-line-format."
- (unwind-protect
- ;; Start up as normal
- (apply fn args)
- ;; If we don't undo inhibit-{message, redisplay} and there's an
- ;; error, we'll see nothing but a blank Emacs frame.
- (when minimal-emacs-inhibit-message-during-startup
- (setq-default inhibit-message nil))
- (when minimal-emacs-inhibit-redisplay-during-startup
- (setq-default inhibit-redisplay nil))
- ;; Restore the mode-line
- (when minimal-emacs-disable-mode-line-during-startup
- (unless (default-toplevel-value 'mode-line-format)
- (setq-default mode-line-format (get 'mode-line-format
- 'initial-value))))))
-
- (advice-add 'startup--load-user-init-file :around
- #'minimal-emacs--startup-load-user-init-file))
-
- ;; Without this, Emacs will try to resize itself to a specific column size
- (setq frame-inhibit-implied-resize t)
-
- ;; A second, case-insensitive pass over `auto-mode-alist' is time wasted.
- ;; No second pass of case-insensitive search over auto-mode-alist.
- (setq auto-mode-case-fold nil)
-
- ;; Reduce *Message* noise at startup. An empty scratch buffer (or the
- ;; dashboard) is more than enough, and faster to display.
- (setq inhibit-startup-screen t
- inhibit-startup-echo-area-message user-login-name)
- (setq initial-buffer-choice nil
- inhibit-startup-buffer-menu t
- inhibit-x-resources t)
-
- ;; Disable bidirectional text scanning for a modest performance boost.
- (setq-default bidi-display-reordering 'left-to-right
- bidi-paragraph-direction 'left-to-right)
-
- ;; Give up some bidirectional functionality for slightly faster re-display.
- (setq bidi-inhibit-bpa t)
-
- ;; Remove "For information about GNU Emacs..." message at startup
- (advice-add #'display-startup-echo-area-message :override #'ignore)
-
- ;; Suppress the vanilla startup screen completely. We've disabled it with
- ;; `inhibit-startup-screen', but it would still initialize anyway.
- (advice-add #'display-startup-screen :override #'ignore)
-
- ;; Shave seconds off startup time by starting the scratch buffer in
- ;; `fundamental-mode'
- (setq initial-major-mode 'fundamental-mode
- initial-scratch-message nil)
-
- (unless minimal-emacs-debug
- ;; Unset command line options irrelevant to the current OS. These options
- ;; are still processed by `command-line-1` but have no effect.
- (unless (eq system-type 'darwin)
- (setq command-line-ns-option-alist nil))
- (unless (memq initial-window-system '(x pgtk))
- (setq command-line-x-option-alist nil)))))
-
;;; Native compilation and Byte compilation
(if (and (featurep 'native-compile)
@@ -272,6 +141,184 @@ minimalistic appearance during startup.")
(setq byte-compile-warnings minimal-emacs-debug
byte-compile-verbose minimal-emacs-debug)
+;;; Miscellaneous
+
+(set-language-environment "UTF-8")
+
+;; Set-language-environment sets default-input-method, which is unwanted.
+(setq default-input-method nil)
+
+;; Increase how much is read from processes in a single chunk
+(setq read-process-output-max (* 2 1024 1024)) ; 1024kb
+
+(setq process-adaptive-read-buffering nil)
+
+;; Don't ping things that look like domain names.
+(setq ffap-machine-p-known 'reject)
+
+(setq warning-minimum-level (if minimal-emacs-debug :warning :error))
+(setq warning-suppress-types '((lexical-binding)))
+
+;;; Performance: Miscellaneous options
+
+;; Font compacting can be very resource-intensive, especially when rendering
+;; icon fonts on Windows. This will increase memory usage.
+(setq inhibit-compacting-font-caches t)
+
+(when (and (not (daemonp)) (not noninteractive))
+ ;; Without this, Emacs will try to resize itself to a specific column size
+ (setq frame-inhibit-implied-resize t)
+
+ ;; A second, case-insensitive pass over `auto-mode-alist' is time wasted.
+ ;; No second pass of case-insensitive search over auto-mode-alist.
+ (setq auto-mode-case-fold nil)
+
+ ;; Reduce *Message* noise at startup. An empty scratch buffer (or the
+ ;; dashboard) is more than enough, and faster to display.
+ (setq inhibit-startup-screen t
+ inhibit-startup-echo-area-message user-login-name)
+ (setq initial-buffer-choice nil
+ inhibit-startup-buffer-menu t
+ inhibit-x-resources t)
+
+ ;; Disable bidirectional text scanning for a modest performance boost.
+ (setq-default bidi-display-reordering 'left-to-right
+ bidi-paragraph-direction 'left-to-right)
+
+ ;; Give up some bidirectional functionality for slightly faster re-display.
+ (setq bidi-inhibit-bpa t)
+
+ ;; Remove "For information about GNU Emacs..." message at startup
+ (advice-add 'display-startup-echo-area-message :override #'ignore)
+
+ ;; Suppress the vanilla startup screen completely. We've disabled it with
+ ;; `inhibit-startup-screen', but it would still initialize anyway.
+ (advice-add 'display-startup-screen :override #'ignore)
+
+ ;; Shave seconds off startup time by starting the scratch buffer in
+ ;; `fundamental-mode'
+ (setq initial-major-mode 'fundamental-mode
+ initial-scratch-message nil)
+
+ (unless minimal-emacs-debug
+ ;; Unset command line options irrelevant to the current OS. These options
+ ;; are still processed by `command-line-1` but have no effect.
+ (unless (eq system-type 'darwin)
+ (setq command-line-ns-option-alist nil))
+ (unless (memq initial-window-system '(x pgtk))
+ (setq command-line-x-option-alist nil))))
+
+;;; Performance: File-name-handler-alist
+
+(defvar minimal-emacs--old-file-name-handler-alist (default-toplevel-value
+ 'file-name-handler-alist))
+
+(defun minimal-emacs--respect-file-handlers (fn args-left)
+ "Respect file handlers.
+FN is the function and ARGS-LEFT is the same argument as `command-line-1'.
+Emacs processes command-line files very early in startup. These files may
+include special paths like TRAMP paths, so restore `file-name-handler-alist' for
+this stage of initialization."
+ (let ((file-name-handler-alist (if args-left
+ minimal-emacs--old-file-name-handler-alist
+ file-name-handler-alist)))
+ (funcall fn args-left)))
+
+(defun minimal-emacs--restore-file-name-handler-alist ()
+ "Restore `file-name-handler-alist'."
+ (set-default-toplevel-value
+ 'file-name-handler-alist
+ ;; Merge instead of overwrite to preserve any changes made since startup.
+ (delete-dups (append file-name-handler-alist
+ minimal-emacs--old-file-name-handler-alist))))
+
+(when (and minimal-emacs--optimize-file-name-handler-alist
+ (not (daemonp))
+ (not minimal-emacs-debug))
+ ;; Determine the state of bundled libraries using calc-loaddefs.el. If
+ ;; compressed, retain the gzip handler in `file-name-handler-alist`. If
+ ;; compiled or neither, omit the gzip handler during startup for improved
+ ;; startup and package load time.
+ (set-default-toplevel-value
+ 'file-name-handler-alist
+ (if (locate-file-internal "calc-loaddefs.el" load-path)
+ nil
+ (list (rassq 'jka-compr-handler
+ minimal-emacs--old-file-name-handler-alist))))
+
+ ;; Ensure the new value persists through any current let-binding.
+ (put 'file-name-handler-alist 'initial-value
+ minimal-emacs--old-file-name-handler-alist)
+
+ ;; Emacs processes command-line files very early in startup. These files may
+ ;; include special paths TRAMP. Restore `file-name-handler-alist'.
+ (advice-add 'command-line-1 :around #'minimal-emacs--respect-file-handlers)
+
+ (add-hook 'emacs-startup-hook #'minimal-emacs--restore-file-name-handler-alist
+ 101))
+
+;;; Performance: Inhibit redisplay
+
+(defun minimal-emacs--reset-inhibit-redisplay ()
+ "Reset inhibit redisplay."
+ (setq-default inhibit-redisplay nil)
+ (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay))
+
+(when (and minimal-emacs-inhibit-redisplay-during-startup
+ (not (daemonp))
+ (not noninteractive)
+ (not minimal-emacs-debug))
+ ;; Suppress redisplay and redraw during startup to avoid delays and
+ ;; prevent flashing an unstyled Emacs frame.
+ (setq-default inhibit-redisplay t)
+ (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay -100))
+
+;;; Performance: Inhibit message
+
+(defun minimal-emacs--reset-inhibit-message ()
+ "Reset inhibit message."
+ (setq-default inhibit-message nil)
+ (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message))
+
+(when (and minimal-emacs-inhibit-message-during-startup
+ (not (daemonp))
+ (not noninteractive)
+ (not minimal-emacs-debug))
+ (setq-default inhibit-message t)
+ (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message -100))
+
+;;; Performance: Disable mode-line during startup
+
+(defun minimal-emacs--startup-load-user-init-file (fn &rest args)
+ "Advice to reset `mode-line-format'. FN and ARGS are the function and args."
+ (unwind-protect
+ ;; Start up as normal
+ (apply fn args)
+ ;; If we don't undo inhibit-{message, redisplay} and there's an error, we'll
+ ;; see nothing but a blank Emacs frame.
+ (when minimal-emacs-inhibit-message-during-startup
+ (setq-default inhibit-message nil))
+ (when minimal-emacs-inhibit-redisplay-during-startup
+ (setq-default inhibit-redisplay nil))
+ ;; Restore the mode-line
+ (when minimal-emacs-disable-mode-line-during-startup
+ (unless (default-toplevel-value 'mode-line-format)
+ (setq-default mode-line-format (get 'mode-line-format
+ 'initial-value))))))
+
+(when (and minimal-emacs-disable-mode-line-during-startup
+ (not (daemonp))
+ (not noninteractive)
+ (not minimal-emacs-debug))
+ (put 'mode-line-format
+ 'initial-value (default-toplevel-value 'mode-line-format))
+ (setq-default mode-line-format nil)
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (setq mode-line-format nil)))
+ (advice-add 'startup--load-user-init-file :around
+ #'minimal-emacs--startup-load-user-init-file))
+
;;; UI elements
(setq frame-title-format minimal-emacs-frame-title-format
@@ -290,17 +337,22 @@ minimalistic appearance during startup.")
(unless (memq window-system '(mac ns))
(setq menu-bar-mode nil)))
+(defun minimal-emacs--setup-toolbar (&rest _)
+ "Setup the toolbar."
+ (when (fboundp 'tool-bar-setup)
+ (advice-remove 'tool-bar-setup #'ignore)
+ (when (bound-and-true-p tool-bar-mode)
+ (funcall 'tool-bar-setup))))
+
(unless (daemonp)
(unless noninteractive
(when (fboundp 'tool-bar-setup)
;; Temporarily override the tool-bar-setup function to prevent it from
;; running during the initial stages of startup
- (advice-add #'tool-bar-setup :override #'ignore)
- (define-advice startup--load-user-init-file
- (:after (&rest _) minimal-emacs-setup-toolbar)
- (advice-remove #'tool-bar-setup #'ignore)
- (when tool-bar-mode
- (tool-bar-setup))))))
+ (advice-add 'tool-bar-setup :override #'ignore)
+
+ (advice-add 'startup--load-user-init-file :after
+ #'minimal-emacs--setup-toolbar))))
(unless (memq 'tool-bar minimal-emacs-ui-features)
(push '(tool-bar-lines . 0) default-frame-alist)
(setq tool-bar-mode nil))
@@ -345,4 +397,8 @@ minimalistic appearance during startup.")
(provide 'early-init)
+;; Local variables:
+;; byte-compile-warnings: (not obsolete free-vars)
+;; End:
+
;;; early-init.el ends here
diff --git a/init.el b/init.el
index 52bdf57..e9b03f2 100644
--- a/init.el
+++ b/init.el
@@ -1,4 +1,4 @@
-;;; init.el --- Init -*- no-byte-compile: t; lexical-binding: t; -*-
+;;; init.el --- Init -*- lexical-binding: t; -*-
;; Author: James Cherti
;; URL: https://github.com/jamescherti/minimal-emacs.d
@@ -16,23 +16,23 @@
;;; Load pre-init.el
(setq minimal-emacs--stage "init.el")
-(minimal-emacs-load-user-init "pre-init.el")
+(if (fboundp 'minimal-emacs-load-user-init)
+ (minimal-emacs-load-user-init "pre-init.el")
+ (error "The early-init.el file failed to loaded"))
(setq minimal-emacs--stage "init.el")
;;; Before package
-;; Increase how much is read from processes in a single chunk
-(setq read-process-output-max (* 2 1024 1024)) ; 1024kb
-
-(setq process-adaptive-read-buffering nil)
-
-;; Don't ping things that look like domain names.
-(setq ffap-machine-p-known 'reject)
-
;; Ask the user whether to terminate asynchronous compilations on exit.
;; This prevents native compilation from leaving temporary files in /tmp.
(setq native-comp-async-query-on-exit t)
+;; Allow for shorter responses: "y" for yes and "n" for no.
+(setq read-answer-short t)
+(if (boundp 'use-short-answers)
+ (setq use-short-answers t)
+ (advice-add 'yes-or-no-p :override #'y-or-n-p))
+
;;; Undo/redo
(setq undo-limit (* 13 160000)
@@ -44,26 +44,22 @@
(when (bound-and-true-p minimal-emacs-package-initialize-and-refresh)
;; Initialize and refresh package contents again if needed
(package-initialize)
- (unless package-archive-contents
+ (unless (seq-empty-p package-archive-contents)
(package-refresh-contents))
;; Install use-package if necessary
(unless (package-installed-p 'use-package)
(package-install 'use-package))
- ;; Ensure use-package is available at compile time
+ ;; Ensure use-package is available
(eval-when-compile
(require 'use-package)))
-;; Ensure the 'use-package' package is installed and loaded
-
;;; Features, warnings, and errors
;; Disable warnings from the legacy advice API. They aren't useful.
(setq ad-redefinition-action 'accept)
-(setq warning-suppress-types '((lexical-binding)))
-
;;; Minibuffer
;; Allow nested minibuffers
@@ -79,11 +75,6 @@
;; By default, Emacs "updates" its ui more often than it needs to
(setq idle-update-delay 1.0)
-;; Allow for shorter responses: "y" for yes and "n" for no.
-(setq read-answer-short t)
-(if (boundp 'use-short-answers)
- (setq use-short-answers t)
- (advice-add #'yes-or-no-p :override #'y-or-n-p))
(defalias #'view-hello-file #'ignore) ; Never show the hello file
;; No beeping or blinking
@@ -427,8 +418,8 @@
;;; Ediff
;; Configure Ediff to use a single frame and split windows horizontally
-(setq ediff-window-setup-function #'ediff-setup-windows-plain
- ediff-split-window-function #'split-window-horizontally)
+(setq ediff-window-setup-function 'ediff-setup-windows-plain
+ ediff-split-window-function 'split-window-horizontally)
;;; Help
@@ -515,8 +506,8 @@
;;; xref
;; Enable completion in the minibuffer instead of the definitions buffer
-(setq xref-show-definitions-function #'xref-show-definitions-completing-read
- xref-show-xrefs-function #'xref-show-definitions-completing-read)
+(setq xref-show-definitions-function 'xref-show-definitions-completing-read
+ xref-show-xrefs-function 'xref-show-definitions-completing-read)
;;; abbrev
@@ -540,8 +531,14 @@
(put cmd 'disabled nil))
;;; Load post init
-(minimal-emacs-load-user-init "post-init.el")
+(when (fboundp 'minimal-emacs-load-user-init)
+ (minimal-emacs-load-user-init "post-init.el"))
(setq minimal-emacs--success t)
(provide 'init)
+
+;; Local variables:
+;; byte-compile-warnings: (not obsolete free-vars)
+;; End:
+
;;; init.el ends here
From 4eb6947f783450f0baf0b8548226adcb2333b2fe Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 11 Mar 2025 14:30:29 -0400
Subject: [PATCH 094/172] Rename variable to
minimal-emacs-optimize-file-name-handler-alist
---
early-init.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/early-init.el b/early-init.el
index 71b2364..f1ab1cb 100644
--- a/early-init.el
+++ b/early-init.el
@@ -56,7 +56,7 @@ By disabling startup messages, this slightly enhances performance and provides a
cleaner startup. The tradeoff is that you won't be informed of the progress or
any relevant activities during startup.")
-(defvar minimal-emacs--optimize-file-name-handler-alist t)
+(defvar minimal-emacs-optimize-file-name-handler-alist t)
(defvar minimal-emacs-disable-mode-line-during-startup t
"Disable the mode line during startup to improve performance.
@@ -232,7 +232,7 @@ this stage of initialization."
(delete-dups (append file-name-handler-alist
minimal-emacs--old-file-name-handler-alist))))
-(when (and minimal-emacs--optimize-file-name-handler-alist
+(when (and minimal-emacs-optimize-file-name-handler-alist
(not (daemonp))
(not minimal-emacs-debug))
;; Determine the state of bundled libraries using calc-loaddefs.el. If
From c8424cb94c6c1f87b7b9e521778c14b370805d1f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 11 Mar 2025 14:31:05 -0400
Subject: [PATCH 095/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index eaa7aba..338e2dd 100644
--- a/README.md
+++ b/README.md
@@ -127,7 +127,7 @@ The minimal-emacs.d init files support additional customization files that are l
Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-early-init.el` files with the following header to prevent them from being byte-compiled and to activate lexical binding:
```elisp
-;;; FILENAME.el --- DESCRIPTION -*- no-byte-compile: t; lexical-binding: t; -*-
+;;; FILENAME.el --- DESCRIPTION -*- lexical-binding: t; -*-
```
(Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.)
From 70d5507ed130f7b657da61b9e8df9dbe5f599394 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 11 Mar 2025 14:49:50 -0400
Subject: [PATCH 096/172] Update comments
---
early-init.el | 99 +++++++++++++++++++++++++++------------------------
init.el | 38 +++++++-------------
2 files changed, 65 insertions(+), 72 deletions(-)
diff --git a/early-init.el b/early-init.el
index f1ab1cb..7675277 100644
--- a/early-init.el
+++ b/early-init.el
@@ -19,11 +19,11 @@
(defvar minimal-emacs-ui-features '()
"List of user interface features to disable in minimal Emacs setup.
This variable holds a list Emacs UI features that can be enabled:
-- `context-menu`: Enables the context menu in graphical environments.
-- `tool-bar`: Enables the tool bar in graphical environments.
-- `menu-bar`: Enables the menu bar in graphical environments.
-- `dialogs`: Enables both file dialogs and dialog boxes.
-- `tooltips`: Enables tooltips.")
+- context-menu (Enables the context menu in graphical environments.)
+- tool-bar (Enables the tool bar in graphical environments.)
+- menu-bar (Enables the menu bar in graphical environments.)
+- dialogs (Enables both file dialogs and dialog boxes.)
+- tooltips (Enables tooltips.)")
(defvar minimal-emacs-frame-title-format "%b – Emacs"
"Template for displaying the title bar of visible and iconified frame.")
@@ -31,39 +31,40 @@ This variable holds a list Emacs UI features that can be enabled:
(defvar minimal-emacs-debug (bound-and-true-p init-file-debug)
"Non-nil to enable debug.")
-(defvar minimal-emacs-gc-cons-threshold (* 16 1024 1024)
- "The value of `gc-cons-threshold' after Emacs startup.")
+(defvar minimal-emacs-gc-cons-threshold (* 32 1024 1024)
+ "Value to set `gc-cons-threshold' to after Emacs startup.
+Ignored if `minimal-emacs-optimize-startup-gc' is nil.")
(defvar minimal-emacs-optimize-startup-gc t
"If non-nil, increase `gc-cons-threshold' during startup to reduce pauses.
After Emacs finishes loading, `gc-cons-threshold' is restored to the value
stored in `minimal-emacs--restore-gc-cons-threshold'.")
+(defvar minimal-emacs-inhibit-redisplay-during-startup nil
+ "Suppress redisplay during startup to improve performance.
+This prevents visual updates while Emacs initializes. The tradeoff is that you
+won't see the progress or activities during the startup process.")
+
+(defvar minimal-emacs-inhibit-message-during-startup nil
+ "Suppress startup messages for a cleaner experience.
+This slightly enhances performance. The tradeoff is that you won't be informed
+of the progress or any relevant activities during startup.")
+
+(defvar minimal-emacs-optimize-file-name-handler-alist t
+ "Enable optimization of `file-name-handler-alist'.
+When non-nil, this variable activates optimizations to reduce file name handler
+lookups during Emacs startup.")
+
+(defvar minimal-emacs-disable-mode-line-during-startup t
+ "Disable the mode line during startup.
+This reduces visual clutter and slightly enhances startup performance. The
+tradeoff is that the mode line is hidden during the startup phase.")
+
(defvar minimal-emacs-package-initialize-and-refresh t
"Whether to automatically initialize and refresh packages.
When set to non-nil, Emacs will automatically call `package-initialize' and
`package-refresh-contents' to set up and update the package system.")
-(defvar minimal-emacs-inhibit-redisplay-during-startup nil
- "Suppress redisplay during startup to improve performance.
-This prevents visual updates while Emacs initializes, leading to a cleaner and
-faster startup. The tradeoff is that you won't see the progress or activities
-during the startup process.")
-
-(defvar minimal-emacs-inhibit-message-during-startup nil
- "Suppress startup messages for a cleaner experience.
-By disabling startup messages, this slightly enhances performance and provides a
-cleaner startup. The tradeoff is that you won't be informed of the progress or
-any relevant activities during startup.")
-
-(defvar minimal-emacs-optimize-file-name-handler-alist t)
-
-(defvar minimal-emacs-disable-mode-line-during-startup t
- "Disable the mode line during startup to improve performance.
-This reduces visual clutter and slightly enhances startup performance. The
-tradeoff is that the mode line is hidden during the startup phase, giving a more
-minimalistic appearance during startup.")
-
(defvar minimal-emacs-user-directory user-emacs-directory
"The default value of the `user-emacs-directory' variable.")
@@ -289,6 +290,19 @@ this stage of initialization."
;;; Performance: Disable mode-line during startup
+(when (and minimal-emacs-disable-mode-line-during-startup
+ (not (daemonp))
+ (not noninteractive)
+ (not minimal-emacs-debug))
+ (put 'mode-line-format
+ 'initial-value (default-toplevel-value 'mode-line-format))
+ (setq-default mode-line-format nil)
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (setq mode-line-format nil))))
+
+;;; Restore values
+
(defun minimal-emacs--startup-load-user-init-file (fn &rest args)
"Advice to reset `mode-line-format'. FN and ARGS are the function and args."
(unwind-protect
@@ -306,18 +320,8 @@ this stage of initialization."
(setq-default mode-line-format (get 'mode-line-format
'initial-value))))))
-(when (and minimal-emacs-disable-mode-line-during-startup
- (not (daemonp))
- (not noninteractive)
- (not minimal-emacs-debug))
- (put 'mode-line-format
- 'initial-value (default-toplevel-value 'mode-line-format))
- (setq-default mode-line-format nil)
- (dolist (buf (buffer-list))
- (with-current-buffer buf
- (setq mode-line-format nil)))
- (advice-add 'startup--load-user-init-file :around
- #'minimal-emacs--startup-load-user-init-file))
+(advice-add 'startup--load-user-init-file :around
+ #'minimal-emacs--startup-load-user-init-file)
;;; UI elements
@@ -344,15 +348,16 @@ this stage of initialization."
(when (bound-and-true-p tool-bar-mode)
(funcall 'tool-bar-setup))))
-(unless (daemonp)
- (unless noninteractive
- (when (fboundp 'tool-bar-setup)
- ;; Temporarily override the tool-bar-setup function to prevent it from
- ;; running during the initial stages of startup
- (advice-add 'tool-bar-setup :override #'ignore)
+(when (and (not (daemonp))
+ (not noninteractive))
+ (when (fboundp 'tool-bar-setup)
+ ;; Temporarily override the tool-bar-setup function to prevent it from
+ ;; running during the initial stages of startup
+ (advice-add 'tool-bar-setup :override #'ignore)
+
+ (advice-add 'startup--load-user-init-file :after
+ #'minimal-emacs--setup-toolbar)))
- (advice-add 'startup--load-user-init-file :after
- #'minimal-emacs--setup-toolbar))))
(unless (memq 'tool-bar minimal-emacs-ui-features)
(push '(tool-bar-lines . 0) default-frame-alist)
(setq tool-bar-mode nil))
diff --git a/init.el b/init.el
index e9b03f2..dc743a1 100644
--- a/init.el
+++ b/init.el
@@ -178,8 +178,7 @@
(setq auto-save-no-message t)
;; Do not auto-disable auto-save after deleting large chunks of
-;; text. The purpose of auto-save is to provide a failsafe, and
-;; disabling it contradicts this objective.
+;; text.
(setq auto-save-include-big-deletions t)
(setq auto-save-list-file-prefix
@@ -206,8 +205,7 @@
;;; recentf
-;; `recentf' is an that maintains a list of recently accessed files, making it
-;; easier to reopen files you have worked on recently.
+;; `recentf' is an that maintains a list of recently accessed files.
(setq recentf-max-saved-items 300) ; default is 20
(setq recentf-max-menu-items 15)
(setq recentf-auto-cleanup (if (daemonp) 300 'never))
@@ -217,8 +215,7 @@
;;; saveplace
-;; `save-place-mode' enables Emacs to remember the last location within a file
-;; upon reopening.
+;; Enables Emacs to remember the last location within a file upon reopening.
(setq save-place-file (expand-file-name "saveplace" user-emacs-directory))
(setq save-place-limit 600)
@@ -254,25 +251,20 @@
;;; Scrolling
-;; Enables faster scrolling through unfontified regions. This may result in
-;; brief periods of inaccurate syntax highlighting immediately after scrolling,
-;; which should quickly self-correct.
+;; Enables faster scrolling. This may result in brief periods of inaccurate
+;; syntax highlighting, which should quickly self-correct.
(setq fast-but-imprecise-scrolling t)
;; Move point to top/bottom of buffer before signaling a scrolling error.
(setq scroll-error-top-bottom t)
-;; Keeps screen position if the scroll command moved it vertically out of the
-;; window.
+;; Keep screen position if scroll command moved it vertically out of the window.
(setq scroll-preserve-screen-position t)
-;; Emacs spends excessive time recentering when the cursor moves more than N
-;; lines past the window edges (N is the value of `scroll-conservatively'). This
-;; can be slow in larger files. If `scroll-conservatively' is set above 100, the
-;; window is never automatically recentered.
+;; If `scroll-conservatively' is set above 100, the window is never
+;; automatically recentered, which decreases the time spend recentering.
(setq scroll-conservatively 101)
-;; Reduce cursor lag by:
;; 1. Preventing automatic adjustments to `window-vscroll' for long lines.
;; 2. Resolving the issue of random half-screen jumps during scrolling.
(setq auto-window-vscroll nil)
@@ -319,9 +311,8 @@
;; Avoid automatic frame resizing when adjusting settings.
(setq global-text-scale-adjust-resizes-frames nil)
-;; This controls how long Emacs will blink to show the deleted pairs with
-;; `delete-pair'. A longer delay can be annoying as it causes a noticeable pause
-;; after each deletion, disrupting the flow of editing.
+;; A longer delay can be annoying as it causes a noticeable pause after each
+;; deletion, disrupting the flow of editing.
(setq delete-pair-blink-delay 0.03)
(setq-default left-fringe-width 8)
@@ -427,9 +418,8 @@
(setq apropos-do-all t)
;; Fixes #11: Prevents help command completion from triggering autoload.
-;; (e.g., apropos-command, apropos-variable, apropos...)
-;; Loading additional files for completion can slow down help commands
-;; and may unintentionally execute initialization code from some libraries.
+;; Loading additional files for completion can slow down help commands and may
+;; unintentionally execute initialization code from some libraries.
(setq help-enable-completion-autoload nil)
(setq help-enable-autoload nil)
(setq help-enable-symbol-autoload nil)
@@ -449,9 +439,7 @@
(setq eglot-report-progress nil) ; Prevent Eglot minibuffer spam
;; Eglot optimization: Disable `eglot-events-buffer' to maintain consistent
-;; performance in long-running Emacs sessions. By default, it retains 2,000,000
-;; lines, and each new event triggers pretty-printing of the entire buffer,
-;; leading to a gradual performance decline.
+;; performance in long-running Emacs sessions.
(setq eglot-events-buffer-config '(:size 0 :format full))
;;; Flymake
From f352d853ef58737f5f32e3233c93d0a00606e07f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 09:10:17 -0400
Subject: [PATCH 097/172] Add help-window-select and next-error-recenter
---
init.el | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/init.el b/init.el
index dc743a1..2241039 100644
--- a/init.el
+++ b/init.el
@@ -94,6 +94,10 @@
compilation-ask-about-save nil
compilation-scroll-output 'first-error)
+;; Recenter to the middle of the window for `compile-goto-error', which is also
+;; used by `wgrep' and `embark-export'.
+(setq next-error-recenter '(4))
+
;;; Misc
(setq whitespace-line-column nil) ; whitespace-mode
@@ -414,6 +418,8 @@
;;; Help
+(setq help-window-select t) ;; Focus new help windows when opened
+
;; Enhance `apropos' and related functions to perform more extensive searches
(setq apropos-do-all t)
From 4507f11f129bc74550fa95c6849c6ccba74dfddb Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 09:11:27 -0400
Subject: [PATCH 098/172] Remove rainbow-delimiters-max-face-count
---
init.el | 4 ----
1 file changed, 4 deletions(-)
diff --git a/init.el b/init.el
index 2241039..653ca64 100644
--- a/init.el
+++ b/init.el
@@ -102,10 +102,6 @@
(setq whitespace-line-column nil) ; whitespace-mode
-;; I reduced the default value of 9 to simplify the font-lock keyword,
-;; aiming to improve performance.
-(setq rainbow-delimiters-max-face-count 5)
-
;; Can be activated with `display-line-numbers-mode'
(setq-default display-line-numbers-width 3)
(setq-default display-line-numbers-widen t)
From e9f2ed79dad405457102911556433af80cf3ad8a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 11:04:28 -0400
Subject: [PATCH 099/172] Remove column-number-mode and line-number-mode
---
init.el | 4 ----
1 file changed, 4 deletions(-)
diff --git a/init.el b/init.el
index 653ca64..166de01 100644
--- a/init.el
+++ b/init.el
@@ -371,10 +371,6 @@
;; Makes Emacs omit the load average information from the mode line.
(setq display-time-default-load-average nil)
-;; Display the current line and column numbers in the mode line
-(setq line-number-mode t)
-(setq column-number-mode t)
-
;;; Filetype
;; Do not notify the user each time Python tries to guess the indentation offset
From 4f1f5ef44ae891ae08eab099c41f2d1116058aab Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 11:11:32 -0400
Subject: [PATCH 100/172] Update README.md
---
README.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/README.md b/README.md
index 338e2dd..da34fbc 100644
--- a/README.md
+++ b/README.md
@@ -858,6 +858,10 @@ To prevent Emacs from saving customization information to a custom file, set `cu
2. You can also add the following to `~/.emacs.d/post-init.el`:
```emacs-lisp
+;; Display the current line and column numbers in the mode line
+(setq line-number-mode t)
+(setq column-number-mode t)
+
;; Display of line numbers in the buffer:
;; (display-line-numbers-mode 1)
From f1295007b436b5f0f5da69b8c576cde0eec78fe5 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 11:15:26 -0400
Subject: [PATCH 101/172] Update README.md
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index da34fbc..e8db80d 100644
--- a/README.md
+++ b/README.md
@@ -861,6 +861,7 @@ To prevent Emacs from saving customization information to a custom file, set `cu
;; Display the current line and column numbers in the mode line
(setq line-number-mode t)
(setq column-number-mode t)
+(setq mode-line-position-column-line-format '("%l:%C"))
;; Display of line numbers in the buffer:
;; (display-line-numbers-mode 1)
From 9702b5aa7a85f8682af04086dfe90c80216b19b4 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 15:33:15 -0400
Subject: [PATCH 102/172] Update minimal-emacs-load-user-init
---
early-init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index 7675277..8ccac45 100644
--- a/early-init.el
+++ b/early-init.el
@@ -98,7 +98,7 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
minimal-emacs-user-directory)))
(when (file-exists-p init-file)
(setq minimal-emacs--stage (file-name-nondirectory init-file))
- (load init-file nil t))))
+ (load init-file nil t t))))
(minimal-emacs-load-user-init "pre-early-init.el")
(setq minimal-emacs--stage "early-init.el")
From cd1130b04a212dcb851bc116a8d6ce2098bcef9a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 15:39:57 -0400
Subject: [PATCH 103/172] Update (load) function arguments
---
early-init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index 8ccac45..7675277 100644
--- a/early-init.el
+++ b/early-init.el
@@ -98,7 +98,7 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
minimal-emacs-user-directory)))
(when (file-exists-p init-file)
(setq minimal-emacs--stage (file-name-nondirectory init-file))
- (load init-file nil t t))))
+ (load init-file nil t))))
(minimal-emacs-load-user-init "pre-early-init.el")
(setq minimal-emacs--stage "early-init.el")
From 07767ef19e67150ea7eceaaa0fbc64cc08f03a20 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 16:20:22 -0400
Subject: [PATCH 104/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index e8db80d..12c6043 100644
--- a/README.md
+++ b/README.md
@@ -127,7 +127,7 @@ The minimal-emacs.d init files support additional customization files that are l
Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-early-init.el` files with the following header to prevent them from being byte-compiled and to activate lexical binding:
```elisp
-;;; FILENAME.el --- DESCRIPTION -*- lexical-binding: t; -*-
+;;; FILENAME.el --- DESCRIPTION -*- no-byte-compile: t; lexical-binding: t; -*-
```
(Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.)
From d17039f2357f8474773c97065b0a95b9e21d615e Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 16:24:35 -0400
Subject: [PATCH 105/172] Make minimal-emacs-load-user-init also load .elc or
.eln files
---
README.md | 4 ++--
early-init.el | 4 ++--
init.el | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index 12c6043..7ed7755 100644
--- a/README.md
+++ b/README.md
@@ -1107,7 +1107,7 @@ To prioritize MELPA over MELPA Stable, to access bleeding-edge package versions,
Add the following line to the end of your `post-init.el` file:
```lisp
-(minimal-emacs-load-user-init "local.el")
+(minimal-emacs-load-user-init "local")
```
This allows `local.el` to load, enabling custom configurations specific to the machine.
@@ -1147,7 +1147,7 @@ Add the following to the top of the `~/.emacs.d/pre-early-init.el` file to make
(unless (string= minimal-emacs-user-directory
previous-minimal-emacs-user-directory)
;; Load pre-early-init.el from the new directory
- (minimal-emacs-load-user-init "pre-early-init.el")))
+ (minimal-emacs-load-user-init "pre-early-init")))
```
### Are post-early-init.el and pre-init.el the same file in terms of the logic?
diff --git a/early-init.el b/early-init.el
index 7675277..158e9c7 100644
--- a/early-init.el
+++ b/early-init.el
@@ -100,7 +100,7 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(setq minimal-emacs--stage (file-name-nondirectory init-file))
(load init-file nil t))))
-(minimal-emacs-load-user-init "pre-early-init.el")
+(minimal-emacs-load-user-init "pre-early-init")
(setq minimal-emacs--stage "early-init.el")
(setq custom-theme-directory
@@ -398,7 +398,7 @@ this stage of initialization."
("melpa" . 0)))
;;; Load post-early-init.el
-(minimal-emacs-load-user-init "post-early-init.el")
+(minimal-emacs-load-user-init "post-early-init")
(provide 'early-init)
diff --git a/init.el b/init.el
index 166de01..5a3d11a 100644
--- a/init.el
+++ b/init.el
@@ -1,4 +1,4 @@
-;;; init.el --- Init -*- lexical-binding: t; -*-
+;;; init.el --- Init -*- no-byte-compile: t; lexical-binding: t; -*-
;; Author: James Cherti
;; URL: https://github.com/jamescherti/minimal-emacs.d
@@ -17,7 +17,7 @@
;;; Load pre-init.el
(setq minimal-emacs--stage "init.el")
(if (fboundp 'minimal-emacs-load-user-init)
- (minimal-emacs-load-user-init "pre-init.el")
+ (minimal-emacs-load-user-init "pre-init")
(error "The early-init.el file failed to loaded"))
(setq minimal-emacs--stage "init.el")
@@ -518,7 +518,7 @@
;;; Load post init
(when (fboundp 'minimal-emacs-load-user-init)
- (minimal-emacs-load-user-init "post-init.el"))
+ (minimal-emacs-load-user-init "post-init"))
(setq minimal-emacs--success t)
(provide 'init)
From 383f61046d68e72407ac0443190adc4065e91936 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 16:44:11 -0400
Subject: [PATCH 106/172] Simplify minimal-emacs-load-user-init
---
early-init.el | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/early-init.el b/early-init.el
index 158e9c7..9f9c906 100644
--- a/early-init.el
+++ b/early-init.el
@@ -94,11 +94,9 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
- (let ((init-file (expand-file-name filename
- minimal-emacs-user-directory)))
- (when (file-exists-p init-file)
- (setq minimal-emacs--stage (file-name-nondirectory init-file))
- (load init-file nil t))))
+ (let* ((init-file (expand-file-name filename
+ minimal-emacs-user-directory)))
+ (load init-file :no-error :no-message)))
(minimal-emacs-load-user-init "pre-early-init")
(setq minimal-emacs--stage "early-init.el")
From 10f65a60b1032dde93366c1c6bf6e00f5b49bdf0 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 16:46:30 -0400
Subject: [PATCH 107/172] Remove minimal-emacs--stage
---
early-init.el | 12 +++---------
init.el | 2 --
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/early-init.el b/early-init.el
index 9f9c906..dd0c238 100644
--- a/early-init.el
+++ b/early-init.el
@@ -75,21 +75,16 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(setq debug-on-error minimal-emacs-debug)
(defvar minimal-emacs--success nil)
-(defvar minimal-emacs--stage "early-init.el")
(defun minimal-emacs--check-success ()
"Verify that the Emacs configuration has loaded successfully."
(unless minimal-emacs--success
(cond
- ((and (or (string= minimal-emacs--stage "pre-early-init.el")
- (string= minimal-emacs--stage "early-init.el")
- (string= minimal-emacs--stage "post-early-init.el"))
- (or (file-exists-p (expand-file-name "~/.emacs.el"))
- (file-exists-p (expand-file-name "~/.emacs"))))
+ ((or (file-exists-p (expand-file-name "~/.emacs.el"))
+ (file-exists-p (expand-file-name "~/.emacs")))
(error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file"))
(t
- (error "Configuration error in: '%s'. Debug by starting Emacs with: emacs --debug-init"
- minimal-emacs--stage)))))
+ (error "Configuration error. Debug by starting Emacs with: emacs --debug-init")))))
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
(defun minimal-emacs-load-user-init (filename)
@@ -99,7 +94,6 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(load init-file :no-error :no-message)))
(minimal-emacs-load-user-init "pre-early-init")
-(setq minimal-emacs--stage "early-init.el")
(setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory))
diff --git a/init.el b/init.el
index 5a3d11a..315a8ba 100644
--- a/init.el
+++ b/init.el
@@ -15,11 +15,9 @@
;;; Code:
;;; Load pre-init.el
-(setq minimal-emacs--stage "init.el")
(if (fboundp 'minimal-emacs-load-user-init)
(minimal-emacs-load-user-init "pre-init")
(error "The early-init.el file failed to loaded"))
-(setq minimal-emacs--stage "init.el")
;;; Before package
From 1b72f7bb2a9004ed5267103b10ab71f87157d932 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:00:27 -0400
Subject: [PATCH 108/172] Remove eval-when-compile for require use-package
---
init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/init.el b/init.el
index 315a8ba..fba12f4 100644
--- a/init.el
+++ b/init.el
@@ -50,8 +50,7 @@
(package-install 'use-package))
;; Ensure use-package is available
- (eval-when-compile
- (require 'use-package)))
+ (require 'use-package))
;;; Features, warnings, and errors
From 90c996e118a1fd2e93c2fdbc52f2b2f8a6db7c78 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:07:54 -0400
Subject: [PATCH 109/172] Only run package-refresh-contents when necessary
---
init.el | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/init.el b/init.el
index fba12f4..ff95ffb 100644
--- a/init.el
+++ b/init.el
@@ -42,11 +42,10 @@
(when (bound-and-true-p minimal-emacs-package-initialize-and-refresh)
;; Initialize and refresh package contents again if needed
(package-initialize)
- (unless (seq-empty-p package-archive-contents)
- (package-refresh-contents))
-
;; Install use-package if necessary
(unless (package-installed-p 'use-package)
+ (unless (seq-empty-p package-archive-contents)
+ (package-refresh-contents))
(package-install 'use-package))
;; Ensure use-package is available
From 9eb2a138ec0e4c11ba66f03b4f15c4134f442960 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:18:28 -0400
Subject: [PATCH 110/172] Remove MELPA stable
---
early-init.el | 2 --
1 file changed, 2 deletions(-)
diff --git a/early-init.el b/early-init.el
index dd0c238..4bb3150 100644
--- a/early-init.el
+++ b/early-init.el
@@ -381,12 +381,10 @@ this stage of initialization."
(setq use-package-always-ensure t)
(setq use-package-enable-imenu-support t)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
- ("melpa-stable" . "https://stable.melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
- ("melpa-stable" . 70)
("melpa" . 0)))
;;; Load post-early-init.el
From e0e1d04ae672804cd57ea354a629033d0cd8010b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:26:01 -0400
Subject: [PATCH 111/172] Update README.md
---
README.md | 33 +++++----------------------------
early-init.el | 1 +
2 files changed, 6 insertions(+), 28 deletions(-)
diff --git a/README.md b/README.md
index 7ed7755..80a40c0 100644
--- a/README.md
+++ b/README.md
@@ -59,7 +59,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Configuring elpaca (package manager)](#configuring-elpaca-package-manager)
- [Frequently asked questions](#frequently-asked-questions)
- [How to display Emacs startup duration?](#how-to-display-emacs-startup-duration)
- - [How to give more priority to MELPA over MELPA stable?](#how-to-give-more-priority-to-melpa-over-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 Emacs customizations?](#how-to-load-emacs-customizations)
- [How to increase gc-cons-threshold?](#how-to-increase-gc-cons-threshold)
@@ -1070,38 +1070,15 @@ 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`.)
-### How to give more priority to MELPA over MELPA stable?
+### How to use MELPA stable?
-**Warning:** MELPA Stable is generally more reliable and thoroughly tested, as it contains stable versions of packages. On the other hand, MELPA provides bleeding-edge versions, which often include new features but may also introduce changes that could potentially break functionality. The author of *minimal-emacs.d* uses MELPA over MELPA Stable without encountering issues, but this is provided as a caution to allow you to make an informed decision based on your stability versus feature needs.
-
-By default, the *minimal-emacs.d* configuration assigns specific priorities to various package archives, which determines the order in which packages are fetched from these archives. The default priorities are as follows:
+To add MELPA Stable for accessing stable package versions, you can adjust the `package-archive-priorities` variable in your `~/.emacs.d/post-early-init.el` file.
```elisp
-(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
- ("nongnu" . 80)
- ("melpa-stable" . 70)
- ("melpa" . 0)))
+(push '("melpa-stable" . "https://stable.melpa.org/packages/") package-archives)
```
-In this configuration, the GNU, Nongnu, and MELPA Stable archives (which contain stable versions of MELPA packages) are assigned higher priorities than MELPA (which contains the latest versions of packages). As a result, packages will be fetched from MELPA Stable before MELPA.
-
-To prioritize MELPA over MELPA Stable, to access bleeding-edge package versions, you can adjust the `package-archive-priorities` variable accordingly:
-
-```elisp
-;; This change increases MELPA's priority to 75, above MELPA Stable's
-;; priority of 70, ensuring that MELPA is preferred for package installations
-;; over MELPA Stable.
-;;
-;; MELPA Stable offers reliable, tested versions, while MELPA provides newer
-;; features at the risk of potential instability; for your information,
-;; the author of minimal-emacs.d has been using MELPA (and not MELPA stable)
-;; for years without any major issues.
-(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
- ("nongnu" . 80)
- ("melpa-stable" . 70)
- ;; MELPA priority has been changed to 75
- ("melpa" . 75)))
-```
+However, the packages can sometimes be outdated.
### How to load a local lisp file for machine-specific configurations?
diff --git a/early-init.el b/early-init.el
index 4bb3150..17ab580 100644
--- a/early-init.el
+++ b/early-init.el
@@ -385,6 +385,7 @@ this stage of initialization."
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
+ ("melpa-stable" . 70)
("melpa" . 0)))
;;; Load post-early-init.el
From d547a87d8c2e0259b1795a4b1b099beae5fed9ca Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:49:13 -0400
Subject: [PATCH 112/172] Remove no-byte-compile and change package settings
---
README.md | 5 ++++-
early-init.el | 5 +++--
init.el | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 80a40c0..ecb5ef1 100644
--- a/README.md
+++ b/README.md
@@ -1075,7 +1075,10 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
To add MELPA Stable for accessing stable package versions, you can adjust the `package-archive-priorities` variable in your `~/.emacs.d/post-early-init.el` file.
```elisp
-(push '("melpa-stable" . "https://stable.melpa.org/packages/") package-archives)
+(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
+ ("nongnu" . 80)
+ ("melpa-stable" . 70)
+ ("melpa" . 0)))
```
However, the packages can sometimes be outdated.
diff --git a/early-init.el b/early-init.el
index 17ab580..4670a33 100644
--- a/early-init.el
+++ b/early-init.el
@@ -382,11 +382,12 @@ this stage of initialization."
(setq use-package-enable-imenu-support t)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
+ ("melpa-stable" . "https://stable.melpa.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
- ("melpa-stable" . 70)
- ("melpa" . 0)))
+ ("melpa" . 70)
+ ("melpa-stable" . 0)))
;;; Load post-early-init.el
(minimal-emacs-load-user-init "post-early-init")
diff --git a/init.el b/init.el
index ff95ffb..ed69c3b 100644
--- a/init.el
+++ b/init.el
@@ -1,4 +1,4 @@
-;;; init.el --- Init -*- no-byte-compile: t; lexical-binding: t; -*-
+;;; init.el --- Init -*- lexical-binding: t; -*-
;; Author: James Cherti
;; URL: https://github.com/jamescherti/minimal-emacs.d
From f691a406e4cb01dcfd34d58477ca5a072193d234 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 17:54:39 -0400
Subject: [PATCH 113/172] Update README.md
---
README.md | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index ecb5ef1..7bf3ed3 100644
--- a/README.md
+++ b/README.md
@@ -1072,17 +1072,20 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
-To add MELPA Stable for accessing stable package versions, you can adjust the `package-archive-priorities` variable in your `~/.emacs.d/post-early-init.el` file.
+**IMPORTANT: Many of the MELPA stable packages are outdated.**
+
+Add the following configuration to `~/.emacs.d/post-early-init.el` to give MELPA Stable a higher priority than MELPA, ensuring that packages are fetched from MELPA Stable first:
```elisp
+;; This change increases MELPA Stable priority to 70, above MELPA,
+;; ensuring that MELPA is preferred for package installations
+;; over MELPA Stable.
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
("melpa-stable" . 70)
("melpa" . 0)))
```
-However, the packages can sometimes be outdated.
-
### How to load a local lisp file for machine-specific configurations?
Add the following line to the end of your `post-init.el` file:
From d91c5f2c2bf417d230e908b59ec1a3c6472a148a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:19:22 -0400
Subject: [PATCH 114/172] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 7bf3ed3..2ced713 100644
--- a/README.md
+++ b/README.md
@@ -130,7 +130,9 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
;;; FILENAME.el --- DESCRIPTION -*- no-byte-compile: t; lexical-binding: t; -*-
```
-(Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.)
+Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.
+
+*(If you remove `no-byte-compile: t;` from your headers, Emacs will compile them. However, if you choose to compile them, you may need to include `(require 'use-package)` at the top of `post-init.el` to ensure that all required `use-package` variables and functions are loaded.)*
## Customizations: UI (pre-early-init.el)
From 32001ba280c892d1d4617d222c7f838bef590cef Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:21:03 -0400
Subject: [PATCH 115/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2ced713..1183655 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.
-*(If you remove `no-byte-compile: t;` from your headers, Emacs will compile them. However, if you choose to compile them, you may need to include `(require 'use-package)` at the top of `post-init.el` to ensure that all required `use-package` variables and functions are loaded.)*
+*(Only if you know what you are doing: If you decide to remove `no-byte-compile: t;` from your init files, Emacs will compile them. However, if you choose to compile them, you may need to include `(require 'use-package)` at the top of `post-init.el` to ensure that all required `use-package` variables and functions are loaded.)*
## Customizations: UI (pre-early-init.el)
From 931de16ded22e9214eef1bb9a232161643ee4784 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:21:50 -0400
Subject: [PATCH 116/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 1183655..b87ffda 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.
-*(Only if you know what you are doing: If you decide to remove `no-byte-compile: t;` from your init files, Emacs will compile them. However, if you choose to compile them, you may need to include `(require 'use-package)` at the top of `post-init.el` to ensure that all required `use-package` variables and functions are loaded.)*
+*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files will allow Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add `(require 'use-package)` at the top of `post-init.el` to ensure that all necessary `use-package` variables and functions are loaded.)*
## Customizations: UI (pre-early-init.el)
From 88c658c4eabadda02af7a2e6fc37370f1ab0c852 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:22:05 -0400
Subject: [PATCH 117/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b87ffda..e52c71d 100644
--- a/README.md
+++ b/README.md
@@ -132,7 +132,7 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.
-*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files will allow Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add `(require 'use-package)` at the top of `post-init.el` to ensure that all necessary `use-package` variables and functions are loaded.)*
+*(Only if you know what you're doing: Removing `no-byte-compile: t; ` from your init files will allow Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add `(require 'use-package)` at the top of `post-init.el` to ensure that all necessary `use-package` variables and functions are loaded.)*
## Customizations: UI (pre-early-init.el)
From bfb9057e5341d341155e0da02adf4062375eb277 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:32:05 -0400
Subject: [PATCH 118/172] Update README.md
---
README.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/README.md b/README.md
index e52c71d..1d9026e 100644
--- a/README.md
+++ b/README.md
@@ -132,8 +132,6 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.
-*(Only if you know what you're doing: Removing `no-byte-compile: t; ` from your init files will allow Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add `(require 'use-package)` at the top of `post-init.el` to ensure that all necessary `use-package` variables and functions are loaded.)*
-
## Customizations: UI (pre-early-init.el)
### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?
From 4c24771f3a317895fb04a8330fa2507706c7be19 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:47:18 -0400
Subject: [PATCH 119/172] Update README.md
---
README.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/README.md b/README.md
index 1d9026e..a9cb0d2 100644
--- a/README.md
+++ b/README.md
@@ -166,6 +166,13 @@ Native compilation enhances Emacs performance by converting Elisp code into nati
:ensure t
:demand t
:config
+ ;; If you choose to compile your pre/post-init files, make sure you
+ ;; understand the implications and thoroughly test your code.
+ (push "/pre-init.el" compile-angel-excluded-files)
+ (push "/post-init.el" compile-angel-excluded-files)
+ (push "/pre-early-init.el" compile-angel-excluded-files)
+ (push "/post-early-init.el" compile-angel-excluded-files)
+
;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
;; Drawback: The minibuffer will not display compile-angel's actions.
(setq compile-angel-verbose t)
From dbd26541240a73212803d46e2c2cfbc69f5cb23f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:48:38 -0400
Subject: [PATCH 120/172] Update README.md
---
README.md | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index a9cb0d2..b80fbfc 100644
--- a/README.md
+++ b/README.md
@@ -165,18 +165,20 @@ Native compilation enhances Emacs performance by converting Elisp code into nati
(use-package compile-angel
:ensure t
:demand t
+ :custom
+ ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
+ ;; Drawback: The minibuffer will not display compile-angel's actions.
+ (compile-angel-verbose t)
+
:config
- ;; If you choose to compile your pre/post-init files, make sure you
- ;; understand the implications and thoroughly test your code.
+ ;; The following directive prevents compile-angel from compiling your init files.
+ ;; (If you choose to compile your pre/post init files, make sure you
+ ;; understand the implications and thoroughly test your code.)
(push "/pre-init.el" compile-angel-excluded-files)
(push "/post-init.el" compile-angel-excluded-files)
(push "/pre-early-init.el" compile-angel-excluded-files)
(push "/post-early-init.el" compile-angel-excluded-files)
- ;; Set `compile-angel-verbose` to nil to suppress output from compile-angel.
- ;; Drawback: The minibuffer will not display compile-angel's actions.
- (setq compile-angel-verbose t)
-
;; A local mode that compiles .el files whenever the user saves them.
;; (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)
From ab51053008bedc1f735e631e2bea95af1436e8bb Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:56:05 -0400
Subject: [PATCH 121/172] Update README.md
---
README.md | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index b80fbfc..795e1d3 100644
--- a/README.md
+++ b/README.md
@@ -132,6 +132,8 @@ Always begin your `pre-init.el`, `post-init.el`, `post-early-init.el`, and `pre-
Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief description of its purpose.
+*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files allows Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add required dependencies. For example, if you're using `use-package`, add `(require 'use-package)` at the top of `post-init.el` to ensure all necessary `use-package` variables and functions are loaded.)*
+
## Customizations: UI (pre-early-init.el)
### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?
@@ -171,9 +173,12 @@ Native compilation enhances Emacs performance by converting Elisp code into nati
(compile-angel-verbose t)
:config
- ;; The following directive prevents compile-angel from compiling your init files.
- ;; (If you choose to compile your pre/post init files, make sure you
- ;; understand the implications and thoroughly test your code.)
+ ;; The following directive prevents compile-angel from compiling your init
+ ;; files. If you choose to remove this push to `compile-angel-excluded-files`
+ ;; and compile your pre/post-init files, ensure you understand the
+ ;; implications and thoroughly test your code. For example, if you're using
+ ;; `use-package`, you'll need to explicitly require `use-package` at the top
+ ;; of your init file.
(push "/pre-init.el" compile-angel-excluded-files)
(push "/post-init.el" compile-angel-excluded-files)
(push "/pre-early-init.el" compile-angel-excluded-files)
From 6cb7a0dacfd354c3a2ae8916545252568ebd6f10 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 19:56:59 -0400
Subject: [PATCH 122/172] Update README.md
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 795e1d3..c3b6a44 100644
--- a/README.md
+++ b/README.md
@@ -174,11 +174,11 @@ Native compilation enhances Emacs performance by converting Elisp code into nati
:config
;; The following directive prevents compile-angel from compiling your init
- ;; files. If you choose to remove this push to `compile-angel-excluded-files`
+ ;; files. If you choose to remove this push to `compile-angel-excluded-files'
;; and compile your pre/post-init files, ensure you understand the
;; implications and thoroughly test your code. For example, if you're using
- ;; `use-package`, you'll need to explicitly require `use-package` at the top
- ;; of your init file.
+ ;; `use-package', you'll need to explicitly add `(require 'use-package)` at
+ ;; the top of your init file.
(push "/pre-init.el" compile-angel-excluded-files)
(push "/post-init.el" compile-angel-excluded-files)
(push "/pre-early-init.el" compile-angel-excluded-files)
From b64896240a7e3fabc0b670cc2ed3266f9ea3f0b9 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 20:00:04 -0400
Subject: [PATCH 123/172] Update README.md
---
README.md | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/README.md b/README.md
index c3b6a44..efdf2be 100644
--- a/README.md
+++ b/README.md
@@ -913,10 +913,7 @@ To prevent Emacs from saving customization information to a custom file, set `cu
(winner-mode 1)
;; Replace selected text with typed text
-(delete-selection-mode 1)
-
-;; Configure Emacs to ask for confirmation before exiting
-(setq confirm-kill-emacs 'y-or-n-p)
+;; (delete-selection-mode 1)
(use-package uniquify
:ensure nil
From a896c08de287bd96eef9174cf7bb88f3823fb9cb Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 12 Mar 2025 21:37:35 -0400
Subject: [PATCH 124/172] Enhance the load function
---
early-init.el | 11 ++++++-----
init.el | 4 ++--
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/early-init.el b/early-init.el
index 4670a33..1e5e76d 100644
--- a/early-init.el
+++ b/early-init.el
@@ -89,11 +89,12 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
- (let* ((init-file (expand-file-name filename
- minimal-emacs-user-directory)))
- (load init-file :no-error :no-message)))
+ (let ((init-file (expand-file-name filename
+ minimal-emacs-user-directory)))
+ (when (file-exists-p init-file)
+ (load init-file nil :no-message))))
-(minimal-emacs-load-user-init "pre-early-init")
+(minimal-emacs-load-user-init "pre-early-init.el")
(setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory))
@@ -390,7 +391,7 @@ this stage of initialization."
("melpa-stable" . 0)))
;;; Load post-early-init.el
-(minimal-emacs-load-user-init "post-early-init")
+(minimal-emacs-load-user-init "post-early-init.el")
(provide 'early-init)
diff --git a/init.el b/init.el
index ed69c3b..1aa9fd8 100644
--- a/init.el
+++ b/init.el
@@ -16,7 +16,7 @@
;;; Load pre-init.el
(if (fboundp 'minimal-emacs-load-user-init)
- (minimal-emacs-load-user-init "pre-init")
+ (minimal-emacs-load-user-init "pre-init.el")
(error "The early-init.el file failed to loaded"))
;;; Before package
@@ -514,7 +514,7 @@
;;; Load post init
(when (fboundp 'minimal-emacs-load-user-init)
- (minimal-emacs-load-user-init "post-init"))
+ (minimal-emacs-load-user-init "post-init.el"))
(setq minimal-emacs--success t)
(provide 'init)
From 90d3a48852d32b2467bff0e842cf2ce0348e040c Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 13:26:17 -0400
Subject: [PATCH 125/172] Enhance the load function
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index efdf2be..a8168b7 100644
--- a/README.md
+++ b/README.md
@@ -1083,9 +1083,9 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
-**IMPORTANT: Many of the MELPA stable packages are outdated.**
+**IMPORTANT: Some of the MELPA stable packages are outdated.**
-Add the following configuration to `~/.emacs.d/post-early-init.el` to give MELPA Stable a higher priority than MELPA, ensuring that packages are fetched from MELPA Stable first:
+To prioritize MELPA Stable over MELPA (the latest package version), add the following configuration to `~/.emacs.d/post-early-init.el` to ensure packages are fetched from MELPA Stable first:
```elisp
;; This change increases MELPA Stable priority to 70, above MELPA,
From c5b09b3a1400b1f2c2905e7cd5590465db9381d5 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 17:55:33 -0400
Subject: [PATCH 126/172] Remove MELPA stable
---
README.md | 3 +++
early-init.el | 1 -
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index a8168b7..9697088 100644
--- a/README.md
+++ b/README.md
@@ -1088,6 +1088,9 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
To prioritize MELPA Stable over MELPA (the latest package version), add the following configuration to `~/.emacs.d/post-early-init.el` to ensure packages are fetched from MELPA Stable first:
```elisp
+;; Add melpa-stable to `package-archives'
+(push '("melpa-stable" . "https://stable.melpa.org/packages/") package-archives)
+
;; This change increases MELPA Stable priority to 70, above MELPA,
;; ensuring that MELPA is preferred for package installations
;; over MELPA Stable.
diff --git a/early-init.el b/early-init.el
index 1e5e76d..0b674b0 100644
--- a/early-init.el
+++ b/early-init.el
@@ -383,7 +383,6 @@ this stage of initialization."
(setq use-package-enable-imenu-support t)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("gnu" . "https://elpa.gnu.org/packages/")
- ("melpa-stable" . "https://stable.melpa.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
From 50dba2b339f35a9aa4d61adaa50d5eaefa5af18f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:15:08 -0400
Subject: [PATCH 127/172] Update README.md
---
README.md | 8 ++++++--
early-init.el | 3 +--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 9697088..e9186de 100644
--- a/README.md
+++ b/README.md
@@ -1083,9 +1083,13 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
-**IMPORTANT: Some of the MELPA stable packages are outdated.**
+**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.** Here is an [interesting discussion about MELPA stable](https://github.com/melpa/melpa/issues/6656).
-To prioritize MELPA Stable over MELPA (the latest package version), add the following configuration to `~/.emacs.d/post-early-init.el` to ensure packages are fetched from MELPA Stable first:
+Here are the key differences between **MELPA** (the default repository used in minimal-emacs.d) and **MELPA Stable**:
+- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, providing the most current features and bug fixes.
+- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages, offering more stability by ensuring that the packages have reached a certain level of completeness before being released. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
+
+By default, minimal-emacs uses MELPA, GNU, and Nongnu repositories. If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
```elisp
;; Add melpa-stable to `package-archives'
diff --git a/early-init.el b/early-init.el
index 0b674b0..8fc3a59 100644
--- a/early-init.el
+++ b/early-init.el
@@ -386,8 +386,7 @@ this stage of initialization."
("nongnu" . "https://elpa.nongnu.org/nongnu/")))
(customize-set-variable 'package-archive-priorities '(("gnu" . 99)
("nongnu" . 80)
- ("melpa" . 70)
- ("melpa-stable" . 0)))
+ ("melpa" . 70)))
;;; Load post-early-init.el
(minimal-emacs-load-user-init "post-early-init.el")
From cab5767fc1ebce3b1d352053feeb9a4c174815df Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:18:59 -0400
Subject: [PATCH 128/172] Update README.md
---
README.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index e9186de..69e096c 100644
--- a/README.md
+++ b/README.md
@@ -1087,9 +1087,9 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
Here are the key differences between **MELPA** (the default repository used in minimal-emacs.d) and **MELPA Stable**:
- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, providing the most current features and bug fixes.
-- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages, offering more stability by ensuring that the packages have reached a certain level of completeness before being released. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
+- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
-By default, minimal-emacs uses MELPA, GNU, and Nongnu repositories. If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
+By default, minimal-emacs.d uses MELPA, GNU, and Nongnu repositories. If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
```elisp
;; Add melpa-stable to `package-archives'
@@ -1108,7 +1108,7 @@ By default, minimal-emacs uses MELPA, GNU, and Nongnu repositories. If you prefe
Add the following line to the end of your `post-init.el` file:
```lisp
-(minimal-emacs-load-user-init "local")
+(minimal-emacs-load-user-init "local.el")
```
This allows `local.el` to load, enabling custom configurations specific to the machine.
@@ -1148,7 +1148,7 @@ Add the following to the top of the `~/.emacs.d/pre-early-init.el` file to make
(unless (string= minimal-emacs-user-directory
previous-minimal-emacs-user-directory)
;; Load pre-early-init.el from the new directory
- (minimal-emacs-load-user-init "pre-early-init")))
+ (minimal-emacs-load-user-init "pre-early-init.el")))
```
### Are post-early-init.el and pre-init.el the same file in terms of the logic?
From 3c6ea08d64e40431960338f6b017062c609f0150 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:23:57 -0400
Subject: [PATCH 129/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 69e096c..e53af48 100644
--- a/README.md
+++ b/README.md
@@ -1086,7 +1086,7 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.** Here is an [interesting discussion about MELPA stable](https://github.com/melpa/melpa/issues/6656).
Here are the key differences between **MELPA** (the default repository used in minimal-emacs.d) and **MELPA Stable**:
-- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, providing the most current features and bug fixes.
+- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
By default, minimal-emacs.d uses MELPA, GNU, and Nongnu repositories. If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
From 5d3f4b78c16cbb5393c650a44f519a081e63758e Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:24:33 -0400
Subject: [PATCH 130/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index e53af48..45981ae 100644
--- a/README.md
+++ b/README.md
@@ -1085,7 +1085,7 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.** Here is an [interesting discussion about MELPA stable](https://github.com/melpa/melpa/issues/6656).
-Here are the key differences between **MELPA** (the default repository used in minimal-emacs.d) and **MELPA Stable**:
+Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
From bdd329cb1cc4a6939b13441f5c8c064a1ea40892 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:27:29 -0400
Subject: [PATCH 131/172] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 45981ae..cc49c49 100644
--- a/README.md
+++ b/README.md
@@ -1083,13 +1083,15 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
+By default, *minimal-emacs.d* uses MELPA instead of MELPA Stable. If you prefer to use MELPA Stable, you can follow the instructions below. However, please note the following important warning:
+
**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.** Here is an [interesting discussion about MELPA stable](https://github.com/melpa/melpa/issues/6656).
Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
-By default, minimal-emacs.d uses MELPA, GNU, and Nongnu repositories. If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
+If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
```elisp
;; Add melpa-stable to `package-archives'
From d8e84b49bc917abdbd8b96f0b2ddf4b091bd7099 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:29:30 -0400
Subject: [PATCH 132/172] Update README.md
---
README.md | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index cc49c49..ea781ea 100644
--- a/README.md
+++ b/README.md
@@ -872,6 +872,9 @@ To prevent Emacs from saving customization information to a custom file, set `cu
2. You can also add the following to `~/.emacs.d/post-init.el`:
```emacs-lisp
+;; Allow Emacs to upgrade built-in packages, such as Org mode
+(setq package-install-upgrade-built-in t)
+
;; Display the current line and column numbers in the mode line
(setq line-number-mode t)
(setq column-number-mode t)
@@ -1083,7 +1086,7 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
-By default, *minimal-emacs.d* uses MELPA instead of MELPA Stable. If you prefer to use MELPA Stable, you can follow the instructions below. However, please note the following important warning:
+By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA Stable](https://stable.melpa.org/). If you prefer to use MELPA Stable, you can follow the instructions below. However, please note the following important warning:
**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.** Here is an [interesting discussion about MELPA stable](https://github.com/melpa/melpa/issues/6656).
From d8258bd89dcd8243cad0816f0ca0ebf19cc05de6 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:29:53 -0400
Subject: [PATCH 133/172] Update README.md
---
README.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/README.md b/README.md
index ea781ea..e1dc46d 100644
--- a/README.md
+++ b/README.md
@@ -871,7 +871,6 @@ To prevent Emacs from saving customization information to a custom file, set `cu
2. You can also add the following to `~/.emacs.d/post-init.el`:
```emacs-lisp
-
;; Allow Emacs to upgrade built-in packages, such as Org mode
(setq package-install-upgrade-built-in t)
From 9eca2ef558ed65dc8f69d265b9fd9ef30426e48c Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:30:54 -0400
Subject: [PATCH 134/172] Update README.md
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index e1dc46d..6cd6019 100644
--- a/README.md
+++ b/README.md
@@ -905,14 +905,14 @@ To prevent Emacs from saving customization information to a custom file, set `cu
(pixel-scroll-precision-mode 1))
;; Display the time in the modeline
-(display-time-mode 1)
+(add-hook 'after-init-hook 'display-time-mode)
;; Paren match highlighting
-(show-paren-mode 1)
+(add-hook 'after-init-hook 'show-paren-mode)
;; Track changes in the window configuration, allowing undoing actions such as
;; closing windows.
-(winner-mode 1)
+(add-hook 'after-init-hook 'winner-mode)
;; Replace selected text with typed text
;; (delete-selection-mode 1)
From 2f7192cfe6e0e419f8e8d39859bd328a746ae032 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 18:32:46 -0400
Subject: [PATCH 135/172] Update README.md
---
README.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 6cd6019..0382425 100644
--- a/README.md
+++ b/README.md
@@ -905,14 +905,14 @@ To prevent Emacs from saving customization information to a custom file, set `cu
(pixel-scroll-precision-mode 1))
;; Display the time in the modeline
-(add-hook 'after-init-hook 'display-time-mode)
+(add-hook 'after-init-hook #'display-time-mode)
;; Paren match highlighting
-(add-hook 'after-init-hook 'show-paren-mode)
+(add-hook 'after-init-hook #'show-paren-mode)
;; Track changes in the window configuration, allowing undoing actions such as
;; closing windows.
-(add-hook 'after-init-hook 'winner-mode)
+(add-hook 'after-init-hook #'winner-mode)
;; Replace selected text with typed text
;; (delete-selection-mode 1)
From 1c80b6d04f054a6debc88f99e4015b2ee5458420 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 19:10:27 -0400
Subject: [PATCH 136/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 0382425..82adbe2 100644
--- a/README.md
+++ b/README.md
@@ -1087,7 +1087,7 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA Stable](https://stable.melpa.org/). If you prefer to use MELPA Stable, you can follow the instructions below. However, please note the following important warning:
-**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.** Here is an [interesting discussion about MELPA stable](https://github.com/melpa/melpa/issues/6656).
+**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.**
Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
From c7ba8935d52a1f943f0892187c72a890d2921899 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 13 Mar 2025 21:32:45 -0400
Subject: [PATCH 137/172] Update README.md
---
README.md | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/README.md b/README.md
index 82adbe2..0ec4dc8 100644
--- a/README.md
+++ b/README.md
@@ -64,6 +64,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [How to load Emacs customizations?](#how-to-load-emacs-customizations)
- [How to increase gc-cons-threshold?](#how-to-increase-gc-cons-threshold)
- [How to change the outline-mode or outline-minor-mode Ellipsis (...) to (▼)?](#how-to-change-the-outline-mode-or-outline-minor-mode-ellipsis--to-)
+ - [How to prevent Emacs from loading .dir-locals.el files?](#how-to-prevent-emacs-from-loading-dir-localsel-files)
- [How to make minimal-emacs.d use an environment variable to change ~/.emacs.d to another directory?](#how-to-make-minimal-emacsd-use-an-environment-variable-to-change-emacsd-to-another-directory)
- [Are post-early-init.el and pre-init.el the same file in terms of the logic?](#are-post-early-initel-and-pre-initel-the-same-file-in-terms-of-the-logic)
- [Why is the menu bar disabled by default?](#why-is-the-menu-bar-disabled-by-default)
@@ -1138,6 +1139,16 @@ Add the following to `~/.emacs.d/pre-early-init.el` to ensure that *minimal-emac
If you want to to change the outline-mode or outline-minor-mode Ellipsis (...) to (▼), use the code snippet in this article: [Changing the Ellipsis (“…”) in outline-mode and outline-minor-mode](https://www.jamescherti.com/emacs-customize-ellipsis-outline-minor-mode/).
+### How to prevent Emacs from loading .dir-locals.el files?
+
+By default, Emacs loads `.dir-locals.el` from the current directory or its parents and applies project-specific settings such as indentation, compilation commands, or custom minor modes. While useful in many cases, this behavior can introduce unintended overrides, inconsistencies, or even security risks when working with untrusted projects.
+
+If you want to prevent Emacs from applying these directory-local settings, you can disable `.dir-locals.el` by setting `enable-dir-local-variables` to `nil`:
+
+``` emacs-lisp
+(setq enable-dir-local-variables nil)
+```
+
### How to make minimal-emacs.d use an environment variable to change ~/.emacs.d to another directory?
Add the following to the top of the `~/.emacs.d/pre-early-init.el` file to make *minimal-emacs.d* use the `MINIMAL_EMACS_USER_DIRECTORY` environment variable to change `~/.emacs.d` to another directory:
From 1041509d8d87028291eddaa64b07eeabda4e58c2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 09:11:43 -0400
Subject: [PATCH 138/172] Remove native-comp-debug
---
early-init.el | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/early-init.el b/early-init.el
index 8fc3a59..0fab298 100644
--- a/early-init.el
+++ b/early-init.el
@@ -128,8 +128,7 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(setq native-comp-warning-on-missing-source minimal-emacs-debug
native-comp-async-report-warnings-errors (or minimal-emacs-debug 'silent)
- native-comp-verbose (if minimal-emacs-debug 1 0)
- native-comp-debug (if minimal-emacs-debug 1 0))
+ native-comp-verbose (if minimal-emacs-debug 1 0))
(setq jka-compr-verbose minimal-emacs-debug)
(setq byte-compile-warnings minimal-emacs-debug
From 249f5505c2cf77c714fb7683005696eef234deb2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 12:24:23 -0400
Subject: [PATCH 139/172] Update README.md
---
README.md | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/README.md b/README.md
index 0ec4dc8..61fbcb7 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Alternative: Install minimal-emacs.d into `~/.minimal-emacs.d`](#alternative-install-minimal-emacsd-into-minimal-emacsd)
- [Update minimal-emacs.d](#update-minimal-emacsd)
- [Customizations: Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead)
+ - [Debug on error](#debug-on-error)
- [Customizations: UI (pre-early-init.el)](#customizations-ui-pre-early-initel)
- [How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?](#how-to-enable-the-menu-bar-the-tool-bar-dialogs-the-contextual-menu-and-tooltips)
- [Customizations: Packages (post-init.el)](#customizations-packages-post-initel)
@@ -135,6 +136,16 @@ Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief descript
*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files allows Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add required dependencies. For example, if you're using `use-package`, add `(require 'use-package)` at the top of `post-init.el` to ensure all necessary `use-package` variables and functions are loaded.)*
+## Debug on error
+
+During the development of your init files, the author strongly recommends adding the following line at the very beginning of your `~/.emacs.d/pre-early-init.el` file:
+
+```elisp
+(setq debug-on-error t)
+```
+
+This setting ensures that Emacs enters the debugger whenever an error occurs during initialization. Since `pre-early-init.el` is loaded before `early-init.el`, enabling `debug-on-error` at this stage allows you to catch errors that might otherwise cause Emacs to fail silently or behave unpredictably.
+
## Customizations: UI (pre-early-init.el)
### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?
From 188b60c5089cea9a88b34c8948b412b3a9a82098 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 12:25:42 -0400
Subject: [PATCH 140/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 61fbcb7..da06d53 100644
--- a/README.md
+++ b/README.md
@@ -144,7 +144,7 @@ During the development of your init files, the author strongly recommends adding
(setq debug-on-error t)
```
-This setting ensures that Emacs enters the debugger whenever an error occurs during initialization. Since `pre-early-init.el` is loaded before `early-init.el`, enabling `debug-on-error` at this stage allows you to catch errors that might otherwise cause Emacs to fail silently or behave unpredictably.
+Enabling `debug-on-error` at this stage allows you to catch errors that might otherwise cause Emacs to fail silently or behave unpredictably.
## Customizations: UI (pre-early-init.el)
From 8b4321b3d67fe081b573d846838e19485b6dcf3b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 13:03:03 -0400
Subject: [PATCH 141/172] Update README.md
---
README.md | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index da06d53..586853e 100644
--- a/README.md
+++ b/README.md
@@ -736,7 +736,9 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`:
(use-package inhibit-mouse
:ensure t
:config
- (inhibit-mouse-mode))
+ (if (daemonp)
+ (add-hook 'server-after-make-frame-hook #'inhibit-mouse-mode)
+ (inhibit-mouse-mode 1)))
```
NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed.
From 1cad02838220ab7e6c7a329a2689e9173fcf586a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 14:10:18 -0400
Subject: [PATCH 142/172] Update README.md
---
README.md | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 586853e..9f88851 100644
--- a/README.md
+++ b/README.md
@@ -568,8 +568,10 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency
``` emacs-lisp
;; Required by evil-collection
-(setq evil-want-integration t)
-(setq evil-want-keybinding nil)
+(eval-when-compile
+ ;; It has to be defined before evil
+ (setq evil-want-integration t)
+ (setq evil-want-keybinding nil))
;; Uncomment the following if you are using undo-fu
;; (setq evil-undo-system 'undo-fu)
@@ -581,6 +583,10 @@ Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency
:commands (evil-mode evil-define-key)
:hook (after-init . evil-mode))
+(eval-when-compile
+ ;; It has to be defined before evil-colllection
+ (setq evil-collection-setup-minibuffer t))
+
(use-package evil-collection
:after evil
:ensure t
From 15c8b4df1be3da77b8945dbad803bbcc0f8a031e Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 12:28:07 -0400
Subject: [PATCH 143/172] Add minimal-emacs-load-nosuffix and enhance the
minimal-emacs-load-user-init
This will enable minimal-emacs to load byte-compiled or possibly
native-compiled init files for the following initialization files:
pre-init.el, post-init.el, pre-early-init.el, and post-early-init.el.
---
early-init.el | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/early-init.el b/early-init.el
index 0fab298..8613c6f 100644
--- a/early-init.el
+++ b/early-init.el
@@ -87,12 +87,33 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(error "Configuration error. Debug by starting Emacs with: emacs --debug-init")))))
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
+(defvar minimal-emacs-load-compiled-init-files nil
+ "If non-nil, attempt to load byte-compiled .elc for init files.
+This will enable minimal-emacs to load byte-compiled or possibly native-compiled
+init files for the following initialization files: pre-init.el, post-init.el,
+pre-early-init.el, and post-early-init.el.")
+
+(defun minimal-emacs--remove-el-file-suffix (filename)
+ "Remove the Elisp file suffix from FILENAME and return it (.el, .el.gz...)."
+ (let ((suffixes (mapcar (lambda (ext) (concat ".el" ext))
+ load-file-rep-suffixes)))
+ (catch 'done
+ (dolist (suffix suffixes filename)
+ (when (string-suffix-p suffix filename)
+ (setq filename (substring filename 0 (- (length suffix))))
+ (throw 'done t))))
+ filename))
+
(defun minimal-emacs-load-user-init (filename)
"Execute a file of Lisp code named FILENAME."
(let ((init-file (expand-file-name filename
minimal-emacs-user-directory)))
- (when (file-exists-p init-file)
- (load init-file nil :no-message))))
+ (if (not minimal-emacs-load-compiled-init-files)
+ (load init-file :no-error :no-message :nosuffix)
+ ;; Remove the file suffix (.el, .el.gz, etc.) to let the `load' function
+ ;; select between .el and .elc files.
+ (setq init-file (minimal-emacs--remove-el-file-suffix init-file))
+ (load init-file :no-error :no-message))))
(minimal-emacs-load-user-init "pre-early-init.el")
From f87ce08249590cdd69d74ee1d9a44fc754f1f0df Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 14 Mar 2025 21:49:21 -0400
Subject: [PATCH 144/172] Remove duplicate: help-window-select
---
init.el | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/init.el b/init.el
index 1aa9fd8..41c7473 100644
--- a/init.el
+++ b/init.el
@@ -406,8 +406,6 @@
;;; Help
-(setq help-window-select t) ;; Focus new help windows when opened
-
;; Enhance `apropos' and related functions to perform more extensive searches
(setq apropos-do-all t)
@@ -417,7 +415,7 @@
(setq help-enable-completion-autoload nil)
(setq help-enable-autoload nil)
(setq help-enable-symbol-autoload nil)
-(setq help-window-select t)
+(setq help-window-select t) ;; Focus new help windows when opened
;;; Eglot
From 6388df0f76b88e9257debfd70eea29d9537a0ebf Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 15 Mar 2025 08:31:51 -0400
Subject: [PATCH 145/172] Add gnutls-min-prime-bits
---
early-init.el | 3 +++
1 file changed, 3 insertions(+)
diff --git a/early-init.el b/early-init.el
index 8613c6f..d2075fd 100644
--- a/early-init.el
+++ b/early-init.el
@@ -389,6 +389,9 @@ this stage of initialization."
(setq use-file-dialog nil)
(setq use-dialog-box nil))
+;;; Security
+(setq gnutls-min-prime-bits 3072)
+
;;; package.el
(setq use-package-compute-statistics minimal-emacs-debug)
From a8746315ff0576872baf8bfc8bbe89557c6b9f4b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sat, 15 Mar 2025 08:46:28 -0400
Subject: [PATCH 146/172] Add gnutls-verify-error and tls-checktrust
---
early-init.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index d2075fd..5321cba 100644
--- a/early-init.el
+++ b/early-init.el
@@ -390,7 +390,9 @@ this stage of initialization."
(setq use-dialog-box nil))
;;; Security
-(setq gnutls-min-prime-bits 3072)
+(setq gnutls-verify-error t) ; Prompts user if there are certificate issues
+(setq tls-checktrust t) ; Ensure SSL/TLS connections undergo trust verification
+(setq gnutls-min-prime-bits 3072) ; Stronger GnuTLS encryption
;;; package.el
(setq use-package-compute-statistics minimal-emacs-debug)
From a3df684c514aec6d9f04b752df4d7136060a8212 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 18 Mar 2025 15:55:29 -0400
Subject: [PATCH 147/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 9f88851..a0bba2a 100644
--- a/README.md
+++ b/README.md
@@ -1093,9 +1093,9 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
```emacs-lisp
(defun display-startup-time ()
"Display the startup time and number of garbage collections."
- (message "Emacs loaded in %.2f seconds (Init only: %.2fs) with %d garbage collections."
- (time-to-seconds (time-since before-init-time))
+ (message "Emacs init loaded in %.2f seconds (Full emacs-startup: %.2fs) with %d garbage collections."
(float-time (time-subtract after-init-time before-init-time))
+ (time-to-seconds (time-since before-init-time))
gcs-done))
(add-hook 'emacs-startup-hook #'display-startup-time 100)
From 34d34c279601c86d76ab9ca8b8bf415fb78a8273 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 19 Mar 2025 07:59:43 -0400
Subject: [PATCH 148/172] Add minimal-emacs-enable-native-compilation
---
early-init.el | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/early-init.el b/early-init.el
index 5321cba..2c3d332 100644
--- a/early-init.el
+++ b/early-init.el
@@ -65,6 +65,13 @@ tradeoff is that the mode line is hidden during the startup phase.")
When set to non-nil, Emacs will automatically call `package-initialize' and
`package-refresh-contents' to set up and update the package system.")
+(defvar minimal-emacs-setup-native-compilation t
+ "If non-nil, enable and configure native compilation.
+When enabled, this variable sets the following:
+- `native-comp-deferred-compilation'
+- `native-comp-jit-compilation'
+- `package-native-compile'")
+
(defvar minimal-emacs-user-directory user-emacs-directory
"The default value of the `user-emacs-directory' variable.")
@@ -141,9 +148,9 @@ pre-early-init.el, and post-early-init.el.")
(fboundp 'native-comp-available-p)
(native-comp-available-p))
;; Activate `native-compile'
- (setq native-comp-jit-compilation t
- native-comp-deferred-compilation t
- package-native-compile t)
+ (setq native-comp-deferred-compilation minimal-emacs-setup-native-compilation
+ native-comp-jit-compilation minimal-emacs-setup-native-compilation
+ package-native-compile minimal-emacs-setup-native-compilation)
;; Deactivate the `native-compile' feature if it is not available
(setq features (delq 'native-compile features)))
From 373940e81cdb8e56b3d0a04af4cfe32d09eff361 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 21 Mar 2025 14:26:44 -0400
Subject: [PATCH 149/172] Update README.md
---
README.md | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index a0bba2a..5864d12 100644
--- a/README.md
+++ b/README.md
@@ -1035,11 +1035,9 @@ Add to `~/.emacs.d/pre-early-init.el`:
(setq minimal-emacs-package-initialize-and-refresh nil)
```
-(According to arthsmn, a *minimal-emacs.d* user, the change above also improves startup time. [In this user's case](https://github.com/jamescherti/minimal-emacs.d/pull/22), the startup time decreased from 1.06 seconds to 0.56 seconds.)
-
And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=readme-ov-file#installer) to `~/.emacs.d/pre-init.el`:
```elisp
-(defvar elpaca-installer-version 0.9)
+(defvar elpaca-installer-version 0.10)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory))
(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory))
@@ -1054,7 +1052,7 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
(add-to-list 'load-path (if (file-exists-p build) build repo))
(unless (file-exists-p repo)
(make-directory repo t)
- (when (< emacs-major-version 28) (require 'subr-x))
+ (when (<= emacs-major-version 28) (require 'subr-x))
(condition-case-unless-debug err
(if-let* ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*"))
((zerop (apply #'call-process `("git" nil ,buffer t "clone"
@@ -1077,10 +1075,6 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
(load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
-
-;; Optional: Install use-package support
-(elpaca elpaca-use-package
- (elpaca-use-package-mode))
```
## Frequently asked questions
From 10aa46b0a42d05662e82197ed7e15ffa9a913a10 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Fri, 21 Mar 2025 15:01:01 -0400
Subject: [PATCH 150/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 5864d12..b12d6b2 100644
--- a/README.md
+++ b/README.md
@@ -136,6 +136,8 @@ Replace `FILENAME.el` with the actual name and DESCRIPTION with a brief descript
*(Only if you know what you're doing: Removing `no-byte-compile: t;` from your init files allows Emacs to compile them, improving load and execution speed. However, if you do so, you may need to add required dependencies. For example, if you're using `use-package`, add `(require 'use-package)` at the top of `post-init.el` to ensure all necessary `use-package` variables and functions are loaded.)*
+**Important:** The examples in this README reference pre/post init files in the `~/.emacs.d/` directory, but the files `pre-early-init.el`, `post-early-init.el`, `pre-init.el`, and `post-init.el` should be placed in the same directory as `init.el` and `early-init.el`, regardless of their location.
+
## Debug on error
During the development of your init files, the author strongly recommends adding the following line at the very beginning of your `~/.emacs.d/pre-early-init.el` file:
From 616bea30c74ac213d891c0934a5904f01a7bcfe3 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 23 Mar 2025 08:28:58 -0400
Subject: [PATCH 151/172] Closes #53: Update docstrings
---
early-init.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/early-init.el b/early-init.el
index 2c3d332..fd949cc 100644
--- a/early-init.el
+++ b/early-init.el
@@ -17,7 +17,7 @@
;;; Variables
(defvar minimal-emacs-ui-features '()
- "List of user interface features to disable in minimal Emacs setup.
+ "List of user interface features to enable in minimal Emacs setup.
This variable holds a list Emacs UI features that can be enabled:
- context-menu (Enables the context menu in graphical environments.)
- tool-bar (Enables the tool bar in graphical environments.)
From 0caaeb6110e738eeefdd28f1bc16c3f67b7dc667 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Sun, 23 Mar 2025 16:48:27 -0400
Subject: [PATCH 152/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b12d6b2..a618e0b 100644
--- a/README.md
+++ b/README.md
@@ -152,7 +152,7 @@ Enabling `debug-on-error` at this stage allows you to catch errors that might ot
### How to enable the menu-bar, the tool-bar, dialogs, the contextual menu, and tooltips?
-**Note:** Enabling the tool-bar, menu-bar, and similar UI elements may slightly increase your startup time.
+**Note:** Enabling the tool-bar or menu-bar may slightly increase your startup time.
To customize your Emacs setup to include various user interface elements, you can use the following settings in your ``~/.emacs.d/pre-early-init.el``:
From 052a7199f27ebb86b67bf2e3b27f258cef529bde Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 10:45:18 -0400
Subject: [PATCH 153/172] Update README.md
---
README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/README.md b/README.md
index a618e0b..0d88d6f 100644
--- a/README.md
+++ b/README.md
@@ -1077,6 +1077,14 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
(load "./elpaca-autoloads")))
(add-hook 'after-init-hook #'elpaca-process-queues)
(elpaca `(,@elpaca-order))
+
+;; Optional: Install use-package support
+;; If you enable elpaca-use-package, some packages, such as Vertico,
+;; may require modifications. See the following discussion for details:
+;; https://github.com/jamescherti/minimal-emacs.d/issues/54
+;;
+;; (elpaca elpaca-use-package
+;; (elpaca-use-package-mode))
```
## Frequently asked questions
From d6eac7d7055325655cd2dfae73a40c56d8946395 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 10:50:34 -0400
Subject: [PATCH 154/172] Update README.md
---
README.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/README.md b/README.md
index 0d88d6f..7b9ecc1 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [How to keep minimal-emacs.d pre-\*.el and post-\*.el files in a separate directory?](#how-to-keep-minimal-emacsd-pre-el-and-post-el-files-in-a-separate-directory)
- [How to make *minimal-emacs.d* install packages in the early-init phase instead of the init phase?](#how-to-make-minimal-emacsd-install-packages-in-the-early-init-phase-instead-of-the-init-phase)
- [Comments from users](#comments-from-users)
+ - [Minimal-emacs.d configurations from users](#minimal-emacsd-configurations-from-users)
- [Features](#features)
- [Author and license](#author-and-license)
- [Links](#links)
@@ -1261,6 +1262,14 @@ A drawback of using the early-init phase instead of init is that if a package fa
- [LionyxML](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb35t9y/) considers that *minimal-emacs.d* contains one of the best README files he has ever read. The author of *minimal-emacs.d* found his comment encouraging. Reading this README.md is highly recommended for anyone looking to start customizing their *minimal-emacs.d* configuration.
- [cyneox](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mdnzgqx/): "Still using it and loving it! Thanks for the regular updates."
+### Minimal-emacs.d configurations from users
+
+- [Victor Dorneanu's minimal-emacs.d configuration](https://github.com/dorneanu/dotfiles/blob/master/minimal-emacs/config.org)
+
+- [Mark Norton's minimal-emacs.d configuration](https://github.com/Remillard/minimal-emacs.d/tree/develop)
+
+Please share your configuration. It could serve as inspiration for other users.
+
## Features
1. **Performance Improvements:**
From 9952dc2bbbd5f3e74923b774fa730f72dc5ecc4b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 10:52:24 -0400
Subject: [PATCH 155/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 7b9ecc1..5368b5e 100644
--- a/README.md
+++ b/README.md
@@ -1080,8 +1080,8 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read
(elpaca `(,@elpaca-order))
;; Optional: Install use-package support
-;; If you enable elpaca-use-package, some packages, such as Vertico,
-;; may require modifications. See the following discussion for details:
+;; If you enable elpaca-use-package, some use-package definitions, such as
+;; Vertico's, may need modifications. See the following discussion for details:
;; https://github.com/jamescherti/minimal-emacs.d/issues/54
;;
;; (elpaca elpaca-use-package
From 24b7946fcb57e3cc5e532bc4a3378e2116a2e264 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 14:32:13 -0400
Subject: [PATCH 156/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5368b5e..6ab65ed 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@

[](https://www.gnu.org/licenses/gpl-3.0)
-The **minimal-emacs.d** project is a lightweight, bloat-free Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup.
+The **minimal-emacs.d** project is a lightweight and optimized Emacs base (`init.el` and `early-init.el`) that **gives you full control over your configuration** (without the complexity of, for instance, Doom Emacs or Spacemacs). It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup.
Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of **extensive research and testing** to fine-tune the best parameters and optimizations for an Emacs configuration. *(More information about the *minimal-emacs.d* features can be found here: [Features](#features).)*
From c30a9cc4ffcd07aacd0689f1b5df45d076165c2f Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 19:40:04 -0400
Subject: [PATCH 157/172] Update README.md
---
README.md | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/README.md b/README.md
index 6ab65ed..48f833e 100644
--- a/README.md
+++ b/README.md
@@ -50,6 +50,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Configuring org-mode](#configuring-org-mode)
- [Inhibit the mouse](#inhibit-the-mouse)
- [Spell checker](#spell-checker)
+ - [Code formatter](#code-formatter)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
- [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel)
@@ -794,6 +795,24 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`:
flyspell-prog-text-faces)))
```
+### Code formatter
+
+Apheleia is an Emacs package designed to run code formatters asynchronously without disrupting the cursor position. Code formatters like Shfmt, Black and Prettier ensure consistency and improve collaboration by automating formatting, but running them on save can introduce latency (e.g., Black takes around 200ms on an empty file) and unpredictably move the cursor when modifying nearby text.
+
+Apheleia solves both problems across all languages, replacing language-specific packages like Blacken and prettier-js. It does this by invoking formatters in an `after-save-hook`, ensuring changes are applied only if the buffer remains unmodified.
+
+To maintain cursor stability, Apheleia generates an RCS patch, applies it selectively, and employs a dynamic programming algorithm to reposition the cursor if necessary. If the formatting alters the vertical position of the cursor in the window, Apheleia adjusts the scroll position to preserve visual continuity across all displayed instances of the buffer. This allows enjoying automated code formatting without sacrificing editor responsiveness or usability.
+
+To configure **apheleia**, add the following to `~/.emacs.d/post-init.el`:
+```elisp
+(use-package apheleia
+ :ensure t
+ :defer t
+ :commands (apheleia-mode
+ apheleia-global-mode)
+ :hook ((prog-mode . apheleia-mode)))
+```
+
### A better Emacs *help* buffer
Helpful is an alternative to the built-in Emacs help that provides much more contextual information.
From 33b06a454b5a98e854512dafff1dec1806cf2679 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 19:41:13 -0400
Subject: [PATCH 158/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 48f833e..52567cd 100644
--- a/README.md
+++ b/README.md
@@ -50,7 +50,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Configuring org-mode](#configuring-org-mode)
- [Inhibit the mouse](#inhibit-the-mouse)
- [Spell checker](#spell-checker)
- - [Code formatter](#code-formatter)
+ - [Asynchronous code formatting without cursor disruption (Apheleia)](#asynchronous-code-formatting-without-cursor-disruption-apheleia)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
- [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel)
@@ -795,7 +795,7 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`:
flyspell-prog-text-faces)))
```
-### Code formatter
+### Asynchronous code formatting without cursor disruption (Apheleia)
Apheleia is an Emacs package designed to run code formatters asynchronously without disrupting the cursor position. Code formatters like Shfmt, Black and Prettier ensure consistency and improve collaboration by automating formatting, but running them on save can introduce latency (e.g., Black takes around 200ms on an empty file) and unpredictably move the cursor when modifying nearby text.
From c2ef0f6ebc3c0487851d5530e40f7af50e07d58b Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 19:43:08 -0400
Subject: [PATCH 159/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 52567cd..7300ec8 100644
--- a/README.md
+++ b/README.md
@@ -1135,7 +1135,7 @@ By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA
Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
-- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
+- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, **MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues** like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
From e00753f2c6ef8a6890370f2056281cb259fddb78 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 25 Mar 2025 19:43:53 -0400
Subject: [PATCH 160/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 7300ec8..fdc3a01 100644
--- a/README.md
+++ b/README.md
@@ -50,7 +50,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Configuring org-mode](#configuring-org-mode)
- [Inhibit the mouse](#inhibit-the-mouse)
- [Spell checker](#spell-checker)
- - [Asynchronous code formatting without cursor disruption (Apheleia)](#asynchronous-code-formatting-without-cursor-disruption-apheleia)
+ - [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
- [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel)
@@ -795,7 +795,7 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`:
flyspell-prog-text-faces)))
```
-### Asynchronous code formatting without cursor disruption (Apheleia)
+### Asynchronous code formatting without cursor disruption
Apheleia is an Emacs package designed to run code formatters asynchronously without disrupting the cursor position. Code formatters like Shfmt, Black and Prettier ensure consistency and improve collaboration by automating formatting, but running them on save can introduce latency (e.g., Black takes around 200ms on an empty file) and unpredictably move the cursor when modifying nearby text.
From 907ee513e816a5629cfdf47ded04799f6b901af7 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Mar 2025 10:50:47 -0400
Subject: [PATCH 161/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index fdc3a01..6df0b84 100644
--- a/README.md
+++ b/README.md
@@ -1285,6 +1285,8 @@ A drawback of using the early-init phase instead of init is that if a package fa
- [Victor Dorneanu's minimal-emacs.d configuration](https://github.com/dorneanu/dotfiles/blob/master/minimal-emacs/config.org)
+- [flowfx emacs.d](https://codeberg.org/flowfx/emacs.d)
+
- [Mark Norton's minimal-emacs.d configuration](https://github.com/Remillard/minimal-emacs.d/tree/develop)
Please share your configuration. It could serve as inspiration for other users.
From fb39be1cdeae1d2bed964c63e2005a950b5ca6a2 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Mar 2025 10:59:33 -0400
Subject: [PATCH 162/172] Update README.md
---
README.md | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6df0b84..3fd4e4f 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
- [Asynchronous code formatting without cursor disruption](#asynchronous-code-formatting-without-cursor-disruption)
- [A better Emacs *help* buffer](#a-better-emacs-help-buffer)
- [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience)
+ - [Showing the tab-bar](#showing-the-tab-bar)
- [Preventing Emacs from saving custom.el](#preventing-emacs-from-saving-customel)
- [Which other customizations can be interesting to add?](#which-other-customizations-can-be-interesting-to-add)
- [Customizations: pre-early-init.el](#customizations-pre-early-initel)
@@ -900,6 +901,13 @@ Other optional packages that may be useful include:
elisp-refs-symbol))
```
+### Showing the tab-bar
+
+Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively when multiple tabs are open:
+```elisp
+(setopt tab-bar-show 1)
+```
+
### Preventing Emacs from saving custom.el
To prevent Emacs from saving customization information to a custom file, set `custom-file` to `null-device` by adding to the following to `~/.emacs.d/post-init.el`:
@@ -1285,7 +1293,9 @@ A drawback of using the early-init phase instead of init is that if a package fa
- [Victor Dorneanu's minimal-emacs.d configuration](https://github.com/dorneanu/dotfiles/blob/master/minimal-emacs/config.org)
-- [flowfx emacs.d](https://codeberg.org/flowfx/emacs.d)
+- [Flowfx emacs.d](https://codeberg.org/flowfx/emacs.d)
+
+- [John B. Sigman: A literate Emacs configuration inspired by minimal-emacs.d](https://www.johnsigman.com/projects/emacs_config/)
- [Mark Norton's minimal-emacs.d configuration](https://github.com/Remillard/minimal-emacs.d/tree/develop)
From 68cd734633c36453434d9938a461ac399ce3b197 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Mar 2025 10:59:58 -0400
Subject: [PATCH 163/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 3fd4e4f..cd3393d 100644
--- a/README.md
+++ b/README.md
@@ -1295,7 +1295,7 @@ A drawback of using the early-init phase instead of init is that if a package fa
- [Flowfx emacs.d](https://codeberg.org/flowfx/emacs.d)
-- [John B. Sigman: A literate Emacs configuration inspired by minimal-emacs.d](https://www.johnsigman.com/projects/emacs_config/)
+- [John B. Sigman: A literate Emacs configuration with some parts inspired by minimal-emacs.d](https://www.johnsigman.com/projects/emacs_config/)
- [Mark Norton's minimal-emacs.d configuration](https://github.com/Remillard/minimal-emacs.d/tree/develop)
From 4276b3a53a9aa258f2941ab0350316cbad1a35bc Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Thu, 27 Mar 2025 11:09:59 -0400
Subject: [PATCH 164/172] Update README.md
---
README.md | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index cd3393d..5ca2439 100644
--- a/README.md
+++ b/README.md
@@ -267,7 +267,7 @@ This is different from `auto-save-mode`: `auto-save-mode` periodically saves all
### Code completion with corfu
-Corfu enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down.
+[Corfu](https://github.com/minad/corfu) enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down.
Cape, or Completion At Point Extensions, extends the capabilities of in-buffer completion. It integrates with Corfu or the default completion UI, by providing additional backends through completion-at-point-functions.
@@ -310,7 +310,13 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`:
### Configuring Vertico, Consult, and Embark
-Vertico, Consult, and Embark collectively enhance Emacs' completion and navigation capabilities. Vertico provides a vertical completion interface, making it easier to navigate and select from completion candidates (e.g., when `M-x` is pressed). Consult offers a suite of commands for efficient searching, previewing, and interacting with buffers, file contents, and more, improving various tasks. Embark integrates with these tools to provide context-sensitive actions and quick access to commands based on the current selection, further improving user efficiency and workflow within Emacs. Together, they create a cohesive and powerful environment for managing completions and interactions.
+[Vertico](https://github.com/minad/vertico), [Consult](https://github.com/minad/consult), and [Embark](https://github.com/oantolin/embark) collectively enhance Emacs' completion and navigation capabilities.
+
+Vertico provides a vertical completion interface, making it easier to navigate and select from completion candidates (e.g., when `M-x` is pressed).
+
+Consult offers a suite of commands for efficient searching, previewing, and interacting with buffers, file contents, and more, improving various tasks.
+
+Embark integrates with these tools to provide context-sensitive actions and quick access to commands based on the current selection, further improving user efficiency and workflow within Emacs. Together, they create a cohesive and powerful environment for managing completions and interactions.

@@ -569,7 +575,7 @@ To install and configure these packages, add the following to `~/.emacs.d/post-i
### Configuring Vim keybindings using Evil?
-Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up Evil mode:
+Configuring Vim keybindings in Emacs can greatly enhance your editing efficiency if you are accustomed to Vim's modal editing style. Add the following to `~/.emacs.d/post-init.el` to set up [Evil mode](https://github.com/emacs-evil/evil):
``` emacs-lisp
;; Required by evil-collection
@@ -681,7 +687,7 @@ Here is an example of how to configure Eglot to enable or disable certain option
### Session Management
-The `easysession.el` Emacs package is a session manager for Emacs that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, windows/splits, the built-in tab-bar (including tabs, their buffers, and windows), and Emacs frames. It offers a convenient and effortless way to manage Emacs editing sessions and utilizes built-in Emacs functions to persist and restore frames.
+The [easysession](https://github.com/jamescherti/easysession.el) Emacs package is a session manager for Emacs that can persist and restore file editing buffers, indirect buffers/clones, Dired buffers, windows/splits, the built-in tab-bar (including tabs, their buffers, and windows), and Emacs frames. It offers a convenient and effortless way to manage Emacs editing sessions and utilizes built-in Emacs functions to persist and restore frames.
To configure **easysession**, add the following to `~/.emacs.d/post-init.el`:
``` emacs-lisp
@@ -736,7 +742,7 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`:
### Inhibit the mouse
-The **inhibit-mouse** package disables mouse input in Emacs.
+The [inhibit-mouse](https://github.com/jamescherti/inhibit-mouse.el) package disables mouse input in Emacs.
This package is useful for users who want to disable the mouse to:
- Prevent accidental clicks or cursor movements that may unexpectedly change the cursor position.
@@ -798,7 +804,7 @@ To configure **flyspell**, add the following to `~/.emacs.d/post-init.el`:
### Asynchronous code formatting without cursor disruption
-Apheleia is an Emacs package designed to run code formatters asynchronously without disrupting the cursor position. Code formatters like Shfmt, Black and Prettier ensure consistency and improve collaboration by automating formatting, but running them on save can introduce latency (e.g., Black takes around 200ms on an empty file) and unpredictably move the cursor when modifying nearby text.
+[Apheleia](https://github.com/radian-software/apheleia) is an Emacs package designed to run code formatters asynchronously without disrupting the cursor position. Code formatters like Shfmt, Black and Prettier ensure consistency and improve collaboration by automating formatting, but running them on save can introduce latency (e.g., Black takes around 200ms on an empty file) and unpredictably move the cursor when modifying nearby text.
Apheleia solves both problems across all languages, replacing language-specific packages like Blacken and prettier-js. It does this by invoking formatters in an `after-save-hook`, ensuring changes are applied only if the buffer remains unmodified.
@@ -1137,9 +1143,9 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
-By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA Stable](https://stable.melpa.org/). If you prefer to use MELPA Stable, you can follow the instructions below. However, please note the following important warning:
+**Note: The minimal-emacs.d author does not recommend using MELPA Stable. Use MELPA instead, which is enabled by default in the minimal-emacs.d configuration.
-**IMPORTANT: Some MELPA Stable packages are outdated and lack important features.**
+By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA Stable](https://stable.melpa.org/) because MELPA Stable offers outdated packages that lack essential features. If you prefer to use MELPA Stable, you may follow the instructions below.
Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
From 3281b6a5dd3a36ed504a460703bbd729b2425df3 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Mon, 31 Mar 2025 13:42:03 -0400
Subject: [PATCH 165/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5ca2439..9488a6e 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ Building the *minimal-emacs.d* `init.el` and `early-init.el` was the result of *
If you're looking for the ideal starter kit to customize Emacs, you've found it. The *minimal-emacs.d* project is:
- **Minimal yet effective:** A solid starting point.
- **Better defaults:** Improved settings for usability, UI, garbage collection, and built-in packages.
-- **No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable and which packages to load with `require`.
+- **0 packages loaded / No forced modes:** Unlike other frameworks or starter kits, *minimal-emacs.d* does not impose modes or require packages. **You have full control** over which global or minor modes to enable and which packages to load with `require`.
- **Customizable foundation:** Designed to be extended, not replaced. This README.md offers extensive recommendations for customizing your *minimal-emacs.d* configuration. (Reminder: [Never modify init.el and early-init.el. Modify these instead...](#customizations-never-modify-initel-and-early-initel-modify-these-instead))
The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongside **146 packages** ([See the packages that the author is using here](https://www.jamescherti.com/essential-emacs-packages/)). Yet, thanks to its efficient design, Emacs still **starts in just 0.22 seconds**:
From 45cf6b01c8f7cc44ce7f0e751370cbc59886ffad Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 1 Apr 2025 11:02:20 -0400
Subject: [PATCH 166/172] Remove eldoc-documentation-strategy
---
init.el | 3 ---
1 file changed, 3 deletions(-)
diff --git a/init.el b/init.el
index 41c7473..194922d 100644
--- a/init.el
+++ b/init.el
@@ -107,9 +107,6 @@
;; Improve Emacs' responsiveness by delaying syntax highlighting during input
(setq redisplay-skip-fontification-on-input t)
-;; Collects and displays all available documentation immediately
-(setq eldoc-documentation-strategy 'eldoc-documentation-compose-eagerly)
-
;; Disable truncation of printed s-expressions in the message buffer
(setq eval-expression-print-length nil
eval-expression-print-level nil)
From a19fa73aeccb29e820af80cf77fd4fc3ed9ae70d Mon Sep 17 00:00:00 2001
From: Alberto Santini
Date: Thu, 3 Apr 2025 09:02:28 +0200
Subject: [PATCH 167/172] Update README.md init file
Update typo (emcs vs. emacs) init file link in more information.
See #56
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 9488a6e..4ee4fdb 100644
--- a/README.md
+++ b/README.md
@@ -84,7 +84,7 @@ In addition to *minimal-emacs.d*, startup speed is influenced by your computer's
## Install minimal-emacs.d
-- **Important:** Ensure that the `~/.emacs` and `~/.emacs.el` files do not exist. These files cause Emacs to ignore `~/.emacs.d/init.el`. This behavior is due to the way Emacs searches for initialization files ([more information](https://www.gnu.org/software/emcs/manual/html_node/emacs/Find-Init.html#Find-Init)). **Simply delete the *~/.emacs* and *~/.emacs.el* files avoid this issue.**
+- **Important:** Ensure that the `~/.emacs` and `~/.emacs.el` files do not exist. These files cause Emacs to ignore `~/.emacs.d/init.el`. This behavior is due to the way Emacs searches for initialization files ([more information](https://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html#Find-Init)). **Simply delete the *~/.emacs* and *~/.emacs.el* files avoid this issue.**
- **Debug:** If a package or any other functionality is not working as expected, start Emacs with `emacs --debug-init` to enable debug mode and obtain the backtrace.
- **Prerequisite:** git
From 5e64341f07c51440cc98c83a9f0e3709d7d01120 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Wed, 9 Apr 2025 15:15:32 -0400
Subject: [PATCH 168/172] Update .github files
---
.github/FUNDING.yml | 1 +
1 file changed, 1 insertion(+)
create mode 100644 .github/FUNDING.yml
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..fbeac8c
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+github: jamescherti
From 0a10ed9ca0e999a1b6e3afa0cb298896f421432a Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 15 Apr 2025 22:01:11 -0400
Subject: [PATCH 169/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 4ee4fdb..9695ba8 100644
--- a/README.md
+++ b/README.md
@@ -733,7 +733,7 @@ To configure **org-mode**, add the following to `~/.emacs.d/post-init.el`:
(org-startup-indented t)
(org-adapt-indentation nil)
(org-edit-src-content-indentation 0)
- (org-startup-truncated nil)
+ (org-startup-truncated t)
(org-fontify-done-headline t)
(org-fontify-todo-headline t)
(org-fontify-whole-heading-line t)
From 879345462968da8d15b4c3c9e5bc2ea8904ffe68 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 15 Apr 2025 22:06:41 -0400
Subject: [PATCH 170/172] Update README.md
---
README.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/README.md b/README.md
index 9695ba8..b3d9abb 100644
--- a/README.md
+++ b/README.md
@@ -1143,12 +1143,12 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
### How to use MELPA stable?
-**Note: The minimal-emacs.d author does not recommend using MELPA Stable. Use MELPA instead, which is enabled by default in the minimal-emacs.d configuration.
+**Note: The minimal-emacs.d author does not recommend using MELPA Stable. Use MELPA instead, which is enabled by default in the minimal-emacs.d configuration.**
By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA Stable](https://stable.melpa.org/) because MELPA Stable offers outdated packages that lack essential features. If you prefer to use MELPA Stable, you may follow the instructions below.
Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
-- **MELPA** is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
+- **MELPA** (preferred) is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, **MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues** like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
If you prefer MELPA Stable over MELPA, you can add MELPA Stable and prioritize it. To ensure packages are fetched from MELPA Stable first, add the following configuration to `~/.emacs.d/post-early-init.el`:
From 62b2283de08a7842af5f2a6b27fe455aac67f54d Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 15 Apr 2025 22:07:53 -0400
Subject: [PATCH 171/172] Update README.md
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index b3d9abb..c33379c 100644
--- a/README.md
+++ b/README.md
@@ -1147,7 +1147,7 @@ Add the following to your `~/.emacs.d/pre-early-init.el` file:
By default, *minimal-emacs.d* uses [MELPA](https://melpa.org/) instead of [MELPA Stable](https://stable.melpa.org/) because MELPA Stable offers outdated packages that lack essential features. If you prefer to use MELPA Stable, you may follow the instructions below.
-Here are the key differences between [MELPA](https://melpa.org/) (the default repository used in minimal-emacs.d) and [MELPA Stable](https://stable.melpa.org/):
+Here are the key differences between **MELPA** (the default repository used in minimal-emacs.d) and **MELPA Stable**:
- **MELPA** (preferred) is a rolling release repository for Emacs packages, where packages are continuously updated with the latest commits from their respective development branches, delivering the most current features and bug fixes. While MELPA features the latest changes, most Emacs package developers have learned to maintain a relatively stable master branch, which contributes to MELPA’s overall stability. Furthermore, MELPA includes a broader selection of packages.
- In contrast, **MELPA Stable** is a repository that hosts versioned, tagged releases of packages. However, **MELPA Stable does not guarantee more reliability than MELPA, as its tagged versions may still suffer from issues** like uncoordinated dependencies or incomplete testing, and updates are less frequent, often based on developer discretion rather than every new commit.
From 4b680d7be374d3a8291aaa1de026eff1699d1849 Mon Sep 17 00:00:00 2001
From: James Cherti <60946298+jamescherti@users.noreply.github.com>
Date: Tue, 15 Apr 2025 22:14:54 -0400
Subject: [PATCH 172/172] Update README.md
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index c33379c..83e58dc 100644
--- a/README.md
+++ b/README.md
@@ -1185,6 +1185,8 @@ To load customizations saved by Emacs (`M-x customize`), add the following code
(load custom-file 'noerror 'nomessage)
```
+However, rather than relying on customizations loaded with the code above, the author recommends configuring Emacs through init files (just as you are doing by reading this README.md and customizing packages using `use-package` with the `:custom` keyword).
+
### How to increase gc-cons-threshold?
Add the following to `~/.emacs.d/pre-early-init.el` to ensure that *minimal-emacs.d* restores the specified amount after startup: