From 273854e15e4369960cedc7c4e4bba44354c9bbb1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:14:27 -0500 Subject: [PATCH 01/81] Update file-name-handler-alist initial value --- early-init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/early-init.el b/early-init.el index a976879..17f4954 100644 --- a/early-init.el +++ b/early-init.el @@ -101,8 +101,7 @@ When set to non-nil, Emacs will automatically call `package-initialize' and nil (list (rassq 'jka-compr-handler old-value)))) ;; Ensure the new value persists through any current let-binding. - (set-default-toplevel-value 'file-name-handler-alist - file-name-handler-alist) + (put 'file-name-handler-alist 'initial-value old-value) ;; Remember the old value to reset it as needed. (add-hook 'emacs-startup-hook (lambda () From 9ae4cb9f5675039f227fee4b77aedd9fee65d741 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:17:15 -0500 Subject: [PATCH 02/81] Restore `file-name-handler-alist' when processing command-line --- early-init.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/early-init.el b/early-init.el index 17f4954..7ad2698 100644 --- a/early-init.el +++ b/early-init.el @@ -102,6 +102,13 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (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))) ;; Remember the old value to reset it as needed. (add-hook 'emacs-startup-hook (lambda () From a3a37c233d7b695b30701ad056ee2df49c95e576 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:25:39 -0500 Subject: [PATCH 03/81] Update the order of mode-line-format sexp --- early-init.el | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/early-init.el b/early-init.el index 7ad2698..78d0df5 100644 --- a/early-init.el +++ b/early-init.el @@ -121,29 +121,27 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (unless noninteractive (unless minimal-emacs-debug - (unless minimal-emacs-debug - ;; Suppress redisplay and redraw during startup to avoid delays and - ;; prevent flashing an unstyled Emacs frame. - ;; (setq-default inhibit-redisplay t) ; Can cause artifacts - (setq-default inhibit-message t) + ;; Suppress redisplay and redraw during startup to avoid delays and + ;; prevent flashing an unstyled Emacs frame. + ;; (setq-default inhibit-redisplay t) ; Can cause artifacts + (setq-default inhibit-message t) - ;; Reset the above variables to prevent Emacs from appearing frozen or - ;; visually corrupted after startup or if a startup error occurs. - (defun minimal-emacs--reset-inhibited-vars-h () - ;; (setq-default inhibit-redisplay nil) ; Can cause artifacts - (setq-default inhibit-message nil) - (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibited-vars-h)) + ;; Reset the above variables to prevent Emacs from appearing frozen or + ;; visually corrupted after startup or if a startup error occurs. + (defun minimal-emacs--reset-inhibited-vars-h () + ;; (setq-default inhibit-redisplay nil) ; Can cause artifacts + (setq-default inhibit-message nil) + (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibited-vars-h)) - (add-hook 'post-command-hook - #'minimal-emacs--reset-inhibited-vars-h -100)) - - (dolist (buf (buffer-list)) - (with-current-buffer buf - (setq mode-line-format nil))) + (add-hook 'post-command-hook + #'minimal-emacs--reset-inhibited-vars-h -100) (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))) (defun minimal-emacs--startup-load-user-init-file (fn &rest args) "Advice for startup--load-user-init-file to reset mode-line-format." From b44f59a77d042e76ab1dc312ff40db022d05c62d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:53:11 -0500 Subject: [PATCH 04/81] Add vc-git-print-log-follow and apropos-do-all --- early-init.el | 25 ++++++++++++------------- init.el | 10 ++++++++++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/early-init.el b/early-init.el index 78d0df5..5c00f27 100644 --- a/early-init.el +++ b/early-init.el @@ -90,16 +90,16 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (unless (daemonp) (let ((old-value (default-toplevel-value 'file-name-handler-alist))) - (set-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. - (if (eval-when-compile - (locate-file-internal "calc-loaddefs.el" load-path)) - nil - (list (rassq 'jka-compr-handler old-value)))) + ;; 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 @@ -146,9 +146,8 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (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 - (progn - ;; Start up as normal - (apply fn args)) + ;; 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. (setq-default inhibit-message nil) diff --git a/init.el b/init.el index 099f9e1..0294bf6 100644 --- a/init.el +++ b/init.el @@ -166,6 +166,10 @@ (setq version-control t) ; Use version numbers for backup files (setq kept-new-versions 5) (setq kept-old-versions 5) + +;;; VC + +(setq vc-git-print-log-follow t) (setq vc-make-backup-files nil) ; Do not backup version controlled files ;;; Auto save @@ -401,6 +405,12 @@ (setq ediff-window-setup-function #'ediff-setup-windows-plain ediff-split-window-function #'split-window-horizontally) +;;; Help + +;; Enhance `apropos' and related functions to perform more extensive searches, +;; increasing their usefulness. +(setq apropos-do-all t) + ;;; Load post-init.el (minimal-emacs-load-user-init "post-init.el") From d04da862544aad000ecef7c5686aafae39c4d7a2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 21:58:51 -0500 Subject: [PATCH 05/81] Add redisplay-skip-fontification-on-input and mouse-wheel-* --- init.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.el b/init.el index 0294bf6..dd2e61a 100644 --- a/init.el +++ b/init.el @@ -113,6 +113,10 @@ ;; Increase how much is read from processes in a single chunk (setq read-process-output-max (* 512 1024)) ; 512kb +;; 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, even if ;; multiple sources provide it. It concatenates the results. (setq eldoc-documentation-strategy 'eldoc-documentation-compose-eagerly) @@ -274,6 +278,9 @@ (setq hscroll-margin 2 hscroll-step 1) +(setq mouse-wheel-scroll-amount '(2 ((shift) . hscroll)) + mouse-wheel-scroll-amount-horizontal 2) + ;;; Mouse Scroll ;; Emacs 29 From cdef3035a34ec921254be52c5522a86857172a89 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 22:23:13 -0500 Subject: [PATCH 06/81] Update recentf options and add minimal-emacs--cleanup-hook --- init.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index dd2e61a..172fa34 100644 --- a/init.el +++ b/init.el @@ -211,7 +211,17 @@ ;; accessed files, making it easier to reopen files you have worked on ;; recently. (setq recentf-max-saved-items 300) ; default is 20 -(setq recentf-auto-cleanup 'mode) +(setq recentf-max-menu-items 15) +(setq recentf-auto-cleanup 'never) + +(defun minimal-emacs--cleanup-hook () + "Run `recentf-cleanup' if `recentf' is loaded and `recentf-mode' is enabled." + (when (and (featurep 'recentf) + recentf-mode + (fboundp 'recentf-cleanup)) + (recentf-cleanup))) + +(add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) ;;; saveplace ;; `save-place-mode` enables Emacs to remember the last location within a file From 014acf26133d9a7d61325b7b2f56dd321be8a8fe Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 2 Feb 2025 22:25:04 -0500 Subject: [PATCH 07/81] Update recentf options --- init.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init.el b/init.el index 172fa34..911a19e 100644 --- a/init.el +++ b/init.el @@ -212,15 +212,13 @@ ;; recently. (setq recentf-max-saved-items 300) ; default is 20 (setq recentf-max-menu-items 15) -(setq recentf-auto-cleanup 'never) - +(setq recentf-auto-cleanup (if (daemonp) 300 'never)) (defun minimal-emacs--cleanup-hook () "Run `recentf-cleanup' if `recentf' is loaded and `recentf-mode' is enabled." (when (and (featurep 'recentf) recentf-mode (fboundp 'recentf-cleanup)) (recentf-cleanup))) - (add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) ;;; saveplace From c64fcacd3dc84b7de5e81c4e3c89d714cebaf694 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:46:38 -0500 Subject: [PATCH 08/81] The load function: set nosuffix to t to ensure the exact file is loaded. --- early-init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/early-init.el b/early-init.el index 5c00f27..a6825cb 100644 --- a/early-init.el +++ b/early-init.el @@ -54,7 +54,7 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (expand-file-name filename minimal-emacs-user-directory))) (when (file-exists-p user-init-file) - (load user-init-file nil t)))) + (load user-init-file nil t t)))) (minimal-emacs-load-user-init "pre-early-init.el") From 80efc418b968346414e9d9e4712040964e41e885 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 09:56:21 -0500 Subject: [PATCH 09/81] Add a buffer section --- init.el | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/init.el b/init.el index 911a19e..b698e9e 100644 --- a/init.el +++ b/init.el @@ -78,9 +78,6 @@ ;;; Misc -;; switch-to-buffer runs pop-to-buffer-same-window instead -(setq switch-to-buffer-obey-display-actions t) - (setq show-paren-delay 0.1 show-paren-highlight-openparen t show-paren-when-point-inside-paren t @@ -98,9 +95,6 @@ (setq-default display-line-numbers-width 3) (setq-default display-line-numbers-widen t) -(setq comint-prompt-read-only t) -(setq comint-buffer-maximum-size 2048) - (setq compilation-always-kill t compilation-ask-about-save nil compilation-scroll-output 'first-error) @@ -137,11 +131,6 @@ (setq find-file-visit-truename t vc-follow-symlinks t) -;; Skip confirmation prompts when creating a new file or buffer -(setq confirm-nonexistent-file-or-buffer nil) - -(setq uniquify-buffer-name-style 'forward) - (setq mouse-yank-at-point t) ;; Prefer vertical splits over horizontal ones @@ -154,6 +143,19 @@ window-divider-default-places t window-divider-default-right-width 1) +;;; Buffers + +;; switch-to-buffer runs pop-to-buffer-same-window instead +(setq switch-to-buffer-obey-display-actions t) + +(setq uniquify-buffer-name-style 'forward) + +(setq comint-prompt-read-only t) +(setq comint-buffer-maximum-size 2048) + +;; Skip confirmation prompts when creating a new file or buffer +(setq confirm-nonexistent-file-or-buffer nil) + ;;; Backup files ;; Avoid generating backups or lockfiles to prevent creating world-readable @@ -286,11 +288,11 @@ (setq hscroll-margin 2 hscroll-step 1) +;;; Mouse + (setq mouse-wheel-scroll-amount '(2 ((shift) . hscroll)) mouse-wheel-scroll-amount-horizontal 2) -;;; Mouse Scroll - ;; Emacs 29 (when (memq 'context-menu minimal-emacs-ui-features) (when (and (display-graphic-p) (fboundp 'context-menu-mode)) From 13737dc30a3c332dd431828d8c971613b733ca15 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:06:11 -0500 Subject: [PATCH 10/81] Remove adding features that are not represented as packages --- init.el | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/init.el b/init.el index b698e9e..27ff3a9 100644 --- a/init.el +++ b/init.el @@ -46,16 +46,8 @@ (setq warning-suppress-types '((lexical-binding))) -;; Some features that are not represented as packages can be found in -;; `features', but this can be inconsistent. The following enforce consistency: -(if (fboundp #'json-parse-string) - (push 'jansson features)) -(if (string-match-p "HARFBUZZ" system-configuration-features) ; no alternative - (push 'harfbuzz features)) -(if (bound-and-true-p module-file-suffix) - (push 'dynamic-modules features)) - ;;; Minibuffer + ;; Allow nested minibuffers (setq enable-recursive-minibuffers t) @@ -76,13 +68,21 @@ (advice-add #'yes-or-no-p :override #'y-or-n-p)) (defalias #'view-hello-file #'ignore) ; Never show the hello file -;;; Misc +;;; Show-paren (setq show-paren-delay 0.1 show-paren-highlight-openparen t show-paren-when-point-inside-paren t show-paren-when-point-in-periphery t) +;;; Compilation + +(setq compilation-always-kill t + compilation-ask-about-save nil + compilation-scroll-output 'first-error) + +;;; Misc + (setq whitespace-line-column nil) ; whitespace-mode ;; I reduced the default value of 9 to simplify the font-lock keyword, @@ -95,15 +95,8 @@ (setq-default display-line-numbers-width 3) (setq-default display-line-numbers-widen t) -(setq compilation-always-kill t - compilation-ask-about-save nil - compilation-scroll-output 'first-error) - (setq truncate-string-ellipsis "…") -;; Delete by moving to trash in interactive mode -(setq delete-by-moving-to-trash (not noninteractive)) - ;; Increase how much is read from processes in a single chunk (setq read-process-output-max (* 512 1024)) ; 512kb @@ -122,6 +115,9 @@ ;;; Files +;; Delete by moving to trash in interactive mode +(setq delete-by-moving-to-trash (not noninteractive)) + ;; 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. (setq find-file-suppress-same-file-warnings t) @@ -131,8 +127,6 @@ (setq find-file-visit-truename t vc-follow-symlinks t) -(setq mouse-yank-at-point t) - ;; Prefer vertical splits over horizontal ones (setq split-width-threshold 170 split-height-threshold nil) @@ -179,6 +173,7 @@ (setq vc-make-backup-files nil) ; Do not backup version controlled files ;;; Auto save + ;; 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. @@ -209,6 +204,7 @@ (setq global-auto-revert-non-file-buffers t) ;;; 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. @@ -224,14 +220,16 @@ (add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) ;;; saveplace -;; `save-place-mode` enables Emacs to remember the last location within a file + +;; `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. (setq save-place-file (expand-file-name "saveplace" user-emacs-directory)) (setq save-place-limit 600) ;;; savehist -;; `savehist` is an Emacs feature that preserves the minibuffer history between + +;; `savehist' 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. @@ -251,6 +249,7 @@ (setq resize-mini-windows 'grow-only) ;;; 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. @@ -290,6 +289,8 @@ ;;; Mouse +(setq mouse-yank-at-point nil) + (setq mouse-wheel-scroll-amount '(2 ((shift) . hscroll)) mouse-wheel-scroll-amount-horizontal 2) @@ -299,6 +300,7 @@ (add-hook 'after-init-hook #'context-menu-mode))) ;;; Cursor + ;; 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 @@ -329,6 +331,7 @@ (setq delete-pair-blink-delay 0.03) ;;; Indent and formatting + (setq-default left-fringe-width 8) (setq-default right-fringe-width 8) @@ -384,7 +387,7 @@ ;; Eliminate delay before highlighting search matches (setq lazy-highlight-initial-delay 0) -;;; Mode line +;;; Modeline ;; Setting `display-time-default-load-average' to nil makes Emacs omit the load ;; average information from the mode line. From 1b96179b3ade261f163d0413bfe29ce3867b950d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:28:06 -0500 Subject: [PATCH 11/81] Add eglot settings and optimizations --- README.md | 1 + init.el | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58ac12a..14d1b2f 100644 --- a/README.md +++ b/README.md @@ -852,6 +852,7 @@ Please [send me](https://www.jamescherti.com/contact/) your feedback and I'll ad 10. **Miscellaneous** - Configure recentf, savehist, and auto-save - Configure Ediff to use a single frame and split windows horizontally + - Optimize Eglot ## Author and license diff --git a/init.el b/init.el index 27ff3a9..d40cb28 100644 --- a/init.el +++ b/init.el @@ -23,6 +23,7 @@ (setq ffap-machine-p-known 'reject) ;;; package.el + (when (bound-and-true-p minimal-emacs-package-initialize-and-refresh) ;; Initialize and refresh package contents again if needed (package-initialize) @@ -431,7 +432,25 @@ ;; increasing their usefulness. (setq apropos-do-all t) -;;; Load post-init.el +;;; Eglot + +(setq eglot-sync-connect 1 + eglot-autoshutdown t) + +;; Activate Eglot in cross-referenced non-project files +(setq eglot-extend-to-xref t) + +;; Eglot optimization +(setq jsonrpc-event-hook nil) +(setq eglot-events-buffer-size 0) +(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. +(setq eglot-events-buffer-config '(:size 0 :format full)) + (minimal-emacs-load-user-init "post-init.el") (provide 'init) From ca81f7ed4f4c909a4077a0ba1dbdd7d6ab1d4170 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 11:49:59 -0500 Subject: [PATCH 12/81] Add Flymake settings --- init.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/init.el b/init.el index d40cb28..d9356ed 100644 --- a/init.el +++ b/init.el @@ -455,4 +455,15 @@ (provide 'init) +;;; Flymake + +(setq flymake-fringe-indicator-position 'left-fringe) +(setq flymake-show-diagnostics-at-end-of-line nil) + +;; Suppress the display of Flymake error counters when there are no errors. +(setq flymake-suppress-zero-counters t) + +;; Disable wrapping around when navigating Flymake errors. +(setq flymake-wrap-around nil) + ;;; init.el ends here From c4858483aa4d254022b1be37ae35b7d057b1cbd1 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:10:49 -0500 Subject: [PATCH 13/81] Enhance dired settings --- init.el | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index d9356ed..f9ae883 100644 --- a/init.el +++ b/init.el @@ -408,12 +408,33 @@ ;;; Dired (setq dired-free-space nil + dired-dwim-target t ; Propose a target for intelligent moving or copying. dired-deletion-confirmer 'y-or-n-p dired-filter-verbose nil - dired-clean-confirm-killing-deleted-buffers nil dired-recursive-deletes 'top dired-recursive-copies 'always - dired-create-destination-dirs 'ask) + dired-create-destination-dirs 'ask + ;; Revert the Dired buffer without prompting. + dired-auto-revert-buffer #'dired-buffer-stale-p + image-dired-thumb-size 150) + +;; Disable the prompt about killing the Dired buffer for a deleted directory. +(setq dired-clean-confirm-killing-deleted-buffers nil) + +;; Dired-omit +(setq dired-omit-verbose nil) +(setq dired-omit-files (concat "\\`[.]?#\\|\\`[.][.]?\\'" + "\\|\\(?:\\.js\\)?\\.meta\\'" + "\\|\\.\\(?:elc\\|o\\|pyo\\|swp\\|class\\)\\'" + "\\|^\\.DS_Store\\'" + "\\|^\\.\\(?:svn\\|git\\)\\'" + "\\|^\\.ccls-cache\\'" + "\\|^\\.project\\(?:ile\\)?\\'" + "\\|^flycheck_.*" + "\\|^flymake_.*")) + +;; ls-lisp +(setq ls-lisp-verbosity nil) ;;; Font / Text scale From 65f3334c656b595ecfcaa54c7cabf7baeab14617 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:20:56 -0500 Subject: [PATCH 14/81] Update dired-omit-files --- init.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index f9ae883..8058b52 100644 --- a/init.el +++ b/init.el @@ -422,13 +422,15 @@ (setq dired-clean-confirm-killing-deleted-buffers nil) ;; Dired-omit + (setq dired-omit-verbose nil) (setq dired-omit-files (concat "\\`[.]?#\\|\\`[.][.]?\\'" "\\|\\(?:\\.js\\)?\\.meta\\'" - "\\|\\.\\(?:elc\\|o\\|pyo\\|swp\\|class\\)\\'" + "\\|\\.\\(?:elc|a\\|o\\|pyc\\|pyo\\|swp\\|class\\)\\'" "\\|^\\.DS_Store\\'" "\\|^\\.\\(?:svn\\|git\\)\\'" "\\|^\\.ccls-cache\\'" + "\\|^__pycache__\\'" "\\|^\\.project\\(?:ile\\)?\\'" "\\|^flycheck_.*" "\\|^flymake_.*")) From 4e310ce192ae7d3b22a04da1c8c0a06de23131d5 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:23:43 -0500 Subject: [PATCH 15/81] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 14d1b2f..ef760b0 100644 --- a/README.md +++ b/README.md @@ -683,6 +683,10 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; windows. ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Dividers.html (add-hook 'after-init-hook #'window-divider-mode) + +;; Automatically hide file details (permissions, size, modification date, etc.) +;; in Dired buffers for a cleaner display. +(add-hook 'dired-mode-hook #'dired-hide-details-mode) ``` It is also recommended to read the following articles: From 2a1d40fa964ce50e04d83dc15a143179d07a20ba Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:43:39 -0500 Subject: [PATCH 16/81] Update ls-lisp settings --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index 8058b52..a51338f 100644 --- a/init.el +++ b/init.el @@ -437,6 +437,7 @@ ;; ls-lisp (setq ls-lisp-verbosity nil) +(setq ls-lisp-dirs-first t) ;;; Font / Text scale From b237b8d7b573730e2ce48bf7ca86eb892c99c776 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:31:29 -0500 Subject: [PATCH 17/81] Fixes #11: Prevents help command completion from triggering autoload. --- init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.el b/init.el index a51338f..6b668c1 100644 --- a/init.el +++ b/init.el @@ -456,6 +456,14 @@ ;; increasing their usefulness. (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. +(setq help-enable-completion-autoload nil) +(setq help-enable-autoload nil) +(setq help-enable-symbol-autoload nil) + ;;; Eglot (setq eglot-sync-connect 1 From e9fe1b70e0360760fc20cfe807140c9e2a7513dc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:24:13 -0500 Subject: [PATCH 18/81] Update read-extended-command-predicate --- init.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index 6b668c1..e977fcb 100644 --- a/init.el +++ b/init.el @@ -359,6 +359,9 @@ ;; Enable indentation and completion using the TAB key (setq-default tab-always-indent nil) +;; Perf: Reduce command completion overhead. +(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. @@ -452,8 +455,7 @@ ;;; Help -;; Enhance `apropos' and related functions to perform more extensive searches, -;; increasing their usefulness. +;; Enhance `apropos' and related functions to perform more extensive searches (setq apropos-do-all t) ;; Fixes #11: Prevents help command completion from triggering autoload. From c3091b1df1d2f4a8ecad6984d6d76593c9248279 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:15:05 -0500 Subject: [PATCH 19/81] Add minimal-emacs-user-directory to recentf-exclude --- init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.el b/init.el index e977fcb..ab5e641 100644 --- a/init.el +++ b/init.el @@ -220,6 +220,16 @@ (recentf-cleanup))) (add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) +;; Update recentf-exclude +(setq recentf-exclude nil) +(dolist (item (list "^/\\(?:ssh\\|su\\|sudo\\)?:" + (concat "^" + (regexp-quote + (abbreviate-file-name + minimal-emacs-user-directory))))) + (when item + (push item recentf-exclude))) + ;;; saveplace ;; `save-place-mode' enables Emacs to remember the last location within a file From 949f771c148648c0c97011a4b360a813e66185e9 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:51:57 -0500 Subject: [PATCH 20/81] Update recentf-exclude --- init.el | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/init.el b/init.el index ab5e641..d27563d 100644 --- a/init.el +++ b/init.el @@ -221,14 +221,7 @@ (add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) ;; Update recentf-exclude -(setq recentf-exclude nil) -(dolist (item (list "^/\\(?:ssh\\|su\\|sudo\\)?:" - (concat "^" - (regexp-quote - (abbreviate-file-name - minimal-emacs-user-directory))))) - (when item - (push item recentf-exclude))) +(setq recentf-exclude (list "^/\\(?:ssh\\|su\\|sudo\\)?:")) ;;; saveplace From d9af329f6a9363936ac881a83fcef8cf458520ca Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 4 Feb 2025 12:23:42 -0500 Subject: [PATCH 21/81] Release: 1.1.2 --- 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 a6825cb..a186989 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.1 +;; Version: 1.1.2 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: diff --git a/init.el b/init.el index d27563d..c3e3fe1 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.1 +;; Version: 1.1.2 ;; SPDX-License-Identifier: GPL-3.0-or-later ;;; Commentary: From b4c2d7cc18b8b6b3773520546d7811a432ff5911 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:05:45 -0500 Subject: [PATCH 22/81] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index ef760b0..2c21683 100644 --- a/README.md +++ b/README.md @@ -809,8 +809,7 @@ A drawback of using the early-init phase instead of init is that if a package fa - [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. - [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic. - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. - -Please [send me](https://www.jamescherti.com/contact/) your feedback and I'll add it to this README.md file. +- [rrajath](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second. ## Features From 3c7338e0049e28888093ddc9144beb3ba1707b9a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:07:10 -0500 Subject: [PATCH 23/81] Update README.md --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 2c21683..c9bf74c 100644 --- a/README.md +++ b/README.md @@ -488,15 +488,7 @@ To configure `eglot`, add the following to `~/.emacs.d/post-init.el`: eglot-rename eglot-ensure eglot-rename - eglot-format-buffer) - - :custom - (eglot-report-progress nil) ; Prevent minibuffer spam - - :config - ;; Optimizations - (fset #'jsonrpc--log-event #'ignore) - (setq jsonrpc-event-hook nil)) + eglot-format-buffer)) ``` Here is an example of how to configure Eglot to enable or disable certain options for the `pylsp` server in Python development. (Note that a third-party tool, [python-lsp-server](https://github.com/python-lsp/python-lsp-server), must be installed): From 1e2a035c28d5e37894d24a258d07c8a7cd27b456 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:12:30 -0500 Subject: [PATCH 24/81] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c9bf74c..2b63466 100644 --- a/README.md +++ b/README.md @@ -802,6 +802,7 @@ A drawback of using the early-init phase instead of init is that if a package fa - [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic. - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. - [rrajath](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second. +- [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. ## Features From 3936c6987bc4095f142f6c8d0f64f2738a428b00 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:16:09 -0500 Subject: [PATCH 25/81] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2b63466..a048743 100644 --- a/README.md +++ b/README.md @@ -798,6 +798,7 @@ A drawback of using the early-init phase instead of init is that if a package fa ### Are there any 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. - [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic. - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. From ab6ead510ec78b782255b20ebcfa15f898feae23 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:27:34 -0500 Subject: [PATCH 26/81] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a048743..7a33330 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,17 @@ 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. +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., +- You have full control over selecting the major and minor modes you need (i.e., **minimal-emacs.d** doesn’t enable any modes by default, allowing users to choose which modes to enable), +- This README.md, which offers extensive recommendations for customizing your Emacs 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. -By default, only essential features are enabled, 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)) +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)) 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 and his Emacs configuration starts in 0.22 seconds: ![](https://www.jamescherti.com/wp-content/uploads/minimal-emacs-startup-time.png) From 0b88b1d9b910c67f499e89a700bf5975d6e588dd Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:34:55 -0500 Subject: [PATCH 27/81] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a33330..64d9028 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Creating *minimal-emacs.d* `init.el` and `early-init.el` involved extensive rese 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)) -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 and his Emacs configuration starts in 0.22 seconds: +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: ![](https://www.jamescherti.com/wp-content/uploads/minimal-emacs-startup-time.png) (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) From b0a20a371f06790e2b7e29a44885de18ece3fa17 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:39:52 -0500 Subject: [PATCH 28/81] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64d9028..8a5a6fd 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The **minimal-emacs.d** project is a customizable Emacs base that provides **bet 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., -- You have full control over selecting the major and minor modes you need (i.e., **minimal-emacs.d** doesn’t enable any modes by default, allowing users to choose which modes to enable), +- Provides the user with complete control over selecting major and minor modes (*minimal-emacs.d* does not enable any modes by default, allowing users to choose which modes to activate). - This README.md, which offers extensive recommendations for customizing your Emacs configuration. *(More information about the features can be found here: [Features](#features))* From aee66c4cff54ae6ff0c9030841c6bd897fc1f3da Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:42:45 -0500 Subject: [PATCH 29/81] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a5a6fd..64675ac 100644 --- a/README.md +++ b/README.md @@ -152,9 +152,9 @@ To install compile-angel, add the following code **at the very beginning of your 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. -One common solution to this issue is the installation of the no-littering package, which reduces clutter in the `~/.emacs.d` directory. +A common solution to this issue is installing the no-littering package; however, this package is not essential. -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`: +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/ (setq minimal-emacs-var-dir (expand-file-name "var/" minimal-emacs-user-directory)) From 23aa176cacf5d8f087c8eb128b69d233b80d2290 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:43:52 -0500 Subject: [PATCH 30/81] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 64675ac..3fcda86 100644 --- a/README.md +++ b/README.md @@ -224,8 +224,6 @@ Vertico, Consult, and Embark collectively enhance Emacs' completion and navigati Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and Embark: ``` emacs-lisp -;; Tip: You can remove the `vertico-mode' use-package and replace it -;; with the built-in `fido-vertical-mode'. (use-package vertico ;; (Note: It is recommended to also enable the savehist package.) :ensure t From e1cfc06b8d509a70b394df95d7c0490716311370 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:47:01 -0500 Subject: [PATCH 31/81] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3fcda86..93ea23d 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ The author is using **[minimal-emacs.d](https://github.com/jamescherti/minimal-e - [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 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 the reflexive disabling of the menu bar?](#why-the-reflexive-disabling-of-the-menu-bar) + - [Why is the menu bar disabled by default?](#why-is-the-menu-bar-disabled-by-default) - [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) @@ -746,7 +746,7 @@ During the execution of `early-init.el` (and `pre-early-init.el` and `post-earl Thus, `post-early-init.el` and `pre-init.el` serve different purposes and are not the same. -### Why the reflexive disabling of the menu bar? +### Why is the menu bar disabled by default? The menu bar is disabled by default in *minimal-emacs.d* to provide a minimal, distraction-free environment, which many experienced users prefer. From ce7818fcd31d6120ca68c6a7332a896ed1d8495b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:48:23 -0500 Subject: [PATCH 32/81] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 93ea23d..89ca0d4 100644 --- a/README.md +++ b/README.md @@ -804,7 +804,7 @@ A drawback of using the early-init phase instead of init is that if a package fa ### Are there any 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. +- [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. - [Another user commented on Reddit](https://www.reddit.com/r/emacs/comments/1feaf37/comment/lrsfd64/), highlighting how a minimal-emacs.d significantly enhanced their Emacs performance. They reported substantial startup time reductions on both their main machine (from ~2.25 to ~0.95 seconds) and an older laptop (from ~2.95 to ~1.27 seconds) while also experiencing a generally snappier performance within Emacs. The user expressed gratitude for the project, calling it fantastic. - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. From 7fe9ccb3b87f9ebd880b96df2d5b985e87afabb0 Mon Sep 17 00:00:00 2001 From: Jinyang Li Date: Fri, 7 Feb 2025 05:01:09 -0600 Subject: [PATCH 33/81] Remove duplicated command (#26) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 89ca0d4..05cb510 100644 --- a/README.md +++ b/README.md @@ -491,7 +491,6 @@ To configure `eglot`, add the following to `~/.emacs.d/post-init.el`: :ensure nil :defer t :commands (eglot - eglot-rename eglot-ensure eglot-rename eglot-format-buffer)) From 99e802bc84643063895e7263424e2300bc2daffe Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 7 Feb 2025 06:25:21 -0500 Subject: [PATCH 34/81] Remove eglot-autoshutdown --- init.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/init.el b/init.el index c3e3fe1..6adf438 100644 --- a/init.el +++ b/init.el @@ -471,8 +471,7 @@ ;;; Eglot -(setq eglot-sync-connect 1 - eglot-autoshutdown t) +(setq eglot-sync-connect 1) ;; Activate Eglot in cross-referenced non-project files (setq eglot-extend-to-xref t) From 2128d0733e6b856bfb4f3816ddd4bc455f261dc7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 7 Feb 2025 06:35:26 -0500 Subject: [PATCH 35/81] Revert "Remove eglot-autoshutdown" This reverts commit 99e802bc84643063895e7263424e2300bc2daffe. --- init.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.el b/init.el index 6adf438..c3e3fe1 100644 --- a/init.el +++ b/init.el @@ -471,7 +471,8 @@ ;;; Eglot -(setq eglot-sync-connect 1) +(setq eglot-sync-connect 1 + eglot-autoshutdown t) ;; Activate Eglot in cross-referenced non-project files (setq eglot-extend-to-xref t) From b5b1382787e9513d4f18d87e601e4df24a46c869 Mon Sep 17 00:00:00 2001 From: Jinyang Li Date: Fri, 7 Feb 2025 21:25:05 -0600 Subject: [PATCH 36/81] Remove duplicated `pixel-scroll-precision-mode` line. (#27) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 05cb510..205ce20 100644 --- a/README.md +++ b/README.md @@ -662,7 +662,6 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (show-paren-mode +1) ; Paren match highlighting (winner-mode 1) (delete-selection-mode 1) ; Replace selected text with typed text -(pixel-scroll-precision-mode 1) ;; Configure Emacs to ask for confirmation before exiting (setq confirm-kill-emacs 'y-or-n-p) From 17cf5375d09c917c75d5624fae01de4376fb7533 Mon Sep 17 00:00:00 2001 From: Jinyang Li Date: Sat, 8 Feb 2025 06:27:01 -0600 Subject: [PATCH 37/81] Document the pixel scroll option for `emacs-mac` build (#28) --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 205ce20..7353767 100644 --- a/README.md +++ b/README.md @@ -655,8 +655,18 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read :config (which-key-mode)) +;; Disable momentum-based scrolling for precise control and enable smoother scrolling. (setq pixel-scroll-precision-use-momentum nil) (pixel-scroll-precision-mode 1) +;; Note: If you're using the pre-built `emacs-mac` (version <= 29.1), pixel-based smooth scrolling +;; is handled by the Mac port code instead of `pixel-scroll-precision-mode`. In this case, use the +;; following line instead of the two lines above: +;; +;; (pixel-scroll-mode 1) +;; +;; For more details, see: +;; https://bitbucket.org/mituharu/emacs-mac/commits/65c6c96f27afa446df6f9d8eff63f9cc012cc738 + (display-time-mode) (show-paren-mode +1) ; Paren match highlighting From 94acbb622c0cb3a4f8688bc63a0429e71d3d2575 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 8 Feb 2025 07:52:10 -0500 Subject: [PATCH 38/81] add hl-line defaults --- init.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init.el b/init.el index c3e3fe1..94ba5b4 100644 --- a/init.el +++ b/init.el @@ -503,4 +503,11 @@ ;; Disable wrapping around when navigating Flymake errors. (setq flymake-wrap-around nil) +;;; hl-line-mode + +;; Restrict `hl-line-mode' highlighting to the current window, reducing visual +;; clutter and slightly improving `hl-line-mode' performance. +(setq hl-line-sticky-flag nil) +(setq global-hl-line-sticky-flag nil) + ;;; init.el ends here From 469e6533e00a2d357eebc47595074c9b56c4569e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sat, 8 Feb 2025 08:37:13 -0500 Subject: [PATCH 39/81] Add dired-vc-rename-file --- init.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.el b/init.el index 94ba5b4..0f556fb 100644 --- a/init.el +++ b/init.el @@ -424,6 +424,8 @@ dired-auto-revert-buffer #'dired-buffer-stale-p image-dired-thumb-size 150) +(setq dired-vc-rename-file t) + ;; Disable the prompt about killing the Dired buffer for a deleted directory. (setq dired-clean-confirm-killing-deleted-buffers nil) From a432bbba5271f50068cf3fd9d5f03b0f89d4c86e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 9 Feb 2025 08:11:40 -0500 Subject: [PATCH 40/81] Add window-divider-mode --- init.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/init.el b/init.el index 0f556fb..f2ce05c 100644 --- a/init.el +++ b/init.el @@ -132,17 +132,8 @@ (setq split-width-threshold 170 split-height-threshold nil) -;; The native border "uses" a pixel of the fringe on the rightmost -;; splits, whereas `window-divider` does not. -(setq window-divider-default-bottom-width 1 - window-divider-default-places t - window-divider-default-right-width 1) - ;;; Buffers -;; switch-to-buffer runs pop-to-buffer-same-window instead -(setq switch-to-buffer-obey-display-actions t) - (setq uniquify-buffer-name-style 'forward) (setq comint-prompt-read-only t) @@ -212,6 +203,7 @@ (setq recentf-max-saved-items 300) ; default is 20 (setq recentf-max-menu-items 15) (setq recentf-auto-cleanup (if (daemonp) 300 'never)) + (defun minimal-emacs--cleanup-hook () "Run `recentf-cleanup' if `recentf' is loaded and `recentf-mode' is enabled." (when (and (featurep 'recentf) @@ -233,10 +225,10 @@ ;;; savehist -;; `savehist' 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. +;; `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. (setq history-length 300) (setq savehist-save-minibuffer-history t) ;; Default @@ -252,6 +244,14 @@ (setq resize-mini-windows 'grow-only) +;; The native border "uses" a pixel of the fringe on the rightmost +;; splits, whereas `window-divider-mode' does not. +(setq window-divider-default-bottom-width 1 + window-divider-default-places t + window-divider-default-right-width 1) + +(add-hook 'after-init-hook #'window-divider-mode) + ;;; Scrolling ;; Enables faster scrolling through unfontified regions. This may result in @@ -418,7 +418,7 @@ dired-deletion-confirmer 'y-or-n-p dired-filter-verbose nil dired-recursive-deletes 'top - dired-recursive-copies 'always + dired-recursive-copies 'always dired-create-destination-dirs 'ask ;; Revert the Dired buffer without prompting. dired-auto-revert-buffer #'dired-buffer-stale-p From c3710eb80a8afdc3205ca5209bf82341a9401f4d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Sun, 9 Feb 2025 08:33:21 -0500 Subject: [PATCH 41/81] Add icomplete-compute-delay --- README.md | 2 +- init.el | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7353767..2fef8f5 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The **minimal-emacs.d** project is a customizable Emacs base that provides **bet 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 any modes by default, allowing users to choose which modes to activate). +- 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. *(More information about the features can be found here: [Features](#features))* diff --git a/init.el b/init.el index f2ce05c..3088fda 100644 --- a/init.el +++ b/init.el @@ -54,8 +54,7 @@ ;; Keep the cursor out of the read-only portions of the.minibuffer (setq minibuffer-prompt-properties - '(read-only t intangible t cursor-intangible t face - minibuffer-prompt)) + '(read-only t intangible t cursor-intangible t face minibuffer-prompt)) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) ;;; User interface @@ -512,4 +511,10 @@ (setq hl-line-sticky-flag nil) (setq global-hl-line-sticky-flag nil) +;;; icomplete + +;; Do not delay displaying completion candidates in `fido-mode' or +;; `fido-vertical-mode' +(setq icomplete-compute-delay 0.01) + ;;; init.el ends here From a7532e65f167bfdbea8e6ce857fdeaeab95085e5 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 09:32:26 -0500 Subject: [PATCH 42/81] Update README.md --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index 2fef8f5..897ba6a 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,12 @@ The author is using **[minimal-emacs.d](https://github.com/jamescherti/minimal-e - [Optimization: Native Compilation](#optimization-native-compilation) - [How to configure vterm](#how-to-configure-vterm) - [How to configure Vertico, Consult, and Embark](#how-to-configure-vertico-consult-and-embark) + - [Code Folding](#code-folding) - [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) - [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) @@ -364,6 +367,20 @@ Add the following to `~/.emacs.d/post-init.el` to set up Vertico, Consult, and E (setq consult-narrow-key "<")) ``` +### Code Folding + +The **outline-indent** Emacs package provides a minor mode that enables code folding based on indentation levels: +```elisp +(use-package outline-indent + :ensure t + :custom + (outline-indent-ellipsis " ▼ ")) +``` + +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. + +![](https://raw.githubusercontent.com/jamescherti/outline-indent.el/main/.screenshot2.png) + ### 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: @@ -520,6 +537,28 @@ Here is an example of how to configure Eglot to enable or disable certain option (add-hook 'python-ts-mode-hook #'eglot) ``` +### 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. + +To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: +``` emacs-lisp +(use-package easysession + :ensure t + :custom + :init + ;; Interval between automatic session saves + (setq easysession-save-interval (* 10 60)) + (add-hook 'emacs-startup-hook #'easysession-load-including-geometry 102) + (add-hook 'emacs-startup-hook #'easysession-save-mode 103)) + +;; Key mappings: +;; C-c l for switching sessions +;; and C-c s for saving the current session +(global-set-key (kbd "C-c l") 'easysession-switch-to) +(global-set-key (kbd "C-c s") 'easysession-save-as) +``` + ### 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. @@ -561,6 +600,22 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: (add-hook 'completion-at-point-functions #'cape-elisp-block)) ``` +### Inhibit the mouse + +The **inhibit-mouse** package disables mouse input in Emacs. + +This package is useful for users who do not need the mouse: +- To prevent accidental clicks or cursor movements that may unexpectedly change the cursor position. +- To reinforce a keyboard-centric workflow by discouraging reliance on the mouse for navigation. + +To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: +```emacs-lisp +(use-package inhibit-mouse + :ensure t + :config + (inhibit-mouse-mode)) +``` + ### 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 5446110cfe4aa665e967d699684b4870b04854f6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:12:15 -0500 Subject: [PATCH 43/81] Update README.md --- README.md | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 897ba6a..217545a 100644 --- a/README.md +++ b/README.md @@ -373,6 +373,18 @@ The **outline-indent** Emacs package provides a minor mode that enables code fol ```elisp (use-package outline-indent :ensure t + :defer t + :commands outline-indent-minor-mode + + :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 " ▼ ")) ``` @@ -545,18 +557,25 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: ``` emacs-lisp (use-package easysession :ensure t + :defer t + :commands (easysession-switch-to + easysession-save-as + easysession-save-mode + easysession-load-including-geometry) + :custom + (easysession-mode-line-misc-info t) ; Display the session in the modeline + (easysession-save-interval (* 10 60)) ; Save every 10 minutes + :init - ;; Interval between automatic session saves - (setq easysession-save-interval (* 10 60)) + ;; Key mappings: + ;; C-c l for switching sessions + ;; and C-c s for saving the current session + (global-set-key (kbd "C-c l") 'easysession-switch-to) + (global-set-key (kbd "C-c s") 'easysession-save-as) + (add-hook 'emacs-startup-hook #'easysession-load-including-geometry 102) (add-hook 'emacs-startup-hook #'easysession-save-mode 103)) - -;; Key mappings: -;; C-c l for switching sessions -;; and C-c s for saving the current session -(global-set-key (kbd "C-c l") 'easysession-switch-to) -(global-set-key (kbd "C-c s") 'easysession-save-as) ``` ### Code completion with corfu From 7c44f621bfa7e275af3853e38471f5c5faed2d12 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:15:43 -0500 Subject: [PATCH 44/81] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 217545a..e9c45f6 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,10 @@ To configure **easysession**, add the following to `~/.emacs.d/post-init.el`: (global-set-key (kbd "C-c l") 'easysession-switch-to) (global-set-key (kbd "C-c s") 'easysession-save-as) + ;; The depth 102 and 103 have been added to to `add-hook' to ensure that the + ;; session is loaded after all other packages. (Using 103/102 is particularly + ;; useful for those using minimal-emacs.d, where some optimizations restore + ;; `file-name-handler-alist` at depth 101 during `emacs-startup-hook`.) (add-hook 'emacs-startup-hook #'easysession-load-including-geometry 102) (add-hook 'emacs-startup-hook #'easysession-save-mode 103)) ``` From f5f776ff63f9fd2e84249785b6ae678edb429a30 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:17:58 -0500 Subject: [PATCH 45/81] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e9c45f6..c0580d8 100644 --- a/README.md +++ b/README.md @@ -627,9 +627,9 @@ To configure `corfu` and `cape`, add the following to `~/.emacs.d/post-init.el`: The **inhibit-mouse** package disables mouse input in Emacs. -This package is useful for users who do not need the mouse: -- To prevent accidental clicks or cursor movements that may unexpectedly change the cursor position. -- To reinforce a keyboard-centric workflow by discouraging reliance on the mouse for navigation. +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. +- Reinforce a keyboard-centric workflow by discouraging reliance on the mouse for navigation. To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: ```emacs-lisp @@ -639,6 +639,8 @@ To configure **inhibit-mouse**, add the following to `~/.emacs.d/post-init.el`: (inhibit-mouse-mode)) ``` +NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functionality, giving them the flexibility to use the mouse when needed. + ### 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 3256195046db445b41e8e1964e516e106006e603 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:19:02 -0500 Subject: [PATCH 46/81] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c0580d8..e1034c7 100644 --- a/README.md +++ b/README.md @@ -645,7 +645,7 @@ NOTE: `inhibit-mouse-mode` allows users to disable and re-enable mouse functiona [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 +;; Straight bootstrap (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name @@ -677,12 +677,12 @@ Add to `~/.emacs.d/pre-early-init.el`: 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.8) +(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 + :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)) From ea22041fa7a8d157528386f48279cfb2ba3bb9a9 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:20:50 -0500 Subject: [PATCH 47/81] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e1034c7..08f8316 100644 --- a/README.md +++ b/README.md @@ -731,9 +731,15 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (setq warning-minimum-level :error) (use-package which-key - :ensure t - :config - (which-key-mode)) + :ensure nil ; builtin + :defer t + :commands which-key-mode + :hook (after-init . which-key-mode) + :custom + (which-key-idle-delay 1.5) + (which-key-idle-secondary-delay 0.25) + (which-key-add-column-padding 1) + (which-key-max-description-length 40)) ;; Disable momentum-based scrolling for precise control and enable smoother scrolling. (setq pixel-scroll-precision-use-momentum nil) From fdc6338954419663c765c71b7cd1b8a76858efd5 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:27:56 -0500 Subject: [PATCH 48/81] Update README.md and remove window-divider-mode --- README.md | 2 +- init.el | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 08f8316..6db091c 100644 --- a/README.md +++ b/README.md @@ -744,6 +744,7 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; Disable momentum-based scrolling for precise control and enable smoother scrolling. (setq pixel-scroll-precision-use-momentum nil) (pixel-scroll-precision-mode 1) + ;; Note: If you're using the pre-built `emacs-mac` (version <= 29.1), pixel-based smooth scrolling ;; is handled by the Mac port code instead of `pixel-scroll-precision-mode`. In this case, use the ;; following line instead of the two lines above: @@ -753,7 +754,6 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; For more details, see: ;; https://bitbucket.org/mituharu/emacs-mac/commits/65c6c96f27afa446df6f9d8eff63f9cc012cc738 - (display-time-mode) (show-paren-mode +1) ; Paren match highlighting (winner-mode 1) diff --git a/init.el b/init.el index 3088fda..5b67f4a 100644 --- a/init.el +++ b/init.el @@ -249,8 +249,6 @@ window-divider-default-places t window-divider-default-right-width 1) -(add-hook 'after-init-hook #'window-divider-mode) - ;;; Scrolling ;; Enables faster scrolling through unfontified regions. This may result in From 493734028776dd65552fd72b7f0547e9f23e1e0c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:41:45 -0500 Subject: [PATCH 49/81] Update README.md --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6db091c..382da4b 100644 --- a/README.md +++ b/README.md @@ -745,19 +745,28 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (setq pixel-scroll-precision-use-momentum nil) (pixel-scroll-precision-mode 1) -;; Note: If you're using the pre-built `emacs-mac` (version <= 29.1), pixel-based smooth scrolling -;; is handled by the Mac port code instead of `pixel-scroll-precision-mode`. In this case, use the -;; following line instead of the two lines above: +;; Pixel Scroll Precision Mode on Emacs for macOS: If you're using a pre-built +;; emacs-mac (version <= 29.1), smooth scrolling is handled by the Mac port +;; code, which overrides `pixel-scroll-precision-mode'. In this case, use the +;; following line instead of enabling `pixel-scroll-precision-mode': ;; ;; (pixel-scroll-mode 1) ;; ;; For more details, see: ;; https://bitbucket.org/mituharu/emacs-mac/commits/65c6c96f27afa446df6f9d8eff63f9cc012cc738 -(display-time-mode) -(show-paren-mode +1) ; Paren match highlighting +;; Display the time in the modeline +(display-time-mode 1) + +;; Paren match highlighting +(show-paren-mode 1) + +;; Track changes in the window configuration, allowing undoing actions such as +;; closing windows. (winner-mode 1) -(delete-selection-mode 1) ; Replace selected text with typed text + +;; 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) From 994a73cb4c9f07f12edb7a71b4122c284602a3b4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:52:42 -0500 Subject: [PATCH 50/81] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 382da4b..838125b 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,10 @@ To install compile-angel, add the following code **at the very beginning of your :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) + (compile-angel-on-load-mode) (add-hook 'emacs-lisp-mode-hook #'compile-angel-on-save-local-mode)) ``` From a630262c8342fad1b1c307be715b819ed1a62e0e Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:02:07 -0500 Subject: [PATCH 51/81] Add: ibuffer-formats --- init.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.el b/init.el index 5b67f4a..0d35fdf 100644 --- a/init.el +++ b/init.el @@ -515,4 +515,13 @@ ;; `fido-vertical-mode' (setq icomplete-compute-delay 0.01) +;;; ibuffer + +(setq ibuffer-formats + '((mark modified read-only locked + " " (name 40 40 :left :elide) + " " (size 8 -1 :right) + " " (mode 18 18 :left :elide) " " filename-and-process) + (mark " " (name 16 -1) " " filename))) + ;;; init.el ends here From 044d0cffa64c434f77eb91476a27adddb665e345 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:37:32 -0500 Subject: [PATCH 52/81] Update xref defaults --- init.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/init.el b/init.el index 0d35fdf..6382dde 100644 --- a/init.el +++ b/init.el @@ -524,4 +524,10 @@ " " (mode 18 18 :left :elide) " " filename-and-process) (mark " " (name 16 -1) " " filename))) +;;; 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) + ;;; init.el ends here From ea9e0bbc5df81b014a9abdb6660fab3828e455fc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:42:25 -0500 Subject: [PATCH 53/81] Disable truncation of printed s-expressions in the message buffer --- init.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/init.el b/init.el index 6382dde..04db3ff 100644 --- a/init.el +++ b/init.el @@ -113,6 +113,10 @@ ;; correctly located based on the updated `user-emacs-directory`. (setq abbrev-file-name (expand-file-name "abbrev_defs" user-emacs-directory)) +;; Disable truncation of printed s-expressions in the message buffer +(setq eval-expression-print-length nil + eval-expression-print-level nil) + ;;; Files ;; Delete by moving to trash in interactive mode From a782878aca0aff81b007964ae3e4fab27c558867 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 14:52:28 -0500 Subject: [PATCH 54/81] Update defaults: abbrev --- init.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 04db3ff..8dd77d7 100644 --- a/init.el +++ b/init.el @@ -108,14 +108,9 @@ ;; multiple sources provide it. It concatenates the results. (setq eldoc-documentation-strategy 'eldoc-documentation-compose-eagerly) -;; For some reason, `abbrev_defs` is located in ~/.emacs.d/abbrev_defs, even -;; when `user-emacs-directory` is modified. This ensures the abbrev file is -;; correctly located based on the updated `user-emacs-directory`. -(setq abbrev-file-name (expand-file-name "abbrev_defs" user-emacs-directory)) - ;; Disable truncation of printed s-expressions in the message buffer (setq eval-expression-print-length nil - eval-expression-print-level nil) + eval-expression-print-level nil) ;;; Files @@ -534,4 +529,13 @@ (setq xref-show-definitions-function #'xref-show-definitions-completing-read xref-show-xrefs-function #'xref-show-definitions-completing-read) +;;; abbrev + +;; Ensure `abbrev_defs` is stored in the correct location when +;; `user-emacs-directory` is modified, as it defaults to ~/.emacs.d/abbrev_defs +;; regardless of the change. +(setq abbrev-file-name (expand-file-name "abbrev_defs" user-emacs-directory)) + +(setq save-abbrevs 'silently) + ;;; init.el ends here From 7eabe7fc3832b64efc8143517a9d5af80925a8d4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:00:59 -0500 Subject: [PATCH 55/81] Add: x-underline-at-descent-line --- init.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init.el b/init.el index 8dd77d7..2ddaa16 100644 --- a/init.el +++ b/init.el @@ -112,6 +112,9 @@ (setq eval-expression-print-length nil eval-expression-print-level nil) +;; Position underlines at the descent line instead of the baseline. +(setq x-underline-at-descent-line t) + ;;; Files ;; Delete by moving to trash in interactive mode From b33a1fef32da27fa421c0f88d506d62dadc2c5ef Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:15:59 -0500 Subject: [PATCH 56/81] Update help defaults and README --- README.md | 3 +++ init.el | 1 + 2 files changed, 4 insertions(+) diff --git a/README.md b/README.md index 838125b..33d037f 100644 --- a/README.md +++ b/README.md @@ -734,6 +734,9 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; Hide warnings and display only errors (setq warning-minimum-level :error) +;; Display of line numbers in the buffer: +;; (display-line-numbers-mode 1) + (use-package which-key :ensure nil ; builtin :defer t diff --git a/init.el b/init.el index 2ddaa16..a1cf230 100644 --- a/init.el +++ b/init.el @@ -469,6 +469,7 @@ (setq help-enable-completion-autoload nil) (setq help-enable-autoload nil) (setq help-enable-symbol-autoload nil) +(setq help-window-select t) ;;; Eglot From d351dac8432d8255ac4e704a2e7c7061b809cbb6 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:03:32 -0500 Subject: [PATCH 57/81] Update README.md --- README.md | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 33d037f..80822ee 100644 --- a/README.md +++ b/README.md @@ -748,19 +748,13 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (which-key-add-column-padding 1) (which-key-max-description-length 40)) -;; Disable momentum-based scrolling for precise control and enable smoother scrolling. -(setq pixel-scroll-precision-use-momentum nil) -(pixel-scroll-precision-mode 1) - -;; Pixel Scroll Precision Mode on Emacs for macOS: If you're using a pre-built -;; emacs-mac (version <= 29.1), smooth scrolling is handled by the Mac port -;; code, which overrides `pixel-scroll-precision-mode'. In this case, use the -;; following line instead of enabling `pixel-scroll-precision-mode': -;; -;; (pixel-scroll-mode 1) -;; -;; For more details, see: -;; https://bitbucket.org/mituharu/emacs-mac/commits/65c6c96f27afa446df6f9d8eff63f9cc012cc738 +(unless (and (eq window-system 'mac) + (bound-and-true-p mac-carbon-version-string)) + ;; Enabling `pixel-scroll-precision-mode' is unnecessary with emacs-mac, as + ;; this version of Emacs natively supports smooth scrolling. + ;; https://bitbucket.org/mituharu/emacs-mac/commits/65c6c96f27afa446df6f9d8eff63f9cc012cc738 + (setq pixel-scroll-precision-use-momentum nil) ; Precise/smoother scrolling + (pixel-scroll-precision-mode 1)) ;; Display the time in the modeline (display-time-mode 1) From 8cd2b2cb838d38e3559b6aeefc507c5bcc6543fa Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:51:02 -0500 Subject: [PATCH 58/81] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 80822ee..db145fe 100644 --- a/README.md +++ b/README.md @@ -750,6 +750,9 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (unless (and (eq window-system 'mac) (bound-and-true-p mac-carbon-version-string)) + ;; Enables `pixel-scroll-precision-mode' on all operating systems and Emacs + ;; versions, except for emacs-mac. + ;; ;; Enabling `pixel-scroll-precision-mode' is unnecessary with emacs-mac, as ;; this version of Emacs natively supports smooth scrolling. ;; https://bitbucket.org/mituharu/emacs-mac/commits/65c6c96f27afa446df6f9d8eff63f9cc012cc738 From f39578acf3aa1542a8fd2672228d70a846f2199b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 14 Feb 2025 07:35:14 -0500 Subject: [PATCH 59/81] Add read-answer-short --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index a1cf230..56e378c 100644 --- a/init.el +++ b/init.el @@ -63,6 +63,7 @@ (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)) From 24525e4c13527b20aacf600ee0609cd9c8e536aa Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 14 Feb 2025 07:56:00 -0500 Subject: [PATCH 60/81] Add dabbrev-ignored-buffer-modes and text-mode-ispell-word-completion --- init.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.el b/init.el index 56e378c..a03a019 100644 --- a/init.el +++ b/init.el @@ -519,6 +519,10 @@ ;; `fido-vertical-mode' (setq icomplete-compute-delay 0.01) +;; In Emacs 30 and newer, disable Ispell completion to avoid annotation errors +;; when no `ispell' dictionary is set. +(setq text-mode-ispell-word-completion nil) + ;;; ibuffer (setq ibuffer-formats @@ -543,4 +547,9 @@ (setq save-abbrevs 'silently) +;;; dabbrev + +(setq dabbrev-ignored-buffer-modes + '(archive-mode image-mode docview-mode tags-table-mode pdf-view-mode)) + ;;; init.el ends here From 414e1cef31b1981926c132d4f4ce317c92f1d2ac Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 14 Feb 2025 08:05:47 -0500 Subject: [PATCH 61/81] Add dabbrev-upcase-means-case-search --- init.el | 1 + 1 file changed, 1 insertion(+) diff --git a/init.el b/init.el index a03a019..e60965a 100644 --- a/init.el +++ b/init.el @@ -549,6 +549,7 @@ ;;; dabbrev +(setq dabbrev-upcase-means-case-search t) (setq dabbrev-ignored-buffer-modes '(archive-mode image-mode docview-mode tags-table-mode pdf-view-mode)) From f547f3c65d3683d9786eeaddf675011b265edf26 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:07:30 -0500 Subject: [PATCH 62/81] Update init.el --- init.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index e60965a..b893b82 100644 --- a/init.el +++ b/init.el @@ -491,10 +491,6 @@ ;; leading to a gradual performance decline. (setq eglot-events-buffer-config '(:size 0 :format full)) -(minimal-emacs-load-user-init "post-init.el") - -(provide 'init) - ;;; Flymake (setq flymake-fringe-indicator-position 'left-fringe) @@ -553,4 +549,8 @@ (setq dabbrev-ignored-buffer-modes '(archive-mode image-mode docview-mode tags-table-mode pdf-view-mode)) +;;; Load post init +(minimal-emacs-load-user-init "post-init.el") + +(provide 'init) ;;; init.el ends here From 01c7d132120ceff00b1513b5b510337ca0650bba Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:22:52 -0500 Subject: [PATCH 63/81] Increase read-process-output-max --- init.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.el b/init.el index b893b82..d5762fd 100644 --- a/init.el +++ b/init.el @@ -99,7 +99,7 @@ (setq truncate-string-ellipsis "…") ;; Increase how much is read from processes in a single chunk -(setq read-process-output-max (* 512 1024)) ; 512kb +(setq read-process-output-max (* 1024 1024)) ; 1024kb ;; Improve Emacs' responsiveness by delaying syntax highlighting during input ;; but may reduce visual feedback. From 66a56c7b4e90dc6cdfc08e5d22a87e62bfba98f8 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 09:26:45 -0500 Subject: [PATCH 64/81] Enhance use-package defaults and performance --- early-init.el | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/early-init.el b/early-init.el index a186989..7948aab 100644 --- a/early-init.el +++ b/early-init.el @@ -48,6 +48,9 @@ When set to non-nil, Emacs will automatically call `package-initialize' and ;;; Load pre-early-init.el +;; 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 @@ -81,9 +84,6 @@ When set to non-nil, Emacs will automatically call `package-initialize' and ;;; Performance -;; Prefer loading newer compiled files -(setq load-prefer-newer t) - ;; 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) @@ -273,9 +273,17 @@ When set to non-nil, Emacs will automatically call `package-initialize' and (setq use-dialog-box nil)) ;;; package.el -(setq package-enable-at-startup nil) -(setq package-quickstart nil) +(setq use-package-compute-statistics minimal-emacs-debug) + +;; 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-minimum-reported-time (if minimal-emacs-debug 0 0.1)) +(setq use-package-verbose minimal-emacs-debug) +(setq package-enable-at-startup nil) ; Let the init.el file handle this (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/") From 69f886e65e0e8d61bce55dec8f9689a38ea85f0d Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 10:07:20 -0500 Subject: [PATCH 65/81] Enable startup messages and the mode line during initialization --- early-init.el | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/early-init.el b/early-init.el index 7948aab..8d78ce0 100644 --- a/early-init.el +++ b/early-init.el @@ -43,6 +43,14 @@ turned on.") 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-messages-during-startup nil + "Suppress startup messages. +This provides a cleaner startup experience and improve startup performance.") + +(defvar minimal-emacs-disable-mode-line-during-startup nil + "Disable the mode line during startup. +This enhances performance and provide a minimalistic appearance.") + (defvar minimal-emacs-user-directory user-emacs-directory "The default value of the `user-emacs-directory' variable.") @@ -124,24 +132,26 @@ When set to non-nil, Emacs will automatically call `package-initialize' and ;; Suppress redisplay and redraw during startup to avoid delays and ;; prevent flashing an unstyled Emacs frame. ;; (setq-default inhibit-redisplay t) ; Can cause artifacts - (setq-default inhibit-message t) + (when minimal-emacs-inhibit-messages-during-startup + (setq-default inhibit-message t) - ;; Reset the above variables to prevent Emacs from appearing frozen or - ;; visually corrupted after startup or if a startup error occurs. - (defun minimal-emacs--reset-inhibited-vars-h () - ;; (setq-default inhibit-redisplay nil) ; Can cause artifacts - (setq-default inhibit-message nil) - (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibited-vars-h)) + ;; Reset the above variables to prevent Emacs from appearing frozen or + ;; visually corrupted after startup or if a startup error occurs. + (defun minimal-emacs--reset-inhibit-message () + ;; (setq-default inhibit-redisplay nil) ; Can cause artifacts + (setq-default inhibit-message nil) + (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message)) - (add-hook 'post-command-hook - #'minimal-emacs--reset-inhibited-vars-h -100) + (add-hook 'post-command-hook + #'minimal-emacs--reset-inhibit-message -100)) - (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))) + (when minimal-emacs-disable-mode-line-during-startup + (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)))) (defun minimal-emacs--startup-load-user-init-file (fn &rest args) "Advice for startup--load-user-init-file to reset mode-line-format." From 66d7e98c15dcf609634c2c1ef1e9cbc56021bb14 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:31:09 -0500 Subject: [PATCH 66/81] Update read-process-output-max before package.el and use-package --- init.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/init.el b/init.el index d5762fd..631503c 100644 --- a/init.el +++ b/init.el @@ -17,7 +17,10 @@ ;;; Load pre-init.el (minimal-emacs-load-user-init "pre-init.el") -;;; Networking +;;; Before package + +;; Increase how much is read from processes in a single chunk +(setq read-process-output-max (* 1024 1024)) ; 1024kb ;; Don't ping things that look like domain names. (setq ffap-machine-p-known 'reject) @@ -98,9 +101,6 @@ (setq truncate-string-ellipsis "…") -;; Increase how much is read from processes in a single chunk -(setq read-process-output-max (* 1024 1024)) ; 1024kb - ;; Improve Emacs' responsiveness by delaying syntax highlighting during input ;; but may reduce visual feedback. (setq redisplay-skip-fontification-on-input t) From fab5ebecaf62dce221ee7adddd78d56fcd134690 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:14:49 -0500 Subject: [PATCH 67/81] Remove ".." from dired-omit-files --- README.md | 6 ++++-- init.el | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index db145fe..21d0def 100644 --- a/README.md +++ b/README.md @@ -789,9 +789,11 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Dividers.html (add-hook 'after-init-hook #'window-divider-mode) -;; Automatically hide file details (permissions, size, modification date, etc.) -;; in Dired buffers for a cleaner display. +;; Dired buffers: Automatically hide file details (permissions, size, +;; 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) +(add-hook 'dired-mode-hook #'dired-omit-mode) ``` It is also recommended to read the following articles: diff --git a/init.el b/init.el index 631503c..387710d 100644 --- a/init.el +++ b/init.el @@ -429,10 +429,9 @@ ;; Disable the prompt about killing the Dired buffer for a deleted directory. (setq dired-clean-confirm-killing-deleted-buffers nil) -;; Dired-omit - +;; dired-omit-mode (setq dired-omit-verbose nil) -(setq dired-omit-files (concat "\\`[.]?#\\|\\`[.][.]?\\'" +(setq dired-omit-files (concat "\\`[.]\\'" "\\|\\(?:\\.js\\)?\\.meta\\'" "\\|\\.\\(?:elc|a\\|o\\|pyc\\|pyo\\|swp\\|class\\)\\'" "\\|^\\.DS_Store\\'" From ae7a9b7e4906c3d9284d2e29cdc8cd8322f3da69 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:29:06 -0500 Subject: [PATCH 68/81] Merge annoyances with user interface --- init.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index 387710d..15f3c20 100644 --- a/init.el +++ b/init.el @@ -72,6 +72,15 @@ (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 +(setq visible-bell nil) +(setq ring-bell-function #'ignore) + +;; 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. +(setq delete-pair-blink-delay 0.03) + ;;; Show-paren (setq show-paren-delay 0.1 @@ -323,17 +332,6 @@ (setq-default cursor-in-non-selected-windows nil) (setq highlight-nonselected-windows nil) -;;; Annoyances - -;; No beeping or blinking -(setq visible-bell nil) -(setq ring-bell-function #'ignore) - -;; 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. -(setq delete-pair-blink-delay 0.03) - ;;; Indent and formatting (setq-default left-fringe-width 8) From 8c963de7723ec9a3d2922568b4626e2a29bc25ea Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:30:53 -0500 Subject: [PATCH 69/81] Merge font and indent and formatting sections --- init.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index 15f3c20..3b487bb 100644 --- a/init.el +++ b/init.el @@ -76,11 +76,6 @@ (setq visible-bell nil) (setq ring-bell-function #'ignore) -;; 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. -(setq delete-pair-blink-delay 0.03) - ;;; Show-paren (setq show-paren-delay 0.1 @@ -332,7 +327,15 @@ (setq-default cursor-in-non-selected-windows nil) (setq highlight-nonselected-windows nil) -;;; Indent and formatting +;;; Text editing, indent, font, and formatting + +;; 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. +(setq delete-pair-blink-delay 0.03) (setq-default left-fringe-width 8) (setq-default right-fringe-width 8) @@ -444,11 +447,6 @@ (setq ls-lisp-verbosity nil) (setq ls-lisp-dirs-first t) -;;; Font / Text scale - -;; Avoid automatic frame resizing when adjusting settings. -(setq global-text-scale-adjust-resizes-frames nil) - ;;; Ediff ;; Configure Ediff to use a single frame and split windows horizontally From 63dc725ea02b79d4386237f38beab88088a0a872 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 12:34:34 -0500 Subject: [PATCH 70/81] Remove mouse-wheel-scroll-amount-horizontal and mouse-wheel-scroll-amount --- init.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/init.el b/init.el index 3b487bb..24f3cb2 100644 --- a/init.el +++ b/init.el @@ -299,9 +299,6 @@ (setq mouse-yank-at-point nil) -(setq mouse-wheel-scroll-amount '(2 ((shift) . hscroll)) - mouse-wheel-scroll-amount-horizontal 2) - ;; Emacs 29 (when (memq 'context-menu minimal-emacs-ui-features) (when (and (display-graphic-p) (fboundp 'context-menu-mode)) From 4e4d6844d8ef551016f401c5649a8521ccf9cf65 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:16:48 -0500 Subject: [PATCH 71/81] Add flyspell defaults --- README.md | 3 +++ init.el | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/README.md b/README.md index 21d0def..584c6b7 100644 --- a/README.md +++ b/README.md @@ -794,6 +794,9 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read ;; expression for a cleaner display. (add-hook 'dired-mode-hook #'dired-hide-details-mode) (add-hook 'dired-mode-hook #'dired-omit-mode) + +;; Toggle on-the-fly spell checking (Flyspell mode). +(add-hook text-mode-hook #'flyspell-mode) ``` It is also recommended to read the following articles: diff --git a/init.el b/init.el index 24f3cb2..b9c9f5f 100644 --- a/init.el +++ b/init.el @@ -507,10 +507,22 @@ ;; `fido-vertical-mode' (setq icomplete-compute-delay 0.01) +;;; flyspell + +(setq flyspell-issue-welcome-flag nil) + +;; Greatly improves flyspell performance by preventing messages from being +;; displayed for each word when checking the entire buffer. +(setq flyspell-issue-message-flag nil) + +;;; ispell + ;; In Emacs 30 and newer, disable Ispell completion to avoid annotation errors ;; when no `ispell' dictionary is set. (setq text-mode-ispell-word-completion nil) +(setq ispell-silently-savep t) + ;;; ibuffer (setq ibuffer-formats From 3bc2059b07e792c7b366b809dda40f9677bc7afc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:17:16 -0500 Subject: [PATCH 72/81] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 584c6b7..36c3195 100644 --- a/README.md +++ b/README.md @@ -795,7 +795,7 @@ And [add the elpaca bootstrap code](https://github.com/progfolio/elpaca?tab=read (add-hook 'dired-mode-hook #'dired-hide-details-mode) (add-hook 'dired-mode-hook #'dired-omit-mode) -;; Toggle on-the-fly spell checking (Flyspell mode). +;; Enable on-the-fly spell checking (Flyspell mode). (add-hook text-mode-hook #'flyspell-mode) ``` From 9b114a91ea06b657bd63d9b8eefcc69bb1ed55c4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:20:09 -0500 Subject: [PATCH 73/81] Move more code to minimal-emacs-disable-mode-line-during-startup --- early-init.el | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/early-init.el b/early-init.el index 8d78ce0..33c34c6 100644 --- a/early-init.el +++ b/early-init.el @@ -151,22 +151,22 @@ This enhances performance and provide a minimalistic appearance.") (setq-default mode-line-format nil) (dolist (buf (buffer-list)) (with-current-buffer buf - (setq mode-line-format nil)))) + (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. - (setq-default inhibit-message nil) - (unless (default-toplevel-value 'mode-line-format) - (setq-default mode-line-format - (get 'mode-line-format 'initial-value))))) + (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. + (setq-default inhibit-message nil) + (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)) + (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) From 4a5431fb366be06a654b2583fc0f592351fedc5f Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:37:14 -0500 Subject: [PATCH 74/81] Enhance inhibit-message/redisplay and mode-line sections --- early-init.el | 74 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/early-init.el b/early-init.el index 33c34c6..2e31074 100644 --- a/early-init.el +++ b/early-init.el @@ -43,13 +43,23 @@ turned on.") 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-messages-during-startup nil - "Suppress startup messages. -This provides a cleaner startup experience and improve startup performance.") +(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-disable-mode-line-during-startup nil - "Disable the mode line during startup. -This enhances performance and provide a minimalistic appearance.") + "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.") @@ -129,12 +139,17 @@ This enhances performance and provide a minimalistic appearance.") (unless noninteractive (unless minimal-emacs-debug - ;; Suppress redisplay and redraw during startup to avoid delays and - ;; prevent flashing an unstyled Emacs frame. - ;; (setq-default inhibit-redisplay t) ; Can cause artifacts - (when minimal-emacs-inhibit-messages-during-startup - (setq-default inhibit-message t) + (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 ;; Reset the above variables to prevent Emacs from appearing frozen or ;; visually corrupted after startup or if a startup error occurs. (defun minimal-emacs--reset-inhibit-message () @@ -142,31 +157,36 @@ This enhances performance and provide a minimalistic appearance.") (setq-default inhibit-message nil) (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message)) - (add-hook 'post-command-hook - #'minimal-emacs--reset-inhibit-message -100)) + (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 - (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))) + (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. - (setq-default inhibit-message 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))))) + (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))) + (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) From 15b165ed82d6303dbd17a19f5ddda291ac57579a Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:39:45 -0500 Subject: [PATCH 75/81] Enhance inhibit-message/redisplay and mode-line sections --- early-init.el | 3 --- 1 file changed, 3 deletions(-) diff --git a/early-init.el b/early-init.el index 2e31074..ed92876 100644 --- a/early-init.el +++ b/early-init.el @@ -150,10 +150,7 @@ minimalistic appearance during startup.") (add-hook 'post-command-hook #'minimal-emacs--reset-inhibit-redisplay -100)) (when minimal-emacs-inhibit-message-during-startup - ;; Reset the above variables to prevent Emacs from appearing frozen or - ;; visually corrupted after startup or if a startup error occurs. (defun minimal-emacs--reset-inhibit-message () - ;; (setq-default inhibit-redisplay nil) ; Can cause artifacts (setq-default inhibit-message nil) (remove-hook 'post-command-hook #'minimal-emacs--reset-inhibit-message)) From e16fe6272232dfc6eca28c9a4b2cfcccd3c3f77b Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:45:22 -0500 Subject: [PATCH 76/81] Remove disabling horizontal-scroll-bar-mode --- early-init.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/early-init.el b/early-init.el index ed92876..9512b34 100644 --- a/early-init.el +++ b/early-init.el @@ -286,8 +286,6 @@ minimalistic appearance during startup.") (push '(vertical-scroll-bars) default-frame-alist) (push '(horizontal-scroll-bars) default-frame-alist) (setq scroll-bar-mode nil) -(when (fboundp 'horizontal-scroll-bar-mode) - (horizontal-scroll-bar-mode -1)) (unless (memq 'tooltips minimal-emacs-ui-features) (when (bound-and-true-p tooltip-mode) From 1293be787c2d75a1c8df14113790d4b15556f739 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 15:58:05 -0500 Subject: [PATCH 77/81] Various enhancements in garbage collection, file-name-handler-alist, and recentf --- early-init.el | 27 +++++++++++++++------------ init.el | 10 +--------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/early-init.el b/early-init.el index 9512b34..85cdb06 100644 --- a/early-init.el +++ b/early-init.el @@ -89,9 +89,10 @@ minimalistic appearance during startup.") (setq gc-cons-threshold most-positive-fixnum) -(add-hook 'emacs-startup-hook - (lambda () - (setq gc-cons-threshold minimal-emacs-gc-cons-threshold))) +(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 @@ -127,15 +128,17 @@ minimalistic appearance during startup.") (let ((file-name-handler-alist (if args-left old-value file-name-handler-alist))) (funcall fn args-left))) - ;; Remember the old value to reset it as needed. - (add-hook 'emacs-startup-hook - (lambda () - (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)))) - 101)) + + ;; 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 diff --git a/init.el b/init.el index b9c9f5f..cb5ea2f 100644 --- a/init.el +++ b/init.el @@ -208,15 +208,7 @@ ;; recently. (setq recentf-max-saved-items 300) ; default is 20 (setq recentf-max-menu-items 15) -(setq recentf-auto-cleanup (if (daemonp) 300 'never)) - -(defun minimal-emacs--cleanup-hook () - "Run `recentf-cleanup' if `recentf' is loaded and `recentf-mode' is enabled." - (when (and (featurep 'recentf) - recentf-mode - (fboundp 'recentf-cleanup)) - (recentf-cleanup))) -(add-hook 'kill-emacs-hook #'minimal-emacs--cleanup-hook) +(setq recentf-auto-cleanup (if (daemonp) 300 'mode)) ;; Update recentf-exclude (setq recentf-exclude (list "^/\\(?:ssh\\|su\\|sudo\\)?:")) From 5516fafdf5c03e4966d928749afe4f96b5d70097 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:01:24 -0500 Subject: [PATCH 78/81] Update README.md --- README.md | 1 + init.el | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 36c3195..ef1800c 100644 --- a/README.md +++ b/README.md @@ -189,6 +189,7 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; accessed files, making it easier to reopen files you have worked on ;; recently. (add-hook 'after-init-hook #'recentf-mode) +(add-hook 'kill-emacs-hook #'recentf-cleanup) ;; savehist is an Emacs feature that preserves the minibuffer history between ;; sessions. It saves the history of inputs in the minibuffer, such as commands, diff --git a/init.el b/init.el index cb5ea2f..1df8b93 100644 --- a/init.el +++ b/init.el @@ -208,7 +208,7 @@ ;; recently. (setq recentf-max-saved-items 300) ; default is 20 (setq recentf-max-menu-items 15) -(setq recentf-auto-cleanup (if (daemonp) 300 'mode)) +(setq recentf-auto-cleanup (if (daemonp) 300 'never)) ;; Update recentf-exclude (setq recentf-exclude (list "^/\\(?:ssh\\|su\\|sudo\\)?:")) From f9c63863118cc98aa37a6d497402a80208ac9a99 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 18 Feb 2025 16:05:14 -0500 Subject: [PATCH 79/81] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ef1800c..2a2a9e4 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,9 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already ;; recentf is an Emacs package that maintains a list of recently ;; accessed files, making it easier to reopen files you have worked on ;; recently. -(add-hook 'after-init-hook #'recentf-mode) +(add-hook 'after-init-hook #'(lambda() + (let ((inhibit-message t)) + (recentf-mode 1)))) (add-hook 'kill-emacs-hook #'recentf-cleanup) ;; savehist is an Emacs feature that preserves the minibuffer history between From 2d296235ca036b5aed7115604ad13b0507901dcc Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 19 Feb 2025 10:28:05 -0500 Subject: [PATCH 80/81] Add minimal-emacs-optimize-startup-gc --- early-init.el | 16 +++++++++++----- init.el | 4 +--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/early-init.el b/early-init.el index 85cdb06..b9f656f 100644 --- a/early-init.el +++ b/early-init.el @@ -38,6 +38,11 @@ turned on.") (defvar minimal-emacs-gc-cons-threshold (* 16 1024 1024) "The value of `gc-cons-threshold' after Emacs startup.") +(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-package-initialize-and-refresh t "Whether to automatically initialize and refresh packages. When set to non-nil, Emacs will automatically call `package-initialize' and @@ -87,12 +92,13 @@ minimalistic appearance during startup.") ;; Garbage collection significantly affects startup times. This setting delays ;; garbage collection during startup but will be reset later. -(setq gc-cons-threshold most-positive-fixnum) +(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) + (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 diff --git a/init.el b/init.el index 1df8b93..8b9b90a 100644 --- a/init.el +++ b/init.el @@ -94,9 +94,7 @@ (setq whitespace-line-column nil) ; whitespace-mode ;; I reduced the default value of 9 to simplify the font-lock keyword, -;; aiming to improve performance. This package helps differentiate -;; nested delimiter pairs, particularly in languages with heavy use of -;; parentheses. +;; aiming to improve performance. (setq rainbow-delimiters-max-face-count 5) ;; Can be activated with `display-line-numbers-mode' From 84363a954b06bf0b358ba3d30bda0a47822244f4 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:50:59 -0500 Subject: [PATCH 81/81] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2a2a9e4..7283a03 100644 --- a/README.md +++ b/README.md @@ -925,6 +925,7 @@ A drawback of using the early-init phase instead of init is that if a package fa - [Cyneox commented on Reddit](https://www.reddit.com/r/emacs/comments/1gh687a/comment/lwdv18t/), expressing gratitude for the resource and sharing their experience. They mentioned it was their fourth attempt to set up a vanilla configuration and highlighted that they had been using the repository as a foundation for their customizations over the past few days. They appreciated the absence of unexplained behavior and the clear instructions on where to place files. The user reported successful testing on both Linux and macOS, noting that everything functioned smoothly, including in the terminal. - [rrajath](https://www.reddit.com/r/emacs/comments/1ihn2tv/comment/mb0ja8k/) has been using the minimal-emacs.d config for the past several months and loves it. His previous setup used to take around 4 seconds to load, but with minimal-emacs.d, it now loads in just 1 second. - [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." ## Features