Commit graph

17794 commits

Author SHA1 Message Date
Jeff Kowalski
29e30e8af4 fix(cli): follow-on syntax fixes to #6772
While fixing #6772, we also address several other issues found by
sh-shellcheck:

L47C39 SC1007:Remove space after = if trying to assign a value
(for empty string, use var='' ... ).

L47C46 SC2046:Quote this to prevent word splitting.

L62C20 SC2086:Double quote to prevent globbing and word splitting.

L82C9  SC2154:tmpdir is referenced but not assigned
(did you mean 'TMPDIR'?).
2022-09-12 11:44:11 +02:00
Jeff Kowalski
571ab7425a fix(cli): #6772 - trivial doomscripts fail
When trying to establish the value of EMACSDIR, the proper fallback
when BASH_SOURCE is undefined is $0 rather than 0, in correct shell-
scripting parlance.
2022-09-12 11:44:11 +02:00
Sean Farley
2548632600 fix(mu4e): force the account stripe face to be non-italic
With mu4e came a new face for the header view. While this is nice for
the text, it had the consequence of making the account stripe (the
vertical bar) a bit jarring. This patch fixes that behavior to make the
stripe non-italic by append `'default` to the face.
2022-09-10 23:54:31 +02:00
tecosaur
01bb743c6c
tweak(mu4e): set last-child thread symbol
Also tweak the line order and whitespace while I'm at it, to show the
overall styling more clearly.
2022-09-10 23:52:36 +02:00
Ivan
6af7338140
refactor(lib): remove unreachable code in doom-print-class-alist
An earlier element in this alist associates buffer with
doom-print--buffer, so this later element is unreachable.
2022-09-10 23:51:40 +02:00
Ivan
44ff627e35
nit: remove unused base-specs arg in doom--make-font-specs 2022-09-10 23:48:56 +02:00
Ivan
ffe3dd59ff
fix: error caused by typo in doom--recentf-file-truename-fn 2022-09-10 23:46:40 +02:00
Krzysztof Baranowski
836d229636 fix(nix): remove :mode hook for nix-drv-mode
The nix-mode package already does this and it shadows other entries for the .drv files in auto-mode-alist (namely Guix derivations).

Ref: 34d51e2731/nix-drv-mode.el (L48)
2022-09-10 23:37:50 +02:00
Henrik Lissner
251ccbcc6b
fix: package recipes with relative :local-repo
Necessitated by 7e0c2ed, and missed in 45a66cd. This would indirectly
cause "No :repo specified for package 'X'" errors for packages with a
`:local-repo` relative to their packages.el file.

Amend: 45a66cda60
Ref: 7e0c2ed8a3
2022-09-10 20:45:44 +02:00
Henrik Lissner
c80fa2efdf
fix: all packages seen as disabled
In v3, doom-module data is stored in symbol plists, but in v2, it's
stored in a hash table. Some v3 code snuck into 45a66cd, which made Doom
try to read module data from plists that hadn't been initialized yet, so
Doom could no longer see your module settings.

Fix: #6769
Amend: 45a66cda60
2022-09-10 20:03:45 +02:00
Henrik Lissner
7a2fa1e313
fix(cli): doctor warnings about irrelevant bytecode
This would check for stale bytecode across all profiles or even .local*
directories created by shell.nix, which is unnecessary.
2022-09-10 20:03:24 +02:00
Henrik Lissner
45a66cda60
fix: ensure module state is in scope for modulep!
Otherwise, doom-module-from-path (and modulep!) would fail to detect the
module they're in, or at least, modulep! would incorrectly return nil,
even for enabled modules.

