Commit graph

427 commits

Author SHA1 Message Date
Henrik Lissner
ec517a831c
fix(cli): void-variable doom-profile-env-file-name error
This variable ref snuck into cff0919, but hasn't been introduced yet.

Fix: #7755
Amend: cff091982e41
2024-05-21 17:17:03 +02:00
Henrik Lissner
56ae6cc1f2
fix(cli): void-function doom-packages-install error
Function was renamed to doom-packages-ensure in cff0919.

Fix: #7755
Amend: cff091982e41
2024-05-21 17:17:03 +02:00
Henrik Lissner
640875d051
tweak(lib): print!: join (path ...) segments 2024-05-21 17:17:03 +02:00
Henrik Lissner
d3e11c6d1a
bump: :core
Fuco1/smartparens@0778a8a840 -> Fuco1/smartparens@ddc6233ea6
bbatsov/projectile@e45f0b0cc4 -> bbatsov/projectile@0163b335a1
emacs-compat/compat@eb8fbfa558 -> emacs-compat/compat@8d4e8a3666
emacs-straight/project@10a6b691e3 -> emacs-straight/project@b6989856ab
joddie/pcre2el@018531ba0c -> joddie/pcre2el@380723b270
jscheid/dtrt-indent@0230ec5032 -> jscheid/dtrt-indent@5d1b44f9a1
justbur/emacs-which-key@4d20bc8525 -> justbur/emacs-which-key@96911a1d3f
noctuid/general.el@bda777cd30 -> noctuid/general.el@ced143c30d
radian-software/straight.el@b3760f5829 -> radian-software/straight.el@b1062df10b
rainstormstudio/nerd-icons.el@c6a4acf194 -> rainstormstudio/nerd-icons.el@8095215a50
2024-05-21 17:17:03 +02:00
Henrik Lissner
846649963d
tweak: move project-list-file to profile data dir
Ref: doomemacs/core#1
2024-05-21 17:17:02 +02:00
Henrik Lissner
92db1e27e3
refactor(cli): remove unused cli/help.el
This file was "renamed" to meta.el at some point, but the old file was
forgotten (and unused).
2024-05-21 17:17:02 +02:00
Henrik Lissner
ccd6e5cb9d
fix(cli): appease byte-compiler wrt defcli-obsolete! 2024-05-21 17:17:02 +02:00
Henrik Lissner
5e1734005c
nit: reformat core packages.el 2024-05-21 17:17:02 +02:00
Henrik Lissner
d8ba772d1c
refactor(cli): rename 'doom purge' -> 'doom gc'
'doom purge' is now deprecated.

Also changes 'doom sync's -p option to --gc. Since GCing causes the loss
of historical data, I'd rather it be a long option to make it a little
harder to do accidentally.
2024-05-21 17:17:02 +02:00
Henrik Lissner
904bfc1f9b
fix(cli): rewrite 'doom sync'; deprecate 'doom build'
This changes 'doom sync' to be smarter about responding to changed
package recipes/pins, changes in Emacs version, or instances where the user
has copied a config to a new system.

In all these cases, the user would formerly have to know about a
specific combination of 'doom sync -u' and 'doom build' to ensure Doom
is in a good state. With this change, 'doom sync' handles all these
cases.

Also, 'doom build' is now deprecated (and 'doom sync' now has a
--rebuild option to mimic its old behavior).

Also also, sometimes, a package may silently fail when cloned (which
used to result in an empty repo). Now, if this is detected, cloning will
be re-attempted up to 3 times before aborting with much more visible
error.

Note: these are stopgap solutions, until v3 is finished.
2024-05-21 17:17:02 +02:00
Henrik Lissner
d92d69ae7c
fix(cli): retry on failure to clone packages (or abort)
Something often reported are file-missing errors when a package that
should be present isn't. This can easily happen if, say, during a 'doom
sync' or 'doom upgrade' a package fails to clone correctly and the user
misses the errors, then tries to carry on as normal. What's worse is
that Straight leaves behind an empty directory, which it treats as a
sign that the package has been cloned correctly, so it doesn't raise any
fuss over them.

With this change, 'doom sync' (and 'doom upgrade') will now try again,
if the clone process fails the first time (up to 3 times) before
aborting the whole process altogether, which should be loud enough for
users not to miss. Note that these failures at 99.99% because of
network (or upstream downtime) issues.

