Commit graph

938 commits

Author SHA1 Message Date
Henrik Lissner
a629b154cc
feat: support for MPS garbage collector (igc)
And remove/disable gcmh if running the IGC build.
2026-03-19 18:39:02 -04:00
Henrik Lissner
25e4c73137
tweak: compilation-max-output-line-length = nil
Scanning each line can slow the compilation buffer down for long-running
and verbose processes.

Ref: doomemacs/community#87
2026-03-19 03:13:06 -04:00
Henrik Lissner
c093595947
perf: compilation: rate-limit comint-truncate-buffer
comint-truncate-buffer preforms expensive line-wise operations on every
line of output in the compilation buffer. This can exponentially slow
down every additional line of output thereafter. To get around this, I
relpace it with a version that rate-limits it until the compilation
buffer has grown large enough.

This may still have issues in cases where the underlying processes
produce long *and* ultra wide lines at the same time.

Ref: doomemacs/community#87
2026-03-19 03:13:06 -04:00
Henrik Lissner
1b1838e160
perf: comint: no-op advice in read-only buffers
Like compilation-mode buffers, so they don't impact their performance.
2026-03-18 19:31:49 -04:00
Henrik Lissner
e368d2da14
fix(lib): doom-indent: if multiple indent vars are nil
In the odd edge case where one (or more) of the indent vars are set to
nil (e.g. misconfiguration via `set-indent-vars!`).
2026-03-18 19:31:48 -04:00
Henrik Lissner
370777f398
fix(lib): doom-indent: void-variable errors
I was too optimistic using intern-soft as a soft-boundp check.

Fix: #8714
Amend: c0662f6ea1
2026-03-15 21:56:08 -04:00
Henrik Lissner
c0662f6ea1
feat(lib): introduce set-indent-vars! & doom-indent API
Introduces a systemic fix to the problem where most major modes don't
set `tab-width` and/or `standard-indent` to match the mode-specific
indent variables. This tries to guess the indent variable(s) for any
given major mode, by searching for variables that end in:

  X-ts-mode-indent-offset
  X-indent-offset
  X-indent-level
  X-tab-width
  X-basic-offset

Where X is the major mode without the (base-)?(ts-)?-mode suffix. This
should resolve to the correctly variable for most popular or newer
packages. For modes where it isn't enough, modules will have to manually
register with `set-indent-vars!`.

This commit also moves various indent commands to a new
lisp/lib/indent.el library and rewrites `doom/set-indent-width` to use
this new API (which no longer depends on editorconfig, and less on
dtrt-indent).

Fix: #8713
2026-03-15 02:23:40 -04:00
Henrik Lissner
2df631ff58
refactor: introduce doom-auto-revert-mode
This originally consisted of four hooks, intended to be a more
performant alternative to the built-in `{global-,}auto-revert-mode`.
However, users who don't want this behavior needed four relatively
obscure `remove-hook` calls to fully it. With this, folks only need:

  (remove-hook 'doom-first-file-hook #'doom-auto-revert-mode)

Or can toggle `doom-auto-revert-mode` directly.

After v3, I plan to move this functionality into a module.

Ref: doomemacs/community#86
2026-03-15 02:16:30 -04:00
Henrik Lissner
165032cfec
refactor(lib): remove doom/dumb-{de,in}dent commands
These two commands aren't used anywhere and the specifics of how
people *want* these sort of commands to work are so specialized and
niche that ours are unlikely to suit most people's needs. As an
alternative, Evil users already have `evil-shift-right` and
`evil-shift-left`, and vanilla users can `(setq tab-always-indent nil)`,
among *many* other possible choices.
2026-03-14 23:08:45 -04:00
Henrik Lissner
3a2c12073f
refactor: s/set-debug-variable!/set-debug-var!/
There will be more of these set-variable-type autodefs in the future, so
I'd rather make the abbreviation of "variable" the precedent now than
destructively rename them all later.
2026-03-13 17:42:00 -04:00
Henrik Lissner
3381577fb2
fix(lib): doom/reload-autoloads
The regexp test was not matching any files (which aren't absolute
paths).
2026-03-13 02:02:57 -04:00
Henrik Lissner
ff75c10550
fix(lib): doom/reload: isolate reload environment more
To resist contamination from the current buffer or environment (e.g. due
to direnv). Also, ensure `doom-after-reload-hook` is executed, even if
the reload process fails.
2026-03-13 01:58:30 -04:00
Henrik Lissner
698d52276e
perf: avoid doom-fallback-buffer in doom-first-buffer-hook trigger
Calling `doom-fallback-buffer` pulls in lisp/lib/buffers.el a sooner
than needed. `doom-fallback-buffer-name` on the other hand is defined
much sooner.
2026-03-13 01:50:56 -04:00
Henrik Lissner
f2257c3fa9
fix: defcustom :type specifiers
setopt throws a void-function nil error if a variable's :type specifier
is invalid.

Fix: #8710
2026-03-12 16:29:37 -04:00
Henrik Lissner
a28c5f6eef
fix(cli): remove unused lexical var
The var was removed in 73d643d and isn't used elsewhere, so...

Amend: 73d643da83
2026-03-11 23:11:52 -04:00
Henrik Lissner
2c412fb310
fix: straight: respect :branch in package! statement
Amend: 7902c08729
2026-03-11 22:50:33 -04:00
Henrik Lissner
73d643da83
fix: appease byte-compiler across the board
Warnings about unused lexical variables, arity warnings, unescaped
single quotes in docstrings, shadowed variables, and invalid value for
:local depending on Emacs version.
2026-03-11 22:50:33 -04:00
Henrik Lissner
0bbece56f1
refactor(vertico): marginalia-command-category: hoist to callers
Emit the metadata at the source.
2026-03-11 22:50:32 -04:00
Henrik Lissner
f573c7a1ee
fix: don't trigger doom-first-buffer-hook too early
The scratch or dashboard buffers triggered it too early.

Fix: #8706
2026-03-11 02:55:08 -04:00
Henrik Lissner
f0da6a2c31
fix(lib): doom-context-pop: logged output
Log should be prefixed with - to denote a lost context.
2026-03-11 02:28:59 -04:00
Henrik Lissner
b4917ef4f3
fix: remove vestigial references to setq!
setq! was deprecated in 304030f in favor of setopt.

Ref: 304030fdf8
2026-03-10 21:59:14 -04:00
Henrik Lissner
4fe1cbeddb
refactor: s/when-let/when-let*/
The former is deprecated on Emacs 31 for the latter.
2026-03-09 03:28:06 -04:00
Henrik Lissner
0b1de48daa
feat(lib): replace doom-region & add doom-region-bounds 2026-03-09 03:28:06 -04:00
Henrik Lissner
9840f8e454
fix: don't activate global-hl-line-mode when hl-line-mode is on
In recent versions of Emacs, `global-hl-line-mode` is separate from
`hl-line-mode`
(the global mode uses a different, more efficient mechanism for line
highlights), so it should bow out if `hl-line-mode` is enabled.
2026-03-08 03:24:50 -04:00
Henrik Lissner
be07b41ed4
perf: run doom-optimize-for-large-files-h earlier in find-file-hook
So later hooks can feel the performance benefits sooner in large files.
2026-03-08 03:23:03 -04:00
Henrik Lissner
08ab5d53b4
docs: update doomemacs repo urls
Close: #8695
Co-authored-by: kovan <kovan@users.noreply.github.com>
2026-03-05 22:48:55 -05:00
Henrik Lissner
a5552a701b
docs: doctor: do ripgrep check after loading $DOOMDIR
Now takes `doom-ripgrep-executable` into account.
2026-03-05 16:33:56 -05:00
Henrik Lissner
b87034c95d
docs: doctor: do non-POSIX shell check after loading $DOOMDIR
This allows user config to affect the result of the test (hiding it if
they've already addressed the issue).

Fix: #8136
2026-03-05 16:27:51 -05:00
Henrik Lissner
e11816e711
fix: doom-initialize-packages: don't activate package.el
This function should not be used as a substitute for
`package-initialize`, to activate packages installed via package.el,
this is solely for metadata for Doom's package manager.
2026-03-04 02:21:19 -05:00
Marien Zwart
dc7c43b6d3 refactor: use supported recentf-auto-cleanup value
We were setting recentf-auto-cleanup to nil, which is not one of the
supported values in its defcustom type.

Set it to `'never` instead. This has exactly the same effect (recentf
only references `recentf-auto-cleanup` from a `cond` statement, which
does nothing for both values), but we might as well future-proof.

Clean up a duplicate assignment while I'm there.

Noticed because I had copied this into my personal config at some
point (to disable Doom's periodic save in daemon sessions) and recently
converted that config to use `setopt`, which complained.
2026-03-03 18:26:05 -05:00
Marien Zwart
a6c57fd4fd fix: save after recentf-cleanup on exit
Doom adds `recentf-cleanup` to `kill-emacs-hook`, but that function only
cleans up `recentf-list` without saving it to disk: saving is handled by
`recentf-save-list`. `recentf-mode` adds `recentf-save-list` to
`kill-emacs-hook` as well... but it only adds that hook when
`recentf-mode` is enabled, which means `recentf-save-list` ends up
before `recentf-cleanup` on `kill-emacs-hook`, rendering the cleanup
ineffective.

This is normally barely noticable, but with many paths on (slow) network
filesystems on `recentf-list` the cleanup can get slow enough to be
annoying.

Fix it by passing a priority to `add-hook`.

This leaves an ineffective cleanup call if we exit Emacs with
recentf-mode disabled, but that should normally only happen if we exit
Emacs without opening a file (`doom-first-file-hook` enables
recentf-mode). If that's an issue, we could add a function to
`recentf-mode-hook` which in turn adds to `emacs-term-hook`, but that
seems too complicated for little gain.
2026-03-03 18:26:05 -05:00
Henrik Lissner
7f17dcf09a
fix(cli): doom emacs: use --init-directory if available
Emulating --init-directory has issues (e.g. isn't exposed to the *exact*
same $HOME environment), so if it's available (i.e. if Emacs 29+ is
being used or Doom lives in ~/.emacs.d or ~/.config/emacs), then use it.
This makes the 'doom emacs' command faster and more reliable as a launch
pad for Doom.
2026-03-03 06:34:45 -05:00
Henrik Lissner
51fe3798b2
docs: doctor: improve $HOME project root check
The check will now list the exact project root files that it finds and
better explain the solution.
2026-03-03 00:11:19 -05:00
Henrik Lissner
a2e0e9c8cf
docs: doctor: revise emacs versions checks
- Simplifies development build check explanation.
- Removes the 27 check, because Doom core will continue to support 27+
  for the foreseeable future, but Doom's modules will be dropping 27 and
  28 support soon, but that check will be done elsewhere.
2026-03-03 00:06:51 -05:00
Henrik Lissner
6c0881c684
nit: revise TODO/FIXME/HACK/REVIEW/etc in comments
Some were outdated, some were incorrectly labeled, others were already
completed, some were missing... Gotta fix them all.

Also, in :ui hl-todo, there are comments that describe how Doom uses
each of these annotations; those have been updated.
2026-03-02 19:45:09 -05:00
Henrik Lissner
a55d6ad958
bump: :doom
bbatsov/projectile@7cb1f64c1d -> bbatsov/projectile@4469d33f49
emacs-straight/project@ff700457fe -> emacs-straight/project@11a821c652
2026-03-02 01:39:49 -05:00
Henrik Lissner
9f00e2e816
release(modules): 26.04.0-dev
Ref: 2b39e41368
2026-03-02 01:39:49 -05:00
Henrik Lissner
f4d970fdf8
fix(lib,workspaces): arity error on persp-after-load-state-functions
`persp-after-load-state-functions` functions must take arguments, but
`doom-kill-childframes-h` didn't take any, causing errors when loading
persp-mode sessions.

Fix: #8700
Amend: e5bbae8144
2026-03-02 01:18:14 -05:00
Henrik Lissner
10d0b60f5d
refactor(lib): deprecate pushnew!
In the spirit of 6f40ad5, I'm deprecating this macro because it doesn't
provide enough value to exist and serves only to complicate a casual
reader's understanding of Doom's modules.

Ref: 6f40ad55f5
2026-03-01 18:10:43 -05:00
Henrik Lissner
f859850130
nit: fix indent for hl-line config 2026-03-01 18:10:43 -05:00
Henrik Lissner
e5bbae8144
feat(lib): introduce doom-kill-childframes-h
And use it to replace the various `posframe-delete-all` hooks littered
about to clean up child/posframes in contexts where they may linger
after destructive operations (like changing the active workspace or
executing `doom/reload`).
2026-03-01 18:10:42 -05:00
Henrik Lissner
e2bdb43bf6
fix(cli): doom emacs: forward $HOME using environment
Rather than hardcoding the envvar assignment into the shell command,
whose syntax isn't portable (see #8697).

Fix: #8697
2026-03-01 18:10:42 -05:00
Henrik Lissner
d9014ec4c5
fix: copy initial-value for load-path, exec-path, process-environment 2026-03-01 18:10:42 -05:00
Henrik Lissner
5311d4592d
fix: minor typo in cli restart logs 2026-03-01 18:10:42 -05:00
Henrik Lissner
59f9e1f5bb
docs(lib): revise doom-log & doom-run-hooks docstrings 2026-03-01 18:10:42 -05:00
Henrik Lissner
304030fdf8
refactor(lib): deprecate setq!
`setq!` was introduced to fix `setopt` pulling in packages. Now that
`setopt` was advised (in fad44ca228) to fix the issue at the source,
this macro is no longer necessary.

Ref: fad44ca228
2026-03-01 18:10:40 -05:00
Henrik Lissner
1c330eadce
refactor(lib): deprecate doom-load-envvars-file
In v3, the envvar file will be an elisp script, which can be `load`ed
directly, so a specialized loader will no longer be necessary.
2026-02-28 05:15:52 -05:00
Henrik Lissner
bd949b718f
refactor(lib): deprecate doom-compile-functions
Module autoloads will be separately byte-compiled in v3. Removing this
ahead of that.
2026-02-28 04:15:15 -05:00
Henrik Lissner
c2c1416634
revert: tweak: disable electric-quote-mode by default
Seems electric-quote-mode was already disabled by fault, but I was
troubleshooting a package that was globally enabling it in its
autoloads, so this setting wasn't needed.

Revert: 8e6d555cc4
2026-02-25 14:31:48 -05:00
Henrik Lissner
8308ac1e95
tweak: levels for certain doom logs
To reduce unnecessary debug spam when debug-mode is on.
2026-02-24 23:25:16 -05:00