Skip to content

Commit 6216b10

Browse files
committed
refactor!: move optional modules from core to modules
This should be backward compatible for the moment. But later, only the `minemacs-modules` variable should be set.
1 parent 925895d commit 6216b10

File tree

10 files changed

+28
-34
lines changed

10 files changed

+28
-34
lines changed

core/me-builtin.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ Useful for quickly switching to an open buffer."
15191519
;; Fallback the new `fido-vertical-mode' Emacs28+ builtin completion mode if
15201520
;; the `me-completion' (which contains `vertico-mode' configuration) core
15211521
;; module is not enabled.
1522-
:unless (and (memq 'me-completion minemacs-core-modules) (not (+package-disabled-p 'vertico)))
1522+
:when (+package-disabled-p 'vertico 'me-completion)
15231523
:hook (minemacs-lazy . fido-vertical-mode))
15241524

15251525
(use-package battery

core/me-modules.el

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,23 @@
66

77
;;; Code:
88

9-
(defcustom minemacs-core-modules
10-
'(me-completion
11-
me-core-ui
12-
me-evil
13-
me-keybindings
14-
me-splash)
9+
(defcustom minemacs-core-modules '()
1510
"MinEmacs enabled core modules."
1611
:group 'minemacs-core
1712
:type '(repeat symbol))
1813

14+
(make-obsolete-variable 'minemacs-core-modules 'minemacs-modules "MinEmacs v7.0.0")
15+
1916
(defcustom minemacs-modules
20-
'(
21-
;; me-ai
17+
'(;; me-ai
2218
;; me-biblio
2319
;; me-binary
2420
;; me-calendar
2521
me-checkers
2622
;; me-clojure
2723
;; me-common-lisp
24+
me-completion
25+
me-core-ui
2826
me-daemon
2927
me-data
3028
me-debug
@@ -33,9 +31,12 @@
3331
me-emacs-lisp
3432
;; me-email
3533
;; me-embedded
34+
me-evil
3635
me-extra
3736
me-files
3837
;; me-fun
38+
;; me-gtd
39+
me-keybindings
3940
me-latex
4041
;; me-lifestyle
4142
;; me-math
@@ -52,6 +53,7 @@
5253
;; me-rss
5354
;; me-scheme
5455
;; me-services
56+
me-splash
5557
;; me-tags
5658
me-tools
5759
me-tty

init.el

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
(load (expand-file-name "core/me-vars.el" (file-name-directory (file-truename load-file-name))) nil t))
100100

101101
;; Add some of MinEmacs' directories to `load-path'.
102-
(setq load-path (append (list minemacs-core-dir minemacs-elisp-dir minemacs-extras-dir) load-path))
102+
(setq load-path (append (list minemacs-core-dir minemacs-elisp-dir minemacs-extras-dir minemacs-modules-dir) load-path))
103103

104104
;; Load MinEmacs' library
105105
(require 'me-lib)
@@ -246,19 +246,16 @@ goes idle."
246246
;; to use some of the new Emacs 29 functions even on earlier Emacs versions,
247247
;; this can be useful when configuring the module's packages and adding new
248248
;; functionality.
249-
(setq minemacs-core-modules
250-
(delete-dups
251-
(append (when (memq 'me-splash minemacs-core-modules) '(me-splash))
252-
'(me-bootstrap)
253-
(when (< emacs-major-version 29) '(me-compat))
254-
'(me-builtin me-gc)
255-
minemacs-core-modules)))
256-
257-
;; Load MinEmacs modules
258-
(dolist (module-file (append
259-
(mapcar (apply-partially #'format "%s%s.el" minemacs-core-dir) minemacs-core-modules)
260-
(mapcar (apply-partially #'format "%s%s.el" minemacs-modules-dir) minemacs-modules)))
261-
(+load module-file))
249+
(let ((splash (when (memq 'me-splash minemacs-core-modules) '(me-splash))))
250+
(setq minemacs-modules (delete-dups (append minemacs-core-modules minemacs-modules))
251+
minemacs-core-modules '(me-bootstrap me-compat me-builtin me-gc))
252+
253+
;; Load MinEmacs modules
254+
(dolist (module (delete-dups (append splash minemacs-core-modules minemacs-modules)))
255+
(let ((module-file (format "%s%s.el" minemacs-core-dir module)))
256+
(if (file-exists-p module-file)
257+
(+load module-file)
258+
(+load (format "%s%s.el" minemacs-modules-dir module))))))
262259

263260
(run-hooks 'minemacs-after-loading-modules-hook)
264261

modules/extras/me-org-export-async-init.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
(provide 'me-org-export-async-init)
2424

2525
;; Load only some essential modules
26-
(setq minemacs-core-modules '(me-builtin)
27-
minemacs-modules '(me-org me-biblio me-latex me-project me-prog me-data me-emacs-lisp))
26+
(setq minemacs-modules '(me-org me-biblio me-latex me-project me-prog me-data me-emacs-lisp))
2827

2928
(load (concat user-emacs-directory "init.el") nil t)
3029

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

skel/modules.el

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@
33
;; Copyright (C) 2022 Abdelhak Bougouffa
44

55
;; This file can be used to override `minemacs-modules'
6-
;; and `minemacs-core-modules'
7-
8-
;;; Ordered list of enabled core modules
9-
(setq minemacs-core-modules
10-
'(me-splash ; Simple splash screen
11-
me-keybindings ; Keybinding (general, which-key, hydra, ...)
12-
me-evil ; Emacs as Vim (evil, evil-collection, evil-snipe, evil-numbers, ...)
13-
me-core-ui ; Core UI (doom-themes, modus-themes, doom-modeline, ...)
14-
me-completion)) ; Completion (vertico, marginalia, corfu, cape, consult, embark, ...)
156

167
;;; List of enabled modules
178
(setq minemacs-modules
@@ -21,6 +12,8 @@
2112
me-checkers ; Static checkers (flymake-collection, flymenu, flymake-cppcheck, ...)
2213
;; me-clojure ; Clojure development (clojure-mode, cider, ...)
2314
;; me-common-lisp ; Common Lisp development (sly, sly-quicklisp, ...)
15+
me-completion ; Completion (vertico, marginalia, corfu, cape, consult, embark, ...)
16+
me-core-ui ; Core UI (doom-themes, modus-themes, doom-modeline, ...)
2417
;; me-daemon ; Emacs daemon tweaks
2518
me-data ; Data file formats and tools (csv, yaml, toml, json, plantuml-mode, jq-mode, ...)
2619
me-debug ; Debugging tools (realgud, disaster, dape, rmsbolt, beardbolt, ...)
@@ -29,10 +22,12 @@
2922
me-emacs-lisp ; Emacs lisp development (parinfer-rust, macrostep, eros, helpful, ...)
3023
;; me-email ; Email (mu4e, mu4e-alert, org-msg, ...)
3124
;; me-embedded ; Embedded systems (embed, arduino-mode, openocd, bitbake, dts-mode, ...)
25+
me-evil ; Emacs as Vim (evil, evil-collection, evil-snipe, evil-numbers, ...)
3226
me-extra ; Extra features (better-jumper, crux, ...)
3327
me-files ; Files and directories (dirvish, vlf, sudo-edit, ztree, ...)
3428
me-fun ; Games and funny packages (xkcd, speed-type, wordel, ...)
3529
;; me-gtd ; Getting Things Done (org-gtd, ...)
30+
me-keybindings ; Keybinding (general, which-key, hydra, ...)
3631
me-latex ; LaTeX (auctex, auctex-latexmk, LaTeX-preview-pane, ...)
3732
;; me-lifestyle ; *Very* opinionated lifestyle packages (awqat, ...)
3833
;; me-math ; Mathematics (maxima, ess, ein, code-cells, julia-mode, ...)
@@ -49,6 +44,7 @@
4944
;; me-rss ; News feed (elfeed, ...)
5045
;; me-scheme ; Scheme development (racket-mode, geiser, ...)
5146
me-services ; Web services (org-jira, ...)
47+
me-splash ; Simple splash screen
5248
;; me-tags ; Source code tagging tools (citre, ggtags, clink, ...)
5349
me-tools ; System tools (vterm, tldr, ssh-deploy, docker, logview, with-editor, ...)
5450
me-tty ; Emacs from terminal (xclip, ...)

0 commit comments

Comments
 (0)