From 911b2ef4ce8677821b5b22ce3f31b8e6b8af18dc Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Fri, 13 May 2022 14:35:26 -0700 Subject: [PATCH] Integrate eros for better display of evaluation Now when I evaluate an s-expression, I get a message near the code instead of down below. --- README.org | 1 + ha-programming-elisp.org | 6 ++++++ ha-programming-scheme.org | 11 +---------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/README.org b/README.org index 34ab32f..98aa48a 100644 --- a/README.org +++ b/README.org @@ -32,6 +32,7 @@ This creates [[file:~/.emacs.d/init.el][~/.emacs.d/init.el]] that starts the pro - [[file:ha-irc.org][irc]] :: connection to IRC servers using rcirc and bitlbee. - [[file:ha-passwords.org][passwords]] :: code for generating passwords. - [[file:ha-programming.org][programming]] :: configuration for /all/ programming languages, or at least, the simple ones. + - [[file:ha-programming-elisp.org][programming-elisp]] :: additions to Emacs Lisp programming. - [[file:ha-programming-python.org][programming-python]] :: configuration for working with Python and LSP. - [[file:ha-programming-scheme.org][programming-scheme]] :: configuration for Racket. - [[file:ha-aux-apps.org][aux-apps]] :: additional application configuration. diff --git a/ha-programming-elisp.org b/ha-programming-elisp.org index b5b9f49..d31843b 100644 --- a/ha-programming-elisp.org +++ b/ha-programming-elisp.org @@ -169,6 +169,12 @@ Other nifty keybindings that I need to commit to muscle memory include: | ~M-r~ | =sp-raise-sexp= | ** Eval Current Expression +The [[https://github.com/xiongtx/eros][eros]] package stands for Evaluation Result OverlayS for Emacs Lisp, and basically shows what each s-expression is near the cursor position instead of in the mini-buffer at the bottom of the window. +#+BEGIN_SRC emacs-lisp + (use-package eros + :hook (emacs-lisp-mode . eros-mode)) +#+END_SRC + A feature I enjoyed from Spacemacs is the ability to evaluate the s-expression currently containing the point. Not sure how they made it, but [[help:evil-cp-next-closing ][evil-cp-next-closing]] from cleverparens can help: #+BEGIN_SRC emacs-lisp diff --git a/ha-programming-scheme.org b/ha-programming-scheme.org index ac231b3..7b79dd9 100644 --- a/ha-programming-scheme.org +++ b/ha-programming-scheme.org @@ -83,10 +83,6 @@ Let’s test it out by defining a variable: And simply using it: #+BEGIN_SRC scheme :var b=8 (+ a b) - - - - #+END_SRC #+RESULTS: @@ -106,14 +102,9 @@ Let’s get the book available as an Info page: (use-package sicp) #+END_SRC -And does this work? -#+BEGIN_SRC scheme - (inc 42) -#+END_SRC - Still having difficulty getting the Scheme REPL to output the results back into this document. Let’s try Racket... -If we want to read the [[file:~/.emacs.d/straight/build/sicp/sicp.info][sicp.info]] file, looks like we need this, at least, temporarily: +Normally, I would just [[info:SICP][read the book]], however, if we want to read the [[file:~/.emacs.d/straight/build/sicp/sicp.info][sicp.info]] file, we need this, at least, temporarily: #+BEGIN_SRC emacs-lisp (add-to-list 'auto-mode-alist '("\\.info\\'" . Info-mode)) #+END_SRC