summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/msg
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-10-07 20:34:51 +0000
committerKarl Berry <karl@freefriends.org>2006-10-07 20:34:51 +0000
commit60a45a6e821196e03a1b74a69b6b5821693288aa (patch)
tree6561dd6a85e9f34421a40fabdf3d42d6b759035f /Master/texmf-dist/tex/latex/msg
parent07f227511dcbf1e141f45c38947c6430d58e8012 (diff)
msg v0.40 update (6oct06)
git-svn-id: svn://tug.org/texlive/trunk@2265 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/msg')
-rw-r--r--Master/texmf-dist/tex/latex/msg/msg.sty148
1 files changed, 94 insertions, 54 deletions
diff --git a/Master/texmf-dist/tex/latex/msg/msg.sty b/Master/texmf-dist/tex/latex/msg/msg.sty
index 6dc6cd62e5f..21f1f003caf 100644
--- a/Master/texmf-dist/tex/latex/msg/msg.sty
+++ b/Master/texmf-dist/tex/latex/msg/msg.sty
@@ -13,21 +13,24 @@
\iffalse checksum part
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
-%% checksum = "54410 1466 6398 61162"
+%% checksum = "21854 1564 6785 65053"
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\fi
-\def\fileversion{V0.20}\def\filedate{2005/01/24}%
+\def\fileversion{V0.40}\def\filedate{2006/10/03}%
\ifx\issuemsg\undefined\else\expandafter\endinput\fi%
\ifnum\catcode`\@=11\else\expandafter\catcode`\@=11\fi%
-\ifx\LdfInit\@undefined% We need inputenc package.
- \RequirePackage{inputenc}% Usually, load that package.
-\else% But with Babel, dont use \usepackage or such,
- \let\@msg@tempa\@currname% Save current package name.
- \xdef\@currname{inputenc}% set package req.
- \@@input inputenc.sty% and input it now.
- \makeatletter%
- \let\@currname\@msg@tempa% Reset original package name.
+\ifx\kbencoding\undefined% If we don't have any keyboard reencoding
+ \ifx\LdfInit\@undefined% we need at least inputenc package.
+ \RequirePackage{inputenc}% Usually, load that package.
+ \else% But with Babel, dont use \usepackage or such,
+ \let\@msg@tempa\@currname% Save current package name.
+ \xdef\@currname{inputenc}% set package req.
+ \@@input inputenc.sty% and input it now.
+ \makeatletter%
+ \let\@currname\@msg@tempa% Reset original package name.
+ \fi%
+ \let\@previeg\empty% We have no encoding at this time.
\fi%
\ifx\issuemsgio\undefined\let\issuemsgio\typeout\fi%
\def\@msg@tempa{dummy}%
@@ -78,19 +81,6 @@
\ifx\MessageBreak\relax%
\def\MessageBreak{^^J\expandafter\@msgalign\msg@header\void}%
\fi%
-\def\@msg@tempa{#1}% TeX cs requires {arg}:
-\def\@msg@tempb{\message}%
-\ifx\@msg@tempa\@msg@tempb%
- \def\@msg@txt{{%
- \themsg\themsgi\themsgii\themsgiii%
- }}%
-\fi%
-\def\@msg@tempb{\errmessage}%
-\ifx\@msg@tempa\@msg@tempb%
- \def\@msg@txt{{%
- \themsg\themsgi\themsgii\themsgiii%
- }}%
-\fi%
\let\@msg@txt@\empty%
\def\@msg@tempb##1##2/{\let\@msg@tempb=##1}%
\def\@msg@tempa{\let\if@msg@pkg@error\iftrue}%
@@ -104,9 +94,12 @@
\ifx\undefined#1\retrievemsg2(msg)%
\PackageWarning{msg}\@msg@txt%
\else\retrievemsg#2(#3)[#4]%
- \edef\@msg@txt{\@msg@txt}%
- \edef\@msg@txt@{\@msg@txt@}%
+ \ifx\kbencoding\undefined% Expand text now if
+ \edef\@msg@txt{\@msg@txt}% output encoding is
+ \edef\@msg@txt@{\@msg@txt@}% not available.
+ \fi%
\@relaxORgobble\@msg@iocmd{\@msg@txt}{\@msg@txt@}%
+%%% \csname @originalkbe\endcsname% Get back encoding if necessary.
\fi%
\let\MessageBreak\@msg@MBori%
}%
@@ -128,12 +121,21 @@
\let\msgtrailerOLD\msgtrailer%
\let\msgencodingOLD\msgencoding%
\let\spaceOLD\space%
+ \let\UTFviii@two@octetsOLD\UTFviii@two@octets%
+ \let\UTFviii@two@octetsOLD\UTFviii@two@octets%
+ \let\UTFviii@four@octetsOLD\UTFviii@four@octets%
+ \let\UTFviii@two@octets\string% If utf8 was loaded then
+ \let\UTFviii@three@octets\string% nullify it until
+ \let\UTFviii@four@octets\string% necessary.
\def\msgheader{\protect\msgheader}%
\def\msgtrailer{\protect\msgtrailer}%
\def\msgencoding{\protect\msgencoding}%
- \def\space{\protect\space}%
+ \def\space{\noexpand\space}%
\def\help{\protect\helpi}%
\protected@edef\@msg@tempf{\@msg@tempf\@msgline}%
+ \let\UTFviii@two@octets\UTFviii@two@octetsOLD%
+ \let\UTFviii@two@octets\UTFviii@two@octetsOLD%
+ \let\UTFviii@four@octets\UTFviii@four@octetsOLD%
\let\space\spaceOLD%
\let\msgheader\msgheaderOLD%
\let\msgtrailer\msgtrailerOLD%
@@ -144,7 +146,8 @@
\let\msgencodingOLD\undefined%
\fi%
}%
- \newread\@inputmsg%
+ \let\endinputORI\endinput% Save \endinput for any use in an alone \msgencoding
+ \newread\@inputmsg% We'll need it at least for the banner message.
\def\@@input@msg@filename{% Doing nearly like \@@input\msg@filename
\openin\@inputmsg=\msg@filename\@msg@moretrue%
\let\msgparti\relax%
@@ -204,16 +207,14 @@
\fi%
\edef\msg@inputlineno{the\inputlineno}%
\makeatletter%
- \let\@msg@gobble@space\relax% Req. when \msgheader in first line.
+ \let\@msg@gobble@space\relax% Case \msgheader in 1st line.
\let\reserved@a\@gobble% Avoid runaway.
- \bgroup\@@input@msg@filename\relax\egroup% Protected marmelade.
+ \bgroup\@@input@msg@filename\relax\egroup%
\let\msg@cmd\relax%
\csname msg@MPI\endcsname% req. when ltxdoc
\ifx\themsg\empty% Unusual end of file reached.
\def\@msg@tempa{\let\msg@empty\relax% to avoid loop.
- \makeatletter%
\r@trievemsg6(msg)[]%
- \makeatother%
}%
\expandafter\@msg@tempa%
\fi%
@@ -241,8 +242,8 @@
\let\themsgiii\empty% message parts.
\set@argmsg\@msg@%
}%
-\def\@gobble@help#1#2{\@msgparts}% Case 2 lines \msg with \read but not \input.
-\long\def\@msg@#1{\def\@msg@tempd{%
+\def\@gobble@help#1#2{\@msgparts}% Case 2 lines \msg with \read
+\long\def\@msg@#1{\def\@msg@tempd{% but not \input.
\ifx\@msginput@usual\@@input@msg@filename%
\def\space{\noexpand\space}%
\protected@edef\msg@header{\msg@header}%
@@ -280,7 +281,7 @@
\def\@msg@tempb{\endinput\@msg@tempd%
\PackageWarningNoLine{msg}{\themsg%
\themsgi\themsgii\themsgiii}%
- \let\@relaxORgobble\@gobble}%
+ \global\let\@relaxORgobble\@gobble}%
\else\let\@msgparts@ORnot\@gobble%
\fi%
\fi%
@@ -320,7 +321,8 @@
\def\msgencoding#1{\ifx\empty#1\else% just disactive 8bits chars.
\let\iterateORI\iterate%
\def\@msg@encoding{#1}%
- \ifx\msg@cmd\issuemsg%\inputencoding{ascii}%
+ \ifx\msg@cmd\issuemsg% If there is not output encoding:
+ \ifx\kbencoding\undefined%\inputencoding{ascii}%
\def\@msgenc@loop##1##2{\@tempcnta`##1\relax%
\loop\catcode\@tempcnta=11%
\ifnum\@tempcnta<`##2\relax%
@@ -330,11 +332,22 @@
\@msgenc@loop\^^K\^^K%
\@msgenc@loop\^^N\^^_%
\@msgenc@loop\^^?\^^ff% 128-255
+%%% \global\let\@originalkbe\relax%
+ \else%
+%%% \xdef\@originalkbe{\noexpand\kbencoding{\@kbencoding}}%
+ \let\languagename\msg@languagename%
+ \let\msgidORI\msgid% Save current msgid because
+ \kbencoding{#1}% it may issue any message.
+ \let\msgid\msgidORI% Now reset it.
+ \@msg@moretrue% Continue file reading.
+ \fi%
\else\let\@latex@infoORI\@latex@info%
\let\@latex@info\@gobble%
\let\endinputBACK\endinput%
\let\endinput\endinputORI%
- \@msgencoding{#1}%
+ \let\msgidORI\msgid% Save current msgid because
+ \@msgencoding{#1}% it may issue any message.
+ \let\msgid\msgidORI% Now reset it.
\let\endinput\endinputBACK%
\let\@latex@info\@latex@infoORI%
\fi\makeatletter%
@@ -342,7 +355,19 @@
\fi%
}%
\let\@msg@encoding\empty% Unknown current encoding.
-\AtBeginDocument{\let\@msgencoding\inputencoding}%
+\ifx\kbencoding\undefined%
+ \AtBeginDocument{\let\@msgencoding\inputencoding}%
+ \let\inputencodingORI\inputencoding% Save \inputencoding code
+ \def\inputencoding#1{\def\@ieg{#1}\let\exec@ieg\relax% Avoid
+ \ifx\@ieg\@previeg\else% to load twice
+ \def\@previeg{#1}% the same encoding file.
+ \def\exec@ieg{\inputencodingORI\@ieg}%
+ \fi%
+ \exec@ieg%
+ }%
+\else%
+ \AtBeginDocument{\let\@msgencoding\kbencoding}%
+\fi%
\def\msgheader#1{\let\reserved@a\relax%
\def\msg@header{#1}\protect\@msgHTsptoken}%
\def\msgtrailer#1{\let\reserved@a\relax%
@@ -382,30 +407,42 @@
\let\msg@cmd\issuemsg%
\next%
}%
-\DeclareOption{message}{\let\issuemsgio\message}% TeX cs.
-\DeclareOption{wlog}{\let\issuemsgio\wlog}% Plain TeX cs.
-\DeclareOption{typeout}{\let\issuemsgio\typeout}% LaTeX cs.
-\DeclareOption{kbtypeout}{\let\issuemsgio\kbtypeout}% Keyboard cs.
-\DeclareOption{tracefiles}{\let\@@input@msg@filename\@msginput@usual%
- }%
+\ifx\intern@lc@llfrom\undefined% Options aren't declared for internal/kernel calls
+ \DeclareOption{message}{\let\issuemsgio\message}% TeX cs.
+ \DeclareOption{wlog}{\let\issuemsgio\wlog}% Plain TeX cs.
+ \DeclareOption{typeout}{\let\issuemsgio\typeout}% LaTeX cs.
+ \DeclareOption{kbtypeout}{\let\issuemsgio\kbtypeout}% Keyboard cs.
+\fi%
+\ifx\intern@lc@llfrom\undefined% Options aren't declared for internal/kernel calls
+ \DeclareOption{tracefiles}{\let\@@input@msg@filename\@msginput@usual}%
+\fi%
+\ifx\intern@lc@llfrom\undefined% Options aren't declared for internal/kernel calls
+ \DeclareOption{noop}{\def\@@input@msg@filename{\xdef\themsg{0}%
+ \xdef\themsgi{\string<msg noop\string>\space\msgid}%
+ }%
+ }%
+\fi%
\edef\nativelanguage{french}% This is my native language.
\let\on@lineORI\on@line%
\let\pwhORI\packagewarningheader%
-\DeclareOption{french}{% Mostly a testing option
- % or have msg's messages in French.
- \@msgINfrench}%
+\ifx\intern@lc@llfrom\undefined% Options aren't declared for internal/kernel calls
+ \DeclareOption{french}{% Mostly a testing option
+ % or have msg's messages in French.
+ \@msgINfrench}%
+\fi%
\def\@msgINfrench{%
\def\on@line{ (voir le source, ligne \the\inputlineno)}%
\def\packagewarningheader##1{Extension ##1 : ATTENTION, }%
\def\msg@languagename{french}}%
\edef\@msg@tempa{french}\ifx\languagename\@msg@tempa\@msgINfrench\fi%
-\DeclareOption*{% Once a language is provided we should
- \let\on@line\on@lineORI% reset to default.
- \let\packagewarningheader\pwhORI%
- \def\@msg@tempa{native}%
- \ifx\@msg@tempa\CurrentOption%
- \let\msg@languagename\nativelanguage%
- \else%
+\ifx\intern@lc@llfrom\undefined% Options aren't declared for internal/kernel calls
+ \DeclareOption*{% Once a language is provided we should
+ \let\on@line\on@lineORI% reset to default.
+ \let\packagewarningheader\pwhORI%
+ \def\@msg@tempa{native}%
+ \ifx\@msg@tempa\CurrentOption%
+ \let\msg@languagename\nativelanguage%
+ \else%
\expandafter%
\ifx\csname l@\CurrentOption\endcsname\relax%
\def\@msg@tempa{\retrievemsg3(msg)\PackageWarningNoLine{msg}%
@@ -414,7 +451,10 @@
\fi\@msg@tempa%
\fi%
}%
-\ProcessOptions% Process options
+\fi%
+\ifx\intern@lc@llfrom\undefined% No process of options for internal/kernel calls
+ \ProcessOptions% Process options
+\fi%
\bgroup% Protect from any setting.
\retrievemsg1(msg)%
\csname msg@MPC\endcsname% required when ltxdoc