783 Commits

Author SHA1 Message Date
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
14189be77c fix: out-of-bounds error if this-single-command-raw-keys is empty
It seems there's an edge case in EXWM where input events may occur
without keys to cause them (#8064), so these two keybind fixes need to
be ready to receive an empty vector from `this-single-command-raw-keys`.

Fix: #8064
2024-09-13 23:07:13 -04:00
9359a81e81 fix: gui frames fail to open from emacsclient
This was a tricky regression to track down. 9753bfb tries to fix an
issue where the `default` face's :foreground changes to `#000000` in any
new frames created after the initial one (by calling `make-frame`),
because those frames' `background-color` and `foreground-color`
parameters default to "#000000" (possibly a bug with `disable-theme` too
eagerly defaulting them to black).

240493a replaces that with new, seemingly cleaner approach: setting
`frame-inherited-parameters`, which instructs `make-frame` to copy those
parameters from the last open frame, however, those parameters in the
initial daemon frame will be set to "unspecified-bg" or
"unspecified-fg" (see the docstring for `face-{back,fore}ground`), which
are invalid color strings. `make-frame` crashes tries to create a frame
with those color values, causing #8059.

Fix: #8059
Amend: 240493ae92
Amend: 9753bfb775
2024-09-12 06:06:25 -04:00
288b6dc962 fix(cli): doom run: symlinks to XDG dirs beyond $HOME
The targets for $XDG_*_HOME symlinks weren't created correctly if they
were set to an absolute path outside of the user's $HOME.

Fix: #8062
2024-09-11 20:08:16 -04:00
9bd9d55354 fix(lib): define doom-context-error 2024-09-11 19:46:15 -04:00
3256fc7fca fix: trigger defcustom setters in files opened from command-line 2024-09-11 19:46:15 -04:00
19d68887b1 refactor: remove redundant auto-mode-alist entries
I moved these into lisp/init.el in e02d3c7, but didn't remove the old
forms (though they weren't doing anything, anyway).

Amend: e02d3c79a9
2024-09-11 19:46:15 -04:00
70bfb9f0e9 docs: letf!: add demo & rewrite docstring 2024-09-11 19:46:15 -04:00
a974210605 refactor(lib): letf!: use define-advice & split defun/defun* 2024-09-11 19:46:15 -04:00
4ca5819532 fix(lib): file!: lower current-load-list priority
Also changes it to consider base buffer's filename (for `eval`
contexts).
2024-09-11 19:46:15 -04:00
f8f2b28580 feat: add doom-log-level
Gives doom-log that capability of indicating log levels for its
messages, so that I can later work of reducing excessive logging in
`doom-debug-mode`.
2024-09-11 19:46:15 -04:00
771fccc52b nit: minor reformatting & revision
Also corrects the version string of obsolete variable `+mu4e-backend`.
2024-09-11 19:46:14 -04:00
6d7a39c482 tweak: load site-lisp verbosely in debug mode 2024-09-11 19:46:14 -04:00