tools/eval: update README
This commit is contained in:
parent
84a063ca78
commit
a78e89bbf8
1 changed files with 30 additions and 24 deletions
|
@ -3,19 +3,19 @@
|
||||||
#+SINCE: v2.0
|
#+SINCE: v2.0
|
||||||
#+STARTUP: inlineimages
|
#+STARTUP: inlineimages
|
||||||
|
|
||||||
* Table of Contents :TOC_3:noexport:
|
* Table of Contents :TOC_3:noexport:
|
||||||
- [[Description][Description]]
|
- [[#description][Description]]
|
||||||
- [[Module Flags][Module Flags]]
|
- [[#module-flags][Module Flags]]
|
||||||
- [[Plugins][Plugins]]
|
- [[#plugins][Plugins]]
|
||||||
- [[Hacks][Hacks]]
|
- [[#hacks][Hacks]]
|
||||||
- [[Prerequisites][Prerequisites]]
|
- [[#prerequisites][Prerequisites]]
|
||||||
- [[Features][Features]]
|
- [[#features][Features]]
|
||||||
- [[Inline Code Evaluation][Inline Code Evaluation]]
|
- [[#inline-code-evaluation][Inline Code Evaluation]]
|
||||||
- [[REPLs][REPLs]]
|
- [[#repls][REPLs]]
|
||||||
- [[Configuration][Configuration]]
|
- [[#configuration][Configuration]]
|
||||||
- [[Register a REPL for a major-mode][Register a REPL for a major-mode]]
|
- [[#register-a-repl-for-a-major-mode][Register a REPL for a major-mode]]
|
||||||
- [[Change how code is evaluated in a major mode][Change how code is evaluated in a major mode]]
|
- [[#change-how-code-is-evaluated-in-a-major-mode][Change how code is evaluated in a major mode]]
|
||||||
- [[Troubleshooting][Troubleshooting]]
|
- [[#troubleshooting][Troubleshooting]]
|
||||||
|
|
||||||
* Description
|
* Description
|
||||||
This modules adds inline code evaluation support to Emacs and a universal
|
This modules adds inline code evaluation support to Emacs and a universal
|
||||||
|
@ -38,8 +38,9 @@ interface for opening and interacting with REPLs.
|
||||||
* Prerequisites
|
* Prerequisites
|
||||||
This module has no direct prerequisites.
|
This module has no direct prerequisites.
|
||||||
|
|
||||||
However, specific languages may require additional setup. Check the
|
However, many languages will require that you install their interpreters, code
|
||||||
documentation of that language's module for details.
|
runners and/or repls to power the functionality of this module. Visit the
|
||||||
|
documentation of their respective =:lang= module for instructions.
|
||||||
|
|
||||||
* Features
|
* Features
|
||||||
** Inline Code Evaluation
|
** Inline Code Evaluation
|
||||||
|
@ -51,12 +52,13 @@ Quickrun can be invoked via:
|
||||||
|
|
||||||
** REPLs
|
** REPLs
|
||||||
Invoked via:
|
Invoked via:
|
||||||
+ =SPC o r= or ~:repl~ will open a REPL in a popup window. =C-u SPC o r= or
|
+ =SPC o r= or ~:repl~ will open a REPL in a popup window. =SPC o R= or ~:repl!~
|
||||||
~:repl!~ will open a REPL in the current window. If a REPL is already open and
|
will open a REPL in the current window. If a REPL is already open and a
|
||||||
a selection is active, it will be sent to the REPL.
|
selection is active, it will be sent to the REPL.
|
||||||
+ ~M-x +eval/open-repl-other-window~
|
+ ~M-x +eval/open-repl-other-window~ (=SPC o r=)
|
||||||
+ ~M-x +eval/open-repl-same-window~
|
+ ~M-x +eval/open-repl-same-window~ (=SPC o R=)
|
||||||
+ ~M-x +eval/send-region-to-repl~ while a selection (and REPL) is active
|
+ ~M-x +eval/send-region-to-repl~ (=SPC c s=) while a selection (and REPL) is
|
||||||
|
active
|
||||||
|
|
||||||
* Configuration
|
* Configuration
|
||||||
** Register a REPL for a major-mode
|
** Register a REPL for a major-mode
|
||||||
|
@ -68,12 +70,16 @@ To use them, you may use ~M-x +eval/open-repl-other-window~, ~M-x
|
||||||
=SPC o r=. These will open a REPL in a popup window.
|
=SPC o r=. These will open a REPL in a popup window.
|
||||||
|
|
||||||
#+begin_quote
|
#+begin_quote
|
||||||
You can simply call that mode's REPL command manually. e.g. ~M-x ielm~, but
|
You can simply call that mode's REPL command manually. e.g. ~M-x ielm~, but this
|
||||||
|
will bar you from the benefits of Doom's REPL system (like send-to-repl
|
||||||
|
functionality).
|
||||||
#+end_quote
|
#+end_quote
|
||||||
|
|
||||||
Otherwise, you can define your own for a specified major mode:
|
Otherwise, you can define your own for a specified major mode:
|
||||||
|
|
||||||
~(set-repl-handler! MAJOR-MODE FUNCTION)~
|
~(set-repl-handler! MAJOR-MODES FUNCTION)~
|
||||||
|
|
||||||
|
MAJOR-MODES is a single major mode symbol or a list of them.
|
||||||
|
|
||||||
FUNCTION should return a repl buffer. Any window changes in this function are
|
FUNCTION should return a repl buffer. Any window changes in this function are
|
||||||
ignored, then the REPL is opened in a popup window.
|
ignored, then the REPL is opened in a popup window.
|
||||||
|
@ -116,4 +122,4 @@ Or if you'd rather run an elisp command:
|
||||||
(set-eval-handler! 'emacs-lisp-mode #'+emacs-lisp-eval)
|
(set-eval-handler! 'emacs-lisp-mode #'+emacs-lisp-eval)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Troubleshooting
|
* TODO Troubleshooting
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue