[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/beardbolt 4a35528d7d 021/323: Configure all variables w
From: |
ELPA Syncer |
Subject: |
[elpa] externals/beardbolt 4a35528d7d 021/323: Configure all variables with buffer-local values |
Date: |
Thu, 9 Mar 2023 10:57:55 -0500 (EST) |
branch: externals/beardbolt
commit 4a35528d7dce2c8a14910162a8b59d5e9080c076
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>
Configure all variables with buffer-local values
---
rmsbolt.el | 46 ++++++++++++++++++++++++++++++++--------------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/rmsbolt.el b/rmsbolt.el
index ad9d12050a..8f90023fad 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -38,11 +38,33 @@
(defcustom rmsbolt-dissasemble nil
"Whether we should dissasemble an output binary."
:type 'boolean
- :safe 'booleanp)
+ :safe 'booleanp
+ :group 'rmsbolt)
(defcustom rmsbolt-command nil
"The base command to run rmsbolt from."
:type 'string
- :safe (lambda (v) (or (booleanp v) (stringp v))))
+ :safe (lambda (v) (or (booleanp v) (stringp v)))
+ :group 'rmsbolt)
+(defcustom rmsbolt-intel-x86 t
+ "Whether to use intel x86 format or att."
+ :type 'boolean
+ :safe 'booleanp
+ :group 'rmsbolt)
+(defcustom rmsbolt-filter-directives t
+ "Whether to filter assembly directives."
+ :type 'boolean
+ :safe 'booleanp
+ :group 'rmsbolt)
+(defcustom rmsbolt-filter-labels t
+ "Whether to filter unused labels."
+ :type 'boolean
+ :safe 'booleanp
+ :group 'rmsbolt)
+(defcustom rmsbolt-filter-comment-only t
+ "Whether to filter comment-only lines."
+ :type 'boolean
+ :safe 'booleanp
+ :group 'rmsbolt)
;;;; Variables:
@@ -53,10 +75,6 @@
(defvar rmsbolt-output-buffer "*rmsbolt-output*")
(defvar rmsbolt-hide-compile t)
-(defvar rmsbolt-intel-x86 t)
-(defvar rmsbolt-filter-asm-directives t)
-(defvar rmsbolt-filter-unused-labels t)
-(defvar rmsbolt-filter-comment-only t)
(defvar rmsbolt-binary-asm-limit 5000)
(defun rmsbolt-output-filename (src-buffer &optional asm)
(if (and (not asm)
@@ -167,7 +185,7 @@
"-S")
(buffer-file-name)
"-o" (rmsbolt-output-filename src-buffer)
- (when rmsbolt-intel-x86
+ (when (buffer-local-value 'rmsbolt-intel-x86
src-buffer)
"-masm=intel"))
" ")))
cmd))
@@ -290,7 +308,7 @@ int main() {
nil
(string-match-p rmsbolt-has-opcode line)))))
-(defun rmsbolt--find-used-labels (asm-lines)
+(defun rmsbolt--find-used-labels (src-buffer asm-lines)
"Find used labels in asm-lines."
(let ((match nil)
(current-label nil)
@@ -313,7 +331,7 @@ int main() {
(unless (or (= 0 (length line))
(string-prefix-p "." line)
(not (string-match-p rmsbolt-label-find line)))
- (if (or (not rmsbolt-filter-asm-directives)
+ (if (or (not (buffer-local-value 'rmsbolt-filter-directives
src-buffer))
(rmsbolt--has-opcode-p line)
(string-match-p rmsbolt-defines-function line))
;; Add labels indescriminantly
@@ -387,7 +405,7 @@ int main() {
"Process and filter a set of asm lines."
(if (buffer-local-value 'rmsbolt-dissasemble src-buffer)
(rmsbolt--process-dissasembled-lines src-buffer asm-lines)
- (let ((used-labels (rmsbolt--find-used-labels asm-lines))
+ (let ((used-labels (rmsbolt--find-used-labels src-buffer asm-lines))
(result nil)
(prev-label nil))
(dolist (line asm-lines)
@@ -402,7 +420,7 @@ int main() {
(when (string-match-p rmsbolt-endblock line)
(setq prev-label nil))
- (when (and rmsbolt-filter-comment-only
+ (when (and (buffer-local-value 'rmsbolt-filter-comment-only
src-buffer)
(string-match-p rmsbolt-comment-only line))
(go continue))
@@ -410,11 +428,11 @@ int main() {
(when match
(if (not used-label)
;; Unused label
- (when rmsbolt-filter-unused-labels
+ (when (buffer-local-value 'rmsbolt-filter-labels src-buffer)
(go continue))
;; Real label, set prev-label
(setq prev-label raw-match)))
- (when (and rmsbolt-filter-asm-directives
+ (when (and (buffer-local-value 'rmsbolt-filter-directives
src-buffer)
(not match))
(if (and (string-match-p rmsbolt-data-defn line)
prev-label)
@@ -492,7 +510,7 @@ int main() {
"&&"
"objdump" "-d" (rmsbolt-output-filename
src-buffer)
"-C" "--insn-width=16" "-l"
- "-M" (if rmsbolt-intel-x86
+ "-M" (if (buffer-local-value
'rmsbolt-intel-x86 src-buffer)
"intel"
"att")
">" (rmsbolt-output-filename src-buffer t))
- [elpa] externals/beardbolt 545a366472 049/323: Add more tests, (continued)
- [elpa] externals/beardbolt 545a366472 049/323: Add more tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2e6163c95a 047/323: Add testing framework, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 5efa347027 046/323: Update readme, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 082cbc7b1c 048/323: Add new tests, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt ff6f376d87 053/323: Update README.org, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 3ca3f35cdb 050/323: Add very basic support for rust, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 65a1ac7b6e 054/323: Add support for demangling, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt bb64352f8d 034/323: Store and use ranges to view highlighted regions, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 1419a90465 040/323: Add C/C++ demo, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 39f1e05667 009/323: Add filter for commentOnly, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 4a35528d7d 021/323: Configure all variables with buffer-local values,
ELPA Syncer <=
- [elpa] externals/beardbolt 3bfc7ed2e3 012/323: Allow custom functions to parse arguments, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 98cea6e8e0 023/323: Simplify creation of new starters with a macro, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 547a47e58f 022/323: Fix default commands, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 2530003c71 020/323: Remove rmsbolt-options, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt cf7d2787bc 027/323: Implement line number parsing, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt 8fc36eacd8 044/323: Add option to force assembling, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d37f8a0ebf 042/323: Remove reliance on hl-line-mode, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt a0527f16af 045/323: Add very basic support for common lisp, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt d7acfdd127 041/323: Fix rmsbolt temp directory generation being too late, ELPA Syncer, 2023/03/09
- [elpa] externals/beardbolt f0d13c4ac2 036/323: Add a stronger blacklist for ocaml asm, ELPA Syncer, 2023/03/09