Skip to content

Commit

Permalink
New option "dotspacemacs-load-prefer-newer" to control prefer newer
Browse files Browse the repository at this point in the history
* core/core-dotspacemacs.el: New option "dotspacemacs-load-prefer-newer"
* core/templates/.spacemacs.template: Template changes for new option
* layers/+spacemacs/spacemacs-defaults/config.el: Apply the new option
  • Loading branch information
sunlin7 authored and Lin Sun committed Nov 20, 2024
1 parent c3269f6 commit 5c382ad
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -3666,6 +3666,8 @@ files (thanks to Daniel Nicolai)
**** Spacemacs-defaults
- Updated spacemacs/save-as function, see github #8974 and #14754 (thanks to
Daniel Nicolai and Lebensterben)
- New option variable ~dotspacemacs-load-prefer-newer~ to control the variable
~load-prefer-newer~ for Emacs (thanks to Lin Sun)
**** Spotify
- Replaced helm-spotify package with helm-spotify-plus
(thanks to Leonard Lausen)
Expand Down
6 changes: 6 additions & 0 deletions core/core-dotspacemacs.el
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,12 @@ are kept or minimized by `spacemacs/toggle-maximize-window' (SPC w m)."
'boolean
'spacemacs-dotspacemacs-init)

(spacemacs|defc dotspacemacs-load-prefer-newer nil
"If nil use the default value of `load-prefer-newer'. Otherwise prefer
newer files to avoid loading outdated compiled ones."
'boolean
'spacemacs-dotspacemacs-init)

(spacemacs|defc dotspacemacs-loading-progress-bar t
"If non nil a progress bar is displayed when spacemacs is loading. This
may increase the boot time on some systems and emacs builds, set it to nil
Expand Down
5 changes: 5 additions & 0 deletions core/templates/.spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,11 @@ It should only modify the values of Spacemacs settings."
;; loading, otherwise do not try the `package-quickstart' (default nil).
dotspacemacs-enable-package-quickstart nil

;; If t, enable the `load-prefer-newer' to avoid loading outdated compiled
;; files. Otherwise, do not change the value of `load-prefer-newer' (default
;; is nil). It will affect the boot time on Windows.
dotspacemacs-load-prefer-newer nil

;; If non-nil a progress bar is displayed when spacemacs is loading. This
;; may increase the boot time on some systems and emacs builds, set it to
;; nil to boost the loading time. (default t)
Expand Down
3 changes: 2 additions & 1 deletion layers/+spacemacs/spacemacs-defaults/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ or `nil' to only save and not visit the file."
(add-hook 'kill-buffer-hook #'spacemacs//add-buffer-to-killed-list)

;; Don't load outdated compiled files.
(setq load-prefer-newer t)
(when dotspacemacs-load-prefer-newer
(setq load-prefer-newer t))

;; Suppress the *Warnings* buffer when native compilation shows warnings.
(setq native-comp-async-report-warnings-errors 'silent)

0 comments on commit 5c382ad

Please sign in to comment.