branch: externals/beardbolt commit 9129f1f13c4e06547b08c5e1e321203698d8cde1 Author: Jay Kamat <jaygka...@gmail.com> Commit: Jay Kamat <jaygka...@gmail.com>
Add documentation and README for elisp Close #3 --- README.org | 6 ++++++ rmsbolt.el | 7 ++++++- starters/rmsbolt-starter.el | 28 ++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 085b1c0632..f8c93183f5 100644 --- a/README.org +++ b/README.org @@ -132,6 +132,12 @@ 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]] +** Emacs Lisp + +No support for source->asm matching, filtering, or automatic recompile. + +[[https://i.imgur.com/uYrQ7En.gif][https://i.imgur.com/uYrQ7En.gif]] + ** Common Lisp No support for source->asm matching or filtering. Only ~sbcl~ and ~clisp~ diff --git a/rmsbolt.el b/rmsbolt.el index 955165b487..2b54eb0139 100644 --- a/rmsbolt.el +++ b/rmsbolt.el @@ -88,7 +88,8 @@ :type 'string :group 'rmsbolt) (defcustom rmsbolt-automatic-recompile t - "Whether to automatically recompile on source buffer changes." + "Whether to automatically recompile on source buffer changes. +Emacs-lisp does not support automatic-recompilation currently." :type 'boolean :group 'rmsbolt) @@ -1108,6 +1109,7 @@ Argument OVERRIDE-BUFFER use this buffer instead of reading from the output file ("python" . "rmsbolt.py") ("haskell" . "rmsbolt.hs") ("pony" . "rmsbolt.pony") + ("emacs-lisp" . "rmsbolt-starter.el") ;; Rmsbolt is capitalized here because of Java convention of Capitalized ;; class names. ("java" . "Rmsbolt.java"))) @@ -1234,6 +1236,9 @@ Argument OVERRIDE-BUFFER use this buffer instead of reading from the output file (should-hot-recompile rmsbolt-automatic-recompile) (output-buffer (get-buffer rmsbolt-output-buffer)) (src-buffer (buffer-local-value 'rmsbolt-src-buffer output-buffer)) + (is-not-elisp (not (eq 'emacs-lisp-mode + (with-current-buffer src-buffer + major-mode)))) (modified (buffer-modified-p src-buffer))) (with-current-buffer src-buffer ;; Write to disk diff --git a/starters/rmsbolt-starter.el b/starters/rmsbolt-starter.el new file mode 100644 index 0000000000..230ef2fa13 --- /dev/null +++ b/starters/rmsbolt-starter.el @@ -0,0 +1,28 @@ +;;; rmsbolt-starter.el --- Starter file for rmsbolt -*- lexical-binding: t; -*- + +;;; Commentary: +;; A simple starter! + +;;; Code: + +(defun my-apply (fn &rest args) + "`apply's FN to ARGS." + (apply fn args)) + +(defun is-rms (letter) + "Check to see if a LETTER is RMS." + (pcase letter + ((or "R" "M" "S") t) + (_ nil) + (_ "I will never run!"))) + +(defun main () + "Main entrypoint." + (let* ((a (my-apply (lambda (a) (- a (+ 20 21))) + 999)) + (a (+ 1 1 1 a))) + (message (is-rms a)))) + +(main) + +;;; rmsbolt-starter.el ends here