Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
;;; core/cli/doctor.el -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
(defvar doom-warnings ())
|
|
|
|
(defvar doom-errors ())
|
|
|
|
|
|
|
|
;;; Helpers
|
|
|
|
(defun elc-check-dir (dir)
|
|
|
|
(dolist (file (directory-files-recursively dir "\\.elc$"))
|
|
|
|
(when (file-newer-than-file-p (concat (file-name-sans-extension file) ".el")
|
|
|
|
file)
|
|
|
|
(warn! "%s is out-of-date" (abbreviate-file-name file)))))
|
|
|
|
|
|
|
|
(defmacro assert! (condition message &rest args)
|
|
|
|
`(unless ,condition
|
|
|
|
(error! ,message ,@args)))
|
|
|
|
|
|
|
|
|
|
|
|
;;; Logging
|
|
|
|
(defmacro error! (&rest args)
|
|
|
|
`(progn (unless inhibit-message (print! (error ,@args)))
|
|
|
|
(push (format! (error ,@args)) doom-errors)))
|
|
|
|
(defmacro warn! (&rest args)
|
|
|
|
`(progn (unless inhibit-message (print! (warn ,@args)))
|
|
|
|
(push (format! (warn ,@args)) doom-warnings)))
|
|
|
|
(defmacro success! (&rest args)
|
|
|
|
`(print! (green ,@args)))
|
|
|
|
(defmacro section! (&rest args)
|
|
|
|
`(print! (bold (blue ,@args))))
|
|
|
|
|
|
|
|
(defmacro explain! (&rest args)
|
|
|
|
`(print-group! (print! (autofill ,@args))))
|
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; CLI commands
|
|
|
|
|
|
|
|
(defcli! (doctor doc) ()
|
|
|
|
"Diagnoses common issues on your system.
|
|
|
|
|
|
|
|
The Doom doctor is essentially one big, self-contained elisp shell script that
|
|
|
|
uses a series of simple heuristics to diagnose common issues on your system.
|
|
|
|
Issues that could intefere with Doom Emacs.
|
|
|
|
|
|
|
|
Doom modules may optionally have a doctor.el file to run their own heuristics
|
|
|
|
in."
|
|
|
|
:bare t
|
|
|
|
(print! "The doctor will see you now...\n")
|
|
|
|
|
|
|
|
;; REVIEW Refactor me
|
|
|
|
(print! (start "Checking your Emacs version..."))
|
2020-05-14 16:31:08 -04:00
|
|
|
(when EMACS28+
|
|
|
|
(warn! "Emacs %s detected. Doom doesn't support Emacs 28/HEAD. It is unstable and may cause errors."
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
emacs-version))
|
|
|
|
|
|
|
|
(print! (start "Checking for Emacs config conflicts..."))
|
|
|
|
(when (file-exists-p "~/.emacs")
|
|
|
|
(warn! "Detected an ~/.emacs file, which may prevent Doom from loading")
|
|
|
|
(explain! "If Emacs finds an ~/.emacs file, it will ignore ~/.emacs.d, where Doom is "
|
|
|
|
"typically installed. If you're seeing a vanilla Emacs splash screen, this "
|
|
|
|
"may explain why. If you use Chemacs, you may ignore this warning."))
|
|
|
|
|
2020-08-12 15:17:15 -04:00
|
|
|
(when EMACS27+
|
|
|
|
(print! (start "Checking for great Emacs features..."))
|
|
|
|
(unless (and (functionp 'json-serialize)
|
2020-08-12 16:01:10 -04:00
|
|
|
(string-match-p "\\_<JSON\\_>" system-configuration-features))
|
2020-08-12 15:17:15 -04:00
|
|
|
(warn! "Emacs was not built with native JSON support")
|
|
|
|
(explain! "Users will see a substantial performance gain by building Emacs with "
|
|
|
|
"jansson support (i.e. a native JSON library), particularly LSP users. "
|
|
|
|
"You must install a prebuilt Emacs binary with this included, or compile "
|
|
|
|
"Emacs with the --with-json option.")))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(print! (start "Checking for private config conflicts..."))
|
|
|
|
(let ((xdg-dir (concat (or (getenv "XDG_CONFIG_HOME")
|
|
|
|
"~/.config")
|
|
|
|
"/doom/"))
|
|
|
|
(doom-dir (or (getenv "DOOMDIR")
|
|
|
|
"~/.doom.d/")))
|
|
|
|
(when (and (not (file-equal-p xdg-dir doom-dir))
|
|
|
|
(file-directory-p xdg-dir)
|
|
|
|
(file-directory-p doom-dir))
|
|
|
|
(print! (warn "Detected two private configs, in %s and %s")
|
|
|
|
(abbreviate-file-name xdg-dir)
|
|
|
|
doom-dir)
|
|
|
|
(explain! "The second directory will be ignored, as it has lower precedence.")))
|
|
|
|
|
|
|
|
(print! (start "Checking for stale elc files..."))
|
|
|
|
(elc-check-dir user-emacs-directory)
|
|
|
|
|
|
|
|
(print! (start "Checking Doom Emacs..."))
|
|
|
|
(condition-case-unless-debug ex
|
|
|
|
(print-group!
|
2020-05-25 02:58:07 -04:00
|
|
|
(let ((doom-interactive-p 'doctor))
|
2019-11-11 22:49:10 -05:00
|
|
|
(doom-initialize 'force)
|
|
|
|
(doom-initialize-modules))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
|
2019-11-11 22:49:10 -05:00
|
|
|
(print! (success "Initialized Doom Emacs %s") doom-version)
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(print!
|
|
|
|
(if (hash-table-p doom-modules)
|
|
|
|
(success "Detected %d modules" (hash-table-count doom-modules))
|
|
|
|
(warn "Failed to load any modules. Do you have an private init.el?")))
|
|
|
|
|
|
|
|
(print! (success "Detected %d packages") (length doom-packages))
|
|
|
|
|
|
|
|
(print! (start "Checking Doom core for irregularities..."))
|
|
|
|
(print-group!
|
|
|
|
;; Check for oversized problem files in cache that may cause unusual/tremendous
|
|
|
|
;; delays or freezing. This shouldn't happen often.
|
2019-11-10 01:35:21 -05:00
|
|
|
(dolist (file (list "savehist" "projectile.cache"))
|
2019-11-10 04:50:47 -05:00
|
|
|
(when-let (size (ignore-errors (doom-file-size file doom-cache-dir)))
|
2019-11-10 01:35:21 -05:00
|
|
|
(when (> size 1048576) ; larger than 1mb
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(warn! "%s is too large (%.02fmb). This may cause freezes or odd startup delays"
|
2020-06-10 21:52:04 -04:00
|
|
|
file (/ size 1024 1024.0))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(explain! "Consider deleting it from your system (manually)"))))
|
|
|
|
|
2020-05-19 21:48:21 -04:00
|
|
|
(unless (executable-find "rg")
|
|
|
|
(error! "Couldn't find the `rg' binary; this a hard dependecy for Doom, file searches may not work at all"))
|
|
|
|
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(unless (ignore-errors (executable-find doom-projectile-fd-binary))
|
2020-05-19 21:48:21 -04:00
|
|
|
(warn! "Couldn't find the `fd' binary; project file searches will be slightly slower"))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
|
2019-11-10 01:39:30 -05:00
|
|
|
(require 'projectile)
|
|
|
|
(when (projectile-project-root "~")
|
|
|
|
(warn! "Your $HOME is recognized as a project root")
|
|
|
|
(explain! "Doom will disable bottom-up root search, which may reduce the accuracy of project\n"
|
|
|
|
"detection."))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
|
|
|
|
;; There should only be one
|
|
|
|
(when (and (file-equal-p doom-private-dir "~/.config/doom")
|
|
|
|
(file-directory-p "~/.doom.d"))
|
|
|
|
(print! (warn "Both %S and '~/.doom.d' exist on your system")
|
|
|
|
(path doom-private-dir))
|
|
|
|
(explain! "Doom will only load one of these (~/.config/doom takes precedence). Possessing\n"
|
|
|
|
"both is rarely intentional; you should one or the other."))
|
|
|
|
|
|
|
|
;; Check for fonts
|
2020-04-24 22:00:17 -04:00
|
|
|
(if (not (executable-find "fc-list"))
|
|
|
|
(warn! "Warning: unable to detect fonts because fontconfig isn't installed")
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
;; all-the-icons fonts
|
|
|
|
(when (and (pcase system-type
|
|
|
|
(`gnu/linux (concat (or (getenv "XDG_DATA_HOME")
|
|
|
|
"~/.local/share")
|
|
|
|
"/fonts/"))
|
|
|
|
(`darwin "~/Library/Fonts/"))
|
|
|
|
(require 'all-the-icons nil t))
|
2019-11-09 20:32:48 -05:00
|
|
|
(with-temp-buffer
|
2020-05-15 04:59:10 -04:00
|
|
|
(let ((errors 0))
|
|
|
|
(cl-destructuring-bind (status . output)
|
|
|
|
(doom-call-process "fc-list" "" "file")
|
|
|
|
(if (not (zerop status))
|
|
|
|
(print! (error "There was an error running `fc-list'. Is fontconfig installed correctly?"))
|
|
|
|
(insert (cdr (doom-call-process "fc-list" "" "file")))
|
|
|
|
(dolist (font all-the-icons-font-names)
|
|
|
|
(if (save-excursion (re-search-backward font nil t))
|
|
|
|
(success! "Found font %s" font)
|
|
|
|
(print! (warn "Warning: couldn't find %S font") font)))
|
|
|
|
(when (> errors 0)
|
|
|
|
(explain! "Some all-the-icons fonts were missing.\n\n"
|
|
|
|
"You can install them by running `M-x all-the-icons-install-fonts' within Emacs.\n"
|
|
|
|
"This could also mean you've installed them in non-standard locations, in which "
|
|
|
|
"case feel free to ignore this warning.")))))))))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
|
|
|
|
(print! (start "Checking for stale elc files in your DOOMDIR..."))
|
|
|
|
(when (file-directory-p doom-private-dir)
|
|
|
|
(print-group!
|
|
|
|
(elc-check-dir doom-private-dir)))
|
|
|
|
|
|
|
|
(when doom-modules
|
|
|
|
(print! (start "Checking your enabled modules..."))
|
|
|
|
(advice-add #'require :around #'doom-shut-up-a)
|
|
|
|
(maphash (lambda (key plist)
|
|
|
|
(let (doom-local-errors
|
|
|
|
doom-local-warnings)
|
|
|
|
(let (doom-errors
|
|
|
|
doom-warnings)
|
|
|
|
(condition-case-unless-debug ex
|
|
|
|
(let ((doctor-file (doom-module-path (car key) (cdr key) "doctor.el"))
|
|
|
|
(packages-file (doom-module-path (car key) (cdr key) "packages.el")))
|
2020-05-25 03:32:50 -04:00
|
|
|
(cl-loop with doom-output-indent = 6
|
2020-05-14 16:33:03 -04:00
|
|
|
for name in (let (doom-packages
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
doom-disabled-packages)
|
|
|
|
(load packages-file 'noerror 'nomessage)
|
|
|
|
(mapcar #'car doom-packages))
|
|
|
|
unless (or (doom-package-get name :disable)
|
|
|
|
(eval (doom-package-get name :ignore))
|
2020-05-15 04:19:25 -04:00
|
|
|
(plist-member (doom-package-get name :recipe) :local-repo)
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(doom-package-built-in-p name)
|
|
|
|
(doom-package-installed-p name))
|
2020-05-14 16:33:03 -04:00
|
|
|
do (print! (error "Missing emacs package: %S") name))
|
Rewrite core-cli
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
2019-11-07 15:59:56 -05:00
|
|
|
(let ((inhibit-message t))
|
|
|
|
(load doctor-file 'noerror 'nomessage)))
|
|
|
|
(file-missing (error! "%s" (error-message-string ex)))
|
|
|
|
(error (error! "Syntax error: %s" ex)))
|
|
|
|
(when (or doom-errors doom-warnings)
|
|
|
|
(print-group!
|
|
|
|
(print! (start (bold "%s %s")) (car key) (cdr key))
|
|
|
|
(print! "%s" (string-join (append doom-errors doom-warnings) "\n")))
|
|
|
|
(setq doom-local-errors doom-errors
|
|
|
|
doom-local-warnings doom-warnings)))
|
|
|
|
(appendq! doom-errors doom-local-errors)
|
|
|
|
(appendq! doom-warnings doom-local-warnings)))
|
|
|
|
doom-modules)))
|
|
|
|
(error
|
|
|
|
(warn! "Attempt to load DOOM failed\n %s\n"
|
|
|
|
(or (cdr-safe ex) (car ex)))
|
|
|
|
(setq doom-modules nil)))
|
|
|
|
|
|
|
|
;; Final report
|
|
|
|
(message "")
|
|
|
|
(dolist (msg (list (list doom-errors "error" 'red)
|
|
|
|
(list doom-warnings "warning" 'yellow)))
|
|
|
|
(when (car msg)
|
|
|
|
(print! (color (nth 2 msg)
|
|
|
|
(if (cdr msg)
|
|
|
|
"There are %d %ss!"
|
|
|
|
"There is %d %s!")
|
|
|
|
(length (car msg)) (nth 1 msg)))))
|
|
|
|
(unless (or doom-errors doom-warnings)
|
|
|
|
(success! "Everything seems fine, happy Emacs'ing!"))
|
|
|
|
t)
|