Commit graph

17864 commits

Author SHA1 Message Date
Henrik Lissner
0511445339
feat(cli): add :dump pseudo command
And fix a void-variable doom-cli--dump error accidentally introduced in
d231755.

Ref: d231755bdf
2022-06-21 00:32:15 +02:00
Henrik Lissner
19ce459138
fix(cli): module cli.el loader
$DOOMDIR/init.el had to be loaded earlier, so we could read the active
module list. This indirectly fixes an issue where users' literate
configs weren't being tangled on 'doom sync'.

Fix: #6479
2022-06-20 23:44:32 +02:00
Henrik Lissner
fe850934f1
fix(cli): display command list groups in insert order
On 'doom help' or 'doom help --commands'
2022-06-20 23:43:23 +02:00
Henrik Lissner
cfb533043f
fix(cli): add extra package checks
So the doctor doesn't complain about pseudo packages, like revealjs,
which is not actually an Emacs package, we're just using straight.el to
install it for org-re-reveal.
2022-06-20 23:43:23 +02:00
Henrik Lissner
79f1d29722
fix(cli): don't trigger kill hooks on 'doom doctor'
To restrict side-effects in the user's config.
2022-06-20 23:43:23 +02:00
Henrik Lissner
315960b9a8
fix(lib): update doom/upgrade
-y switch was replaced with -!/--force in 6c0b7e1.

Amend: 6c0b7e1530
2022-06-20 23:43:23 +02:00
Henrik Lissner
d231755bdf
refactor(cli): rename struct constructors/copiers
To maintain our namespaces.
2022-06-20 23:43:23 +02:00
Chris Rose
3a7eab38ad
fix: allow :protocol keyword in package!
Co-authored-by: Chris Rose <chrisros@amazon.com>
2022-06-20 19:09:50 +02:00
Henrik Lissner
f350a28db2
revert: fix(rss): fix *rss* workspace doesn't exist
Removed by request.

Ref: #6422
Revert: f178eb6f52
2022-06-20 16:11:02 +02:00
Henrik Lissner
d1472c191e
tweak(cli): be verbose about site files in debug mode
More information for hapless debuggers like me!

Ref: #6473
2022-06-20 13:37:54 +02:00
Henrik Lissner
eb7329d912
fix(org): unbalanced parenthesis
Causing odd org related errors at startup or 'doom doctor'.

Amend: fb1c8eb11d
2022-06-20 03:45:46 +02:00
Henrik Lissner
210381bdcf
fix(lib): autoload format-spec on 27.x
This function wasn't autoloaded until 28, causing void-function errors
if it's used.
2022-06-20 03:02:25 +02:00
Henrik Lissner
343def0b1e
fix(cli): void-function relpath on 'doom compile' 2022-06-20 02:27:23 +02:00
Henrik Lissner
8b93e8b15c
fix(tabs): wrong-type-arg stringp (Git "...") error
Newer versions of project.el changed the return value of
`project-current` to a three-part list, rather than a cons cell.
centaur-tabs expects the old signature and we get a type error.

This advice ensures centaur-tabs works with old or new versions of
project, and is a temporary measure until the issue is resolved
upstream.

Ref: ema2159/centaur-tabs#181
Fix: #6280
2022-06-20 02:07:42 +02:00
Henrik Lissner
fb1c8eb11d
fix(org): lazy loading of org-protocol
First, removal of the old org-protocol advice needed to be updated,
because org-protocol-detect-protocol-server was renamed to
org--protocol-detect-protocol-server upstream.

Second, I only noticed now that our lazy loader for org-protocol wasn't
active until Org was loaded, which was far too late, and meant
org-protocol wasn't working out of the box. This fixes that.
2022-06-20 01:55:21 +02:00
Henrik Lissner
b81e4af66a
fix(cli): deploy git hooks to repo at $PWD, not $EMACSDIR 2022-06-19 23:05:33 +02:00
Henrik Lissner
d002e4c89d
dev(ci): comment out unused CI config
Until 'doom make {docs,codeowners}' are done, they'd throw errors.
2022-06-19 22:51:46 +02:00
Henrik Lissner
12e9b4422f
tweak(cli): show benchmark for doom {build,purge}
These two commands tend to take a while.
2022-06-19 22:51:46 +02:00
Henrik Lissner
ab7f7058f3
docs(cli): show correct command in error message
Before:
  $ doom ci hook commit-msg test
  Error: "doom ci" expected 0 arguments, but got 1

  Usage: doom ci COMMAND [ARGS...]

  See 'doom h[elp] ci' or 'doom ci {-?,--help}' for documentation.

After:
  $ doom ci hook commit-msg test
  Error: ":before doom ci" expected 0 arguments, but got 1

  Usage: doom ci hook commit-msg FILE

  See 'doom h[elp] ci hook commit-msg' or 'doom ci hook commit-msg {-?,--help}' for documentation.
