[luatex] Another REPL
Eduardo Ochs
eduardoochs at gmail.com
Tue Jan 12 02:54:46 CET 2021
Hi list,
Here is another REPL:
https://github.com/edrx/edrxrepl#Introduction
It was also inspired by Rob Hoelz's lua-repl - as the one that Robert
Krug announced a few hours ago in this other thread,
https://tug.org/pipermail/luatex/2021-January/007458.html
but mine is a rewrite from scratch. One way to test it (ta-da: without
git!) is this:
rm -Rfv /tmp/edrxrepl
mkdir /tmp/edrxrepl/
cd /tmp/edrxrepl/
wget http://angg.twu.net/edrxrepl/edrxrepl.lua
wget http://angg.twu.net/edrxrepl/edrxrepltest.tex
lualatex edrxrepltest.tex
Here is a slightly edited transcript of a session:
/tmp/edrxrepl(edrx:sc)# lualatex edrxrepltest.tex
This is LuaTeX, Version 1.10.0 (TeX Live 2019)
restricted system commands enabled.
(./edrxrepltest.tex
LaTeX2e <2020-02-02> patch level 5
(some lines deleted...)
Run REPL.stop = 1 to leave the REPL.
>>>
>>> mt = function (s) tok = token.create(s); print(tok) end
>>> ma = function (s) print(token.get_macro(s)) end
>>> me = function (s) print(token.get_meaning(s)) end
>>> ma "break"
\protect \break
>>> me "break"
->\protect \break
>>> ma "section"
\@startsection {section}{1}{\z@ }{-3.5ex \@plus -1ex \@minus
-.2ex}{2.3ex \@plus .2ex}{\normalfont \Large \bfseries }
>>> ma "@startsection"
\if at noskipsec \leavevmode \fi \@tempskipa #4\relax \@afterindenttrue
\ifdim \@tempskipa <\z@ \@tempskipa -\@tempskipa \@afterindentfalse
\fi \if at nobreak \everypar {}\else \addpenalty \@secpenalty \addvspace
\@tempskipa \fi \@ifstar {\@ssect {#3}{#4}{#5}{#6}}{\@dblarg {\@sect
{#1}{#2}{#3}{#4}{#5}{#6}}}
>>> os.exit()
/tmp/edrxrepl(edrx:sc)#
I've been using Emacs and eev to script REPL sessions, more of less
like this,
http://www.youtube.com/watch?v=86yiRG8YJD0#t=15m56s
but I still find many things very hard to discover. It would be great
if other people could share their workflows for using REPLs in
Lua(La)TeX...
Cheers,
Eduardo Ochs
http://angg.twu.net/#eev
http://angg.twu.net/emacsconf2020.html
More information about the luatex
mailing list.