feature/eval: update README (remove :repl)

And use a simpler set-repl-handler! example.
This commit is contained in:
Henrik Lissner 2019-01-05 16:55:01 -05:00
parent d82745844b
commit fffee76f7a
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -67,26 +67,20 @@ default binding: =SPC o r=. These will open a REPL in a popup window.
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
#+end_quote #+end_quote
Otherwise, you can define your own for a specified major-mode with the =:repl= Otherwise, you can define your own for a specified major mode:
setting.
~(set! :repl MAJOR-MODE FUNCTION)~ ~(set-repl-handler! MAJOR-MODE FUNCTION)~
FUNCTION should be a command that opens a repl buffer. Any window changes are FUNCTION should return a repl buffer. Any window changes in this function are
ignored, then handed off to shackle (assuming shackle-mode is on) to display in ignored, then the REPL is opened in a popup window.
a popup window.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defun +emacs-lisp/repl () (defun +lua/repl ()
(interactive) (interactive)
(pop-to-buffer (lua-start-process "lua" "lua")
(or (get-buffer "*ielm*") (pop-to-buffer lua-process-buffer))
(progn (ielm)
(let ((buf (get-buffer "*ielm*")))
(bury-buffer buf)
buf)))))
(set-repl-handler! 'emacs-lisp-mode #'+emacs-lisp/repl) (set-repl-handler! 'lua-mode #'+lua/repl)
#+END_SRC #+END_SRC
** Change how code is evaluated in a major mode ** Change how code is evaluated in a major mode