[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt b4f31813dc 240/323: Auto stop an existing com
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt b4f31813dc 240/323: Auto stop an existing compilation |
Date: |
Thu, 9 Mar 2023 10:58:34 -0500 (EST) |
branch: externals/beardbolt
commit b4f31813dc2600880b30f7a949bc0eb14db397f0
Author: Erik Arvstedt <erik.arvstedt@gmail.com>
Commit: Erik Arvstedt <erik.arvstedt@gmail.com>
Auto stop an existing compilation
This makes rmsbolt work smoothly when the update interval is shorter
than the compilation duration.
Previously, an interactive query was shown by `compile.el`,
interrupting the typing flow.
---
rmsbolt.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/rmsbolt.el b/rmsbolt.el
index b20bda0c53..4aa50f9264 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1314,12 +1314,13 @@ Argument ASM-LINES input lines."
(nreverse result)))
;;;;; Handlers
-(cl-defun rmsbolt--handle-finish-compile (buffer str &key override-buffer)
+(cl-defun rmsbolt--handle-finish-compile (buffer str &key override-buffer
stopped)
"Finish hook for compilations.
Argument BUFFER compilation buffer.
Argument STR compilation finish status.
Argument OVERRIDE-BUFFER asm src buffer to use instead of reading
- `rmsbolt-output-filename'."
+ `rmsbolt-output-filename'.
+Argument STOPPED The compilation was stopped to start another compilation."
(when (not (buffer-live-p buffer))
(error "Dead buffer passed to compilation-finish-function! RMSBolt cannot
continue."))
(let ((compilation-fail
@@ -1330,7 +1331,8 @@ Argument OVERRIDE-BUFFER asm src buffer to use instead of
reading
(with-current-buffer (get-buffer-create rmsbolt-output-buffer)
;; Store src buffer value for later linking
- (cond ((not compilation-fail)
+ (cond (stopped) ; Do nothing
+ ((not compilation-fail)
(if (and (not override-buffer)
(not (file-exists-p (rmsbolt-output-filename src-buffer
t))))
(message "Error reading from output file.")
@@ -1488,6 +1490,7 @@ and return it."
(rmsbolt-l-elisp-compile-override (rmsbolt--get-lang))
:src-buffer (current-buffer))))
(t
+ (rmsbolt--stop-running-compilation)
(rmsbolt--parse-options)
(let* ((src-buffer (current-buffer))
(lang (rmsbolt--get-lang))
@@ -1551,6 +1554,17 @@ and return it."
#'rmsbolt--handle-finish-compile nil t)
(setq rmsbolt-src-buffer src-buffer))))))
+(defun rmsbolt--stop-running-compilation ()
+ (when-let* ((compilation-buffer (get-buffer "*rmsbolt-compilation*"))
+ (proc (get-buffer-process compilation-buffer)))
+ (when (eq (process-status proc) 'run)
+ (set-process-sentinel proc nil)
+ (interrupt-process proc)
+ (rmsbolt--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))))
+
;;;; Keymap
(defvar rmsbolt-mode-map
(let ((map (make-sparse-keymap)))
- [elpa] externals/beardbolt 2e1ff0653e 216/323: Correct location of parse hook, (continued)
- [elpa] externals/beardbolt 2e1ff0653e 216/323: Correct location of parse hook, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 345059d4f4 219/323: Set `defvar-local` vars with `setq`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4f6ffdd254 226/323: Rename rmsbolt-move-overlays -> rmsbolt-update-overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 464b524e49 221/323: Remove redundant `and`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 51ff24b3b1 217/323: Fix native-comp docstring warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 0bc89903f1 231/323: on-kill-buffer: Fix error on missing output-buffer, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d09d72f463 215/323: Add after-parse-hook, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt af37266681 227/323: Rename rmsbolt--cleanup-overlays -> rmsbolt--remove-overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f3fe3d24db 230/323: Don't use a timer for updating overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 6d0d799d44 233/323: Fix docstring warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b4f31813dc 240/323: Auto stop an existing compilation,
ELPA Syncer <=
- [elpa] externals/beardbolt 50cd4c6d0c 234/323: Use setq for `rmsbolt-dir`, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 9c56c62993 247/323: Update texi docs, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3baf531b55 238/323: Refactor: Move let binding closer to point of usage, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 24ac775643 246/323: Support Nim 1.6.6, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt e634757395 235/323: Remove unneeded lambda, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3514e6f288 237/323: rmsbolt-compile: Only ask to save the current buffer, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ea22302660 258/323: Delete beardbolt-split.el, doesn't justify separate file, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 7619539a86 243/323: starters/elisp: Fix compiler warning, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d37371b088 249/323: Fix byte-compilation warnings, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 1873e605ab 256/323: Remove unused test/test-helper.el, ELPA Syncer, 2023/03/09