[elpa] externals/async aae9b1927c 1/4: feat: implement reading messages sent from child process

2023-03-09 Thread ELPA Syncer
branch: externals/async
commit aae9b1927c5c24ed52b1ec738d569edfb7017a65
Author: Matus Goljer 
Commit: Matus Goljer 

feat: implement reading messages sent from child process
---
 async.el | 28 ++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/async.el b/async.el
index 244954feb4..12331972c3 100644
--- a/async.el
+++ b/async.el
@@ -197,6 +197,27 @@ It is intended to be used as follows:
  (process-name proc) (process-exit-status proc
   (set (make-local-variable 'async-callback-value-set) t))
 
+(defun async-read-from-client (proc string)
+  ;; log the message in the process buffer
+  (with-current-buffer (process-buffer proc)
+(insert string))
+
+  ;; parse message
+  (with-temp-buffer
+(insert string)
+(goto-char (point-min))
+(let (msg)
+  (condition-case nil
+  (while (setq msg (read (current-buffer)))
+(when-let ((msg-decoded (ignore-errors (base64-decode-string 
msg
+  (setq msg-decoded (car (read-from-string msg-decoded)))
+  (with-current-buffer (process-buffer proc)
+(when async-callback
+  (funcall async-callback msg-decoded)
+;; This is OK, we reached the end of the chunk subprocess sent
+;; at this time.
+(end-of-file t)
+
 (defun async--receive-sexp (&optional stream)
   ;; FIXME: Why use `utf-8-auto' instead of `utf-8-unix'?  This is
   ;; a communication channel over which we have complete control,
@@ -288,8 +309,10 @@ its FINISH-FUNC is nil."
   "Send the given messages to the asynchronous Emacs PROCESS."
   (let ((args (append args '(:async-message t
 (if async-in-child-emacs
-(if async-callback
-(funcall async-callback args))
+(princ
+ (with-temp-buffer
+   (async--insert-sexp args)
+   (buffer-string)))
   (async--transmit-sexp (car args) (list 'quote (cdr args))
 
 (defun async-receive ()
@@ -310,6 +333,7 @@ working directory."
 (with-current-buffer buf
   (set (make-local-variable 'async-callback) finish-func)
   (set-process-sentinel proc #'async-when-done)
+  (set-process-filter proc #'async-read-from-client)
   (unless (string= name "emacs")
 (set (make-local-variable 'async-callback-for-process) t))
   proc)))



[elpa] externals/async 3bd17d58e1 4/4: Merge pull request #167 from Fuco1/feature/implement-child-messages

2023-03-09 Thread ELPA Syncer
branch: externals/async
commit 3bd17d58e1ca14c629e72acfbd77138ff5adc1d6
Merge: 71cc50f27f a982ab7a9a
Author: Thierry Volpiatto 
Commit: GitHub 

Merge pull request #167 from Fuco1/feature/implement-child-messages

feat: implement reading messages sent from child process
---
 async.el | 73 +---
 1 file changed, 66 insertions(+), 7 deletions(-)

diff --git a/async.el b/async.el
index 244954feb4..3761354f73 100644
--- a/async.el
+++ b/async.el
@@ -197,6 +197,27 @@ It is intended to be used as follows:
  (process-name proc) (process-exit-status proc
   (set (make-local-variable 'async-callback-value-set) t))
 
+(defun async-read-from-client (proc string)
+  ;; log the message in the process buffer
+  (with-current-buffer (process-buffer proc)
+(insert string))
+
+  ;; parse message
+  (with-temp-buffer
+(insert string)
+(goto-char (point-min))
+(let (msg)
+  (condition-case nil
+  (while (setq msg (read (current-buffer)))
+(when-let ((msg-decoded (ignore-errors (base64-decode-string 
msg
+  (setq msg-decoded (car (read-from-string msg-decoded)))
+  (with-current-buffer (process-buffer proc)
+(when async-callback
+  (funcall async-callback msg-decoded)
+;; This is OK, we reached the end of the chunk subprocess sent
+;; at this time.
+(end-of-file t)
+
 (defun async--receive-sexp (&optional stream)
   ;; FIXME: Why use `utf-8-auto' instead of `utf-8-unix'?  This is
   ;; a communication channel over which we have complete control,
@@ -280,20 +301,47 @@ its FINISH-FUNC is nil."
  #'identity async-callback-value (current-buffer))
 
 (defun async-message-p (value)
-  "Return non-nil of VALUE is an async.el message packet."
+  "Return non-nil if VALUE is an async.el message packet."
   (and (listp value)
(plist-get value :async-message)))
 
-(defun async-send (&rest args)
-  "Send the given messages to the asynchronous Emacs PROCESS."
+(defun async-send (process-or-key &rest args)
+  "Send the given message to the asychronous child or parent Emacs.
+
+To send messages from the parent to a child, PROCESS-OR-KEY is
+the child process object.  ARGS is a plist.  Example:
+
+  (async-send proc :operation :load-file :file \"this file\")
+
+To send messages from the child to the parent, PROCESS-OR-KEY is
+the first key of the plist, ARGS is a value followed by
+optionally more key-value pairs.  Example:
+
+  (async-send :status \"finished\" :file-size 123)"
   (let ((args (append args '(:async-message t
 (if async-in-child-emacs
-(if async-callback
-(funcall async-callback args))
-  (async--transmit-sexp (car args) (list 'quote (cdr args))
+(princ
+ (with-temp-buffer
+   (async--insert-sexp (cons process-or-key args))
+   (buffer-string)))
+  (async--transmit-sexp process-or-key (list 'quote args)
 
 (defun async-receive ()
-  "Send the given messages to the asynchronous Emacs PROCESS."
+  "Receive message from parent Emacs.
+
+The child process blocks until a message is received.
+
+Message is a plist with one key :async-message set to t always
+automatically added to signify this plist is an async message.
+
+You can use `async-message-p' to test if the payload was a
+message.
+
+Use
+
+   (let ((msg (async-receive))) ...)
+
+to read and process a message."
   (async--receive-sexp))
 
 ;;;###autoload
@@ -310,6 +358,7 @@ working directory."
 (with-current-buffer buf
   (set (make-local-variable 'async-callback) finish-func)
   (set-process-sentinel proc #'async-when-done)
+  (set-process-filter proc #'async-read-from-client)
   (unless (string= name "emacs")
 (set (make-local-variable 'async-callback-for-process) t))
   proc)))
@@ -351,6 +400,16 @@ When done, the return value is passed to FINISH-FUNC.  
Example:
  (message \"Async process done, result should be 222: %s\"
   result)))
 
+If you call `async-send' from a child process, the message will
+be also passed to the FINISH-FUNC.  You can test RESULT to see if
+it is a message by using `async-message-p'.  If nil, it means
+this is the final result.  Example of the FINISH-FUNC:
+
+(lambda (result)
+  (if (async-message-p result)
+  (message \"Received a message from child process: %s\" result)
+(message \"Async process done, result: %s\" result)))
+
 If FINISH-FUNC is nil or missing, a future is returned that can
 be inspected using `async-get', blocking until the value is
 ready.  Example:



[elpa] externals/async c5b1ff0b87 2/4: docs: improve documentation of async-send and async-receive

2023-03-09 Thread ELPA Syncer
branch: externals/async
commit c5b1ff0b870a035c77f6d132f2ba4de929a08fb7
Author: Matus Goljer 
Commit: Matus Goljer 

docs: improve documentation of async-send and async-receive
---
 async.el | 37 +++--
 1 file changed, 31 insertions(+), 6 deletions(-)

diff --git a/async.el b/async.el
index 12331972c3..28b9a87c2b 100644
--- a/async.el
+++ b/async.el
@@ -301,22 +301,47 @@ its FINISH-FUNC is nil."
  #'identity async-callback-value (current-buffer))
 
 (defun async-message-p (value)
-  "Return non-nil of VALUE is an async.el message packet."
+  "Return non-nil if VALUE is an async.el message packet."
   (and (listp value)
(plist-get value :async-message)))
 
-(defun async-send (&rest args)
-  "Send the given messages to the asynchronous Emacs PROCESS."
+(defun async-send (process-or-key &rest args)
+  "Send the given message to the asychronous child or parent Emacs.
+
+To send messages from the parent to a child, PROCESS-OR-KEY is
+the child process object.  ARGS is a plist.  Example:
+
+  (async-send proc :operation :load-file :file \"this file\")
+
+To send messages from the child to the parent, PROCESS-OR-KEY is
+the first key of the plist, ARGS is a value followed by
+optionally more key-value pairs.  Example:
+
+  (async-send :status \"finished\" :file-size 123)"
   (let ((args (append args '(:async-message t
 (if async-in-child-emacs
 (princ
  (with-temp-buffer
-   (async--insert-sexp args)
+   (async--insert-sexp (cons process-or-key args))
(buffer-string)))
-  (async--transmit-sexp (car args) (list 'quote (cdr args))
+  (async--transmit-sexp process-or-key (list 'quote args)
 
 (defun async-receive ()
-  "Send the given messages to the asynchronous Emacs PROCESS."
+  "Receive message from parent Emacs.
+
+The child process blocks until a message is received.
+
+Message is a plist with one key :async-message set to t always
+automatically added to signify this plist is an async message.
+
+You can use `async-message-p' to test if the payload was a
+message.
+
+Use
+
+   (let ((msg (async-receive))) ...)
+
+to read and process a message."
   (async--receive-sexp))
 
 ;;;###autoload



[elpa] externals/async updated (71cc50f27f -> 3bd17d58e1)

2023-03-09 Thread ELPA Syncer
elpasync pushed a change to branch externals/async.

  from  71cc50f27f Merge pull request #166 from bcc32/update-repo-url
   new  aae9b1927c feat: implement reading messages sent from child process
   new  c5b1ff0b87 docs: improve documentation of async-send and 
async-receive
   new  a982ab7a9a docs: add note about how to use result of child 
async-send
   new  3bd17d58e1 Merge pull request #167 from 
Fuco1/feature/implement-child-messages


Summary of changes:
 async.el | 73 +---
 1 file changed, 66 insertions(+), 7 deletions(-)



[elpa] externals/async a982ab7a9a 3/4: docs: add note about how to use result of child async-send

2023-03-09 Thread ELPA Syncer
branch: externals/async
commit a982ab7a9a72c99b3867a6fb5a123f724ddcadcb
Author: Matus Goljer 
Commit: Matus Goljer 

docs: add note about how to use result of child async-send
---
 async.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/async.el b/async.el
index 28b9a87c2b..3761354f73 100644
--- a/async.el
+++ b/async.el
@@ -400,6 +400,16 @@ When done, the return value is passed to FINISH-FUNC.  
Example:
  (message \"Async process done, result should be 222: %s\"
   result)))
 
+If you call `async-send' from a child process, the message will
+be also passed to the FINISH-FUNC.  You can test RESULT to see if
+it is a message by using `async-message-p'.  If nil, it means
+this is the final result.  Example of the FINISH-FUNC:
+
+(lambda (result)
+  (if (async-message-p result)
+  (message \"Received a message from child process: %s\" result)
+(message \"Async process done, result: %s\" result)))
+
 If FINISH-FUNC is nil or missing, a future is returned that can
 be inspected using `async-get', blocking until the value is
 ready.  Example:



[elpa] externals/jit-spell updated (2736376ab8 -> dc58b579d4)

2023-03-09 Thread ELPA Syncer
elpasync pushed a change to branch externals/jit-spell.

  from  2736376ab8 Make sure to remove stray overlays
   new  9abdad2be6 Add a clarification about the face list variables
   new  dc58b579d4 Fix wrong nesting


Summary of changes:
 jit-spell.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)



[elpa] externals/jit-spell dc58b579d4 2/2: Fix wrong nesting

2023-03-09 Thread ELPA Syncer
branch: externals/jit-spell
commit dc58b579d4d074bb7b1f5ff2f4f8a5150cc31b8d
Author: Augusto Stoffel 
Commit: Augusto Stoffel 

Fix wrong nesting
---
 jit-spell.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/jit-spell.el b/jit-spell.el
index fbbd1a499a..8e4e2288e4 100644
--- a/jit-spell.el
+++ b/jit-spell.el
@@ -218,8 +218,8 @@ to END coming first."
   (pcase-dolist (`(,i . ,j) gaps)
 (dolist (ov (overlays-in j end))
   (when (eq 'jit-spell (overlay-get ov 'category))
-(delete-overlay ov))
-  (setq end i)))
+(delete-overlay ov)))
+(setq end i))
   (dolist (ov (overlays-in start end))
 (when (eq 'jit-spell (overlay-get ov 'category))
   (delete-overlay ov



[elpa] externals/jit-spell 9abdad2be6 1/2: Add a clarification about the face list variables

2023-03-09 Thread ELPA Syncer
branch: externals/jit-spell
commit 9abdad2be6985a28d11c32e1949c15813d9851bf
Author: Augusto Stoffel 
Commit: Augusto Stoffel 

Add a clarification about the face list variables
---
 jit-spell.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/jit-spell.el b/jit-spell.el
index d2b20ef06c..fbbd1a499a 100644
--- a/jit-spell.el
+++ b/jit-spell.el
@@ -82,19 +82,22 @@
 font-lock-variable-name-face
 tex-math
 tex-verbatim)
-  "Faces jit-spell should ignore in TeX and derived modes."
+  "Faces jit-spell should ignore in TeX and derived modes.
+You can modify this variable buffer locally, say in a mode hook,
+but this must be done before activating `jit-spell-mode.'"
   :type '(repeat face))
 
 (defcustom jit-spell-prog-mode-faces
   '(font-lock-comment-face
 font-lock-doc-face
 font-lock-string-face)
-  "Faces jit-spell should check in modes derived from `prog-mode'."
+  "Faces jit-spell should check in modes derived from `prog-mode'.
+You can modify this variable buffer locally, say in a mode hook,
+but this must done before activating `jit-spell-mode.'"
   :type '(repeat face))
 
 (defcustom jit-spell-use-apostrophe-hack 'auto
   "Whether to work around Hunspell's issue parsing apostrophes.
-
 In some languages, Hunspell always considers the apostrophe
 character (a.k.a. straight quote) part of the word, which leads
 to false positives when it is used as a quotation mark."



[nongnu] elpa/multiple-cursors 6956e8e12e: Add autoload to activate-cursor-for-undo

2023-03-09 Thread ELPA Syncer
branch: elpa/multiple-cursors
commit 6956e8e12ee191d7c80d042ae8ff495286fcbe38
Author: Magnar Sveen 
Commit: GitHub 

Add autoload to activate-cursor-for-undo

This solves an issue where packages are loaded mid undo-session with undo-fu
---
 multiple-cursors-core.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/multiple-cursors-core.el b/multiple-cursors-core.el
index 194ca0b45d..3d48684ada 100644
--- a/multiple-cursors-core.el
+++ b/multiple-cursors-core.el
@@ -368,6 +368,7 @@ caches will be reset by mc--reset-read-prompts."
 (defvar mc--stored-state-for-undo nil
   "Variable to keep the state of the real cursor while undoing a fake one")
 
+;;;###autoload
 (defun activate-cursor-for-undo (id)
   "Called when undoing to temporarily activate the fake cursor
 which action is being undone."



[nongnu] elpa/org-journal 18df4d5ae5: version 2.2.0

2023-03-09 Thread ELPA Syncer
branch: elpa/org-journal
commit 18df4d5ae5e15580df42562c143d007c6d28d75f
Author: Bastian Bechtold 
Commit: Bastian Bechtold 

version 2.2.0
---
 CHANGELOG  | 33 +
 CONTRIBUTORS   | 14 ++
 org-journal.el |  2 +-
 3 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index f43e45eece..ca77d60997 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,36 @@
+2.2.0 / 2023-03-09
+==
+
+- fix to check journal files in symlink directory correctly (tomoyukim)
+- Add note for issue #406 in README.org (Marcel van der Boom)
+- fix: do not error out on timestamps with extra components (#407) (Janek)
+- fix failing test case #404 (Jason May)
+- don't break journaling if CREATED exists at file level #383 (Jason May)
+- fill docstrings to prevent byte-compile warnings (Jason May)
+- Add NonGNU ELPA to installation instructions (Stefan Kangas)
+- Add NonGNU ELPA badge to README.org (Stefan Kangas)
+- Add copyright and license header (Stefan Kangas)
+- Encryption enabling added to org-journal-mode-hook (quantum)
+- added documentation for `org-journal-mode-hook` (quantum)
+- visual-line-mode not present in org-journal-mode-hook (quantum)
+- Replace kill-region with delete-region (Janek)
+- removed repeated text from readme (Harsha Somisetty)
+- Fix multi-line file header being mixed up with the journal entry. (Alexander 
Miller)
+- Minor typos in docstrings (Christopher League)
+- document org-journal-hide-entries-p (Damien)
+- Remove deplicate of C-c C-j definition. (Dmitrii Kuragin)
+- Update documentation to reflect removed 'C-c C-j' global key (Dmitrii 
Kuragin)
+- Remove key definition in the package loading. (Dmitrii Kuragin)
+- Fix failing test (Christian Schwarzgruber)
+- Set FIXEDCASE flag on replace-regexp-in-string (Christian Schwarzgruber)
+- Add scheduled entry time of the day (Daniel Nicolai)
+- Replace get-file-buffer with find-buffer-visiting (wolfwang)
+- Fix incorrect entry-path when extend-today (yangsheng6810)
+- Just a little code rework (Christian Schwarzgruber)
+- Swallow message in test (Christian Schwarzgruber)
+- Also test against Emacs 27.1 (Christian Schwarzgruber)
+- Fix and clean-up org-journal-scheduled-weekly-test (Christian Schwarzgruber)
+- Fix Agenda integration when not using daily files (Christian Schwarzgruber)
 
 2.1.2 / 2021-01-28
 ==
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 8988f0228e..dd60ceb10d 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -3,16 +3,25 @@ Christian Schwarzgruber - maintainer
 
 Akira Komamura
 Alan Schmitt
+Alexander Miller
 Chad Lamb
+Christian Schwarzgruber
+Christopher League
+Damien
 David Duthie
 David Smith
+Dmitrii Kuragin
 Donghyun Cho
 EFLS
+Harsha Somisetty
 Ja0nz
+Janek
+Jason May
 Jay
 Jeff Spaulding
 Jinhee Baek
 Kevin Liu
+Marcel van der Boom
 Matthew M. Keeler
 Michael Markert
 Miciah Masters
@@ -23,6 +32,7 @@ Ram Raghunathan
 Rudi Grinberg
 Samim Pezeshki
 Sibi Prabakaran
+Stefan Kangas
 Stig Brautaset
 Sébastien Lerique
 Tina Russell
@@ -37,5 +47,9 @@ dks
 doolio
 duianto
 emiltoacs
+quantum
 robinx
+tomoyukin
 whiskeyputers
+wolfwang
+yangsheng6810
diff --git a/org-journal.el b/org-journal.el
index 720e46181f..9af8f34bc3 100644
--- a/org-journal.el
+++ b/org-journal.el
@@ -6,7 +6,7 @@
 ;; Christian Schwarzgruber
 
 ;; URL: http://github.com/bastibe/org-journal
-;; Version: 2.1.2
+;; Version: 2.2.0
 ;; Package-Requires: ((emacs "25.1") (org "9.1"))
 
 ;; Redistribution and use in source and binary forms, with or without



[elpa] main b2bcc83b78: * elpa-packages (denote-menu): New package

2023-03-09 Thread Stefan Monnier via
branch: main
commit b2bcc83b789fce88c9c3ae27de65d299f46dea92
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (denote-menu): New package
---
 elpa-packages | 5 +
 1 file changed, 5 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index d1a575cba6..bb1912e978 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -83,6 +83,8 @@
   ;; a "parallel" history to that of the upstream.
   :manual-sync t)
  (beacon   :url "https://github.com/Malabarba/beacon";)
+ (beardbolt:url "https://github.com/joaotavora/beardbolt";
+  :readme "README.md")
  (beframe  :url "https://git.sr.ht/~protesilaos/beframe";
   :doc "README.org"
   :readme "README.md"
@@ -187,6 +189,9 @@
   :doc "README.org"
   :news "CHANGELOG.org"
   :ignored-files ("COPYING" "doclicense.texi"))
+ (denote-menu  :url "https://github.com/namilus/denote-menu";
+  :doc "README.org"
+  :ignored-files ("COPYING"))
  (detached :url "https://git.sr.ht/~niklaseklund/detached.el";
   :news "CHANGELOG.org"
   :readme "README.md")



[elpa] externals/beardbolt 2626732524 003/323: Add filter for assembler directives

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 26267325247c7ad4e2294f24fbc50747adbfde8c
Author: Jay Kamat 
Commit: Jay Kamat 

Add filter for assembler directives
---
 rmsbolt.el | 39 ++-
 1 file changed, 34 insertions(+), 5 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 62e418fccb..e1b8505334 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -25,8 +25,14 @@
 
 ;;; Constants:
 
+(require 'cl-lib)
+
 (defconst +rmsbolt-compile-name+ "rmsbolt-compile")
 
+(defconst +rmsbolt-assembler-pattern+ (rx bol (1+ space)
+  "." (1+ (not (any ";")))
+  (0+ space) eol))
+
 ;;; Code:
  Variables:
 (defvar rmsbolt-temp-dir nil
@@ -37,6 +43,8 @@
 
 (defvar rmsbolt-output-filename "rmsbolt.s")
 (defvar rmsbolt-hide-compile t)
+(defvar rmsbolt-intel-x86 t)
+(defvar rmsbolt-filter-asm-directives t)
 
  Macros
 
@@ -50,6 +58,18 @@
 
 
  Functions
+
+(defun rmsbolt--process-asm-lines (asm-lines)
+  "Process and filter a set of asm lines."
+  (when rmsbolt-filter-asm-directives
+(setq asm-lines
+  (cl-remove-if
+   (apply-partially #'string-match-p +rmsbolt-assembler-pattern+)
+   asm-lines)))
+  (mapconcat 'identity
+ asm-lines
+ "\n"))
+
 (defun rmsbolt--handle-finish-compile (buffer _str)
   "Finish hook for compilations."
   (let ((compilation-fail
@@ -60,10 +80,16 @@
 
 (with-current-buffer (get-buffer-create rmsbolt-output-buffer)
   (cond ((not compilation-fail)
- (delete-region (point-min) (point-max))
- (insert-file-contents rmsbolt-output-filename)
- (asm-mode)
- (display-buffer (current-buffer)))
+ (if (not (file-exists-p rmsbolt-output-filename))
+ (message "Error reading from output file.")
+   (delete-region (point-min) (point-max))
+   (insert
+(rmsbolt--process-asm-lines
+ (with-temp-buffer
+   (insert-file-contents rmsbolt-output-filename)
+   (split-string (buffer-string) "\n" t
+   (asm-mode)
+   (display-buffer (current-buffer
 (t
  ;; Display compilation output
  (display-buffer buffer))
@@ -76,8 +102,11 @@
  (cmd (mapconcat 'identity
  (list cmd
"-S" (buffer-file-name)
-   "-o" rmsbolt-output-filename)
+   "-o" rmsbolt-output-filename
+   (when rmsbolt-intel-x86
+ "-masm=intel"))
  " ")))
+
 (rmsbolt-with-display-buffer-no-window
  (with-current-buffer (compilation-start cmd)
(add-hook 'compilation-finish-functions



[elpa] branch externals/beardbolt created (now 06fd5a1eee)

2023-03-09 Thread ELPA Syncer
elpasync pushed a change to branch externals/beardbolt.

at  06fd5a1eee * beardbolt.el (bb--guess-from-ccj): Don't mess with -O 
flags

This branch includes the following new commits:

   new  61ccd7a73e Initial commit
   new  4a6f289c94 Add very basic compilation of c files
   new  2626732524 Add filter for assembler directives
   new  43f0eac016 Add support for changing compiler and flags
   new  83e29706f5 Work on porting used label finder
   new  1545531849 Add initial implementation of filter
   new  b6127c7f67 Fix error when not filtering for labels
   new  58c77d90c3 Add outshine comments
   new  39f1e05667 Add filter for commentOnly
   new  de183bea12 Add support for c++ and c
   new  f04df12d28 Add config facility for object dumping
   new  3bfc7ed2e3 Allow custom functions to parse arguments
   new  e0bc9fc409 Fix starters
   new  5ab75b7f56 Add stubs for dissasembly
   new  d604adae64 Add initial functions for processing binary asm
   new  90b5cad9c1 Finish initial implementation of dissasembly
   new  93f3cad769 Use local variables instead of custom parsing
   new  38649b53f2 Relicense to affero GPL
   new  ac893146e3 Force dissasembly if we don't support asm
   new  2530003c71 Remove rmsbolt-options
   new  4a35528d7d Configure all variables with buffer-local values
   new  547a47e58f Fix default commands
   new  98cea6e8e0 Simplify creation of new starters with a macro
   new  ce6511f715 Fix compiler warnings
   new  55c26882cd Fix crash on quit
   new  74b773d370 Fix crash on quit for real
   new  cf7d2787bc Implement line number parsing
   new  a9e5fbfd7a Implement line number parsing for disassembled files
   new  0a55783f33 Add skeleton for font-lock
   new  3b6bb5bd75 Add basic overlays to view matched lines
   new  8dcd74b511 Clean up rmsbolt.c by moving starters into helper files
   new  e6081fae6b Add unrefined support for ocaml
   new  6239f41d9d Add a goto-match feature for easily traversing matches
   new  bb64352f8d Store and use ranges to view highlighted regions
   new  aea0966e9d Don't add binary asm line data when viewing different 
files
   new  f0d13c4ac2 Add a stronger blacklist for ocaml asm
   new  4213316f23 Fix recentering when not needed
   new  e0d917206e Improve quality of default matching faces
   new  a638324882 Add OCaml demo
   new  1419a90465 Add C/C++ demo
   new  d7acfdd127 Fix rmsbolt temp directory generation being too late
   new  d37f8a0ebf Remove reliance on hl-line-mode
   new  a950515dfc Fix spelling mistake
   new  8fc36eacd8 Add option to force assembling
   new  a0527f16af Add very basic support for common lisp
   new  5efa347027 Update readme
   new  2e6163c95a Add testing framework
   new  082cbc7b1c Add new tests
   new  545a366472 Add more tests
   new  3ca3f35cdb Add very basic support for rust
   new  f30a05624d Add support for parsing .file directives
   new  c066da01c4 Fix ocaml def
   new  ff6f376d87 Update README.org
   new  65a1ac7b6e Add support for demangling
   new  86742e7b76 Merge branch 'master' of gitlab.com:jgkamat/rmsbolt
   new  0e0d82d774 Override default directory to prevent rouge executables
   new  fef52d3de3 Update readme
   new  f911321a02 Add support for automatically hot recompiling
   new  627dd4c1c9 Allow for custom asm processing functions
   new  01f7664eda Fix tests
   new  ca92d533ad Add basic support for python
   new  22810d69a7 Add docs for python
   new  f0be36f4b5 Update link
   new  68af010f02 Add support for haskell
   new  234e09b81a Fix spelling of OCaml
   new  503b51ecb8 Fix typo
   new  978d8290a1 Add guide on adding new languages
   new  7e4baa833e Fix a few comments
   new  1f50b7bb7f Add java framework
   new  8213e24af3 Update README
   new  a191eb9c73 Add basic Java support
   new  36b701d70e Fix broken tests
   new  1001531172 Add java demo
   new  285f9bd9be Add missing import
   new  e71061f509 Fix readme
   new  c442960f16 Add an easy way to turn off automatic recompilation
   new  d126f452d2 Update README
   new  77398fec4f Clarify starter/ folder message
   new  644973d865 Fix improper building of rmsbolt-starter path
   new  db87a0a6a4 Refactor rmsbolt-temp-dir to be more clear it's a 
private variable
   new  21b29cdb72 Satisfy package-lint
   new  439c7cb213 Satisfy checkdoc
   new  26fc524912 Fix usage of if-let*
   new  859722f7e0 Add back support for Emacs 25
   new  060f170a61 Clear overlays upon exiting rmsbolt mode
   new  8cfb5b1968 Upgrade information and docs for melpa
   new  cd424d2556 Fix broken disassemble spelling
   new  526ed37d71 Don't add overlays to non-rmsbolt-mode buffers
   new  6c53494f52 Add note for contribut

[elpa] externals/beardbolt 43f0eac016 004/323: Add support for changing compiler and flags

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 43f0eac016f2d09531fdf03962bbc1768a840cc5
Author: Jay Kamat 
Commit: Jay Kamat 

Add support for changing compiler and flags
---
 README.org |  2 ++
 rmsbolt.el | 57 -
 2 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 11bd429529..e041f7da80 100644
--- a/README.org
+++ b/README.org
@@ -9,3 +9,5 @@ A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer
 - Compilation runs entirely on your machine
 - Faster results
 - Infinitely hackable!
+- Write your code in your preferred editing environment
+- Runs entirely with 0 js
diff --git a/rmsbolt.el b/rmsbolt.el
index e1b8505334..2a9aef760d 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -41,11 +41,41 @@
   "Shell rmsbolt will use to split paths.")
 (defvar rmsbolt-output-buffer "*rmsbolt-output*")
 
-(defvar rmsbolt-output-filename "rmsbolt.s")
+(defun rmsbolt-output-filename ()
+  (expand-file-name "rmsbolt.s" rmsbolt-temp-dir))
 (defvar rmsbolt-hide-compile t)
 (defvar rmsbolt-intel-x86 t)
 (defvar rmsbolt-filter-asm-directives t)
 
+ Classes
+
+(cl-defstruct (rmsbolt-options
+   (:conc-name rmsbolt-o-))
+  (compile-cmd
+   ""
+   :type string
+   :documentation "The command used to compile this file")
+  )
+
+(cl-defstruct (rmsbolt-lang
+   (:conc-name rmsbolt-l-))
+  (options
+   nil
+   :type 'rmsbolt-options
+   :documentation "The default options object to use.")
+  (mode
+   'fundamental-mode
+   :type 'symbol
+   :documentation "The mode to activate this language in."))
+
+(defvar rmsbolt-languages
+  `((c-mode .
+,(make-rmsbolt-lang :mode 'c-mode
+:options (make-rmsbolt-options
+  :compile-cmd "gcc -g -O0")) )
+))
+
+
  Macros
 
 (defmacro rmsbolt-with-display-buffer-no-window (&rest body)
@@ -80,13 +110,13 @@
 
 (with-current-buffer (get-buffer-create rmsbolt-output-buffer)
   (cond ((not compilation-fail)
- (if (not (file-exists-p rmsbolt-output-filename))
+ (if (not (file-exists-p (rmsbolt-output-filename)))
  (message "Error reading from output file.")
(delete-region (point-min) (point-max))
(insert
 (rmsbolt--process-asm-lines
  (with-temp-buffer
-   (insert-file-contents rmsbolt-output-filename)
+   (insert-file-contents (rmsbolt-output-filename))
(split-string (buffer-string) "\n" t
(asm-mode)
(display-buffer (current-buffer
@@ -94,15 +124,32 @@
  ;; Display compilation output
  (display-buffer buffer))
 
+(defun rmsbolt--get-cmd ()
+  "Gets the rms command from the buffer, if available."
+  (save-excursion
+(goto-char (point-min))
+(re-search-forward (rx "RMS:" (1+ space) (group (1+ (any "-" alnum 
space nil t)
+(match-string-no-properties 1)))
+(defun rmsbolt--parse-options ()
+  "Parse RMS options from file."
+  (let* ((lang (cdr-safe (assoc major-mode rmsbolt-languages)))
+ (options (copy-rmsbolt-options (rmsbolt-l-options lang)))
+ (cmd (rmsbolt--get-cmd)))
+(when cmd
+  (setf (rmsbolt-ro-compile-cmd options) cmd))
+options))
+
 (defun rmsbolt-compile ()
   "Compile the current rmsbolt buffer."
   (interactive)
   (save-some-buffers nil (lambda () rmsbolt-mode))
-  (let* ((cmd "gcc -O0")
+  (let* ((options (rmsbolt--parse-options))
+ (cmd (rmsbolt-o-compile-cmd options))
  (cmd (mapconcat 'identity
  (list cmd
+   "-g"
"-S" (buffer-file-name)
-   "-o" rmsbolt-output-filename
+   "-o" (rmsbolt-output-filename)
(when rmsbolt-intel-x86
  "-masm=intel"))
  " ")))



[elpa] externals/beardbolt f04df12d28 011/323: Add config facility for object dumping

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit f04df12d2887ff12756f03b521a2f425d67a185d
Author: Jay Kamat 
Commit: Jay Kamat 

Add config facility for object dumping
---
 rmsbolt.el | 60 ++--
 1 file changed, 38 insertions(+), 22 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index e89b568006..c69ff8efe1 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -91,8 +91,12 @@
(:conc-name rmsbolt-o-))
   (compile-cmd
""
-   :type string
-   :documentation "The command used to compile this file"))
+   :type 'string
+   :documentation "The command used to compile this file")
+  (binary-compile
+   nil
+   :type 'bool
+   :documentation "Whether we should compile to binary and dissasemble that."))
 
 (cl-defstruct (rmsbolt-lang
(:conc-name rmsbolt-l-))
@@ -104,6 +108,14 @@
'fundamental-mode
:type 'symbol
:documentation "The mode to activate this language in.")
+  (supports-binary
+   nil
+   :type 'bool
+   :documentation "If we support binary dumping with this language.")
+  (objdumper
+   "objdump"
+   :type 'string
+   :documentation "The object dumper to use if dissasembling binary.")
   (starter-file
nil
:type 'string
@@ -113,16 +125,19 @@
:type 'string
:documentation "The starter filename to use"))
 
-(defvar rmsbolt-languages
-  `((c-mode
- . ,(make-rmsbolt-lang :mode 'c
-   :options (make-rmsbolt-options
- :compile-cmd "gcc -O0")
-   :starter-file-name "rmsbolt.c"
-   :starter-file
-   "#include 
+(defvar rmsbolt-languages)
+(setq
+ rmsbolt-languages
+ `((c-mode
+. ,(make-rmsbolt-lang :mode 'c
+  :options (make-rmsbolt-options
+:compile-cmd "gcc")
+  :supports-binary t
+  :starter-file-name "rmsbolt.c"
+  :starter-file
+  "#include 
 
-// RMS: gcc -O0
+// RMS: gcc -O3
 
 int isRMS(int a) {
 switch (a) {
@@ -143,16 +158,17 @@ int main() {
 printf(\"%c\\n\", a);
 }
 "
-   ))
-(c++-mode
- . ,(make-rmsbolt-lang :mode 'c++-mode
-   :options (make-rmsbolt-options
- :compile-cmd "g++ -O0")
-   :starter-file-name "rmsbolt.cpp"
-   :starter-file
-   "#include 
-
-// RMS: g++ -O0
+  ))
+   (c++-mode
+. ,(make-rmsbolt-lang :mode 'c++-mode
+  :options (make-rmsbolt-options
+:compile-cmd "g++")
+  :supports-binary t
+  :starter-file-name "rmsbolt.cpp"
+  :starter-file
+  "#include 
+
+// RMS: g++ -O3
 
 int isRMS(int a) {
 switch (a) {
@@ -173,7 +189,7 @@ int main() {
 std::cout << a << std::endl;
 }
 "
-   
+  
 
 
  Macros



[elpa] externals/beardbolt 83e29706f5 005/323: Work on porting used label finder

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 83e29706f5efa5a8e986a837203dfa66e6e35190
Author: Jay Kamat 
Commit: Jay Kamat 

Work on porting used label finder
---
 rmsbolt.el | 120 -
 1 file changed, 119 insertions(+), 1 deletion(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 2a9aef760d..3221f38044 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -26,6 +26,8 @@
 ;;; Constants:
 
 (require 'cl-lib)
+(require 'subr-x)
+(require 'map)
 
 (defconst +rmsbolt-compile-name+ "rmsbolt-compile")
 
@@ -46,6 +48,37 @@
 (defvar rmsbolt-hide-compile t)
 (defvar rmsbolt-intel-x86 t)
 (defvar rmsbolt-filter-asm-directives t)
+(defvar rmsbolt-filter-unused-labels t)
+
+ Regexes
+
+(defvar rmsbolt-label-def  (rx bol (group (any ".a-zA-Z_$@")
+  (0+ (any "a-zA-Z0-9$_@.")))
+   ":"))
+(defvar rmsbolt-defines-global (rx bol (0+ space) ".glob"
+   (opt "a") "l" (0+ space)
+   (group (any ".a-zA-Z_")
+  (0+ (any "a-zA-Z0-9$_.")
+(defvar rmsbolt-label-find (rx (any ".a-zA-Z_")
+   (0+
+(any "a-zA-Z0-9$_."
+(defvar rmsbolt-assignment-def (rx bol (0+ space)
+   (group
+(any ".a-zA-Z_$")
+(1+ (any "a-zA-Z0-9$_.")))
+   (0+ space) "="))
+(defvar rmsbolt-has-opcode (rx bol (0+ space)
+   (any "a-zA-Z")))
+
+(defvar rmsbolt-defines-function (rx bol (0+ space) ".type"
+ (0+ any) "," (0+ space) (any "@%")
+ "function" eol))
+
+(defvar rmsbolt-data-defn (rx bol (0+ space) "."
+  (group (or "string" "asciz" "ascii"
+ (and
+  (optional (any "1248")) "byte")
+ "short" "word" "long" "quad" "value" 
"zero"
 
  Classes
 
@@ -70,9 +103,13 @@
 
 (defvar rmsbolt-languages
   `((c-mode .
-,(make-rmsbolt-lang :mode 'c-mode
+,(make-rmsbolt-lang :mode 'c
 :options (make-rmsbolt-options
   :compile-cmd "gcc -g -O0")) )
+(c++-mode .
+  ,(make-rmsbolt-lang :mode 'c++-mode
+  :options (make-rmsbolt-options
+:compile-cmd "g++ -g -O0")) )
 ))
 
 
@@ -88,9 +125,90 @@
 
 
  Functions
+(defun rmsbolt-re-seq (regexp string)
+  "Get list of all REGEXP match in STRING."
+  (save-match-data
+(let ((pos 0)
+  matches)
+  (while (string-match regexp string pos)
+(push (match-string 0 string) matches)
+(setq pos (match-end 0)))
+  matches)))
+
+(defun rmsbolt--has-opcode-p (line)
+  "Check if LINE has opcodes."
+  (save-match-data
+(let* ((match (string-match rmsbolt-label-def line))
+   (line (if match
+ (substring line (match-end 0))
+   line))
+   (line (cl-first (split-string line (rx (1+ (any ";#")))
+  (if (string-match-p rmsbolt-assignment-def line)
+  nil
+(string-match-p rmsbolt-has-opcode line)
+
+(defun rmsbolt--find-used-labels (asm-lines)
+  "Find used labels in asm-lines."
+  (let ((match nil)
+(current-label nil)
+(labels-used nil)
+(trimmed-line nil)
+(weak-usages (make-hash-table :test #'equal)))
+(dolist (line asm-lines)
+  (setq trimmed-line (string-trim line))
+
+  (setq match (and
+   (string-match rmsbolt-label-def line)
+   (match-string 1 line)))
+  (when match
+(setq current-label match))
+  (when (string-match-p rmsbolt-defines-global line)
+(cl-pushnew match labels-used :test #'equal))
+  ;; When we have no line or a period started line, skip
+  (unless (or (= 0 (length line))
+  (string-prefix-p "." line)
+  (not (string-match-p rmsbolt-label-find line)))
+(if (or (not rmsbolt-filter-asm-directives)
+(rmsbolt--has-opcode-p line)
+(string-match-p rmsbolt-defines-function line))
+;; Add labels indescriminantly
+(dolist (l (rmsbolt-re-seq rmsbolt-label-find line))
+  (cl-pushnew l labels-used :test #'equal))
+
+  (when (and current-label
+ (or (string-match-p rmsbolt-data-defn line)
+ (rmsbolt--has-opcode-p line)))
+(dolist (l (rmsbolt-re-seq rmsbolt-label-find line))
+  (cl-pushnew l (gethash current-label weak-usages) :test 
#'equal))
+
+
+(let* ((max-label-iter 10

[elpa] externals/beardbolt 58c77d90c3 008/323: Add outshine comments

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 58c77d90c32501767c80d53c2818ff8de2448ad0
Author: Jay Kamat 
Commit: Jay Kamat 

Add outshine comments
---
 README.org |  1 +
 rmsbolt.el | 15 +++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index aa72b10163..8e26aae4a7 100644
--- a/README.org
+++ b/README.org
@@ -10,5 +10,6 @@ A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer
 - Better turnaround time from writing code to seeing disassembly
 - Infinitely hackable!
 - Write, compile, and view dissasembly entirely in Emacs
+  - Use compile.el to traverse errors like you would normally
 - Runs entirely without node, npm, or js.
   - No dependencies other than emacs 25 and your compiler ~:)~
diff --git a/rmsbolt.el b/rmsbolt.el
index 839888abcc..088c1345bb 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -138,6 +138,7 @@
 (setq pos (match-end 0)))
   matches)))
 
+; Filter Functions
 (defun rmsbolt--has-opcode-p (line)
   "Check if LINE has opcodes."
   (save-match-data
@@ -186,7 +187,6 @@
 (dolist (l (rmsbolt-re-seq rmsbolt-label-find line))
   (cl-pushnew l (gethash current-label weak-usages) :test 
#'equal))
 
-
 (let* ((max-label-iter 10)
(label-iter 0)
(completed nil))
@@ -246,6 +246,7 @@
(nreverse result)
"\n")))
 
+; Handlers
 (defun rmsbolt--handle-finish-compile (buffer _str)
   "Finish hook for compilations."
   (let ((compilation-fail
@@ -270,6 +271,7 @@
  ;; Display compilation output
  (display-buffer buffer))
 
+; Parsing Options
 (defun rmsbolt--get-cmd ()
   "Gets the rms command from the buffer, if available."
   (save-excursion
@@ -285,6 +287,7 @@
   (setf (rmsbolt-ro-compile-cmd options) cmd))
 options))
 
+; UI Functions
 (defun rmsbolt-compile ()
   "Compile the current rmsbolt buffer."
   (interactive)
@@ -303,15 +306,11 @@
 (rmsbolt-with-display-buffer-no-window
  (with-current-buffer (compilation-start cmd)
(add-hook 'compilation-finish-functions
- #'rmsbolt--handle-finish-compile nil t
-
-  ;; TODO
-  )
+ #'rmsbolt--handle-finish-compile nil t)
 
- Alda Keymap
-(defvar rmsbolt-mode-map nil "Keymap for `alda-mode'.")
+ Keymap
+(defvar rmsbolt-mode-map nil "Keymap for `rmsbolt-mode'.")
 (when (not rmsbolt-mode-map) ; if it is not already defined
-
   ;; assign command to keys
   (setq rmsbolt-mode-map (make-sparse-keymap))
   (define-key rmsbolt-mode-map (kbd "C-c C-c") #'rmsbolt-compile))



[elpa] externals/beardbolt a9e5fbfd7a 028/323: Implement line number parsing for disassembled files

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit a9e5fbfd7a77d8acc83ceae610a1fa1be0607923
Author: Jay Kamat 
Commit: Jay Kamat 

Implement line number parsing for disassembled files
---
 rmsbolt.el | 34 +-
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index effa8170d7..24a7d1f93c 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -310,6 +310,10 @@ int main() {
   matches)))
 
 ; Filter Functions
+
+;; Filtering functions were more or less lifted from the godbolt compiler 
exporter to maintain compatiblity.
+;; https://github.com/mattgodbolt/compiler-explorer/blob/master/lib/asm.js
+
 (defun rmsbolt--has-opcode-p (line)
   "Check if LINE has opcodes."
   (save-match-data
@@ -385,16 +389,22 @@ int main() {
 (not (string-match-p regexp func))
   t)))
 
+;; TODO godbolt does not handle dissasembly with filter=off, but we should.
 (cl-defun rmsbolt--process-dissasembled-lines (src-buffer asm-lines)
   "Process and filter dissasembled ASM-LINES from SRC-BUFFER."
   (let* ((result nil)
- (func nil))
+ (func nil)
+ (source-linum nil))
 (dolist (line asm-lines)
   (cl-tagbody
(when (> (length result) rmsbolt-binary-asm-limit)
  (cl-return-from rmsbolt--process-dissasembled-lines
'("Aborting processing due to exceeding the binary limit.")))
-   ;; TODO process line numbers
+   (when (string-match rmsbolt-dissas-line line)
+ (setq source-linum (string-to-number (match-string 2 line)))
+ ;; We are just setting a linum, no data here.
+ (go continue))
+
(when (string-match rmsbolt-dissas-label line)
  (setq func (match-string 2 line))
  (when (rmsbolt--user-func-p src-buffer func)
@@ -404,7 +414,12 @@ int main() {
 (rmsbolt--user-func-p src-buffer func))
  (go continue))
(when (string-match rmsbolt-dissas-opcode line)
- (push (concat "\t" (match-string 3 line)) result)
+ (let ((line (concat "\t" (match-string 3 line
+   ;; Add line text property if available
+   (when source-linum
+ (add-text-properties 0 (length line)
+  `(rmsbolt-src-line ,source-linum) line))
+   (push line result))
  (go continue))
continue))
 (nreverse result)))
@@ -431,6 +446,7 @@ int main() {
 (match-string 2 line
(when (string-match rmsbolt-source-stab line)
  (pcase (string-to-number (match-string 1 line))
+   ;; http://www.math.utah.edu/docs/info/stabs_11.html
(68
 (setq source-linum (match-string 2 line)))
((or 100 132)
@@ -495,12 +511,12 @@ int main() {
  (linum 0))
  ;; Add lines to hashtable
  (dolist (line lines)
-   (cl-pushnew
-linum
-(gethash
- (get-text-property
-  0 'rmsbolt-src-line line)
- ht))
+   (when-let ((property
+   (get-text-property
+0 'rmsbolt-src-line line)))
+ (cl-pushnew
+  linum
+  (gethash property ht)))
(incf linum))
  (with-current-buffer src-buffer
(setq-local rmsbolt-line-mapping ht))



[elpa] externals/beardbolt 3b6bb5bd75 030/323: Add basic overlays to view matched lines

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 3b6bb5bd755b1ebf1fc5f29e7902068143da363a
Author: Jay Kamat 
Commit: Jay Kamat 

Add basic overlays to view matched lines
---
 rmsbolt.el | 83 --
 1 file changed, 75 insertions(+), 8 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 60f2acc723..becc9df5ac 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -35,6 +35,12 @@
   "rmsbolt customization options"
   :group 'applications)
 
+(defcustom rmsbolt-use-overlays t
+  "Whether we should use overlays to show matching code."
+  :type 'boolean
+  :safe 'booleanp
+  :group 'rmsbolt)
+
 ; Buffer Local Tweakables
 (defcustom rmsbolt-dissasemble nil
   "Whether we should dissasemble an output binary."
@@ -94,7 +100,18 @@
 
 (defvar-local rmsbolt-line-mapping nil
   "Line mapping hashtable from source lines -> asm lines")
+(defvar-local rmsbolt-current-line nil
+  "Current line for fontifier.")
+
+(defvar rmsbolt-overlays nil
+  "List of overlays to use.")
+(defvar rmsbolt-overlay-delay 0.125
+  "Time in seconds to delay before showing overlays.")
 
+(defvar rmsbolt--idle-timer nil
+  "Idle timer for rmsbolt overlays.")
+
+(defvar-local rmsbolt-src-buffer nil)
 
  Regexes
 
@@ -503,6 +520,7 @@ int main() {
 (src-buffer (buffer-local-value 'rmsbolt-src-buffer buffer)))
 
 (with-current-buffer (get-buffer-create rmsbolt-output-buffer)
+  ;; Store src buffer value for later linking
   (cond ((not compilation-fail)
  (if (not (file-exists-p (rmsbolt-output-filename src-buffer t)))
  (message "Error reading from output file.")
@@ -520,9 +538,11 @@ int main() {
(get-text-property
 0 'rmsbolt-src-line line)))
  (cl-pushnew
-  linum
+  ;; These numbers are 0 indexed, but we want 1 indexed
+  (1+ linum)
   (gethash property ht)))
(incf linum))
+
  (with-current-buffer src-buffer
(setq-local rmsbolt-line-mapping ht))
  (delete-region (point-min) (point-max))
@@ -530,6 +550,7 @@ int main() {
   (mapconcat 'identity lines "\n"))
  (asm-mode)
  (rmsbolt-mode 1)
+ (setq-local rmsbolt-src-buffer src-buffer)
  (display-buffer (current-buffer)
 (t
  ;; Display compilation output
@@ -551,15 +572,14 @@ int main() {
 src-buffer))
 
 ; UI Functions
-(defvar-local rmsbolt-src-buffer nil)
 (defun rmsbolt-compile ()
   "Compile the current rmsbolt buffer."
   (interactive)
   (save-some-buffers nil (lambda () rmsbolt-mode))
-  (rmsbolt--parse-options)
   (if (eq major-mode 'asm-mode)
   ;; We cannot compile asm-mode files
   (message "Cannot compile this file. Are you sure you are not in the 
output buffer?")
+(rmsbolt--parse-options)
 (let* ((src-buffer (current-buffer))
(lang (rmsbolt--get-lang))
(func (rmsbolt-l-compile-cmd-function lang))
@@ -582,6 +602,7 @@ int main() {
 " ")))
   (_
(error "Objdumper not recognized"
+  (setq-local rmsbolt-src-buffer src-buffer)
   (rmsbolt-with-display-buffer-no-window
(with-current-buffer (compilation-start cmd)
  (add-hook 'compilation-finish-functions
@@ -621,9 +642,50 @@ int main() {
 (rmsbolt-defstarter "c++" 'c++-mode)
 
  Font lock matcher
-(defun rmsbolt-search-for-keyword (limit)
-  ;; TODO implement me
-  )
+(defun rmsbolt--goto-line (line)
+  "Goto a certain LINE."
+  (let ((cur (line-number-at-pos)))
+(forward-line (- line cur
+(defun rmsbolt--setup-overlay (start end buf)
+  "Setup overlay with START and END in BUF."
+  (let ((o (make-overlay start end buf)))
+(overlay-put o 'face 'rmsbolt-current-line-face)
+o))
+
+(defun rmsbolt-move-overlays ()
+  "Function for moving overlays for rmsbolt."
+
+  (if-let* ((src-buffer
+ (and rmsbolt-mode rmsbolt-use-overlays))
+(src-buffer
+ (buffer-local-value 'rmsbolt-src-buffer (current-buffer)))
+(output-buffer (get-buffer-create rmsbolt-output-buffer))
+(current-line (line-number-at-pos))
+(src-current-line
+ (if (eq (current-buffer) src-buffer)
+ current-line
+   (get-text-property (point) 'rmsbolt-src-line)))
+(asm-lines (gethash src-current-line
+(buffer-local-value 'rmsbolt-line-mapping 
src-buffer)))
+;; TODO also consider asm
+(src-pts
+ (with-current-buffer src-buffer
+   (save-excursion
+ (rmsbolt--goto-line src-current-line)
+ (values (c-point 'bol) (c-point 'eol))
+  (progn
+(mapc #'delete-overlay rmsbolt-ov

[elpa] externals/beardbolt 8dcd74b511 031/323: Clean up rmsbolt.c by moving starters into helper files

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 8dcd74b511098cda52ac5c113e9fd9c92171e3e1
Author: Jay Kamat 
Commit: Jay Kamat 

Clean up rmsbolt.c by moving starters into helper files
---
 README.org   |  5 ++-
 rmsbolt.el   | 90 
 starters/rmsbolt.c   | 25 +++
 starters/rmsbolt.cpp | 25 +++
 4 files changed, 74 insertions(+), 71 deletions(-)

diff --git a/README.org b/README.org
index 3148ae0572..2347b7994d 100644
--- a/README.org
+++ b/README.org
@@ -26,5 +26,8 @@ add it..
 ** Quelpa
 
 #+BEGIN_SRC emacs-lisp
-  (quelpa '(rmsbolt :fetcher gitlab :repo "jgkamat/rmsbolt"))
+  (quelpa '(rmsbolt
+:files (:defaults "starters")
+:fetcher gitlab
+:repo "jgkamat/rmsbolt"))
 #+END_SRC
diff --git a/rmsbolt.el b/rmsbolt.el
index becc9df5ac..de142cae19 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -111,6 +111,10 @@
 (defvar rmsbolt--idle-timer nil
   "Idle timer for rmsbolt overlays.")
 
+(defvar rmsbolt-dir (when load-file-name
+  (file-name-directory load-file-name))
+  "The directory which rmsbolt is installed to.")
+
 (defvar-local rmsbolt-src-buffer nil)
 
  Regexes
@@ -187,10 +191,6 @@
'objdump
:type symbol
:documentation "The object dumper to use if dissasembling binary.")
-  (starter-file
-   nil
-   :type 'string
-   :documentation "Some starter code to jump off of, if not supplying your 
own.")
   (starter-file-name
nil
:type 'string
@@ -241,70 +241,14 @@
   :supports-asm t
   :starter-file-name "rmsbolt.c"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
-  :dissas-hidden-funcs rmsbolt--hidden-func-c
-  :starter-file
-  "#include 
-
-// Local Variables:
-// rmsbolt-command: \"gcc -O3\"
-// rmsbolt-dissasemble: nil
-// End:
-
-int isRMS(int a) {
-switch (a) {
-case 'R':
- return 1;
-case 'M':
- return 2;
-case 'S':
- return 3;
-default:
- return 0;
-}
-}
-
-int main() {
-   char a = 1 + 1;
-   if (isRMS(a))
-printf(\"%c\\n\", a);
-}
-"
-  ))
+  :dissas-hidden-funcs rmsbolt--hidden-func-c))
(c++-mode
 . ,(make-rmsbolt-lang :mode 'c++-mode
   :compile-cmd "g++"
   :supports-asm t
   :starter-file-name "rmsbolt.cpp"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
-  :dissas-hidden-funcs rmsbolt--hidden-func-c
-  :starter-file
-  "#include 
-
-// Local Variables:
-// rmsbolt-command: \"g++ -O3\"
-// rmsbolt-dissasemble: nil
-// End:
-
-int isRMS(int a) {
-switch (a) {
-case 'R':
- return 1;
-case 'M':
- return 2;
-case 'S':
- return 3;
-default:
- return 0;
-}
-}
-
-int main() {
-   char a = 1 + 1;
-   if (isRMS(a))
-std::cout << a << std::endl;
-}
-"
-  
+  :dissas-hidden-funcs rmsbolt--hidden-func-c
 
 
  Macros
@@ -624,14 +568,20 @@ int main() {
   (let* ((lang-def (rmsbolt--get-lang lang-mode))
  (file-name
   (expand-file-name (rmsbolt-l-starter-file-name lang-def) 
rmsbolt-temp-dir))
- (exists (file-exists-p file-name)))
-(find-file file-name)
-(unless exists
-  (insert
-   (rmsbolt-l-starter-file lang-def))
-  (save-buffer))
-(unless rmsbolt-mode
-  (rmsbolt-mode 1
+ (exists (file-exists-p file-name))
+ (src-file-name
+  (when rmsbolt-dir
+(expand-file-name (rmsbolt-l-starter-file-name lang-def) (concat 
rmsbolt-dir "starters/"
+ (src-file-exists (file-exists-p src-file-name)))
+(if (not src-file-exists)
+(error "Could not find starter files! Are you sure the starter/ folder 
is available?")
+  (find-file file-name)
+  (unless exists
+(insert-file-contents
+ src-file-name)
+(save-buffer))
+  (unless rmsbolt-mode
+(rmsbolt-mode 1)
 (defmacro rmsbolt-defstarter (lang mode)
   "Defines a starter for LANG and MODE."
   `(defun ,(intern (concat "rmsbolt-" lang)) ()
diff --git a/starters/rmsbolt.c b/starters/rmsbolt.c
new file mode 100644
index 00..ea7b750eff
--- /dev/null
+++ b/starters/rmsbolt.c
@@ -0,0 +1,25 @@
+#include 
+
+// Local Variables:
+// rmsbolt-command: "gcc -O3"
+// rmsbolt-dissasemble: nil
+// End:
+
+int isRMS(int a) {
+switch (a) {
+case 'R':
+ return 1;
+case 'M':
+ retur

[elpa] externals/beardbolt bb64352f8d 034/323: Store and use ranges to view highlighted regions

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit bb64352f8d0ebd08e2ff25d6b69395bbe7436300
Author: Jay Kamat 
Commit: Jay Kamat 

Store and use ranges to view highlighted regions
---
 rmsbolt.el | 161 +
 1 file changed, 99 insertions(+), 62 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index ca7ba5173a..827b7403cc 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -28,6 +28,7 @@
 (require 'cl-lib)
 (require 'subr-x)
 (require 'map)
+(require 'cc-defs)
 
 ;;; Code:
  Customize:
@@ -43,6 +44,10 @@
   "Whether we should goto the match in the other buffer if it is non visible."
   :type 'boolean
   :group 'rmsbolt)
+(defcustom rmsbolt-mode-lighter " RMS🗲"
+  "Lighter displayed in mode line when `rmsbolt-mode' is active."
+  :type 'string
+  :group 'rmsbolt)
 
 ; Buffer Local Tweakables
 (defcustom rmsbolt-dissasemble nil
@@ -530,17 +535,32 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
  (insert-file-contents (rmsbolt-output-filename 
src-buffer t))
  (split-string (buffer-string) "\n" t
  (ht (make-hash-table))
- (linum 0))
+ (linum 1)
+ (start-match nil)
+ (in-match nil))
  ;; Add lines to hashtable
  (dolist (line lines)
-   (when-let ((property
-   (get-text-property
-0 'rmsbolt-src-line line)))
- (cl-pushnew
-  ;; These numbers are 0 indexed, but we want 1 indexed
-  (1+ linum)
-  (gethash property ht)))
-   (incf linum))
+   (let ((property
+  (get-text-property
+   0 'rmsbolt-src-line line)))
+ (progn
+   (cl-tagbody
+run-conditional
+(cond
+ ((and in-match (eq in-match property))
+  ;; We are continuing an existing match
+  nil)
+ (in-match
+  ;; We are in a match that has just expired
+  (push (cons start-match (1- linum))
+(gethash in-match ht))
+  (setq in-match nil
+start-match nil)
+  (go run-conditional))
+ (property
+  (setq in-match property
+start-match linum))
+   (cl-incf linum))
 
  (with-current-buffer src-buffer
(setq-local rmsbolt-line-mapping ht))
@@ -668,65 +688,82 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 (defun rmsbolt-move-overlays ()
   "Function for moving overlays for rmsbolt."
 
-  (if-let* ((should-run
- (and rmsbolt-mode rmsbolt-use-overlays))
-(src-buffer
- (buffer-local-value 'rmsbolt-src-buffer (current-buffer)))
-(output-buffer (get-buffer-create rmsbolt-output-buffer))
-(current-line (line-number-at-pos))
-(src-current-line
- (if (eq (current-buffer) src-buffer)
- current-line
-   (get-text-property (point) 'rmsbolt-src-line)))
-(hash-table (buffer-local-value 'rmsbolt-line-mapping src-buffer))
-(asm-lines (gethash src-current-line hash-table))
-;; TODO also consider asm
-(src-pts
- (with-current-buffer src-buffer
-   (save-excursion
- (rmsbolt--goto-line src-current-line)
- (values (c-point 'bol) (c-point 'eol))
-  (let ((line-visible (not rmsbolt-goto-match))
-(src-buffer-selected (eq (current-buffer) src-buffer)))
-(mapc #'delete-overlay rmsbolt-overlays)
-(setq rmsbolt-overlays nil)
-(push (rmsbolt--setup-overlay (first src-pts) (second src-pts) 
src-buffer)
-  rmsbolt-overlays)
-(unless src-buffer-selected
-  (with-current-buffer src-buffer
-(setq line-visible (rmsbolt--point-visible (first src-pts)
-(with-current-buffer output-buffer
-  (save-excursion
-(dolist (l asm-lines)
-  (rmsbolt--goto-line l)
-  ;; check if line is visible and set line-visible
-  (unless (or line-visible (not src-buffer-selected))
-(setq line-visible (rmsbolt--point-visible (c-point 'bol
-
-  (push (rmsbolt--setup-overlay (c-point 'bol) (c-point 'eol) 
output-buffer)
-rmsbolt-overlays)))
-  (unless line-visible
-;; Scroll buffer to first line
-(when-let
-((scro

[elpa] externals/beardbolt 4a35528d7d 021/323: Configure all variables with buffer-local values

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 4a35528d7dce2c8a14910162a8b59d5e9080c076
Author: Jay Kamat 
Commit: Jay Kamat 

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 90b5cad9c1 016/323: Finish initial implementation of dissasembly

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 90b5cad9c1aec17261120e780e945b9941ea2860
Author: Jay Kamat 
Commit: Jay Kamat 

Finish initial implementation of dissasembly
---
 rmsbolt.el | 87 --
 1 file changed, 62 insertions(+), 25 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index ad795ec146..b7583c694c 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -37,8 +37,6 @@
   "Shell rmsbolt will use to split paths.")
 (defvar rmsbolt-output-buffer "*rmsbolt-output*")
 
-(defun rmsbolt-output-filename ()
-  (expand-file-name "rmsbolt.s" rmsbolt-temp-dir))
 (defvar rmsbolt-hide-compile t)
 (defvar rmsbolt-intel-x86 t)
 (defvar rmsbolt-filter-asm-directives t)
@@ -46,6 +44,11 @@
 (defvar rmsbolt-filter-comment-only t)
 (defvar rmsbolt-dissasemble nil)
 (defvar rmsbolt-binary-asm-limit 5000)
+(defun rmsbolt-output-filename (&optional asm)
+  (if (and rmsbolt-dissasemble
+   (not asm))
+  (expand-file-name "rmsbolt.out" rmsbolt-temp-dir)
+(expand-file-name "rmsbolt.s" rmsbolt-temp-dir)))
 
  Regexes
 
@@ -106,6 +109,11 @@
""
:type 'string
:documentation "The command used to compile this file")
+  (lang
+   nil
+   :type 'symbol
+   :documentation "The major mode language we are compiling in."
+   )
   (binary-compile
nil
:type 'bool
@@ -126,8 +134,8 @@
:type 'bool
:documentation "If we support binary dumping with this language.")
   (objdumper
-   "objdump"
-   :type 'string
+   'objdump
+   :type symbol
:documentation "The object dumper to use if dissasembling binary.")
   (starter-file
nil
@@ -153,7 +161,10 @@
  (cmd (mapconcat 'identity
  (list cmd
"-g"
-   "-S" (buffer-file-name)
+   (if rmsbolt-dissasemble
+   ""
+ "-S")
+   (buffer-file-name)
"-o" (rmsbolt-output-filename)
(when rmsbolt-intel-x86
  "-masm=intel"))
@@ -172,7 +183,8 @@
  `((c-mode
 . ,(make-rmsbolt-lang :mode 'c
   :options (make-rmsbolt-options
-:compile-cmd "gcc")
+:compile-cmd "gcc"
+:lang 'c-mode)
   :supports-binary t
   :starter-file-name "rmsbolt.c"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
@@ -205,7 +217,8 @@ int main() {
(c++-mode
 . ,(make-rmsbolt-lang :mode 'c++-mode
   :options (make-rmsbolt-options
-:compile-cmd "g++")
+:compile-cmd "g++"
+:lang 'c++-mode)
   :supports-binary t
   :starter-file-name "rmsbolt.cpp"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
@@ -331,16 +344,16 @@ int main() {
 (setq completed t
   labels-used)))
 
-(defun rmsbolt--user-func-p (func)
+(defun rmsbolt--user-func-p (opts func)
   "Return t if FUNC is a user function."
-  (let* ((lang (rmsbolt--get-lang))
+  (let* ((lang (rmsbolt--get-lang (rmsbolt-o-lang opts)))
  (regexp (rmsbolt-l-dissas-hidden-funcs lang)))
 (if regexp
 (not (string-match-p regexp func))
   t)))
 
-(cl-defun rmsbolt--process-dissasembled-lines (asm-lines)
-  "Process and filter dissasembled lines."
+(cl-defun rmsbolt--process-dissasembled-lines (opts asm-lines)
+  "Process and filter dissasembled ASM-LINES from OPTS."
   (let* ((result nil)
  (func nil)
  (match nil))
@@ -351,24 +364,25 @@ int main() {
'("Aborting processing due to exceeding the binary limit.")))
;; TODO process line numbers
(when (string-match rmsbolt-dissas-label line)
- (setq func (match-string 2 line)))
+ (setq func (match-string 2 line))
+ (when (rmsbolt--user-func-p opts func)
+   (push (concat func ":") result))
+ (go continue))
(unless (and func
-(rmsbolt--user-func-p func))
+(rmsbolt--user-func-p opts func))
  (go continue))
-
(when (string-match rmsbolt-dissas-opcode line)
- (push (match-string 3 line) result))
-
-
+ (push (concat "\t" (match-string 3 line)) result)
+ (go continue))
continue))
 (mapconcat 'identity
(nreverse result)
"\n")))
 
-(cl-defun rmsbolt--process-asm-lines (asm-lines)
+(cl-defun rmsbolt--process-asm-lines (opts asm-lines)
   "Process and filter a set of asm lines."
   (if rmsbolt-dissasemble
-  (rmsbolt--process-dissasembled-lines asm-lines)
+  (rmsbolt--process-dissasembled-lines opts a

[elpa] externals/beardbolt 74b773d370 026/323: Fix crash on quit for real

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 74b773d370612e3afa4960d973321e199775420f
Author: Jay Kamat 
Commit: Jay Kamat 

Fix crash on quit for real
---
 rmsbolt.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 8312599e6f..aca6b84313 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -75,8 +75,8 @@
 (defvar rmsbolt-shell "bash"
   "Shell rmsbolt will use to split paths.")
 (defvar rmsbolt-output-buffer "*rmsbolt-output*")
-(defvar rmsbolt-mode
-  "whether rmsbolt-mode is enabled")
+;; whether rmsbolt-mode is enabled.
+(defvar rmsbolt-mode)
 
 (defvar rmsbolt-hide-compile t)
 (defvar rmsbolt-binary-asm-limit 5000)
@@ -568,7 +568,8 @@ int main() {
   (make-temp-file "rmsbolt-" t))
 (add-hook 'kill-emacs-hook
   (lambda ()
-(when (and rmsbolt-temp-dir
+(when (and (boundp 'rmsbolt-temp-dir)
+   rmsbolt-temp-dir
(file-directory-p rmsbolt-temp-dir) )
   (delete-directory rmsbolt-temp-dir t))
 (setq rmsbolt-temp-dir nil)



[elpa] externals/beardbolt 38649b53f2 018/323: Relicense to affero GPL

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 38649b53f2f7cf7a2f4facc2a0f5067933005035
Author: Jay Kamat 
Commit: Jay Kamat 

Relicense to affero GPL
---
 LICENSE| 157 -
 rmsbolt.el |   8 ++--
 2 files changed, 76 insertions(+), 89 deletions(-)

diff --git a/LICENSE b/LICENSE
index 9cecc1d466..be3f7b28e5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,23 +1,21 @@
-GNU GENERAL PUBLIC LICENSE
-   Version 3, 29 June 2007
+GNU AFFERO GENERAL PUBLIC LICENSE
+   Version 3, 19 November 2007
 
- Copyright (C) 2007 Free Software Foundation, Inc. 
+ Copyright (C) 2007 Free Software Foundation, Inc. 
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
 Preamble
 
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
+  The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
 
   The licenses for most software and other practical works are designed
 to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
+our General Public Licenses are intended to guarantee your freedom to
 share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
+software for all its users.
 
   When we speak of free software, we are referring to freedom, not
 price.  Our General Public Licenses are designed to make sure that you
@@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get 
it if you
 want it, that you can change the software or use pieces of it in new
 free programs, and that you know you can do these things.
 
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperati

[elpa] externals/beardbolt b6127c7f67 007/323: Fix error when not filtering for labels

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit b6127c7f677ac7392247d6f71d60db7d789b6b7c
Author: Jay Kamat 
Commit: Jay Kamat 

Fix error when not filtering for labels
---
 rmsbolt.el | 88 ++
 1 file changed, 37 insertions(+), 51 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index dbeaacd673..839888abcc 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -210,51 +210,41 @@
 
 (defun rmsbolt--process-asm-lines (asm-lines)
   "Process and filter a set of asm lines."
-  (when rmsbolt-filter-unused-labels
-(let ((used-labels (rmsbolt--find-used-labels asm-lines))
-  (result nil)
-  (prev-label nil))
-  (dolist (line asm-lines)
-(let* ((raw-match (or (string-match rmsbolt-label-def line)
-  (string-match rmsbolt-assignment-def line)))
-   (match (when raw-match
-(match-string 1 line)))
-   (used-label (cl-find match used-labels :test #'equal)))
-  (cl-tagbody
-   ;; End block, reset prev-label and source
-   (when (string-match-p rmsbolt-endblock line)
- (setq prev-label nil))
-
-   ;; continue means we don't add to the ouptut
-   (when match
- (if (not used-label)
- ;; Unused label
- (when rmsbolt-filter-unused-labels
-   (go continue))
-   ;; Real label, set prev-label
-   (setq prev-label raw-match)))
-   (when (and rmsbolt-filter-asm-directives
-  (not match))
- (if  (and (string-match-p rmsbolt-data-defn line)
-   prev-label)
- ;; data is being used
- nil
-   (when (string-match-p rmsbolt-directive line)
- (go continue
-   (push line result)
-   continue)))
-
-  (mapconcat 'identity
- (nreverse result)
- "\n")
-  ))
-
-  ;; (when rmsbolt-filter-asm-directives
-  ;;   (setq asm-lines
-  ;; (cl-remove-if
-  ;;  (apply-partially #'string-match-p +rmsbolt-assembler-pattern+)
-  ;;  asm-lines)))
-  )
+  (let ((used-labels (rmsbolt--find-used-labels asm-lines))
+(result nil)
+(prev-label nil))
+(dolist (line asm-lines)
+  (let* ((raw-match (or (string-match rmsbolt-label-def line)
+(string-match rmsbolt-assignment-def line)))
+ (match (when raw-match
+  (match-string 1 line)))
+ (used-label (cl-find match used-labels :test #'equal)))
+(cl-tagbody
+ ;; End block, reset prev-label and source
+ (when (string-match-p rmsbolt-endblock line)
+   (setq prev-label nil))
+
+ ;; continue means we don't add to the ouptut
+ (when match
+   (if (not used-label)
+   ;; Unused label
+   (when rmsbolt-filter-unused-labels
+ (go continue))
+ ;; Real label, set prev-label
+ (setq prev-label raw-match)))
+ (when (and rmsbolt-filter-asm-directives
+(not match))
+   (if  (and (string-match-p rmsbolt-data-defn line)
+ prev-label)
+   ;; data is being used
+   nil
+ (when (string-match-p rmsbolt-directive line)
+   (go continue
+ (push line result)
+ continue)))
+(mapconcat 'identity
+   (nreverse result)
+   "\n")))
 
 (defun rmsbolt--handle-finish-compile (buffer _str)
   "Finish hook for compilations."
@@ -361,9 +351,7 @@ int main() {
   (save-buffer))
 
 (unless rmsbolt-mode
-  (rmsbolt-mode 1))
-)
-  )
+  (rmsbolt-mode 1
 
  Mode Definition:
 
@@ -378,9 +366,7 @@ int main() {
 (add-hook 'kill-emacs-hook
   (lambda ()
 (delete-directory rmsbolt-temp-dir t)
-(setq rmsbolt-temp-dir nil
-
-  )
+(setq rmsbolt-temp-dir nil)
 
 (provide 'rmsbolt)
 



[elpa] externals/beardbolt 1419a90465 040/323: Add C/C++ demo

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 1419a90465640546de228ccc28bf01ab6efdf668
Author: Jay Kamat 
Commit: Jay Kamat 

Add C/C++ demo
---
 README.org | 9 +
 1 file changed, 9 insertions(+)

diff --git a/README.org b/README.org
index da0d81727b..95db642c8e 100644
--- a/README.org
+++ b/README.org
@@ -3,6 +3,11 @@
 
 A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-exporter]] 
for Emacs.
 
+RMSBolt tries to make it easy to see what your compiler is doing. It does this
+by showing you the assembly output of a given source code file. It also
+highlights which source code a given assembly block corresponds to, and vice
+versa.
+
 * Why RMSbolt over godbolt?
 
 - No more sending your code to any server
@@ -34,6 +39,10 @@ add it..
 
 * Demo
 
+** C/C++
+
+[[https://u.cubeupload.com/jgkamat/sihr1g.gif][https://u.cubeupload.com/jgkamat/sihr1g.gif]]
+
 ** Ocaml
 
 
[[https://u.cubeupload.com/jgkamat/PabAq2.gif][https://u.cubeupload.com/jgkamat/PabAq2.gif]]



[elpa] externals/beardbolt 5ab75b7f56 014/323: Add stubs for dissasembly

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 5ab75b7f56c7f2c9e675e744d622cc9bb6500da2
Author: Jay Kamat 
Commit: Jay Kamat 

Add stubs for dissasembly
---
 rmsbolt.el | 97 +++---
 1 file changed, 48 insertions(+), 49 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index eaf1772cd8..5247984008 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -29,12 +29,6 @@
 (require 'subr-x)
 (require 'map)
 
-(defconst +rmsbolt-compile-name+ "rmsbolt-compile")
-
-(defconst +rmsbolt-assembler-pattern+ (rx bol (1+ space)
-  "." (1+ (not (any ";")))
-  (0+ space) eol))
-
 ;;; Code:
  Variables:
 (defvar rmsbolt-temp-dir nil
@@ -50,6 +44,7 @@
 (defvar rmsbolt-filter-asm-directives t)
 (defvar rmsbolt-filter-unused-labels t)
 (defvar rmsbolt-filter-comment-only t)
+(defvar rmsbolt-dissasemble nil)
 
  Regexes
 
@@ -64,9 +59,8 @@
(0+
 (any "a-zA-Z0-9$_."
 (defvar rmsbolt-assignment-def (rx bol (0+ space)
-   (group
-(any ".a-zA-Z_$")
-(1+ (any "a-zA-Z0-9$_.")))
+   (group (any ".a-zA-Z_$")
+  (1+ (any "a-zA-Z0-9$_.")))
(0+ space) "="))
 (defvar rmsbolt-has-opcode (rx bol (0+ space)
(any "a-zA-Z")))
@@ -305,47 +299,52 @@ int main() {
 (setq completed t
   labels-used)))
 
-(defun rmsbolt--process-asm-lines (asm-lines)
+(defun rmsbolt--process-dissasembled-lines (asm-lines)
+  )
+
+(cl-defun rmsbolt--process-asm-lines (asm-lines)
   "Process and filter a set of asm lines."
-  (let ((used-labels (rmsbolt--find-used-labels asm-lines))
-(result nil)
-(prev-label nil))
-(dolist (line asm-lines)
-  (let* ((raw-match (or (string-match rmsbolt-label-def line)
-(string-match rmsbolt-assignment-def line)))
- (match (when raw-match
-  (match-string 1 line)))
- (used-label (cl-find match used-labels :test #'equal)))
-(cl-tagbody
- ;; End block, reset prev-label and source
- (when (string-match-p rmsbolt-endblock line)
-   (setq prev-label nil))
-
- (when (and rmsbolt-filter-comment-only
-(string-match-p rmsbolt-comment-only line))
-   (go continue))
-
- ;; continue means we don't add to the ouptut
- (when match
-   (if (not used-label)
-   ;; Unused label
-   (when rmsbolt-filter-unused-labels
- (go continue))
- ;; Real label, set prev-label
- (setq prev-label raw-match)))
- (when (and rmsbolt-filter-asm-directives
-(not match))
-   (if  (and (string-match-p rmsbolt-data-defn line)
- prev-label)
-   ;; data is being used
-   nil
- (when (string-match-p rmsbolt-directive line)
-   (go continue
- (push line result)
- continue)))
-(mapconcat 'identity
-   (nreverse result)
-   "\n")))
+  (if rmsbolt-dissasemble
+  (rmsbolt--process-dissasembled-lines asm-lines)
+(let ((used-labels (rmsbolt--find-used-labels asm-lines))
+  (result nil)
+  (prev-label nil))
+  (dolist (line asm-lines)
+(let* ((raw-match (or (string-match rmsbolt-label-def line)
+  (string-match rmsbolt-assignment-def line)))
+   (match (when raw-match
+(match-string 1 line)))
+   (used-label (cl-find match used-labels :test #'equal)))
+  (cl-tagbody
+   ;; End block, reset prev-label and source
+   (when (string-match-p rmsbolt-endblock line)
+ (setq prev-label nil))
+
+   (when (and rmsbolt-filter-comment-only
+  (string-match-p rmsbolt-comment-only line))
+ (go continue))
+
+   ;; continue means we don't add to the ouptut
+   (when match
+ (if (not used-label)
+ ;; Unused label
+ (when rmsbolt-filter-unused-labels
+   (go continue))
+   ;; Real label, set prev-label
+   (setq prev-label raw-match)))
+   (when (and rmsbolt-filter-asm-directives
+  (not match))
+ (if  (and (string-match-p rmsbolt-data-defn line)
+   prev-label)
+ ;; data is being used
+ nil
+   (when (string-match-p rmsbolt-directive line)
+ (go continue
+   (push line result)
+   continue)))
+  (mapconcat 'identity
+

[elpa] externals/beardbolt 98cea6e8e0 023/323: Simplify creation of new starters with a macro

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 98cea6e8e0c84249e2d045f5384562153812c0a8
Author: Jay Kamat 
Commit: Jay Kamat 

Simplify creation of new starters with a macro
---
 rmsbolt.el | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 67ebb96fae..d897288f75 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -546,16 +546,16 @@ int main() {
   (insert
(rmsbolt-l-starter-file lang-def))
   (save-buffer))
-
 (unless rmsbolt-mode
-  (rmsbolt-mode 1)))
-  )
-(defun rmsbolt-c ()
-  (interactive)
-  (rmsbolt-starter 'c-mode))
-(defun rmsbolt-c++ ()
-  (interactive)
-  (rmsbolt-starter 'c++-mode))
+  (rmsbolt-mode 1
+(defmacro rmsbolt-defstarter (lang mode)
+  "Defines a starter for LANG and MODE."
+  `(defun ,(intern (concat "rmsbolt-" lang)) ()
+ ,(concat "Open a rmsbolt starter file for " lang ".")
+ (interactive)
+ (rmsbolt-starter ,mode)))
+(rmsbolt-defstarter "c" 'c-mode)
+(rmsbolt-defstarter "c++" 'c++-mode)
 
  Mode Definition:
 



[elpa] externals/beardbolt aea0966e9d 035/323: Don't add binary asm line data when viewing different files

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit aea0966e9d474828af3a4b35756d9f5629b9ab33
Author: Jay Kamat 
Commit: Jay Kamat 

Don't add binary asm line data when viewing different files
---
 rmsbolt.el | 25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 827b7403cc..286f445270 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -278,10 +278,14 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
eol))
 (defvar rmsbolt--hidden-func-ocaml)
 (setq rmsbolt--hidden-func-ocaml (rx bol
- (or
-  (and "camlCamlinternalFormat__" (0+ any))
-  ;; (0+ any)
-  )
+ (or (and "__" (0+ any))
+ (and "_" (or "init" "start" "fini"))
+ (and (opt "de") "register_tm_clones")
+ "call_gmon_start"
+ "frame_dummy"
+ (and ".plt" (0+ any))
+ (and "camlCamlinternalFormat__" (0+ 
any))
+ (and (1+ (not (any "@"))) "@plt"))
  eol))
  Language Definitions
 (defvar rmsbolt-languages)
@@ -313,6 +317,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
  Macros
 
 (defmacro rmsbolt-with-display-buffer-no-window (&rest body)
+  "Run BODY without displaying any window."
   ;; See http://debbugs.gnu.org/13594
   `(let ((display-buffer-overriding-action
   (if rmsbolt-hide-compile
@@ -352,7 +357,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 (string-match-p rmsbolt-has-opcode line)
 
 (defun rmsbolt--find-used-labels (src-buffer asm-lines)
-  "Find used labels in asm-lines."
+  "Find used labels in ASM-LINES generated from SRC-BUFFER."
   (let ((match nil)
 (current-label nil)
 (labels-used nil)
@@ -427,7 +432,11 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
  (cl-return-from rmsbolt--process-dissasembled-lines
'("Aborting processing due to exceeding the binary limit.")))
(when (string-match rmsbolt-dissas-line line)
- (setq source-linum (string-to-number (match-string 2 line)))
+ ;; Don't add linums from files which we aren't inspecting
+ (if (file-equal-p (buffer-file-name src-buffer)
+   (match-string 1 line))
+ (setq source-linum (string-to-number (match-string 2 line)))
+   (setq source-linum nil))
  ;; We are just setting a linum, no data here.
  (go continue))
 
@@ -747,7 +756,9 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   src-current-line))
(window (get-buffer-window scroll-buffer)))
 (with-selected-window window
-  (rmsbolt--goto-line line-scroll))
+  (rmsbolt--goto-line line-scroll)
+  ;; If we scrolled, recenter
+  (recenter))
   (mapc #'delete-overlay rmsbolt-overlays)
   (setq rmsbolt-overlays nil))
 



[elpa] externals/beardbolt c066da01c4 052/323: Fix ocaml def

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit c066da01c46206899117e272fec798089dec1b98
Author: Jay Kamat 
Commit: Jay Kamat 

Fix ocaml def
---
 rmsbolt.el | 33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 48bebfba01..b406699822 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -331,23 +331,22 @@ Outputs assembly file if ASM."
   "frame_dummy"
   (and ".plt" (0+ any)))
   eol))
-(defvar rmsbolt--hidden-func-ocaml)
-(setq rmsbolt--hidden-func-ocaml
-  (rx bol
-  (or (and "__" (0+ any))
-  (and "_" (or "init" "start" "fini"))
-  (and (opt "de") "register_tm_clones")
-  (and ".plt" (0+ any))
-  (and "camlCamlinternalFormat" (0+ any))
-  (and (1+ (not (any "@"))) "@plt")
-  (and (or "caml_" "camlStd_") (0+ any))
-  (and "caml" (or "Pervasives" "List" "Bytes"
-  "String" "Buffer" "Printf"
-  "Char" "Sys") "__" (0+ any))
-  ;; Ocaml likes to make labels following camlModule__,
-  ;; filter out any lowercase
-  (and (1+ (1+ lower) (opt (or "64" "32" "8" "16")) (opt "_"
-  eol))
+(defvar rmsbolt--hidden-func-ocaml
+  (rx bol
+  (or (and "__" (0+ any))
+  (and "_" (or "init" "start" "fini"))
+  (and (opt "de") "register_tm_clones")
+  (and ".plt" (0+ any))
+  (and "camlCamlinternalFormat" (0+ any))
+  (and (1+ (not (any "@"))) "@plt")
+  (and (or "caml_" "camlStd_") (0+ any))
+  (and "caml" (or "Pervasives" "List" "Bytes"
+  "String" "Buffer" "Printf"
+  "Char" "Sys") "__" (0+ any))
+  ;; Ocaml likes to make labels following camlModule__,
+  ;; filter out any lowercase
+  (and (1+ (1+ lower) (opt (or "64" "32" "8" "16")) (opt "_"
+  eol))
  Language Definitions
 (defvar rmsbolt-languages)
 (setq



[elpa] externals/beardbolt 55c26882cd 025/323: Fix crash on quit

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 55c26882cd1944371e4dee37780c4ba6cd46d554
Author: Jay Kamat 
Commit: Jay Kamat 

Fix crash on quit
---
 README.org | 25 -
 rmsbolt.el |  6 +-
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index 8e26aae4a7..3148ae0572 100644
--- a/README.org
+++ b/README.org
@@ -5,11 +5,26 @@ A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer
 
 * Why RMSbolt over godbolt?
 
-- No sending your code to a third party server
-- Compilation runs entirely on your machine
-- Better turnaround time from writing code to seeing disassembly
-- Infinitely hackable!
+- No more sending your code to any server
+- Much faster turnaround time from writing code to seeing and interacting with 
disassembly
+- 100% usable without the mouse.
 - Write, compile, and view dissasembly entirely in Emacs
-  - Use compile.el to traverse errors like you would normally
+  - Use compile.el, flymake, or flycheck to traverse and fix errors as you
+would normally.
+  - Use any libraries on your machine trivially
 - Runs entirely without node, npm, or js.
   - No dependencies other than emacs 25 and your compiler ~:)~
+  - Code is actually readable
+- Full undo (tree) system from Emacs on disassembly for easy comparisons
+- Infinitely hackable!
+
+* Installation
+
+rmsbolt is not on melpa yet. If you find it useful, please let me know and I 
may
+add it..
+
+** Quelpa
+
+#+BEGIN_SRC emacs-lisp
+  (quelpa '(rmsbolt :fetcher gitlab :repo "jgkamat/rmsbolt"))
+#+END_SRC
diff --git a/rmsbolt.el b/rmsbolt.el
index 46c5bb714b..8312599e6f 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -75,6 +75,8 @@
 (defvar rmsbolt-shell "bash"
   "Shell rmsbolt will use to split paths.")
 (defvar rmsbolt-output-buffer "*rmsbolt-output*")
+(defvar rmsbolt-mode
+  "whether rmsbolt-mode is enabled")
 
 (defvar rmsbolt-hide-compile t)
 (defvar rmsbolt-binary-asm-limit 5000)
@@ -566,7 +568,9 @@ int main() {
   (make-temp-file "rmsbolt-" t))
 (add-hook 'kill-emacs-hook
   (lambda ()
-(delete-directory rmsbolt-temp-dir t)
+(when (and rmsbolt-temp-dir
+   (file-directory-p rmsbolt-temp-dir) )
+  (delete-directory rmsbolt-temp-dir t))
 (setq rmsbolt-temp-dir nil)
 
 (provide 'rmsbolt)



[elpa] externals/beardbolt 3ca3f35cdb 050/323: Add very basic support for rust

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 3ca3f35cdb14a27eaef9f58db1bbb0fb508cc649
Author: Jay Kamat 
Commit: Jay Kamat 

Add very basic support for rust
---
 README.org   |  2 +-
 rmsbolt.el   | 37 +++--
 starters/rmsbolt.c   |  2 +-
 starters/rmsbolt.cpp |  2 +-
 starters/rmsbolt.ml  |  2 +-
 starters/rmsbolt.rs  | 35 +++
 6 files changed, 70 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index 85395517ef..2a9207b33f 100644
--- a/README.org
+++ b/README.org
@@ -1,7 +1,7 @@
 
 * RMSbolt
 
-A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-exporter]] 
for Emacs.
+A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-explorer]] 
for Emacs.
 
 RMSBolt tries to make it easy to see what your compiler is doing. It does this
 by showing you the assembly output of a given source code file. It also
diff --git a/rmsbolt.el b/rmsbolt.el
index 0de2ad2637..2e5ed91bd5 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1,11 +1,11 @@
-;;; rmsbolt.el --- A compiler output viewer for Emacs -*- lexical-binding: t; 
-*-
+;;; rmsbolt.el --- A compiler output viewer -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2018 Jay Kamat
 ;; Author: Jay Kamat 
-;; Version: 0.0.1
-;; Keywords: compilation
+;; Version: 0.1.0
+;; Keywords: compilation, tools
 ;; URL: http://gitlab.com/jgkamat/rmsbolt
-;; Package-Requires: ((emacs "25.0"))
+;; Package-Requires: ((emacs "25.1"))
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU Affero General Public License as published by
@@ -300,6 +300,22 @@ Assumes function name to dissasemble is 'main'."
   " "))
   (_
(error "This Common Lisp interpreter is not supported")
+(cl-defun rmsbolt--rust-compile-cmd (&key src-buffer)
+  "Process a compile command for rustc."
+  (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
+ (cmd (mapconcat 'identity
+ (list cmd
+   "-g"
+   "--emit"
+   (if (buffer-local-value 'rmsbolt-disassemble 
src-buffer)
+   "link"
+ "asm")
+   (buffer-file-name)
+   "-o" (rmsbolt-output-filename src-buffer)
+   (when (buffer-local-value 'rmsbolt-intel-x86 
src-buffer)
+ "-Cllvm-args=--x86-asm-syntax=intel"))
+ " ")))
+cmd))
 
 (defvar rmsbolt--hidden-func-c
   (rx bol (or (and "__" (0+ any))
@@ -364,6 +380,15 @@ Assumes function name to dissasemble is 'main'."
   :starter-file-name "rmsbolt.lisp"
   :compile-cmd-function #'rmsbolt--lisp-compile-cmd
   :disass-hidden-funcs nil))
+   (rust-mode
+. ,(make-rmsbolt-lang :mode 'rust-mode
+  :compile-cmd "rustc"
+  :supports-asm t
+  :supports-disass nil
+  :objdumper 'objdump
+  :starter-file-name "rmsbolt.rs"
+  :compile-cmd-function #'rmsbolt--rust-compile-cmd
+  :disass-hidden-funcs nil))
))
 
  Macros
@@ -379,7 +404,7 @@ Assumes function name to dissasemble is 'main'."
 
 
  Functions
-;; Functions to parse and lint assembly were lifted almost directly from the 
compiler-exporter
+;; Functions to parse and lint assembly were lifted almost directly from the 
compiler-explorer
 
 (defun rmsbolt-re-seq (regexp string)
   "Get list of all REGEXP match in STRING."
@@ -393,7 +418,7 @@ Assumes function name to dissasemble is 'main'."
 
 ; Filter Functions
 
-;; Filtering functions were more or less lifted from the godbolt compiler 
exporter to maintain compatiblity.
+;; Filtering functions were more or less lifted from the godbolt compiler 
explorer to maintain compatiblity.
 ;; https://github.com/mattgodbolt/compiler-explorer/blob/master/lib/asm.js
 
 (defun rmsbolt--has-opcode-p (line)
diff --git a/starters/rmsbolt.c b/starters/rmsbolt.c
index 63dc6d69cc..65103434ba 100644
--- a/starters/rmsbolt.c
+++ b/starters/rmsbolt.c
@@ -4,7 +4,7 @@
 
 // Local Variables:
 // rmsbolt-command: "gcc -O0"
-// rmsbolt-dissasemble: nil
+// rmsbolt-disassemble: nil
 // End:
 
 int isRMS(int a) {
diff --git a/starters/rmsbolt.cpp b/starters/rmsbolt.cpp
index aa4dee0f0e..40cc5a94b2 100644
--- a/starters/rmsbolt.cpp
+++ b/starters/rmsbolt.cpp
@@ -4,7 +4,7 @@
 
 // Local Variables:
 // rmsbolt-command: "g++ -O0"
-// rmsbolt-dissasemble: nil
+// rmsbolt-disassemble: nil
 // End:
 
 int isRMS(int a) {
diff --git a/starters/rmsbolt.ml b/starters/rmsbolt.ml
index 23872d40de..4cb5fe07db 100644
--- a/starte

[elpa] externals/beardbolt 0a55783f33 029/323: Add skeleton for font-lock

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 0a55783f335baab66e172811a2f126916654b020
Author: Jay Kamat 
Commit: Jay Kamat 

Add skeleton for font-lock
---
 rmsbolt.el | 78 +++---
 1 file changed, 49 insertions(+), 29 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 24a7d1f93c..60f2acc723 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -68,6 +68,12 @@
   :safe 'booleanp
   :group 'rmsbolt)
 
+ Faces
+
+(defface rmsbolt-current-line-face
+  '((t (:weight bold)))
+  "Face to fontify the current line for showing matches."
+  :group 'fic-mode)
 
  Variables:
 (defvar rmsbolt-temp-dir nil
@@ -148,7 +154,6 @@
 (group (1+ digit)) ",0,"
 (group (1+ digit)) "," (0+ any)))
 
-
  Classes
 
 (cl-defstruct (rmsbolt-lang
@@ -524,6 +529,7 @@ int main() {
  (insert
   (mapconcat 'identity lines "\n"))
  (asm-mode)
+ (rmsbolt-mode 1)
  (display-buffer (current-buffer)
 (t
  ;; Display compilation output
@@ -551,33 +557,36 @@ int main() {
   (interactive)
   (save-some-buffers nil (lambda () rmsbolt-mode))
   (rmsbolt--parse-options)
-  (let* ((src-buffer (current-buffer))
- (lang (rmsbolt--get-lang))
- (func (rmsbolt-l-compile-cmd-function lang))
- (cmd (funcall func src-buffer)))
-
-(when (buffer-local-value 'rmsbolt-dissasemble src-buffer)
-  (pcase
-  (rmsbolt-l-objdumper lang)
-('objdump
- (setq cmd
-   (mapconcat 'identity
-  (list cmd
-"&&"
-"objdump" "-d" (rmsbolt-output-filename 
src-buffer)
-"-C" "--insn-width=16" "-l"
-"-M" (if (buffer-local-value 
'rmsbolt-intel-x86 src-buffer)
- "intel"
-   "att")
-">" (rmsbolt-output-filename src-buffer t))
-  " ")))
-(_
- (error "Objdumper not recognized"
-(rmsbolt-with-display-buffer-no-window
- (with-current-buffer (compilation-start cmd)
-   (add-hook 'compilation-finish-functions
- #'rmsbolt--handle-finish-compile nil t)
-   (setq-local rmsbolt-src-buffer src-buffer)
+  (if (eq major-mode 'asm-mode)
+  ;; We cannot compile asm-mode files
+  (message "Cannot compile this file. Are you sure you are not in the 
output buffer?")
+(let* ((src-buffer (current-buffer))
+   (lang (rmsbolt--get-lang))
+   (func (rmsbolt-l-compile-cmd-function lang))
+   (cmd (funcall func src-buffer)))
+
+  (when (buffer-local-value 'rmsbolt-dissasemble src-buffer)
+(pcase
+(rmsbolt-l-objdumper lang)
+  ('objdump
+   (setq cmd
+ (mapconcat 'identity
+(list cmd
+  "&&"
+  "objdump" "-d" (rmsbolt-output-filename 
src-buffer)
+  "-C" "--insn-width=16" "-l"
+  "-M" (if (buffer-local-value 
'rmsbolt-intel-x86 src-buffer)
+   "intel"
+ "att")
+  ">" (rmsbolt-output-filename src-buffer t))
+" ")))
+  (_
+   (error "Objdumper not recognized"
+  (rmsbolt-with-display-buffer-no-window
+   (with-current-buffer (compilation-start cmd)
+ (add-hook 'compilation-finish-functions
+   #'rmsbolt--handle-finish-compile nil t)
+ (setq-local rmsbolt-src-buffer src-buffer))
 
  Keymap
 (defvar rmsbolt-mode-map nil "Keymap for `rmsbolt-mode'.")
@@ -611,6 +620,11 @@ int main() {
 (rmsbolt-defstarter "c" 'c-mode)
 (rmsbolt-defstarter "c++" 'c++-mode)
 
+ Font lock matcher
+(defun rmsbolt-search-for-keyword (limit)
+  ;; TODO implement me
+  )
+
  Mode Definition:
 
 ;;;###autoload
@@ -618,6 +632,12 @@ int main() {
 (define-minor-mode rmsbolt-mode
   "RMSbolt"
   nil "RMSBolt" rmsbolt-mode-map
+  (if rmsbolt-mode
+  (font-lock-add-keywords
+   nil '((rmsbolt-search-for-keyword
+  (0 rmsbolt-current-line-face
+)
+
   (unless (and rmsbolt-temp-dir
(file-exists-p rmsbolt-temp-dir))
 (setq rmsbolt-temp-dir
@@ -626,7 +646,7 @@ int main() {
   (lambda ()
 (when (and (boundp 'rmsbolt-temp-dir)
rmsbolt-temp-dir
-   (file-directory-p rmsbolt-temp-dir) )
+   (file-directory-p rmsbolt-temp-dir))
   (delete-directory rmsbolt-temp-dir t))
 (setq rmsbolt-temp-dir nil)

[elpa] externals/beardbolt ff6f376d87 053/323: Update README.org

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit ff6f376d87bc38f82489cbba7636e1730e2ce0b5
Author: Jay Kamat 
Commit: Jay Kamat 

Update README.org
---
 README.org | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 2a9207b33f..8852726001 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,3 @@
-
 * RMSbolt
 
 A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-explorer]] 
for Emacs.
@@ -41,14 +40,14 @@ add it..
 
 ** C/C++
 
-[[https://u.cubeupload.com/jgkamat/sihr1g.gif][https://u.cubeupload.com/jgkamat/sihr1g.gif]]
+[[https://s25.postimg.cc/c1zj5ghr3/sihr1g.gif]]
 
 ** Ocaml
 
-[[https://u.cubeupload.com/jgkamat/PabAq2.gif][https://u.cubeupload.com/jgkamat/PabAq2.gif]]
+[[https://s25.postimg.cc/s088vljov/Pab_Aq2.gif]]
 
 ** Common Lisp
 
 No support for source->asm matching or filtering.
 
-[[http://u.cubeupload.com/jgkamat/1FB9k7.gif][http://u.cubeupload.com/jgkamat/1FB9k7.gif]]
+[[https://s25.postimg.cc/uhk02ugfz/1_FB9k7.gif]]



[elpa] externals/beardbolt 503b51ecb8 066/323: Fix typo

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 503b51ecb87ee098aae9a4dbc565ea9198286dd5
Author: Jay Kamat 
Commit: Jay Kamat 

Fix typo

Thanks toofar :D
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 5a6fc41837..dc1d4ee8a3 100644
--- a/README.org
+++ b/README.org
@@ -68,7 +68,7 @@ to ~haskell-demangler~.
 
 ** Python
 
-Support for viewing bytecode only. Python 
[[https://bugs.python.org/issue2506][dosen't have many options]], so most
+Support for viewing bytecode only. Python 
[[https://bugs.python.org/issue2506][doesn't have many options]], so most
 tweakables will not work. Python 3.7 is required for recursion into functions,
 otherwise only top level code will be shown. Python 2 is unsupported.
 



[elpa] externals/beardbolt ce6511f715 024/323: Fix compiler warnings

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit ce6511f715fa9f5a9bf963a20616741d1d3c669c
Author: Jay Kamat 
Commit: Jay Kamat 

Fix compiler warnings
---
 .gitignore |  2 ++
 rmsbolt.el | 10 +++---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..7e1ab01b27
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+
+*.elc
diff --git a/rmsbolt.el b/rmsbolt.el
index d897288f75..46c5bb714b 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -315,11 +315,8 @@ int main() {
   (let ((match nil)
 (current-label nil)
 (labels-used nil)
-(trimmed-line nil)
 (weak-usages (make-hash-table :test #'equal)))
 (dolist (line asm-lines)
-  (setq trimmed-line (string-trim line))
-
   (setq match (and
(string-match rmsbolt-label-def line)
(match-string 1 line)))
@@ -350,7 +347,7 @@ int main() {
(label-iter 0)
(completed nil))
 
-  (while (and (<= (incf label-iter)
+  (while (and (<= (cl-incf label-iter)
   max-label-iter)
   (not completed))
 (let ((to-add nil))
@@ -379,12 +376,11 @@ int main() {
 (cl-defun rmsbolt--process-dissasembled-lines (src-buffer asm-lines)
   "Process and filter dissasembled ASM-LINES from SRC-BUFFER."
   (let* ((result nil)
- (func nil)
- (match nil))
+ (func nil))
 (dolist (line asm-lines)
   (cl-tagbody
(when (> (length result) rmsbolt-binary-asm-limit)
- (return-from rmsbolt--process-dissasembled-lines
+ (cl-return-from rmsbolt--process-dissasembled-lines
'("Aborting processing due to exceeding the binary limit.")))
;; TODO process line numbers
(when (string-match rmsbolt-dissas-label line)



[elpa] externals/beardbolt be3f92821e 140/323: Clean up PHP exporter slightly

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit be3f92821e8c4d16c7aab06d1c6037ab5da5da43
Author: Jay Kamat 
Commit: Jay Kamat 

Clean up PHP exporter slightly
---
 rmsbolt.el | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 36acab6ba0..882d48fac0 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -912,26 +912,24 @@ Argument SRC-BUFFER source buffer."
 (nreverse result)))
 
 (cl-defun rmsbolt--process-php-bytecode (_src-buffer asm-lines)
-  (let ((source-linum nil)
-(state 'useless)
+  (let ((state 'useless)
 (current-line nil)
 (result nil))
 (dolist (line asm-lines)
-  (case state
+  (cl-case state
 ((text)
  (push line result)
  (when (string-match "^-+$" line)
(setq state 'asm)))
 ((asm)
  (cond
-  ((equalp "" line) (setq state 'useless) (push "" result))
+  ((string-empty-p line) (setq state 'useless))
   ((string-match "^ *\\([0-9]+\\) +[0-9]+" line)
(setq current-line (string-to-number (match-string 1 line)))
-   (add-text-properties 0 (length line) `(rmsbolt-src-line 
,current-line) line)
-   (push line result))
+   (add-text-properties 0 (length line) `(rmsbolt-src-line 
,current-line) line))
   (t
-   (add-text-properties 0 (length line) `(rmsbolt-src-line 
,current-line) line)
-   (push line result
+   (add-text-properties 0 (length line) `(rmsbolt-src-line 
,current-line) line)))
+ (push line result))
 (otherwise
  (when (string-match "^filename:" line)
(setq state 'text)



[elpa] externals/beardbolt ca92d533ad 061/323: Add basic support for python

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit ca92d533adb237a4570a194d682a73ccff5b073e
Author: Jay Kamat 
Commit: Jay Kamat 

Add basic support for python
---
 rmsbolt.el | 184 -
 1 file changed, 110 insertions(+), 74 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index ca507f3dcc..c3db0cce83 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -433,7 +433,8 @@ Outputs assembly file if ASM."
   :supports-disass nil
   :starter-file-name "rmsbolt.py"
   :compile-cmd-function #'rmsbolt--py-compile-cmd
-  :disass-hidden-funcs nil))
+  :disass-hidden-funcs nil
+  :process-asm-custom-fn 
#'rmsbolt--process-python-bytecode))
))
 
  Macros
@@ -581,6 +582,112 @@ Outputs assembly file if ASM."
continue))
 (nreverse result)))
 
+(cl-defun rmsbolt--process-src-asm-lines (src-buffer asm-lines)
+  (let ((used-labels (rmsbolt--find-used-labels src-buffer asm-lines))
+(result nil)
+(prev-label nil)
+(source-linum nil)
+(source-file nil)
+(skip-file-match
+ ;; Skip file match if we don't have a current filename
+ (not (buffer-file-name src-buffer
+(dolist (line asm-lines)
+  (let* ((raw-match (or (string-match rmsbolt-label-def line)
+(string-match rmsbolt-assignment-def line)))
+ (match (when raw-match
+  (match-string 1 line)))
+ (used-label (cl-find match used-labels :test #'equal)))
+(cl-tagbody
+ ;; Process file name hints
+ (when (string-match rmsbolt-source-file line)
+   (if (match-string 3 line)
+   ;; Clang style match
+   (setq source-file (expand-file-name
+  (match-string 3 line)
+  (match-string 2 line)))
+ (setq source-file (match-string 2 line
+ ;; Process any line number hints
+ (when (string-match rmsbolt-source-tag line)
+   (if (or skip-file-match
+   (file-equal-p (buffer-file-name src-buffer) source-file))
+   (setq source-linum (string-to-number
+   (match-string 2 line)))
+ (setq source-linum nil)))
+ (when (string-match rmsbolt-source-stab line)
+   (pcase (string-to-number (match-string 1 line))
+ ;; http://www.math.utah.edu/docs/info/stabs_11.html
+ (68
+  (setq source-linum (match-string 2 line)))
+ ((or 100 132)
+  (setq source-linum nil
+
+ ;; End block, reset prev-label and source
+ (when (string-match-p rmsbolt-endblock line)
+   (setq prev-label nil))
+
+ (when (and (buffer-local-value 'rmsbolt-filter-comment-only 
src-buffer)
+(string-match-p rmsbolt-comment-only line))
+   (go continue))
+
+ ;; continue means we don't add to the ouptut
+ (when match
+   (if (not used-label)
+   ;; Unused label
+   (when (buffer-local-value 'rmsbolt-filter-labels src-buffer)
+ (go continue))
+ ;; Real label, set prev-label
+ (setq prev-label raw-match)))
+ (when (and (buffer-local-value 'rmsbolt-filter-directives src-buffer)
+(not match))
+   (if  (and (string-match-p rmsbolt-data-defn line)
+ prev-label)
+   ;; data is being used
+   nil
+ (when (string-match-p rmsbolt-directive line)
+   (go continue
+ ;; Add line numbers to mapping
+ (when (and source-linum
+(rmsbolt--has-opcode-p line))
+   (add-text-properties 0 (length line)
+`(rmsbolt-src-line ,source-linum) line))
+ ;; Add line
+ (push line result)
+
+ continue)))
+(nreverse result)))
+
+(cl-defun rmsbolt--process-python-bytecode (_src-buffer asm-lines)
+  (let ((source-linum nil)
+(result nil))
+(dolist (line asm-lines)
+  (if (not (string-match (rx bol (repeat 3 (opt space))
+ (group (opt (1+ digit))) (0+ space)
+ (group (opt "-->")) (0+ space)
+ (group (opt ">>")) (0+ space)
+ (group (1+ digit)) (0+ space)
+ (group (1+ (or letter "_"))) (0+ space)
+ (group (opt (1+ digit))) (0+ space)
+ (group (opt (0+ any
+ line))
+  ;; just push the var with no linum
+  (push line result)
+;; Grab line numbers
+(unless (string-empty-p (match-string 1 line))

[elpa] externals/beardbolt a638324882 039/323: Add OCaml demo

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit a638324882fc0266ce753c645dd80787247554cc
Author: Jay Kamat 
Commit: Jay Kamat 

Add OCaml demo
---
 README.org | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/README.org b/README.org
index 2347b7994d..da0d81727b 100644
--- a/README.org
+++ b/README.org
@@ -31,3 +31,9 @@ add it..
 :fetcher gitlab
 :repo "jgkamat/rmsbolt"))
 #+END_SRC
+
+* Demo
+
+** Ocaml
+
+[[https://u.cubeupload.com/jgkamat/PabAq2.gif][https://u.cubeupload.com/jgkamat/PabAq2.gif]]



[elpa] externals/beardbolt e0d917206e 038/323: Improve quality of default matching faces

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit e0d917206eb1627d01f06c563ddc897abbd3e543
Author: Jay Kamat 
Commit: Jay Kamat 

Improve quality of default matching faces
---
 rmsbolt.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index df8ffdb4fd..b143deeedc 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -90,9 +90,9 @@
  Faces
 
 (defface rmsbolt-current-line-face
-  '((t (:weight bold)))
+  '((t (:weight bold :inherit hl-line)))
   "Face to fontify the current line for showing matches."
-  :group 'fic-mode)
+  :group 'rmsbolt)
 
  Variables:
 (defvar rmsbolt-temp-dir nil
@@ -721,7 +721,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
(with-current-buffer src-buffer
  (save-excursion
(rmsbolt--goto-line src-current-line)
-   (cl-values (c-point 'bol) (c-point 'eol))
+   (cl-values (c-point 'bol) (c-point 'bonl))
 (let ((line-visible (not rmsbolt-goto-match))
   (src-buffer-selected (eq (current-buffer) src-buffer)))
   (mapc #'delete-overlay rmsbolt-overlays)
@@ -740,7 +740,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
  (start-pt (progn (rmsbolt--goto-line start)
   (c-point 'bol)))
  (end-pt (progn (rmsbolt--goto-line end)
-(c-point 'eol)))
+(c-point 'bonl)))
  (visible (or line-visible
   (rmsbolt--point-visible start-pt)
   (rmsbolt--point-visible end-pt)



[elpa] externals/beardbolt 93f3cad769 017/323: Use local variables instead of custom parsing

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 93f3cad769b53e39d93890ebf08f6f5c446ba562
Author: Jay Kamat 
Commit: Jay Kamat 

Use local variables instead of custom parsing
---
 rmsbolt.el | 97 ++
 1 file changed, 60 insertions(+), 37 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index b7583c694c..ef8a7bb103 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -30,6 +30,21 @@
 (require 'map)
 
 ;;; Code:
+ Customize:
+(defgroup rmsbolt nil
+  "rmsbolt customization options"
+  :group 'applications)
+
+(defcustom rmsbolt-dissasemble nil
+  "Whether we should dissasemble an output binary."
+  :type 'boolean
+  :safe 'booleanp)
+(defcustom rmsbolt-command nil
+  "The base command to run rmsbolt from."
+  :type 'string
+  :safe 'stringp)
+
+
  Variables:
 (defvar rmsbolt-temp-dir nil
   "Temporary directory to use for compilation and other reasons.")
@@ -42,14 +57,16 @@
 (defvar rmsbolt-filter-asm-directives t)
 (defvar rmsbolt-filter-unused-labels t)
 (defvar rmsbolt-filter-comment-only t)
-(defvar rmsbolt-dissasemble nil)
 (defvar rmsbolt-binary-asm-limit 5000)
-(defun rmsbolt-output-filename (&optional asm)
-  (if (and rmsbolt-dissasemble
-   (not asm))
+(defun rmsbolt-output-filename (options &optional asm)
+  (if (and (not asm)
+   (rmsbolt-o-dissasemble options))
   (expand-file-name "rmsbolt.out" rmsbolt-temp-dir)
 (expand-file-name "rmsbolt.s" rmsbolt-temp-dir)))
 
+(defvar-local rmsbolt-dissasemble nil)
+
+
  Regexes
 
 (defvar rmsbolt-label-def  (rx bol (group (any ".a-zA-Z_$@")
@@ -114,7 +131,7 @@
:type 'symbol
:documentation "The major mode language we are compiling in."
)
-  (binary-compile
+  (dissasemble
nil
:type 'bool
:documentation "Whether we should compile to binary and dissasemble that."))
@@ -161,11 +178,11 @@
  (cmd (mapconcat 'identity
  (list cmd
"-g"
-   (if rmsbolt-dissasemble
+   (if (rmsbolt-o-dissasemble options)
""
  "-S")
(buffer-file-name)
-   "-o" (rmsbolt-output-filename)
+   "-o" (rmsbolt-output-filename options)
(when rmsbolt-intel-x86
  "-masm=intel"))
  " ")))
@@ -192,7 +209,10 @@
   :starter-file
   "#include 
 
-// RMS: gcc -O3
+// Local Variables:
+// rmsbolt-command: \"gcc -O3\"
+// rmsbolt-dissasemble: nil
+// End:
 
 int isRMS(int a) {
 switch (a) {
@@ -226,7 +246,10 @@ int main() {
   :starter-file
   "#include 
 
-// RMS: g++ -O3
+// Local Variables:
+// rmsbolt-command: \"g++ -O3\"
+// rmsbolt-dissasemble: nil
+// End:
 
 int isRMS(int a) {
 switch (a) {
@@ -381,7 +404,7 @@ int main() {
 
 (cl-defun rmsbolt--process-asm-lines (opts asm-lines)
   "Process and filter a set of asm lines."
-  (if rmsbolt-dissasemble
+  (if (rmsbolt-o-dissasemble opts)
   (rmsbolt--process-dissasembled-lines opts asm-lines)
 (let ((used-labels (rmsbolt--find-used-labels asm-lines))
   (result nil)
@@ -436,14 +459,14 @@ int main() {
 
 (with-current-buffer (get-buffer-create rmsbolt-output-buffer)
   (cond ((not compilation-fail)
- (if (not (file-exists-p (rmsbolt-output-filename t)))
+ (if (not (file-exists-p (rmsbolt-output-filename opts t)))
  (message "Error reading from output file.")
(delete-region (point-min) (point-max))
(insert
 (rmsbolt--process-asm-lines
  opts
  (with-temp-buffer
-   (insert-file-contents (rmsbolt-output-filename t))
+   (insert-file-contents (rmsbolt-output-filename opts t))
(split-string (buffer-string) "\n" t
(asm-mode)
(display-buffer (current-buffer
@@ -454,19 +477,17 @@ int main() {
 ; Parsing Options
 (defun rmsbolt--get-lang (&optional language)
   (cdr-safe (assoc (or language major-mode) rmsbolt-languages)))
-(defun rmsbolt--get-cmd ()
-  "Gets the rms command from the buffer, if available."
-  (save-excursion
-(goto-char (point-min))
-(re-search-forward (rx "RMS:" (1+ space) (group (1+ (any "-" "+" alnum 
space nil t)
-(match-string-no-properties 1)))
 (defun rmsbolt--parse-options ()
   "Parse RMS options from file."
   (let* ((lang (rmsbolt--get-lang))
- (options (copy-rmsbolt-options (rmsbolt-l-options lang)))
- (cmd (rmsbolt--get-cmd)))
+ (options (copy-rmsbolt-options
+   (rmsbolt-l-options lang)))
+ (cmd rmsbolt-command))
 (when cmd
   (setf (rmsbolt-o-compile-c

[elpa] externals/beardbolt 39f1e05667 009/323: Add filter for commentOnly

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 39f1e056672a1e70ba147db7e4438fe8240269c0
Author: Jay Kamat 
Commit: Jay Kamat 

Add filter for commentOnly
---
 rmsbolt.el | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 088c1345bb..78724afe67 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -49,6 +49,7 @@
 (defvar rmsbolt-intel-x86 t)
 (defvar rmsbolt-filter-asm-directives t)
 (defvar rmsbolt-filter-unused-labels t)
+(defvar rmsbolt-filter-comment-only t)
 
  Regexes
 
@@ -80,6 +81,9 @@
  "short" "word" "long" "quad" "value" 
"zero"
 (defvar rmsbolt-directive (rx bol (0+ space) "." (0+ any) eol))
 (defvar rmsbolt-endblock (rx "." (or "cfi_endproc" "data" "text" "section")))
+(defvar rmsbolt-comment-only (rx bol (0+ space) (or (and (or (any "#@;") "//"))
+(and "/*" (0+ any) "*/"))
+ (0+ any) eol))
 
  Classes
 
@@ -88,8 +92,7 @@
   (compile-cmd
""
:type string
-   :documentation "The command used to compile this file")
-  )
+   :documentation "The command used to compile this file"))
 
 (cl-defstruct (rmsbolt-lang
(:conc-name rmsbolt-l-))
@@ -224,6 +227,10 @@
  (when (string-match-p rmsbolt-endblock line)
(setq prev-label nil))
 
+ (when (and rmsbolt-filter-comment-only
+(string-match-p rmsbolt-comment-only line))
+   (go continue))
+
  ;; continue means we don't add to the ouptut
  (when match
(if (not used-label)
@@ -284,7 +291,7 @@
  (options (copy-rmsbolt-options (rmsbolt-l-options lang)))
  (cmd (rmsbolt--get-cmd)))
 (when cmd
-  (setf (rmsbolt-ro-compile-cmd options) cmd))
+  (setf (rmsbolt-o-compile-cmd options) cmd))
 options))
 
 ; UI Functions



[elpa] externals/beardbolt a5614c56d7 113/323: Merge branch 'pony'

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit a5614c56d7a3b270cb29d00e1854df6fe98e1ad5
Merge: 865d5a8c1a 47e9fa1f59
Author: Jay Kamat 
Commit: Jay Kamat 

Merge branch 'pony'
---
 README.org| 24 +++
 rmsbolt.el| 82 +--
 starters/rmsbolt.pony | 23 +++
 3 files changed, 107 insertions(+), 22 deletions(-)

diff --git a/README.org b/README.org
index aec022098c..64dbd1a5fd 100644
--- a/README.org
+++ b/README.org
@@ -12,7 +12,7 @@ versa. It supports more types of languages than any previous 
tool of its kind.
 - Much more flexible and powerful:
   - Supports disassembly to bytecode as well as assembly.
   - Supports many languages that godbolt does not support, such as python,
-common lisp, ocaml, and java.
+common lisp, ocaml, java, and pony.
 - No more sending your code to any server.
 - Much faster turnaround time from writing code to seeing and interacting with 
disassembly.
 - 100% usable without the mouse.
@@ -54,10 +54,12 @@ though.
 #+END_SRC
 
 * Running
- Once installed, use the ~rmsbolt-starter~ command to generate starter files, 
or
- enable ~rmsbolt-mode~ in a supported language. Then run ~rmsbolt-compile~ or
- use the default ~C-c C-c~ binding. After the first run, the buffer should
- automatically update.
+Once installed, use the ~rmsbolt-starter~ command to generate starter files, or
+enable ~rmsbolt-mode~ in a supported language. Then run ~rmsbolt-compile~ or
+use the default ~C-c C-c~ binding. After the first run, the buffer should
+automatically update.
+
+Language-specific quirks are listed in the demos section currently.
 
 * Configuration
 
@@ -121,9 +123,19 @@ moment.
 
 [[https://i.imgur.com/KkWEMMj.gif][https://i.imgur.com/KkWEMMj.gif]]
 
+** Pony
+
+Filtering on pony is not as effective as pony asm includes references to
+machine-generated functions. This means the output will be slower to generate,
+similar to disassembly in other languages. The pony file being viewed will be
+copied into it's own directory, making it much harder to view non-toy examples.
+
+[[https://i.imgur.com/8kd6kkJ.gif][https://i.imgur.com/8kd6kkJ.gif]]
+
 ** Common Lisp
 
-No support for source->asm matching or filtering.
+No support for source->asm matching or filtering. Only ~sbcl~ and ~clisp~
+supported at the moment, with ~sbcl~ giving much better results.
 
 [[https://i.imgur.com/36aNVvf.gif][https://i.imgur.com/36aNVvf.gif]]
 
diff --git a/rmsbolt.el b/rmsbolt.el
index 3f72177d9f..a66c85c16b 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2018 Jay Kamat
 ;; Author: Jay Kamat 
-;; Version: 0.1.0
+;; Version: 0.1.1
 ;; Keywords: compilation, tools
 ;; URL: http://gitlab.com/jgkamat/rmsbolt
 ;; Package-Requires: ((emacs "25.1"))
@@ -25,8 +25,8 @@
 ;; RMSBolt is a package to provide assembly or bytecode output for a source
 ;; code input file.
 ;;
-;; It currently supports: C/C++, OCaml, Haskell, Python, Java, and (limited)
-;; Common Lisp.
+;; It currently supports: C/C++, OCaml, Haskell, Python, Java, Pony, and
+;; (limited) Common Lisp.
 ;;
 ;; Adding support for more languages, if they have an easy manual compilation
 ;; path from source->assembly/bytecode with debug information, should be much
@@ -181,6 +181,9 @@ Please DO NOT modify this blindly, as this directory will 
get deleted on Emacs e
 
 (defvar-local rmsbolt-src-buffer nil)
 
+(defvar-local rmsbolt--real-src-file nil
+  "If set, the real filename that we compiled from, probably due to a copy 
from this file.")
+
  Variable-like funcs
 (defun rmsbolt-output-filename (src-buffer &optional asm)
   "Function for generating an output filename for SRC-BUFFER.
@@ -383,6 +386,42 @@ Outputs assembly file if ASM."
  "-Cllvm-args=--x86-asm-syntax=intel"))
  " ")))
 cmd))
+(cl-defun rmsbolt--pony-compile-cmd (&key src-buffer)
+  "Process a compile command for ponyc."
+  (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
+ (dir (expand-file-name "pony/" rmsbolt--temp-dir))
+ (_ (make-directory dir t))
+ ;; (base-filename (file-name-sans-extension
+ ;; (file-name-nondirectory
+ ;;  (buffer-file-name
+ (base-filename "pony")
+ (base-filename (expand-file-name base-filename dir))
+ (asm-filename (concat base-filename ".s"))
+ (object-filename (concat base-filename ".o"))
+ ;; TODO should we copy this in lisp here, or pass this to the 
compilation command?
+ (_ (copy-file (buffer-file-name)
+   (expand-file-name dir) t))
+ (dis (buffer-local-value 'rmsbolt-disassemble src-buffer))
+ (cmd (mapconcat #'identity
+ (list
+  "cd" dir "&&"
+  cmd
+  "-g"
+  ;; TODO: find a good way to expose -r=

[elpa] externals/beardbolt fef52d3de3 057/323: Update readme

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit fef52d3de321184fd30673763f882cf9c9f9b0c2
Author: Jay Kamat 
Commit: Jay Kamat 

Update readme
---
 README.org | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/README.org b/README.org
index b0d3ee26df..63206249c6 100644
--- a/README.org
+++ b/README.org
@@ -48,6 +48,12 @@ add it..
 
 [[https://s25.postimg.cc/s088vljov/Pab_Aq2.gif]]
 
+** Rust
+
+demangling is done with rustfilt if available
+
+[[https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif][https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif]]
+
 ** Common Lisp
 
 No support for source->asm matching or filtering.



[elpa] externals/beardbolt 971d6cfeae 093/323: Various fixes and cleanups

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 971d6cfeaee351ab67fc9655091b74b036b78f0b
Author: Stefan Monnier 
Commit: Jay Kamat 

Various fixes and cleanups

- Don't require `subr-x` at run-time, since it's designed to be unneeded.
- accept non-ASCII alphabetic letters
- drop unused `mode` field in rmsbolt-lang struct
- replace `starter-file-name` field with a `rmsbolt-starter-files` var.
  I think this should be changed further and basically auto-generated
  from the contents of the `starters` subdir.  But in any case this is
  not needed for "normal" operation and getting rid of it removes the
  need for rmsbolt-languages.
- Introduce buffer-local rmsbolt-language-descriptor to replace
  rmsbolt-languages: the idea is that rmsbolt should (in the long run)
  only provide the infrastructure and then each major mode would set
  rmsbolt-language-descriptor as appropriate.  Just as we do for
  font-lock, imenu, outline-minor-mode, etc...
  There's a FIXME in there, because it's not really satisfactory yet.
- rmsbolt--get-lang remove `language` argument since it's not used any
  more.  Also `major-mode` is now only used for backward compatibility
  with rmsbolt-languages (using `major-mode` is almost always a bad
  idea, since it interacts poorly with derived-modes).
- Initialize rmsbolt-mode-map in the traditional way.
- Make rmsbolt-starter interactive (with completion for the various
  available starter files) and make it replace the various
  rmsbolt- commands.
- Remove `rmsbolt-defstarter` and calls to it.
- Change two weird `unless` which I think should be `when` in rmsbolt-mode.
---
 .gitignore   |   2 +
 README.org   |   4 +-
 rmsbolt-java.el  |  10 +--
 rmsbolt.el   | 181 +--
 test/rmsbolt-test.el |   4 +-
 5 files changed, 99 insertions(+), 102 deletions(-)

diff --git a/.gitignore b/.gitignore
index 59a4b3ccf4..8b45679dfc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 
 *.elc
+*-autoloads.el
+*-pkg.el
 /.cask/
diff --git a/README.org b/README.org
index 260e32115f..b0ca974894 100644
--- a/README.org
+++ b/README.org
@@ -54,9 +54,9 @@ though.
 #+END_SRC
 
 * Running
- Once installed, use the ~rmsbolt-lang~ functions (they will show up after
+ Once installed, use the ~rmsbolt-starter~ command (it will show up after
  ~(require 'rmsbolt)~) to generate starter files, or enable ~rmsbolt-mode~ in a
- supported language. Then run ~rmsbolt-compile~ or use the default ~C-c C-c~
+ supported language.  Then run ~rmsbolt-compile~ or use the default ~C-c C-c~
  binding. After the first run, the buffer should automatically update.
 
 * Demos
diff --git a/rmsbolt-java.el b/rmsbolt-java.el
index 0ed7e1ea50..d429856284 100644
--- a/rmsbolt-java.el
+++ b/rmsbolt-java.el
@@ -1,4 +1,4 @@
-;;; rmsbolt-java.el --- A elisp library to parse javap output -*- 
lexical-binding: t; -*-
+;;; rmsbolt-java.el --- An Elisp library to parse javap output -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2018 Jay Kamat
 ;; Author: Jay Kamat 
@@ -21,17 +21,18 @@
 ;; along with this program.  If not, see .
 
 ;;; Commentary:
+
 ;; The java bytecode dissasembler format is rather obtuse. This library tries
 ;; to make a programatic layer for interacting with it. It's main aim is
 ;; correlating lines in source code to the generated output.
 ;;
-;; This library takes in the output of javap -c -l split into a list by lines,
+;; This library takes in the output of `javap -c -l` split into a list by 
lines,
 ;; which is the same format rmsbolt uses.
 
 ;;; Requires:
 
 (require 'cl-lib)
-(require 'subr-x)
+(eval-when-compile (require 'subr-x))
 
 ;;; Code:
 
@@ -122,7 +123,8 @@ Also FILTER \"useless\" lines out, optionally."
   (setq result-hold nil))
 (push line result))
 (when (and (not filter)
-   ;; Never ouptut code, that's handled above. Code: is 
handled on transition
+   ;; Never output code, that's handled above.
+   ;; Code: is handled on transition
(not (eq state 'code-found)))
   (push line result-hold
 (nreverse result)))
diff --git a/rmsbolt.el b/rmsbolt.el
index 53654acf60..1aadf05e5c 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -21,9 +21,13 @@
 ;; along with this program.  If not, see .
 
 ;;; Commentary:
-;; rmsbolt is a package to provide assembly or bytecode output for a source 
code input file.
+
+;; RMSBolt is a package to provide assembly or bytecode output for a source
+;; code input file.
+;;
+;; It currently supports: C/C++, OCaml, Haskell, Python, Java, and (limited)
+;; Common Lisp.
 ;;
-;; It currently supports: C/C++, OCaml, Haskell, Python, Java, and (limited) 
Common Lisp.
 ;; Adding support for more languages, if they have an easy manual compilation
 ;; path from

[elpa] externals/beardbolt 910509ce5d 104/323: Document buffer-local tweakables in readme

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 910509ce5da79223edae2cdac750be6e8c3664f4
Author: Jay Kamat 
Commit: Jay Kamat 

Document buffer-local tweakables in readme

Previously, this was only in ;;commetnary but now it's in the README
too

Closes #5
---
 README.org | 24 
 1 file changed, 24 insertions(+)

diff --git a/README.org b/README.org
index 2e1d844005..aa1518cd76 100644
--- a/README.org
+++ b/README.org
@@ -59,6 +59,30 @@ though.
  use the default ~C-c C-c~ binding. After the first run, the buffer should
  automatically update.
 
+* Configuration
+
+RMSBolt is primarily configured with Emacs local variables. This lets you 
change
+compiler and rmsbolt options simply by editing a local variable block. The
+starter files have this block with some common settings:
+
+#+BEGIN_SRC c
+// Local Variables:
+// rmsbolt-command: "gcc -O0"
+// rmsbolt-disassemble: nil
+// End:
+#+END_SRC
+
+Notable options:
+
+| Option| Description  

 |
+|---+---|
+| ~rmsbolt-command~ | determines the prefix of the compilation 
command to use. Use this to switch between compilers or pass flags to your 
compiler. |
+| ~rmsbolt-disassemble~ | disassemble from a compiled binary with 
objdump, if supported.  
  |
+| ~rmsbolt-filter-*~| Tweak filtering of binary output 

 |
+| ~rmsbolt-intel-x86~   | Toggle between intel and att syntax if 
supported   
   |
+| ~rmsbolt-demangle~| Demangle the output, if supported.   

 |
+| ~rmsbolt-ignore-binary-limit~ | Ignore the binary size limit for 
disassembly. This will almost certainly cause Emacs to hang during large 
processing. |
+
 * Demos
 ** C/C++
 



[elpa] externals/beardbolt 2530003c71 020/323: Remove rmsbolt-options

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 2530003c7182994c4a48926a26c72716bd23720c
Author: Jay Kamat 
Commit: Jay Kamat 

Remove rmsbolt-options
---
 rmsbolt.el | 101 -
 1 file changed, 40 insertions(+), 61 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index d20b062fec..ad9d12050a 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -58,9 +58,9 @@
 (defvar rmsbolt-filter-unused-labels t)
 (defvar rmsbolt-filter-comment-only t)
 (defvar rmsbolt-binary-asm-limit 5000)
-(defun rmsbolt-output-filename (options &optional asm)
+(defun rmsbolt-output-filename (src-buffer &optional asm)
   (if (and (not asm)
-   (rmsbolt-o-dissasemble options))
+   (buffer-local-value 'rmsbolt-dissasemble src-buffer))
   (expand-file-name "rmsbolt.out" rmsbolt-temp-dir)
 (expand-file-name "rmsbolt.s" rmsbolt-temp-dir)))
 
@@ -120,28 +120,8 @@
 
  Classes
 
-(cl-defstruct (rmsbolt-options
-   (:conc-name rmsbolt-o-))
-  (compile-cmd
-   ""
-   :type 'string
-   :documentation "The command used to compile this file")
-  (lang
-   nil
-   :type 'symbol
-   :documentation "The major mode language we are compiling in."
-   )
-  (dissasemble
-   nil
-   :type 'bool
-   :documentation "Whether we should compile to binary and dissasemble that."))
-
 (cl-defstruct (rmsbolt-lang
(:conc-name rmsbolt-l-))
-  (options
-   nil
-   :type 'rmsbolt-options
-   :documentation "The default options object to use.")
   (mode
'fundamental-mode
:type 'symbol
@@ -166,23 +146,27 @@
nil
:type 'string
:documentation "Functions that are hidden when dissasembling.")
+  (compile-cmd
+   nil
+   :type 'string
+   :documentation "Default compilation command to use if none is provided.")
   (compile-cmd-function
nil
:type 'function
:documentation "A function which takes in a compile command (could be the 
default) and adds needed args to it."))
 
 
-(defun rmsbolt--c-compile-cmd (options)
+(defun rmsbolt--c-compile-cmd (src-buffer)
   "Process a compile command for gcc/clang."
-  (let* ((cmd (rmsbolt-o-compile-cmd options))
+  (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
  (cmd (mapconcat 'identity
  (list cmd
"-g"
-   (if (rmsbolt-o-dissasemble options)
+   (if (buffer-local-value 'rmsbolt-dissasemble 
src-buffer)
""
  "-S")
(buffer-file-name)
-   "-o" (rmsbolt-output-filename options)
+   "-o" (rmsbolt-output-filename src-buffer)
(when rmsbolt-intel-x86
  "-masm=intel"))
  " ")))
@@ -199,9 +183,7 @@
  rmsbolt-languages
  `((c-mode
 . ,(make-rmsbolt-lang :mode 'c
-  :options (make-rmsbolt-options
-:compile-cmd "gcc"
-:lang 'c-mode)
+  :compile-cmd "gcc"
   :supports-asm t
   :starter-file-name "rmsbolt.c"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
@@ -236,9 +218,7 @@ int main() {
   ))
(c++-mode
 . ,(make-rmsbolt-lang :mode 'c++-mode
-  :options (make-rmsbolt-options
-:compile-cmd "g++"
-:lang 'c++-mode)
+  :compile-cmd "g++"
   :supports-asm t
   :starter-file-name "rmsbolt.cpp"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
@@ -367,16 +347,17 @@ int main() {
 (setq completed t
   labels-used)))
 
-(defun rmsbolt--user-func-p (opts func)
+(defun rmsbolt--user-func-p (src-buffer func)
   "Return t if FUNC is a user function."
-  (let* ((lang (rmsbolt--get-lang (rmsbolt-o-lang opts)))
+  (let* ((lang (rmsbolt--get-lang
+(buffer-local-value 'major-mode src-buffer)))
  (regexp (rmsbolt-l-dissas-hidden-funcs lang)))
 (if regexp
 (not (string-match-p regexp func))
   t)))
 
-(cl-defun rmsbolt--process-dissasembled-lines (opts asm-lines)
-  "Process and filter dissasembled ASM-LINES from OPTS."
+(cl-defun rmsbolt--process-dissasembled-lines (src-buffer asm-lines)
+  "Process and filter dissasembled ASM-LINES from SRC-BUFFER."
   (let* ((result nil)
  (func nil)
  (match nil))
@@ -388,11 +369,11 @@ int main() {
;; TODO process line numbers
(when (string-match rmsbolt-dissas-label line)
  (setq func (match-string 2 line))
- (when (rmsbolt--user-func-p opts func)
+ (when (rmsbolt--user-func-p src-buffer func)
(p

[elpa] externals/beardbolt 234e09b81a 065/323: Fix spelling of OCaml

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 234e09b81a72fe425ed40604bc74b05be855a0cd
Author: Jay Kamat 
Commit: Jay Kamat 

Fix spelling of OCaml
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 78a5768049..5a6fc41837 100644
--- a/README.org
+++ b/README.org
@@ -49,7 +49,7 @@ add it..
 
 [[https://s25.postimg.cc/c1zj5ghr3/sihr1g.gif]]
 
-** Ocaml
+** OCaml
 
 [[https://s25.postimg.cc/s088vljov/Pab_Aq2.gif]]
 



[elpa] externals/beardbolt 627dd4c1c9 059/323: Allow for custom asm processing functions

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 627dd4c1c9650818b587ddb891eefb3b8699819e
Author: Jay Kamat 
Commit: Jay Kamat 

Allow for custom asm processing functions

Useful for bytecode
---
 rmsbolt.el | 185 +++--
 1 file changed, 107 insertions(+), 78 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 702d601af0..f1fb2b288c 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -229,7 +229,7 @@ Outputs assembly file if ASM."
:type 'symbol
:documentation "The object dumper to use if disassembling binary.")
   (demangler
-   "c++filt"
+   nil
:type 'string
:documentation "The command of the demangler to use for this source code.")
   (starter-file-name
@@ -247,7 +247,13 @@ Outputs assembly file if ASM."
   (compile-cmd-function
nil
:type 'function
-   :documentation "A function which takes in a compile command (could be the 
default) and adds needed args to it."))
+   :documentation "A function which takes in a compile command
+(could be the default) and adds needed args to it.")
+  (process-asm-custom-fn
+   nil
+   :type 'function
+   :documentation "A custom function used for parsing asm lines
+   instead of the default assembly one." ))
 
 
 (cl-defun rmsbolt--c-compile-cmd (&key src-buffer)
@@ -337,6 +343,13 @@ Outputs assembly file if ASM."
  "-Cllvm-args=--x86-asm-syntax=intel"))
  " ")))
 cmd))
+(cl-defun rmsbolt--py-compile-cmd (&key src-buffer)
+  "Process a compile command for rustc."
+  (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer)))
+(mapconcat 'identity
+   (list cmd "-m" "dis" (buffer-file-name)
+ ">" (rmsbolt-output-filename src-buffer))
+   " ")))
 
 (defvar rmsbolt--hidden-func-c
   (rx bol (or (and "__" (0+ any))
@@ -371,6 +384,7 @@ Outputs assembly file if ASM."
   :compile-cmd "gcc"
   :supports-asm t
   :supports-disass t
+  :demangler "c++filt"
   :starter-file-name "rmsbolt.c"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-c))
@@ -379,6 +393,7 @@ Outputs assembly file if ASM."
   :compile-cmd "g++"
   :supports-asm t
   :supports-disass t
+  :demangler "c++filt"
   :starter-file-name "rmsbolt.cpp"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-c))
@@ -388,7 +403,6 @@ Outputs assembly file if ASM."
   :compile-cmd "ocamlopt"
   :supports-asm t
   :supports-disass t
-  :demangler nil
   :starter-file-name "rmsbolt.ml"
   :compile-cmd-function #'rmsbolt--ocaml-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-ocaml))
@@ -398,7 +412,6 @@ Outputs assembly file if ASM."
   :supports-asm t
   :supports-disass nil
   :objdumper 'cat
-  :demangler nil
   :starter-file-name "rmsbolt.lisp"
   :compile-cmd-function #'rmsbolt--lisp-compile-cmd
   :disass-hidden-funcs nil))
@@ -412,6 +425,15 @@ Outputs assembly file if ASM."
   :starter-file-name "rmsbolt.rs"
   :compile-cmd-function #'rmsbolt--rust-compile-cmd
   :disass-hidden-funcs nil))
+   ;; ONLY SUPPORTS PYTHON 3
+   (python-mode
+. ,(make-rmsbolt-lang :mode 'python-mode
+  :compile-cmd "python3"
+  :supports-asm t
+  :supports-disass nil
+  :starter-file-name "rmsbolt.py"
+  :compile-cmd-function #'rmsbolt--py-compile-cmd
+  :disass-hidden-funcs nil))
))
 
  Macros
@@ -561,80 +583,87 @@ Outputs assembly file if ASM."
 
 (cl-defun rmsbolt--process-asm-lines (src-buffer asm-lines)
   "Process and filter a set of asm lines."
-  (if (buffer-local-value 'rmsbolt-disassemble src-buffer)
-  (rmsbolt--process-disassembled-lines src-buffer asm-lines)
-(let ((used-labels (rmsbolt--find-used-labels src-buffer asm-lines))
-  (result nil)
-  (prev-label nil)
-  (source-linum nil)
-  (source-file nil)
-  (skip-file-match
-   ;; Skip file match if we don't have a current filename
-   (not (buffer-file-name src-buffer
-  (dolist (line asm-lines)
-(let* ((raw-match (or (string-match rmsbolt-label

[elpa] externals/beardbolt 547a47e58f 022/323: Fix default commands

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 547a47e58fbd23c432510bdd9b394cab7c6b6f6f
Author: Jay Kamat 
Commit: Jay Kamat 

Fix default commands
---
 rmsbolt.el | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 8f90023fad..67ebb96fae 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -35,6 +35,7 @@
   "rmsbolt customization options"
   :group 'applications)
 
+; Buffer Local Tweakables
 (defcustom rmsbolt-dissasemble nil
   "Whether we should dissasemble an output binary."
   :type 'boolean
@@ -43,6 +44,7 @@
 (defcustom rmsbolt-command nil
   "The base command to run rmsbolt from."
   :type 'string
+  ;; nil means use default command
   :safe (lambda (v) (or (booleanp v) (stringp v)))
   :group 'rmsbolt)
 (defcustom rmsbolt-intel-x86 t
@@ -482,8 +484,8 @@ int main() {
   (let* ((lang (rmsbolt--get-lang))
  (src-buffer (current-buffer))
  (cmd rmsbolt-command))
-(when cmd
-  (setq-local rmsbolt-command cmd))
+(when (not cmd)
+  (setq-local rmsbolt-command (rmsbolt-l-compile-cmd lang)))
 (when (not (rmsbolt-l-supports-asm lang))
   (setq-local rmsbolt-dissasemble t))
 src-buffer))



[elpa] externals/beardbolt 1545531849 006/323: Add initial implementation of filter

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 15455318490511835138b40f7dfafbd5dfcf584b
Author: Jay Kamat 
Commit: Jay Kamat 

Add initial implementation of filter
---
 README.org |  9 +++
 rmsbolt.el | 80 +-
 2 files changed, 64 insertions(+), 25 deletions(-)

diff --git a/README.org b/README.org
index e041f7da80..aa72b10163 100644
--- a/README.org
+++ b/README.org
@@ -1,13 +1,14 @@
 
 * RMSbolt
 
-A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-exporter]] 
in emacs.
+A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-exporter]] 
for Emacs.
 
 * Why RMSbolt over godbolt?
 
 - No sending your code to a third party server
 - Compilation runs entirely on your machine
-- Faster results
+- Better turnaround time from writing code to seeing disassembly
 - Infinitely hackable!
-- Write your code in your preferred editing environment
-- Runs entirely with 0 js
+- Write, compile, and view dissasembly entirely in Emacs
+- Runs entirely without node, npm, or js.
+  - No dependencies other than emacs 25 and your compiler ~:)~
diff --git a/rmsbolt.el b/rmsbolt.el
index 3221f38044..dbeaacd673 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -73,12 +73,13 @@
 (defvar rmsbolt-defines-function (rx bol (0+ space) ".type"
  (0+ any) "," (0+ space) (any "@%")
  "function" eol))
-
 (defvar rmsbolt-data-defn (rx bol (0+ space) "."
   (group (or "string" "asciz" "ascii"
  (and
   (optional (any "1248")) "byte")
  "short" "word" "long" "quad" "value" 
"zero"
+(defvar rmsbolt-directive (rx bol (0+ space) "." (0+ any) eol))
+(defvar rmsbolt-endblock (rx "." (or "cfi_endproc" "data" "text" "section")))
 
  Classes
 
@@ -102,14 +103,14 @@
:documentation "The mode to activate this language in."))
 
 (defvar rmsbolt-languages
-  `((c-mode .
-,(make-rmsbolt-lang :mode 'c
-:options (make-rmsbolt-options
-  :compile-cmd "gcc -g -O0")) )
-(c++-mode .
-  ,(make-rmsbolt-lang :mode 'c++-mode
-  :options (make-rmsbolt-options
-:compile-cmd "g++ -g -O0")) )
+  `((c-mode
+ . ,(make-rmsbolt-lang :mode 'c
+   :options (make-rmsbolt-options
+ :compile-cmd "gcc -g -O0")) )
+(c++-mode
+ . ,(make-rmsbolt-lang :mode 'c++-mode
+   :options (make-rmsbolt-options
+ :compile-cmd "g++ -g -O0")) )
 ))
 
 
@@ -125,6 +126,8 @@
 
 
  Functions
+;; Functions to parse and lint assembly were lifted almost directly from the 
compiler-exporter
+
 (defun rmsbolt-re-seq (regexp string)
   "Get list of all REGEXP match in STRING."
   (save-match-data
@@ -162,7 +165,9 @@
(match-string 1 line)))
   (when match
 (setq current-label match))
-  (when (string-match-p rmsbolt-defines-global line)
+  (setq match (and (string-match rmsbolt-defines-global line)
+   (match-string 1 line)))
+  (when match
 (cl-pushnew match labels-used :test #'equal))
   ;; When we have no line or a period started line, skip
   (unless (or (= 0 (length line))
@@ -205,18 +210,51 @@
 
 (defun rmsbolt--process-asm-lines (asm-lines)
   "Process and filter a set of asm lines."
-  (when rmsbot-filter-unused-labels
-(let* ((used-labels (rmsbolt--find-used-labels asm-lines)))
-
+  (when rmsbolt-filter-unused-labels
+(let ((used-labels (rmsbolt--find-used-labels asm-lines))
+  (result nil)
+  (prev-label nil))
+  (dolist (line asm-lines)
+(let* ((raw-match (or (string-match rmsbolt-label-def line)
+  (string-match rmsbolt-assignment-def line)))
+   (match (when raw-match
+(match-string 1 line)))
+   (used-label (cl-find match used-labels :test #'equal)))
+  (cl-tagbody
+   ;; End block, reset prev-label and source
+   (when (string-match-p rmsbolt-endblock line)
+ (setq prev-label nil))
+
+   ;; continue means we don't add to the ouptut
+   (when match
+ (if (not used-label)
+ ;; Unused label
+ (when rmsbolt-filter-unused-labels
+   (go continue))
+   ;; Real label, set prev-label
+   (setq prev-label raw-match)))
+   (when (and rmsbolt-filter-asm-directives
+  (not match))
+ (if  (and (string-match-p rmsbolt-data-defn line)
+   prev-labe

[elpa] externals/beardbolt 61ccd7a73e 001/323: Initial commit

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 61ccd7a73ecf5ef6876435679e70c68fed69e4a8
Author: Jay Kamat 
Commit: Jay Kamat 

Initial commit
---
 LICENSE| 674 +
 README.org |  11 +
 rmsbolt.el |  42 
 3 files changed, 727 insertions(+)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00..9cecc1d466
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+GNU GENERAL PUBLIC LICENSE
+   Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+   TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without

[elpa] externals/beardbolt 68af010f02 064/323: Add support for haskell

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 68af010f0230747ea53657d178be58c29475
Author: Jay Kamat 
Commit: Jay Kamat 

Add support for haskell
---
 README.org  |  7 +++
 rmsbolt.el  | 25 -
 starters/rmsbolt.hs | 31 +++
 3 files changed, 62 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 6ae9085b26..78a5768049 100644
--- a/README.org
+++ b/README.org
@@ -59,6 +59,13 @@ demangling is done with rustfilt if available
 
 
[[https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif][https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif]]
 
+** Haskell
+
+demangling is done with the compiler-explorer demangler, named
+to ~haskell-demangler~.
+
+[[https://s25.postimg.cc/4d5167yr3/output-2018-08-08-23_17_59.gif][https://s25.postimg.cc/4d5167yr3/output-2018-08-08-23_17_59.gif]]
+
 ** Python
 
 Support for viewing bytecode only. Python 
[[https://bugs.python.org/issue2506][dosen't have many options]], so most
diff --git a/rmsbolt.el b/rmsbolt.el
index 6de3344d13..2a3ce2e497 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -344,13 +344,27 @@ Outputs assembly file if ASM."
  " ")))
 cmd))
 (cl-defun rmsbolt--py-compile-cmd (&key src-buffer)
-  "Process a compile command for rustc."
+  "Process a compile command for python3."
   (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer)))
 (mapconcat 'identity
(list cmd "-m" "dis" (buffer-file-name)
  ">" (rmsbolt-output-filename src-buffer))
" ")))
 
+(cl-defun rmsbolt--hs-compile-cmd (&key src-buffer)
+  "Process a compile command for ghc."
+  (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
+ (cmd (mapconcat 'identity
+ (list cmd
+   "-g"
+   (if (buffer-local-value 'rmsbolt-disassemble 
src-buffer)
+   ""
+ "-S")
+   (buffer-file-name)
+   "-o" (rmsbolt-output-filename src-buffer))
+ " ")))
+cmd))
+
 (defvar rmsbolt--hidden-func-c
   (rx bol (or (and "__" (0+ any))
   (and "_" (or "init" "start" "fini"))
@@ -435,6 +449,15 @@ Outputs assembly file if ASM."
   :compile-cmd-function #'rmsbolt--py-compile-cmd
   :disass-hidden-funcs nil
   :process-asm-custom-fn 
#'rmsbolt--process-python-bytecode))
+   (haskell-mode
+. ,(make-rmsbolt-lang :mode 'haskell-mode
+  :compile-cmd "ghc"
+  :supports-asm t
+  :supports-disass nil
+  :demangler "haskell-demangler"
+  :starter-file-name "rmsbolt.hs"
+  :compile-cmd-function #'rmsbolt--hs-compile-cmd
+  :disass-hidden-funcs nil))
))
 
  Macros
diff --git a/starters/rmsbolt.hs b/starters/rmsbolt.hs
new file mode 100644
index 00..d21c7c2152
--- /dev/null
+++ b/starters/rmsbolt.hs
@@ -0,0 +1,31 @@
+-- Haskell rmsbolt starter file
+
+-- Haskell demangler support can be gained by placing the binary
+-- generated from this folder on your path under the name
+-- 'haskell-demangler'
+-- https://github.com/mattgodbolt/compiler-explorer/tree/master/haskell
+
+-- Local Variables:
+-- rmsbolt-command: "ghc -O0"
+-- End:
+
+module Rmsbolt where
+
+import Data.Char
+
+isRMS :: Char -> Bool
+isRMS letter
+  | letter == 'R' = True
+  | letter == 'M' = True
+  | letter == 'S' = True
+  | otherwise = False
+
+main :: IO()
+main =
+  let num = Data.Char.chr 2 in
+let out = isRMS num in
+  let out_str =
+if out then
+  "True" else
+  "False" in
+putStrLn out_str



[elpa] externals/beardbolt a0527f16af 045/323: Add very basic support for common lisp

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit a0527f16afbfbb59b28e32d4efdc8ef709f927fe
Author: Jay Kamat 
Commit: Jay Kamat 

Add very basic support for common lisp
---
 rmsbolt.el| 49 -
 starters/rmsbolt.lisp | 16 
 2 files changed, 64 insertions(+), 1 deletion(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 6ed6cd4b39..0de2ad2637 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -273,6 +273,34 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   " "))
  " ")))
 cmd))
+(cl-defun rmsbolt--lisp-compile-cmd (&key src-buffer)
+  "Process a compile command for common lisp.
+
+Assumes function name to dissasemble is 'main'."
+  (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
+ (interpreter (cl-first (split-string cmd nil t)))
+ (disass-eval "\"(disassemble 'main)\"")
+ (disass-eval-unquoted "(disassemble 'main)"))
+(pcase interpreter
+  ("sbcl"
+   (mapconcat 'identity
+  (list cmd "--noinform" "--load"
+(buffer-file-name)
+"--eval" disass-eval "--non-interactive"
+;; Remove leading comments
+"|" "sed" "'s/^;\s//'" ">"
+(rmsbolt-output-filename src-buffer))
+  " "))
+  ("clisp"
+   (mapconcat 'identity
+  (list cmd "-q" "-x"
+(concat
+ "\"(load \\\"" (buffer-file-name) "\\\") " 
disass-eval-unquoted "\"")
+">" (rmsbolt-output-filename src-buffer))
+  " "))
+  (_
+   (error "This Common Lisp interpreter is not supported")
+
 (defvar rmsbolt--hidden-func-c
   (rx bol (or (and "__" (0+ any))
   (and "_" (or "init" "start" "fini"))
@@ -326,7 +354,17 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   :supports-disass t
   :starter-file-name "rmsbolt.ml"
   :compile-cmd-function #'rmsbolt--ocaml-compile-cmd
-  :disass-hidden-funcs rmsbolt--hidden-func-ocaml
+  :disass-hidden-funcs rmsbolt--hidden-func-ocaml))
+   (lisp-mode
+. ,(make-rmsbolt-lang :mode 'lisp-mode ;; Assume common lisp..
+  :compile-cmd "sbcl"
+  :supports-asm t
+  :supports-disass nil
+  :objdumper 'cat
+  :starter-file-name "rmsbolt.lisp"
+  :compile-cmd-function #'rmsbolt--lisp-compile-cmd
+  :disass-hidden-funcs nil))
+   ))
 
  Macros
 
@@ -648,6 +686,14 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
  "att")
   ">" (rmsbolt-output-filename src-buffer t))
 " ")))
+  ('cat
+   (setq cmd
+ (mapconcat 'identity
+(list cmd
+  "&&" "mv"
+  (rmsbolt-output-filename src-buffer)
+  (rmsbolt-output-filename src-buffer t))
+" ")))
   (_
(error "Objdumper not recognized"
   (setq-local rmsbolt-src-buffer src-buffer)
@@ -709,6 +755,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 (rmsbolt-defstarter "c" 'c-mode)
 (rmsbolt-defstarter "c++" 'c++-mode)
 (rmsbolt-defstarter "ocaml" 'tuareg-mode)
+(rmsbolt-defstarter "cl" 'lisp-mode)
 
  Font lock matcher
 (defun rmsbolt--goto-line (line)
diff --git a/starters/rmsbolt.lisp b/starters/rmsbolt.lisp
new file mode 100644
index 00..af964082e0
--- /dev/null
+++ b/starters/rmsbolt.lisp
@@ -0,0 +1,16 @@
+;; Common Lisp rmsbolt starter file
+
+;; rmsbolt ONLY DISASSEMBLES THE MAIN FUNCTION.
+;; Please ensure you have a main function defined,
+;; and place all your code inside of it!
+
+;; Local Variables:
+;; rmsbolt-command: "sbcl"
+;; End:
+
+(defun main ()
+  (defun add (a b)
+;; (declare (optimize (speed 3) (safety 0) (debug 0)))
+;; (declare (type fixnum a b))
+(+ a b))
+  (add 2 3))



[elpa] externals/beardbolt 5efa347027 046/323: Update readme

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 5efa3470274c75bbc47b26d2bb12ea598981b7cb
Author: Jay Kamat 
Commit: Jay Kamat 

Update readme
---
 README.org | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/README.org b/README.org
index 95db642c8e..0756bc7bc4 100644
--- a/README.org
+++ b/README.org
@@ -46,3 +46,10 @@ add it..
 ** Ocaml
 
 
[[https://u.cubeupload.com/jgkamat/PabAq2.gif][https://u.cubeupload.com/jgkamat/PabAq2.gif]]
+
+
+** Common Lisp
+
+No support for source->asm matching or filtering.
+
+[[http://u.cubeupload.com/jgkamat/1FB9k7.gif][http://u.cubeupload.com/jgkamat/1FB9k7.gif]]



[elpa] externals/beardbolt d37f8a0ebf 042/323: Remove reliance on hl-line-mode

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit d37f8a0ebf340390641a652b99c82582cfe35292
Author: Jay Kamat 
Commit: Jay Kamat 

Remove reliance on hl-line-mode
---
 rmsbolt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index f4cc254cf3..538bc7f73e 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -90,7 +90,7 @@
  Faces
 
 (defface rmsbolt-current-line-face
-  '((t (:weight bold :inherit hl-line)))
+  '((t (:weight bold :inherit highlight)))
   "Face to fontify the current line for showing matches."
   :group 'rmsbolt)
 



[elpa] externals/beardbolt 495d481a94 136/323: Move rmsbolt-command initialization to end

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 495d481a94829badbecef755891fc66531b30117
Author: Jay Kamat 
Commit: Jay Kamat 

Move rmsbolt-command initialization to end
---
 rmsbolt.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 2cbb53f38d..e5b399fa8d 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1034,18 +1034,18 @@ Argument OVERRIDE-BUFFER use this buffer instead of 
reading from the output file
  (cmd rmsbolt-command)
  (force-disass (not (rmsbolt-l-supports-asm lang)))
  (force-asm (not (rmsbolt-l-supports-disass lang
-(when (not cmd)
-  (setq-local rmsbolt-command
-  (let ((new-cmd (rmsbolt-l-compile-cmd lang)))
-(pcase new-cmd
-  ((pred functionp) (funcall new-cmd src-buffer))
-  (_ new-cmd)
 (when (and force-disass force-asm)
   (error "No disassemble method found for this langauge, please double 
check spec"))
 (when force-disass
   (setq-local rmsbolt-disassemble t))
 (when force-asm
   (setq-local rmsbolt-disassemble nil))
+(when (not cmd)
+  (setq-local rmsbolt-command
+  (let ((new-cmd (rmsbolt-l-compile-cmd lang)))
+(pcase new-cmd
+  ((pred functionp) (funcall new-cmd src-buffer))
+  (_ new-cmd)
 src-buffer))
 
 (defun rmsbolt--demangle-command (existing-cmd lang src-buffer)



[elpa] externals/beardbolt d187b8b189 125/323: Optimize guide display when many line blocks found

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit d187b8b189e70b841f7cd3aaf880a878be7e7612
Author: Jay Kamat 
Commit: Jay Kamat 

Optimize guide display when many line blocks found
---
 rmsbolt.el | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 0bc73b4f8d..ba05d2123f 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1164,10 +1164,11 @@ Argument OVERRIDE-BUFFER use this buffer instead of 
reading from the output file
 o))
 (cl-defun rmsbolt--point-visible (point)
   "Check if the current point is visible in a window in the current buffer."
-  (dolist (w (get-buffer-window-list))
-(when (pos-visible-in-window-p point w)
-  (cl-return-from rmsbolt--point-visible t)))
-  nil)
+  (when (cl-find-if (lambda (w)
+  (and (>= point (window-start w))
+   (<= point (window-end w
+(get-buffer-window-list))
+t))
 
 (defun rmsbolt-move-overlays ()
   "Function for moving overlays for rmsbolt."



[elpa] externals/beardbolt 8213e24af3 070/323: Update README

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 8213e24af33ecfdd68cab0229ecb858affb0cc41
Author: Jay Kamat 
Commit: Jay Kamat 

Update README
---
 README.org  | 21 +
 rmsbolt-java.el | 48 
 rmsbolt.el  |  2 +-
 3 files changed, 62 insertions(+), 9 deletions(-)

diff --git a/README.org b/README.org
index 369479e128..714ab6e49d 100644
--- a/README.org
+++ b/README.org
@@ -12,24 +12,29 @@ versa.
 - No more sending your code to any server
 - Much faster turnaround time from writing code to seeing and interacting with 
disassembly
 - 100% usable without the mouse.
-- Write, compile, and view dissasembly entirely in Emacs
-  - Use compile.el, flymake, or flycheck to traverse and fix errors as you
-would normally.
-  - Use any libraries on your machine trivially
 - Runs entirely without node, npm, or js.
   - No required dependencies other than emacs 25 and your compiler ~:)~
   - It's easy to add new languages (even those that use unique bytecode 
formats)
 without touching many files.
-- Full undo (tree) system from Emacs on disassembly for easy comparisons
-- Much more flexible
+- Benefits from living in Emacs
+  - Full undo tree from Emacs on disassembly/source so you don't loose work.
+  - Vim bindings through evil/viper.
+  - Use compile.el, flymake, or flycheck to traverse and fix errors as you
+would normally.
+  - Use *any* libraries on your machine trivially.
+  - Customize colors and behavior through ~customize~.
+  - Change tracking through magit/diff-hl/etc.
+- Much more flexible and powerful
   - Supports dissasembling to bytecode as well as assembly
   - Supports many languages that godbolt does not support, such as python,
-common lisp, and ocaml.
+common lisp, ocaml, and java.
+- Simpler
 - Infinitely hackable!
 
 * Installation
 
-rmsbolt will almost certainly not work on windows.
+rmsbolt will almost certainly not work naively on windows as it depends on a
+unix shell for building commands. It may work through cygwin though.
 
 rmsbolt is not on melpa yet. If you find it useful, please let me know and I 
may
 add it..
diff --git a/rmsbolt-java.el b/rmsbolt-java.el
new file mode 100644
index 00..7acf7743e6
--- /dev/null
+++ b/rmsbolt-java.el
@@ -0,0 +1,48 @@
+;;; rmsbolt-java.el --- A elisp library to parse javap output -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2018 Jay Kamat
+;; Author: Jay Kamat 
+;; Version: 0.1.0
+;; Keywords: compilation, tools
+;; URL: http://gitlab.com/jgkamat/rmsbolt
+;; Package-Requires: ((emacs "25.1"))
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU Affero General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU Affero General Public License for more details.
+
+;; You should have received a copy of the GNU Affero General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+;; The java bytecode dissasembler format is rather obtuse. This library tries
+;; to make a programatic layer for interacting with it. It's main aim is
+;; correlating lines in source code to the generated output.
+;;
+;; This library takes in the output of javap -c -l split into a list by lines,
+;; which is the same format rmsbolt uses.
+
+;;; Requires:
+
+(require 'cl-lib)
+
+;;; Code:
+
+(defun rmsbolt-java-process-bytecode (asm-lines)
+  "Process ASM-LINES to add properties refrencing the source code.
+Also filters \"useless\" lines out."
+  )
+
+(defun rmsbolt--process-java-bytecode (_src_buffer asm-lines)
+  "Wrapper for easy integration into rmsbolt."
+  (rmsbolt-java-process-bytecode asm-lines))
+
+(provide 'rmsbolt-java)
+
+;;; rmsbolt-java.el ends here
diff --git a/rmsbolt.el b/rmsbolt.el
index b6a2910019..26317820c9 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -23,7 +23,7 @@
 ;;; Commentary:
 ;; TODO create commentary
 
-;;; Constants:
+;;; Requires:
 
 (require 'cl-lib)
 (require 'subr-x)



[elpa] externals/beardbolt 77842a5f78 126/323: Add elisp support to docs

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 77842a5f78e9bbe4bf3bb209122a0e18b21db63f
Author: Jay Kamat 
Commit: Jay Kamat 

Add elisp support to docs
---
 README.org | 4 ++--
 rmsbolt.el | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 1416a64e21..f559007089 100644
--- a/README.org
+++ b/README.org
@@ -11,8 +11,8 @@ versa. It supports more types of languages than any previous 
tool of its kind.
 
 - Much more flexible and powerful:
   - Supports disassembly to bytecode as well as assembly.
-  - Supports many languages that godbolt does not support, such as python,
-common lisp, ocaml, java, and pony.
+  - Supports many languages that godbolt does not support, such as Python,
+Common Lisp, Emacs Lisp, Ocaml, Java, and Pony.
 - No more sending your code to any server.
 - Much faster turnaround time from writing code to seeing and interacting with 
disassembly.
 - 100% usable without the mouse.
diff --git a/rmsbolt.el b/rmsbolt.el
index ba05d2123f..d2b814fe08 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -25,8 +25,8 @@
 ;; RMSBolt is a package to provide assembly or bytecode output for a source
 ;; code input file.
 ;;
-;; It currently supports: C/C++, OCaml, Haskell, Python, Java, Pony, and
-;; (limited) Common Lisp.
+;; It currently supports: C/C++, OCaml, Haskell, Python, Java, Pony, Emacs 
Lisp,
+;; and (limited) Common Lisp.
 ;;
 ;; Adding support for more languages, if they have an easy manual compilation
 ;; path from source->assembly/bytecode with debug information, should be much



[elpa] externals/beardbolt cf7d2787bc 027/323: Implement line number parsing

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit cf7d2787bce4ba509325d642e31b32960a64c985
Author: Jay Kamat 
Commit: Jay Kamat 

Implement line number parsing
---
 rmsbolt.el | 76 +++---
 1 file changed, 58 insertions(+), 18 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index aca6b84313..effa8170d7 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -86,7 +86,8 @@
   (expand-file-name "rmsbolt.out" rmsbolt-temp-dir)
 (expand-file-name "rmsbolt.s" rmsbolt-temp-dir)))
 
-(defvar-local rmsbolt-dissasemble nil)
+(defvar-local rmsbolt-line-mapping nil
+  "Line mapping hashtable from source lines -> asm lines")
 
 
  Regexes
@@ -139,6 +140,14 @@
   (opt " ")))
   (0+ space)
   (group (0+ any
+(defvar rmsbolt-source-tag (rx bol (0+ space) ".loc" (1+ space)
+   (group (1+ digit)) (1+ space)
+   (group (1+ digit))
+   (0+ any)))
+(defvar rmsbolt-source-stab (rx bol (0+ any) ".stabn" (1+ space)
+(group (1+ digit)) ",0,"
+(group (1+ digit)) "," (0+ any)))
+
 
  Classes
 
@@ -200,6 +209,7 @@
"frame_dummy"
(and ".plt" (0+ any)))
eol))
+ Language Definitions
 (defvar rmsbolt-languages)
 (setq
  rmsbolt-languages
@@ -397,9 +407,7 @@ int main() {
  (push (concat "\t" (match-string 3 line)) result)
  (go continue))
continue))
-(mapconcat 'identity
-   (nreverse result)
-   "\n")))
+(nreverse result)))
 
 (cl-defun rmsbolt--process-asm-lines (src-buffer asm-lines)
   "Process and filter a set of asm lines."
@@ -407,7 +415,8 @@ int main() {
   (rmsbolt--process-dissasembled-lines src-buffer asm-lines)
 (let ((used-labels (rmsbolt--find-used-labels src-buffer asm-lines))
   (result nil)
-  (prev-label nil))
+  (prev-label nil)
+  (source-linum nil))
   (dolist (line asm-lines)
 (let* ((raw-match (or (string-match rmsbolt-label-def line)
   (string-match rmsbolt-assignment-def line)))
@@ -415,7 +424,18 @@ int main() {
 (match-string 1 line)))
(used-label (cl-find match used-labels :test #'equal)))
   (cl-tagbody
-   ;; TODO process line numbers
+   ;; Process any line number hints
+   (when (string-match rmsbolt-source-tag line)
+ (setq source-linum
+   (string-to-number
+(match-string 2 line
+   (when (string-match rmsbolt-source-stab line)
+ (pcase (string-to-number (match-string 1 line))
+   (68
+(setq source-linum (match-string 2 line)))
+   ((or 100 132)
+(setq source-linum nil
+
;; End block, reset prev-label and source
(when (string-match-p rmsbolt-endblock line)
  (setq prev-label nil))
@@ -440,11 +460,16 @@ int main() {
  nil
(when (string-match-p rmsbolt-directive line)
  (go continue
+   ;; Add line numbers to mapping
+   (when (and source-linum
+  (rmsbolt--has-opcode-p line))
+ (add-text-properties 0 (length line)
+  `(rmsbolt-src-line ,source-linum) line))
+   ;; Add line
(push line result)
+
continue)))
-  (mapconcat 'identity
- (nreverse result)
- "\n"
+  (nreverse result
 
 ; Handlers
 (defun rmsbolt--handle-finish-compile (buffer _str)
@@ -460,15 +485,30 @@ int main() {
   (cond ((not compilation-fail)
  (if (not (file-exists-p (rmsbolt-output-filename src-buffer t)))
  (message "Error reading from output file.")
-   (delete-region (point-min) (point-max))
-   (insert
-(rmsbolt--process-asm-lines
- src-buffer
- (with-temp-buffer
-   (insert-file-contents (rmsbolt-output-filename src-buffer 
t))
-   (split-string (buffer-string) "\n" t
-   (asm-mode)
-   (display-buffer (current-buffer
+   (let ((lines
+  (rmsbolt--process-asm-lines
+   src-buffer
+   (with-temp-buffer
+ (insert-file-contents (rmsbolt-output-filename 
src-buffer t))
+ (split-string (buffer-string) "\n" t
+ (ht (make-hash-table))
+ (linum 0))
+ ;; Add lines to hashtable
+ 

[elpa] externals/beardbolt f89875215b 128/323: Fix byte-compilation warnings

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit f89875215b91e7261cca0901f6a0170f96163c74
Author: Jay Kamat 
Commit: Jay Kamat 

Fix byte-compilation warnings
---
 rmsbolt.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 1822bcc96e..bd78f392d3 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -622,12 +622,14 @@ This should be an object of type `rmsbolt-lang', normally 
set by the major mode"
 (setq pos (match-end 0)))
   matches)))
 
+;; Prevent byte-compilation warnings for cl-print-compiled, which is imported
+;; from cl-print
+(defvar cl-print-compiled)
 (defun rmsbolt--disassemble-file (filename out-buffer)
   "Disassemble an elisp FILENAME into elisp bytecode in OUT-BUFFER.
 Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-bytecode-file";
   (if (not (require 'cl-print nil 'noerror))
   (error "Package cl-print or Emacs 26+ are required for the Emacs 
disassembler")
-(require 'cl-print)
 (byte-compile-file filename)
 ;; .el -> .elc
 (setq filename (concat filename "c"))



[elpa] externals/beardbolt c6831044c6 092/323: Update README

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit c6831044c6aaf5f74a12fa3dad1d050509464f01
Author: Jay Kamat 
Commit: Jay Kamat 

Update README
---
 README.org | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index dc333efdeb..260e32115f 100644
--- a/README.org
+++ b/README.org
@@ -135,8 +135,9 @@ freenode. ~:)~
 
 If you find issues, please send me a mail or submit an issue.
 
-If you would like to submit a patch, please submit a merge request. If your
-change is non-trivial, please 
[[https://www.fsf.org/licensing/assigning.html][assign copyright to the FSF]] 
as well.
+If you would like to submit a patch, please submit a merge request, or send me 
a
+mail with your patch. If your change is non-trivial, please
+[[https://www.fsf.org/licensing/assigning.html][assign copyright to the FSF]] 
as well.
 
 * Alternatives
 - [[https://github.com/yawkat/javap][yawkat/javap]]



[elpa] externals/beardbolt d126f452d2 077/323: Update README

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit d126f452d2ee4809d5c9ab2e6fe968a13225ff80
Author: Jay Kamat 
Commit: Jay Kamat 

Update README
---
 README.org | 4 ++--
 rmsbolt.el | 2 --
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/README.org b/README.org
index 23d07c70b9..8a54720f59 100644
--- a/README.org
+++ b/README.org
@@ -1,11 +1,11 @@
 * RMSbolt
 
-A basic implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-explorer]] 
for Emacs.
+An implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-explorer]] 
for Emacs.
 
 RMSBolt tries to make it easy to see what your compiler is doing. It does this
 by showing you the assembly output of a given source code file. It also
 highlights which source code a given assembly block corresponds to, and vice
-versa.
+versa. It supports more types of languages than any previous tool of it's kind.
 
 * Why RMSbolt over godbolt?
 
diff --git a/rmsbolt.el b/rmsbolt.el
index 0ef807fbfe..d01013c58f 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -22,8 +22,6 @@
 
 ;;; Commentary:
 ;; rmsbolt is a package to provide assembly or bytecode output for a source 
code input file.
-;;
-;;
 
 ;;; Requires:
 



[elpa] externals/beardbolt 4f86bae37e 144/323: Add rmsbolt-asm-format for toggling between asm formats.

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 4f86bae37e4bfd75f7506a57099c5ed89e3882f1
Author: Jay Kamat 
Commit: Jay Kamat 

Add rmsbolt-asm-format for toggling between asm formats.

nil/t use tool defaults (ie: don't specify anything)
a string is passed directly to the tool in most cases.

Usually "intel" or "att" will work, in the case of disassembly, many
more will work (see objdump(1)).

See #11
---
 README.org |  2 +-
 rmsbolt.el | 64 --
 2 files changed, 47 insertions(+), 19 deletions(-)

diff --git a/README.org b/README.org
index 8cd6a09254..4f7a658de2 100644
--- a/README.org
+++ b/README.org
@@ -85,7 +85,7 @@ Notable options:
 | ~rmsbolt-default-directory~   | determines the default-drectory to compile 
from.   
   |
 | ~rmsbolt-disassemble~ | disassemble from a compiled binary with 
objdump, if supported.  
  |
 | ~rmsbolt-filter-*~| Tweak filtering of binary output 

 |
-| ~rmsbolt-intel-x86~   | Toggle between intel and att syntax if 
supported   
   |
+| ~rmsbolt-asm-format~  | Switch between different output formats. 
Most binary formats support "att" and "intel"   
 |
 | ~rmsbolt-demangle~| Demangle the output, if supported.   

 |
 | ~rmsbolt-ignore-binary-limit~ | Ignore the binary size limit for 
disassembly. This will almost certainly cause Emacs to hang during large 
processing. |
 
diff --git a/rmsbolt.el b/rmsbolt.el
index c57d70e519..8aee85d443 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -49,7 +49,7 @@
 ;; `rmsbolt-default-directory': determines the default-drectory to compile 
from.
 ;; `rmsbolt-disassemble': disassemble from a compiled binary with objdump, if 
supported.
 ;; `rmsbolt-filter-*': Tweak filtering of binary output.
-;; `rmsbolt-intel-x86': Toggle between intel and att syntax if supported.
+;; `rmsbolt-asm-format': Choose between intel att, and other syntax if 
supported.
 ;; `rmsbolt-demangle': Demangle the output, if supported.
 ;;
 ;; For more advanced configuration (to the point where you can override almost
@@ -125,10 +125,32 @@ Some exporters (such as pony) may not work with this set."
   ;; nil means use default command
   :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
+(define-obsolete-variable-alias 'rmsbolt-intel-x86
+  'rmsbolt-asm-format "RMSBolt-0.2"
+  "Sorry about not providing a proper migration for this variable.
+Unfortunately the new options aren't a straightforward mapping.
+Most likely what you want:
+
+t -> \"intel\"
+nil -> \"att\"
+tool defaults -> nil
+
+This means that if you had rmsbolt-intel-x86 set manually, you
+are now getting tool defaults.")
+(defcustom rmsbolt-asm-format "intel"
+  "Which output assembly format to use.
+
+The supported values depend highly on the exporter, but typical
+values are: intel, att,  (for using tool defaults).
+Invalid values will be passed onto the disassembly tools, which
+may throw errors.
+
+If you are not on x86, you most likely want to set this to nil.
+
+Since this defaults to 'intel, implementers must support this
+being set (at worst falling back to nil if passed 'intel)."
+  :type 'string
+  :safe (lambda (v) (or (booleanp v) (stringp v)))
   :group 'rmsbolt)
 (defcustom rmsbolt-filter-directives t
   "Whether to filter assembly directives."
@@ -350,17 +372,20 @@ Return value is quoted for passing to the shell."
   "Process a compile command for gcc/clang."
   (rmsbolt--with-files
src-buffer
-   (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
+   (let* ((asm-format (buffer-local-value 'rmsbolt-asm-format src-buffer))
+  (disass (buffer-local-value 'rmsbolt-disassemble src-buffer))
+  (cmd (buffer-local-value 'rmsbolt-command src-buffer))
   (cmd (mapconcat #'identity
   (list cmd
 "-g"
-(if (buffer-local-value 'rmsbolt-disassemble 
src-buffer)
+(if disass
 "-c"
   "-S")
 src-filename
 "-o" output-filename
-(when (buffer-local-value 'rmsbolt-intel-x86 
src-buffer)
-  "-masm=intel"))
+(when (and (not (booleanp asm-format))
+

[elpa] externals/beardbolt e517cd4dbc 142/323: Remove unneeded disass-hidden-funcs overrides

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit e517cd4dbc0bae2e6ae02a79e19ec698800a4f1b
Author: Jay Kamat 
Commit: Jay Kamat 

Remove unneeded disass-hidden-funcs overrides
---
 rmsbolt.el | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index cf05367e59..15c94e2b95 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -599,29 +599,25 @@ https://github.com/derickr/vld";
   :supports-asm t
   :supports-disass nil
   :objdumper 'cat
-  :compile-cmd-function #'rmsbolt--lisp-compile-cmd
-  :disass-hidden-funcs nil))
+  :compile-cmd-function #'rmsbolt--lisp-compile-cmd))
(rust-mode
 . ,(make-rmsbolt-lang :compile-cmd "rustc"
   :supports-asm t
   :supports-disass nil
   :objdumper 'objdump
   :demangler "rustfilt"
-  :compile-cmd-function #'rmsbolt--rust-compile-cmd
-  :disass-hidden-funcs nil))
+  :compile-cmd-function #'rmsbolt--rust-compile-cmd))
(ponylang-mode
 . ,(make-rmsbolt-lang :compile-cmd "ponyc"
   :supports-asm t
   :supports-disass t
   :objdumper 'objdump
-  :compile-cmd-function #'rmsbolt--pony-compile-cmd
-  :disass-hidden-funcs nil))
+  :compile-cmd-function #'rmsbolt--pony-compile-cmd))
(php-mode
 . ,(make-rmsbolt-lang :compile-cmd "php"
   :supports-asm t
   :supports-disass nil
   :compile-cmd-function #'rmsbolt--php-compile-cmd
-  :disass-hidden-funcs nil
   :process-asm-custom-fn 
#'rmsbolt--process-php-bytecode))
;; ONLY SUPPORTS PYTHON 3
(python-mode
@@ -629,30 +625,26 @@ https://github.com/derickr/vld";
   :supports-asm t
   :supports-disass nil
   :compile-cmd-function #'rmsbolt--py-compile-cmd
-  :disass-hidden-funcs nil
   :process-asm-custom-fn 
#'rmsbolt--process-python-bytecode))
(haskell-mode
 . ,(make-rmsbolt-lang :compile-cmd "ghc"
   :supports-asm t
   :supports-disass nil
   :demangler "haskell-demangler"
-  :compile-cmd-function #'rmsbolt--hs-compile-cmd
-  :disass-hidden-funcs nil))
+  :compile-cmd-function #'rmsbolt--hs-compile-cmd))
(java-mode
 . ,(make-rmsbolt-lang :compile-cmd "javac"
   :supports-asm t
   :supports-disass nil
   :objdumper 'cat
   :compile-cmd-function #'rmsbolt--java-compile-cmd
-  :process-asm-custom-fn 
#'rmsbolt--process-java-bytecode
-  :disass-hidden-funcs nil))
+  :process-asm-custom-fn 
#'rmsbolt--process-java-bytecode))
(emacs-lisp-mode
 . ,(make-rmsbolt-lang :supports-asm t
   :supports-disass nil
   ;; Nop
   :process-asm-custom-fn (lambda (_src-buffer lines)
lines)
-  :disass-hidden-funcs nil
   :elisp-compile-override 
#'rmsbolt--elisp-compile-override))
))
 (make-obsolete-variable 'rmsbolt-languages



[elpa] externals/beardbolt 8fc36eacd8 044/323: Add option to force assembling

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 8fc36eacd803bcb7a0a6b513f3a1ceb6a33957c4
Author: Jay Kamat 
Commit: Jay Kamat 

Add option to force assembling
---
 rmsbolt.el | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index fb44bfc069..6ed6cd4b39 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -306,6 +306,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 . ,(make-rmsbolt-lang :mode 'c
   :compile-cmd "gcc"
   :supports-asm t
+  :supports-disass t
   :starter-file-name "rmsbolt.c"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-c))
@@ -313,6 +314,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 . ,(make-rmsbolt-lang :mode 'c++-mode
   :compile-cmd "g++"
   :supports-asm t
+  :supports-disass t
   :starter-file-name "rmsbolt.cpp"
   :compile-cmd-function #'rmsbolt--c-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-c))
@@ -321,6 +323,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 . ,(make-rmsbolt-lang :mode 'tuareg-mode
   :compile-cmd "ocamlopt"
   :supports-asm t
+  :supports-disass t
   :starter-file-name "rmsbolt.ml"
   :compile-cmd-function #'rmsbolt--ocaml-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-ocaml
@@ -603,11 +606,17 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   (hack-local-variables)
   (let* ((lang (rmsbolt--get-lang))
  (src-buffer (current-buffer))
- (cmd rmsbolt-command))
+ (cmd rmsbolt-command)
+ (force-disass (not (rmsbolt-l-supports-asm lang)))
+ (force-asm (not (rmsbolt-l-supports-disass lang
 (when (not cmd)
   (setq-local rmsbolt-command (rmsbolt-l-compile-cmd lang)))
-(when (not (rmsbolt-l-supports-asm lang))
+(when (and force-disass force-asm)
+  (error "No dissasembly method found for this langauge, please double 
check spec"))
+(when force-disass
   (setq-local rmsbolt-disassemble t))
+(when force-asm
+  (setq-local rmsbolt-disassemble nil))
 src-buffer))
 
 ; UI Functions
@@ -617,7 +626,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   (save-some-buffers nil (lambda () rmsbolt-mode))
   (if (eq major-mode 'asm-mode)
   ;; We cannot compile asm-mode files
-  (message "Cannot compile this file. Are you sure you are not in the 
output buffer?")
+  (message "Cannot compile assembly files. Are you sure you are not in the 
output buffer?")
 (rmsbolt--parse-options)
 (let* ((src-buffer (current-buffer))
(lang (rmsbolt--get-lang))



[elpa] externals/beardbolt 6239f41d9d 033/323: Add a goto-match feature for easily traversing matches

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 6239f41d9d9ca666561e0cb2c6e045a14ec5036d
Author: Jay Kamat 
Commit: Jay Kamat 

Add a goto-match feature for easily traversing matches
---
 rmsbolt.el | 61 -
 1 file changed, 48 insertions(+), 13 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 4a227cf105..ca7ba5173a 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -38,7 +38,10 @@
 (defcustom rmsbolt-use-overlays t
   "Whether we should use overlays to show matching code."
   :type 'boolean
-  :safe 'booleanp
+  :group 'rmsbolt)
+(defcustom rmsbolt-goto-match t
+  "Whether we should goto the match in the other buffer if it is non visible."
+  :type 'boolean
   :group 'rmsbolt)
 
 ; Buffer Local Tweakables
@@ -96,8 +99,11 @@
 (defvar rmsbolt-mode)
 
 (defvar rmsbolt-hide-compile t)
-(defvar rmsbolt-binary-asm-limit 5000)
+(defvar rmsbolt-binary-asm-limit 1)
 (defun rmsbolt-output-filename (src-buffer &optional asm)
+  "Function for generating an output filename for SRC-BUFFER.
+
+Outputs assembly file if ASM."
   (if (and (not asm)
(buffer-local-value 'rmsbolt-dissasemble src-buffer))
   (expand-file-name "rmsbolt.out" rmsbolt-temp-dir)
@@ -265,6 +271,13 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
"frame_dummy"
(and ".plt" (0+ any)))
eol))
+(defvar rmsbolt--hidden-func-ocaml)
+(setq rmsbolt--hidden-func-ocaml (rx bol
+ (or
+  (and "camlCamlinternalFormat__" (0+ any))
+  ;; (0+ any)
+  )
+ eol))
  Language Definitions
 (defvar rmsbolt-languages)
 (setq
@@ -290,7 +303,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   :supports-asm t
   :starter-file-name "rmsbolt.ml"
   :compile-cmd-function #'rmsbolt--ocaml-compile-cmd
-  :dissas-hidden-funcs rmsbolt--hidden-func-c
+  :dissas-hidden-funcs rmsbolt--hidden-func-ocaml
 
  Macros
 
@@ -637,18 +650,25 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
  Font lock matcher
 (defun rmsbolt--goto-line (line)
   "Goto a certain LINE."
-  (let ((cur (line-number-at-pos)))
-(forward-line (- line cur
+  (when line
+(let ((cur (line-number-at-pos)))
+  (forward-line (- line cur)
 (defun rmsbolt--setup-overlay (start end buf)
   "Setup overlay with START and END in BUF."
   (let ((o (make-overlay start end buf)))
 (overlay-put o 'face 'rmsbolt-current-line-face)
 o))
+(cl-defun rmsbolt--point-visible (point)
+  "Check if the current point is visible in a winodw in the current buffer."
+  (dolist (w (get-buffer-window-list))
+(when (pos-visible-in-window-p point w)
+  (cl-return-from rmsbolt--point-visible t)))
+  nil)
 
 (defun rmsbolt-move-overlays ()
   "Function for moving overlays for rmsbolt."
 
-  (if-let* ((src-buffer
+  (if-let* ((should-run
  (and rmsbolt-mode rmsbolt-use-overlays))
 (src-buffer
  (buffer-local-value 'rmsbolt-src-buffer (current-buffer)))
@@ -666,17 +686,37 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
(save-excursion
  (rmsbolt--goto-line src-current-line)
  (values (c-point 'bol) (c-point 'eol))
-  (progn
+  (let ((line-visible (not rmsbolt-goto-match))
+(src-buffer-selected (eq (current-buffer) src-buffer)))
 (mapc #'delete-overlay rmsbolt-overlays)
 (setq rmsbolt-overlays nil)
 (push (rmsbolt--setup-overlay (first src-pts) (second src-pts) 
src-buffer)
   rmsbolt-overlays)
+(unless src-buffer-selected
+  (with-current-buffer src-buffer
+(setq line-visible (rmsbolt--point-visible (first src-pts)
 (with-current-buffer output-buffer
   (save-excursion
 (dolist (l asm-lines)
   (rmsbolt--goto-line l)
+  ;; check if line is visible and set line-visible
+  (unless (or line-visible (not src-buffer-selected))
+(setq line-visible (rmsbolt--point-visible (c-point 'bol
+
   (push (rmsbolt--setup-overlay (c-point 'bol) (c-point 'eol) 
output-buffer)
-rmsbolt-overlays)
+rmsbolt-overlays)))
+  (unless line-visible
+;; Scroll buffer to first line
+(when-let
+((scroll-buffer (if src-buffer-selected
+output-buffer
+  src-buffer))
+ (line-scroll (if src-buffer-selected
+  (first asm-li

[elpa] externals/beardbolt f0be36f4b5 063/323: Update link

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit f0be36f4b52eca992e999a2becc779b694389b18
Author: Jay Kamat 
Commit: Jay Kamat 

Update link
---
 README.org | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.org b/README.org
index c1187c23a7..6ae9085b26 100644
--- a/README.org
+++ b/README.org
@@ -61,9 +61,9 @@ demangling is done with rustfilt if available
 
 ** Python
 
-Support for bytecode viewing. Python dosen't have many options, so most
-tweakables will not work. Python 3.7 is required for recursion into functions.
-Python 2 is unsupported.
+Support for viewing bytecode only. Python 
[[https://bugs.python.org/issue2506][dosen't have many options]], so most
+tweakables will not work. Python 3.7 is required for recursion into functions,
+otherwise only top level code will be shown. Python 2 is unsupported.
 
 
[[https://s25.postimg.cc/594qd9o4v/output-2018-08-04-18_07_45.gif][https://s25.postimg.cc/594qd9o4v/output-2018-08-04-18_07_45.gif]]
 



[elpa] externals/beardbolt 27e7bb714f 139/323: Add suppport for PHP

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 27e7bb714f83c301820dbd915eeea5c0070a6924
Author: Antoine Brand 
Commit: Antoine Brand 

Add suppport for PHP
---
 rmsbolt.el | 41 +
 1 file changed, 41 insertions(+)

diff --git a/rmsbolt.el b/rmsbolt.el
index adc8cc78b0..36acab6ba0 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -483,6 +483,14 @@ Return value is quoted for passing to the shell."
   ">" output-filename)
 " "
 
+(cl-defun rmsbolt--php-compile-cmd (&key src-buffer)
+  "Process a compile command for PHP it needs to have the vld.so module on."
+  (rmsbolt--with-files
+   src-buffer
+   (concat (buffer-local-value 'rmsbolt-command src-buffer)
+   " -dvld.active=1 -dvld.execute=0 -dvld.verbosity=1 "
+   src-filename " 2> " output-filename " > /dev/null")))
+
 (cl-defun rmsbolt--hs-compile-cmd (&key src-buffer)
   "Process a compile command for ghc."
   (rmsbolt--with-files
@@ -601,6 +609,13 @@ Return value is quoted for passing to the shell."
   :objdumper 'objdump
   :compile-cmd-function #'rmsbolt--pony-compile-cmd
   :disass-hidden-funcs nil))
+   (php-mode
+. ,(make-rmsbolt-lang :compile-cmd "php"
+  :supports-asm t
+  :supports-disass nil
+  :compile-cmd-function #'rmsbolt--php-compile-cmd
+  :disass-hidden-funcs nil
+  :process-asm-custom-fn 
#'rmsbolt--process-php-bytecode))
;; ONLY SUPPORTS PYTHON 3
(python-mode
 . ,(make-rmsbolt-lang :compile-cmd "python3"
@@ -896,6 +911,32 @@ Argument SRC-BUFFER source buffer."
   (push line result
 (nreverse result)))
 
+(cl-defun rmsbolt--process-php-bytecode (_src-buffer asm-lines)
+  (let ((source-linum nil)
+(state 'useless)
+(current-line nil)
+(result nil))
+(dolist (line asm-lines)
+  (case state
+((text)
+ (push line result)
+ (when (string-match "^-+$" line)
+   (setq state 'asm)))
+((asm)
+ (cond
+  ((equalp "" line) (setq state 'useless) (push "" result))
+  ((string-match "^ *\\([0-9]+\\) +[0-9]+" line)
+   (setq current-line (string-to-number (match-string 1 line)))
+   (add-text-properties 0 (length line) `(rmsbolt-src-line 
,current-line) line)
+   (push line result))
+  (t
+   (add-text-properties 0 (length line) `(rmsbolt-src-line 
,current-line) line)
+   (push line result
+(otherwise
+ (when (string-match "^filename:" line)
+   (setq state 'text)
+(nreverse result)))
+
 (cl-defun rmsbolt--process-python-bytecode (_src-buffer asm-lines)
   (let ((source-linum nil)
 (result nil))



[elpa] externals/beardbolt 545a366472 049/323: Add more tests

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 545a36647274200b4bb7855c4b8aa5fdd15857b1
Author: Jay Kamat 
Commit: Jay Kamat 

Add more tests
---
 test/rmsbolt-c-post4.s |   28 ++
 test/rmsbolt-c-pre2.s  | 1005 
 test/rmsbolt-test.el   |8 +
 3 files changed, 1041 insertions(+)

diff --git a/test/rmsbolt-c-post4.s b/test/rmsbolt-c-post4.s
new file mode 100644
index 00..6ea4cb2e43
--- /dev/null
+++ b/test/rmsbolt-c-post4.s
@@ -0,0 +1,28 @@
+isRMS:
+   sub edi, 77
+   mov eax, 200
+   cmp edi, 6
+   ja  .L1
+   lea rax, CSWTCH.1[rip]
+   mov eax, DWORD PTR [rax+rdi*4]
+.L1:
+   rep ret
+.LC0:
+   .string "%c\n"
+main:
+   lea rdi, .LC0[rip]
+   sub rsp, 8
+   mov esi, 2
+   xor eax, eax
+   callprintf@PLT
+   xor eax, eax
+   add rsp, 8
+   ret
+CSWTCH.1:
+   .long   2
+   .long   200
+   .long   200
+   .long   200
+   .long   200
+   .long   1
+   .long   3
diff --git a/test/rmsbolt-c-pre2.s b/test/rmsbolt-c-pre2.s
new file mode 100644
index 00..d52f23a412
--- /dev/null
+++ b/test/rmsbolt-c-pre2.s
@@ -0,0 +1,1005 @@
+   .file   "rmsbolt.c"
+   .intel_syntax noprefix
+   .text
+.Ltext0:
+   .p2align 4,,15
+   .globl  isRMS
+   .type   isRMS, @function
+isRMS:
+.LFB11:
+   .file 1 "/tmp/rmsbolt-LsubiK/rmsbolt.c"
+   .loc 1 11 0
+   .cfi_startproc
+.LVL0:
+   sub edi, 77
+.LVL1:
+   .loc 1 12 0
+   mov eax, 200
+   cmp edi, 6
+   ja  .L1
+   lea rax, CSWTCH.1[rip]
+   mov eax, DWORD PTR [rax+rdi*4]
+.L1:
+   .loc 1 22 0
+   rep ret
+   .cfi_endproc
+.LFE11:
+   .size   isRMS, .-isRMS
+   .section.rodata.str1.1,"aMS",@progbits,1
+.LC0:
+   .string "%c\n"
+   .section.text.startup,"ax",@progbits
+   .p2align 4,,15
+   .globl  main
+   .type   main, @function
+main:
+.LFB12:
+   .loc 1 24 0
+   .cfi_startproc
+.LVL2:
+   .loc 1 27 0
+   lea rdi, .LC0[rip]
+   .loc 1 24 0
+   sub rsp, 8
+   .cfi_def_cfa_offset 16
+   .loc 1 27 0
+   mov esi, 2
+   xor eax, eax
+   callprintf@PLT
+.LVL3:
+   .loc 1 28 0
+   xor eax, eax
+   add rsp, 8
+   .cfi_def_cfa_offset 8
+   ret
+   .cfi_endproc
+.LFE12:
+   .size   main, .-main
+   .section.rodata
+   .align 16
+   .type   CSWTCH.1, @object
+   .size   CSWTCH.1, 28
+CSWTCH.1:
+   .long   2
+   .long   200
+   .long   200
+   .long   200
+   .long   200
+   .long   1
+   .long   3
+   .text
+.Letext0:
+   .file 2 "/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h"
+   .file 3 "/usr/include/x86_64-linux-gnu/bits/types.h"
+   .file 4 "/usr/include/libio.h"
+   .file 5 "/usr/include/stdio.h"
+   .file 6 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h"
+   .section.debug_info,"",@progbits
+.Ldebug_info0:
+   .long   0x393
+   .value  0x4
+   .long   .Ldebug_abbrev0
+   .byte   0x8
+   .uleb128 0x1
+   .long   .LASF54
+   .byte   0xc
+   .long   .LASF55
+   .long   .LASF56
+   .long   .Ldebug_ranges0+0
+   .quad   0
+   .long   .Ldebug_line0
+   .uleb128 0x2
+   .long   .LASF7
+   .byte   0x2
+   .byte   0xd8
+   .long   0x34
+   .uleb128 0x3
+   .byte   0x8
+   .byte   0x7
+   .long   .LASF0
+   .uleb128 0x3
+   .byte   0x1
+   .byte   0x8
+   .long   .LASF1
+   .uleb128 0x3
+   .byte   0x2
+   .byte   0x7
+   .long   .LASF2
+   .uleb128 0x3
+   .byte   0x4
+   .byte   0x7
+   .long   .LASF3
+   .uleb128 0x3
+   .byte   0x1
+   .byte   0x6
+   .long   .LASF4
+   .uleb128 0x3
+   .byte   0x2
+   .byte   0x5
+   .long   .LASF5
+   .uleb128 0x4
+   .byte   0x4
+   .byte   0x5
+   .string "int"
+   .uleb128 0x3
+   .byte   0x8
+   .byte   0x5
+   .long   .LASF6
+   .uleb128 0x2
+   .long   .LASF8
+   .byte   0x3
+   .byte   0x83
+   .long   0x65
+   .uleb128 0x2
+   .long   .LASF9
+   .byte   0x3
+   .byte   0x84
+   .long   0x65
+   .uleb128 0x3
+   .byte   0x8
+   .byte   0x7
+   .long   .LASF10
+   .uleb128 0x5
+   .byte   0x8
+   .uleb128 0x6
+   .byte   0x8
+   .long   0x91
+   .uleb128 0x3
+   .byte   0x1
+   .byte   0x6
+   .long   .LASF11
+   .uleb128 0x7
+   .long   0x91
+   .uleb128 0x8
+   .long   .LASF41
+   .byte   0xd8
+   .byte   0x4
+   .byte   0xf1
+   .long   0x21a
+   .uleb128 0x9
+   .long   .LASF12
+   .byte   0x4
+   .byte   0xf2
+   .long   0x5e
+   .byte   0
+   .uleb128 0x9
+   .long   .

[elpa] externals/beardbolt 0e0d82d774 056/323: Override default directory to prevent rouge executables

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 0e0d82d774bc1647ea1ee95239cd4f9899c24e0d
Author: Jay Kamat 
Commit: Jay Kamat 

Override default directory to prevent rouge executables
---
 rmsbolt.el  |  6 +-
 starters/rmsbolt.rs | 34 +++---
 2 files changed, 16 insertions(+), 24 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index d4182dc3a2..4486e3ecf5 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -739,13 +739,15 @@ Outputs assembly file if ASM."
   ;; We cannot compile asm-mode files
   (message "Cannot compile assembly files. Are you sure you are not in the 
output buffer?")
 (rmsbolt--parse-options)
+(rmsbolt--gen-temp)
 (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))
;; Convert to demangle if we need to
-   (cmd (rmsbolt--demangle-command cmd lang src-buffer)))
+   (cmd (rmsbolt--demangle-command cmd lang src-buffer))
+   (default-directory rmsbolt-temp-dir))
 
   (when (buffer-local-value 'rmsbolt-disassemble src-buffer)
 (pcase
@@ -858,6 +860,8 @@ Outputs assembly file if ASM."
 (if-let* ((should-run rmsbolt-use-overlays)
   (src-buffer
(buffer-local-value 'rmsbolt-src-buffer (current-buffer)))
+  ;; Don't run on unsaved buffers
+  (should-run (not (buffer-modified-p src-buffer)))
   (output-buffer (get-buffer-create rmsbolt-output-buffer))
   (current-line (line-number-at-pos))
   (src-current-line
diff --git a/starters/rmsbolt.rs b/starters/rmsbolt.rs
index 80e90ed5b5..23c7bfed24 100644
--- a/starters/rmsbolt.rs
+++ b/starters/rmsbolt.rs
@@ -6,30 +6,18 @@
 // End:
 
 
-fn main() {
-let number = 13;
-// TODO ^ Try different values for `number`
-
-println!("Tell me about {}", number);
-match number {
-// Match a single value
-1 => println!("One!"),
-// Match several values
-2 | 3 | 5 | 7 | 11 => println!("This is a prime"),
-// Match an inclusive range
-13...19 => println!("A teen"),
-// Handle the rest of cases
-_ => println!("Ain't special"),
+fn is_rms(a: char) -> i32 {
+match a {
+'R' => 1,
+'M' => 2,
+'S' => 3,
+_ => 0,
 }
+}
 
-let boolean = true;
-// Match is an expression too
-let binary = match boolean {
-// The arms of a match must cover all the possible values
-false => 0,
-true => 1,
-// TODO ^ Try commenting out one of these arms
+fn main() {
+let a: u8 = 1 + 1;
+if is_rms(a as char) != 0 {
+println!("{}", a);
 };
-
-println!("{} -> {}", boolean, binary);
 }



[elpa] externals/beardbolt 22810d69a7 062/323: Add docs for python

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 22810d69a7128668e8bdb66542e50c2a25c1ad2c
Author: Jay Kamat 
Commit: Jay Kamat 

Add docs for python
---
 README.org  | 13 +
 rmsbolt.el  |  6 --
 starters/rmsbolt.py | 16 
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 63206249c6..c1187c23a7 100644
--- a/README.org
+++ b/README.org
@@ -38,6 +38,11 @@ add it..
 :repo "jgkamat/rmsbolt"))
 #+END_SRC
 
+* Running
+ Once installed, use the ~rmsbolt-lang~ functions to generate starter files, or
+ enable ~rmsbolt-mode~ in a supported language. Then run ~rmsbolt-compile~ or
+ use the default ~C-c C-c~ binding.
+
 * Demo
 
 ** C/C++
@@ -54,6 +59,14 @@ demangling is done with rustfilt if available
 
 
[[https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif][https://s25.postimg.cc/h7npjnnun/output-2018-08-01-19_30_52.gif]]
 
+** Python
+
+Support for bytecode viewing. Python dosen't have many options, so most
+tweakables will not work. Python 3.7 is required for recursion into functions.
+Python 2 is unsupported.
+
+[[https://s25.postimg.cc/594qd9o4v/output-2018-08-04-18_07_45.gif][https://s25.postimg.cc/594qd9o4v/output-2018-08-04-18_07_45.gif]]
+
 ** Common Lisp
 
 No support for source->asm matching or filtering.
diff --git a/rmsbolt.el b/rmsbolt.el
index c3db0cce83..6de3344d13 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -896,7 +896,8 @@ Outputs assembly file if ASM."
  (src-file-name
   (when rmsbolt-dir
 (expand-file-name (rmsbolt-l-starter-file-name lang-def) (concat 
rmsbolt-dir "starters/"
- (src-file-exists (file-exists-p src-file-name)))
+ (src-file-exists (when src-file-name
+(file-exists-p src-file-name
 (if (not src-file-exists)
 (error "Could not find starter files! Are you sure the starter/ folder 
is available?")
   (find-file file-name)
@@ -916,7 +917,8 @@ Outputs assembly file if ASM."
 (rmsbolt-defstarter "c++" 'c++-mode)
 (rmsbolt-defstarter "ocaml" 'tuareg-mode)
 (rmsbolt-defstarter "cl" 'lisp-mode)
-(rmsbolt-defstarter "rust" 'rust-mode)
+(rmsbolt-defstarter "rust " 'rust-mode)
+(rmsbolt-defstarter "python" 'python-mode)
 
  Font lock matcher
 (defun rmsbolt--goto-line (line)
diff --git a/starters/rmsbolt.py b/starters/rmsbolt.py
new file mode 100644
index 00..7e7444f36c
--- /dev/null
+++ b/starters/rmsbolt.py
@@ -0,0 +1,16 @@
+# python rmsbolt starter file
+#
+# Local Variables:
+# rmsbolt-command: "python3"
+# End:
+
+RMS_MAP = {
+'R': 3,
+'M': 3,
+'S': 3
+}
+
+def isRMS(char):
+return 3
+
+print(isRMS('R'))



[elpa] externals/beardbolt 8ad27e8490 176/323: Added basic documentation for Go support

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 8ad27e849079606d5a0a4b70f8bc8e5d5ddcff99
Author: Matt Curtis 
Commit: Matt Curtis 

Added basic documentation for Go support
---
 doc/rmsbolt.org  | 4 
 doc/rmsbolt.texi | 9 -
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/rmsbolt.org b/doc/rmsbolt.org
index 0dd8963fe4..197db8e28f 100644
--- a/doc/rmsbolt.org
+++ b/doc/rmsbolt.org
@@ -186,6 +186,10 @@ file:
   }
 #+END_SRC
 
+** Go
+
+Uses Go's objdump tool to produce viewing-only bytecode. Go must be on the 
path.
+
 * Integrations
 This section covers integrations that RMSbolt provides, which make it easier to
 use RMSbolt with complex projects with many dependencies.
diff --git a/doc/rmsbolt.texi b/doc/rmsbolt.texi
index 9727b03396..2767b2dd38 100644
--- a/doc/rmsbolt.texi
+++ b/doc/rmsbolt.texi
@@ -57,6 +57,7 @@ Languages
 * Emacs Lisp::
 * Common Lisp::
 * Zig::
+* Go::
 
 Integrations
 
@@ -206,6 +207,7 @@ This section covers languages-specific quirks and features.
 * Emacs Lisp::
 * Common Lisp::
 * Zig::
+* Go::
 @end menu
 
 @node C/C++
@@ -301,6 +303,11 @@ pub fn panic(msg: []const u8, error_return_trace: 
?*@@import("builtin").StackTra
 @}
 @end example
 
+@node Go
+@section Go
+
+Uses Go's objdump tool to produce viewing-only bytecode. Go must be on the 
path.
+
 @node Integrations
 @chapter Integrations
 
@@ -415,4 +422,4 @@ disassembly point of view.
 You're done!
 
 @c Emacs 25.2.2 (Org mode 8.2.10)
-@bye
\ No newline at end of file
+@bye



[elpa] externals/beardbolt e1e69080b7 303/323: Rename "output buffer" -> "asm buffer"

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit e1e69080b7c06da38034143d230f6c51f6f2e53f
Author: João Távora 
Commit: João Távora 

Rename "output buffer" -> "asm buffer"

* beardbolt.el (bb--asm-buffer): Rename from bb--output-buffer
(bb--handle-finish-compile): use bb--asm-buffer
(bb--on-kill-source-buffer): use bb--asm-buffer
(bb--asm-mode): Rename from bb--asm-mode
(bb--asm-buffer-pch): Rename from bb--output-buffer-pch
---
 beardbolt.el | 26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/beardbolt.el b/beardbolt.el
index 8113be7eaa..07dac06acf 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -100,7 +100,7 @@ Passed directly to compiler or disassembler."
   :group 'beardbolt)
 
  Basic model
-(defvar-local bb--output-buffer nil)
+(defvar-local bb--asm-buffer nil)
 (defvar-local bb--source-buffer nil)
 (defvar-local bb--compile-spec nil)
 (defvar-local bb--declared-output nil)
@@ -108,13 +108,15 @@ Passed directly to compiler or disassembler."
 (defvar-local bb--line-mappings nil "Maps asm regions -> source lines")
 (defvar-local bb--rainbow-overlays nil "Rainbow overlays.")
 
-(defun bb--output-buffer (src-buffer)
+(defun bb--asm-buffer (src-buffer)
   "Get/create output buffer for current source file."
   (with-current-buffer src-buffer
-(or (and (buffer-live-p bb--output-buffer) bb--output-buffer)
-(setq bb--output-buffer
+(or (and (buffer-live-p bb--asm-buffer)
+ (equal (buffer-name bb--asm-buffer) "*bb-asm*")
+ bb--asm-buffer)
+(setq bb--asm-buffer
   (with-current-buffer
-  (generate-new-buffer (format "*bb-output for %s*" 
src-buffer))
+  (get-buffer-create "*bb-asm*")
 (current-buffer))
 
 (defvar bb-hide-compile t)
@@ -509,10 +511,10 @@ Argument STR compilation finish status."
   (let* ((src-buffer bb--source-buffer)
  (compile-spec bb--compile-spec)
  (declared-output bb--declared-output)
- (output-buffer (bb--output-buffer src-buffer))
+ (output-buffer (bb--asm-buffer src-buffer))
  (split-width-threshold (min split-width-threshold 100)))
 (with-current-buffer output-buffer
-  (bb--output-mode)
+  (bb--asm-mode)
   (setq bb--source-buffer src-buffer)
   (let* ((inhibit-modification-hooks t)
  (inhibit-read-only t))
@@ -672,13 +674,13 @@ With prefix argument, choose from starter files in 
`bb-starter-files'."
   (bb--synch-relation-overlays))
 
 (defun bb--on-kill-source-buffer ()
-  (bb--when-live-buffer bb--output-buffer
-(kill-buffer bb--output-buffer)))
+  (bb--when-live-buffer bb--asm-buffer
+(kill-buffer bb--asm-buffer)))
 
 (defun bb--on-kill-output-buffer ()
   (bb--delete-rainbow-overlays))
 
-(defun bb--output-buffer-pch ()
+(defun bb--asm-buffer-pch ()
   (bb--synch-relation-overlays))
 
 (defvar bb--change-timer nil)
@@ -725,10 +727,10 @@ 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-derived-mode bb--output-mode asm-mode "⚡output⚡"
+(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 'post-command-hook #'bb--output-buffer-pch nil t)
+  (add-hook 'post-command-hook #'bb--asm-buffer-pch nil t)
   (setq truncate-lines t)
   (read-only-mode t)
   (buffer-disable-undo)



[elpa] externals/beardbolt cd424d2556 087/323: Fix broken disassemble spelling

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit cd424d25568f151416f60ad79d3ef015d83943f4
Author: Jay Kamat 
Commit: Jay Kamat 

Fix broken disassemble spelling
---
 rmsbolt.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index fbb1cf02cb..4760413ec9 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -42,7 +42,7 @@
 ;;
 ;; Notable options:
 ;; `rmsbolt-command': determines the prefix of the compilation command to use
-;; `rmsbolt-dissasemble': dissasemble from a compiled binary with objdump, if 
supported.
+;; `rmsbolt-disassemble': disassemble from a compiled binary with objdump, if 
supported.
 ;; `rmsbolt-filter-*': Tweak filtering of binary output
 ;; `rmsbolt-intel-x86': Toggle between intel and att syntax if supported
 ;; `rmsbolt-demangle': Demangle the output, if supported.
@@ -341,7 +341,7 @@ Outputs assembly file if ASM."
 (cl-defun rmsbolt--lisp-compile-cmd (&key src-buffer)
   "Process a compile command for common lisp.
 
-   Assumes function name to dissasemble is 'main'."
+   Assumes function name to disassemble is 'main'."
   (let* ((cmd (buffer-local-value 'rmsbolt-command src-buffer))
  (interpreter (cl-first (split-string cmd nil t)))
  (disass-eval "\"(disassemble 'main)\"")
@@ -894,7 +894,7 @@ Argument STR compilation finish status."
 (when (not cmd)
   (setq-local rmsbolt-command (rmsbolt-l-compile-cmd lang)))
 (when (and force-disass force-asm)
-  (error "No dissasembly method found for this langauge, please double 
check spec"))
+  (error "No disassemble method found for this langauge, please double 
check spec"))
 (when force-disass
   (setq-local rmsbolt-disassemble t))
 (when force-asm



[elpa] externals/beardbolt 032b3d8eef 107/323: Add melpa badge

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 032b3d8eef453876e01109a700ec77489a704797
Author: Jay Kamat 
Commit: Jay Kamat 

Add melpa badge
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index aa1518cd76..537b0adc3b 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-* [[https://gitlab.com/jgkamat/rmsbolt][RMSbolt]]
+* [[https://gitlab.com/jgkamat/rmsbolt][RMSbolt]] 
[[http://melpa.org/#/rmsbolt][file:http://melpa.org/packages/rmsbolt-badge.svg]]
 
 A supercharged implementation of the 
[[https://github.com/mattgodbolt/compiler-explorer][godbolt compiler-explorer]] 
for Emacs.
 



[elpa] externals/beardbolt 01f7664eda 060/323: Fix tests

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 01f7664edae76195e7251884739b2b62ea554301
Author: Jay Kamat 
Commit: Jay Kamat 

Fix tests
---
 rmsbolt.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index f1fb2b288c..ca507f3dcc 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -585,7 +585,8 @@ Outputs assembly file if ASM."
   "Process and filter a set of asm lines."
   (let* ((lang (with-current-buffer src-buffer
  (rmsbolt--get-lang)))
- (process-asm-fn (rmsbolt-l-process-asm-custom-fn lang)))
+ (process-asm-fn (when lang
+   (rmsbolt-l-process-asm-custom-fn lang
 (cond
  (process-asm-fn
   (funcall process-asm-fn src-buffer asm-lines))



[elpa] externals/beardbolt ea3e0e4257 200/323: Fix incorrect matching of filenames for compile_commands.json

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit ea3e0e4257f653df404bb0d4300f7e8e55f97e17
Author: Jay Kamat 
Commit: Jay Kamat 

Fix incorrect matching of filenames for compile_commands.json
---
 rmsbolt.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 328681852d..f15dd8a6d3 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -775,13 +775,13 @@ toolchain."
   (when-let ((json-object-type 'alist)
  (json-array-type 'vector)
  (cmds (json-read-file comp-cmds))
- (stripped-file (file-name-nondirectory file))
  (entry (cl-find-if
  (lambda (elt)
-   (string=
-stripped-file
-(file-name-nondirectory
- (alist-get 'file elt ""
+   (file-equal-p
+file
+(expand-file-name
+ (alist-get 'file elt "")
+ (alist-get 'directory elt ""
  cmds))
  (dir (alist-get 'directory entry))
  (cmd (alist-get 'command entry)))



[elpa] externals/beardbolt 4213316f23 037/323: Fix recentering when not needed

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 4213316f23f619adea3034046f5694db66fc5ff2
Author: Jay Kamat 
Commit: Jay Kamat 

Fix recentering when not needed
---
 rmsbolt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index a8fb8fb8c7..df8ffdb4fd 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -747,7 +747,7 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
   (and (> saved-pt start-pt)
(< saved-pt end-pt)
 ;; check if line is visible and set line-visible
-(unless (or visible (not src-buffer-selected))
+(unless (or line-visible (not src-buffer-selected))
   (setq line-visible visible))
 (push (rmsbolt--setup-overlay start-pt end-pt 
output-buffer)
   rmsbolt-overlays)



[elpa] externals/beardbolt d7acfdd127 041/323: Fix rmsbolt temp directory generation being too late

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit d7acfdd12736070c0033b58474fc059342c0a81c
Author: Jay Kamat 
Commit: Jay Kamat 

Fix rmsbolt temp directory generation being too late
---
 rmsbolt.el | 27 +++
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index b143deeedc..f4cc254cf3 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -653,9 +653,23 @@ Needed as ocaml cannot output asm to a non-hardcoded file"
 
  Init commands
 
+(defun rmsbolt--gen-temp ()
+  "Generate rmsbolt temp dir if needed."
+  (unless (and rmsbolt-temp-dir
+   (file-exists-p rmsbolt-temp-dir))
+(setq rmsbolt-temp-dir
+  (make-temp-file "rmsbolt-" t))
+(add-hook 'kill-emacs-hook
+  (lambda ()
+(when (and (boundp 'rmsbolt-temp-dir)
+   rmsbolt-temp-dir
+   (file-directory-p rmsbolt-temp-dir))
+  (delete-directory rmsbolt-temp-dir t))
+(setq rmsbolt-temp-dir nil)
 
 (defun rmsbolt-starter (lang-mode)
   "Code for fully setting up a language from LANG-MODE."
+  (rmsbolt--gen-temp)
   (let* ((lang-def (rmsbolt--get-lang lang-mode))
  (file-name
   (expand-file-name (rmsbolt-l-starter-file-name lang-def) 
rmsbolt-temp-dir))
@@ -787,18 +801,7 @@ This mode is enabled both in modes to be compiled and 
output buffers."
 (setq rmsbolt--idle-timer (run-with-idle-timer
rmsbolt-overlay-delay t
#'rmsbolt-move-overlays)))
-
-  (unless (and rmsbolt-temp-dir
-   (file-exists-p rmsbolt-temp-dir))
-(setq rmsbolt-temp-dir
-  (make-temp-file "rmsbolt-" t))
-(add-hook 'kill-emacs-hook
-  (lambda ()
-(when (and (boundp 'rmsbolt-temp-dir)
-   rmsbolt-temp-dir
-   (file-directory-p rmsbolt-temp-dir))
-  (delete-directory rmsbolt-temp-dir t))
-(setq rmsbolt-temp-dir nil)
+  (rmsbolt--gen-temp))
 
 (provide 'rmsbolt)
 



[elpa] externals/beardbolt 26fc524912 083/323: Fix usage of if-let*

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 26fc52491246f6c18f702b8a9780efa4eabe2cc1
Author: Jay Kamat 
Commit: Jay Kamat 

Fix usage of if-let*
---
 rmsbolt.el | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index ce9997eb9c..59d92e8fd5 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1015,25 +1015,25 @@ Argument BUFFER compilation buffer."
 (defun rmsbolt-move-overlays ()
   "Function for moving overlays for rmsbolt."
   (when rmsbolt-mode
-(if-let* ((should-run rmsbolt-use-overlays)
-  (src-buffer
-   (buffer-local-value 'rmsbolt-src-buffer (current-buffer)))
-  ;; Don't run on unsaved buffers
-  (should-run (not (buffer-modified-p src-buffer)))
-  (output-buffer (get-buffer-create rmsbolt-output-buffer))
-  (current-line (line-number-at-pos))
-  (src-current-line
-   (if (eq (current-buffer) src-buffer)
-   current-line
- (get-text-property (point) 'rmsbolt-src-line)))
-  (hash-table (buffer-local-value 'rmsbolt-line-mapping 
src-buffer))
-  (asm-lines (gethash src-current-line hash-table))
-  ;; TODO also consider asm
-  (src-pts
-   (with-current-buffer src-buffer
- (save-excursion
-   (rmsbolt--goto-line src-current-line)
-   (cl-values (c-point 'bol) (c-point 'bonl))
+(if-let ((should-run rmsbolt-use-overlays)
+ (src-buffer
+  (buffer-local-value 'rmsbolt-src-buffer (current-buffer)))
+ ;; Don't run on unsaved buffers
+ (should-run (not (buffer-modified-p src-buffer)))
+ (output-buffer (get-buffer-create rmsbolt-output-buffer))
+ (current-line (line-number-at-pos))
+ (src-current-line
+  (if (eq (current-buffer) src-buffer)
+  current-line
+(get-text-property (point) 'rmsbolt-src-line)))
+ (hash-table (buffer-local-value 'rmsbolt-line-mapping src-buffer))
+ (asm-lines (gethash src-current-line hash-table))
+ ;; TODO also consider asm
+ (src-pts
+  (with-current-buffer src-buffer
+(save-excursion
+  (rmsbolt--goto-line src-current-line)
+  (cl-values (c-point 'bol) (c-point 'bonl))
 (let ((line-visible (not rmsbolt-goto-match))
   (src-buffer-selected (eq (current-buffer) src-buffer)))
   ;; Clear out overlays in case they are used



[elpa] externals/beardbolt 7e25ed58f2 099/323: Merge branch 'patch-1' into 'master'

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 7e25ed58f2cada4fcf42bcd6c558efb5f79abdc8
Merge: cfe809f979 5cecc2fb67
Author: Jay Kamat 
Commit: Jay Kamat 

Merge branch 'patch-1' into 'master'

Fix typo in README

See merge request jgkamat/rmsbolt!1
---
 README.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 47e423c93f..85c544e6d7 100644
--- a/README.org
+++ b/README.org
@@ -5,7 +5,7 @@ A supercharged implementation of the 
[[https://github.com/mattgodbolt/compiler-e
 RMSBolt tries to make it easy to see what your compiler is doing. It does this
 by showing you the assembly output of a given source code file. It also
 highlights which source code a given assembly block corresponds to, and vice
-versa. It supports more types of languages than any previous tool of it's kind.
+versa. It supports more types of languages than any previous tool of its kind.
 
 * Why RMSbolt over godbolt?
 



[elpa] externals/beardbolt c00d09a850 122/323: Use hashtables instead of lists as sets for labels used

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit c00d09a8507b080470f802c71cbef32cc7d22b02
Author: Jay Kamat 
Commit: Jay Kamat 

Use hashtables instead of lists as sets for labels used

Issue #9
---
 rmsbolt.el | 25 -
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 79bf730c8b..7f06deef7e 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -663,7 +663,7 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
   "Find used labels in ASM-LINES generated from SRC-BUFFER."
   (let ((match nil)
 (current-label nil)
-(labels-used nil)
+(labels-used (make-hash-table :test #'equal))
 (weak-usages (make-hash-table :test #'equal)))
 (dolist (line asm-lines)
   (setq match (and
@@ -674,7 +674,7 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
   (setq match (and (string-match rmsbolt-defines-global line)
(match-string 1 line)))
   (when match
-(cl-pushnew match labels-used :test #'equal))
+(puthash match t labels-used))
   ;; When we have no line or a period started line, skip
   (unless (or (= 0 (length line))
   (string-prefix-p "." line)
@@ -684,7 +684,7 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
 (string-match-p rmsbolt-defines-function line))
 ;; Add labels indescriminantly
 (dolist (l (rmsbolt-re-seq rmsbolt-label-find line))
-  (cl-pushnew l labels-used :test #'equal))
+  (puthash l t labels-used))
 
   (when (and current-label
  (or (string-match-p rmsbolt-data-defn line)
@@ -700,16 +700,15 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
   max-label-iter)
   (not completed))
 (let ((to-add nil))
-  (mapc
-   (lambda (label)
- (mapc
-  (lambda(now-used)
-(when (not (cl-find now-used labels-used :test #'equal))
-  (cl-pushnew now-used to-add :test #'equal)))
-  (gethash label weak-usages)))
+  (maphash
+   (lambda (label _v)
+ (dolist (now-used (gethash label weak-usages))
+   (when (not (gethash now-used labels-used))
+ (cl-pushnew now-used to-add :test #'equal
labels-used)
   (if to-add
-  (mapc (lambda (l) (cl-pushnew l labels-used :test #'equal)) 
to-add)
+  (dolist (l to-add)
+(puthash l t labels-used))
 (setq completed t
   labels-used)))
 
@@ -779,7 +778,7 @@ Argument SRC-BUFFER source buffer."
 (string-match rmsbolt-assignment-def line)))
  (match (when raw-match
   (match-string 1 line)))
- (used-label (cl-find match used-labels :test #'equal)))
+ (used-label-p (gethash match used-labels)))
 (cl-tagbody
  ;; Process file name hints
  (when (string-match rmsbolt-source-file line)
@@ -814,7 +813,7 @@ Argument SRC-BUFFER source buffer."
 
  ;; continue means we don't add to the ouptut
  (when match
-   (if (not used-label)
+   (if (not used-label-p)
;; Unused label
(when (buffer-local-value 'rmsbolt-filter-labels src-buffer)
  (go continue))



[elpa] externals/beardbolt d1b0f7c2ba 118/323: Fix compilation warnings

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit d1b0f7c2ba421e4f7c3e546813f1bbe5453daf7f
Author: Jay Kamat 
Commit: Jay Kamat 

Fix compilation warnings
---
 rmsbolt.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index d24a196086..0aa20c140a 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -631,14 +631,14 @@ Lifted from 
https://emacs.stackexchange.com/questions/35936/disassembly-of-a-byt
 (with-current-buffer out-buffer
   (erase-buffer)
   (condition-case ()
-  (cl-loop with cl-print-compiled = 'disassemble
-   for expr = (read inbuf)
-   do (pcase expr
-(`(byte-code ,(pred stringp) ,(pred vectorp) 
,(pred natnump))
- (princ "TOP-LEVEL byte code:\n" (current-buffer))
- (disassemble-1 expr 0))
-(_ (cl-prin1 expr (current-buffer
-   do (terpri (current-buffer)))
+  (let ((cl-print-compiled 'disassemble))
+(cl-loop for expr = (read inbuf)
+ do (pcase expr
+  (`(byte-code ,(pred stringp) ,(pred vectorp) 
,(pred natnump))
+   (princ "TOP-LEVEL byte code:\n" 
(current-buffer))
+   (disassemble-1 expr 0))
+  (_ (cl-prin1 expr (current-buffer
+ do (terpri (current-buffer
 (end-of-file nil)))
 
 ; Filter Functions



[elpa] externals/beardbolt 21b29cdb72 081/323: Satisfy package-lint

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 21b29cdb725429490eb188b4e293a647416ad10a
Author: Jay Kamat 
Commit: Jay Kamat 

Satisfy package-lint
---
 rmsbolt-java.el | 6 --
 rmsbolt.el  | 6 ++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/rmsbolt-java.el b/rmsbolt-java.el
index e495b2c498..0ed7e1ea50 100644
--- a/rmsbolt-java.el
+++ b/rmsbolt-java.el
@@ -127,12 +127,6 @@ Also FILTER \"useless\" lines out, optionally."
   (push line result-hold
 (nreverse result)))
 
-(defun rmsbolt--process-java-bytecode (src-buffer asm-lines)
-  "Wrapper for easy integration into rmsbolt."
-  (rmsbolt-java-process-bytecode
-   asm-lines
-   (buffer-local-value 'rmsbolt-filter-directives src-buffer)))
-
 (provide 'rmsbolt-java)
 
 ;;; rmsbolt-java.el ends here
diff --git a/rmsbolt.el b/rmsbolt.el
index 70134adf50..d278c124a1 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -747,6 +747,12 @@ Outputs assembly file if ASM."
 (push line result)))
 (nreverse result)))
 
+(defun rmsbolt--process-java-bytecode (src-buffer asm-lines)
+  "Wrapper for easy integration into rmsbolt."
+  (rmsbolt-java-process-bytecode
+   asm-lines
+   (buffer-local-value 'rmsbolt-filter-directives src-buffer)))
+
 (cl-defun rmsbolt--process-asm-lines (src-buffer asm-lines)
   "Process and filter a set of asm lines."
   (let* ((lang (with-current-buffer src-buffer



[elpa] externals/beardbolt 1001531172 073/323: Add java demo

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 1001531172b176abd6a3a05365c4e997646c39a2
Author: Jay Kamat 
Commit: Jay Kamat 

Add java demo
---
 README.org | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/README.org b/README.org
index 594d692b0f..560320c71b 100644
--- a/README.org
+++ b/README.org
@@ -85,6 +85,12 @@ otherwise only top level code will be shown. Python 2 is 
unsupported.
 
 
[[https://s25.postimg.cc/594qd9o4v/output-2018-08-04-18_07_45.gif][https://s25.postimg.cc/594qd9o4v/output-2018-08-04-18_07_45.gif]]
 
+** Java
+
+parses the output of ~javap~, so may be a little unreliable or buggy at the
+moment.
+
+[[https://s25.postimg.cc/57s2z9uxb/output-2018-09-01-00_29_30.gif][https://s25.postimg.cc/57s2z9uxb/output-2018-09-01-00_29_30.gif]]
 ** Common Lisp
 
 No support for source->asm matching or filtering.



[elpa] externals/beardbolt d09d72f463 215/323: Add after-parse-hook

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit d09d72f463cde47b6f861c8e20f90c6bb082c44f
Author: Jay Kamat 
Commit: Jay Kamat 

Add after-parse-hook
---
 rmsbolt.el | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/rmsbolt.el b/rmsbolt.el
index 40021a8e13..08ddc3cb98 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -192,6 +192,15 @@ Note that basic flags to ensure basic usage are always 
modified."
   :safe 'booleanp
   :group 'rmsbolt)
 
+(defcustom rmsbolt-after-parse-hook nil
+  "Hook after all parsing is done, but before compile command is run.
+
+Exercise caution when setting variables in this hook - doing so
+can disrupt rmsbolt state and cause issues. Variables set here
+may not be cleared to default as variables are usually."
+  :group 'rmsbolt
+  :type 'hook)
+
  Faces
 
 (defface rmsbolt-current-line-face
@@ -1519,6 +1528,7 @@ Are you running two compilations at the same time?"))
(error "Objdumper not recognized"
   ;; Convert to demangle if we need to
   (setq cmd (rmsbolt--demangle-command cmd lang src-buffer))
+  (run-hooks 'rmsbolt-after-parse-hook)
   (rmsbolt-with-display-buffer-no-window
(let ((shell-file-name (or (executable-find rmsbolt--shell)
   shell-file-name)))



[elpa] externals/beardbolt 082cbc7b1c 048/323: Add new tests

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 082cbc7b1cab76be13529143579de010ccf12b8a
Author: Jay Kamat 
Commit: Jay Kamat 

Add new tests
---
 .ert-runner|   1 +
 .gitlab-ci.yml |   9 +
 test/rmsbolt-c-post1.s |  47 +++
 test/rmsbolt-c-post2.s | 916 +
 test/rmsbolt-c-post3.s | 117 +++
 test/rmsbolt-c-pre1.s  | 916 +
 test/rmsbolt-test.el   |  45 +++
 7 files changed, 2051 insertions(+)

diff --git a/.ert-runner b/.ert-runner
new file mode 100644
index 00..47007910fb
--- /dev/null
+++ b/.ert-runner
@@ -0,0 +1 @@
+-l rmsbolt.el
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 00..daa4856f92
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,9 @@
+stages:
+  - build
+
+test:
+  image: jgkamat/emacs:25.2-cask
+  stage: build
+  script:
+- cask
+- cask exec ert-runner
diff --git a/test/rmsbolt-c-post1.s b/test/rmsbolt-c-post1.s
new file mode 100644
index 00..2b100d724b
--- /dev/null
+++ b/test/rmsbolt-c-post1.s
@@ -0,0 +1,47 @@
+isRMS:
+   pushrbp
+   mov rbp, rsp
+   mov DWORD PTR -4[rbp], edi
+   mov eax, DWORD PTR -4[rbp]
+   cmp eax, 82
+   je  .L3
+   cmp eax, 83
+   je  .L4
+   cmp eax, 77
+   je  .L5
+   jmp .L7
+.L3:
+   mov eax, 1
+   jmp .L6
+.L5:
+   mov eax, 2
+   jmp .L6
+.L4:
+   mov eax, 3
+   jmp .L6
+.L7:
+   mov eax, 200
+.L6:
+   pop rbp
+   ret
+.LC0:
+   .string "%c\n"
+main:
+   pushrbp
+   mov rbp, rsp
+   sub rsp, 16
+   mov BYTE PTR -1[rbp], 2
+   movsx   eax, BYTE PTR -1[rbp]
+   mov edi, eax
+   callisRMS
+   testeax, eax
+   je  .L9
+   movsx   eax, BYTE PTR -1[rbp]
+   mov esi, eax
+   lea rdi, .LC0[rip]
+   mov eax, 0
+   callprintf@PLT
+.L9:
+   mov eax, 0
+   leave
+   ret
diff --git a/test/rmsbolt-c-post2.s b/test/rmsbolt-c-post2.s
new file mode 100644
index 00..c539d24771
--- /dev/null
+++ b/test/rmsbolt-c-post2.s
@@ -0,0 +1,916 @@
+   .file   "rmsbolt.c"
+   .intel_syntax noprefix
+   .text
+.Ltext0:
+   .globl  isRMS
+   .type   isRMS, @function
+isRMS:
+.LFB0:
+   .file 1 "/tmp/rmsbolt-LsubiK/rmsbolt.c"
+   .loc 1 11 0
+   .cfi_startproc
+   pushrbp
+   .cfi_def_cfa_offset 16
+   .cfi_offset 6, -16
+   mov rbp, rsp
+   .cfi_def_cfa_register 6
+   mov DWORD PTR -4[rbp], edi
+   .loc 1 12 0
+   mov eax, DWORD PTR -4[rbp]
+   cmp eax, 82
+   je  .L3
+   cmp eax, 83
+   je  .L4
+   cmp eax, 77
+   je  .L5
+   jmp .L7
+.L3:
+   .loc 1 14 0
+   mov eax, 1
+   jmp .L6
+.L5:
+   .loc 1 16 0
+   mov eax, 2
+   jmp .L6
+.L4:
+   .loc 1 18 0
+   mov eax, 3
+   jmp .L6
+.L7:
+   .loc 1 20 0
+   mov eax, 200
+.L6:
+   .loc 1 22 0
+   pop rbp
+   .cfi_def_cfa 7, 8
+   ret
+   .cfi_endproc
+.LFE0:
+   .size   isRMS, .-isRMS
+   .section.rodata
+.LC0:
+   .string "%c\n"
+   .text
+   .globl  main
+   .type   main, @function
+main:
+.LFB1:
+   .loc 1 24 0
+   .cfi_startproc
+   pushrbp
+   .cfi_def_cfa_offset 16
+   .cfi_offset 6, -16
+   mov rbp, rsp
+   .cfi_def_cfa_register 6
+   sub rsp, 16
+   .loc 1 25 0
+   mov BYTE PTR -1[rbp], 2
+   .loc 1 26 0
+   movsx   eax, BYTE PTR -1[rbp]
+   mov edi, eax
+   callisRMS
+   testeax, eax
+   je  .L9
+   .loc 1 27 0
+   movsx   eax, BYTE PTR -1[rbp]
+   mov esi, eax
+   lea rdi, .LC0[rip]
+   mov eax, 0
+   callprintf@PLT
+.L9:
+   mov eax, 0
+   .loc 1 28 0
+   leave
+   .cfi_def_cfa 7, 8
+   ret
+   .cfi_endproc
+.LFE1:
+   .size   main, .-main
+.Letext0:
+   .file 2 "/usr/lib/gcc/x86_64-linux-gnu/6/include/stddef.h"
+   .file 3 "/usr/include/x86_64-linux-gnu/bits/types.h"
+   .file 4 "/usr/include/libio.h"
+   .file 5 "/usr/include/stdio.h"
+   .file 6 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h"
+   .section.debug_info,"",@progbits
+.Ldebug_info0:
+   .long   0x358
+   .value  0x4
+   .long   .Ldebug_abbrev0
+   .byte   0x8
+   .uleb128 0x1
+   .long   .LASF56
+   .byte   0xc
+   .long   .LASF57
+   .long   .LASF58
+   .quad   .Ltext0
+   .quad   .Letext0-.Ltext0
+   .long   .Ldebug_line0
+   .uleb128 0x2
+   .long   .LASF7
+   .byte   0x2
+   .byte   0xd8
+   .long   0x38
+   .uleb128 0x3
+   .byte   0x8
+   .byte   0x7
+   .long   .LASF0
+   .uleb12

[elpa] externals/beardbolt 3195997ccd 275/323: * beardbolt.el (bb--synch-relation-overlays): Rework and bugfix.

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 3195997ccdd1771e6f70bbe77e07ba82ed850f02
Author: João Távora 
Commit: João Távora 

* beardbolt.el (bb--synch-relation-overlays): Rework and bugfix.
---
 beardbolt.el | 27 ++-
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/beardbolt.el b/beardbolt.el
index a04b3d42ac..40fd89bfa2 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -760,19 +760,20 @@ Interactively, determine LANG from `major-mode'."
   "Update overlays to visually match selected source and asm lines.
 Runs in output buffer.  Sets `bb--relation-overlays'."
   (bb--delete-relation-overlays)
-  (let ((positions (plist-get (gethash source-line bb--line-mappings)
-  :positions)))
-(when positions
-  (bb--when-live-buffer bb--source-buffer
-(save-excursion
-  (push
-   (progn
- (goto-char (point-min))
- (bb--make-relation-overlay
-  (line-beginning-position source-line)
-  (line-end-position source-line)))
-   bb--relation-overlays))
-(bb--recenter-maybe (overlay-start (car bb--relation-overlays
+  (let* ((positions (plist-get (gethash source-line bb--line-mappings)
+   :positions))
+ (src-overlay
+  (and positions
+   (bb--when-live-buffer bb--source-buffer
+ (save-excursion
+   (goto-char (point-min))
+   (forward-line (1- source-line))
+   (bb--recenter-maybe (point))
+   (bb--make-relation-overlay
+(line-beginning-position)
+(line-end-position)))
+(when src-overlay
+  (push src-overlay bb--relation-overlays)
   (cl-loop for (start . end) in positions
do (push (bb--make-relation-overlay start end) 
bb--relation-overlays)
finally (bb--recenter-maybe (caar positions))



[elpa] externals/beardbolt 1f50b7bb7f 069/323: Add java framework

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 1f50b7bb7f06e705fa32676b2d5accec9178f209
Author: Jay Kamat 
Commit: Jay Kamat 

Add java framework
---
 rmsbolt.el | 28 
 1 file changed, 28 insertions(+)

diff --git a/rmsbolt.el b/rmsbolt.el
index 8cf4b02276..b6a2910019 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -364,6 +364,25 @@ Outputs assembly file if ASM."
"-o" (rmsbolt-output-filename src-buffer))
  " ")))
 cmd))
+(cl-defun rmsbolt--java-compile-cmd (&key src-buffer)
+  "Process a compile command for ocaml.
+
+  Needed as ocaml cannot output asm to a non-hardcoded file"
+  (let* ((output-filename (rmsbolt-output-filename src-buffer))
+ (class-filename (concat (file-name-sans-extension (buffer-file-name)) 
".class"))
+ (cmd (buffer-local-value 'rmsbolt-command src-buffer))
+ (cmd (mapconcat 'identity
+ (list cmd
+   "-g"
+   (buffer-file-name)
+   "&&"
+   "javap"
+   "-c" "-l"
+   class-filename
+   ">"
+   output-filename)
+ " ")))
+cmd))
 
 (defvar rmsbolt--hidden-func-c
   (rx bol (or (and "__" (0+ any))
@@ -458,6 +477,15 @@ Outputs assembly file if ASM."
   :starter-file-name "rmsbolt.hs"
   :compile-cmd-function #'rmsbolt--hs-compile-cmd
   :disass-hidden-funcs nil))
+   (java-mode
+. ,(make-rmsbolt-lang :mode 'java-mode
+  :compile-cmd "javac"
+  :supports-asm t
+  :supports-disass nil
+  :objdumper 'cat
+  :starter-file-name "rmsbolt.java"
+  :compile-cmd-function #'rmsbolt--java-compile-cmd
+  :disass-hidden-funcs nil))
))
 
  Macros



[elpa] externals/beardbolt ec99a1aa31 146/323: Attempt to fix whitespace clearing on hot recompiles

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit ec99a1aa319408f44a7ebf1d17adc298d559cdb1
Author: Jay Kamat 
Commit: Jay Kamat 

Attempt to fix whitespace clearing on hot recompiles

Does anyone want to have their before-save-hooks run automatically?
---
 rmsbolt.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 4a38b6396c..6bf8025b4e 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1406,8 +1406,13 @@ Argument OVERRIDE-BUFFER use this buffer instead of 
reading from the output file
(eq rmsbolt-automatic-recompile 'force)))
  (modified (buffer-modified-p src-buffer)))
 (with-current-buffer src-buffer
-  ;; Write to disk
-  (save-buffer)
+  ;; Clear `before-save-hook' to prevent things like whitespace cleanup or
+  ;; aggressive indent from running (this is a hot recompile):
+  ;; 
https://github.com/syl20bnr/spacemacs/blob/c7a103a772d808101d7635ec10f292ab9202d9ee/layers/%2Bspacemacs/spacemacs-editing/local/spacemacs-whitespace-cleanup/spacemacs-whitespace-cleanup.el#L72
+  ;; TODO does anyone want before-save-hook to run on a hot recompile?
+  (let ((before-save-hook nil))
+;; Write to disk
+(save-buffer))
   ;; Recompile
   (setq rmsbolt--automated-compile t)
   (rmsbolt-compile



[elpa] externals/beardbolt 65a1ac7b6e 054/323: Add support for demangling

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 65a1ac7b6eba896fba0fdec601f0933cc2daee5a
Author: Jay Kamat 
Commit: Jay Kamat 

Add support for demangling
---
 README.org   |  2 ++
 rmsbolt.el   | 58 +++-
 test/rmsbolt-test.el | 47 +-
 3 files changed, 92 insertions(+), 15 deletions(-)

diff --git a/README.org b/README.org
index 2a9207b33f..68c5b5186b 100644
--- a/README.org
+++ b/README.org
@@ -25,6 +25,8 @@ versa.
 
 * Installation
 
+rmsbolt will almost certainly not work on windows.
+
 rmsbolt is not on melpa yet. If you find it useful, please let me know and I 
may
 add it..
 
diff --git a/rmsbolt.el b/rmsbolt.el
index b406699822..d4182dc3a2 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -86,6 +86,11 @@
   :type 'boolean
   :safe 'booleanp
   :group 'rmsbolt)
+(defcustom rmsbolt-demangle t
+  "Whether to attempt to demangle the resulting assembly."
+  :type 'boolean
+  :safe 'booleanp
+  :group 'rmsbolt)
 
  Faces
 
@@ -215,8 +220,12 @@ Outputs assembly file if ASM."
:documentation "If we support assembly directly. If nil, we must 
disassemble.")
   (objdumper
'objdump
-   :type symbol
+   :type 'symbol
:documentation "The object dumper to use if disassembling binary.")
+  (demangler
+   "c++filt"
+   :type 'string
+   :documentation "The command of the demangler to use for this source code.")
   (starter-file-name
nil
:type 'string
@@ -253,7 +262,7 @@ Outputs assembly file if ASM."
 (cl-defun rmsbolt--ocaml-compile-cmd (&key src-buffer)
   "Process a compile command for gcc/clang.
 
-  Needed as ocaml cannot output asm to a 
non-hardcoded file"
+  Needed as ocaml cannot output asm to a non-hardcoded file"
   (let* ((diss (buffer-local-value 'rmsbolt-disassemble src-buffer))
  (output-filename (rmsbolt-output-filename src-buffer))
  (predicted-asm-filename (concat (file-name-sans-extension 
(buffer-file-name)) ".s"))
@@ -373,6 +382,7 @@ Outputs assembly file if ASM."
   :compile-cmd "ocamlopt"
   :supports-asm t
   :supports-disass t
+  :demangler nil
   :starter-file-name "rmsbolt.ml"
   :compile-cmd-function #'rmsbolt--ocaml-compile-cmd
   :disass-hidden-funcs rmsbolt--hidden-func-ocaml))
@@ -382,6 +392,7 @@ Outputs assembly file if ASM."
   :supports-asm t
   :supports-disass nil
   :objdumper 'cat
+  :demangler nil
   :starter-file-name "rmsbolt.lisp"
   :compile-cmd-function #'rmsbolt--lisp-compile-cmd
   :disass-hidden-funcs nil))
@@ -391,6 +402,7 @@ Outputs assembly file if ASM."
   :supports-asm t
   :supports-disass nil
   :objdumper 'objdump
+  :demangler "rustfilt"
   :starter-file-name "rmsbolt.rs"
   :compile-cmd-function #'rmsbolt--rust-compile-cmd
   :disass-hidden-funcs nil))
@@ -701,6 +713,23 @@ Outputs assembly file if ASM."
   (setq-local rmsbolt-disassemble nil))
 src-buffer))
 
+(defun rmsbolt--demangle-command (existing-cmd lang src-buffer)
+  "Append a demangler routine to EXISTING-CMD with LANG and SRC-BUFFER and 
return it."
+  (if-let ((to-demangle (buffer-local-value 'rmsbolt-demangle src-buffer))
+   (demangler (rmsbolt-l-demangler lang))
+   (demangler-exists (executable-find demangler)))
+  (concat existing-cmd " "
+  (mapconcat
+   'identity
+   (list "&&" demangler
+ "<" (rmsbolt-output-filename src-buffer t)
+ ">" (expand-file-name "tmp.s" rmsbolt-temp-dir)
+ "&&" "mv"
+ (expand-file-name "tmp.s" rmsbolt-temp-dir)
+ (rmsbolt-output-filename src-buffer t))
+   " "))
+existing-cmd))
+
 ; UI Functions
 (defun rmsbolt-compile ()
   "Compile the current rmsbolt buffer."
@@ -713,7 +742,10 @@ Outputs assembly file if ASM."
 (let* ((src-buffer (current-buffer))
(lang (rmsbolt--get-lang))
(func (rmsbolt-l-compile-cmd-function lang))
-   (cmd (funcall func :src-buffer src-buffer)))
+   ;; Generate command
+   (cmd (funcall func :src-buffer src-buffer))
+   ;; Convert to demangle if we need to
+   (cmd (rmsbolt--demangle-command cmd lang src-buffer)))
 
   (when (buffer-local-value 'rmsbolt-disassemble src-buffer)
 (pcase
@@ -822,7 +854,6 @@ Outputs assembly file if ASM."
 
 (defun rmsbolt-move-overlays ()
   "Function for moving overlays for rmsbolt."
-
   (when rm

[elpa] externals/beardbolt e0bc9fc409 013/323: Fix starters

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit e0bc9fc409619f6c2caff36397ad88cfda2f5ce8
Author: Jay Kamat 
Commit: Jay Kamat 

Fix starters
---
 rmsbolt.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index fd25f643e2..eaf1772cd8 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -373,8 +373,8 @@ int main() {
  (display-buffer buffer))
 
 ; Parsing Options
-(defun rmsbolt--get-lang ()
-  (cdr-safe (assoc major-mode rmsbolt-languages)))
+(defun rmsbolt--get-lang (&optional language)
+  (cdr-safe (assoc (or language major-mode) rmsbolt-languages)))
 (defun rmsbolt--get-cmd ()
   "Gets the rms command from the buffer, if available."
   (save-excursion
@@ -414,8 +414,8 @@ int main() {
 
 
 (defun rmsbolt-starter (lang-mode)
-  "Code for "
-  (let* ((lang-def (rmsbolt--get-lang))
+  "Code for fully setting up a language from LANG-MODE."
+  (let* ((lang-def (rmsbolt--get-lang lang-mode))
  (file-name
   (expand-file-name (rmsbolt-l-starter-file-name lang-def) 
rmsbolt-temp-dir))
  (exists (file-exists-p file-name)))



[elpa] externals/beardbolt 345dd21d24 145/323: Fix typo in docstring

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 345dd21d24f0605efada9378c892eeeab53e7625
Author: Jay Kamat 
Commit: Jay Kamat 

Fix typo in docstring
---
 rmsbolt.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index 8aee85d443..4a38b6396c 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -147,8 +147,8 @@ may throw errors.
 
 If you are not on x86, you most likely want to set this to nil.
 
-Since this defaults to 'intel, implementers must support this
-being set (at worst falling back to nil if passed 'intel)."
+Since this defaults to \"intel\", implementers must support this
+being set (at worst falling back to nil if passed \"intel\")."
   :type 'string
   :safe (lambda (v) (or (booleanp v) (stringp v)))
   :group 'rmsbolt)



[elpa] externals/beardbolt a74d54e764 109/323: Fix tests

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit a74d54e764a8c0bf6e9873e6c9865945b2dac53a
Author: Jay Kamat 
Commit: Jay Kamat 

Fix tests
---
 test/rmsbolt-test.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/rmsbolt-test.el b/test/rmsbolt-test.el
index 9efffb4361..8880b1caeb 100644
--- a/test/rmsbolt-test.el
+++ b/test/rmsbolt-test.el
@@ -32,7 +32,7 @@
 (ert-deftest filter-tests-all-c ()
   "Test if assembly filteration in c is working."
   (with-temp-buffer
-(setq-local rmsbolt-dissasemble nil)
+(setq-local rmsbolt-disassemble nil)
 (setq-local rmsbolt-filter-comment-only t)
 (setq-local rmsbolt-filter-directives t)
 (setq-local rmsbolt-filter-labels t)
@@ -40,7 +40,7 @@
 (ert-deftest filter-tests-none-c ()
   "Test if assembly filteration in c is working."
   (with-temp-buffer
-(setq-local rmsbolt-dissasemble nil)
+(setq-local rmsbolt-disassemble nil)
 (setq-local rmsbolt-filter-comment-only nil)
 (setq-local rmsbolt-filter-directives nil)
 (setq-local rmsbolt-filter-labels nil)
@@ -48,7 +48,7 @@
 (ert-deftest filter-tests-dir-c ()
   "Test if assembly filteration in c is working."
   (with-temp-buffer
-(setq-local rmsbolt-dissasemble nil)
+(setq-local rmsbolt-disassemble nil)
 (setq-local rmsbolt-filter-comment-only nil)
 (setq-local rmsbolt-filter-directives t)
 (setq-local rmsbolt-filter-labels nil)
@@ -56,7 +56,7 @@
 (ert-deftest filter-tests-weak-ref-c ()
   "Test if assembly filteration in c is working."
   (with-temp-buffer
-(setq-local rmsbolt-dissasemble nil)
+(setq-local rmsbolt-disassemble nil)
 (setq-local rmsbolt-filter-comment-only nil)
 (setq-local rmsbolt-filter-directives t)
 (setq-local rmsbolt-filter-labels t)



[elpa] externals/beardbolt 730ea84796 290/323: bb-compile-delay can be nil

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 730ea84796023b61688a54008fa23beedefce79a
Author: João Távora 
Commit: João Távora 

bb-compile-delay can be nil

* beardbolt.el (bb-compile-delay): Can be nil.
(bb--after-change): Don't do anything if bb-compile-delay is nil.
---
 beardbolt.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/beardbolt.el b/beardbolt.el
index 72e035fda9..46f9cae61c 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -128,7 +128,8 @@ Passed directly to compiler or disassembler."
 (defvar bb-hide-compile t)
 
 (defvar bb-compile-delay 1.0
-  "Time in seconds to delay before recompiling if there is a change.")
+  "Time in seconds to delay before recompiling if there is a change.
+If nil, auto-recompilation is off.")
 
 (defvar bb--shell "bash"
   "Which shell to prefer if available.
@@ -700,8 +701,9 @@ With prefix argument, choose from starter files in 
`bb-starter-files'."
 (defvar bb--change-timer nil)
 
 (defun bb--after-change (&rest _)
-  (when (timerp bb--change-timer) (cancel-timer bb--change-timer))
-  (setq bb--change-timer (run-with-timer bb-compile-delay nil 
#'bb--on-change-timer)))
+  (when bb-compile-delay
+(when (timerp bb--change-timer) (cancel-timer bb--change-timer))
+(setq bb--change-timer (run-with-timer bb-compile-delay nil 
#'bb--on-change-timer
 
 (defun bb--on-change-timer ()
   (bb-compile (bb--get-lang)))



[elpa] externals/beardbolt 0d5774397b 124/323: Update README

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 0d5774397bbfe781923e50d630a4720939b110c1
Author: Jay Kamat 
Commit: Jay Kamat 

Update README
---
 README.org | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/README.org b/README.org
index 37bb6b4bb0..1416a64e21 100644
--- a/README.org
+++ b/README.org
@@ -74,6 +74,9 @@ starter files have this block with some common settings:
 // End:
 #+END_SRC
 
+*Note*: 
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables][the
 Local Variable block must be 3000 characters from the end of the
+file to work]]. Any method of setting buffer-local variables will work though.
+
 Notable options:
 
 | Option| Description  

 |



[elpa] externals/beardbolt 3baf531b55 238/323: Refactor: Move let binding closer to point of usage

2023-03-09 Thread ELPA Syncer
branch: externals/beardbolt
commit 3baf531b556aef8dd72b0145eced4d2748df34f0
Author: Erik Arvstedt 
Commit: Erik Arvstedt 

Refactor: Move let binding closer to point of usage

The variables defined in the let binding are only used by
`compilation-start`.
This makes the next commit more readable.
---
 rmsbolt.el | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/rmsbolt.el b/rmsbolt.el
index e403a7db26..1b829da910 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -1534,15 +1534,15 @@ and return it."
(error "Objdumper not recognized"
   ;; Convert to demangle if we need to
   (setq cmd (rmsbolt--demangle-command cmd lang src-buffer))
-  (let ((shell-file-name (or (executable-find rmsbolt--shell)
- shell-file-name)))
-(with-current-buffer
+  (with-current-buffer ; With compilation buffer
+  (let ((shell-file-name (or (executable-find rmsbolt--shell)
+ shell-file-name)))
 ;; TODO should this be configurable?
 (rmsbolt-with-display-buffer-no-window
- (compilation-start cmd nil (lambda (&rest _) 
"*rmsbolt-compilation*")))
-  (add-hook 'compilation-finish-functions
-#'rmsbolt--handle-finish-compile nil t)
-  (setq rmsbolt-src-buffer src-buffer)))
+ (compilation-start cmd nil (lambda (&rest _) 
"*rmsbolt-compilation*"
+(add-hook 'compilation-finish-functions
+  #'rmsbolt--handle-finish-compile nil t)
+(setq rmsbolt-src-buffer src-buffer))
 
  Keymap
 (defvar rmsbolt-mode-map



  1   2   3   4   >