Commit Graph

645 Commits

Author SHA1 Message Date
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
4d83719e58 fix: doom-module-context: make error free 2024-10-31 21:54:20 -04:00
9aa4470683 refactor: declare doom-module->context side-effect-free 2024-10-31 21:54:20 -04:00
fca6187021 refactor: with-doom-module: context constructor 2024-10-31 21:54:20 -04:00
db76813c26 refactor: rename doom-features to doom-system 2024-10-31 21:54:20 -04:00
25201a40f3 refactor: rename :core module group to :doom
I'll soon introduce a new family of core modules which will house most
of what's currently in the doom-*.el libs, moving them out of core.
2024-10-31 21:54:19 -04:00
9ae7aa1122 tweak: centralize profile loader script
Because this file serves as a global manifest for Doom's profiles, it
should be kept in a central location for any Doom instance to consult,
rather than per-instance. Plus, post-v3 Doom will only write files to
$XDG_*_HOME and $TMPDIR, therefore I'd like to avoid writing to
$EMACSDIR.

This change shouldn't affect end-users, in any case. Run 'doom sync' to
regenerate the file, which should happen when you run 'doom upgrade'
anyway.
2024-10-31 21:54:19 -04:00
fafdb25dd8 feat(lib): introduce doom-error & error functions 2024-10-20 02:41:51 -04:00
49f4bf6819 fix(lib): letf!: defun* indentation 2024-10-20 02:41:51 -04:00
15904349cf refactor!: module API
BREAKING CHANGE: This backports some architectural choices from v3.0.
This changes Doom's module API, renaming some functions and removing
others, in order to facilitate some new features, prepare to move Doom's
modules into separate repos, and make way for two, much larger breaking
commits coming in the next few days.

This commit won't break anything for users unless they're tinkering with
Doom's internals/using its `doom-module-*` API directly. I am avoiding
broader backwards incompatibilities until the 3.0 release.

What's new:

- Negated flags. (modulep! :editor evil -everywhere) will return non-nil
  if :editor evil is active without its +everywhere flag.
- `modulep!` now takes multiple flags to simplify AND checks. E.g.

    (and (modulep! +foo)
         (modulep! +bar)
         (not (modulep! +baz)))

  Can now be expressed with:

    (modulep! +foo +bar -baz)
- Adds pcase matchers for `doom-module-context` and `doom-module`
  structs, making the following destructuring binds possible:

    (pcase-dolist ((doom-module group name flags features)
                   (hash-table-values doom-modules))
      ...)

  This will be used more in v3.0.
- Adds file cookie support to module init.el and config.el files.

Here's a summary of breaking changes made in this commit:

- `doom-module-context` was changed from a vector to a struct (record).
- `doom-modules` is now a table of `doom-module` structs, rather than
  free-form plists.
- The following macros have been renamed:
  - `doom-context-with` -> `with-doom-context`
  - `doom-module-context-with` -> `with-doom-module`
- The followings functions have been replaced/removed:
  - `doom-module-context`+`doom-module-context-get` -> `doom-module`
  - `doom-module-set` -> `doom-module--put`
  - `doom-module-p` -> `doom-module-active-p`
  - `doom-module-context-key` (is now a getter with the same name)
  - `doom-module-put` (removed)
  - `doom-module--context-field` (removed)
- The signatures for these functions have changed:
  - `doom-module-get CATEGORY &optional MODULE PROP` ->
    `doom-module-get (GROUP . MODULE) &optional PROP`
  - `doom-module-locate-path CATEGORY &optional MODULE FILE` ->
    `doom-module-locate-path (GROUP . MODULE) &optional FILE`
  - `doom-module-expand-path CATEGORY MODULE &optional FILE` ->
    `doom-module-expand-path (GROUP . MODULE) &optional FILE`
- Adds the following functions
  - `doom-module-exists-p`
  - `doom-module-key`
  - `doom-module->context`
  - `doom-module<-context`
- Removes the following variables
  - `doom-module--empty-context`

This commit results in a little redundancy, which I will address in
parts 2/3 and/or v3.0.
2024-10-20 02:41:42 -04:00
8b9168de6e release(modules): 24.11.0-dev
Ref: 2b39e41368
2024-10-03 02:26:28 -04:00
df65137730 docs: warn Windows users about symlinks
This isn't important *yet*, but it will be post-v3.0, so might as well
start warning people early.
2024-10-02 21:55:50 -04:00
896204c8f7 docs: more robust nerd-icon doctor check
Fix: #7431
2024-10-02 21:53:43 -04:00
9df3787bc7 docs: warn about segfaults on Emacs 29.4 + PGTK
Fix: #7915
2024-10-02 21:53:40 -04:00
c88516d6bb docs: revise Emacs version warnings 2024-10-02 05:22:46 -04:00
ad29be39f6 refactor(lib): add provide lines 2024-10-02 05:15:58 -04:00
fe7b84966a bump: straight
radian-software/straight.el@88e574ae75 -> radian-software/straight.el@08e197bfa6

- Adds support for MELPA's :rename directive.

Ref: radian-software/straight.el#1167
2024-10-02 04:49:19 -04:00
8c7711920e fix(lib): doom/{reload,upgrade} on Windows
On Windows, don't execute the bash script.

Fix: #8098
2024-10-02 04:12:59 -04:00
c8a5e6ec1c fix: map!: allow :map values to be interpolated
With the comma syntax. E.g.

  (let ((maps '(some-mode-map another-mode-map)))
    (map! :map ,maps))

This technique was used in the recent rewrite of the Racket
module (1baebda), but I forgot to include this change, so Racket users
have probably noticed some missing keybinds! This fixes that too.

Amend: 1baebdafb3
Ref: #7543
2024-09-17 17:30:57 -04:00
037b018cdd feat: add .doommodule files
These optional dotfiles indicate the root of a module or module
group (:lang), and will later contain module metadata. They will also
serve as an alternative to packages.el and doctor.el, and will aide the
parts of the v3.0 module API concerned with resolving the current module
from a path (`doom-module-from-path`), which currently rely too heavily
on parsing path strings.

For now, however, they're simply placeholders.
2024-09-14 20:47:39 -04:00
66a2972ebf fix(lib): doom/set-indent-width on Emacs >=30
A built-in `editorconfig` package was added in Emacs 30, with a somewhat
different API from the other package of the same name.

Fix: #8072
2024-09-14 15:22:09 -04:00
fa6893eeea tweak(lib): doom-debug-variables: add doom-log-level 2024-09-13 23:07:14 -04:00
41987bb00f fix(cli): persist correct doom-log-level to after-scripts 2024-09-13 23:07:13 -04:00
0e5935f0f7 fix(cli): "Argument list too long" error from after-scripts
Because a persisted envvar was larger than MAX_ARG_STRLEN (which is
typically ~2kb).
2024-09-13 23:07:13 -04:00