Commit graph

96 commits

Author SHA1 Message Date
Henrik Lissner
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
Henrik Lissner
d6a2e24a3e
fix(dired,vc-gutter): don't inhibit diff-hl-dired-mode
Dirvish uses the fringe for its vc-state diff, which isn't available in
TTY Emacs, so we still need `diff-hl-dired-mode` there.

Revert: a8ed6c9f7d
Ref: #6760
2024-08-29 01:12:29 -04:00
Henrik Lissner
14478064af
refactor(dired,vc-gutter): setup for tty frames
A recent commit (c53f63b) allows me to simplify this a bit.

Ref: c53f63b96e
Ref: #8001
2024-08-28 17:56:55 -04:00
Henrik Lissner
93c5f98ee2
fix(vc-gutter): resist errors in kill-buffer advice
A regression introduced in aa8c31c.

Fix: #8018
Ref: #8009
Amend: aa8c31cf08
2024-08-22 16:06:42 -04:00
Henrik Lissner
e59023b843
fix(vc-gutter): toggle diff-hl-margin-mode in tty frames
Fix: #8001
2024-08-22 15:50:34 -04:00
Henrik Lissner
aa8c31cf08
fix(vc-gutter): wrong-number-of-args error
A regression introduced in ded3f5e.

Fix: #8009
Amend: ded3f5ec83
2024-08-21 12:57:28 -04:00
Henrik Lissner
ff9c59df46
tweak(vc-gutter): disable diff-hl-mode in pdf-view-mode 2024-08-21 05:04:25 -04:00
Henrik Lissner
ded3f5ec83
fix(vc-gutter): runaway diff-hl threads & immortal buffers
This was an elusive bug caused by two upstream behaviors:

1. `kill-buffer` will silently refuse to kill a buffer if there is a
   thread associated with it.
2. `global-diff-hl-mode` activates `diff-hl-mode` in *most* buffers,
   even invisible ones. This calls `diff-hl-update` each time
   it does. This isn't a problem *unless* you have `diff-hl-update-async`
   enabled, because it creates a thread every time `diff-hl-update` is
   called. That means for every buffer -- real or transient -- you have
   a new thread queued.

And this caused two main issues:

1. Temporary buffers are often opened and closed very rapidly (often
   faster than the thread can complete), so they weren't getting cleaned
   up. I hope you weren't too attached to your memory, because you'll
   have a lot of buried buffers to feed before long!
2. In cases where `diff-hl-update` simply takes a long time, multiple
   calls to it would queue more threads. When Emacs eventually yields
   the CPU to them, you'll get random,
   impossible-to-predict-or-track-down freezes. Joy!

This may very well be enough reason to disable `diff-hl-update-async` by
default, but I didn't want to give up on it *just* yet, despite how
inelegant this solution is...

Fix: #7954
Fix: #7991
2024-08-21 05:03:30 -04:00
Henrik Lissner
a8ed6c9f7d
fix(vc-gutter): inhibit diff-hl-dired-mode in dirvish
Ref: #6760
2024-08-17 14:24:51 -04:00
Henrik Lissner
7f3412e317
bump: :ui
Alexander-Miller/treemacs@54ef590b76 -> Alexander-Miller/treemacs@202d7f01d6
Bad-ptr/persp-mode.el@345baaa520 -> Bad-ptr/persp-mode.el@40e9993a97
dgutov/diff-hl@57d9d4e3e1 -> dgutov/diff-hl@b80ff9b4a7
ema2159/centaur-tabs@d6009c295a -> ema2159/centaur-tabs@063534bd00
emacs-lsp/lsp-treemacs@1d43e9e030 -> emacs-lsp/lsp-treemacs@fb1a07ae0a
emacs-straight/minimap@4898d27768 -> emacs-straight/minimap@5aa0df40bc
seagle0128/doom-modeline@1505c13564 -> seagle0128/doom-modeline@9920ef5116
tarsius/hl-todo@dd46d426c0 -> tarsius/hl-todo@82eba6b8f7
2024-08-08 17:26:58 -04:00
Henrik Lissner
0f30e1eca5
bump: :ui vc-gutter :tools magit :emacs vc
dgutov/diff-hl@f66345ed1f -> dgutov/diff-hl@57d9d4e3e1
magit/forge@9edfcb2c15 -> magit/forge@21d410c810
magit/magit@9d4192b7b1 -> magit/magit@e777822720
2024-07-29 02:03:25 -04:00
Dan McArdle
ff3fd15b02 fix(vc-gutter): check 'diff-hl-disable-on-remote is bound
This fixes the following error message on startup:

    Symbol’s value as variable is void: diff-hl-disable-on-remote