For now, this does leave Doom in an incomplete state (until you try
again when the connection issue is resolved), but a rollback step will
be added in v3 to prevent this, as well as better error messages (as
well as @doomelpa mirror for packages on less reliable hosts, like
codeberg, savannah, etc).
2024-05-21 17:17:02 +02:00
Henrik Lissner
9ef0b49515
refactor!(cli): remove compile and clean commands
BREAKING CHANGE: This removes the 'doom compile' and 'doom clean'
commands, and offers no immediate replacement for them (and no plan to
include one). In the future, byte-compilation of Doom's internals will
be baked into 'doom sync', but until then, Doom is not optimized to take
advantage of byte-compilation, and forcing it provides no benefit.
2024-05-21 17:17:01 +02:00
Jonas Jelten
0cb9efcbca
feat: allow setting evil states for leader keys
This allows adjusting the evil-states a leader key is active for.
2024-05-21 17:17:01 +02:00
Henrik Lissner
6e60a5921c
tweak: enable startup optimizations in debug mode
Before this, startup optimizations were disabled in debug mode, but more
often than not, this just made it difficult to reproduce some errors at
startup.
2024-05-21 17:16:58 +02:00
Henrik Lissner
f62a1f640b
refactor: inline doom--make-font-specs
This function isn't (and won't be) used anywhere else. No reason for it
to be its own function.
2024-05-21 17:16:56 +02:00
Henrik Lissner
1aaaf9b851
refactor: consolidate startup--load-user-init-file advice
Splitting up all this advice was unnecessary noise.
2024-05-21 17:16:56 +02:00
Henrik Lissner
aedf2a194f
fix: shut up site-lisp
One various OSes, Emacs ships with site-lisp files that load
OS/architecture-specific config (like native-comp config), or load-lines
for Emacs packages installed via your OS package manager (like mu4e).
Output from these are rarely suppressed, for some reason, which causes
noise in *Messages* at startup, which triggers a redraw, which can be
very expensive during startup, depending on your window system.
2024-05-21 17:16:56 +02:00
Henrik Lissner
4997015ac7
fix: ensure inhibit-* is reset on startup error 2024-05-21 17:16:56 +02:00
Henrik Lissner
9658b06260
fix: tiny fonts in (daemon) GUI frames
Due to a suppressed void-variable error, font initialization is
short-circuited across daemon frames when the fonts are reloaded or
changed (which is also triggered by changing themes), resulting in
malformed (often tiny) fonts in GUI frames.

Fix: #7730
2024-05-21 17:16:55 +02:00
Henrik Lissner
88cfbf8307
fix: save-place: don't move point more than once
In some contexts, like org-agenda-switch-to visiting a TODO in an agenda
file, the visiting command will move the cursor after opening the file.
If save-place moves the cursor yet again, the cursor will end up in an
unpredictable place.
2024-05-21 17:16:55 +02:00
Henrik Lissner
22309ad240
release(modules): 24.03.0-dev
Ref: 2b39e41368
2024-05-21 17:16:54 +02:00
Henrik Lissner
73bfaf7122
fix(cli): silence output from site-lisp
Some site files will forcibly undo `inhibit-message` or set
`force-load-messages`. This ensures site lisp files don't make
unnecessary noise at startup.
2024-05-21 17:16:53 +02:00
Henrik Lissner
9f2071808b
refactor(lib): doom-region-end: extract marker 2024-05-21 17:16:53 +02:00
Henrik Lissner
0197991038
refactor(lib): use doom-region-{beginning,end} 2024-05-21 17:16:53 +02:00
Henrik Lissner
316a6f0746
fix: doom-incremental-first-idle-timer: type error when nil (part 2)
Amend: 2bce9dbc1ad1
Ref: #7710
2024-05-21 17:16:53 +02:00
Henrik Lissner
d4c3b12390
nit: revise and reformat comments 2024-05-21 17:16:52 +02:00
Henrik Lissner
87c33db473
refactor: remove explain-pause-mode
Tools like these will be moved to a benchmark module later (or perhaps
to `:lang emacs-lisp`). For the time being, it only takes up extra space
that few users use.
2024-05-21 17:16:52 +02:00
Henrik Lissner
51dcf7da6a
feat(lib): backport find-sibling-file
I will slowly phase out projectile in favor of project.el, starting with
projectile-find-other-file, which -- as of Emacs 29 -- has a native
alternative: `find-sibling-file`.

