summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-04 00:18:26 +0000
committerKarl Berry <karl@freefriends.org>2014-01-04 00:18:26 +0000
commitb726d3267b3e2c379d7e1e8e4302ab8339f0bccd (patch)
treed91ecd35f96891b43e4758c04e87fe255970fbfd /Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty
parentf5e68d092b878b0f0d86b10cbd8830cf08a153b8 (diff)
lisp-on-tex (3jan14)
git-svn-id: svn://tug.org/texlive/trunk@32561 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty')
-rw-r--r--Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty17
1 files changed, 16 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty b/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty
index 7d7c24b7301..87345706583 100644
--- a/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty
+++ b/Master/texmf-dist/tex/latex/lisp-on-tex/lisp-string.sty
@@ -25,7 +25,7 @@
%% IMMEDIATEWRITE : () -> ()
%% It outputs the output buffer immediately.
-%% It cause error if the buffer is imcomlete.
+%% It cause error if the buffer is incomplete.
\addassoc\@globalenv\immediatewrite{\@tlabel@func{\@immediate@write}}
\def\@immediate@write#1{%
\gdef#1{\@tlabel@nil{}}%
@@ -60,5 +60,20 @@
The argument of ungroup must be a grouped string.}%
\fi}
+%% FGETS : () -> string
+%% (\fgets) -> read tokens from standard-in
+\addassoc\@globalenv\fgets{\@tlabel@func{\@text@fgets}}
+\def\@text@fgets#1{%
+\endlinechar=-1
+\read-1to#1%
+\expandafter\gdef\expandafter#1\expandafter{\expandafter\@tlabel@string\expandafter{#1}}}
+
+%% EXPAND : string -> string
+%% (\expand '<token>') -> '<token+>' where <token+> is expanded tokens of <token>
+\addassoc\@globalenv\expand{\@tlabel@func{\@lot@text@expand}}
+\def\@lot@text@expand#1\@tlabel@string#2{%
+ \edef\@temp@i{#2}%
+ \xdef#1{\noexpand\@tlabel@string{\@temp@i}}}
+