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.
In the absence of a .clang-format file, imposing the value of
`c-basic-offset` onto clang-format seems like reasonable, default
behavior. Like all other cases, this can be disabled by unsetting
`apheleia-formatters-respect-indent-level` globally or mode-locally with
`setq-hook!` or similar.
Apheleia's default config for prettier adds --use-tabs/--tab-width to
force prettier to match Emacs' indent settings, which is fine until a
prettier config file tries to overwrite it and is ignored. As a
compromise (and stopgap solution), I omit these flags if any prettier
settings are set in the current project.
Fix: #7998
change `+format--lsp-fn` to run `+format--lsp-fn` in context of main
buffer rather than apheleia's scratch buffer so that the lsp mode can
be discovered
BREAKING CHANGE: This commit introduces two changes, a breaking, one
not.
The breaking change: `+format-with-lsp` used to control lsp-mode/eglot
integration for this module, but it is now gated behind a new +lsp flag.
Users will need to add it to their `doom!` blocks (in $DOOMDIR/init.el)
to restore the integration.
The other change: I've merged the former `lsp` and `eglot` formatters
into a single `lsp` formatter that dispatches to the appropriate
backend, as well as wrapping this integration in a
`+format-with-lsp-mode` minor mode, so it can be toggled at will; mainly
to assist in debugging formatter behavior.
A unified formatter makes it easier for folks to configure
`+format-with` on a per-project/directory/file basis, without needing to
know what backend this module uses, and opens us up to integrating other
LSP backends in the future (like lsp-bridge).
I want both `apheleia-formatter` and `apheleia-inhibit` exposed for easy
setting from directory/file-local variables (like .dir-locals.el), but
I'd like to abstract away the implementation (Apheleia) a little, hence
these aliases. This way, whether or not we're still using Apheleia in a
year or three, `+format-with` and `+format-inhibit` should always work.
Rather than wrap Apheleia in custom formatting logic, I now use
Apheleia's own machinary to integrate into LSP and Eglot, which is less
complexity to maintain. It also makes settings +format-with a more
reliable option for per-project or per-file configuration.
This also adds a +format/org-src-block command, which I'll incorporate
into the org module in a follow-up commit.
Ref: #7685
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
Didn't return non-nil, so whether or not it worked, Apheleia would
attempt to (ineffectually) format the org buffer afterwards.
Also remove unneeded beg/end checks (the functions always receive a
value).
BREAKING CHANGE: This deprecates the IS-(MAC|WINDOWS|LINUX|BSD) family
of global constants in favor of a native `featurep` check:
IS-MAC -> (featurep :system 'macos)
IS-WINDOWS -> (featurep :system 'windows)
IS-LINUX -> (featurep :system 'linux)
IS-BSD -> (featurep :system 'bsd)
The constants will stick around until the v3 release so folks can still
use it -- and there are still some modules that use it, but I'll phase
those uses out gradually.
Fix: #7479
`+format-on-save-disabled-modes` documentation was referencing behaviour
that no longer exists, as well as documenting behaviour that was not
implemented.