emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/beardbolt c5086ea624 294/323: bb--output-mode now a maj


From: ELPA Syncer
Subject: [elpa] externals/beardbolt c5086ea624 294/323: bb--output-mode now a major mode
Date: Thu, 9 Mar 2023 10:58:49 -0500 (EST)

branch: externals/beardbolt
commit c5086ea624fcaa1d3a2c3046143896a18e6a812a
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    bb--output-mode now a major mode
    
    * beardbolt.el (bb-compile-delay): Adjust to 0.6
    (bb--handle-finish-compile): Use bb--output-mode
    (bb--output-mode): Now a major mode.
---
 beardbolt.el | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/beardbolt.el b/beardbolt.el
index 46f9cae61c..6f6412f050 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -127,7 +127,7 @@ Passed directly to compiler or disassembler."
 
 (defvar bb-hide-compile t)
 
-(defvar bb-compile-delay 1.0
+(defvar bb-compile-delay 0.6
   "Time in seconds to delay before recompiling if there is a change.
 If nil, auto-recompilation is off.")
 
@@ -517,10 +517,9 @@ Argument STR compilation finish status."
          (output-buffer (bb--output-buffer src-buffer))
          (split-width-threshold (min split-width-threshold 100)))
     (with-current-buffer output-buffer
-      (asm-mode)
-      (display-line-numbers-mode)
-      (setq bb--source-buffer src-buffer)
       (bb--output-mode)
+
+      (setq bb--source-buffer src-buffer)
       (buffer-disable-undo)
       ;; Store src buffer value for later linking
       (cond
@@ -742,16 +741,12 @@ With prefix argument, choose from starter files in 
`bb-starter-files'."
     (remove-hook 'kill-buffer-hook #'bb--on-kill-source-buffer t)
     (remove-hook 'post-command-hook #'bb--source-buffer-pch t))))
 
-(define-minor-mode bb--output-mode
+(define-derived-mode bb--output-mode asm-mode "⚡output⚡"
   "Toggle `bearbolt--output-mode', internal mode for asm buffers."
-  :global nil :lighter " ⚡"
-  (cond
-   (bb--output-mode
-    (add-hook 'kill-buffer-hook #'bb--on-kill-output-buffer nil t)
-    (add-hook 'post-command-hook #'bb--output-buffer-pch nil t))
-   (t
-    (remove-hook 'kill-buffer-hook #'bb--on-kill-output-buffer t)
-    (remove-hook 'post-command-hook #'bb--output-buffer-pch t))))
+  (add-hook 'kill-buffer-hook #'bb--on-kill-output-buffer nil t)
+  (add-hook 'post-command-hook #'bb--output-buffer-pch nil t)
+  (setq truncate-lines t)
+  (display-line-numbers-mode))
 
 ;;;###autoload
 (defun beardbolt ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]