2024-07-26 16:29:34 -04:00
Henrik Lissner
7c5d8641a1
fix(vc-gutter): respect diff-hl-disable-on-remote in dired
Neither `diff-hl-dired-mode` or `diff-hl-dired-mode-unless-remote`
respect diff-hl-disable-on-remote, so added my own enabler hook.
2024-07-25 19:43:28 -04:00
Henrik Lissner
a8b836dac3
fix(vc-gutter): use global-diff-hl-mode
Our former approach would enable diff-hl unconditionally. This way, the
`diff-hl-global-modes` variable is respected.

Ref: https://discourse.doomemacs.org/t/4710/2
2024-07-25 19:43:28 -04:00
Henrik Lissner
5485b912de
bump: :ui vc-gutter
dgutov/diff-hl@11f3113e79 -> dgutov/diff-hl@f66345ed1f

- Our diff-hl-update-async hack is no longer needed. The issue was
  addressed upstream.

Amend: 778fc9ad3f
Ref: dgutov/diff-hl#213
Ref: dgutov/diff-hl@e264d13a3d
2024-07-15 00:23:31 -04:00
Henrik Lissner
778fc9ad3f
fix(vc-gutter): disable diff-hl-update-async in with-editor-mode
`diff-hl-update-async` was enabled in f2696d7, causing a regression
where with-editor buffers wouldn't get cleaned up properly. This would
particularly affect Magit's COMMIT_EDITMSG buffers. To quote jds on
Discord:

  It seems like after committing (with cc in the magit buffer), it
  leaves COMMIT_EDITMSG around. The next time I try & commit, a single c
  keypress immediately jumps to the old COMMIT_EDITMSG buffer, but it's
  inactive - C-c C-c closes that buffer but makes no change to git.

I opt for advice instead of find-file or with-editor-mode hooks to
restore normal behavior should with-editor-mode be later disabled
without the death of its buffer (not relevant to magit, specifically,
but it might be to other consumers of with-editor, now or in the
future).

Ref: dgutov/diff-hl#213
Amend: f2696d7302
2024-07-10 18:27:54 -04:00
Henrik Lissner
f1f72c291a
refactor(vc-gutter): simplify & DRY
These advice were unnecessary when not only does diff-hl expose
variables to change them, but one of the overridden definitions is
identical to the function it's replacing.

Also includes some other minor refactors.
2024-07-10 03:54:45 -04:00
Henrik Lissner
78304f4d79
perf(vc-gutter): optimize bitmaps
The NS build of Emacs (on MacOS) seems to struggle rendering our old
fringe bitmaps for diff-hl, leading to noticably slow-downs when
scrolling in buffers with diff-hl enabled. By pre-computing the pixel
height and width of the bitmap, rather than relying on passing `repeat`
to define-fringe-bitmap's ALIGN argument, this seems to spare it a chunk
of wasted cycles.

Ref: https://www.reddit.com/r/emacs/comments/1do1wgj/fringes_incredibly_slow_on_emacs_ns_with_macos/
Fix: #7923
2024-07-10 03:18:46 -04:00
Henrik Lissner
f2696d7302
perf(vc-gutter): diff-hl-update-async = t
Don't block Emacs when updating the gutter.

