[latex3-commits] [latex2e-public] r1448 - Bug fix - extra spaces with \babelensure

noreply at latex-project.org noreply at latex-project.org
Mon Apr 10 14:03:52 CEST 2017


Author: javier
Date: 2017-04-10 14:03:52 +0200 (Mon, 10 Apr 2017)
New Revision: 1448

Added:
   trunk/required/babel/testfiles/tsx361833.lvt
   trunk/required/babel/testfiles/tsx361833.tlg
Modified:
   trunk/required/babel/README
   trunk/required/babel/babel.dtx
   trunk/required/babel/babel.pdf
   trunk/required/babel/bbcompat.dtx
   trunk/required/babel/bbunicode.dtx
Log:
Bug fix - extra spaces with \babelensure

Modified: trunk/required/babel/README
===================================================================
--- trunk/required/babel/README	2017-04-07 17:03:52 UTC (rev 1447)
+++ trunk/required/babel/README	2017-04-10 12:03:52 UTC (rev 1448)
@@ -1,11 +1,11 @@
-Babel 3.9r
+Babel 3.9s
 ----------
 
-This is Babel 3.9r.
+This is Babel 3.9s.
 
 *** Babel 3.9o and 3.9p are deprecated ***
 *** For incompatibilities with polyglossia read the manual ***
-*** You must recreate the formats if coming from an older version ***
+*** You must recreate the formats if coming from version <3.9q ***
 
 Version 3.9a fixed lots of bugs and added some new features, intended
 mainly to make it compatible somehow with Unicode engines. Some bugs
@@ -106,6 +106,7 @@
       - bbunicode - Fixed a line break at \cs{foreignlanguage} with
         unloaded patterns. Also added \babelcatcodetablenum, just in
 	case.
+3.9s  - Bug fix - extra speces with \babelensure
 
 * bbunicode.dtx
 1.0b  - Improvements by Elie Roux for LuaTeX.
@@ -122,5 +123,5 @@
 
 ------------
 Javier Bezos
-2016-04-23
+2017-04-10
 

Modified: trunk/required/babel/babel.dtx
===================================================================
--- trunk/required/babel/babel.dtx	2017-04-07 17:03:52 UTC (rev 1447)
+++ trunk/required/babel/babel.dtx	2017-04-10 12:03:52 UTC (rev 1448)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright 2012-2016 Javier Bezos and Johannes L. Braams.
+% Copyright 2012-2017 Javier Bezos and Johannes L. Braams.
 % Copyright 1989-2012 Johannes L. Braams and any individual authors
 % listed elsewhere in this file. 
 % All rights reserved.
@@ -36,7 +36,7 @@
 %\iffalse
 %% File 'babel.dtx'
 %\fi
-%%\ProvidesFile{babel.dtx}[2016/04/23 v3.9r The Babel package]
+%%\ProvidesFile{babel.dtx}[2017/04/10 v3.9s The Babel package]
 %\iffalse
 %
 % Babel DOCUMENT-STYLE option for LaTeX version 2.09 or plain TeX;
@@ -45,7 +45,7 @@
 %% Copyright (C) 1989-2008 by Johannes Braams,
 %%                            TeXniek
 %%                            all rights reserved.
-%% Copyright (C) 2013-2016 by Johannes Braams 
+%% Copyright (C) 2013-2017 by Johannes Braams 
 %%                            TeXniek
 %%                            by Javier Bezos
 %%                            all rights reserved.
@@ -196,8 +196,8 @@
 \vspace{2cm}\hspace{1.5cm}
 \begin{minipage}{5cm}
 \Large
-Version 3.9r\newline
-2016/04/23
+Version 3.9s\newline
+2017/04/10
 
 \vspace{1cm}
 \textit{Original author}\newline
@@ -2433,7 +2433,7 @@
 %    little bit of literate programming.
 %
 %    \begin{macrocode}
-%<<version=3.9r>>
+%<<version=3.9s>>
 %<<date=2016/04/23>>
 %    \end{macrocode}
 %
@@ -3474,6 +3474,9 @@
 % \changes{babel~3.9i}{2014/02/14}{Macro \cs{babelensure} added}
 % \changes{babel~3.9k}{2014/03/23}{Encapsulate \cs{foreignlanguage} in
 %   \cs{bbl at ensure@}language, to "protect" strings}
