Commit graph

140 commits

Author SHA1 Message Date
Peter Hoeg
9a1022ef08
bump: :editor format
radian-software/apheleia@c222927f70 -> radian-software/apheleia@56651724ad

fbd00b6 changes aphelia-core to aphelia, but only in 1 out of 2 places
and this is not the correct name in the version pinned in doom.

Fix: #7568
Amend: fbd00b6a08
2023-11-29 11:27:06 -05:00
John Goff
fbd00b6a08 fix(format): correct name of feature 2023-11-27 09:37:11 -05:00
John Goff
c076b1237f docs(format): reasoning for using +format/buffer 2023-11-27 09:37:11 -05:00
John Goff
9da33cf9e7 docs(format): describe interaction between +onsave and LSP 2023-11-27 09:37:11 -05:00
John Goff
9d8f657b37 refactor(format): describe what hook does 2023-11-27 09:36:58 -05:00
John Goff
85d20f71ca docs(format): fix name of doom-package 2023-11-27 09:36:58 -05:00
John Goff
9b718f8a5a docs(format): document +format-on-save-disabled-modes in README 2023-11-27 09:36:58 -05:00
John Goff
cdbf97b4e9 fix(format): align behaviour and documentation
`+format-on-save-disabled-modes` documentation was referencing behaviour
that no longer exists, as well as documenting behaviour that was not
implemented.
2023-11-27 09:36:58 -05:00
Henrik Lissner
a4d95674ec
tweak(format): doom-debug-variables: add apheleia-log-only-errors 2023-09-20 20:23:59 +02:00
Henrik Lissner
cdbf58a871
refactor(format): swap to string-blank-p & memq 2023-09-20 20:23:59 +02: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
LemonBreezes
aab5215951 fix(format): use +vc-gutter-update-h instead
+vc-gutter-init-maybe-h is not defined when using +diff-hl so instead
let's use +vc-gutter-update-h to refresh the VC gutter.
2023-09-16 05:00:25 +02:00
Ellis Kenyo
e44508f67c docs(format): improve note about regional formatting 2023-09-15 20:38:29 +02:00
Ellis Kenyo
7920b0d46c fix(format): update missing values & set buffer modification
This prevents apheleia complaining about the editing buffer being
killed.

Co-authored-by: Wang Liao <lwlw1988@gmail.com>
2023-09-15 20:38:29 +02:00
Henrik Lissner
3191349182
docs(format): set-formatter!: escape quotes in docstring 2023-09-14 20:17:24 +02:00
Ellis Kenyo
0b2e6d7070 docs(format): clarify how to update macro in private config 2023-09-14 20:06:51 +02:00
Ellis Kenyo
dd68bbb7da
fix(format): removed unused argument 2023-09-13 20:21:08 +01:00
Ellis Kenyo
ce93f899fd
fix(format): improve function/module loading safety 2023-09-13 20:21:08 +01:00
Ellis Kenyo
249a39acb4
fix(format): pin apheleia 2023-09-13 20:21:07 +01:00
Ellis Kenyo
12d520a377
fix(format): remove merged formatter 2023-09-13 20:21:07 +01:00
Ellis Kenyo
b0e579741e
fix(format): react to ns change 2023-09-13 20:21:07 +01:00
Ellis Kenyo
550767efe2
fix(format): apheleia-inhibit-functions after load 2023-09-13 20:21:07 +01:00
Ellis Kenyo
b34533de96
fix(format): load format-on-save-disabled-modes fn
Should handle some corner cases with how inhibiting is set
2023-09-13 20:21:07 +01:00
Ellis Kenyő
926b8f1328
docs(format): redo docs to handle refactor 2023-09-13 20:21:07 +01:00
Ellis Kenyő
457aeeccc0
fix(format): better handle format-on-save disable 2023-09-13 20:21:07 +01:00
Ellis Kenyő
dc3b5c3710
fix(format): handle git-gutter nicely 2023-09-13 20:21:01 +01:00
Ellis Kenyő
cd79edf134
feat(format): add :lang emacs-lisp formatter
Introduce a formatter function for emacs-lisp (tracked upstream here
[1]) that tries to preserve as much of what the user wants as possible

[1]: https://github.com/radian-software/apheleia/pull/102
2023-09-13 20:20:58 +01:00
Ellis Kenyő
3aa9796b84
fix(format): resolve list expansion issues
The argument list was being expanded incorrectly, this should now be resolved.
2023-09-13 20:20:58 +01:00
Ellis Kenyő
4ecd616cd8
refactor(format): replace with apheleia
Initial refactor of format module to replace format-all with apheleia
2023-09-13 20:19:59 +01:00
TEC
5ac2a5258b docs: change link format 2022-10-05 01:01:19 +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
057e6c531c
refactor: replace doom-enlist with ensure-list
doom-enlist is now a deprecated alias for ensure-list, which is built
into Emacs 28.1+ and is its drop-in replacement. We've already
backported it for 27.x users in doom-lib (in 4bf4978).

Ref: 4bf49785fd
2022-08-07 19:43:13 +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
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
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
9ada400805 docs(:editor): update READMEs to new format 2021-11-21 20:04:28 +01:00
Henrik Lissner
4549b275f2 fix(format): format-all-mode not activating
Also makes format-all log more when doom-debug-mode is on.

Fix #5589
2021-10-06 13:58:16 +02:00
Henrik Lissner
06392a723f refactor: rename orig-fn arg in advice to fn
A minor tweak to our naming conventions for the first argument of an
:around advice.
2021-08-04 01:53:12 -04:00
LuoZhipeng
bf488394e9 editor/format lsp feature requirement from textDocument/rangeFormatting to textDocument/formatting. 2021-07-27 17:49:57 +08:00
Nathan Tran
ad24061a81
Fix formatting ignoring buffer-local variables 2021-07-24 01:54:06 +10:00
Ralf Beckmann
012b759e98 Fix #5128: No format-on-save by lsp-formatters
A call to `format-all--formatter-executable` with the formatter being
equal to `'lsp` or `'eglot` will return `nil`. Therefore, `funcall` was
never called in those cases.
2021-06-14 23:52:16 +02:00
Henrik Lissner
9fb96f9eeb Fix 'setting-constant enable-multibyte-characters' error
Regression caused by 78dde6efd.

Mentioned in #5133
2021-06-04 22:45:36 -04:00
Henrik Lissner
78dde6efdd Fix #5133: don't kill LSP after reformatting
This happened because LSP hooks on kill-buffer-hook (and possibly
others) caused our temporary formatting buffer to talk to LSP as if it
were the original buffer. When the temp buffer was cleaned up, LSP
assumed the original buffer had been closed. No more!

In fact, to avoid similar issues, let's avoid any complex functionality
in hooks in this temp buffer.
2021-06-04 22:22:57 -04:00
Henrik Lissner
68b422c786 editor/format: redesign
This isn't the apheleia rewrite, just a redesign to fix the module's
current issues with its +onsave feature.

+ Rethinks how the formatter dispatches to lsp/eglot's formatter.
+ Stops format-all from being too imposing with its warnings.
+ Relies more on format-all-mode to control formatting-on-save.
+ Sidestep +format-buffer-a hackery when using lsp/eglot formatters.

Fixes #5121
Fixes #5128
Fixes #5133
2021-06-04 16:15:29 -04:00
Henrik Lissner
027dec3b5f editor/format: use unabbreviated commit
Fix #5136
2021-06-04 14:08:42 -04:00
Henrik Lissner
33dbae7cb2 Fix format-all formatters not activating on save 2021-05-28 00:11:28 -04:00
Henrik Lissner
005a71e467 Fix #5104 (again): void-function +format-lsp-enable-on-save-maybe-h 2021-05-27 19:32:56 -04:00