2022-06-19 22:51:46 +02:00
Henrik Lissner
50a0c2ef46
fix(cli): ci.el loader
- :before ci will try to load $REPOROOT/ci.el or $DOOMDIR/ci.el. It
  finds $REPOROOT by calling `git`, but doesn't handle errors. Now it
  does.
- Because &rest was in :before ci's argspec, :before ci * subcommands
  would be inaccessible (not that any exist atm, though).
- Let the user know when it finds the project's ci.el.
2022-06-19 22:49:47 +02:00
Henrik Lissner
7862a9e15d
docs(cli): add more exit! usecases 2022-06-19 22:01:28 +02:00
Henrik Lissner
da74525cbc
tweak(cli): process arguments before executing CLIs 2022-06-19 21:39:17 +02:00
Henrik Lissner
d226946f59
fix(cli): aliases to pseudo commands
To understand what's going on here, understand this: this is a regular
CLI command:

  (defcli! (doom sync) () ...)

And this is a pseudo command:

  (defcli! (:before doom sync) () ...)

If a pseudo command is aliased to another pseudo command:

  (defcli! (:before doom (foo bar baz)) ...)

In which case, ':before doom bar' and ':before doom baz' are aliases for
':before doom foo', there was a bug that cut out the keyword, so in
actuality, ':before doom {bar,baz}' were aliased to 'doom bar'.

This fixes that, and the peculiar issue of 'doom purge' executing 'doom
build' due to this, living in core/cli/packages.el:

  (defcli! (:before (build b purge p)) (&context context)
    (require 'comp nil t)
    (doom-initialize-core-packages))

Ref: https://github.com/doomemacs/doomemacs/issues/4273#issuecomment-1159610824
2022-06-19 21:26:53 +02:00
Henrik Lissner
92a5c28687
feat(rest): add +jq flag
Adds support for setting variables from results using jq expressions.

Ref: https://github.com/pashky/restclient.el
Ref: https://github.com/ljos/jq-mode
Close: #5238
2022-06-19 14:56:04 +02:00
Henrik Lissner
49ef0fa8dd
tweak(cli): improve message when no similar commands found
Rather than display a blank line, let the user know no similar commands
were found.
2022-06-19 13:07:28 +02:00
Henrik Lissner
6eefd4c1df
fix(cli): wrong-type-arg error on unrecognized command
If you type an unrecognized command, you get an "Error: unrecognized
command X" error, then a list of similar commands, followed by a
recommendation to check out 'doom help Y' or 'doom --help Y', where Y is
the nearest recognized parent command. E.g. 'doom ci blah' is an unknown
command, but 'doom ci' is known, therefore Y = 'doom ci'.

This fix ensures that Y is properly resolved.

Amend: 6c0b7e1530
2022-06-19 13:03:28 +02:00
Henrik Lissner
446e1432bc
fix(cli): show full synopsis for pseudo commands
Before:
  $ doom help help
  Usage:  COMMAND [ARGS...]

  TODO

  TODO

After:
  Usage: doom help [-g|--no-global] [--manpage] [--commands]
                   [--synopsis|--subcommands|--similar|--envvars|--postamble] [--]
                   COMMAND [ARGS...]

  Show documentation for a Doom CLI command.

  OPTIONS:
    -g, --no-global
      Hide global options.

    --manpage
      Generate in manpage format.

    --commands
      List all known commands.

    --synopsis, --subcommands, --similar, --envvars, --postamble
      Show only the specified sections..

Amend: 6c0b7e1530
2022-06-19 12:50:21 +02:00
Henrik Lissner
8d881f44c4
fix(cli): various errors in 'doom help'
- Wrong number of arguments: #<subr max> 0
- Symbol's value as variable is void: localonly?

Amend: 6c0b7e1530
2022-06-19 12:50:21 +02:00
Henrik Lissner
42d84e7e21
fix(cli): possible divide-by-zero when calculating similarity
If given two empty strings (which doesn't happens anywhere in the
codebase atm, but just in case).
2022-06-19 12:50:17 +02:00
Henrik Lissner
979495cf33
fix(cli): void-function doom-clean-byte-compiled-files on 'doom upgrade'
This function was renamed in 6c0b7e1.

Amend: 6c0b7e1530
2022-06-19 12:08:24 +02:00
Henrik Lissner
fb7f4c6cbe
fix(cli): time out if native-comp hangs
Some packages (primarily vterm, evil-collection, and with-editor) end up
hanging their native compilation process. In vterm's case it's because
it invisibly prompts to compile its module then waits forever for user
input that'll never come. I haven't figured out why it happens for the
others though.

In any case, since the workaround is to simply kill these processes and
carry on, I added this timeout mechanism to do it for you (timing out
after 30s of no movement). A more elegant solution will have to wait
until the rewrite of our package manager.

Fix: #5592
2022-06-19 12:01:52 +02:00
Henrik Lissner
837f404fbc
fix(lib): update doom/reload & doom/reload-autoloads
To reflect changes to bootstrapper made in 1402db5.

Amend: 1402db5129
Fix: #6470
2022-06-19 11:48:17 +02:00
Henrik Lissner
33d9e741b0
refactor(ci): move .github/ci.el to /ci.el
So 'doom ci' picks up on this project's CI settings.
2022-06-19 03:18:57 +02:00
Henrik Lissner
f913ff07b3
fix(cli): void-function doom-packages-install error on 'doom install' 2022-06-19 03:00:10 +02:00
Henrik Lissner
074f63ff31
fix(cli): ignore invalid __DOOMGEOM value 2022-06-19 02:44:00 +02:00
Henrik Lissner
beef0aef02
fix(cli): split tput call into two separate calls
This fixes an issue where, on some systems, `tput cols lines` does not
produce "N\nM" (where N = number of columns in the terminal and M =
number of lines), and instead produces "N\n", causing parsing errors.
2022-06-19 02:39:22 +02:00
Henrik Lissner
8816508d6c
fix(cli): update 'doom upgrade'
To reflect changes made in 6c0b7e1.

Amend: 6c0b7e1530
2022-06-19 02:34:23 +02:00
Henrik Lissner
f4e7e8be56
fix(cli): type error when __DOOMGEOM is empty 2022-06-19 02:20:34 +02:00
Henrik Lissner
09ddac1d7a
feat(cli): resolve EMACSDIR to doomscript's parent directory
If no EMACSDIR is given, assume ../ is the Emacs config we want to
operate out of, taking after bin/doom.

And use bash. This script was designed for the convenience of other
scripters on unix systems, so it can afford a small hit to portability.
2022-06-19 02:20:34 +02:00
Henrik Lissner
74f3c1d11c
fix(cli): doom {compile,clean} errors
- An improper autoload was preventing 'doom clean' from being
  recognized.
- 'doom compile' hadn't been updated to reflect changes introduced
  recently in 1402db5.

Amend: 6c0b7e1530
Ref: 1402db5129
2022-06-19 01:39:32 +02:00
Henrik Lissner
6963b784cc
refactor(cli): extract doom/info renderer
Into doom-info-string, which will wrap its contents to a given column
using the new print library.
2022-06-19 01:31:56 +02:00
Henrik Lissner
23678c52fe
refactor(lib): tidy up doom/version 2022-06-19 01:31:38 +02:00
Henrik Lissner
498d88ba9b
feat(cli): add -j/--jobs NUM options
To 'doom sync', 'doom upgrade', and 'doom build'. So users can decide
whether they want Doom 100%'ing their CPUs.

After 3.0, many of these commands will be merged, so a little code
duplication is fine for now.
2022-06-19 01:29:40 +02:00
Henrik Lissner
89e02c1c2b
fix(cli): wrong-number-of-args error on 'doom upgrade'
When I added call! to the DSL, I forgot to update doom-cli-call calls.
This should quell these errors when running 'doom upgrade':

  x There was an unexpected runtime error
    Message: Wrong number of arguments
    Details: (((cl-struct-doom-cli-context-tags cl-struct-doom-cli-option-...
    Backtrace:
      (doom-cli-call ("doom" "sync" "-u"))
      (cond (packages\? (doom-cli-call sync-cmd) (doom-print (doom-print-...

Amend: 6c0b7e1530
2022-06-19 01:17:25 +02:00
Henrik Lissner
647abad97d
fix(cli): void-variable ansi-color--control-seq-fragment-regexp
This variable wasn't introduced until Emacs 29.

Amend: 6c0b7e1530
2022-06-19 01:15:02 +02:00
Henrik Lissner
2e9997a3d5
fix(cli): void-variable doom-repo-* errors on 'doom upgrade'
Amend: 6c0b7e1530
2022-06-19 01:10:54 +02:00
Henrik Lissner
d5db9076af
fix(cli): wrong-number-of-args error on 'doom sync'
Amend: 6c0b7e1530
2022-06-19 01:07:01 +02:00
Henrik Lissner
81a52402b2
fix(cli): void-variable packages-only?
Amend: 6c0b7e1530
2022-06-19 01:05:26 +02:00
Henrik Lissner
58561ba278
dev: update workflows
- Remove defunct test workflow (will be replaced later).
- Pass secrets into add-to-project so it can see our github token.
2022-06-19 01:01:35 +02:00
Henrik Lissner
3633c19df8
docs: recommend Emacs 28.1 instead of 27.2 2022-06-18 23:53:12 +02:00