+% \changes{babel~3.9s}{2017/04/10}{Bug fix - extra spaces because a
+%   missing percent}
+% \changes{babel~3.9s}{2017/04/10}{\cs{bbl at ensure@lang} defined only once}
 %
 %    \begin{macrocode}
 \newcommand\babelensure[2][]{%
@@ -3505,19 +3508,20 @@
     \ifx##1\@empty\else
       \in@{##1}{#2}%
       \ifin@\else
+        \@ifundefined{bbl at ensure@\languagename}%
+          {\edef\bbl at tempa{%
+            \noexpand\DeclareRobustCommand
+            \bbl at csarg\noexpand{ensure@\languagename}[1]{%
+              \noexpand\foreignlanguage{\languagename}%
+              {\ifx\relax#3\else
+                \noexpand\fontencoding{#3}\noexpand\selectfont
+               \fi
+               ########1}}}%
+          \bbl at tempa}{}%
         \toks@\expandafter{##1}%
-        \edef\bbl at tempa{%
-          \noexpand\DeclareRobustCommand
-          \bbl at csarg\noexpand{ensure@\languagename}[1]{%
-            \noexpand\foreignlanguage{\languagename}%
-            {\ifx\relax#3\else
-              \noexpand\fontencoding{#3}\noexpand\selectfont
-             \fi
-             ########1}}}%
-        \bbl at tempa
         \edef##1{%
            \bbl at csarg\noexpand{ensure@\languagename}%
-           {\the\toks@}}
+           {\the\toks@}}%
       \fi
       \expandafter\bbl at tempb
     \fi}%

Modified: trunk/required/babel/babel.pdf
===================================================================
(Binary files differ)

Modified: trunk/required/babel/bbcompat.dtx
===================================================================
--- trunk/required/babel/bbcompat.dtx	2017-04-07 17:03:52 UTC (rev 1447)
+++ trunk/required/babel/bbcompat.dtx	2017-04-10 12:03:52 UTC (rev 1448)
@@ -30,7 +30,7 @@
 %
 % \iffalse
 %<*dtx>
-\ProvidesFile{bbcompat.dtx}[2016/04/23 v3.9r]
+\ProvidesFile{bbcompat.dtx}[2017/04/10 v3.9s]
 %</dtx>
 %
 %% File 'bbcompat.dtx'

Modified: trunk/required/babel/bbunicode.dtx
===================================================================
--- trunk/required/babel/bbunicode.dtx	2017-04-07 17:03:52 UTC (rev 1447)
+++ trunk/required/babel/bbunicode.dtx	2017-04-10 12:03:52 UTC (rev 1448)
@@ -1,6 +1,6 @@
 % \iffalse meta-comment
 %
-% Copyright 2013-2016 Javier Bezos and any individual authors
+% Copyright 2013-2017 Javier Bezos and any individual authors
 % listed elsewhere in this file.  All rights reserved.
 % 
 % This file is part of the Babel system.
@@ -31,12 +31,12 @@
 % \iffalse
 %<*dtx>
 \ProvidesFile{bbunicode.dtx}
-       [2016/04/23 v3.9r Babel hooks for Unicode engines]
+       [2017/04/10 v3.9s Babel hooks for Unicode engines]
 %</dtx>
 %
 %% File `bbunicode.dtx'
 %% Babel package for LaTeX version 2e
-%% Copyright (C) 2103-2016
+%% Copyright (C) 2103-2017
 %%           by Javier Bezos
 %
 %<*filedriver>

Added: trunk/required/babel/testfiles/tsx361833.lvt
===================================================================
--- trunk/required/babel/testfiles/tsx361833.lvt	                        (rev 0)
+++ trunk/required/babel/testfiles/tsx361833.lvt	2017-04-10 12:03:52 UTC (rev 1448)
@@ -0,0 +1,40 @@
+% Spaces added by \babelensure with \selectlanguage
+
+\input{test2e}
+\documentclass[welsh,british]{article}
+\START
+\AUTHOR{Javier Bezos}
+\CLASS[welsh,british]{article}
+\PACKAGE{babel}
+\OMIT
+
+\usepackage{babel}
+
+\newcommand{\cymraeg}[1]{{\selectlanguage{welsh}#1}}
+\newcommand{\welsh}[1]{\foreignlanguage{welsh}{#1}}
+
+\babelensure{welsh}
+
+\makeatletter
+\def\TestPos#1{%
+  \gdef\TestAuxMessage##1{\message{^^JTIMO^^J##1^^JOMIT^^J}}%
+  \pdfsavepos
+  \protected at write\@mainaux{}%
+    {\protect\TestAuxMessage{#1 \string= \noexpand\the\pdflastxpos,
+    \noexpand\the\pdflastypos}}}
+\def\TestAuxMessage#1{}
+\makeatother
+
+\begin{document}
+\TIMO
+
+\newcommand*{\colophonname}{\cymraeg{Coloffon}---Colophon\TestPos{select}}
+
+\section*{\colophonname}
+
+\renewcommand*{\colophonname}{\welsh{Coloffon}---Colophon\TestPos{foreign}}
+
+\section*{\colophonname}
+
+\OMIT
+\end{document}

Added: trunk/required/babel/testfiles/tsx361833.tlg
===================================================================
--- trunk/required/babel/testfiles/tsx361833.tlg	                        (rev 0)
+++ trunk/required/babel/testfiles/tsx361833.tlg	2017-04-10 12:03:52 UTC (rev 1448)
@@ -0,0 +1,8 @@
+This is a generated file for the LaTeX2e validation system.
+Don't change this file in any respect.
+Author: Javier Bezos
+Main Class: article
+    Options: welsh,british
+Package: babel
+select = 18148214, 46515936
+foreign = 18148214, 44687301



More information about the latex3-commits mailing list