Commit graph

590 commits

Author SHA1 Message Date
Henrik Lissner
fe0548e820
tweak: unbind SPC in y-or-n-p prompts
SPC is equivalent to y when y-or-n-p prompts you, which seems way too
easy to hit by accident, especially with our leader key being (or
involving) SPC by default.
2024-07-09 21:53:50 -04:00
Henrik Lissner
8bd6b8ab68
perf: suppress local-vars hooks in temp buffers
Doom inserts some expensive hooks in MODE-local-vars-hook, like
triggering LSP servers, tree-sitter, or visual enhancements -- things
that are unnecessary in temporary (invisible) buffers, so I suppress
them altogether there.
2024-07-09 20:56:35 -04:00
Henrik Lissner
e43d575caf
refactor(lib): don't use smartparens' API
Toward our eventual goal of moving smartparens out of core, I've adapted
this from code provided by hpfr on Discord, which was adapted from
smartparen's syntax-ppss caching logic. `:config default` will need need
some attention before we can fully move smartparens to its own `:editor
smartparens` module.

Co-authored-by: hpfr <hpfr@users.noreply.github.com>
2024-07-09 20:55:29 -04:00
Henrik Lissner
944eef90ec
fix(lib): doom-plist-merge causing side-effects
This one was sneaky. `doom-plist-merge` was mutating the second plist
fed to it, causing issues upwind of its uses. In #7925, for example,
calling `doom-package-recipe` to read a package's recipe would end up
altering it, copying sub-properties of :recipe to other packages'
recipes.

If you've hit #7925, you'll also need to delete your build-cache to get
around the error. I.e.

  rm -f $EMACSDIR/.local/straight/build-*-cache.el
  doom sync  # or upgrade

Fix: #7925
2024-07-09 02:46:53 -04:00
132ikl
d7075b2420
tweak(lib): doom-project-find-file: use transient project
If DIR is not a project and does not have root markers, create a
transient project instead. This ensures that `project-find-file-in`, and
by extension vertico, is still used in non-project directories instead
of falling back to `find-file`

Ref: 1b0af3bfc7
2024-07-06 20:16:59 -04:00
Henrik Lissner
1cc83dce35
fix(cli): wrong-number-of-args error on choosing 'abort'
Fix: #7917
2024-07-06 20:13:38 -04:00
Henrik Lissner
b767beaca6
fix(lib): don't call doom-adjust-font-size twice
When doom-big-font-mode is deactivated.
2024-07-05 20:10:57 -04:00
woochica
6e69b29084
fix(lib): reset font size before setting big font mode
Calling (doom-adjust-font-size 1) repeatedly would keep increase the
font size because an increment is passed.

When loading themes, the doom-big-font-mode minor mode gets loaded again
therefore it causes the font to get increased.

Fix: #7845
2024-07-05 18:58:18 -04:00
Henrik Lissner
481753bd5e
refactor!: remove pcre2el package
BREAKING CHANGE: This removes the pcre2el package, which Doom was using
solely for one function to escape PCREs. In the interest of thinning out
Doom's core, I've hoisted a simpler version of the function into Doom's
stdlib so I can remove the dependency.
2024-07-01 18:11:34 -04:00
Henrik Lissner
25d0b4065f
dev: format CODEOWNERS with more whitespace
Affects the result of 'doom make codeowners'
2024-07-01 03:35:35 -04:00
Henrik Lissner
d75f9be0d4
release(modules): 24.08.0-dev
Ref: 2b39e41368
2024-06-30 16:18:07 -04:00
Henrik Lissner
ae9e1feaa6
refactor: avoid needless macro calls
Avoid macros where we really don't need them.
2024-06-28 17:00:58 -04:00
Henrik Lissner
c4ee986818
docs: fix badges & update 29.3->29.4
29.4 (an emergency maintenance release) was released on June 22, 2024.

Fix: #7910
2024-06-28 17:00:58 -04:00
Henrik Lissner
83aa40797e
fix(cli): suppress secondary prompts from straight on -!/--force
The -!/--force flags suppress straight's 'how to proceed' prompts, but
not the secondary ones like 'Really delete remote "origin"?'. This fixes
that.

Fix: #7906
2024-06-28 17:00:58 -04:00
Henrik Lissner
a24ff58a5a
fix(lib): don't kill buffers visible in another frame
For Doom's kill-current-buffer advice.
2024-06-26 23:21:06 -04:00
Henrik Lissner
5c50b65e95
bump: ws-butler
hlissner/ws-butler@572a10c11b -> lewang/ws-butler@e3a38d93e0

I switch back to upstream ws-butler to reduce maintenance burden, and
because the two issues my fork resolves are now resolved upstream, in
doom-modeline (see lewang/ws-butler#31). I also change
ws-butler-keep-whitespace-before-point to its default for #7843.

Revert: c59ae5d172
Ref: lewang/ws-butler#31
Close: #7843
Fix: #7516
2024-06-23 15:56:17 -04:00
Henrik Lissner
d84111927c
fix(lib): doom/bumpify-diff: ignore malformed package! statements
To avoid 'uneven number of packages be bumped' errors in some edge cases
where this isn't true.
2024-06-22 18:14:05 -04:00
Henrik Lissner
7e7d8ebdfd
fix(lib): print!: don't resolve printed symlinks 2024-06-22 18:14:05 -04:00
Henrik Lissner
703173a6d2
feat(lib): doom-print: allow lexical redirection 2024-06-22 18:14:05 -04:00
Henrik Lissner
17119c5df7
refactor(lib): tweak user-error messages
To make these errors more consistent with similar commands/operations,
as well as rely less on cl-check-type (cl-lib's understanding of the
`font` type is a bit odd; they'd emit warnings/errors about this, but
still perform the checks -- I opted to check more explicitly instead).
2024-06-22 18:14:05 -04:00
Henrik Lissner
b405225b90
refactor!(vc-gutter): drop git-gutter for diff-hl
BREAKING CHANGE: This removes git-gutter as an implementation for the
`:ui vc-gutter` module, leaving only the diff-hl implementation. There
are no longer any +git-gutter or +diff-hl flags for this module. Users
don't have to do anything to keep the vc gutter, unless they prefer
git-gutter for any reason (in which case they'll need to install and set
it up themselves).

This has been planned for some time, because of a roadmap goal for Doom
to lean into native/built-in functionality where it's equal or better
than the third party alternatives. diff-hl relies on the built-in vc.el
library instead of talking to git directly (thus expanding support to
whatever VCS's vc.el supports, and not git alone), which also means it
can take advantage of its caching and other user configuration for
vc.el. Overall, it is faster and lighter.

What I've also been waiting for was a stage-hunk command, similar to
git-gutter:stage-hunk, which arrived in dgutov/diff-hl@a0560551cd and
dgutov/diff-hl@133538973b, and have evolved since.

Ref: dgutov/diff-hl@a0560551cd
Ref: dgutov/diff-hl@133538973b
Ref: https://github.com/orgs/doomemacs/projects/5/views/1?pane=issue&itemId=58747789
2024-06-22 18:14:04 -04:00
duli
7fe642938d fix: 'doom sync' generates autoload files for symbolic link files
* lisp/lib/autoloads.el(doom-autoloads--scan) Remove invoke
`file-truename` of file, keeping symbolic from being converted to a real
path.
* lisp/doom-modules.el(doom-module-from-path) Replace
`file-in-directory-p` with `string-match` to determine the module to
which the file belongs.

Fix: #7821
2024-06-21 17:52:45 -04:00
Henrik Lissner
9116ec2ec7
release(modules): 24.07.0-dev
Ref: 2b39e41368
2024-06-20 18:29:15 -04:00
Henrik Lissner
39588a15f6
bump: :core
Fuco1/smartparens@a5c68cac1b -> Fuco1/smartparens@f7cf316715
Wilfred/helpful@a32a5b3d95 -> Wilfred/helpful@4ba24cac9f
emacs-straight/project@93aa1872e9 -> emacs-straight/project@bf4c3cfcfb
jscheid/dtrt-indent@5d1b44f9a1 -> jscheid/dtrt-indent@939c5e374a
justbur/emacs-which-key@1e89fa000e -> justbur/emacs-which-key@ed38931217
2024-06-20 18:28:13 -04:00
Henrik Lissner
04057003c2
docs: update supported Emacs version in version check 2024-06-20 18:28:12 -04:00
Henrik Lissner
517daa4ed9
bump: :core
Fuco1/smartparens@ddc6233ea6 -> Fuco1/smartparens@a5c68cac1b
emacs-compat/compat@8d4e8a3666 -> emacs-compat/compat@80dbd9bc5e
emacs-straight/project@b6989856ab -> emacs-straight/project@93aa1872e9
justbur/emacs-which-key@96911a1d3f -> justbur/emacs-which-key@1e89fa000e
noctuid/general.el@ced143c30d -> noctuid/general.el@826bf2b97a
radian-software/straight.el@b1062df10b -> radian-software/straight.el@88e574ae75
rainstormstudio/nerd-icons.el@8095215a50 -> rainstormstudio/nerd-icons.el@4322290303
2024-06-03 16:22:10 -04:00
Henrik Lissner
e18a509f71
fix: suppress lexical-binding warnings on 30+
These checks and warnings were added on some recent commit of Emacs.
They're annoying to deal with and the end-user typically can't do much
about them (e.g. old packages), so I suppress them across the board.

That said, there are a few we cannot catch in non-interactive
sessions (where they aren't delayed), and those early warnings don't
respect delayed-warnings-list. This ought to be considered a bug
upstream.
2024-06-03 16:22:09 -04:00
Byungwan Jun
c70b966850 fix(cli): auto-generated script error
The auto-generated script has bom characters on my mac. if bin/doom
exits with code 254, it gives me the below error:
`.../doom.123.0.sh: line 1: #!/usr/bin/env: No such file or directory`
2024-06-03 16:20:13 -04:00
Marien Zwart
e203309e5c refactor(lib): use ripgrep instead of git grep
Although this is a refactor for normal users of Doom, it is a bugfix for
one (I assume) unsupported configuration: when Doom is not running from
a git checkout. In that case, `doom--help-package-configs` currently
returns Git's error messages. This breaks `doom/help-packages` because
it expects each returned line to contain at least one `:` character, so
it errors out with `Wrong number of arguments: (file line _match &rest),
2`.

Using ripgrep here should be equivalent for normal users as long as they
have not added untracked files not covered by Doom's .gitignore.
2024-06-03 16:19:42 -04:00
StrawberryTea
2729a3f7e3 fix: obey the comp namespace change
Some of the comp functions were declared private.
2024-06-03 15:57:56 -04:00
Levin Du
ede616fdd7
fix(cli): doom-packages-ensure: ensure local packages are built
If the package is local, the local-repo has absolute local file path,
and straight-modified-dir will return as it is, which always exists.

Fix it by passing package only to straight-modified-dir.
2024-04-16 03:00:56 -04:00
Levin Du
5a92e1b94a
fix: doom-initialize-core-packages: extract plist from alist
The doom-package-list is a list of (module :key value ...). To get the
plist, apply cdr first.
2024-04-16 02:59:04 -04:00
Henrik Lissner
ff4a0bc54a
fix: doom-run-hook-on: check context & chain hooks unconditionally
Consult the doom-context to determine if a transient hook should fire,
rather than after-init-time (less reliable; there may be times we want
them to fire post-init).

Also ensures that they're chained to find-file hooks whether or not this
is a daemon session (since they could concievably be triggered before
the daemon finishes initializing, but after Doom initializes).
2024-04-09 12:42:00 -04:00
Henrik Lissner
96e3255c33
nit: reformat+revise comments
Includes minor refactors to appease the byte-compiler or use more
succinct (but equivalent) syntax.
2024-04-09 12:39:51 -04:00
Henrik Lissner
d317fa4667
refactor: menu-bar (re)initialization on MacOS
Before this, it was non-trivial to *truly* disable the menu-bar in GUI
frames on MacOS, unless you knew about the
doom-restore-menu-bar-in-gui-frames-h hook and removed it. With this
change, the hook will bow out if the user has tampered with/called
menu-bar-mode at all.
2024-04-09 12:29:22 -04:00
Henrik Lissner
da3d0687c5
fix: doom-init-fonts-h: don't run more than needed
The face and theme-face manipulation only needs to happen once per
frame, and the `set-fontset-font` calls only need to happen once per
session (or whenever the user calls `M-x doom/reload-fonts`). This
change ensures this and saves Emacs some work when initializing new
frames, as well as resolves `set-fontset-font` related segfaults in some
edge cases (#7803).

Fix: #7803
2024-04-09 03:14:08 -04:00
Henrik Lissner
4f51652111
fix(lib): remove-recent-file: improve completion UI
Integrates with completion frameworks (particularly vertico) that read
capf metadata.
2024-04-06 12:37:10 -04:00
Henrik Lissner
f18603e66a
feat(lib): sudo-{find,this}-file: invoke save-place
After switching to the sudo-ed tramp buffer, this restores the point and
scroll position of the window to match the source buffer.

I exploit save-place here instead of simply saving/restoring (point)
and (window-start), because I believe it's better UX that save-place
treat the two buffers as effectively the same now and in the future, and
record the last cursor position equally between them, even if the
implementation is messier. This *could* be generalized into an advice
for save-place-find-file-hook and save-place-to-alist, but that's an
experiment for another day.

This is an experimental implementation and may change later.

Close: #7181
Co-authored-by: YourFin <YourFin@users.noreply.github.com>
2024-04-05 18:38:14 -04:00
Henrik Lissner
82e0641bf7
refactor: remove redundant auto-mode-alist entries
Also removes the *.{hex,nes} entry because it's far too niche to be a
global default.
2024-04-05 12:06:18 -04:00
Henrik Lissner
8d370d5608
refactor: doom--last-frame: remove unused symbol
Its last reference was removed in e889b2c. Not sure why this stuck
around for so long.

Ref: 0bb4d4dfcb
2024-04-04 23:46:07 -04:00
Henrik Lissner
0b93ecf42c
fix(lib): sudo-{find,this}-file: disable auto-save
auto-save can trigger processes that hang silently in the background,
making those buffers inoperable (hanging Emacs) for the rest of the
session, even if they are killed (tramp caches them), so I suppress them
solely for these temporary tramp buffers created by doom/sudo-find-file
and doom/sudo-this-file.
2024-04-04 23:46:04 -04:00
Henrik Lissner
38a3adcf0e
fix(lib): find-subling-file-search: wrong-number-of-args error
I backported `find-sibling-file` from Emacs 29+ in 198fe82, but it
passes a third argument (REGEXP) to `file-expand-wildcards` which wasn't
introduced until 29, so users on 28 or earlier would see a
wrong-number-of-arguments error (see #7795).

Rather than backport the entire `file-expand-wildcards`
function (risking other edge cases), I've advised its usage in
`find-sibling-file-search` to behave as it would in 29+ with a non-nil
REGEXP argument.

Amend: 198fe82b6d
Fix: #7795
2024-04-04 13:00:12 -04:00
Henrik Lissner
d166d754d6
release(modules): 24.04.0-dev
Ref: 2b39e41368
2024-04-04 00:23:20 -04:00
Henrik Lissner
869ad10f34
refactor: startup optimizations
I revisit all our startup optimizations to see how they fair in Emacs
29.x and 30.x. Most of them still hold up. I've revised and updated most
of the accompanying comments to better explain them, given what I know
now compared to when I first wrote them.
2024-04-04 00:17:02 -04:00
Henrik Lissner
2debe85a8a
fix(cli): doom upgrade: void-variable num
Fix: #7791
2024-04-03 19:21:14 -04:00
Henrik Lissner
c6fc0e5bc0
fix(cli): don't delete repos beyond $DOOMLOCALDIR
Doom makes multiple attempts to re-clone repos if they failed the first
time, however, if a user provides a :local-repo and that location isn't
a git repo, Doom assumes this it is the result of a failed clone, and so
deletes it to "try" again (which will fail). This can result in lost
work.

This prevents this from happening to packages/repos outside of
$DOOMLOCALDIR (all packages under $DOOMLOCALDIR must be git repos).

Fix: #7785
Amend: 3643c4dadd
Amend: 1fa8d3a4b9
2024-04-01 19:43:39 -04:00
Henrik Lissner
392fe88ed0
fix(lib): sudo-{this,save}-file: file path for indirect clones
If the buffer is an indirect clone, it may not have a buffer-file-name.

Also changes the command to throw an error if the current file has no
file path *and* is not a dired buffer.
2024-04-01 14:03:35 -04:00
carehabit
230c82fc95
docs: remove unintended repetition
Signed-off-by: carehabit <shenyuting@outlook.com>
2024-04-01 13:30:10 -04:00
Henrik Lissner
3643c4dadd
fix(cli): void-function directory-empty-p error
directory-empty-p was introduced in 28.1, but Doom still supports 27.1,
so 27.x users would see this error when running any bin/doom command
that clones packages.

Fix: #7779
Amend: 1fa8d3a4b9
2024-03-30 11:50:57 -04:00
Henrik Lissner
b01e496405
fix(cli): doom sync: rebuild-all loop
Addresses an edge case where 'doom sync' could fall into an inescapable
'rebuild all packages' loop.

Fix: #7775
2024-03-29 23:41:12 -04:00