Ref: #7923
2024-07-08 22:16: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
Henrik Lissner
62248f8366
bump: :ui
Alexander-Miller/treemacs@8c6df39f01 -> Alexander-Miller/treemacs@54ef590b76
dgutov/diff-hl@9662083943 -> dgutov/diff-hl@11f3113e79
doomemacs/themes@3b2422b208 -> doomemacs/themes@816fb54d60
emacs-lsp/lsp-treemacs@e54e74deb8 -> emacs-lsp/lsp-treemacs@1d43e9e030
emacs-straight/minimap@90aeeb5798 -> emacs-straight/minimap@4898d27768
jrblevin/deft@bb1a16b87c -> jrblevin/deft@b369d7225d
seagle0128/doom-modeline@e09b8e989f -> seagle0128/doom-modeline@11ae6c193c
tarsius/hl-todo@f1fef158f9 -> tarsius/hl-todo@dd46d426c0
2024-06-21 19:11:30 -04:00
Henrik Lissner
665d808d09
bump: :ui
Alexander-Miller/treemacs@df26b6ab9a -> Alexander-Miller/treemacs@8c6df39f01
dgutov/diff-hl@b8b2727a72 -> dgutov/diff-hl@9662083943
doomemacs/themes@ff26f26ea3 -> doomemacs/themes@37d2182f50
jrblevin/deft@28be94d89b -> jrblevin/deft@bb1a16b87c
seagle0128/doom-modeline@bf880ae56f -> seagle0128/doom-modeline@e09b8e989f
2024-03-21 12:02:02 -04:00
Henrik Lissner
210a5d4162
bump: :ui
Alexander-Miller/treemacs@56691a530a -> Alexander-Miller/treemacs@df26b6ab9a
Bad-ptr/persp-mode.el@df95ea710e -> Bad-ptr/persp-mode.el@345baaa520
dgutov/diff-hl@b5651f1c57 -> dgutov/diff-hl@b8b2727a72
edkolev/evil-goggles@0070c9d844 -> edkolev/evil-goggles@34ca276a85
emacs-lsp/lsp-treemacs@e66ae21965 -> emacs-lsp/lsp-treemacs@e54e74deb8
emacsorphanage/anzu@5abb37455e -> emacsorphanage/anzu@26fb50b429
joostkremers/writeroom-mode@1fd52848eb -> joostkremers/writeroom-mode@f4d035e91d
mickeynp/ligature.el@0e5d0a8554 -> mickeynp/ligature.el@6ac1634612
rolandwalker/unicode-fonts@44d0a22420 -> rolandwalker/unicode-fonts@6245b97d8d
tarsius/hl-todo@70ce48470c -> tarsius/hl-todo@f1fef158f9
2024-02-04 18:58:53 -05:00
Henrik Lissner
88bb045388
docs(*): replace all-the-icons with nerd-icons
Also colorizes the leading icon in notices.
2023-09-16 20:19:11 +02:00
Ellis Kenyő
dc3b5c3710
fix(format): handle git-gutter nicely 2023-09-13 20:21:01 +01:00
Henrik Lissner
7a5f5d07e7
bump: :ui
Alexander-Miller/treemacs@9986d6cd3d -> Alexander-Miller/treemacs@00e96c842f
dgutov/diff-hl@d20f16bf5e -> dgutov/diff-hl@b5651f1c57
doomemacs/themes@b5ff201f4b -> doomemacs/themes@e4f0b006a5
edkolev/evil-goggles@8f20a16e74 -> edkolev/evil-goggles@0070c9d844
ema2159/centaur-tabs@a2890d968d -> ema2159/centaur-tabs@0bb1aa18d4
emacs-lsp/lsp-treemacs@a48763ba5d -> emacs-lsp/lsp-treemacs@e66ae21965
jaypei/emacs-neotree@98fe21334a -> jaypei/emacs-neotree@2b0cb82853
k-talo/volatile-highlights.el@513c8b73cd -> k-talo/volatile-highlights.el@fcf6e27784
seagle0128/doom-modeline@6125309c2c -> seagle0128/doom-modeline@f45a5a2003
tarsius/hl-todo@a627d33214 -> tarsius/hl-todo@0faf8569b6
2023-08-20 22:26:07 +02:00
Henrik Lissner
1eb3fd3449
bump: :ui
Alexander-Miller/treemacs@76807bef3c -> Alexander-Miller/treemacs@9986d6cd3d
Bad-ptr/persp-mode.el@7a594a3d8f -> Bad-ptr/persp-mode.el@df95ea710e
abo-abo/ace-window@0577c426a9 -> abo-abo/ace-window@77115afc1b
abo-abo/hydra@9e9e00cb24 -> abo-abo/hydra@317e1de330
dgutov/diff-hl@dabb7be628 -> dgutov/diff-hl@d20f16bf5e
dimitri/switch-window@8d9fe251d8 -> dimitri/switch-window@71ef2f54c9
ema2159/centaur-tabs@f4cef95acb -> ema2159/centaur-tabs@a2890d968d
emacs-lsp/lsp-treemacs@2894e6dec5 -> emacs-lsp/lsp-treemacs@a48763ba5d
joostkremers/writeroom-mode@eac1da790f -> joostkremers/writeroom-mode@1fd52848eb
k-talo/volatile-highlights.el@9a20091f0c -> k-talo/volatile-highlights.el@513c8b73cd
rolandwalker/nav-flash@2e31f32085 -> rolandwalker/nav-flash@5d4b485678
rolandwalker/unicode-fonts@47f2397ade -> rolandwalker/unicode-fonts@44d0a22420
seagle0128/doom-modeline@b66d5e5006 -> seagle0128/doom-modeline@6125309c2c
tarsius/hl-todo@e52285965b -> tarsius/hl-todo@a627d33214
2023-02-20 22:47:23 -05:00
roife
f6616e8a06
fix(vc-gutter): add missing autoloads
Add required autoloads for vc-gutter to fix errors from which-key. See the issue
below.

