texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6564] backslash handling


From: Gavin D. Smith
Subject: [6564] backslash handling
Date: Mon, 24 Aug 2015 11:52:45 +0000

Revision: 6564
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6564
Author:   gavin
Date:     2015-08-24 11:52:45 +0000 (Mon, 24 Aug 2015)
Log Message:
-----------
backslash handling

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/texinfo.tex

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-08-23 14:26:14 UTC (rev 6563)
+++ trunk/ChangeLog     2015-08-24 11:52:45 UTC (rev 6564)
@@ -1,3 +1,23 @@
+2015-08-24  Gavin Smith  <address@hidden>
+
+       * doc/texinfo.tex (\balancecolumns): Increase height of column 
+       that shouldn't be split.  Add a missing %.
+
+       (\normalbackslash, \ttbackslash): Rename, to avoid confusion 
+       with other \normal... commands that are defined to character 
+       tokens with catcode other.
+
+       (\initial): Define \\ for coming from a sorted index file.
+       (\\): Remove definition, formerly used for user-defined macros.
+
+       (\eatinput): Eat to end of line, to account for first line being
+       `\input texinfo.tex' instead of merely `input texinfo'.
+       (\enablebackslashhack): New definition.  Let \ to @eatinput and
+       provide for it to be turned off after the first line.  Use it on
+       the very last line of the file.
+       (\setfilename): No longer use \fixbackslash.
+       (\otherifyactive): Inline into single usage site.
+
 2015-08-23  Gavin Smith  <address@hidden>
 
        * doc/texinfo.tex (\initial): Use \secfonts but within a group.  

Modified: trunk/doc/texinfo.tex
===================================================================
--- trunk/doc/texinfo.tex       2015-08-23 14:26:14 UTC (rev 6563)
+++ trunk/doc/texinfo.tex       2015-08-24 11:52:45 UTC (rev 6564)
@@ -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{2015-08-23.16}
+\def\texinfoversion{2015-08-24.13}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1057,7 +1057,6 @@
 % So open here the files we need to have open while reading the input.
 % This makes it possible to make a .fmt file for texinfo.
 \def\setfilename{%
-   \fixbackslash  % Turn off hack to swallow `\input texinfo'.
    \iflinks
      \tryauxfile
      % Open the new aux file.  TeX will close it automatically at exit.
@@ -5015,6 +5014,9 @@
 % These macros are used by the sorted index file itself.
 % Change them to control the appearance of the index.
 
address@hidden \catcode`\\=13
address@hidden@address@hidden@address@hidden@backslash}}}}
+
 \let\normalhyphen=-
 {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
@@ -5024,6 +5026,7 @@
   % math fonts looks more consistent than the typewriter font used elsewhere
   % for these characters.
   \usemathbackslash
+  %
   % Can't get bold backslash so don't use bold forward slash
   \catcode`\/=13
   \def/{{\secrmnotbold \normalslash}}%
@@ -5336,10 +5339,10 @@
   \dimen@ = \ht0
   \advance\dimen@ by \topskip
   \advance\dimen@ by-\baselineskip
-  \ifdim\dimen@<10\baselineskip
+  \ifdim\dimen@<14\baselineskip
     % Don't split a short final column in two.
     \global\setbox1 = \copy0
-    \global\setbox3 = \vbox{}
+    \global\setbox3 = \vbox{}%
   \else
   \divide\dimen@ by 2 % target to split to
   %debug\message{final 2-column material height=\the\ht0, address@hidden
@@ -7475,8 +7478,6 @@
   \catcode`\\=\active
 }
 
