From 4dc42de9e3cdbe24ffe04ebcb8af11f3d7961b27 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 28 Jul 2019 01:32:16 +0200 Subject: [PATCH] def-command! -> defcli! And def-command-group! -> defcligroup!, to match our new convention for naming definer macros. --- core/cli/autoloads.el | 2 +- core/cli/byte-compile.el | 6 +++--- core/cli/debug.el | 4 ++-- core/cli/env.el | 2 +- core/cli/install.el | 4 ++-- core/cli/packages.el | 8 ++++---- core/cli/patch-macos.el | 2 +- core/cli/test.el | 2 +- core/cli/upgrade.el | 2 +- core/core-cli.el | 18 +++++++++--------- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/core/cli/autoloads.el b/core/cli/autoloads.el index a0ddb7508..6fefc264f 100644 --- a/core/cli/autoloads.el +++ b/core/cli/autoloads.el @@ -17,7 +17,7 @@ one wants that.") ;; ;;; Commands -(def-command! (autoloads a) () +(defcli! (autoloads a) () "Regenerates Doom's autoloads files. It scans and reads autoload cookies (;;;###autoload) in core/autoload/*.el, diff --git a/core/cli/byte-compile.el b/core/cli/byte-compile.el index cc79fbdc6..f83b10ff2 100644 --- a/core/cli/byte-compile.el +++ b/core/cli/byte-compile.el @@ -1,6 +1,6 @@ ;;; core/cli/byte-compile.el -*- lexical-binding: t; -*- -(def-command! (compile c) (&rest targets) +(defcli! (compile c) (&rest targets) "Byte-compiles your config or selected modules. compile [TARGETS...] @@ -12,11 +12,11 @@ and your private config files, respectively. To recompile your packages, use 'doom rebuild' instead." (doom-byte-compile targets)) -(def-command! (recompile rc) (&rest targets) +(defcli! (recompile rc) (&rest targets) "Re-byte-compiles outdated *.elc files." (doom-byte-compile targets 'recompile)) -(def-command! clean () +(defcli! clean () "Delete all *.elc files." (doom-clean-byte-compiled-files)) diff --git a/core/cli/debug.el b/core/cli/debug.el index 8693f7f64..278140fdc 100644 --- a/core/cli/debug.el +++ b/core/cli/debug.el @@ -6,7 +6,7 @@ ;; ;;; Commands -(def-command! info (&optional format) +(defcli! info (&optional format) "Output system info in markdown for bug reports. Will print in the following formats: @@ -32,7 +32,7 @@ If no arguments are given, --raw is assumed." format))) nil) -(def-command! (version v) () +(defcli! (version v) () "Reports the version of Doom and Emacs." (doom/version) nil) diff --git a/core/cli/env.el b/core/cli/env.el index d144f63c4..67eb448ca 100644 --- a/core/cli/env.el +++ b/core/cli/env.el @@ -1,6 +1,6 @@ ;;; core/cli/env.el -*- lexical-binding: t; -*- -(def-command! env (&rest args) +(defcli! env (&rest args) "Regenerates your envvars file. doom env [-c|--clear] diff --git a/core/cli/install.el b/core/cli/install.el index b5d5e610f..727b6186e 100644 --- a/core/cli/install.el +++ b/core/cli/install.el @@ -1,13 +1,13 @@ ;;; core/cli/install.el -*- lexical-binding: t; -*- -(def-command! quickstart (&rest args) ; DEPRECATED +(defcli! quickstart (&rest args) ; DEPRECATED "This is a deprecated alias for 'doom install'. See 'doom help install' instead." :hidden t (apply #'doom-cli-install args)) -(def-command! (install i) (&rest args) +(defcli! (install i) (&rest args) "A wizard for installing Doom for the first time. This command does the following: diff --git a/core/cli/packages.el b/core/cli/packages.el index 728ba45a2..d934ec6a5 100644 --- a/core/cli/packages.el +++ b/core/cli/packages.el @@ -12,7 +12,7 @@ ;; ;;; Dispatchers -(def-command! (update u) () +(defcli! (update u) () "Updates packages. This excludes packages whose `package!' declaration contains a non-nil :freeze @@ -21,7 +21,7 @@ or :ignore property." (straight-check-all) (doom-packages-update doom-auto-accept))) -(def-command! (rebuild b) (&rest args) +(defcli! (rebuild b) (&rest args) "Rebuilds all installed packages. This ensures that all needed files are symlinked from their package repo and @@ -29,7 +29,7 @@ their elisp files are byte-compiled." (doom--ensure-autoloads-while (doom-packages-rebuild doom-auto-accept (member "-f" args)))) -(def-command! (purge p) (&rest args) +(defcli! (purge p) (&rest args) "Deletes any unused packages and repos." (doom--ensure-autoloads-while (straight-check-all) @@ -37,7 +37,7 @@ their elisp files are byte-compiled." (member "-f" args) doom-auto-accept))) -;; (def-command! rollback () ; TODO rollback +;; (defcli! rollback () ; TODO rollback ;; "" ;; (user-error "Not implemented yet, sorry!")) diff --git a/core/cli/patch-macos.el b/core/cli/patch-macos.el index aa6c0f271..4e1816398 100644 --- a/core/cli/patch-macos.el +++ b/core/cli/patch-macos.el @@ -1,6 +1,6 @@ ;;; core/cli/patch-macos.el -*- lexical-binding: t; -*- -(def-command! patch-macos () ; DEPRECATED +(defcli! patch-macos () ; DEPRECATED "Patches Emacs.app to respect your shell environment. WARNING: This command is deprecated. Use 'doom env' instead. diff --git a/core/cli/test.el b/core/cli/test.el index 2f2b5a3d7..15bf44059 100644 --- a/core/cli/test.el +++ b/core/cli/test.el @@ -1,6 +1,6 @@ ;;; core/cli/test.el -*- lexical-binding: t; -*- -(def-command! test () +(defcli! test () "Run Doom unit tests.") diff --git a/core/cli/upgrade.el b/core/cli/upgrade.el index 14e725889..ab22e015c 100644 --- a/core/cli/upgrade.el +++ b/core/cli/upgrade.el @@ -1,6 +1,6 @@ ;;; core/cli/upgrade.el -*- lexical-binding: t; -*- -(def-command! (upgrade up) () +(defcli! (upgrade up) () "Updates Doom and packages. This requires that ~/.emacs.d is a git repo, and is the equivalent of the diff --git a/core/core-cli.el b/core/core-cli.el index 99dd6a373..f82977aaa 100644 --- a/core/core-cli.el +++ b/core/core-cli.el @@ -114,14 +114,14 @@ If SHOW-HELP is non-nil, show the documentation for said dispatcher." (user-error "I don't understand 'doom %s %s'\n\nRun 'doom help' to see what I do understand." cmd (string-join args " ")))) (run-hooks 'doom-cli-post-error-execute-hook)))))) -(defmacro def-command-group! (name docstring &rest body) +(defmacro defcligroup! (name docstring &rest body) "TODO" (declare (indent defun) (doc-string 2)) `(let ((doom--cli-group ,name)) (puthash doom--cli-group ,docstring doom--cli-groups) ,@body)) -(defmacro def-command! (names arglist docstring &rest body) +(defmacro defcli! (names arglist docstring &rest body) "Define a dispatcher command. COMMAND is a symbol or a list of symbols representing the aliases for this command. DESC is a string description. The first line should be short (under 60 letters), as it will be displayed for @@ -151,7 +151,7 @@ BODY will be run when this dispatcher is called." ;;; Dispatch commands ;; Load all of our subcommands -(def-command! (refresh re) (&rest args) +(defcli! (refresh re) (&rest args) "Ensure Doom is properly set up. This is the equivalent of running autoremove, install, autoloads, then @@ -188,9 +188,9 @@ stale." ;; Load all of our subcommands (load! "cli/install") -(def-command-group! "Diagnostics" +(defcligroup! "Diagnostics" "For troubleshooting and diagnostics" - (def-command! (doctor doc) () + (defcli! (doctor doc) () "Checks for issues with your environment & Doom config. Use the doctor to diagnose common problems or list missing dependencies in @@ -199,7 +199,7 @@ enabled modules.") (load! "cli/debug") (load! "cli/test")) -(def-command-group! "Maintenance" +(defcligroup! "Maintenance" "For managing your config and packages" (load! "cli/env") (load! "cli/upgrade") @@ -207,13 +207,13 @@ enabled modules.") (load! "cli/autoloads") (load! "cli/patch-macos")) -(def-command-group! "Byte compilation" +(defcligroup! "Byte compilation" "For byte-compiling Doom and your config" (load! "cli/byte-compile")) -(def-command-group! "Utilities" +(defcligroup! "Utilities" "Conveniences for interacting with Doom externally" - (def-command! run () + (defcli! run () "Run Doom Emacs from bin/doom's parent directory. All arguments are passed on to Emacs (except for -p and -e).