Fix: #6957
2023-02-18 01:00:59 -05:00
TEC
5ac2a5258b docs: change link format 2022-10-05 01:01:19 +02:00
Henrik Lissner
3ae8c520d5
nit(vc-gutter): reformat annotated comments 2022-09-06 23:41:28 +02:00
Henrik Lissner
ad6a3d0f33
refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
Henrik Lissner
de62c5449d
nit(vc-gutter): add summary tags to comments
A new convention I'm slowly rolling out to modules to help readers
quickly identify the purpose of a change. E.g.

  UX    - a change done to improve user experience
  STYLE - for aesthetics
  FIX   - addresses a perceived or potential issue
  PERF  - intended to improve performance

Combined tags will be delimited with commas. E.g. "UX,PERF:"

There may be more later, and these will be further documented in the new
docs about to come up.
2022-08-10 14:06:52 +02:00
Henrik Lissner
bd597ffda4
docs(vc-gutter): document module's hacks 2022-08-10 13:18:34 +02:00
Henrik Lissner
99b0b70c49
fix(vc-gutter): remove advice removal for diff-hl-overlay-modified
Originally, this intended to *stop* diff-hl from too aggressively
deleting the diff overlays while editing. This is either no longer the
case or the old advice was mistaken; the intended behavior is achieved
without it.
2022-08-10 13:18:34 +02:00
Henrik Lissner
d55d7f3088
feat(vc-gutter): shrink revert-hunk popup to contents 2022-08-10 13:18:33 +02:00
Henrik Lissner
24623f9959
refactor!(dired): move diff-hl config to :ui vc-gutter
BREAKING CHANGE: users who are used to diff-hl displaying diffs in dired
will notice they have vanished. diff-hl's conig has been moved to :ui
vc-gutter +diff-hl (added in 27a448b). Enable it to get it back.

Ref: 27a448b04b
2022-08-09 16:30:43 +02:00
Henrik Lissner
e76f327e0a
fix(vc-gutter): apply +pretty to diff-hl-dired-mode
Amend: cd9bc5a1fd
2022-08-09 16:30:43 +02:00
Henrik Lissner
e30eb03f83
refactor(vc-gutter): remove redundant hooks
The refresh hooks address the stage/unstage cases already.
2022-08-09 16:30:43 +02:00
Henrik Lissner
15b00b78fe
refactor(vc-gutter): use local modes instead of global 2022-08-09 16:30:43 +02:00
Henrik Lissner
27a448b04b
feat(vc-gutter): add +diff-hl backend
This adds an alternative backend to the :ui vc-gutter module, enabled
with the +diff-hl flag. In the future, I intend for diff-hl to replace
git-gutter, as it is slightly faster and depends on more native
functionality (vc.el), but it's still a little buggy. It will remain
opt-in until those issues are sorted out.
2022-08-08 18:23:47 +02:00
Henrik Lissner
cd9bc5a1fd
refactor!(vc-gutter): move style defaults behind +pretty
BREAKING CHANGE: This changes moves its default configuration of the
fringe behind a +pretty flag. This won't cause breakage, but will cause
a (possibly unwanted) visual change: git-gutter will use its default
indicators (e.g. + and - symbols) instead of the continuous bars from
before.

