Commit graph

260 commits

Author SHA1 Message Date
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
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
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
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
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
69f0df289b
fix(lib): profiles: ensure site-lisp load-path entries are last
If the site-lisp load-path entries different between the non-interactive
and interactive sessions, there could be redundant paths prepended to
load-path, causing load order issues (#8607). This ensures they are
appended, instead.

Fix: #8607
2026-02-22 01:40:54 -05:00
Henrik Lissner
ac649cce2a
feat(lib): add doom-real-buffer-modes
For dictating what buffers are considered real based on their major
modes.

Also makes most terminal emulator or comint-mode buffers real by
default.

Fix: doomemacs/community#73
2026-02-20 20:37:31 -05:00
Henrik Lissner
28cb499225
feat(lib): doom-special-buffer-p: consider special-mode parents 2026-02-20 20:37:31 -05:00
Henrik Lissner
1240162d7a
refactor(lib): remove doom/restart-and-restore
Emacs 29 introduced a `restart-emacs` command that is more reliable, but
it cannot restart Emacs with arbitrary arguments, which the old
`restart-emacs` library could. Without this capability,
`doom/restart-and-restore` is not trivially (or elegantly) possible, and
I can't justify a whole extra dependency just to support that,
especially in my pursuit to slim down Doom's core.

This commit also removes the doom/upgrade command, which is an awkward
and fickle command to support across platforms (too many edge cases).
2026-02-20 20:18:50 -05:00
Henrik Lissner
28e52b8c89
refactor(cli): doom gc: remove redundant logic 2026-02-15 21:58:25 -05:00
kovan
7902c08729 fix(lib): use git symbolic-ref instead of branch -m for empty repos
Fix: #8538

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:02:58 -05:00
Henrik Lissner
3ad9eeb273
fix(lib): doom/reload: only escape spaces in $EMACS on Windows
This is a temporary measure until the interpolation in the powershell
script can be addressed directly (by someone better versed in
powershell).

Fix: #8572
Close: #8654
Co-authored-by: kovan <kovan@users.noreply.github.com>
2026-02-13 23:55:20 -05:00
Henrik Lissner
66ad58afc4
fix(lib): doom-docs-org-mode: id locations 2026-01-19 17:08:54 -05:00
Henrik Lissner
be7ac25a84
fix: file-name-concat paths instead of concat
Treat paths as paths, rather than strings. Removes the requirements that
doom-*-dir variables end in slash (though I'll continue doing so as a
convention). Also moves a lot of cache/data into the current profile's
cache/data directories. Shouldn't actually affect anything for folks not
using Doom's profile system (yet).

Fix: #8616
2025-12-30 22:59:10 -05:00
Henrik Lissner
46353c326a
fix(lib): desktop.el session load/save
restart-emacs--restore-frames-using-desktop had some bugs that made
doom-load-session non-functional.

Fix: #2291
2025-12-30 22:50:31 -05:00
richard134
21682009b1
feat(lib): add toggle scratch buffer commands
Add `doom/toggle-scratch-buffer` and `doom/toggle-project-scratch-buffer`
commands that toggle scratch buffer visibility, consistent with how
`SPC o t` toggles the terminal popup.

Also extract mode determination logic into `doom--scratch-buffer-initial-mode`
helper to ensure toggle commands respect `doom-scratch-initial-major-mode`
configuration (including mode inheritance when set to `t`).

Keybindings updated to use toggle variants:
- `SPC x` (evil) / `C-c f x` (emacs) for scratch buffer
- `SPC p x` (evil) / `C-c p x` (emacs) for project scratch buffer

Fix: #8604
2025-12-24 18:24:01 -05:00
Henrik Lissner
01b958ea35
fix(lib): print!: lost newlines in output
Some lines separated with a single newline were joined by
fill-paragraph.
2025-12-07 17:51:35 -05:00
Henrik Lissner
0e784755eb
fix(lib): void-variable type
When autodef'ing anything but functions.
2025-09-25 03:29:56 -04:00
Henrik Lissner
fbdde6b5f4
module!: add :editor whitespace
BREAKING CHANGE: Moves ws-butler, dtrt-indent, and whitespace defaults
out of Doom's core and into a new module. ws-butler is gated behind
+trim and dtrt-indent behind +guess. Users who depend on/like these
packages will need to enable the new module and their respective
flags (which is the default going forward).

This change is motivated by an ongoing effort to slim down Doom's
core (by (re)moving non-essentials from it).

This also addresses an issue where dtrt-indent would vastly increase
load times for some major-modes (e.g. elixir-mode & elm-mode, see #7537)
by restricting it to non-project files and non-read-only buffers AND
excludign those two major modes from indent guessing.

Fix: #8516
Fix: #7537
2025-09-24 02:23:30 -04:00
Henrik Lissner
87a7efcea6
fix(lib): package!: add :env property
Allows the association of arbitrary envvars or variables with the build
artifacts of a package. If they change, the package is rebuilt on the
next 'doom sync'. This is a temporary measure, which is why this is not
touted as a new feature. It will be replaced in v3.
2025-09-22 23:30:03 -04:00
Henrik Lissner
1bc2af6ce5
fix(lib): remove black hole insertions
These inserts were writing nowhere.
2025-09-22 23:30:03 -04:00
Henrik Lissner
093488fcb7
fix(lib): dependence on hash-table insertion order
Yes, yes. I did a stupid here. I depend on the order of a hash table,
and sure enough, that came back to bite me when that changed internally
in Emacs 29. In practice, this meant packages were getting
installed/rebuilt in reverse order, which, besides some odd output
during 'doom sync' for users on 29+, didn't pose any overt issues, but
may have caused strange, inexplicable byte-code warnings/errors.

But, rather than do the smart thing and *not* do this, I do the next
best thing: procrastinate! Because the solution is non-trivial (I don't
control the hash table in question) and this is precisely the sort of
technical debt I've fixed in v3, and I'd really, *really* rather beat my
head on that wall, rather than this one.
2025-09-22 23:30:03 -04:00
Henrik Lissner
4de162108e
feat: retry straight operations if they fail
Prior to this, we had some rudimentary retry logic for failed git clones
resulting in an empty repo, but it didn't respond to other legit
errors (like connection errors or legit remote failures). This one does,
retrying in more contexts.

Close: #8523
Co-authored-by: NightMachinery <NightMachinery@users.noreply.github.com>
2025-09-22 23:25:04 -04:00
Troy Brown
fa6a2607b7 fix(lib): doom/sandbox: tree-sitter extra load path 2025-09-21 19:43:52 -04:00
Henrik Lissner
b72fe2bd37
feat(lib): profiles: more portable load-path/Info-directory-list
The Emacs appimage generates a new mountpoint on each invokation, but
Doom's profiles assume that the Emacs directories don't move. To make
Doom's profiles a little more profile, it will no longer set `load-path`
and simply add the new paths to the existing one. Same for
Info-directory-list.

Consequently, this also seems to speed up startup times for ~8% in my
tests. Neat.
2025-09-15 18:53:30 -04:00
Henrik Lissner
84d5fa2b65
fix(lib): profiles: allow generators w/o an init function 2025-09-14 16:16:40 -04:00
Henrik Lissner
1e89556fa8
fix(lib): doom-file-read: (read . N) spec
Failed to read :by argument in '(read . ,N) form.
2025-09-14 11:52:29 -04:00
Henrik Lissner
26a5ad72e1
fix(cli): autoloads: type error parsing autoloads
Prevent rare edge cases where FORM is an atom, causing `cadr` to throw a
type error. Might explain some cases of `doom sync` doing nothing after
'> Generating N init files...'.

Amend: c014950f6d
2025-09-03 23:15:57 +02:00
Henrik Lissner
c014950f6d
fix(cli): remove *-ts-mode {interpreter,auto}-mode-alist entries
While generating the autoloads for the current profile (at `doom sync`),
remove any `add-to-list` forms modifying `interpreter-mode-alist` or
`auto-mode-alist` in autoloaded `(when (treesit-available-p) ...)`
blocks. We want to fully rely on `major-mode-remap-defaults`.
2025-09-03 14:40:36 +02:00
Henrik Lissner
2d28328b43
fix(cli): handle snapshot packages
Don't execute git commands in snapshots.

Amend: 8cdddd87d9
2025-09-02 00:31:08 +02:00
Henrik Lissner
a91f93a33a
fix(cli): failure to repin packages installed from snapshots
When a pinned package is repinned, the package manager attempts to  `git
checkout` the new pin, which won't work if the package isn't a git
repo (see 8cdddd87).

Amend: 8cdddd87d9
2025-09-01 21:56:54 +02:00
Henrik Lissner
a1c307b441
fix(lib): doom/reload: quote $EMACS
With af4cbc7, escaping and quoting in $EMACS is now respected by
bin/doom; so make use of it to fix issues with $EMACS paths/commands
that contain spaces.

Ref: af4cbc7791d2
Fix: #8475
Fix: #8403
2025-09-01 14:24:12 +02:00
Henrik Lissner
2e508c299d
fix(cli): 'Failed to clone package' error
A regression introduced in 8cdddd8.

Fix: #8471
Amend: 8cdddd87d9
2025-08-30 18:35:05 +02:00
Henrik Lissner
8cdddd87d9
tweak(cli): download package archives by default
From this point on, Straight will download packages from tarballs (if
possible) from their associated forge rather than clone them as git
repositories. This is (marginally) faster and consumes significantly
less space. Doom treats its packages as build artifacts anyway.

This shouldn't cause any immediate breakage, but it may upset folks who
want their local package installs to be repositories. For them, this can
be reversed by simply adding this to $DOOMDIR/init.el:

  (after! doom-straight
    (setq straight-vc-use-snapshot-installation nil))

This only applies to packages installed after this point. Packages that
are already cloned as a repo will stay that way until the next time
they're uninstalled or reinstalled from scratch. Plus it only works on
systems that have `tar` in their $PATH *and* forges that are
supported (at the time of writing: github, gitlab, codeberg, bitbucket,
and sourcehut).

Ref: radian-software/straight.el@4241b63952
2025-08-30 13:40:06 +02:00
Henrik Lissner
0ed0072ff2
refactor(lib): doom/set-frame-opacity
Remove redundancies.

Ref: #8395
Amend: 2c18b61c99
2025-08-11 01:22:40 +02:00
Henrik Lissner
2c18b61c99
feat(lib): set-frame-opacity: add FRAMES argument
Doesn't change the default behavior of the command, but adds an optional
FRAMES argument (a list of frames or `t` for all open and future
frames). If passed the prefix arg, FRAMES default to `t`, which applies
the opacity change to all open and future frames.

Close: #8395
Co-authored-by: lattarov <lattarov@users.noreply.github.com>
2025-08-10 15:34:43 +02:00
pancho horrillo
8b3894a94b fix(lib): update reference to deprecated alias 2025-08-09 22:35:34 +02:00
Henrik Lissner
dd89efdb42
tweak(lib): doom-debug-variables: add epg-debug 2025-07-13 22:28:34 +02:00
Henrik Lissner
7d69c5f7df
fix(lib): void-function editorconfig--default-indent-size-function
There are two editorconfig libraries. One built into 30+ and one on
MELPA. Same name, different APIs. If the MELPA one is installed through,
say, your OS package manager, then the detection heuristic in
`doom/set-indent-width` could get confused which library is which.

Fix: #8423
2025-07-01 14:22:10 +02:00
Henrik Lissner
589fa73435
fix(lib): doom/reload: on Windows
- cmd.exe chokes on the space in "C:\Program Files\...", but more
  importantly, doom.ps1 should be invoked with powershell, not cmd.exe.
- Windows has pwsh.exe and powershell.exe, which, while not identical,
  are close enough for our purposes, but needed to be accounted for.

Fix: #8098
2025-06-25 17:36:59 +02:00
Henrik Lissner
18bb2da849
fix(lib): doom-project-find-file: allow arbitrary roots
Allow doom-project-find-file to search file hierarchies from arbitrary
starting points (otherwise, project.el will resolve to the nearest
project root).
2025-06-10 21:29:00 +02:00
Henrik Lissner
c22bb498e5
fix(lib): doom-print-minimum-level: type error if level is undefined 2025-05-22 16:33:33 +02:00
Henrik Lissner
5d13d6ce99
fix(lib): doom-file-cookie: what argument-less cookies return
Used to be that a ;;;###COOKIE with no argument would return NULL-VALUE.
No more, it will now return `t`.

Also corrects the docstring to properly reflect what this does.
2025-05-22 16:33:22 +02:00
Henrik Lissner
3c8240dfaa
fix(cli): error if $EMACSDIR/.local/etc/eln missing 2025-05-14 23:43:58 +02:00
Henrik Lissner
510347977e
docs(lib): revise various docstrings 2025-05-09 01:14:16 -04:00
Henrik Lissner
e6ee332573
fix(lib): autoload doom/describe-char
Amend: 303dd28db8
2025-05-05 02:45:45 -04:00
Henrik Lissner
303dd28db8
feat(lib): introduce doom/describe-char
A version of describe-char that, when given a prefix arg, will prompt
the user to click where to execute the command (so you can read
text-properties/overlay information for otherwise unselectable text, in
the minibuffer or special UIs).
2025-04-24 04:28:49 -04:00
Henrik Lissner
009a285c0a
fix: doom-quit-p when use-dialog-box
I don't know what I was thinking, but I need more sleep.

Amend: 1a0fb88897
2025-04-15 19:08:45 -04:00
Henrik Lissner
20c80c461e
fix: void-function use-dialog-box-p
This function doesn't exist before Emacs 29, and also isn't meant to be
used in a global context.

Amend: 6a44a2ea80
2025-04-15 17:21:14 -04:00
Henrik Lissner
a13719af45
refactor(lib): backport static-{if,when,unless}
And deprecate our eval-{if,when}! macros.
2025-04-15 00:39:10 -04:00