This issue is what would've caused the package list or the doctor to
include/consider packages in disabled modules or behind disabled flags.
2022-09-10 19:11:03 +02:00
Henrik Lissner
ce0e3a04b6
tweak(lib): prevent redundant timestamps in logs 2022-09-10 18:36:24 +02:00
Henrik Lissner
78af0eeecb
fix(lib): only set top-level values of debug variables 2022-09-10 18:36:24 +02:00
Henrik Lissner
05d06cc552
tweak(lib): suppress GC logging in debug mode
It happens so often it can overwhelm the echo area. It's still logged
to *Messages* however.
2022-09-10 18:36:24 +02:00
Henrik Lissner
d290152a8e
refactor(lib): replace doom-debugger with advice
Writing a debugger for Elisp is too much hassle. `debug` itself isn't
very customizable without a *lot* of boilerplate, so instead of writing
my own, it's more effective to advise debug instead. Certainly, I don't
do anything with it yet, but I will soon.
2022-09-10 18:36:24 +02:00
Henrik Lissner
b66ccaeca0
fix(agda): tree-sitter compatibility with agda2-mode
Tree-sitter-lang recognized agda-mode, but not agda2-mode.
2022-09-10 18:36:24 +02:00
Henrik Lissner
49f4ec3b10
feat(tree-sitter): add set-tree-sitter-lang! autodef 2022-09-10 18:36:24 +02:00
Henrik Lissner
151300ecce
feat(cli): deny XDG, Wayland, Sway, + socket envvars
Additional envvars that would not be helpful to persist.

Ref: https://discourse.doomemacs.org/t/3088
2022-09-10 18:36:24 +02:00
Henrik Lissner
c59fe8596f
dev: handle blank shell.nix inputs properly
If doomdir, emacsdir, and/or doomlocaldir were blank, / would be treated
as their value, which will fail in some spectacular (and some quiet)
ways.
2022-09-10 18:36:23 +02:00
Henrik Lissner
b5b0d5de1c
dev: update shell.nix
To include a wider selection of Emacs versions.

Also makes 28.1 the default version.
2022-09-10 18:36:23 +02:00
Henrik Lissner
c747d218ae
refactor(cli): throw error if Doom fails to load 2022-09-10 18:36:23 +02:00
Henrik Lissner
3505e666a8
fix: failure to load doom libs on 27.x
Emacs 27.x does not collapse consecutive slashes in a file path when
trying to load them, and instead discards everything before it and
treats the rest as an absolute path, e.g. "~/some//path/foo/" ->
"/path/foo". This is not the case in 28.1, but Doom's backport of
file-name-concat did not take this into account, so it's been modified
to trim trailing slashes.

Fix: #6766
Amend: 433c9e344d
2022-09-10 18:33:02 +02:00
Henrik Lissner
eb80d461df
fix(lib): void-function macroexp-file-name error
This function was introduced in Emacs 28.1, so 7e0c2ed was a breaking
change for 27.x users.

Fix: #6766
Amend: 7e0c2ed8a3
2022-09-10 13:03:53 +02:00
Henrik Lissner
7e931ec586
fix: file-missing errors while trying to build packages
This is caused by a bug in recent builds of Emacs 29, where
`loaddefs-generate` will activate emacs-lisp-mode to read a package's
autoloads, but does so without suppressing its mode hooks. Other
packages may add functions to this hook from their autoloads (like
overseer.el does). Calling these functions will initiate a chain
reaction where other packages will be loaded (plus their dependencies),
but aren't guaranteed to be available so early in the bootstrap process.
The result are file-missing errors about seemingly unrelated packages,
like pkg-info or dash.

Ref: emacs-mirror/emacs@0d383b592c
Fix: https://discourse.doomemacs.org/t/3149
2022-09-10 12:38:53 +02:00
Henrik Lissner
96ae3f1b04
fix(cli): nativecomp error writing to read-only fs
Occurs when a site-file fails to be natively compiled, and Doom attempts
to write an error file in the same directory. On some systems, the
site-lisp directory is in a read-only tree/mount (like nix and guix).
This should suppress those attempts.
2022-09-10 12:08:16 +02:00
Henrik Lissner
f3e85afc7e
fix(lib): ensure after! body gets expanded
Relying on eval-after-load's compiler-macro magic (after 8b4f722) can
cause scope issues with nested macros (like file! and dir! running in
the context of a temp buffer), so best we use with-eval-after-load
directly.

Ref: 8b4f722fa3
2022-09-10 11:59:48 +02:00
Henrik Lissner
7e0c2ed8a3
fix(lib): convert file! and dir! to macros
To ensure that they're expanded at a file's top-level, while expanded,
where they're used. It also fixes a few inlined uses of the file!
macro (e.g. in `load!`, as reported in #6764), which was prematurely
committed ahead of this change.

Close: #6764
Amend: a179b8d262
2022-09-10 11:59:17 +02:00
Henrik Lissner
46e23f37ba
fix: memory leak & freezes on native-comp+pgtk builds
b7f84bd introduced a nasty regression that caused an infinite loop and
runaway memory usage on some pgtk+native-comp builds of Emacs when it
attempted to perform deferred native compilation of your packages. This
would make Emacs unusable and, if left alone, could even crash your
system.

The only Emacs builds I'm certain are affected are derived from
flatwhatson/emacs (like emacs-pgtk-native-comp on Guix and Arch Linux in
particular). 28.1 stable and master (on emacs-mirror/emacs@e13509468b)
are unaffected.

It appears that some, earlier pgtk builds stack idle timers differently.
I'm not entirely sure how, because it doesn't manifest in more recent
builds of Emacs, and I'm already burnt out on debugging this, but here's
how Doom encountered it:

Doom has an incremental package loader; it loads packages, piecemeal,
after Emacs has been idle for 2s, then again every 0.75s until it
finishes or the user sends input (then it waits another 2s before
starting again). However, if at any time the iloader detected that
native-compilation is in progress, it waits 2s before trying
again (repeat, until native-comp is done). But here's the catch, given
the following:

  (run-with-idle-timer
   2 nil (lambda ()
           (run-with-idle-timer 1 nil (lambda () (message "hi")))))

I had assumed "hi" would be emitted after 3 seconds (once idle), but
instead it is emitted after 2. Like this, Doom's iloader would elapse
one idle timer directly into another, ad infinitum, until Emacs was
forcibly killed.

By switching to run-at-time and employing my own rudimentary idle timer,
I avoid this issue. Also, the iloader no longer needs to be considerate
of native-comp, because the latter does its own rate-limiting controlled
by native-comp-async-jobs-number.

Amend: b7f84bdd01
2022-09-10 01:38:58 +02:00
Henrik Lissner
3fe81f4291
fix(cli): wrong-number-of-args error when auto-resolving prompts
E.g. 'doom sync -!' will auto-resolve repo conflicts, but this error was
preventing that.
2022-09-10 01:36:58 +02:00
Henrik Lissner
6e8de0bd89
refactor(lib): use num-processors
This C function was introduced in Emacs 28.1.
2022-09-08 13:36:17 +02:00
Henrik Lissner
cd269753cf
fix(lib): leave point at bob in with-file-contents!
with-file-contents!'s docstring promises that point will end up at the
beginning of the buffer, but this promise wasn't kept until now.
2022-09-08 00:24:16 +02:00
Henrik Lissner
b121c5e1c6
refactor(lib): provide doom-libs as subfeatures
This allows us to load them via doom-require. Why not use normal
features? Because Doom's libraries are designed to be loaded as part of
Doom, and will openly rely on Doom state if needed; this is a contract I
want to enforce by ensuring their only entry points are through
`doom-require` or autoloading.

I will add them to the rest of the libraries later.

Site-node: this also adds Commentary+Code to the comment headings, as I
want a space to use that space to describe the library, when I get
around to it.
2022-09-08 00:20:26 +02:00
Henrik Lissner
a179b8d262
feat(lib): add doom-{require,load}
These functions are light wrappers around require and load, such that
Doom will catch (and decorate) any errors from the target file, and is
also capable of loading Doom's subfeatures.
2022-09-07 23:19:37 +02:00
Henrik Lissner
0172b180a9
refactor(cli): remove superfluous emacs switches
Neither --no-x-resources or --no-splash are relevant to a noninteractive
session.
2022-09-07 17:25:01 +02:00
Henrik Lissner
a0fc7bad5a
fix(cli): create doom directories early
This is a regression from 948f946, where a bunch of mkdir calls were
removed prematurely. In v3, other processes are responsible for creating
these directories, but those haven't been implemented yet.

Fix: #6756
Amend: 948f9461a7
2022-09-07 17:25:01 +02:00
Henrik Lissner
ceae154751
fix(cli): reading dir perms on a non-existent dir
This is a regression from c05e615. doom.el changes user-emacs-directory
to doom-cache-dir, which may not exist yet, at the time of this check,
causing file-attributes to return nil, and causing = to throw a type
error (see #6754).

In addition to fixing this, I've also made the check more liberal about
failures, in the odd case that doom-emacs-dir, too, does not exist at
the time bin/doom is called (it'd be very hard to pull that off, but not
impossible).

Fix: #6754
Amend: c05e61536e
2022-09-07 17:25:01 +02:00
Henrik Lissner
18887163f9
tweak(cli): add lisp/cli to doom-cli-load-path by default 2022-09-07 17:25:00 +02:00
Gerry Agbobada
2cd8f85bac fix(debugger): fix dap-ui conditional loading
Probably missed when adding eglot support code in the module
2022-09-07 16:23:24 +02:00
Henrik Lissner
8594c1a0c4
fix(cli): failure to autoload 'doom refresh' error
Amend: cee89a5d3f
2022-09-07 11:32:41 +02:00
Henrik Lissner
9e3d99277e
docs(everywhere): update CLI command
6c0b7e1 introduced a new convention for CLIs defined by Doom's modules:
to namespace them under `doom +MODULE ...`. What was once 'doom
everywhere' is now 'doom +everywhere', so the docs needed correcting.

Ref: 6c0b7e1530
2022-09-07 02:34:57 +02:00
Henrik Lissner
4efdf51ca5
release(modules): 22.09.0-dev
Ref: 2b39e41368
2022-09-07 01:48:37 +02:00
Henrik Lissner
e87fd8ac13
fix: validate fd --version output
Ref: https://discourse.doomemacs.org/t/3144
2022-09-07 01:48:37 +02:00
Andrew Whatson
71e0190618 bump: :lang scheme
emacs-geiser/chicken@79a9ac78f4 -> emacs-geiser/chicken@a480598b59
emacs-geiser/gauche@fd52cbaed9 -> emacs-geiser/gauche@8ff743f641
emacs-geiser/geiser@9507e81a07 -> emacs-geiser/geiser@550d57d347
emacs-geiser/guile@c641fcc50b -> emacs-geiser/guile@b2d6f398e3
flatwhatson/flycheck-guile@e46d6e5453 -> flatwhatson/flycheck-guile@e58ceb8b51
2022-09-07 01:40:10 +02:00
Andrew Whatson
5fb96f2886 fix(scheme): restore repl-per-project for scheme
Geiser commit 476897e4f8a1 introduced `geiser-repl-per-project-p` which
defaults to false, breaking our repl-per-project support.  Previously,
setting `geiser-repl-current-project-function` was sufficient.
2022-09-07 01:40:10 +02:00
Henrik Lissner
a1c9d40ee8
docs(rust): de-emphasize rls
RLS has been deprecated for rust-analyzer, so it's best that our rust
module refrain from advertising it so prominently.

Ref: https://blog.rust-lang.org/2022/07/01/RLS-deprecation.html
2022-09-07 01:25:22 +02:00
Henrik Lissner
63b0ebeda7
refactor!(rust): remove racer and default to +lsp
BREAKING CHANGE: Racer is no longer developed and its project page
recommends using rust-analyzer instead. Moreover, users have reported
issues trying to build/install it on recent versions of rust, so I've
removed support for Racer from Doom, and now default solely to LSP for
IDE features.

Users that want these features will need to activate the module's +lsp
flag (along with the :tools lsp module) and install rust-analyzer. See
the module's README for instructions.

Close: #6705
Co-authored-by: c1ttim <c1ttim@users.noreply.github.com>
2022-09-07 01:25:18 +02:00
Henrik Lissner
20c50755e8
fix(magit): end-of-file error
Due to an unbalanced paren in d8f87ad.

Amend: d8f87ada96
2022-09-07 00:55:51 +02:00
Henrik Lissner
ea84212d0a
fix(magit): void-function (:files) error
Due to a missed syntax error in d8f87ad.

Amend: d8f87ada96
2022-09-07 00:52:49 +02:00
casswedson
d8f87ada96 fix(magit): only install forge if asked 2022-09-07 00:25:52 +02:00