diff options
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.sty | 17 |
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}}} + |