[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 78eed53af1 260/323: Don't hang a "[Compiling]
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 78eed53af1 260/323: Don't hang a "[Compiling]" forever in the mode-line |
Date: |
Thu, 9 Mar 2023 10:58:36 -0500 (EST) |
branch: externals/beardbolt
commit 78eed53af1495f4a6a3cadb838e22f18bb61a382
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Don't hang a "[Compiling]" forever in the mode-line
Bypassing compile.el's logic for tearing down a compilation process
means that the "[Compiling]" mode line indicator might stick there
forever, incorrectly.
* beardbolt.el (bb--stop-running-compilation): Rewrite.
(bb-compile): Update call to compilation-start.
(bb--compilation-buffer): New helper.
(bb--handle-finish-compile): Rework.
---
beardbolt.el | 26 +++++++++++---------------
1 file changed, 11 insertions(+), 15 deletions(-)
diff --git a/beardbolt.el b/beardbolt.el
index 3763331639..4626242e01 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -1411,13 +1411,12 @@ Argument ASM-LINES input lines."
(setq bb--rainbow-overlays nil))
;;;;; Handlers
-(cl-defun bb--handle-finish-compile (buffer str &key override-buffer stopped)
+(cl-defun bb--handle-finish-compile (buffer str &key override-buffer)
"Finish hook for compilations.
Argument BUFFER compilation buffer.
Argument STR compilation finish status.
Argument OVERRIDE-BUFFER asm src buffer to use instead of reading
- `bb-output-filename'.
-Argument STOPPED The compilation was stopped to start another compilation."
+ `bb-output-filename'."
(when (not (buffer-live-p buffer))
(error "Dead buffer passed to compilation-finish-function! beardbolt
cannot continue."))
(let ((compilation-fail
@@ -1428,8 +1427,7 @@ Argument STOPPED The compilation was stopped to start
another compilation."
(with-current-buffer (get-buffer-create bb-output-buffer)
;; Store src buffer value for later linking
- (cond (stopped) ; Do nothing
- ((not compilation-fail)
+ (cond ((not compilation-fail)
(if (and (not override-buffer)
(not (file-exists-p (bb-output-filename src-buffer t))))
(message "Error reading from output file.")
@@ -1579,6 +1577,9 @@ and return it."
" "))
existing-cmd))
+(defun bb--compilation-buffer (&rest _)
+ (get-buffer-create "*bb-compilation*"))
+
;;;;; UI Functions
(defun bb-compile ()
"Compile the current beardbolt buffer."
@@ -1657,7 +1658,7 @@ and return it."
(compilation-auto-jump-to-first-error t))
;; TODO should this be configurable?
(bb-with-display-buffer-no-window
- (compilation-start cmd nil (lambda (&rest _)
"*bb-compilation*"))))
+ (compilation-start cmd nil #'bb--compilation-buffer)))
;; Only jump to errors, skip over warnings
(setq-local compilation-skip-threshold 2)
(add-hook 'compilation-finish-functions
@@ -1665,15 +1666,10 @@ and return it."
(setq bb-src-buffer src-buffer))))))
(defun bb--stop-running-compilation ()
- (when-let* ((compilation-buffer (get-buffer "*bb-compilation*"))
- (proc (get-buffer-process compilation-buffer)))
- (when (eq (process-status proc) 'run)
- (set-process-sentinel proc nil)
- (interrupt-process proc)
- (bb--handle-finish-compile compilation-buffer nil :stopped t)
- ;; Wait a short while for the process to exit cleanly
- (sit-for 0.2)
- (delete-process proc))))
+ (let ((buffer (bb--compilation-buffer)))
+ (if-let ((proc (get-buffer-process buffer)))
+ (interrupt-process proc)
+ (error "[beardbolt] No compilation to stop"))))
;;;; Keymap
(defvar bb-mode-map
- [elpa] externals/beardbolt 1267509ab4 220/323: Move `rmsbolt-with-display-buffer-no-window`, (continued)
- [elpa] externals/beardbolt 1267509ab4 220/323: Move `rmsbolt-with-display-buffer-no-window`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8544df3e9d 222/323: Use `rmsbolt--cleanup-overlays`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 42b0ab4239 225/323: Make it clear that we're operating on a list of asm regions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4f4a7f85ac 223/323: Simplify visibility check logic, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3a1e068bb8 228/323: Don't update overlays if the src buffer is no longer current, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b56d3b6cdb 245/323: Merge branch 'improve-starters' into 'master', ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 16f887917b 252/323: Improve rainbow color selection algorithm, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9bc7e8aeb8 236/323: Remove `rmsbolt--post-command-hook` when mode is deactivated, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 660739681c 254/323: Rename every rms* file to beard*, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f846655a35 250/323: Rework rmsbolt-rainbowize to reuse more code, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 78eed53af1 260/323: Don't hang a "[Compiling]" forever in the mode-line,
ELPA Syncer <=
- [elpa] externals/beardbolt b71d1bd763 265/323: * beardbolt.el (bb-compile): Fix handling of bb-asm-format., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4cbe58f834 279/323: Add -g1 instead of -g to speed it up massively, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2542f24813 285/323: Tweak, rework, speed up main algorithm again, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 85bc714336 295/323: Simplify source file tracking, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c5086ea624 294/323: bb--output-mode now a major mode, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 298a5fe6a2 296/323: Fix starter/beardbolt.cpp, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 067096f3b9 299/323: Friendlier beardbolt--output-mode, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0ae21a302a 302/323: Simplify window management in preparation of beardbolt-execute-program, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 842b2159da 305/323: More simplification, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 60d189b0a6 310/323: Advertise beardbolt-execute and a few other things, ELPA Syncer, 2023/03/09