fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
;;; lisp/init.el -*- lexical-binding: t; -*-
|
|
|
|
;;; Commentary:
|
|
|
|
;;
|
|
|
|
;; :core is now treated like a normal module, and this is its (temporary) init
|
|
|
|
;; file, which will be removed once we've resolved our `use-package' dependency
|
|
|
|
;; (which will soon be moved to its own module), then these will be returned to
|
|
|
|
;; the profile init file.
|
|
|
|
;;
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(doom-require 'doom-keybinds)
|
|
|
|
(doom-require 'doom-ui)
|
|
|
|
(doom-require 'doom-projects)
|
|
|
|
(doom-require 'doom-editor)
|
|
|
|
|
2024-09-10 04:18:39 -04:00
|
|
|
;; COMPAT: `safe-local-variable-directories' was introduced in Emacs 30.1
|
|
|
|
(unless (boundp 'safe-local-variable-directories)
|
|
|
|
(defvar safe-local-variable-directories ())
|
|
|
|
(define-advice hack-local-variables-filter (:around (fn variables dir-name) respect)
|
|
|
|
(let ((enable-local-variables
|
|
|
|
(if (delq nil (mapcar (lambda (dir)
|
|
|
|
(and dir-name dir
|
|
|
|
(file-equal-p dir dir-name)))
|
|
|
|
safe-local-variable-directories))
|
|
|
|
:all
|
|
|
|
enable-local-variables)))
|
|
|
|
(funcall fn variables dir-name))))
|
|
|
|
|
|
|
|
;; Ensure .dir-locals.el in $EMACSDIR and $DOOMDIR are always respected
|
|
|
|
(add-to-list 'safe-local-variable-directories doom-emacs-dir)
|
|
|
|
(add-to-list 'safe-local-variable-directories doom-user-dir)
|
|
|
|
|
|
|
|
;;; Support for Doom-specific file extensions
|
|
|
|
(add-to-list 'auto-mode-alist '("/\\.doom\\(?:project\\|module\\|profile\\)?\\'" . lisp-data-mode))
|
|
|
|
(add-to-list 'auto-mode-alist '("/\\.doomrc\\'" . emacs-lisp-mode))
|
|
|
|
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
;;; init.el ends here
|