Move doom! to core-packages.el; add doom-dont-load-p
This commit is contained in:
parent
b0075eab8a
commit
a9e29c053b
2 changed files with 39 additions and 41 deletions
|
@ -30,6 +30,9 @@ symbol and cdr is the submodule's name as a symbol.")
|
|||
(defvar doom-auto-install-p nil
|
||||
"")
|
||||
|
||||
(defvar doom-dont-load-p nil
|
||||
"If non-nil, don't actually load modules, only keep track of them.")
|
||||
|
||||
(defvar doom--load-path (append (list doom-core-dir
|
||||
doom-modules-dir
|
||||
doom-local-dir)
|
||||
|
@ -60,7 +63,33 @@ symbol and cdr is the submodule's name as a symbol.")
|
|||
;; Bootstrap function
|
||||
;;
|
||||
|
||||
(autoload 'use-package "quelpa-use-package" nil t)
|
||||
(defmacro doom! (&rest packages)
|
||||
"DOOM Emacs bootstrap macro. List the modules to load. Benefits from
|
||||
byte-compilation."
|
||||
(let (mode)
|
||||
(dolist (p packages)
|
||||
(cond ((string-prefix-p ":" (symbol-name p))
|
||||
(setq mode p))
|
||||
((not mode)
|
||||
(error "No namespace specified on `doom!' for %s" p))
|
||||
(t
|
||||
(setq doom-modules (append doom-modules (list (cons mode p))))))))
|
||||
(unless doom-dont-load-p
|
||||
`(let (file-name-handler-alist)
|
||||
,@(mapcar (lambda (pkg) (macroexpand `(load! ,(car pkg) ,(cdr pkg))))
|
||||
doom-modules)
|
||||
|
||||
(unless noninteractive
|
||||
(when (display-graphic-p)
|
||||
(require 'server)
|
||||
(unless (server-running-p)
|
||||
(server-start)))
|
||||
|
||||
;; Prevent any auto-displayed text + benchmarking
|
||||
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
||||
(message "Loaded %s packages in %s"
|
||||
(length doom-packages)
|
||||
(emacs-init-time))))))
|
||||
|
||||
(defun doom-initialize (&optional force-p)
|
||||
"Initialize installed packages (using package.el). This must be used on first
|
||||
|
|
39
core/core.el
39
core/core.el
|
@ -156,53 +156,22 @@ enable multiple minor modes for the same regexp.")
|
|||
|
||||
(package! smex :commands smex)
|
||||
|
||||
(unless (require 'autoloads nil t)
|
||||
(add-hook 'after-init-hook 'doom/refresh-autoloads))
|
||||
|
||||
;;; Let 'er rip! (order matters!)
|
||||
(require 'core-ui) ; draw me like one of your French editors
|
||||
(require 'core-popups) ; taming sudden yet inevitable windows
|
||||
(require 'core-editor) ; baseline configuration for text editing
|
||||
(require 'core-projects) ; getting around your projects
|
||||
|
||||
(unless (require 'autoloads nil t)
|
||||
(add-hook 'after-init-hook 'doom/refresh-autoloads)))
|
||||
|
||||
;; (require 'core-workspaces) ; TODO
|
||||
;; (require 'core-completion) ; TODO company & auto-complete, for the lazy typist
|
||||
;; (require 'core-evil)
|
||||
;; (require 'core-jump)
|
||||
;; (require 'core-repl)
|
||||
;; (require 'core-snippets)
|
||||
;; (require 'core-syntax-checking))
|
||||
)
|
||||
|
||||
;;;
|
||||
;;
|
||||
(defmacro doom! (&rest packages)
|
||||
"DOOM Emacs bootstrap macro. List the modules to load. Benefits from
|
||||
byte-compilation."
|
||||
`(let (file-name-handler-alist)
|
||||
,@(mapcar (lambda (pkg)
|
||||
`(progn
|
||||
(add-to-list 'doom-modules (cons ,(car pkg) ',(cdr pkg)))
|
||||
,(macroexpand `(load! ,(car pkg) ,(cdr pkg)))))
|
||||
(let (pkgs mode)
|
||||
(dolist (p packages)
|
||||
(cond ((string-prefix-p ":" (symbol-name p))
|
||||
(setq mode p))
|
||||
((not mode)
|
||||
(error "No namespace specified on `doom!' for %s" p))
|
||||
(t
|
||||
(setq pkgs (append pkgs (list (cons mode p)))))))
|
||||
pkgs))
|
||||
|
||||
(unless noninteractive
|
||||
(when (display-graphic-p)
|
||||
(require 'server)
|
||||
(unless (server-running-p)
|
||||
(server-start)))
|
||||
|
||||
;; Prevent any auto-displayed text + benchmarking
|
||||
(advice-add 'display-startup-echo-area-message :override 'ignore)
|
||||
(message ""))))
|
||||
;; (require 'core-syntax-checking)
|
||||
|
||||
(provide 'core)
|
||||
;;; core.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue