Commit Graph

668 Commits

Author SHA1 Message Date
9c8ea37a2d refactor(cli): remove cli/packages.el
This file is mostly redundant. There is much more trimming/culling of
Doom's package API pending, but I'll save that for v3.
2024-12-01 01:20:38 -05:00
9aaefbe4ae refactor: remove redundant straight hacks
These were moved to doom-straight and renamed in 8cafbe4.

Amend: 8cafbe4408
2024-11-30 22:50:27 -05:00
3401492c84 refactor: deprecate letenv!
`letenv!` is a layover from the days before
`with-environment-variables` (introduced in 28.x), and it remained
afterwards because I preferred the shorter name. From v3 and onward,
Doom's core will be put on a diet which, among other things, will
include culling redundant or superfluous functions/macros like this one.
2024-11-30 22:50:27 -05:00
a39dd36e97 refactor: move templates/ to static/
To better reflect what this directory is intended to store (i.e. not
just templates).
2024-11-30 22:50:27 -05:00
201321c929 feat(lib): backport safe-local-variable-directories
Necessary to silence safe-local-variable warnings/prompts for $EMACSDIR
and $DOOMDIR, later.
2024-11-30 22:50:27 -05:00
da08aa2d7d feat(lib): backport major-mode-remap{,-alist}
Will be necessary for treesit.el support coming to the :tools
tree-sitter module later.
2024-11-30 22:50:27 -05:00
3b6e46ef00 feat(lib): move backports to doom-compat.el
Moves backports to new doom-compat library.

Also rolls out defbackport! calls, because it's unnecessary boilerplate.
2024-11-30 22:49:35 -05:00
bf9249d002 docs: don't recommend doom/reload
Many users seem to treat `doom/reload` like a 1-to-1 replacement for
`doom sync` + restart Emacs (which it is not), and are surprised when it
fails to properly "reload" their config. I'm considering removing
`doom/reload` altogether for this reason, or turning it into a light
wrapper around `restart-emacs`, but for now I'll settle for recommending
it less in documentation and comments. The references in docs/*.org will
be dealt with later.
2024-11-25 20:28:45 -05:00
97387b89fb fix(lib): with-doom-module: nil -> empty doom-module-context
Would throw an "Invalid key: nil" error if KEY was `nil`.

Fix: #8176
Amend: 8cafbe4408
2024-11-25 17:10:10 -05:00
169540ad3b feat(lib): add doom-copy
For deep-copying. Necessary for coming changes.
2024-11-25 17:09:54 -05:00
9c8cfaadde fix(cli): doom sync: void-variable envvars error
For Windows users only.

Amend: 8cafbe4408
2024-11-23 08:34:34 -05:00
87a024ee90 fix: don't byte-compile profile init file
The performance benefit of doing so has always been questionable or, at
best, negligible, but has caused numerous issues over the years. The
latest one being #8162, where byte-compiling a profile init file with
too many package autoloads would consume more than 255 opcodes, causing
an overflow error.

For simplicity's sake, Doom will no longer byte-compile this file.

Fix: #8162
2024-11-19 00:40:57 -05:00
caab7f9263 nit: move obsolete aliases
To group together everything I plan to delete in v3.
2024-11-15 04:08:23 -05:00
2373511daf refactor(lib): deprecate doom-plist-get
It's redundant with cl-getf, and so will be removed in v3.0.
2024-11-15 04:08:23 -05:00
fa0a83ff2f feat(lib): add doom-plist-{map,map*} 2024-11-15 04:08:16 -05:00
7bc39f2c14 fix: restore noninteractive init settings
Accidentally removed in 8cafbe4, when it was supposed to be moved.

Amend: 8cafbe4408
2024-11-14 05:16:57 -05:00
87833005fd tweak(cli): remove 'doom i' alias
Freeing this up to use for a future command (doom init), and because
'doom install' ought to be used very rarely and deliberately, so it
shouldn't have a convenient alias anyway.
2024-11-13 17:21:32 -05:00
5e84709577 nit(cli): fix print-group! indentation 2024-11-13 17:10:09 -05:00
cb557319a9 fix(lib): silence deprecation notice from autoload.el
It's been replaced with loaddeffs-gen.el in >=30, but we can't switch to
it until we've dropped 29.x support.
2024-11-13 17:09:36 -05:00
1af6fe8502 fix(cli): cull empty let-forms in autoloads
Amend: 114f99688c
2024-11-12 05:37:12 -05:00
989e7a0034 fix(cli): decli-group!: indentation 2024-11-12 04:30:12 -05:00
68ace9c1f1 docs(cli): report full command in command-based errors 2024-11-12 04:30:09 -05:00
fdcab58a1b fix: raise compile errors from profile init files
Otherwise, errors in package/module/user autoloads could cause `doom
sync` to silently and invisibly fail.

Fix: #7253
2024-11-08 01:18:48 -05:00
eea00f5d45 refactor: remove doom/goto-private-*-file commands
These commands were removed in an ongoing effort to slim down Doom and
its core. The `doom/goto-private-*-file` family of commands were
redundant with `doom/open-private-config` and
`doom/find-file-in-private-config`.
2024-11-07 04:03:13 -05:00
6a8c09f012 fix: package autoload order
This is an old issue that's haunted Doom for a while. I had initially
planned to wait until the switch to Elpaca, but I decided to just sit
down and solve this.

This ensures package autoloads are always written in depth-first
dependency order to Doom's profile init file, preventing load-order
issues like the notorious void-function geiser-activate-implementation
error. `geiser` needs to be built before any `geiser-*` plugins, since
its plugins reference variables/functions in geiser's own autoloads, but
there's no way to enforce package order in `straight--build-cache`
currently, and subsequent package updates (or just deleting package
directories by hand) can change the order of straight's build-cache in
subtle ways.

Fix: #7693
Fix: #7472
2024-11-07 02:48:52 -05:00
bcd399d1c3 fix: more void-variable doom-module-*-file errors
A stop-gap until the third follow-up to 8cafbe4 is complete.

Fix: #8153
Amend: 8cafbe4408
2024-11-06 18:23:47 -05:00
1b826fa80f refactor: remove load suffix hacks
The lexical bindings for the load suffix variables in early-init.el does
this work already, so affecting the global state of these variables is
redundant and overkill.
2024-11-06 06:13:19 -05:00
0f556345fd fix: remove custom-dont-initialize hack
It seems either Emacs' warning library and/or debugger relies on
custom.el functionality at load time to properly function. If
`custom-dont-initialize` is non-nil when a warning or error occurs,
Emacs fails to fully load the `warning` or `backtrace` libraries,
causing this error to obscure the true warning/error with:

  Error in delayed-warnings-hook (display-delayed-warnings): (void-variable
  warning-minimum-log-level)
2024-11-06 06:12:22 -05:00
48d043301e fix: void symbol doom-module-packages-file
From `doom/reload-packages` and various `doom/bump-*` commands. This is
a stop gap solution until the next big refactor.

Fix: #8149
Amend: 8cafbe4408
2024-11-04 20:44:35 -05:00
0b79fd3391 fix: doom-autoloads--scan: set load-true-file-name too
Ref: 114f99688c
2024-11-04 20:41:55 -05:00
e1a2f94ec1 fix: void-variable doom-module-load-path error
`doom-module-load-path` will be removed in the next big refactor commit,
so as a stop gap, I simply move it to doom.el to resolve the reference
error.

This also removes the obsolete alias `doom-modules-dirs`, since it's
been deprecated long enough (and `doom-module-load-path` itself won't be
around much longer anyway).

Ref: #8147
Amend: 8cafbe4408
2024-11-04 18:23:25 -05:00
e2c1801e6a fix: doom/reload: void-variable doom-module-init-file
Fix: #8147
Amend: 8cafbe4408
2024-11-04 18:17:59 -05:00
1d3c2db274 fix: doom-autoloads--scan: s/pfile/file
This typo is responsible of a startup error `delayed-warnings-hooks
void-variable warning-minimum-log-level`.

Fix: #8144
2024-11-04 12:31:11 -05:00
7531c4298e fix: indexing packages' Info documents (part 2)
The issue required a more systemic fix, because the former (before
9e6c46a even) only recorded `Info-directory-list` for the packages that
were installed/updated in that `doom sync` session, forgetting all
packages installed in the past.

Fix: #8143
Amend: 9e6c46a332
2024-11-03 22:33:13 -05:00
b26980a4a4 fix: reversed autoloads
Autoloads were accidentally reversed in 114f996. For some packages,
autoload order is signifcant (such as json-mode, which autoloads
json-mode-auto-mode-list first, then modifies it in a later autoload).

Fix: #8143
Amend: 114f99688c
2024-11-03 21:22:30 -05:00
b3aa41fd74 refactor: profile generators 2024-11-03 21:03:40 -05:00
9e6c46a332 fix: indexing packages' Info documents
Fix: #5457
2024-11-03 21:03:40 -05:00
114f99688c fix: nil load-file-name in package autoloads
Some packages do funky things in their autoloads, so care is needed to
closely emulate an autoloading environment when loading them, however,
in 8cafbe4, Doom wraps these autoloads in a function, thus ensuring
they're executed without `load-file-name` or `load-in-progress` set,
which some packages will expect these in their autoloads.

This fixes the (wrong-type-argument stringp nil) error some folks see
with certain packages doing said funky things in their autoloads (like
realgun in the :tools debugger module).

Fix: #8143
Amend: 8cafbe4408
2024-11-03 21:02:32 -05:00
5649e1acc4 fix: incorrect value for user-init-file
This wasn't really causing any noticable issues, but should be corrected
in any case.
2024-11-03 15:19:54 -05:00
1f45e9e79e refactor: remove redundant require calls
Amend: aab1595011
2024-11-03 15:19:54 -05:00
0b9342589b fix(cli): doom upgrade: void-variable straight-repository-branch
'doom upgrade' naively evaluates straight's recipe so it can delete
it (so 'doom sync' will upgrade it), but the
`straight-repository-branch` reference will error out for users updating
Doom from before 8cafbe4 to a commit after it, since its value now lives
in `doom-straight`, which may not be loaded yet.

Rather than further embed this hack (and because I don't want to spend
more time on straight.el accommodations than I have to, since it'll be
replaced with Elpaca soon), I simply replace the reference with its
value.

Fix: #8140
Amend: 8cafbe4408
2024-11-03 15:19:46 -05:00
f425f2ff3d fix: more void-variable errors
For `straight--build-cache` and `doom-modules`.

Fix: #8140
Amend: 8cafbe4408
2024-11-03 12:36:38 -05:00
aab1595011 fix: void-variable straight-base-dir errors
Fix: #8140
Amend: 8cafbe4408
2024-11-03 12:00:22 -05:00
7c89699e3f fix: silence (if|when)-let deprecation warnings
Seems these two macros were marked obsolete very recently on Emacs 31.1
in favor of (if|when)-let*. Since the change seems premature (judging
from the mailing list discussion), and because I disagree with the
change (and will redefine (if|when)-let if they actually go through with
removing them), I simply silence the warnings altogether. They're not
helpful for the end user and end up only spamming them with unactionable
warnings.

I'll wait until upstream figures it out before I make any decisions.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00637.html
2024-11-03 01:52:45 -05:00
8cafbe4408 refactor!: restructure Doom core
BREAKING CHANGE: This restructures Doom's core in an effort to slim it
down and partially mirror architectural changes coming in v3. This is
part 2 of 3 commits (part 1 being 1590434), done to facilitate a change
in part 3 that will introduce a new `doom!` syntax for pulling
third-party module libraries from remote sources (similar to `package!`
statements). I am backporting this from V3 so I can move our modules out
into separate repos sooner than later, so development on modules can
continue separately without interfering with v3's roll out.

Though this is labeled a breaking change, it shouldn't affect most users
except those few tinkering directly with Doom's internals.

Ref: 15904349cf
2024-11-03 01:52:28 -05:00
5dcba2f89f fix: permissions for local dirs
This prevents edge cases where these directories are created with
permissions that prevent Emacs from writing to them. This can happy
either due to an overly-restrictive default umask,
`set-default-file-modes` call, or if `doom-profiles-save` is instructed
to write a file whose parent doesn't exist yet.

Fix: #8134
2024-11-01 03:34:09 -04:00
bbf733c5e0 fix: profile loader file path
Should load the byte-compiled version of the file (and produce one
without a redundant emacs version suffix).

Amend: 9ae7aa1122
2024-11-01 03:07:20 -04:00
8a7b20c43d release(modules): 24.12.0-dev
Ref: 2b39e41368
2024-10-31 21:54:21 -04:00
d80c5e5115 bump: :doom
bbatsov/projectile@8cc2ee8937 -> bbatsov/projectile@0a15d81be9
emacs-compat/compat@e9203e1649 -> emacs-compat/compat@9a234d0d28
emacs-straight/project@5c77d78936 -> emacs-straight/project@2a3fe4c7db
gilbertw1/better-jumper@4762221378 -> gilbertw1/better-jumper@b1bf7a3c8c
radian-software/straight.el@08e197bfa6 -> radian-software/straight.el@33fb469506
rainstormstudio/nerd-icons.el@c3d641d8e1 -> rainstormstudio/nerd-icons.el@cc6c468303
2024-10-31 21:54:20 -04:00
ffac5ea4fa fix: doom-module-from-path: doom-{core,user}-dir detection 2024-10-31 21:54:20 -04:00