Commit graph

17629 commits

Author SHA1 Message Date
Henrik Lissner
cd8fb0059d
fix(cli): validation for regexp arguments
string-match-p throws an error if given an invalid regexp, which is what
we *should* be testing for, not its return value (which should be
ignored), but this wasn't the case before this commit.

Fix: #6534
2022-07-05 14:15:06 +02:00
Henrik Lissner
acae9f9acb
bump: :tools lsp
emacs-lsp/lsp-mode@6b6afc00de -> emacs-lsp/lsp-mode@3fa645c039
joaotavora/eglot@e835996e16 -> joaotavora/eglot@bd970be047

- There are multiple issues in the lsp-mode
  repo (emacs-lsp/lsp-mode#2722), lsp-julia repo (gdkrmr/lsp-julia#23
  and gdkrmr/lsp-julia#35), and the LanguageServer.jl
  repo (julia-vscode/LanguageServer.jl#844) about crashes of the Julia
  LSP with lsp-mode due to errors caused by the folding capabilities
  announced by the client. One can work around these issues by enabling
  folding (see gdkrmr/lsp-julia#23) but that is only a hack and does not
  fix the underlying issue. The problem is caused by a violation of the
  LSP specs in lsp-mode which was fixed in emacs-lsp/lsp-mode#3593. The
  PR updates lsp-mode to the latest commit on the master branch which
  contains this fix (and some other unrelated fixes, CI passes
  successfully again), and hence the workaround for lsp-julia can be
  removed.

Ref: emacs-lsp/lsp-mode#3593
Ref: emacs-lsp/lsp-mode#2722
Ref: gdkrmr/lsp-julia#35
Ref: gdkrmr/lsp-julia#23
Ref: julia-vscode/LanguageServer.jl#844
Close: #6516
Co-authored-by: devmotion <devmotion@users.noreply.github.com>
2022-07-05 01:35:06 +02:00
Henrik Lissner
e4a1e4c909
fix(rss): *rss* workspace doesn't exist error
Co-authored-by: Johnson Liu <buyandrep@gmail.com>
2022-07-04 21:51:46 +02:00
Henrik Lissner
e35cc0dfe7
release(modules): 22.07.0-dev
Ref: 2b39e41368
2022-07-04 21:12:13 +02:00
Henrik Lissner
94a4a7a58b
fix(cli): display global options in --help output
Global options were omitted in help output for subcommands before this
fix. This caused #6533, where the user was unable to find the correct
option to suppress prompts because 'doom upgrade --help' would not show
--force/-!, but 'doom --help' would. Still, it's unreasonable to expect
the user to know this beforehand.

Ref: #6533
2022-07-04 18:44:01 +02:00
Henrik Lissner
38a3a50951
fix(cli): void-function always
`always` was added in Emacs 28 and is unavailable to 27.x users, which
is unacceptable while Doom supports 27.x.

Fix: #6532
Amend: 74cc541597
2022-07-04 18:37:05 +02:00
Henrik Lissner
6cb2c6e962
fix(cli): recognize global options for pseudo CLIs
The global options (like --debug and --pager) weren't recognized for
pseudo command like :help and :version (in particular, rendering --pager
ineffective).

Fix: #6526
2022-07-04 02:58:17 +02:00
Henrik Lissner
af4c18e283
fix(cli): recognize command argument for --pager
--pager incorrectly expected a boolean argument, when it should accept
any arbitrary pager command (set to a blank string to disable the
pager).

Ref: #6526
2022-07-04 02:58:17 +02:00
Henrik Lissner
442d607ec0
fix: remove outdated uses of user-emacs-directory
Doom changes user-emacs-directory (see 46844b5 for explanation), so
doom-emacs-dir should be used to refer to your $EMACSDIR instead.

Fix: #6530
Ref: 46844b55de
2022-07-04 02:58:11 +02:00
Henrik Lissner
5a98d59afc
perf(evil): lazy load evil-collection-shortdoc
Another package that Emacs loads eagerly at startup, that ends up
pulling in evil-collection et co.
2022-07-04 02:38:10 +02:00
Henrik Lissner
7d0d90ec50
revert: refactor(lib): remove doom-apply-ansi-color-to-compilation-buffer-h
ansi-color-compilation-filter wasn't introduced until Emacs 28, so this
removal was too hasty, but should be reconsidered when we drop 27.x
support.

Fix: #6515
Revert: 2f7171bf8a
2022-06-29 18:14:21 +02:00
Henrik Lissner
cbc3c0860e
fix(vertico): unrecognized keyword :function error
Due to upstream change to consult-async-split-styles-alist.

Ref: minad/consult@dbe48621f3
2022-06-29 18:14:21 +02:00
Henrik Lissner
14b2395424
refactor: remove unused core variables
doom-debug-p and doom-interactive-p have always been intentionally
redundant, because changing the variables they replaced had other
side-effects, which made writing tests for them difficult. Since our
new (yet unpublished) tests lean heavily toward integration testing more
than unit testing, this becomes an implementation detail.

And doom-init-p's only use was refactor out at some point in the past,
so it's no longer used.

Also done to reduce Doom's footprint, in general.
2022-06-29 18:14:20 +02:00
Henrik Lissner
74cc541597
refactor(literate): DRY tangling
And remove unused cache file.

Ref: #6281
2022-06-29 18:14:20 +02:00
Álan Crístoffer
c2f8476c86
fix(macos): void-variable newwindow? error
Amend: ec2062f517
2022-06-29 18:12:43 +02:00
Yaman Qalieh
bc32e2ec4c
tweak(mu4e): increase human-date to fit full time
Messages from the current day do not fit with the current width since
they are formatted as times (Ex: "05:17:23 PM"). The increase to 12
matches the mu4e defaults.

Amend: d1ba626a2a
2022-06-28 00:06:05 +02:00
Dominic Martinez
839970c2de docs(mu4e): fix incorrect variable name in snippet
The variable name for toggling org-msg by default was changed in commit
6118ad5c12, leading to the provided
snippet not actually disabling org-msg.
2022-06-28 00:04:49 +02:00
Ellis Kenyő
facab56a5c
bump: :lang fsharp
fsharp/emacs-fsharp-mode@b3aa4c53fc -> fsharp/emacs-fsharp-mode@c1e58c61f9

- Fix issue causing the inferior-buffer to block when adding nuget
  packages.
2022-06-28 00:04:19 +02:00
Henrik Lissner
a570ffe16c
fix(org): end-of-file error while parsing +present
Ref: db3ca52ed6 (commitcomment-76886620)
2022-06-24 12:25:44 +02:00
4shen0ne
1e6d5c3f65
feat(dired): add +dirvish option
Fix: #6397
2022-06-23 13:47:22 +02:00
TEC
8df91f0b33 feat(literate): add async config tangling 2022-06-23 03:13:55 +02:00
Henrik Lissner
a65e97bf2c
fix(cli): return *all* aliases from doom-cli-aliases
Now it walks the command tree breadth-first to collect *all* aliases
that lead to the given command.
2022-06-22 23:04:59 +02:00
Henrik Lissner
4dcfc37199
nit(cli): clarify comments in bin/doomscript 2022-06-22 23:04:59 +02:00
Henrik Lissner
d2fbe6a0c9
fix(cli): restore doom {refresh,re} alias
Amend: 6c0b7e1530
2022-06-22 23:04:58 +02:00
Henrik Lissner
001065ba42
refactor(cli): minor refactors & allow flychecker in CLIs
- Add comments to doom-cli-context-parse.
- Simplify/inline code here and there.
- Remove sacrifice to appease byte-compiler.

Thanks to a346928 there's no need to appease the byte-compiler with this
eval-when-compile hackery.

Ref: a34692826f18
2022-06-22 23:04:54 +02:00
Henrik Lissner
e651547abb
fix(cli): &rest not consuming rest of arguments
An edge case that occurs when no options are supplied to make arguments
non-null.
2022-06-22 23:04:14 +02:00
Henrik Lissner
2aca862187
fix(cli): prevent oversized error data spam
A backtrace with a sufficiently large object (especially with circular
references) could unhelpfully flood the screen.
2022-06-22 23:04:14 +02:00
Henrik Lissner
2660fcce25
fix(cli): not printing straight log after it errors
This regression was introduced in 6c0b7e1, preventing the debugger from
printing straight.el's process log when a straight.el error occurs.
Instead, it would print a less-than-helpful backtrace.

Amend: 6c0b7e1530
2022-06-22 23:04:14 +02:00
Henrik Lissner
666cc1fda7
refactor(cli): remove :stub, :obsolete, :deprecated, :since
I've removed these CLI properties because they were either
unused (:deprecated and :since) or poorly implemented (:stub and
:obsolete). And I'd rather have fewer magical properties, and instead
delegate these roles to the defobsolete! and (new) defstub!  macros.
Also, in the future, the help API will ascertain :since dynamically, so
it won't be very useful.

In summary:
- Use defstub! instead of :stub
- Use defobsolete! instead of :obsolete or :deprecated
- This removes the doom-cli-deprecated-error type (it's not really an
  error to begin with).
- Removes :stub, :obsolete, :deprecated, and :since
2022-06-22 23:04:14 +02:00
Henrik Lissner
a4aab45656
fix(emacs-lisp): flycheck false positives in Doom configs 2022-06-22 23:04:00 +02:00
Henrik Lissner
e4aa07f811
feat(cli): record aliases in doom-cli-context-path
doom-cli-context-path stores the path taken to get to the current
command. For example, given:

  (defcli! (doom boop) () ...)
  (defcli! (doom baz) () (call! '(boop)))
  (defalias! (doom bar) (doom baz))
  (defalias! (doom foo) (doom bar))
  (run! "doom" "foo")

Then the doom-cli-context-path by 'doom boop' will be:

Before this commit: ((doom baz))
After this commit:  ((doom baz) (doom bar) (doom foo))
2022-06-22 20:35:52 +02:00
Henrik Lissner
c06040338a
fix(lsp,tree-sitter): void-function lsp!/tree-sitter! errors
These are autodefs, meaning they should be defined whether or not the
containing module is enabled, but they should no-op when it's disabled,
by defining a no-op macro with the same name. However, lsp! and
tree-sitter! are meant to be used as hooks, and you can't use macros as
hooks, so you get void-function errors when they are used as such.

This ensures they are properly defined as no-op functions in those
cases. I.e.

  ;;;###autodef FORM

FORM is used instead of a no-op macro if the parent module is disabled.
2022-06-22 20:35:52 +02:00
Henrik Lissner
23b289b9a5
feat(cli): fall back to :docs for docstring
Also allows for a dynamically generated docstring. Careful though, it's
evaluated when `defcli!` is evaluated, not when the CLI is executed.
2022-06-22 20:35:17 +02:00
Henrik Lissner
209092c578
refactor(cli): don't reboot bin/doom on --pager
Also adds comments to explain why we're rebooting (or not) for these
settings.
2022-06-22 11:48:11 +02:00
Henrik Lissner
f0a11da072
tweak(cli): less verbosity on -!/--force
The notice will still be logged, but let's not potentially ruin piped
output with unneeded noise.
2022-06-22 11:42:25 +02:00
Henrik Lissner
834ff3ea85
fix(cli): autoloaded clis aliased to wrong commands
I use a shortcut like this to autoload multiple (different) CLIs living
in the same file:

  (defautoload! ((foo bar baz)) "file")

However, this creates premature aliases between autoloaded CLIs. When
'baz' is invoked, instead of loading "file", it resolves to 'foo'
first *then* loads it, causing 'foo' to be executed instead of 'baz'.
This commit fixes that.

Also, minor refactor: I removed the plist argument from a
doom-cli-command-normalize call because it wasn't needed or useful to
the consumer of its return value.

Amend: d226946f59
2022-06-22 02:27:34 +02:00
Henrik Lissner
93fc74a143
fix(everywhere): update cli command
To accommodate changes recently made to Doom's CLI framework.

Ref: 6c0b7e1530
2022-06-22 01:27:03 +02:00
Henrik Lissner
3ea9051890
fix(cli): remove set -e from bin/doom{,script}
This killed the script prematurely (without displaying the error) if
Emacs failed to execute. In versions prior to bash 4, set -e would not
terminate the script if a non-zero exit code occurred within a subshell,
but it will in bash 4+.

In any case, we don't need this fallback to begin with. The script
handles its errors sufficiently otherwise.
2022-06-22 01:23:39 +02:00
Henrik Lissner
f0e8728bbc
fix(lib): restart-emacs name collision on Emacs 29+
Emacs 29 introduces a new command: restart-emacs, which clashes with the
more featureful restart-emacs package that Doom installs to manage the
session. Fortunately, the built-in one is defines in files.el, which is
eagerly loaded at startup, so as long as the third-party one is
loaded (at some point), it shouldn't be a problem.

Fix: #6492
2022-06-22 01:10:07 +02:00
Henrik Lissner
170dadca5a
feat(emacs-lisp): register doomscript as elisp interpreter 2022-06-21 23:42:16 +02:00
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