[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt dbafc4a88c 304/323: Minor cleanup
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt dbafc4a88c 304/323: Minor cleanup |
Date: |
Thu, 9 Mar 2023 10:58:57 -0500 (EST) |
branch: externals/beardbolt
commit dbafc4a88c5d61249c1cc898b5238f424cc17de3
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Minor cleanup
* beardbolt.el (bb--defoption, bb--asm-buffer)
(bb-hide-compile, bb--handle-finish-compile)
(bb--on-kill-output-buffer, bb--asm-mode): Tweak.
---
beardbolt.el | 63 ++++++++++++++++--------------------------------------------
1 file changed, 17 insertions(+), 46 deletions(-)
diff --git a/beardbolt.el b/beardbolt.el
index 07dac06acf..bd4a7e9834 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -43,63 +43,38 @@
:group 'applications)
(defmacro bb--defoption (sym &rest whatever)
- `(progn (defcustom ,sym ,@whatever)
- (put ',sym 'bb--option t)))
-
-
-(bb--defoption bb-disassemble nil
- "Whether we should disassemble an output binary."
- :type 'boolean
- :safe 'booleanp
- :group 'beardbolt)
+ `(progn (defcustom ,sym ,@whatever) (put ',sym 'bb--option t)))
(bb--defoption bb-command nil
"The base command to run beardbolt from."
- :type 'string
- ;; nil means use default command
- :safe (lambda (v) (or (booleanp v) (listp v) (stringp v)))
- :group 'beardbolt)
-
+ :type 'string :safe (lambda (v) (or (listp v) (stringp v))))
+(bb--defoption bb-disassemble nil
+ "Non-nil to assemble then disassemble an output binary."
+ :type 'boolean :safe 'booleanp)
(bb--defoption bb-asm-format 'att
"Which output assembly format to use.
Passed directly to compiler or disassembler."
- :type 'string
- :safe (lambda (v) (or (booleanp v) (symbolp v) (stringp v)))
- :group 'beardbolt)
+ :type 'string :safe (lambda (v) (or (null v) (symbolp v) (stringp v))))
(bb--defoption bb-preserve-directives nil
"Non-nil to keep assembly directives."
- :type 'boolean
- :safe 'booleanp
- :group 'beardbolt)
+ :type 'boolean :safe 'booleanp)
(bb--defoption bb-preserve-unused-labels nil
"Non-nil to keep unused labels."
- :type 'boolean
- :safe 'booleanp
- :group 'beardbolt)
+ :type 'boolean :safe 'booleanp)
(bb--defoption bb-preserve-library-functions nil
"Non-nil to keep functions with no code related to current file."
- :type 'boolean
- :safe 'booleanp
- :group 'beardbolt)
+ :type 'boolean :safe 'booleanp)
(bb--defoption bb-preserve-comments nil
"Non-nil to filter comment-only lines."
- :type 'boolean
- :safe 'booleanp
- :group 'beardbolt)
+ :type 'boolean :safe 'booleanp)
(bb--defoption bb-demangle t
"Non-nil to attempt to demangle the resulting assembly."
- :type 'boolean
- :safe 'booleanp
- :group 'beardbolt)
-
-;;;; Faces
+ :type 'boolean :safe 'booleanp)
(defface bb-current-line-face
'((t (:weight bold :inherit highlight)))
- "Face to fontify the current line for showing matches."
- :group 'beardbolt)
+ "Face to fontify the current line for showing matches.")
-;;;; Basic model
(defvar-local bb--asm-buffer nil)
(defvar-local bb--source-buffer nil)
(defvar-local bb--compile-spec nil)
@@ -109,7 +84,7 @@ Passed directly to compiler or disassembler."
(defvar-local bb--rainbow-overlays nil "Rainbow overlays.")
(defun bb--asm-buffer (src-buffer)
- "Get/create output buffer for current source file."
+ "Get/create asm buffer for current source file."
(with-current-buffer src-buffer
(or (and (buffer-live-p bb--asm-buffer)
(equal (buffer-name bb--asm-buffer) "*bb-asm*")
@@ -119,8 +94,6 @@ Passed directly to compiler or disassembler."
(get-buffer-create "*bb-asm*")
(current-buffer))))))
-(defvar bb-hide-compile t)
-
(defvar bb-compile-delay 0.6
"Time in seconds to delay before recompiling if there is a change.
If nil, auto-recompilation is off.")
@@ -511,9 +484,9 @@ Argument STR compilation finish status."
(let* ((src-buffer bb--source-buffer)
(compile-spec bb--compile-spec)
(declared-output bb--declared-output)
- (output-buffer (bb--asm-buffer src-buffer))
+ (asm-buffer (bb--asm-buffer src-buffer))
(split-width-threshold (min split-width-threshold 100)))
- (with-current-buffer output-buffer
+ (with-current-buffer asm-buffer
(bb--asm-mode)
(setq bb--source-buffer src-buffer)
(let* ((inhibit-modification-hooks t)
@@ -677,7 +650,7 @@ With prefix argument, choose from starter files in
`bb-starter-files'."
(bb--when-live-buffer bb--asm-buffer
(kill-buffer bb--asm-buffer)))
-(defun bb--on-kill-output-buffer ()
+(defun bb--on-kill-asm-buffer ()
(bb--delete-rainbow-overlays))
(defun bb--asm-buffer-pch ()
@@ -710,8 +683,6 @@ With prefix argument, choose from starter files in
`bb-starter-files'."
(cmd (bb--split-rm-single cmd "-flto" #'string-prefix-p)))
cmd))
-;;;; Mode Definition:
-
;;;###autoload
(define-minor-mode bb-mode
"Toggle `beardbolt-mode'. May be enabled by user in source buffer."
@@ -729,7 +700,7 @@ With prefix argument, choose from starter files in
`bb-starter-files'."
(define-derived-mode bb--asm-mode asm-mode "⚡asm ⚡"
"Toggle `bearbolt--output-mode', internal mode for asm buffers."
- (add-hook 'kill-buffer-hook #'bb--on-kill-output-buffer nil t)
+ (add-hook 'kill-buffer-hook #'bb--on-kill-asm-buffer nil t)
(add-hook 'post-command-hook #'bb--asm-buffer-pch nil t)
(setq truncate-lines t)
(read-only-mode t)
- [elpa] externals/beardbolt 28fc329861 262/323: Rework bb-compile a bit, (continued)
- [elpa] externals/beardbolt 28fc329861 262/323: Rework bb-compile a bit, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f491a6adb2 278/323: Rework to use write-region, use a little less memory, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2633e20e66 274/323: * beardbolt.el (bb--reachable-p): Rework for small speed gain., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 60fa7a3c05 280/323: Force asm output to be of a certain format, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt b2dc0eb81d 284/323: Make beardbolt-disassemble work again, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 730ea84796 290/323: bb-compile-delay can be nil, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2c798336b8 292/323: Tweak README.md, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt c05a0be490 297/323: Add useful beardbolt-preserve-library-functions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 26c0b918e4 301/323: Tweak README.md again, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt e1e69080b7 303/323: Rename "output buffer" -> "asm buffer", ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt dbafc4a88c 304/323: Minor cleanup,
ELPA Syncer <=
- [elpa] externals/beardbolt 68469cfb57 306/323: More misc minor rework to simplify code, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 02a0bfbcdb 313/323: Add `beardbolt-ccj-extra-flags` option, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 6a71a16619 319/323: Simplify rainbow-clearing logic, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt e403331350 322/323: * beardbolt.el (bb--synch-relation-overlays): Fix bug., ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4a6f289c94 002/323: Add very basic compilation of c files, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ac893146e3 019/323: Force dissasembly if we don't support asm, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f30a05624d 051/323: Add support for parsing .file directives, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 865d5a8c1a 111/323: Clean up CI config, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 7f61815c17 121/323: Try to fix bytecode issues, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt e517cd4dbc 142/323: Remove unneeded disass-hidden-funcs overrides, ELPA Syncer, 2023/03/09