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

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

[elpa] externals/beardbolt c442960f16 076/323: Add an easy way to turn o


From: ELPA Syncer
Subject: [elpa] externals/beardbolt c442960f16 076/323: Add an easy way to turn off automatic recompilation
Date: Thu, 9 Mar 2023 10:58:19 -0500 (EST)

branch: externals/beardbolt
commit c442960f160f3fab565268950044435cd8fd26e8
Author: Jay Kamat <jaygkamat@gmail.com>
Commit: Jay Kamat <jaygkamat@gmail.com>

    Add an easy way to turn off automatic recompilation
---
 README.org |  8 ++++++--
 rmsbolt.el | 14 +++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 154f72255c..23d07c70b9 100644
--- a/README.org
+++ b/README.org
@@ -17,6 +17,7 @@ versa.
   - It's easy to add new languages (even those that use unique bytecode 
formats)
     without touching many files.
   - Dosen't eat your ram on the 'server' or the 'client'
+  - No enforced limits on code size, compilation time, or processing time.
 - Benefits from living in Emacs
   - Full undo tree from Emacs on disassembly/source so you don't loose work.
   - Vim bindings through evil/viper.
@@ -53,7 +54,8 @@ add it..
 * 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.
+ use the default ~C-c C-c~ binding. After the first run, the buffer should
+ automatically update.
 
 * Demos
 ** C/C++
@@ -115,12 +117,14 @@ available in the compiled form if they exist.
      settings into a valid command which will take in a filename and output
      assembly or an executable. See ~rmsbolt--c-compile-cmd~ for an example.
    - If the assembly is not in a standard format, you will need to define a
-     ~process-asm-custom-fn~ as well.
+     ~process-asm-custom-fn~ as well (see python/java for examples).
 2. [[file:rmsbolt.el::;;;;;%20Starter%20Definitions][Add a new entry into the 
starter file]]
    - For this, you will need to make a starter file. See 
[[file:starters/][this folder]] for
      existing examples.
 
 You're done!
+
 * Alternatives
 - [[https://github.com/yawkat/javap][yawkat/javap]]
 - 
[[https://github.com/mattgodbolt/compiler-explorer][mattgodbolt/compiler-explorer]]
+- [[http://reliant.colab.duke.edu/c2mips/][c2mips]]
diff --git a/rmsbolt.el b/rmsbolt.el
index c9ab587eb0..0ef807fbfe 100644
--- a/rmsbolt.el
+++ b/rmsbolt.el
@@ -21,7 +21,9 @@
 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
-;; TODO create commentary
+;; rmsbolt is a package to provide assembly or bytecode output for a source 
code input file.
+;;
+;;
 
 ;;; Requires:
 
@@ -50,6 +52,10 @@
   "Lighter displayed in mode line when `rmsbolt-mode' is active."
   :type 'string
   :group 'rmsbolt)
+(defcustom rmsbolt-automatic-recompile t
+  "Whether to automatically recompile on source buffer changes."
+  :type 'boolean
+  :group 'rmsbolt)
 
 ;;;;; Buffer Local Tweakables
 (defcustom rmsbolt-disassemble nil
@@ -977,7 +983,7 @@ Outputs assembly file if ASM."
 (rmsbolt-defstarter "python" 'python-mode)
 (rmsbolt-defstarter "java" 'java-mode)
 
-;;;; Font lock matcher
+;;;; Overlay Commands
 (defun rmsbolt--goto-line (line)
   "Goto a certain LINE."
   (when line
@@ -1069,6 +1075,7 @@ Outputs assembly file if ASM."
 (defun rmsbolt-hot-recompile ()
   "Recompile source buffer if we need to."
   (when-let ((should-hot-compile rmsbolt-mode)
+             (should-hot-recompile rmsbolt-automatic-recompile)
              (output-buffer (get-buffer rmsbolt-output-buffer))
              (src-buffer (buffer-local-value 'rmsbolt-src-buffer 
output-buffer))
              (modified (buffer-modified-p src-buffer)))
@@ -1094,7 +1101,8 @@ 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 rmsbolt--compile-idle-timer
+  (unless (or rmsbolt--compile-idle-timer
+              (not rmsbolt-automatic-recompile))
     (setq rmsbolt--compile-idle-timer (run-with-idle-timer
                                        rmsbolt-compile-delay t
                                        #'rmsbolt-hot-recompile)))



reply via email to

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