159 Commits

Author SHA1 Message Date
ed9190ef00 fix(cli): infinite loop linting long lines in commits
Fix: #8425
2025-07-13 22:28:34 +02:00
3d75d8e205 fix(cli): doom emacs: command not found
Being the flawless professional that I am, I forgot to include the
source code for `doom emacs` in 7f6a2d2.

Fix: #8429
Amend: 7f6a2d284e
2025-06-26 22:54:37 +02:00
7f6a2d284e refactor(cli): doom run: rename to 'doom emacs'
In v3, 'doom run' will have a different purpose (for launching project
or CI/CD tasks), so it now emits a warning that it's moved to a new
'doom emacs' command.

I refrain from updating documentation because a rewrite of our docs will
be coming up soon.
2025-06-25 17:36:59 +02:00
cbdce0dc71 refactor(cli): doctor: extract symlink check to function 2025-04-11 12:17:48 -04:00
dac6e05b87 refactor: deprecate appendq!, prependq!, & delq! macros
In the interest of slimming down Doom's core (as we near v3), I've
deprecated these macros. They doesn't really need to exist. Sure, the
alternatives aren't as ergonomic or elegant, but they're good enough
that we don't need these trivial wrappers. Their local uses have been
refactored out as well.
2025-03-25 14:16:56 -04:00
6e6eaa1189 docs: bump latest supported Emacs version to 30.1
30.1 was released yesterday.

Fix: #8283
2025-02-24 23:40:00 -05:00
75a995f66f docs: detect nushell on windows too
Amend: 1a86360560
2025-01-10 18:41:25 -05:00
1a86360560 docs: warn users about nushell issues
Like Fish, using nushell as your shell-file-name can cause downstream
issues wherever Emacs (or Emacs packages) spawn child processes via a
shell command and rely on its output. For example: diff-hl users may not
see a git gutter if nushell (or fish) is their $SHELL.
2025-01-10 18:13:24 -05:00
eccd72922b fix(cli): show "restart Emacs" advice only if Emacs is running
Also fixes the case where it'll appear, unconditionally on 'doom
install', where the advice doesn't make sense.
2025-01-09 14:31:26 -05:00
295cee7c78 refactor(cli): s/doom-cli-sync-info-file/doom-sync-info-file
To conform to new naming conventions.
2025-01-09 14:28:54 -05:00
0a715cc3f2 refactor: (if|when)-let -> (if|when)-let*
With the former macros' future in the air (and likely to be targeted in
future, potentially breaking changes), I'll deal with this now than have
it bite me later.

Ref: https://lists.gnu.org/archive/html/emacs-devel/2024-10/msg00637.html
2025-01-08 19:33:37 -05:00
abedb71f96 refactor(cli): restructure doom profile commands
- Replace 'doom profiles sync' with 'doom profile sync --all'.
- Move lisp/cli/profiles.el to lisp/cli/profile.el.
- Move obsolete alias to bin/doom.
2024-12-01 01:57:46 -05:00
be6fcece3a fix(cli): doom gc
cli/gc.el accidentally snuck into 5e84709, along with a particular
v3-isms that doesn't belong in Doom yet, such as autoloads in CLI libs
and them providing subfeatures of doom-cli, rather than doom-cli-*.
These have been reversed for now.

Amend: 5e84709577
2024-12-01 01:20:41 -05:00
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
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
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
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
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
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
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
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
a940ac5614 fix(cli): doom install: load $DOOMDIR/cli.el too
In case the user's put some configuration in cli.el that could be
relevant to eventual profile generation.
2024-09-04 15:04:32 -04:00
1a5ff08da4 fix(cli): doom install: bootstrap other profiles if present
Like 'doom sync', have 'doom install' set up the profiles bootloader.
2024-09-04 15:04:32 -04:00
42df7cb9fd docs(cli): doom install: reformat output
Also simplifies the first-timer "things you should know" snippet after
running 'doom install'.
2024-09-04 15:04:32 -04:00
559e5b6a96 docs(cli): doom gc: corrections
To reflect changes made to this command when it was renamed 'doom gc'
(from 'doom purge').
2024-09-03 04:04:29 -04:00
5c7f6f5c41 fix(cli): don't native-comp site-files without --aot
Amend: e3fdfee1c5
Ref: #6811
2024-09-03 04:04:22 -04:00
3bced4dbbe refactor(cli): separate cli bootstrap from lib
Eventually, I want to autoload some of this stuff, so that users in
interactive sessions can safely load it without side effects (useful
when writing their own CLIs or editing Doom's source).
2024-09-01 14:45:52 -04:00
069ea9e02f fix(cli): straight: highlight 'Reset "*" to "*"' option 2024-08-31 21:50:08 -04:00
79910fba42 fix(cli): wrong-number-of-args error from mapconcat
On Emacs <=28.2, mapconcat's third argument isn't optional.

Amend: 7f175ab6d9
Ref: #8024
2024-08-30 04:57:29 -04:00
7f175ab6d9 fix(cli): inconsistent system hash between sessions
sxhash doesn't guarantee hashes are consistent across Emacs sessions, so
use md5 instead. Also simplifies what's getting hashed;
`system-configuration` is a sufficient substitute for both `system-type`
and what I wanted to glean from changes in
`system-configuration-features`.

Amend: 80e9263b85
Close: #8030
Ref: #8024
Co-authored-by: yaaama <yaaama@users.noreply.github.com>
2024-08-29 15:44:29 -04:00
6077b6f0d8 fix: correct version string in obsoletion calls 2024-08-26 18:07:47 -04:00
80e9263b85 fix(cli): doom sync: heuristic for total rebuilds
Fix: #8024
2024-08-26 02:16:03 -04:00
e21e01d4c2 fix(cli): doom env: blacklist $WAYLAND_DISPLAY 2024-08-23 02:50:19 -04:00
c901f5806e fix(cli): straight ignoring native-comp-jit-compilation-deny-list
Turns out native-comp doesn't respect
`native-comp-jit-compilation-deny-list` if called explicitly (instead of
from deferred compilation).

Fix: #5592
Fix: #6283
Fix: #3655
2024-08-23 02:50:19 -04:00
1912571c9c docs: minor revisions of docstrings across core+cli 2024-08-15 23:24:56 -04:00
3a2c234b1c fix(cli): don't AOT native-comp if disabled 2024-08-15 15:46:47 -04:00
4fcf332749 refactor: generalize fd/ripgrep vars & options
I intend to eventually replace projectile with project.el, so these
doom-projectile-* variables need to be generalized, starting with the
fd/ripgrep executable paths.

ALong with that, this refactors Doom's projectile-generic-command to
lean more on built-in fd support in projectile, where possible (fewer
wheels reinvented).

Ref: doomemacs/core#1
2024-08-09 21:03:37 -04:00
e3fdfee1c5 feat(cli): add --aot option
Allow ahead-of-time native-compilation during CLI operations that
install or update packages. This will not retroactively native-compile
already-installed packages, you'll need to use --rebuild to do so.

(This is a stop-gap solution until the v3.0 release)

Fix: #6811
2024-08-08 17:26:54 -04:00
2c17f71965 fix(cli): don't prompt to rebuild if --rebuild is given
When running `doom sync --rebuild` after emacs upgrade the user is
prompted with "Installed packages must be rebuilt. Do so now?", even
though doom was explicitly instructed to rebuild. This PR removes this
prompt when the `--rebuild` option is provided
2024-08-06 13:02:13 -04:00
b163c21fe5 fix(cli): --force: handle more straight prompts
Fix: #7906
2024-07-28 15:21:13 -04:00
54a084fed7 fix(cli): some package files not being byte-compiled
Fix: #7707
Ref: radian-software/straight.el#1132
2024-07-26 04:46:54 -04:00
5852b2ecf5 fix(cli): properly overwrite last line of output
Before this, text that extended past the new line's length would
persist, causing garbled output like this:

  > Ensuring packages are installed and built...
    > Updating recipe repos...
    > Cloning org-appear...r emacsmirror-mirror...
    - No packages need attention

Which might lead you to believe org-appear is being cloned from
emacsmirror-mirror, but the full output is actually:

  > Ensuring packages are installed and built...
    > Updating recipe repos...
      > Updating recipes for melpa...
      > Updating recipes for nongnu-elpa...
      > Updating recipes for gnu-elpa-mirror...
      > Updating recipes for el-get...
      > Updating recipes for emacsmirror-mirror...
    > Cloning org-appear...
    - No packages need attention
2024-07-26 04:46:54 -04:00
98a3cad54d docs: minor docstring revisions
For clarity only. These do not reflect any recent changes.
2024-07-18 22:38:59 -04:00