branch: externals/beardbolt
commit bc0652e56e77f4d6ae3e0929aa9561cdd2eabbe7
Author: Jay Kamat <[email protected]>
Commit: Jay Kamat <[email protected]>
Add support for indirect buffers
Closes #18
---
rmsbolt.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/rmsbolt.el b/rmsbolt.el
index 2e771abbf8..f1272ed717 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1462,16 +1462,21 @@ Are you running two compilations at the same time?"))
;; We cannot compile asm-mode files
(message "Cannot compile assembly files. Are you sure you are not in the
output buffer?"))
((rmsbolt-l-elisp-compile-override (rmsbolt--get-lang))
- (funcall
- (rmsbolt-l-elisp-compile-override (rmsbolt--get-lang))
- :src-buffer (current-buffer)))
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+ (funcall
+ (rmsbolt-l-elisp-compile-override (rmsbolt--get-lang))
+ :src-buffer (current-buffer))))
(t
(rmsbolt--parse-options)
(let* ((src-buffer (current-buffer))
(lang (rmsbolt--get-lang))
(func (rmsbolt-l-compile-cmd-function lang))
;; Generate command
- (cmd (funcall func :src-buffer src-buffer))
+ (cmd
+ ;; Compilation commands assume the current buffer is a real file
+ ;; currently - this works around that.
+ (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+ (funcall func :src-buffer src-buffer)))
(asm-format
(buffer-local-value 'rmsbolt-asm-format src-buffer))
(default-directory (or rmsbolt-default-directory