summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/babel/switch.def
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-04-01 21:10:44 +0000
committerKarl Berry <karl@freefriends.org>2019-04-01 21:10:44 +0000
commitde9dc4bb86a87f4d72b59034b56593313b2e8c8a (patch)
treeafcde74e28915439fef0d65c8a1eefeb9dc9df7a /Master/texmf-dist/tex/generic/babel/switch.def
parent98766f71d95e3aa7dcf598359ffb0f9902c73797 (diff)
babel (1apr19)
git-svn-id: svn://tug.org/texlive/trunk@50699 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel/switch.def')
-rw-r--r--Master/texmf-dist/tex/generic/babel/switch.def54
1 files changed, 37 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/generic/babel/switch.def b/Master/texmf-dist/tex/generic/babel/switch.def
index 486e4da6b14..6495fb6ab65 100644
--- a/Master/texmf-dist/tex/generic/babel/switch.def
+++ b/Master/texmf-dist/tex/generic/babel/switch.def
@@ -37,7 +37,7 @@
\wlog{File: #1 #4 #3 <#2>}%
\let\ProvidesFile\@undefined}
\fi
-\ProvidesFile{switch.def}[2018/11/13 3.27 Babel switching mechanism]
+\ProvidesFile{switch.def}[2019/04/01 3.28 Babel switching mechanism]
\ifx\AtBeginDocument\@undefined
\input plain.def\relax
\fi
@@ -58,8 +58,8 @@
\countdef\last@language=19
\def\addlanguage{\alloc@9\language\chardef\@cclvi}
\fi
-\def\bbl@version{3.27}
-\def\bbl@date{2018/11/13}
+\def\bbl@version{3.28}
+\def\bbl@date{2019/04/01}
\def\adddialect#1#2{%
\global\chardef#1#2\relax
\bbl@usehooks{adddialect}{{#1}{#2}}%
@@ -115,19 +115,22 @@
\aftergroup\bbl@pop@language
\bbl@set@language{#1}}
\def\BabelContentsFiles{toc,lof,lot}
-\def\bbl@set@language#1{%
+\def\bbl@set@language#1{% from selectlanguage, pop@
\edef\languagename{%
\ifnum\escapechar=\expandafter`\string#1\@empty
\else\string#1\@empty\fi}%
\select@language{\languagename}%
+ % write to auxs
\expandafter\ifx\csname date\languagename\endcsname\relax\else
\if@filesw
\protected@write\@auxout{}{\string\babel@aux{\languagename}{}}%
\bbl@usehooks{write}{}%
\fi
\fi}
-\def\select@language#1{%
+\def\select@language#1{% from set@, babel@aux
+ % set hymap
\ifnum\bbl@hymapsel=\@cclv\chardef\bbl@hymapsel4\relax\fi
+ % set name
\edef\languagename{#1}%
\bbl@fixname\languagename
\bbl@iflanguage\languagename{%
@@ -140,6 +143,7 @@
some cases, you may need to remove the aux file}%
{You may proceed, but expect wrong results}%
\else
+ % set type
\let\bbl@select@type\z@
\expandafter\bbl@switch\expandafter{\languagename}%
\fi}}
@@ -162,7 +166,8 @@
\select@language{#1}}
\let\select@language@x\select@language
\newif\ifbbl@usedategroup
-\def\bbl@switch#1{%
+\def\bbl@switch#1{% from select@, foreign@
+ % restore
\originalTeX
\expandafter\def\expandafter\originalTeX\expandafter{%
\csname noextras#1\endcsname
@@ -170,6 +175,7 @@
\babel@beginsave}%
\bbl@usehooks{afterreset}{}%
\languageshorthands{none}%
+ % switch captions, date
\ifcase\bbl@select@type
\ifhmode
\hskip\z@skip % trick to ignore spaces
@@ -180,19 +186,27 @@
\csname captions#1\endcsname\relax
\csname date#1\endcsname\relax
\fi
- \else\ifbbl@usedategroup
- \bbl@usedategroupfalse
- \ifhmode
- \hskip\z@skip % trick to ignore spaces
- \csname date#1\endcsname\relax
- \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
- \else
- \csname date#1\endcsname\relax
+ \else
+ \ifbbl@usedategroup % if \foreign... within \<lang>date
+ \bbl@usedategroupfalse
+ \ifhmode
+ \hskip\z@skip % trick to ignore spaces
+ \csname date#1\endcsname\relax
+ \loop\ifdim\lastskip>\z@\unskip\repeat\unskip
+ \else
+ \csname date#1\endcsname\relax
+ \fi
\fi
- \fi\fi
+ \fi
+ % switch extras
\bbl@usehooks{beforeextras}{}%
\csname extras#1\endcsname\relax
\bbl@usehooks{afterextras}{}%
+ % > babel-ensure
+ % > babel-sh-<short>
+ % > babel-bidi
+ % > babel-fontspec
+ % hyphenation - case mapping
\ifcase\bbl@opt@hyphenmap\or
\def\BabelLower##1##2{\lccode##1=##2\relax}%
\ifnum\bbl@hymapsel>4\else
@@ -205,7 +219,9 @@
\fi
\fi
\global\let\bbl@hymapsel\@cclv
+ % hyphenation - patterns
\bbl@patterns{#1}%
+ % hyphenation - mins
\babel@savevariable\lefthyphenmin
\babel@savevariable\righthyphenmin
\expandafter\ifx\csname #1hyphenmins\endcsname\relax
@@ -249,18 +265,21 @@
{\par}%
\endgroup}
\def\foreign@language#1{%
+ % set name
\edef\languagename{#1}%
\bbl@fixname\languagename
\bbl@iflanguage\languagename{%
\expandafter\ifx\csname date\languagename\endcsname\relax
- \bbl@warning
+ \bbl@warning % TODO - why a warning, not an error?
{Unknown language `#1'. Either you have\\%
misspelled its name, it has not been installed,\\%
or you requested it in a previous run. Fix its name,\\%
- install it or just rerun the file, respectively.\\%
+ install it or just rerun the file, respectively. In\\%
+ some cases, you may need to remove the aux file.\\%
I'll proceed, but expect wrong results.\\%
Reported}%
\fi
+ % set type
\let\bbl@select@type\@ne
\expandafter\bbl@switch\expandafter{\languagename}}}
\let\bbl@hyphlist\@empty
@@ -277,6 +296,7 @@
\edef\bbl@tempa{#1:\f@encoding}%
\fi
\@expandtwoargs\bbl@usehooks{patterns}{{#1}{\bbl@tempa}}%
+ % > luatex
\@ifundefined{bbl@hyphenation@}{}{% Can be \relax!
\begingroup
\bbl@xin@{,\number\language,}{,\bbl@hyphlist}%