Commit graph

17443 commits

Author SHA1 Message Date
Henrik Lissner
6d0639d101
fix(lib): avoid doom-load-session on restart if not in Doom
If for some reason you restart into another config (or startup fails for
one reason or another), don't call doom-load-session and break things.
2022-06-21 23:33:07 +02:00
Henrik Lissner
d014a7ae8b
docs(emacs-lisp): add fn!/lambda! to ToC & tweak header-args 2022-06-21 23:32:02 +02:00
Henrik Lissner
90a6bdb751
nit(cli): update comments wrt deferring site-lisp and -Q
Ref: 3b3c008b1b (commitcomment-76653206)
2022-06-21 23:31:16 +02:00
Henrik Lissner
66d06261aa
perf(lib): factor seq out of fn! & bake in lookup table
A little more time and space gained by cutting out seq entirely and
pre-generating the argument lookup table. At least, in uncompiled use
cases.

The original implementation used regexp to lookup arguments, which
was (relatively) expensive. By comparison, using `assq` is *much*
faster, especially for datasets this small; and more so when I get
around to byte-compiling Doom's core (assq has its own byte-compiler
opcode).
2022-06-21 23:27:19 +02:00
Henrik Lissner
1583db5983
fix(lib): void-variable x error in fn!
Amend: 72a8485d77
2022-06-21 23:01:13 +02:00
Henrik Lissner
5519c030ff
fix(cli): -!/--force being ignored
Forgot to adapt the old code to use doom-cli-context struct!

Fix: #6485
2022-06-21 23:00:00 +02:00
Henrik Lissner
72a8485d77
perf(lib): optimize fn! macro
- Reduces allocations by avoiding copies produced by reverse and seq,
  and by avoiding a closure.
- Reduces runtime by avoiding the overhead of seq's generics.
2022-06-21 22:51:45 +02:00
Henrik Lissner
3b3c008b1b
fix(cli): site file loader
I had missed the fact that -Q implies not only
--no-site-file (intended), but --no-site-lisp (unintended). Without the
latter, no site-lisp directory is left in load-path, and any attempt to
load it after-the-fact (which I do in core-cli.el) will fail. Thanks to
@yamanq for noticing this!

Fix: #6473
Fix: #4198
Co-authored-by: Yaman Qalieh <yamanq@users.noreply.github.com>
2022-06-21 22:48:43 +02:00
Henrik Lissner
681d40ab58
refactor(lib): use feature checks for backports
Instead of imprecise version checks.

Fix: #6489
2022-06-21 21:29:08 +02:00
Henrik Lissner
00c75eddf8
docs(emacs-lisp): add fn! & lambda! demos 2022-06-21 21:29:08 +02:00
Henrik Lissner
23feb482e9
refactor!(lib): rename fn!->lambda! & fn!!->fn!
BREAKING CHANGE: This renames the fn! macro to lambda! and fn!! to fn!.
I hadn't put much thought into their names when they were added, but now
that they're seeing more use, I've reconsidered.

The reasoning is (and I'll refer to them by their new names):

- If you're using fn!, you care more about the syntax's brevity, than if
  you were using lambda!, so I wanted fn! to have the (even if slightly)
  shorter name.
- lambda! decorates native lambda (with cl-function). Its old name
  did not suggest that connection like other !-macros in Doom's library
  do.
- Their old names implied the two macros were somehow related or that
  one decorated the other. They aren't and don't.
2022-06-21 21:29:08 +02:00
Ellis Kenyő
ca73a689ab feat(fsharp): add ob-fsharp
Add org-babel support for F#
2022-06-21 20:27:50 +02:00
Henrik Lissner
1f4b9b73fc
fix(org): org-download-delete and [[download:...]] links
org-download-delete doesn't accommodate a non-standard value for
org-download-link-format. Now it does.

Close: #6202
Co-authored-by: zrquan <zrquan@users.noreply.github.com>
2022-06-21 18:46:26 +02:00
Henrik Lissner
7ca50e0ce8
feat(default): bind 'SPC b y' to yank whole buffer
Evil may not always be available in all buffers, and in line with the
filepath yank commands on SPC f y/Y, I thought this command could be
useful. However, I omitted a "replace buffer with paste" command because
in any editing context, evil should be available, in which case it'd be
redundant with `vigp` (or yig for yanking the buffer).

Close: #5281
Co-authored-by: Alex Palaistras <deuill@users.noreply.github.com>
2022-06-21 18:46:25 +02:00
Henrik Lissner
ec2062f517
feat(macos): add 'open in new iTerm window' command
Plus keybinds on '<leader> o I'.

Close: #6318
Co-authored-by: brorbw <brorbw@users.noreply.github.com>
2022-06-21 18:46:25 +02:00
Brian Christian
db3ca52ed6 fix(org): wrong arg type when leaving present mode
When leaving org-tree-slide-mode, the window fringes are reset
fringe-mode has multiple possible types, including cons cell,
which cannot be passed directly to set-window-fringes
2022-06-21 18:31:59 +02:00
Henrik Lissner
b63b209dd3
fix(cli): force less to process ansi codes
I'm not certain how portable -r is for less. Fingers crossed!

Fix: #6488
2022-06-21 16:32:19 +02:00
Henrik Lissner
9f2d6262e5
refactor(cli): return unresolved CLIs from doom-cli-find
'doom help' is aliased to the pseudo command ':help'. (doom-cli-find
'("doom" "help")) would return a list of all CLIs that are pertinent to
'doom help's execution, but it resolves aliases, making it unclear to
recipients of this list what the initial command was.

This requires callers resolve the CLIs themselves, but at least now the
user has the choice.
2022-06-21 14:44:26 +02:00
Henrik Lissner
23ee89ec08
tweak(lib): advise run-hooks & improve feedback on debug mode 2022-06-21 14:41:21 +02:00
Henrik Lissner
9d1df5f298
nit: minor refactors & comment/docstring revisions 2022-06-21 14:40:15 +02:00
Henrik Lissner
773122f1ec
fix(python): syntax highlighting in 28.1
Python syntax highlighting was broken in the 28.1 release.

Close: #6414
Co-authored-by: dani84bs <dani84bs@users.noreply.github.com>
2022-06-21 14:32:13 +02:00
Henrik Lissner
d6d1e600c0
fix(org): org-protocol not triggering for its uris
A more elegant solution will have to wait until the CLI rewrite (where
modules can supply patches for its packages, then I could hoist
org-protocol-check-filename-for-protocol into the autoloads file using
autoload cookie magic).

Fix: #6481
Fix: #5997
2022-06-21 03:04:28 +02:00
Henrik Lissner
b0b727824a
feat(cli): allow docs to use %c/%p format specs
And replace magic section SYNOPSIS with EXAMPLES.
2022-06-21 02:08:19 +02:00
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