From f644821cc208a45a8125338e7bedde7e465e4353 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Fri, 13 May 2011 20:10:15 +0200 Subject: =?UTF-8?q?using=20the=20extremely=20robust=20=E2=80=9Cdoifnextcha?= =?UTF-8?q?relse=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tex/context/third/letterspace/t-letterspace.mkiv | 31 +++--------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/tex/context/third/letterspace/t-letterspace.mkiv b/tex/context/third/letterspace/t-letterspace.mkiv index ce3f026..fbc0895 100644 --- a/tex/context/third/letterspace/t-letterspace.mkiv +++ b/tex/context/third/letterspace/t-letterspace.mkiv @@ -87,35 +87,12 @@ \fi \fi% {\letterspace_setstuff\currentobject}% - \doifnextspace{% + % Hans’ macro \doifnextcharelse works a lot better than my + % previously defined kludge … + \doifnextcharelse{\blankspace}{% {\letterspace_setstuff\ }% \gobblespacetokens% - }% -} - -%D This is a partial ripoff of a couple of macros from -%D \type{syst-aux.mkiv}. -%D \useURL [flet] [http://www.tug.org/TUGboat/Articles/tb09-3/tb22bechtolsheim.pdf] [] [\type{futurelet}] -%D Very helpful for further understanding of what’s exactly going -%D on: Stephan von Bechtolsheim’s tutorial on \from[flet]. -%D -%D In short: the trick is checking whether the token following -%D the command is a space, that is: whether it expands to -%D \type{\blankspace}. If the test succeeds, a space will be -%D added that has the correct parameters and all space tokens -%D following the command will be gobbled. Otherwise -- the next -%D token being anything else -- \type{\letterspace} will proceed -%D without changing anything. - -\def\doifnextspace#1{% - \def\!!string{#1}% - \futurelet\nexttoken\inspectnexttoken% -} - -\def\inspectnexttoken{% - \ifx\nexttoken\blankspace - \@EA\!!string - \fi% + }{}% } %D \macros -- cgit v1.2.3