From 15995e10bfc68edf79970c4ea4fbb6678566c46e Mon Sep 17 00:00:00 2001 From: Mojca Miklavec Date: Mon, 14 May 2012 17:38:55 +0000 Subject: ConTeXt 2012.05.14 16:00 git-svn-id: svn://tug.org/texlive/trunk@26371 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/context/base/lang-url.mkiv | 54 ++++++++++++++++-------- 1 file changed, 36 insertions(+), 18 deletions(-) (limited to 'Master/texmf-dist/tex/context/base/lang-url.mkiv') diff --git a/Master/texmf-dist/tex/context/base/lang-url.mkiv b/Master/texmf-dist/tex/context/base/lang-url.mkiv index cba013324c7..1bbe1683830 100644 --- a/Master/texmf-dist/tex/context/base/lang-url.mkiv +++ b/Master/texmf-dist/tex/context/base/lang-url.mkiv @@ -5,7 +5,7 @@ %D subtitle=Language Options, %D author=Hans Hagen, %D date=\currentdate, -%D copyright={PRAGMA / Hans Hagen \& Ton Otten}] +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for @@ -15,6 +15,9 @@ \unprotect +%D Traditionally this code is in the language namespace as +%D hyphenation relates to languages. + %D \macros %D {hyphenatedurl} %D @@ -55,32 +58,47 @@ \let|=\letterbar \to \everyhyphenatedurl -\def\hyphenatedurlseparator{} % \periodcentered - -\def\dohyphenatedurlafter #1{\char#1\discretionary{}{\hyphenatedurlseparator}{}}% -\def\dohyphenatedurlbefore#1{\discretionary{\hyphenatedurlseparator}{}{}\char#1\relax}% -\def\dohyphenatedurlnormal#1{\char#1\relax}% -\def\dohyphenatedurldisc #1{\discretionary{}{}{}} +\let\hyphenatedurlseparator \empty % \periodcentered +\let\hyphenatedurldiscretionary\empty -\def\sethyphenatedurlnormal #1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,0)}} -\def\sethyphenatedurlbefore #1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,1)}} -\def\sethyphenatedurlafter #1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,2)}} +\setnewconstant\hyphenatedurllefthyphenmin \plusthree +\setnewconstant\hyphenatedurlrighthyphenmin\plusthree -\def\hyphenatedurldiscretionary{} +\def\lang_url_space {\nobreak\hskip\zeropoint plus\onepoint\nobreak} +\def\lang_url_after #1{\char#1\discretionary{}{\hyphenatedurlseparator}{}} +\def\lang_url_before #1{\discretionary{\hyphenatedurlseparator}{}{}\char#1\relax} +\def\lang_url_normal #1{\char#1\relax} +\def\lang_url_disc #1{\discretionary{}{}{}} + +\def\lang_url_space_trace {\nobreak\begingroup\darkyellow\ruledhskip\zeropoint plus\onepoint\endgroup\nobreak} +\def\lang_url_after_trace #1{\char#1\hsmash{\darkblue\vl}\discretionary{}{\hyphenatedurlseparator}{}} +\def\lang_url_before_trace#1{\discretionary{\hyphenatedurlseparator}{}{}\hsmash{\darkred\vl}\char#1\relax} +\def\lang_url_normal_trace#1{\char#1\relax} +\def\lang_url_disc_trace #1{\discretionary{\hsmash{\darkgreen\vl}}{\hsmash{\darkgreen\vl}}{\hsmash{\darkgreen\vl}}} + +\def\showhyphenatedurlbreaks + {\let\lang_url_space \lang_url_space_trace + \let\lang_url_after \lang_url_after_trace + \let\lang_url_before\lang_url_before_trace + \let\lang_url_normal\lang_url_normal_trace + \let\lang_url_disc \lang_url_disc_trace} + +\def\sethyphenatedurlnormal#1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,0)}} % Lua names will change +\def\sethyphenatedurlbefore#1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,1)}} % Lua names will change +\def\sethyphenatedurlafter #1{\ctxcommand{hyphenatedurl.setcharacters(\!!bs#1\!!es,2)}} % Lua names will change % \sethyphenatedurlafter{ABCDEF} -\setnewconstant\hyphenatedurllefthyphenmin \plusthree -\setnewconstant\hyphenatedurlrighthyphenmin\plusthree - \unexpanded \def\hyphenatedurl#1% {\dontleavehmode \begingroup \the\everyhyphenatedurl - \let\n\dohyphenatedurlnormal - \let\b\dohyphenatedurlbefore - \let\a\dohyphenatedurlafter - \let\d\dohyphenatedurldisc + \normallanguage\zerocount + \let\s\lang_url_space + \let\a\lang_url_after + \let\b\lang_url_before + \let\n\lang_url_normal + \let\d\lang_url_disc \normalexpanded{\noexpand\ctxcommand{hyphenatedurl( \!!bs\noexpand\detokenize{#1}\!!es, \number\hyphenatedurllefthyphenmin, -- cgit v1.2.3