Remove doom//x naming convention
This naming convention was meant to be for batch commands, but it grew to include "commands that were helpful with managing Doom", but many of these commands shouldn't be interactive in the first place!
This commit is contained in:
parent
648f4bb585
commit
03022d09f9
11 changed files with 85 additions and 97 deletions
|
@ -217,12 +217,16 @@ whose car is the list of faces and cadr is the list of overlay faces."
|
||||||
(list faces overlays))))))
|
(list faces overlays))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom//open-manual ()
|
(defalias 'doom/help 'doom/open-manual)
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun doom/open-manual ()
|
||||||
|
"TODO"
|
||||||
(interactive)
|
(interactive)
|
||||||
(find-file (expand-file-name "index.org" doom-docs-dir)))
|
(find-file (expand-file-name "index.org" doom-docs-dir)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom//reload (&optional force-p)
|
(defun doom/reload (&optional force-p)
|
||||||
"Reloads your config. This is experimental!
|
"Reloads your config. This is experimental!
|
||||||
|
|
||||||
If called from a noninteractive session, this will try to communicate with a
|
If called from a noninteractive session, this will try to communicate with a
|
||||||
|
@ -236,15 +240,16 @@ init.el and config.el. Then runs `doom-reload-hook'."
|
||||||
(cond ((and noninteractive (not (daemonp)))
|
(cond ((and noninteractive (not (daemonp)))
|
||||||
(require 'server)
|
(require 'server)
|
||||||
(if (not (server-running-p))
|
(if (not (server-running-p))
|
||||||
(doom//reload-autoloads force-p)
|
(doom-reload-autoloads force-p)
|
||||||
(print! "Reloading active Emacs session...")
|
(print! "Reloading active Emacs session...")
|
||||||
(print!
|
(print!
|
||||||
(bold "%%s")
|
(bold "%%s")
|
||||||
(if (server-eval-at server-name '(doom//reload))
|
(if (server-eval-at server-name '(doom/reload))
|
||||||
(green "Done!")
|
(green "Done!")
|
||||||
(red "There were issues!")))))
|
(red "There were issues!")))))
|
||||||
((let ((load-prefer-newer t))
|
((progn
|
||||||
(doom//reload-autoloads force-p)
|
(require 'core-packages)
|
||||||
|
(doom-reload-autoloads force-p)
|
||||||
(doom-initialize 'force)
|
(doom-initialize 'force)
|
||||||
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
(with-demoted-errors "PRIVATE CONFIG ERROR: %s"
|
||||||
(doom-initialize-modules 'force))
|
(doom-initialize-modules 'force))
|
||||||
|
|
|
@ -230,7 +230,7 @@ containing (PACKAGE-SYMBOL OLD-VERSION-LIST NEW-VERSION-LIST).
|
||||||
|
|
||||||
If INCLUDE-FROZEN-P is non-nil, check frozen packages as well.
|
If INCLUDE-FROZEN-P is non-nil, check frozen packages as well.
|
||||||
|
|
||||||
Used by `doom//packages-update'."
|
Used by `doom-packages-update'."
|
||||||
(doom-initialize-packages t)
|
(doom-initialize-packages t)
|
||||||
(doom-refresh-packages-maybe doom-debug-mode)
|
(doom-refresh-packages-maybe doom-debug-mode)
|
||||||
(require 'async)
|
(require 'async)
|
||||||
|
@ -279,7 +279,7 @@ Used by `doom//packages-update'."
|
||||||
"Return a list of symbols representing packages that are no longer needed or
|
"Return a list of symbols representing packages that are no longer needed or
|
||||||
depended on.
|
depended on.
|
||||||
|
|
||||||
Used by `doom//packages-autoremove'."
|
Used by `doom-packages-autoremove'."
|
||||||
(let ((package-selected-packages
|
(let ((package-selected-packages
|
||||||
(mapcar #'car (doom-get-packages :ignored nil :disabled nil))))
|
(mapcar #'car (doom-get-packages :ignored nil :disabled nil))))
|
||||||
(append (package--removable-packages)
|
(append (package--removable-packages)
|
||||||
|
@ -298,7 +298,7 @@ the package symbol, and whose CDR is a plist taken from that package's
|
||||||
If INCLUDE-IGNORED-P is non-nil, includes missing packages that are ignored,
|
If INCLUDE-IGNORED-P is non-nil, includes missing packages that are ignored,
|
||||||
i.e. they have an :ignore property.
|
i.e. they have an :ignore property.
|
||||||
|
|
||||||
Used by `doom//packages-install'."
|
Used by `doom-packages-install'."
|
||||||
(doom-initialize-packages)
|
(doom-initialize-packages)
|
||||||
(cl-loop for (name . plist)
|
(cl-loop for (name . plist)
|
||||||
in (doom-get-packages :ignored (if include-ignored-p 'any) :disabled nil)
|
in (doom-get-packages :ignored (if include-ignored-p 'any) :disabled nil)
|
||||||
|
@ -450,9 +450,8 @@ calls."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom//packages-install (&optional auto-accept-p)
|
(defun doom-packages-install (&optional auto-accept-p)
|
||||||
"Interactive command for installing missing packages."
|
"Interactive command for installing missing packages."
|
||||||
(interactive "P")
|
|
||||||
(print! "Looking for packages to install...")
|
(print! "Looking for packages to install...")
|
||||||
(let ((packages (reverse (doom-get-missing-packages))))
|
(let ((packages (reverse (doom-get-missing-packages))))
|
||||||
(cond ((not packages)
|
(cond ((not packages)
|
||||||
|
@ -511,9 +510,8 @@ calls."
|
||||||
success)))))
|
success)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom//packages-update (&optional auto-accept-p)
|
(defun doom-packages-update (&optional auto-accept-p)
|
||||||
"Interactive command for updating packages."
|
"Interactive command for updating packages."
|
||||||
(interactive "P")
|
|
||||||
(print! "Looking for outdated packages...")
|
(print! "Looking for outdated packages...")
|
||||||
(let ((packages (cl-sort (cl-copy-list (doom-get-outdated-packages)) #'string-lessp
|
(let ((packages (cl-sort (cl-copy-list (doom-get-outdated-packages)) #'string-lessp
|
||||||
:key #'car)))
|
:key #'car)))
|
||||||
|
@ -555,9 +553,8 @@ calls."
|
||||||
success)))))
|
success)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom//packages-autoremove (&optional auto-accept-p)
|
(defun doom-packages-autoremove (&optional auto-accept-p)
|
||||||
"Interactive command for auto-removing orphaned packages."
|
"Interactive command for auto-removing orphaned packages."
|
||||||
(interactive "P")
|
|
||||||
(print! "Looking for orphaned packages...")
|
(print! "Looking for orphaned packages...")
|
||||||
(let ((packages (doom-get-orphaned-packages)))
|
(let ((packages (doom-get-orphaned-packages)))
|
||||||
(cond ((not packages)
|
(cond ((not packages)
|
||||||
|
@ -609,7 +606,8 @@ calls."
|
||||||
|
|
||||||
;; Replace with Doom variants
|
;; Replace with Doom variants
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(advice-add #'package-autoremove :override #'doom//packages-autoremove)
|
(advice-add #'package-autoremove :override (λ! (doom-packages-autoremove current-prefix-arg)))
|
||||||
;;;###autoload
|
|
||||||
(advice-add #'package-install-selected-packages :override #'doom//packages-install)
|
;;;###autoload
|
||||||
|
(advice-add #'package-install-selected-packages :override (λ! (doom-packages-install current-prefix-arg)))
|
||||||
|
|
||||||
|
|
|
@ -95,7 +95,7 @@ presentations."
|
||||||
(set-frame-font doom-font t t)))
|
(set-frame-font doom-font t t)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom//reload-theme ()
|
(defun doom/reload-theme ()
|
||||||
"Reset the current color theme and fonts."
|
"Reset the current color theme and fonts."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((theme (or (car-safe custom-enabled-themes) doom-theme)))
|
(let ((theme (or (car-safe custom-enabled-themes) doom-theme)))
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
|
|
||||||
(defvar doom-auto-accept (getenv "YES")
|
(defvar doom-auto-accept (getenv "YES")
|
||||||
"If non-nil, Doom will auto-accept any confirmation prompts during batch
|
"If non-nil, Doom will auto-accept any confirmation prompts during batch
|
||||||
commands like `doom//packages-install', `doom//packages-update' and
|
commands like `doom-packages-install', `doom-packages-update' and
|
||||||
`doom//packages-autoremove'.")
|
`doom-packages-autoremove'.")
|
||||||
|
|
||||||
(defconst doom--dispatch-command-alist ())
|
(defconst doom--dispatch-command-alist ())
|
||||||
(defconst doom--dispatch-alias-alist ())
|
(defconst doom--dispatch-alias-alist ())
|
||||||
|
@ -213,21 +213,19 @@ recompile. Run this whenever you:
|
||||||
(string-match-p "[^ \t\n]" (buffer-string))
|
(string-match-p "[^ \t\n]" (buffer-string))
|
||||||
(error "Failed to check working tree in %s" dir)))))
|
(error "Failed to check working tree in %s" dir)))))
|
||||||
|
|
||||||
(defun doom//refresh (&optional force-p)
|
(defun doom-refresh (&optional force-p)
|
||||||
"Ensure Doom is in a working state by checking autoloads and packages, and
|
"Ensure Doom is in a working state by checking autoloads and packages, and
|
||||||
recompiling any changed compiled files. This is the shotgun solution to most
|
recompiling any changed compiled files. This is the shotgun solution to most
|
||||||
problems with doom."
|
problems with doom."
|
||||||
(interactive "P")
|
(doom-reload-doom-autoloads force-p)
|
||||||
(doom//reload-doom-autoloads force-p)
|
|
||||||
(unwind-protect
|
(unwind-protect
|
||||||
(progn (ignore-errors (doom//packages-autoremove doom-auto-accept))
|
(progn (ignore-errors (doom-packages-autoremove doom-auto-accept))
|
||||||
(ignore-errors (doom//packages-install doom-auto-accept)))
|
(ignore-errors (doom-packages-install doom-auto-accept)))
|
||||||
(doom//reload-package-autoloads force-p)
|
(doom-reload-package-autoloads force-p)
|
||||||
(doom//byte-compile nil 'recompile)))
|
(doom-byte-compile nil 'recompile)))
|
||||||
|
|
||||||
(defun doom//upgrade ()
|
(defun doom-upgrade ()
|
||||||
"Upgrade Doom to the latest version non-destructively."
|
"Upgrade Doom to the latest version non-destructively."
|
||||||
(interactive)
|
|
||||||
(require 'vc-git)
|
(require 'vc-git)
|
||||||
(let* ((gitdir (expand-file-name ".git" doom-emacs-dir))
|
(let* ((gitdir (expand-file-name ".git" doom-emacs-dir))
|
||||||
(branch (vc-git--symbolic-ref doom-emacs-dir))
|
(branch (vc-git--symbolic-ref doom-emacs-dir))
|
||||||
|
@ -251,29 +249,28 @@ problems with doom."
|
||||||
(unless (zerop (process-file "git" nil buf nil "fetch" "--tags"
|
(unless (zerop (process-file "git" nil buf nil "fetch" "--tags"
|
||||||
doom-repo-remote branch))
|
doom-repo-remote branch))
|
||||||
(error "Failed to fetch from upstream"))
|
(error "Failed to fetch from upstream"))
|
||||||
(when
|
(let ((current-rev (vc-git-working-revision doom-emacs-dir))
|
||||||
(let ((current-rev (vc-git-working-revision doom-emacs-dir))
|
(rev (string-trim (shell-command-to-string (format "git rev-parse %s/%s" doom-repo-remote branch)))))
|
||||||
(rev (string-trim (shell-command-to-string (format "git rev-parse %s/%s" doom-repo-remote branch)))))
|
(unless rev
|
||||||
(unless rev
|
(error "Couldn't detect Doom's version. Is %s a repo?"
|
||||||
(error "Couldn't detect Doom's version. Is %s a repo?"
|
(abbreviate-file-name doom-emacs-dir)))
|
||||||
(abbreviate-file-name doom-emacs-dir)))
|
(when (equal current-rev rev)
|
||||||
(when (equal current-rev rev)
|
(user-error "Doom is up to date!"))
|
||||||
(user-error "Doom is up to date!"))
|
(message "Updates for Doom are available!\n\n Old revision: %s\n New revision: %s\n"
|
||||||
(message "Updates for Doom are available!\n\n Old revision: %s\n New revision: %s\n"
|
current-rev rev)
|
||||||
current-rev rev)
|
;; TODO Display newsletter diff
|
||||||
;; TODO Display newsletter diff
|
(unless (or doom-auto-accept (y-or-n-p "Proceed?"))
|
||||||
(unless (or doom-auto-accept (y-or-n-p "Proceed?"))
|
(error "Aborted"))
|
||||||
(error "Aborted"))
|
(message "Removing byte-compiled files from your config (if any)")
|
||||||
(message "Removing byte-compiled files from your config (if any)")
|
(doom-clean-byte-compiled-files)
|
||||||
(doom//clean-byte-compiled-files)
|
(unless (zerop (process-file "git" nil buf nil "reset" "--hard"
|
||||||
(unless (zerop (process-file "git" nil buf nil "reset" "--hard"
|
(format "%s/%s" doom-repo-remote branch)))
|
||||||
(format "%s/%s" doom-repo-remote branch)))
|
(error "An error occurred while checking out the latest commit\n\n%s"
|
||||||
(error "An error occurred while checking out the latest commit\n\n%s"
|
(buffer-string)))
|
||||||
(buffer-string)))
|
(unless (equal (vc-git-working-revision doom-emacs-dir) rev)
|
||||||
(unless (equal (vc-git-working-revision doom-emacs-dir) rev)
|
(error "Failed to checkout latest commit.\n\n%s" (buffer-string)))
|
||||||
(error "Failed to checkout latest commit.\n\n%s" (buffer-string)))
|
(doom-refresh 'force)
|
||||||
(doom//refresh 'force)
|
(message "Done! Please restart Emacs for changes to take effect")))
|
||||||
(message "Done! Please restart Emacs for changes to take effect"))))
|
|
||||||
(user-error
|
(user-error
|
||||||
(message "%s Aborting." (error-message-string e)))
|
(message "%s Aborting." (error-message-string e)))
|
||||||
(error
|
(error
|
||||||
|
@ -281,12 +278,11 @@ problems with doom."
|
||||||
(car e)
|
(car e)
|
||||||
(buffer-string))))))))
|
(buffer-string))))))))
|
||||||
|
|
||||||
(defun doom//quickstart ()
|
(defun doom-quickstart ()
|
||||||
"Quickly deploy a private module and Doom.
|
"Quickly deploy a private module and Doom.
|
||||||
|
|
||||||
This deploys a barebones config to `doom-private-dir', installs all missing
|
This deploys a barebones config to `doom-private-dir', installs all missing
|
||||||
packages and regenerates the autoloads file."
|
packages and regenerates the autoloads file."
|
||||||
(interactive)
|
|
||||||
(let ((short-private-dir (abbreviate-file-name doom-private-dir)))
|
(let ((short-private-dir (abbreviate-file-name doom-private-dir)))
|
||||||
(if (file-directory-p doom-private-dir)
|
(if (file-directory-p doom-private-dir)
|
||||||
(print! (yellow "%s directory already exists. Skipping." short-private-dir))
|
(print! (yellow "%s directory already exists. Skipping." short-private-dir))
|
||||||
|
@ -307,9 +303,9 @@ packages and regenerates the autoloads file."
|
||||||
(with-temp-file config-file (insert ""))
|
(with-temp-file config-file (insert ""))
|
||||||
(print! (green "Done!")))))
|
(print! (green "Done!")))))
|
||||||
(print! "Installing plugins")
|
(print! "Installing plugins")
|
||||||
(doom//packages-install)
|
(doom-packages-install)
|
||||||
(print! "Regenerating autoloads files")
|
(print! "Regenerating autoloads files")
|
||||||
(doom//reload-autoloads nil 'force-p)
|
(doom-reload-autoloads nil 'force-p)
|
||||||
(print! (bold (green "\nFinished! Doom is ready to go!\n")))
|
(print! (bold (green "\nFinished! Doom is ready to go!\n")))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(doom-template-insert "QUICKSTART_INTRO")
|
(doom-template-insert "QUICKSTART_INTRO")
|
||||||
|
@ -357,24 +353,22 @@ it exists."
|
||||||
short-name
|
short-name
|
||||||
(car ex) (error-message-string ex))))))
|
(car ex) (error-message-string ex))))))
|
||||||
|
|
||||||
(defun doom//reload-autoloads (&optional file force-p)
|
(defun doom-reload-autoloads (&optional file force-p)
|
||||||
"Reloads FILE (an autoload file), if it needs reloading.
|
"Reloads FILE (an autoload file), if it needs reloading.
|
||||||
|
|
||||||
FILE should be one of `doom-autoload-file' or `doom-package-autoload-file'. If
|
FILE should be one of `doom-autoload-file' or `doom-package-autoload-file'. If
|
||||||
it is nil, it will try to reload both. If FORCE-P (universal argument) do it
|
it is nil, it will try to reload both. If FORCE-P (universal argument) do it
|
||||||
even if it doesn't need reloading!"
|
even if it doesn't need reloading!"
|
||||||
(interactive
|
|
||||||
(list nil current-prefix-arg))
|
|
||||||
(or (null file)
|
(or (null file)
|
||||||
(stringp file)
|
(stringp file)
|
||||||
(signal 'wrong-type-argument (list 'stringp file)))
|
(signal 'wrong-type-argument (list 'stringp file)))
|
||||||
(cond ((equal file doom-autoload-file)
|
(cond ((equal file doom-autoload-file)
|
||||||
(doom//reload-doom-autoloads force-p))
|
(doom-reload-doom-autoloads force-p))
|
||||||
((equal file doom-package-autoload-file)
|
((equal file doom-package-autoload-file)
|
||||||
(doom//reload-package-autoloads force-p))
|
(doom-reload-package-autoloads force-p))
|
||||||
((progn
|
((progn
|
||||||
(doom//reload-doom-autoloads force-p)
|
(doom-reload-doom-autoloads force-p)
|
||||||
(doom//reload-package-autoloads force-p)))))
|
(doom-reload-package-autoloads force-p)))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -493,7 +487,7 @@ even if it doesn't need reloading!"
|
||||||
(when (re-search-forward "^;;\\(;[^\n]*\\| no-byte-compile: t\\)\n" nil t)
|
(when (re-search-forward "^;;\\(;[^\n]*\\| no-byte-compile: t\\)\n" nil t)
|
||||||
(replace-match "" t t)))
|
(replace-match "" t t)))
|
||||||
|
|
||||||
(defun doom//reload-doom-autoloads (&optional force-p)
|
(defun doom-reload-doom-autoloads (&optional force-p)
|
||||||
"Refreshes the autoloads.el file, specified by `doom-autoload-file', if
|
"Refreshes the autoloads.el file, specified by `doom-autoload-file', if
|
||||||
necessary (or if FORCE-P is non-nil).
|
necessary (or if FORCE-P is non-nil).
|
||||||
|
|
||||||
|
@ -503,7 +497,6 @@ Emacs where to find lazy-loaded functions.
|
||||||
|
|
||||||
This should be run whenever your `doom!' block, or a module autoload file, is
|
This should be run whenever your `doom!' block, or a module autoload file, is
|
||||||
modified."
|
modified."
|
||||||
(interactive)
|
|
||||||
(let* ((default-directory doom-emacs-dir)
|
(let* ((default-directory doom-emacs-dir)
|
||||||
(doom-modules (doom-modules))
|
(doom-modules (doom-modules))
|
||||||
(targets
|
(targets
|
||||||
|
@ -538,7 +531,7 @@ modified."
|
||||||
(message "Generating new autoloads.el")
|
(message "Generating new autoloads.el")
|
||||||
(make-directory (file-name-directory doom-autoload-file) t)
|
(make-directory (file-name-directory doom-autoload-file) t)
|
||||||
(with-temp-file doom-autoload-file
|
(with-temp-file doom-autoload-file
|
||||||
(doom--generate-header 'doom//reload-doom-autoloads)
|
(doom--generate-header 'doom-reload-doom-autoloads)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(doom--generate-autoloads (reverse enabled-targets)))
|
(doom--generate-autoloads (reverse enabled-targets)))
|
||||||
;; Replace autoload paths (only for module autoloads) with absolute
|
;; Replace autoload paths (only for module autoloads) with absolute
|
||||||
|
@ -596,7 +589,7 @@ modified."
|
||||||
(goto-char (match-beginning 1))
|
(goto-char (match-beginning 1))
|
||||||
(kill-sexp)))
|
(kill-sexp)))
|
||||||
|
|
||||||
(defun doom//reload-package-autoloads (&optional force-p)
|
(defun doom-reload-package-autoloads (&optional force-p)
|
||||||
"Compiles `doom-package-autoload-file' from the autoloads files of all
|
"Compiles `doom-package-autoload-file' from the autoloads files of all
|
||||||
installed packages. It also caches `load-path', `Info-directory-list',
|
installed packages. It also caches `load-path', `Info-directory-list',
|
||||||
`doom-disabled-packages', `package-activated-list' and `auto-mode-alist'.
|
`doom-disabled-packages', `package-activated-list' and `auto-mode-alist'.
|
||||||
|
@ -605,7 +598,6 @@ Will do nothing if none of your installed packages have been modified. If
|
||||||
FORCE-P (universal argument) is non-nil, regenerate it anyway.
|
FORCE-P (universal argument) is non-nil, regenerate it anyway.
|
||||||
|
|
||||||
This should be run whenever your `doom!' block or update your packages."
|
This should be run whenever your `doom!' block or update your packages."
|
||||||
(interactive)
|
|
||||||
(if (and (not force-p)
|
(if (and (not force-p)
|
||||||
(not doom-emacs-changed-p)
|
(not doom-emacs-changed-p)
|
||||||
(file-exists-p doom-package-autoload-file)
|
(file-exists-p doom-package-autoload-file)
|
||||||
|
@ -620,7 +612,7 @@ This should be run whenever your `doom!' block or update your packages."
|
||||||
(let (case-fold-search)
|
(let (case-fold-search)
|
||||||
(doom-delete-autoloads-file doom-package-autoload-file)
|
(doom-delete-autoloads-file doom-package-autoload-file)
|
||||||
(with-temp-file doom-package-autoload-file
|
(with-temp-file doom-package-autoload-file
|
||||||
(doom--generate-header 'doom//reload-package-autoloads)
|
(doom--generate-header 'doom-reload-package-autoloads)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
;; Cache the important and expensive-to-initialize state here.
|
;; Cache the important and expensive-to-initialize state here.
|
||||||
(doom--generate-var-cache)
|
(doom--generate-var-cache)
|
||||||
|
@ -643,7 +635,7 @@ This should be run whenever your `doom!' block or update your packages."
|
||||||
;; Byte compilation
|
;; Byte compilation
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(defun doom//byte-compile (&optional modules recompile-p)
|
(defun doom-byte-compile (&optional modules recompile-p)
|
||||||
"Byte compiles your emacs configuration.
|
"Byte compiles your emacs configuration.
|
||||||
|
|
||||||
init.el is always byte-compiled by this.
|
init.el is always byte-compiled by this.
|
||||||
|
@ -656,12 +648,10 @@ WARNING: byte-compilation yields marginal gains and makes debugging new issues
|
||||||
difficult. It is recommended you don't use it unless you understand the
|
difficult. It is recommended you don't use it unless you understand the
|
||||||
reprecussions.
|
reprecussions.
|
||||||
|
|
||||||
Use `doom//clean-byte-compiled-files' or `make clean' to reverse
|
Use `doom-clean-byte-compiled-files' or `make clean' to reverse
|
||||||
byte-compilation.
|
byte-compilation.
|
||||||
|
|
||||||
If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
(interactive
|
|
||||||
(list nil current-prefix-arg))
|
|
||||||
(let ((default-directory doom-emacs-dir)
|
(let ((default-directory doom-emacs-dir)
|
||||||
(total-ok 0)
|
(total-ok 0)
|
||||||
(total-fail 0)
|
(total-fail 0)
|
||||||
|
@ -704,8 +694,8 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
(message "Aborting.")
|
(message "Aborting.")
|
||||||
(cl-return-from 'byte-compile)))
|
(cl-return-from 'byte-compile)))
|
||||||
(unless recompile-p
|
(unless recompile-p
|
||||||
(doom//clean-byte-compiled-files)
|
(doom-clean-byte-compiled-files)
|
||||||
(doom//reload-autoloads))
|
(doom-reload-autoloads))
|
||||||
(let (doom-emacs-changed-p
|
(let (doom-emacs-changed-p
|
||||||
noninteractive)
|
noninteractive)
|
||||||
;; But first we must be sure that Doom and your private config have
|
;; But first we must be sure that Doom and your private config have
|
||||||
|
@ -767,13 +757,12 @@ If RECOMPILE-P is non-nil, only recompile out-of-date files."
|
||||||
"There were breaking errors."
|
"There were breaking errors."
|
||||||
(error-message-string ex)
|
(error-message-string ex)
|
||||||
"Reverting changes...")
|
"Reverting changes...")
|
||||||
(quiet! (doom//clean-byte-compiled-files))
|
(quiet! (doom-clean-byte-compiled-files))
|
||||||
(print! (yellow "Finished (nothing was byte-compiled)"))))))))
|
(print! (yellow "Finished (nothing was byte-compiled)"))))))))
|
||||||
|
|
||||||
(defun doom//clean-byte-compiled-files ()
|
(defun doom-clean-byte-compiled-files ()
|
||||||
"Delete all the compiled elc files in your Emacs configuration and private
|
"Delete all the compiled elc files in your Emacs configuration and private
|
||||||
module. This does not include your byte-compiled, third party packages.'"
|
module. This does not include your byte-compiled, third party packages.'"
|
||||||
(interactive)
|
|
||||||
(cl-loop with default-directory = doom-emacs-dir
|
(cl-loop with default-directory = doom-emacs-dir
|
||||||
for path in (append (doom-files-in doom-emacs-dir :match "\\.elc$" :depth 0)
|
for path in (append (doom-files-in doom-emacs-dir :match "\\.elc$" :depth 0)
|
||||||
(doom-files-in doom-private-dir :match "\\.elc$" :depth 1)
|
(doom-files-in doom-private-dir :match "\\.elc$" :depth 1)
|
||||||
|
|
|
@ -6,12 +6,9 @@
|
||||||
;;
|
;;
|
||||||
;; The three key commands are:
|
;; The three key commands are:
|
||||||
;;
|
;;
|
||||||
;; + `bin/doom install` or `doom//packages-install': Installs packages that are
|
;; + `bin/doom install`: Installs packages that are wanted, but not installed.
|
||||||
;; wanted, but not installed.
|
;; + `bin/doom update`: Updates packages that are out-of-date.
|
||||||
;; + `bin/doom update` or `doom//packages-update': Updates packages that are
|
;; + `bin/doom autoremove`: Uninstalls packages that are no longer needed.
|
||||||
;; out-of-date.
|
|
||||||
;; + `bin/doom autoremove` or `doom//packages-autoremove': Uninstalls packages
|
|
||||||
;; that are no longer needed.
|
|
||||||
;;
|
;;
|
||||||
;; This system reads packages.el files located in each activated module (and one
|
;; This system reads packages.el files located in each activated module (and one
|
||||||
;; in `doom-core-dir'). These contain `package!' blocks that tell DOOM what
|
;; in `doom-core-dir'). These contain `package!' blocks that tell DOOM what
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
;;; core/core-tests.el -*- lexical-binding: t; -*-
|
;;; core/core-tests.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(defun doom//run-tests (&optional modules)
|
(defun doom-run-tests (&optional modules)
|
||||||
"Run all loaded tests, specified by MODULES (a list of module cons cells) or
|
"Run all loaded tests, specified by MODULES (a list of module cons cells) or
|
||||||
command line args following a double dash (each arg should be in the
|
command line args following a double dash (each arg should be in the
|
||||||
'module/submodule' format).
|
'module/submodule' format).
|
||||||
|
|
||||||
If neither is available, run all tests in all enabled modules."
|
If neither is available, run all tests in all enabled modules."
|
||||||
(interactive)
|
|
||||||
(let (noninteractive)
|
(let (noninteractive)
|
||||||
;; Core libraries aren't fully loaded in a noninteractive session, so we
|
;; Core libraries aren't fully loaded in a noninteractive session, so we
|
||||||
;; reload it with `noninteractive' set to nil to force them to.
|
;; reload it with `noninteractive' set to nil to force them to.
|
||||||
(quiet! (doom//reload-autoloads))
|
(quiet! (doom-reload-autoloads))
|
||||||
(doom-initialize t))
|
(doom-initialize t))
|
||||||
(let ((target-paths
|
(let ((target-paths
|
||||||
;; Convert targets into a list of string paths, pointing to the root
|
;; Convert targets into a list of string paths, pointing to the root
|
||||||
|
|
|
@ -30,7 +30,7 @@ shorter major mode name in the mode-line. See `doom|set-mode-name'.")
|
||||||
|
|
||||||
(defvar doom-load-theme-hook nil
|
(defvar doom-load-theme-hook nil
|
||||||
"Hook run when the theme (and font) is initialized (or reloaded
|
"Hook run when the theme (and font) is initialized (or reloaded
|
||||||
with `doom//reload-theme').")
|
with `doom/reload-theme').")
|
||||||
|
|
||||||
(defvar doom-before-switch-window-hook nil
|
(defvar doom-before-switch-window-hook nil
|
||||||
"Hook run before `switch-window' or `switch-frame' are called. See
|
"Hook run before `switch-window' or `switch-frame' are called. See
|
||||||
|
@ -578,7 +578,7 @@ frame's window-system, the theme will be reloaded.")
|
||||||
;; out daemon and emacsclient frames.
|
;; out daemon and emacsclient frames.
|
||||||
;;
|
;;
|
||||||
;; There will still be issues with simultaneous gui and terminal (emacsclient)
|
;; There will still be issues with simultaneous gui and terminal (emacsclient)
|
||||||
;; frames, however. There's always `doom//reload-theme' if you need it!
|
;; frames, however. There's always `doom/reload-theme' if you need it!
|
||||||
(defun doom|init-theme-in-frame (frame)
|
(defun doom|init-theme-in-frame (frame)
|
||||||
"Reloads the theme in new daemon or tty frames."
|
"Reloads the theme in new daemon or tty frames."
|
||||||
(when (and (framep frame)
|
(when (and (framep frame)
|
||||||
|
|
|
@ -70,10 +70,10 @@ Use this for files that change often, like cache files.")
|
||||||
XDG directory conventions if ~/.config/doom exists.")
|
XDG directory conventions if ~/.config/doom exists.")
|
||||||
|
|
||||||
(defconst doom-autoload-file (concat doom-local-dir "autoloads.el")
|
(defconst doom-autoload-file (concat doom-local-dir "autoloads.el")
|
||||||
"Where `doom//reload-doom-autoloads' will generate its core autoloads file.")
|
"Where `doom-reload-doom-autoloads' will generate its core autoloads file.")
|
||||||
|
|
||||||
(defconst doom-package-autoload-file (concat doom-local-dir "autoloads.pkg.el")
|
(defconst doom-package-autoload-file (concat doom-local-dir "autoloads.pkg.el")
|
||||||
"Where `doom//reload-package-autoloads' will generate its package.el autoloads
|
"Where `doom-reload-package-autoloads' will generate its package.el autoloads
|
||||||
file.")
|
file.")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
(spy-on 'require)
|
(spy-on 'require)
|
||||||
(spy-on 'load)
|
(spy-on 'load)
|
||||||
(spy-on 'doom//reload-doom-autoloads)
|
(spy-on 'doom-reload-doom-autoloads)
|
||||||
(spy-on 'doom//reload-package-autoloads)
|
(spy-on 'doom-reload-package-autoloads)
|
||||||
(spy-on 'doom-initialize-autoloads)
|
(spy-on 'doom-initialize-autoloads)
|
||||||
(spy-on 'doom-ensure-core-directories)
|
(spy-on 'doom-ensure-core-directories)
|
||||||
(spy-on 'doom-ensure-core-packages)
|
(spy-on 'doom-ensure-core-packages)
|
||||||
|
|
|
@ -628,8 +628,8 @@
|
||||||
:desc "View *Messages*" :n "m" #'view-echo-area-messages
|
:desc "View *Messages*" :n "m" #'view-echo-area-messages
|
||||||
:desc "Describe mode" :n "M" #'describe-mode
|
:desc "Describe mode" :n "M" #'describe-mode
|
||||||
:desc "Toggle profiler" :n "p" #'doom/toggle-profiler
|
:desc "Toggle profiler" :n "p" #'doom/toggle-profiler
|
||||||
:desc "Reload theme" :n "r" #'doom//reload-theme
|
:desc "Reload theme" :n "r" #'doom/reload-theme
|
||||||
:desc "Reload private config" :n "R" #'doom//reload
|
:desc "Reload private config" :n "R" #'doom/reload
|
||||||
:desc "Describe DOOM setting" :n "s" #'doom/describe-setters
|
:desc "Describe DOOM setting" :n "s" #'doom/describe-setters
|
||||||
:desc "Describe variable" :n "v" #'describe-variable
|
:desc "Describe variable" :n "v" #'describe-variable
|
||||||
:desc "Print Doom version" :n "V" #'doom/version
|
:desc "Print Doom version" :n "V" #'doom/version
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
:config
|
:config
|
||||||
;; Reload common faces when reloading doom-themes live
|
;; Reload common faces when reloading doom-themes live
|
||||||
(defun +doom*reload-common (&rest _) (load "doom-themes-common.el" nil t))
|
(defun +doom*reload-common (&rest _) (load "doom-themes-common.el" nil t))
|
||||||
(advice-add #'doom//reload-theme :before #'+doom*reload-common)
|
(advice-add #'doom/reload-theme :before #'+doom*reload-common)
|
||||||
|
|
||||||
;; improve integration w/ org-mode
|
;; improve integration w/ org-mode
|
||||||
(add-hook 'doom-load-theme-hook #'doom-themes-org-config)
|
(add-hook 'doom-load-theme-hook #'doom-themes-org-config)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue