[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 1c0e96060b 229/323: Don't set global kill-buf
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 1c0e96060b 229/323: Don't set global kill-buffer-hook |
Date: |
Thu, 9 Mar 2023 10:58:33 -0500 (EST) |
branch: externals/beardbolt
commit 1c0e96060b5203414524eecbdf2c4465155bc728
Author: Erik Arvstedt <erik.arvstedt@gmail.com>
Commit: Erik Arvstedt <erik.arvstedt@gmail.com>
Don't set global kill-buffer-hook
Instead, set the hook locally.
Also don't remove overlays when a src buffer is killed that is no
longer current.
---
rmsbolt.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/rmsbolt.el b/rmsbolt.el
index 3136b69de1..abc0dd05fd 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1713,10 +1713,11 @@ Are you running two compilations at the same time?"))
(mapc #'delete-overlay rmsbolt-overlays)
(setq rmsbolt-overlays nil))
-(defun rmsbolt--kill-buffer-cleanup ()
- "A simple hook to listen for the output buffer close so we can clean up
overlays."
- (when (eq (current-buffer) (get-buffer rmsbolt-output-buffer))
- (rmsbolt--remove-overlays)))
+(defun rmsbolt--on-kill-buffer ()
+ (let ((output-buffer (get-buffer rmsbolt-output-buffer)))
+ (when (or (eq (current-buffer) output-buffer)
+ (eq (current-buffer) (buffer-local-value 'rmsbolt-src-buffer
output-buffer)))
+ (rmsbolt--remove-overlays))))
(defun rmsbolt-hot-recompile ()
"Recompile source buffer if we need to."
@@ -1759,13 +1760,13 @@ This mode is enabled in both src and assembly output
buffers."
;; Init
(cond
(rmsbolt-mode
+ (add-hook 'kill-buffer-hook #'rmsbolt--on-kill-buffer nil t)
;; This idle timer always runs, even when we aren't in rmsbolt-mode
;; It won't do anything unless we are in rmsbolt-mode
(unless rmsbolt--idle-timer
(setq rmsbolt--idle-timer (run-with-idle-timer
rmsbolt-overlay-delay t
- #'rmsbolt-update-overlays))
- (add-hook 'kill-buffer-hook #'rmsbolt--kill-buffer-cleanup))
+ #'rmsbolt-update-overlays)))
(unless (or rmsbolt--compile-idle-timer
(not rmsbolt-automatic-recompile))
(setq rmsbolt--compile-idle-timer (run-with-idle-timer
@@ -1773,7 +1774,8 @@ This mode is enabled in both src and assembly output
buffers."
#'rmsbolt-hot-recompile)))
(rmsbolt--gen-temp))
(t ;; Cleanup
- (rmsbolt--remove-overlays))))
+ (rmsbolt--remove-overlays)
+ (remove-hook 'kill-buffer-hook #'rmsbolt--on-kill-buffer t))))
;;;###autoload
(defun rmsbolt ()
- [elpa] externals/beardbolt 25cd95a3b3 174/323: Fix a typo, (continued)
- [elpa] externals/beardbolt 25cd95a3b3 174/323: Fix a typo, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt af0a8a6ec9 189/323: Merge branch 'master' of gitlab.com:jgkamat/rmsbolt, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt fcefc0509d 184/323: Add basic documentation for Swift, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 1b015e8d9b 212/323: Update ci to use alpine directly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 62e68ea2d4 194/323: Fix overlays not working on first compile with popup, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 536a699d1f 193/323: Clean up overlays and mappings if compilation fails, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ea3e0e4257 200/323: Fix incorrect matching of filenames for compile_commands.json, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2bc1afe528 196/323: Strip -save-temps when -P is provided, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 840d7f7a1e 195/323: Add :force t argument to rmsbolt-move-overlays, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c86cc8f11e 199/323: Fix highlights not working with compile_commands.json in some cases, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 1c0e96060b 229/323: Don't set global kill-buffer-hook,
ELPA Syncer <=
- [elpa] externals/beardbolt 7a964319ba 213/323: Merge branch 'zig-0.9' into 'master', ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 981522dcaa 218/323: Improve `rmsbolt-mode` docstring, ELPA Syncer, 2023/03/09
- [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