To get back the old look, enable `+pretty` on the `:ui vc-gutter`
module.

This was done to make the defaults toggleable, to standardize +pretty,
to document issues with this customization that have been brought up by
members of the Emacs community, and to better document it in comments
for posterity.
2022-08-08 18:23:47 +02:00
Henrik Lissner
1abcf913aa
revert: fix(docs): set mode in file-local vars
emacs-straight/org-mode@e22b4eb7aa introduced a breaking change that
made it impossible to rely on .dir-locals.el to change org-mode buffers
in $EMACSDIR to doom-docs-org-mode (without infinite recursion), so we
used file-local variables in 7e400ab.

emacs-straight/org-mode@215de6176b reverted that change, so we can use
.dir-locals.el again, and this is my preference, since it requires less
boilerplate across our hundreds of org files.

Ref: emacs-straight/org-mode@215de6176b
Ref: emacs-straight/org-mode@e22b4eb7aa
Revert: 7e400abdc0
2022-08-07 19:08:07 +02:00
Henrik Lissner
1f8bf7accb
merge: rewrite-docs
I've omitted docs/*.org from this merge, as there is still work left to
do there, but I am pushing the module docs early so folks can benefit
from the new docs sooner.
2022-08-03 03:27:50 +02:00
Henrik Lissner
7e400abdc0
fix(docs): set mode in file-local vars
Due to emacs-straight/org-mode@e22b4eb, a replacement major mode (for
org-mode) can no longer be specified from .dir-locals.el, as it spirals
into infinite recursion. Therefore, a mode: line is needed in all Doom
docs.

Ref: emacs-straight/org-mode@e22b4eb7aa
2022-08-03 02:46:33 +02:00
Henrik Lissner
1255315bfc
refactor(docs): replace nav menus with virtual one
Now that the header is dynamically generated (when doom-docs-mode is
active), a literal header is unnecessary.
2022-08-02 19:37:07 +02:00
Henrik Lissner
e77a45bc22
docs: use lowercase keywords
As per Org's new defaults, which we're adopting elsewhere, so may as
well adopt it here.
2022-08-02 16:23:43 +02:00
Henrik Lissner
7246db457c docs: replace doom-source with doom-repo links
I will later use "source" to refer to module sources, so better we avoid
the terminology for now.
2022-02-01 18:55:27 +01:00
Henrik Lissner
5cf424cf6b bump: :ui
Alexander-Miller/treemacs@63e2bc207a -> Alexander-Miller/treemacs@1820db42c6
ema2159/centaur-tabs@8b4249c405 -> ema2159/centaur-tabs@5860a5c40c
emacs-lsp/lsp-treemacs@d82df44d63 -> emacs-lsp/lsp-treemacs@c40a381730
emacsorphanage/git-gutter-fringe@4f19866494 -> emacsorphanage/git-gutter-fringe@648cb5b57f
hlissner/emacs-doom-themes@e716ddbb88 -> hlissner/emacs-doom-themes@7d1a56623c
joostkremers/writeroom-mode@7f4ec92404 -> joostkremers/writeroom-mode@eac1da790f
rolandwalker/unicode-fonts@e3942fe40b -> rolandwalker/unicode-fonts@47f2397ade
seagle0128/doom-modeline@ffedb34800 -> seagle0128/doom-modeline@69ede7d719

- Emacs 29 introduces the mode-line-active face, which inherits from
  variable-pitch, therefore the modeline uses your variable-pitch font,
  instead of your default. As of
  hlissner/emacs-doom-themes@7d1a56623c, this is no longer the
  case (fixing #5891).

Fix: #5891
2021-12-13 19:28:32 +01:00
Henrik Lissner
88844e9cec docs: simplify internal docs links
Fewer links means less confusion.

- Merge doom-issue and doom-commit links into doom-ref (for auto-linking
  Issue/PR/commit references).
- Merge doom-module-source and doom-docs-source links into doom-source.
- Rename doom-report-issue to doom-report.
- Use '!' as the icon for module issues link.
- Remove doom-repo (replaced with "doom:*" in :lang org module).
- Add doomdir and emacsdir links to :lang org module.
2021-11-21 20:04:28 +01:00
Henrik Lissner
b5a2aa48fe docs(:ui): update READMEs to new format 2021-11-21 20:04:28 +01:00