[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/zig-mode 6309295 069/104: Hide the *zig-fmt* window when f
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/zig-mode 6309295 069/104: Hide the *zig-fmt* window when formatting succeeds again |
Date: |
Sun, 29 Aug 2021 11:37:04 -0400 (EDT) |
branch: elpa/zig-mode
commit 63092951499cc45ffacd65fe7c1603af3e6d5c37
Author: joachimschmidt557 <joachim.schmidt557@outlook.com>
Commit: joachimschmidt557 <joachim.schmidt557@outlook.com>
Hide the *zig-fmt* window when formatting succeeds again
This prevents the slightly annoying event that the buffer
inadvertently gets split after zig fmt succeeds.
---
zig-mode.el | 36 +++++++++++++++++++-----------------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/zig-mode.el b/zig-mode.el
index f3b4c14..23688f5 100644
--- a/zig-mode.el
+++ b/zig-mode.el
@@ -110,23 +110,25 @@ If given a SOURCE, execute the CMD on it."
"Format the current buffer using the zig fmt."
(interactive)
(let ((fmt-buffer-name "*zig-fmt*"))
- ;; If we have an old *zig-fmt* buffer, we want to kill
- ;; it and start a new one to show the new errors
- (when (get-buffer fmt-buffer-name)
- (kill-buffer fmt-buffer-name))
- (let ((fmt-buffer (get-buffer-create fmt-buffer-name)))
- (set-process-sentinel
- (start-process "zig-fmt"
- fmt-buffer
- zig-zig-bin
- "fmt"
- (buffer-file-name))
- (lambda (process _e)
- (if (> (process-exit-status process) 0)
- (progn
- (switch-to-buffer-other-window fmt-buffer)
- (compilation-mode))
- (revert-buffer :ignore-auto :noconfirm)))))))
+ ;; If we have an old *zig-fmt* buffer, we want to kill
+ ;; it and start a new one to show the new errors
+ (when (get-buffer fmt-buffer-name)
+ (switch-to-buffer-other-window fmt-buffer-name)
+ (quit-window)
+ (kill-buffer fmt-buffer-name))
+ (let ((fmt-buffer (get-buffer-create fmt-buffer-name)))
+ (set-process-sentinel
+ (start-process "zig-fmt"
+ fmt-buffer
+ zig-zig-bin
+ "fmt"
+ (buffer-file-name))
+ (lambda (process _e)
+ (if (> (process-exit-status process) 0)
+ (progn
+ (switch-to-buffer-other-window fmt-buffer)
+ (compilation-mode))
+ (revert-buffer :ignore-auto :noconfirm)))))))
(defun zig-re-word (inner)
"Construct a regular expression for the word INNER."
- [nongnu] elpa/zig-mode 89385d7 088/104: Make read-only-mode deactivation/activation explicit, (continued)
- [nongnu] elpa/zig-mode 89385d7 088/104: Make read-only-mode deactivation/activation explicit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 3e3c0d5 102/104: Fix font-lock of parameters with optional, pointer or array types, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 8e0e610 086/104: Use (read-only-mode) instead of (toggle-read-only), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 12fe3c9 001/104: Initial commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 7c6323c 021/104: orelse, f16, comptime_int, comptime_float, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 3778fb5 030/104: Make indentation more nuanced (and add more tests for it), ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 9dc36e1 046/104: move defgroup and defcustom to the beginning of the code, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 4eafa60 050/104: colorize compilation buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 107a67b 060/104: Runs `revert-buffer` after formatting on save., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode b4ae21a 061/104: Merge pull request #26 from Saikyun/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 6309295 069/104: Hide the *zig-fmt* window when formatting succeeds again,
ELPA Syncer <=
- [nongnu] elpa/zig-mode 1e75c04 100/104: Remove irrelevant comment, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 0babe7e 103/104: Merge pull request #59 from eric-p-hutchins/params-with-optionals-pointers-and-arrays-oh-my, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 2d0eb23 097/104: Merge pull request #55 from arqv/optim-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 232bfff 010/104: Merge pull request #2 from syohex/fix-package, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode fead48b 002/104: Initial revision., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode c961a6d 005/104: noreturn., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 5b3b772 011/104: Removed hook., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode fb8d52f 017/104: License., ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode 4f281e4 020/104: Changed repository location, ELPA Syncer, 2021/08/29
- [nongnu] elpa/zig-mode c5315ff 026/104: Apply font-lock-doc-face to doc comments (for issue #5), ELPA Syncer, 2021/08/29