diff --git a/core/autoload/cli.el b/core/autoload/cli.el new file mode 100644 index 000000000..5ab0f66d0 --- /dev/null +++ b/core/autoload/cli.el @@ -0,0 +1,66 @@ +;;; core/autoload/cli.el -*- lexical-binding: t; -*- + +(require 'core-cli) + +(defun doom--run (command &optional yes) + (let ((default-directory doom-emacs-dir) + (doom-auto-accept yes)) + (let ((compilation-buffer-name-function (lambda (_) "*bin/doom*"))) + (compile (format "bin/doom %s" command) t)) + (while compilation-in-progress + (sit-for 1)) + (when (y-or-n-p "Reload Doom config?") + (doom/reload)) + (message "Done"))) + + +;;;###autoload +(defun doom//update (&optional yes) + "TODO" + (interactive "P") + (doom--run "update" yes)) + +;;;###autoload +(defun doom//upgrade (&optional yes) + "TODO" + (interactive "P") + (doom--run "upgrade" yes)) + +;;;###autoload +(defun doom//install (&optional yes) + "TODO" + (interactive "P") + (doom--run "install" yes)) + +;;;###autoload +(defun doom//autoremove (&optional yes) + "TODO" + (interactive "P") + (doom--run "autoremove" yes)) + +;;;###autoload +(defun doom//refresh (&optional yes) + "TODO" + (interactive "P") + (doom--run "refresh" yes)) + +;;;###autoload +(defun doom/reload (&optional force-p) + "Reloads your config. This is experimental! + +If called from a noninteractive session, this will try to communicate with a +live server (if one is found) to tell it to run this function. + +If called from an interactive session, tries to reload autoloads files (if +necessary), reinistalize doom (via `doom-initialize') and reloads your private +init.el and config.el. Then runs `doom-reload-hook'." + (interactive "P") + (require 'core-cli) + (doom-reload-autoloads force-p) + (setq load-path doom-site-load-path) + (let (doom-init-p) + (doom-initialize)) + (with-demoted-errors "PRIVATE CONFIG ERROR: %s" + (doom-initialize-modules 'force)) + (run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook) + (message "Finished!")) diff --git a/core/autoload/help.el b/core/autoload/help.el index c30be5e94..75d4d1a69 100644 --- a/core/autoload/help.el +++ b/core/autoload/help.el @@ -220,24 +220,3 @@ whose car is the list of faces and cadr is the list of overlay faces." "TODO" (interactive) (find-file (expand-file-name "index.org" doom-docs-dir))) - -;;;###autoload -(defun doom/reload (&optional force-p) - "Reloads your config. This is experimental! - -If called from a noninteractive session, this will try to communicate with a -live server (if one is found) to tell it to run this function. - -If called from an interactive session, tries to reload autoloads files (if -necessary), reinistalize doom (via `doom-initialize') and reloads your private -init.el and config.el. Then runs `doom-reload-hook'." - (interactive "P") - (require 'core-cli) - (doom-reload-autoloads force-p) - (setq load-path doom-site-load-path) - (let (doom-init-p) - (doom-initialize)) - (with-demoted-errors "PRIVATE CONFIG ERROR: %s" - (doom-initialize-modules 'force)) - (run-hook-wrapped 'doom-reload-hook #'doom-try-run-hook) - (message "Finished!")) diff --git a/modules/ui/popup/config.el b/modules/ui/popup/config.el index 583ef3122..e2dbf8958 100644 --- a/modules/ui/popup/config.el +++ b/modules/ui/popup/config.el @@ -132,7 +132,9 @@ prevent the popup(s) from messing up the UI (or vice versa)." '(("^\\*" :slot 1 :vslot -1 :select t) ("^ \\*" :slot 1 :vslot -1 :size +popup-shrink-to-fit))) (when (featurep! +defaults) - '(("^\\*Completions" + '(("^\\*bin/doom\\*$" + :vslot 9999 :size 0.75 :quit 'current :select t :ttl 0) + ("^\\*Completions" :slot -1 :vslot -2 :ttl 0) ("^\\*Compil\\(?:ation\\|e-Log\\)" :size 0.3 :ttl 0 :quit t)