Ref: doomemacs/community#1
2024-05-21 17:16:52 +02:00
Henrik Lissner
29fc1dfd6d
fix(lib): only use alpha-background on pgtk builds
Fix: #7721
2024-05-21 17:16:51 +02:00
Henrik Lissner
5fb7dd6dfa
fix: doom-incremental-first-idle-timer: type error when nil
If the user uses the doom-load-packages-incrementally function directly,
and has set doom-incremental-first-idle-timer set to nil, it will throw
a type error.

Close: #7710
2024-05-21 17:16:51 +02:00
StrawberryTea
e0c784ecaa
fix(popup): allow killing popup buffers
Currently, `SPC b k` does not allow us to kill popup buffers. If we are
say using a comint/eshell/eat buffer and we borked the state while
testing hooks or we sent EOF to the underlying process, our intention
with `SPC b k` is to kill the underlying buffer.
2024-05-21 17:16:50 +02:00
Henrik Lissner
b4374278a3
fix: define doom-font-error
Was meant to be in 98d753e.

Amend: 98d753e1036f
2024-05-21 17:16:48 +02:00
Henrik Lissner
46ad9b0d6f
fix(org): don't change tab-width in org-mode
Recently, org-mode made a non-standard tab-width an error state.
Unfortunately, it's way too easy for users to accidentally change
it (e.g. with editorconfig, indiscriminate setter hooks, or other
packages), and since there is zero reason to ever want a non-standard
tab-width in org-mode, I not only exclude it from dtrt-indent as a
global default (i.e. not only as part of :lang org), but I add a late
org-mode-hook hook to reset tab-width, just in case.
2024-05-21 17:16:48 +02:00
Henrik Lissner
344881cbf5
fix: blank frame on can't-find-font error during startup
Due to our inhibit-redisplay hack, a missing font could lead to a blank
Emacs after startup. This change fixes that so that not only is an error
emitted when Emacs can't find your font, but the error will be a little
more readable.

This is a stopgap solution until I finish a better one I'm preparing for
v3.

Fix: #7055
2024-05-21 17:16:47 +02:00
TEC
bbf8934fd3
tweak(cli): use fancier string-dist suggestion alg
To improve the quality of "did you mean?"-style suggestions, shift from
using Ratcliff-Obershelp similarity to the Restricted
Damerau-Levenshtein string distance (also known as Optimal String
Alignment).

This code is a translation of a Julia implementation that I wrote a
while ago:
https://github.com/tecosaur/DataToolkitBase.jl/blob/v0.4.1/src/model/utils.jl#L40-L107

See https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance
and https://en.wikipedia.org/wiki/Gestalt_pattern_matching for more
information on these algorithms.
2024-05-21 17:16:46 +02:00
Henrik Lissner
9a56a6feee
fix: exclude indent detection in derived modes
Changes what major modes we exclude from dtrt-indent's auto-detection.
Any mode in doom-detect-indentation-excluded-modes, plus derived modes,
will be excluded instead of only the parent modes.

