fix(lib): doom/sandbox: vanilla-doom+ target
Between this and60083a2
, doom/sandbox is now fully functional (this is a stopgap fix until v3.0). Ref:60083a2626
Fix: #5845 Fix: #6505 Fix: #7486
This commit is contained in:
parent
60083a2626
commit
a022e55c08
2 changed files with 78 additions and 85 deletions
|
@ -405,7 +405,16 @@ Defaults to the profile at `doom-profile-default'."
|
||||||
(letf! ((defun module-loader (group name file &optional noerror)
|
(letf! ((defun module-loader (group name file &optional noerror)
|
||||||
(doom-module-context-with (cons group name)
|
(doom-module-context-with (cons group name)
|
||||||
`(let ((doom-module-context ,doom-module-context))
|
`(let ((doom-module-context ,doom-module-context))
|
||||||
(doom-load ,(abbreviate-file-name (file-name-sans-extension file))))))
|
(doom-load
|
||||||
|
,(pcase (cons group name)
|
||||||
|
('(:core . nil)
|
||||||
|
`(file-name-concat
|
||||||
|
doom-core-dir ,(file-name-nondirectory (file-name-sans-extension file))))
|
||||||
|
('(:user . nil)
|
||||||
|
`(file-name-concat
|
||||||
|
doom-user-dir ,(file-name-nondirectory (file-name-sans-extension file))))
|
||||||
|
(_ (abbreviate-file-name (file-name-sans-extension file))))
|
||||||
|
t))))
|
||||||
(defun module-list-loader (modules file &optional noerror)
|
(defun module-list-loader (modules file &optional noerror)
|
||||||
(cl-loop for (cat . mod) in modules
|
(cl-loop for (cat . mod) in modules
|
||||||
if (doom-module-locate-path cat mod file)
|
if (doom-module-locate-path cat mod file)
|
||||||
|
|
|
@ -49,18 +49,22 @@
|
||||||
|
|
||||||
(defun doom--sandbox-run (&optional mode)
|
(defun doom--sandbox-run (&optional mode)
|
||||||
"TODO"
|
"TODO"
|
||||||
|
(letenv! (("DOOMDIR" (if (eq mode 'vanilla-doom+)
|
||||||
|
(expand-file-name "___does_not_exist___" temporary-file-directory)
|
||||||
|
doom-user-dir)))
|
||||||
(doom--sandbox-launch
|
(doom--sandbox-launch
|
||||||
(unless (eq mode 'doom) '("-Q"))
|
(unless (memq mode '(doom vanilla-doom+)) '("-Q"))
|
||||||
(let ((forms
|
(let ((forms
|
||||||
(read (format "(progn\n%s\n)"
|
(read (format "(progn\n%s\n)"
|
||||||
(buffer-substring-no-properties
|
(buffer-substring-no-properties
|
||||||
(point-min)
|
(point-min)
|
||||||
(point-max))))))
|
(point-max))))))
|
||||||
(if (eq mode 'doom)
|
(if (memq mode '(doom vanilla-doom+))
|
||||||
forms
|
forms
|
||||||
`(progn
|
`(progn
|
||||||
;; doom variables
|
;; doom variables
|
||||||
(setq init-file-debug t
|
(setq init-file-debug t
|
||||||
|
doom-log-level 2
|
||||||
doom-emacs-dir ,doom-emacs-dir
|
doom-emacs-dir ,doom-emacs-dir
|
||||||
doom-cache-dir ,(expand-file-name "cache/" doom-sandbox-dir)
|
doom-cache-dir ,(expand-file-name "cache/" doom-sandbox-dir)
|
||||||
doom-data-dir ,(expand-file-name "data/" doom-sandbox-dir))
|
doom-data-dir ,(expand-file-name "data/" doom-sandbox-dir))
|
||||||
|
@ -89,26 +93,6 @@
|
||||||
;; Then launch as much about Emacs as we can
|
;; Then launch as much about Emacs as we can
|
||||||
(defun --run-- () ,forms)
|
(defun --run-- () ,forms)
|
||||||
,(pcase mode
|
,(pcase mode
|
||||||
(`vanilla-doom+ ; Doom core + modules - private config
|
|
||||||
(user-error "Not supported yet!")
|
|
||||||
`(progn
|
|
||||||
(require 'doom ,(expand-file-name "doom.el" doom-core-dir))
|
|
||||||
(let ((doom-module-init-file "__does-not-exist__"))
|
|
||||||
(require 'doom-start))
|
|
||||||
(setq doom-module-load-path (list doom-modules-dir))
|
|
||||||
(setq doom-modules ',doom-modules)
|
|
||||||
(maphash (lambda (key plist)
|
|
||||||
(doom-module-put
|
|
||||||
(car key) (cdr key)
|
|
||||||
:path (doom-module-locate-path (car key) (cdr key))))
|
|
||||||
doom-modules)
|
|
||||||
(--run--)
|
|
||||||
(doom-run-hooks 'doom-before-modules-init-hook)
|
|
||||||
(maphash (doom-module-loader doom-module-init-file) doom-modules)
|
|
||||||
(doom-run-hooks 'doom-after-modules-init-hook)
|
|
||||||
(doom-run-hooks 'doom-before-modules-config-hook)
|
|
||||||
(maphash (doom-module-loader doom-module-config-file) doom-modules)
|
|
||||||
(doom-run-hooks 'doom-after-modules-config-hook)))
|
|
||||||
(`vanilla-doom ; only Doom core
|
(`vanilla-doom ; only Doom core
|
||||||
`(let ((doom-user-dir "/tmp/does/not/exist"))
|
`(let ((doom-user-dir "/tmp/does/not/exist"))
|
||||||
(require 'doom ,(expand-file-name "doom.el" doom-core-dir))
|
(require 'doom ,(expand-file-name "doom.el" doom-core-dir))
|
||||||
|
@ -132,7 +116,7 @@
|
||||||
(fset 'doom-run-all-startup-hooks-h #',(symbol-function #'doom-run-all-startup-hooks-h))
|
(fset 'doom-run-all-startup-hooks-h #',(symbol-function #'doom-run-all-startup-hooks-h))
|
||||||
;; (doom-run-all-startup-hooks-h)
|
;; (doom-run-all-startup-hooks-h)
|
||||||
(unless (default-toplevel-value 'mode-line-format)
|
(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))))))))))
|
||||||
|
|
||||||
(fset 'doom--run-vanilla-emacs (cmd! (doom--sandbox-run 'vanilla)))
|
(fset 'doom--run-vanilla-emacs (cmd! (doom--sandbox-run 'vanilla)))
|
||||||
(fset 'doom--run-vanilla-doom (cmd! (doom--sandbox-run 'vanilla-doom)))
|
(fset 'doom--run-vanilla-doom (cmd! (doom--sandbox-run 'vanilla-doom)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue