From bcd02ba59b7e4c37730758bbeb41f311382e3440 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Wed, 27 Jun 2007 14:10:18 +0200 Subject: [PATCH] Update texinfo.tex from Texinfo CVS texinfo.tex last fix makes UTF-8 to Texinfo acented characters conversion in texi-gettext.py no longer necessary, so we drop it. --- buildscripts/texi-gettext.py | 62 -------------------------------- tex/texinfo.tex | 70 +++++++++++++++++++++++++++--------- 2 files changed, 53 insertions(+), 79 deletions(-) diff --git a/buildscripts/texi-gettext.py b/buildscripts/texi-gettext.py index 49cc62288b..00807407b0 100644 --- a/buildscripts/texi-gettext.py +++ b/buildscripts/texi-gettext.py @@ -36,66 +36,6 @@ ref_re = re.compile (r'(?ms)@(rglos|ref)(\{)(.*?)(\})') node_section_re = re.compile (r'@(node|(?:unnumbered|appendix)(?:(?:sub){0,2}sec)?|top|chapter|(?:sub){0,2}section|(?:major|chap|(?:sub){0,2})heading)( )(.*?)(\n)') menu_entry_re = re.compile (r'\* (.*?)::') -# Why not use recode? -# - well, it would add one more dependency... -accents2texi = ( - ("á", "@'a"), - ("à", "@`a"), - ("â", "@^a"), - ("ä", "@\"a"), - ("é", "@'e"), - ("è", "@`e"), - ("ê", "@^e"), - ("ë", "@\"e"), - ("ó", "@'o"), - ("ò", "@`o"), - ("ô", "@^o"), - ("ö", "@\"o"), - ("ú", "@'u"), - ("ù", "@`u"), - ("û", "@^u"), - ("ü", "@\"u"), - ("ç", "@,{c}"), - ("À", "@`A"), - ("Á", "@'A"), - ("Â", "@^A"), - ("Ä", "@\"A"), - ("É", "@'E"), - ("È", "@`E"), - ("Ê", "@^E"), - ("Ë", "@\"E"), - ("Ó", "@'O"), - ("Ò", "@`O"), - ("Ô", "@^O"), - ("Ö", "@\"O"), - ("Ú ", "@'U"), - ("Ù", "@`U"), - ("Û", "@^U"), - ("Ü", "@\"U"), - ("Ç", "@,{C}"), - ("Í", "@'{@dotless{i}}"), - ("ì", "@`{@dotless{i}}"), - ("î", "@^{@dotless{i}}"), - ("ï", "@\"{@dotless{i}}"), - ("Í", "@'I"), - ("Ì", "@`I"), - ("Î", "@^I"), - ("Ï", "@\"I"), - ("œ", "@oe{}"), - ("Œ", "@OE{}"), - ("æ", "@ae{}"), - ("Æ", "@AE{}"), - ("¡", "@exclamdown{}"), - ("¿", "@questiondown{}"), - ("ø", "@o{}"), - ("Ø", "@O{}"), - ("ß", "@ss{}"), - ("ł", "@l{}"), - ("Ł", "@L{}"), - ("å", "@aa{}"), - ("Å", "@AA{}")) - - def title_gettext (m): if m.group (2) == '{': r = whitespaces.sub (' ', m.group (3)) @@ -125,8 +65,6 @@ well as all `UNTRANSLATED NODE: IGNORE ME' lines.""", '') page = page.replace ('UNTRANSLATED NODE: IGNORE ME', _doc ("This section has not been translated yet; please refer to the manual in English.")) includes = include_re.findall (page) page = include_re.sub (lambda m: include_replace (m, filename), page) - for (u_char, texiaccent_char) in accents2texi: - page = page.replace (u_char, texiaccent_char) p = os.path.join (outdir, filename) [:-4] + 'pdftexi' f = open (p, 'w') f.write (page) diff --git a/tex/texinfo.tex b/tex/texinfo.tex index 0f3c750a64..060f622245 100644 --- a/tex/texinfo.tex +++ b/tex/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2007-05-04.09} +\def\texinfoversion{2007-06-26.23} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, @@ -5765,11 +5765,11 @@ end % regular 0x27. % \def\codequoteright{% - \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax - '% - \else - \char'15 - \fi + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. @@ -5777,11 +5777,11 @@ end % the code environments to do likewise. % \def\codequoteleft{% - \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax - `% - \else - \char'22 - \fi + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + `% + \else \char'22 \fi + \else \char'22 \fi } % \begingroup @@ -6332,6 +6332,10 @@ end % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. + % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. @@ -6346,6 +6350,7 @@ end \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% @@ -7434,22 +7439,41 @@ end % @documentlanguage is usually given very early, just after % @setfilename. If done too late, it may not override everything -% properly. Single argument is the language abbreviation. -% It would be nice if we could set up a hyphenation file here. +% properly. Single argument is the language (de) or locale (de_DE) +% abbreviation. It would be nice if we could set up a hyphenation file. % -\parseargdef\documentlanguage{% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. + % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% + \documentlanguagetrywithoutunderscore{#1_\finish}% \else \input txi-#1.tex \fi \closein 1 \endgroup +\endgroup} +} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\def\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 } +% \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? In the current directory should work if nowhere else does.} @@ -7464,6 +7488,14 @@ should work if nowhere else does.} \repeat } +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1 + \advance\count255 by 1 + \repeat +} + % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % @@ -8316,6 +8348,10 @@ should work if nowhere else does.} \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in \fi % \setleading{\textleading} -- 2.39.2