branch: externals/beardbolt
commit ec99a1aa319408f44a7ebf1d17adc298d559cdb1
Author: Jay Kamat <jaygka...@gmail.com>
Commit: Jay Kamat <jaygka...@gmail.com>

    Attempt to fix whitespace clearing on hot recompiles
    
    Does anyone want to have their before-save-hooks run automatically?
---
 rmsbolt.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 4a38b6396c..6bf8025b4e 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1406,8 +1406,13 @@ Argument OVERRIDE-BUFFER use this buffer instead of 
reading from the output file
                                (eq rmsbolt-automatic-recompile 'force)))
              (modified (buffer-modified-p src-buffer)))
     (with-current-buffer src-buffer
-      ;; Write to disk
-      (save-buffer)
+      ;; Clear `before-save-hook' to prevent things like whitespace cleanup or
+      ;; aggressive indent from running (this is a hot recompile):
+      ;; 
https://github.com/syl20bnr/spacemacs/blob/c7a103a772d808101d7635ec10f292ab9202d9ee/layers/%2Bspacemacs/spacemacs-editing/local/spacemacs-whitespace-cleanup/spacemacs-whitespace-cleanup.el#L72
+      ;; TODO does anyone want before-save-hook to run on a hot recompile?
+      (let ((before-save-hook nil))
+        ;; Write to disk
+        (save-buffer))
       ;; Recompile
       (setq rmsbolt--automated-compile t)
       (rmsbolt-compile))))

Reply via email to