This indirectly fixes an issue where org-mode derivatives (like
org-journal-mode) have their tab-width changed (#7670), causing the
`org-current-text-column` macro to throw the following error:

  Tab width in Org files must be 8, not N.  Please adjust your
  `tab-width' settings for Org mode.

I opted for this solution instead rather than adding all possibly
derivatives to `doom-detect-indentation-excluded-modes`.

Fix: #7670
Ref: 38dd882685/lisp/org-macs.el (L1154)
2024-05-21 17:16:45 +02:00
Mathew
e3deab3e21
fix(lib): doom/sudo-find-file: expand given path
It's possible for the user to type shell variables (something like
`$MYVAR/dir/filename`) as part of the filepath, so we need to call
`expand-file-name`.
2024-05-21 17:16:44 +02:00
Henrik Lissner
89d8170eac
fix(lib): doom-project-find-file: remove +vertico/consult-fd-or-find
When +vertico/find-file-in was replaced in 60e22fd with
+vertico/consult-fd-or-find, it changed a key behavior for
doom-project-find-file for Vertico users: instead of displaying an
initial list of all files under the target directory, it would display
nothing until the user entered in N * `consult-async-min-input`
characters, causing confusion (see linked comment).

Since Vertico integration modifies project-find-file-in's interface
appropriately, I leave it to that command instead.

Ref: https://github.com/doomemacs/doomemacs/issues/7312#issuecomment-1933404444
Amend: 60e22fd2eb61
2024-05-21 17:16:44 +02:00
Henrik Lissner
0c4c63200c
fix(lib): doom-project-find-file: cl-no-applicable-method project-root
Fix: #7312
2024-05-21 17:16:44 +02:00
Henrik Lissner
f748b9778a
fix(cli): ensure $EMACSDIR/lisp/cli is in $DOOMPATH
If $DOOMPATH is malformed or set to a value that does not contain a
valid path to Doom's CLI library in $EMACSDIR/lisp/cli (see #7608),
bin/doom no longer functions, emitting "a subcommand is required"
errors.

This change ensures that the CLI library is always the last (implicit)
element in doom-cli-load-path, and ensures $DOOMPATH is never written to
the user's envvar file (in case they try to use bin/doom from inside a
terminal within a Doom Emacs session), which should ensure users -- at
least -- never find themselves stranded without the Doom CLI.

Fix: #7608
Co-authored-by: bpizzi <bpizzi@users.noreply.github.com>
2024-05-21 17:16:43 +02:00
Zero King
db039b4d1c
fix: void-variable doom-modules-load-path error
Amend: 343c3a82b06a
2024-05-21 17:16:43 +02:00
Henrik Lissner
9b8c8449c6
refactor: remove all-the-icons
I began phasing out all-the-icons in 9787022. Now that Doom has
no (first order) dependencies that depend on it (and enough time has
passed), it's time to remove it.

Ref: 9787022b839d
2024-05-21 17:16:42 +02:00
Henrik Lissner
bffa3f2694
bump: :core
bbatsov/projectile@9446ea92d2 -> bbatsov/projectile@e45f0b0cc4
domtronn/all-the-icons.el@be9d5dcda9 -> domtronn/all-the-icons.el@ee41438493
emacs-compat/compat@ea8de2ea18 -> emacs-compat/compat@eb8fbfa558
emacs-straight/project@f64bcf065c -> emacs-straight/project@10a6b691e3
jscheid/dtrt-indent@e0630f74f9 -> jscheid/dtrt-indent@0230ec5032
noctuid/general.el@833dea2c4a -> noctuid/general.el@bda777cd30
rainstormstudio/nerd-icons.el@e109d09b95 -> rainstormstudio/nerd-icons.el@c6a4acf194
2024-05-21 17:16:42 +02:00
Henrik Lissner
48bc13670d
fix: doom-module-locate-paths: remove file-name-sans-extension call
This was preventing its usage in :lang emacs-lisp from finding demos.org
files in modules.

Amend: 3bea4f66a844
2024-05-21 17:16:39 +02:00
Henrik Lissner
a2d6a985fc
refactor: s/doom-modules-dirs/doom-module-load-path/
Ref: fc6934c24073
2024-05-21 17:16:39 +02:00
Henrik Lissner
e448f819e0
tweak(lib): doom-info: show $EMACS/$EMACSDIR 2024-05-21 17:16:37 +02:00
Henrik Lissner
df2cd34403
nit: fix s/make/bake typo 2024-05-21 17:16:37 +02:00
Henrik Lissner
c52ca4d4a7
nit: doom-modules: reformat & declare obsolete variables defs 2024-05-21 17:16:37 +02:00
Henrik Lissner
f3edcb9f3d
refactor(emacs-lisp): elisp-demos: reorganize Doom demos
- Move Doom core elisp API demos out of docs/examples.org into lisp/demos.org.
- Recognize and search demos.org file in modules for additional
  demos (including $DOOMDIR/demos.org).
- Refactor emacs-lisp module to use new elisp-demos-user-files variable
  instead of an advice. This way, elisp-demo's commands (such as
  `elisp-demos-find-demo` and `elisp-demos-add-demo`) will include
  Doom's demos.
2024-05-21 17:16:37 +02:00
Henrik Lissner
4541a42db4
refactor: doom-module: conform variables to conventions
- Rename doom--empty-module-context to doom-module--empty-context.
- Nest doom-module-context symbol plist in its 'keys' property. (By
  convention, Doom uses keywords as keys in most places. Let's be
  consistent)
- Updates all uses of doom-module--context-field and
  doom-module-context-get.
2024-05-21 17:16:37 +02:00