-\def\\{\normalbackslash}%
-
 \def\macrolineargctxt{% used for whole-line arguments without braces
   \scanctxt
   \catcode`\{=\other
@@ -10315,12 +10316,6 @@
   % in principle, all other definitions in \tex have to be undone too.
 }
 
-% If a .fmt file is being used, characters that might appear in a file
-% name cannot be active until we have parsed the command line.
-% So turn them off again, and have \everyjob (or @setfilename) turn them on.
-% \otherifyactive is called near the end of this file.
-\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
-
 % Used sometimes to turn off (effectively) the active characters even after
 % parsing them.
 \def\turnoffactive{%
@@ -10339,31 +10334,28 @@
 % \doublebackslash is two of them (for the pdf outlines).
 {\catcode`\\=\other @address@hidden @address@hidden
 
-% In texinfo, backslash is an active character; it prints the backslash
+% In Texinfo, backslash is an active character; it prints the backslash
 % in fixed width font.
 \catcode`\\=\active  % @ for escape char from now on.
 
-% The story here is that in math mode, the \char of \backslashcurfont
-% ends up printing the roman \ from the math symbol font (because \char
-% in math mode uses the \mathcode, and plain.tex sets
-% \mathcode`\\="026E).  It seems better for @backslashchar{} to always
-% print a typewriter backslash, hence we use an explicit \mathchar,
+% Print a typewriter backslash.  For math mode, we can't simply use
+% \backslashcurfont: the story here is that in math mode, the \char
+% of \backslashcurfont ends up printing the roman \ from the math symbol
+% font (because \char in math mode uses the \mathcode, and plain.tex
+% sets \mathcode`\\="026E).  Hence we use an explicit \mathchar,
 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
 % ignored family value; char position "5C).  We can't use " for the
 % usual hex value because it has already been made active.
address@hidden@address@hidden @ifmmode @mathchar29020 @else @backslashcurfont 
@fi}}
address@hidden@backslashchar = @normalbackslash % @backslashchar{} is for user 
documents.
 
-% On startup, @fixbackslash assigns:
-%  @let \ = @normalbackslash
address@hidden@address@hidden @ifmmode @mathchar29020 @else @backslashcurfont 
@fi}}
address@hidden@backslashchar = @ttbackslash % @backslashchar{} is for user 
documents.
+
 % \rawbackslash defines an active \ to do \backslashcurfont.
 % \otherbackslash defines an active \ to be a literal `\' character with
 % catcode other.  We switch back and forth between these.
 @address@hidden@address@hidden
 @address@hidden@address@hidden
 
address@hidden@address@hidden@address@hidden@backslash}}}
-
 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
 % the literal character `\'.  Also revert - to its normal character, in
 % case the active - from code has slipped in.
@@ -10377,40 +10369,53 @@
    @address@hidden
    @let<address@hidden
    @let>address@hidden
-   @address@hidden
    @address@hidden
    @address@hidden
    @let|address@hidden
    @address@hidden
+   @address@hidden
    @markupsetuplqdefault
    @markupsetuprqdefault
    @unsepspaces
  }
 }
 
-% Make _ and + \other characters, temporarily.
-% This is canceled by @fixbackslash.
address@hidden
+% If a .fmt file is being used, characters that might appear in a file
+% name cannot be active until we have parsed the command line.
+% So turn them off again, and have @fixbackslash turn them back on.
address@hidden@other @address@hidden@other
 
+% \enablebackslashhack - allow file to begin `\input texinfo'
+%
 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
 % That is what \eatinput is for; after that, the `\' should revert to printing
 % a backslash.
-%
address@hidden@eatinput input address@hidden
address@hidden@let\ = @eatinput
+% If the file did not have a `\input texinfo', then it is turned off after
+% the first line; otherwise the first `\' in the file would cause an error.
+% This is used on the very last line of this file, texinfo.tex.
+{
address@hidden@^=7
address@hidden@address@hidden@enablebackslashhack{%
+  @address@hidden = @eatinput%
+  @address@hidden
+  @def address@hidden@secondlinenl}%
+  @gdef @address@hidden@thirdlinenl}%
+  @gdef @address@hidden
+}}
 
-% On the other hand, perhaps the file did not have a `\input texinfo'. Then
-% the first `\' in the file would cause an error. This macro tries to fix
-% that, assuming it is called before the first `\' could plausibly occur.
-% Also turn back on active characters that might appear in the input
-% file name, in case not using a pre-dumped format.
-%
address@hidden@^=7 @address@hidden
address@hidden@eatinput input address@hidden
+
 @address@hidden
-  @address@hidden @let\ = @normalbackslash @fi
+  @address@hidden @let\ = @ttbackslash @fi
+  @catcode13=5 % regular end of line
+  % Also turn back on active characters that might appear in the input
+  % file name, in case not using a pre-dumped format.
   @address@hidden
   @address@hidden@active
 }
 
+
 % Say @foo, not \foo, in error messages.
 @escapechar = `@@
 
@@ -10450,3 +10455,4 @@
 @ignore
    arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
 @end ignore
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]