branch: externals/beardbolt
commit f491a6adb28f2bf9cc8a9e7dd373e0c08b9e0568
Author: João Távora <[email protected]>
Commit: João Távora <[email protected]>
Rework to use write-region, use a little less memory
* beardbolt.el (bb-compile): Rework.
---
beardbolt.el | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/beardbolt.el b/beardbolt.el
index c41837d03f..513329e746 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -666,11 +666,8 @@ Interactively, determine LANG from `major-mode'."
(when risky-vars
(message "[beardbolt] Some variables risky %s" risky-vars)))))
(hack-local-variables))
- (let* ((dump-file
- (let ((inhibit-message t))
- (make-temp-file "beardbolt-dump-" nil
- (concat "." (file-name-extension buffer-file-name))
- (buffer-string))))
+ (let* ((dump-file (make-temp-file "beardbolt-dump-" nil
+ (concat "." (file-name-extension
buffer-file-name))))
(src-buffer (current-buffer))
(specs (funcall (bb--lang-compile-specs lang)))
(spec (alist-get
@@ -678,6 +675,8 @@ Interactively, determine LANG from `major-mode'."
specs))
(command-and-declared-output (funcall (car spec) dump-file))
(cmd (car command-and-declared-output)))
+ (let ((inhibit-message t))
+ (write-region (point-min) (point-max) dump-file))
(with-current-buffer ; With compilation buffer
(let ((shell-file-name (or (executable-find bb--shell)
shell-file-name))