mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
Fix rustfmt, show log by default
This commit is contained in:
parent
6449a7439e
commit
d3304b018c
2 changed files with 30 additions and 5 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -10,6 +10,14 @@ The format is based on [Keep a Changelog].
|
|||
function as a formatter allowing you to plug more powerful
|
||||
formatters into apheleia such as language servers.
|
||||
|
||||
## Changes
|
||||
* Stdout and stderr buffers are no longer retained after running a
|
||||
formatter. Instead, the stderr is appended into an
|
||||
`*apheleia-whatever-log*` buffer if it fails, or unconditionally if
|
||||
the new user option `apheleia-verbose` is set to non-nil. See [#64],
|
||||
[#65]. The log buffer is not hidden by default, and this can be
|
||||
changed via the new user option `apheleia-hide-log-buffer` ([#69]).
|
||||
|
||||
## Bugs fixed
|
||||
* Allow running the same formatter in multiple buffers in parallel
|
||||
([#64], [#65]). Previously, when saving a number of files at the
|
||||
|
@ -18,12 +26,16 @@ The format is based on [Keep a Changelog].
|
|||
* In some circumstances the error `wrong-type-argument bufferp nil`
|
||||
could be reported when running certain formatters under Apheleia.
|
||||
This has been fixed.
|
||||
* Rustfmt is no longer passed the `--unstable-features` and
|
||||
`--skip-children` flags, since they are not available on all
|
||||
versions of Rustfmt ([#69]).
|
||||
|
||||
[#52]: https://github.com/raxod502/apheleia/issues/52
|
||||
[#60]: https://github.com/raxod502/apheleia/issues/60
|
||||
[#62]: https://github.com/raxod502/apheleia/issues/62
|
||||
[#64]: https://github.com/raxod502/apheleia/issues/64
|
||||
[#65]: https://github.com/raxod502/apheleia/pull/65
|
||||
[#69]: https://github.com/raxod502/apheleia/issues/69
|
||||
|
||||
## 1.2 (released 2021-12-27)
|
||||
### Enhancements
|
||||
|
|
23
apheleia.el
23
apheleia.el
|
@ -36,6 +36,13 @@
|
|||
:link '(url-link :tag "GitHub" "https://github.com/raxod502/apheleia")
|
||||
:link '(emacs-commentary-link :tag "Commentary" "apheleia"))
|
||||
|
||||
(defcustom apheleia-hide-log-buffer nil
|
||||
"Non-nil means log buffers will be hidden.
|
||||
Hidden buffers have names that begin with a space, and do not
|
||||
appear in `switch-to-buffer' unless you type in a space
|
||||
manually."
|
||||
:type 'boolean)
|
||||
|
||||
(cl-defun apheleia--edit-distance-table (s1 s2)
|
||||
"Align strings S1 and S2 for minimum edit distance.
|
||||
Return the dynamic programming table as has table which maps cons
|
||||
|
@ -283,7 +290,11 @@ command succeeds provided that its exit status is 0."
|
|||
(stderr (generate-new-buffer
|
||||
(format " *apheleia-%s-stderr*" name)))
|
||||
(log (get-buffer-create
|
||||
(format " *apheleia-%s-log*" name))))
|
||||
(format "%s*apheleia-%s-log*"
|
||||
(if apheleia-hide-log-buffer
|
||||
" "
|
||||
"")
|
||||
name))))
|
||||
(condition-case-unless-debug e
|
||||
(progn
|
||||
(setq apheleia--current-process
|
||||
|
@ -320,10 +331,13 @@ command succeeds provided that its exit status is 0."
|
|||
(message
|
||||
(concat
|
||||
"Failed to run %s: exit status %s "
|
||||
"(see hidden buffer%s)")
|
||||
"(see %s %s)")
|
||||
(car command)
|
||||
(process-exit-status proc)
|
||||
log))
|
||||
(if (string-prefix-p " " (buffer-name log))
|
||||
"hidden buffer"
|
||||
"buffer")
|
||||
(string-trim (buffer-name log))))
|
||||
(when ensure
|
||||
(funcall ensure))
|
||||
(kill-buffer stdout)
|
||||
|
@ -626,8 +640,7 @@ function: %s" command)))
|
|||
(latexindent . ("latexindent"))
|
||||
(ocamlformat . ("ocamlformat" "-" "--name" filepath))
|
||||
(prettier . (npx "prettier" "--stdin-filepath" filepath))
|
||||
(rustfmt . ("rustfmt" "--unstable-features" "--skip-children"
|
||||
"--quiet" "--emit" "stdout"))
|
||||
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
|
||||
(terraform . ("terraform" "fmt" "-")))
|
||||
"Alist of code formatting commands.
|
||||
The keys may be any symbols you want, and the values are
|
||||
|
|
Loading…
Add table
Reference in a new issue