aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorPaul Eggert2015-09-09 12:36:18 -0700
committerPaul Eggert2015-09-09 12:36:45 -0700
commit5a3122e1679575a8b4e24d3d965f6d6684ae118e (patch)
tree77dd3851262b5c2e008e0dc6a549233c5f105782 /doc/misc
parentab21f61a552f038485d40218dfd94a16b843eb52 (diff)
downloademacs-5a3122e1679575a8b4e24d3d965f6d6684ae118e.tar.gz
emacs-5a3122e1679575a8b4e24d3d965f6d6684ae118e.zip
Merge from gnulib and texinfo
This incorporates: 2015-08-03 Improve port of stdalign to C++11 * lib/stdalign.in.h: Copy from gnulib. * doc/misc/texinfo.tex: Copy from texinfo.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/texinfo.tex633
1 files changed, 401 insertions, 232 deletions
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index f773c90b8d5..aaabbc9c9f5 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2015-07-01.07} 6\def\texinfoversion{2015-09-05.20}
7% 7%
8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -310,7 +310,9 @@
310\def\prevsectiondefs{} 310\def\prevsectiondefs{}
311\def\lastcolordefs{} 311\def\lastcolordefs{}
312 312
313
313% Main output routine. 314% Main output routine.
315%
314\chardef\PAGE = 255 316\chardef\PAGE = 255
315\output = {\onepageout{\pagecontents\PAGE}} 317\output = {\onepageout{\pagecontents\PAGE}}
316 318
@@ -344,10 +346,10 @@
344 \normalturnoffactive % \ in index entries must not stay \, e.g., if 346 \normalturnoffactive % \ in index entries must not stay \, e.g., if
345 % the page break happens to be in the middle of an example. 347 % the page break happens to be in the middle of an example.
346 % We don't want .vr (or whatever) entries like this: 348 % We don't want .vr (or whatever) entries like this:
347 % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} 349 % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
348 % "\acronym" won't work when it's read back in; 350 % "\acronym" won't work when it's read back in;
349 % it needs to be 351 % it needs to be
350 % {\code {{\tt \backslashcurfont }acronym} 352 % {\code {{\backslashcurfont }acronym}
351 \shipout\vbox{% 353 \shipout\vbox{%
352 % Do this early so pdf references go to the beginning of the page. 354 % Do this early so pdf references go to the beginning of the page.
353 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi 355 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
@@ -427,9 +429,13 @@
427\def\nsbot{\vbox 429\def\nsbot{\vbox
428 {\hrule height\cornerlong depth\cornerthick width\cornerthick}} 430 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
429 431
432
433% Argument parsing
434
430% Parse an argument, then pass it to #1. The argument is the rest of 435% Parse an argument, then pass it to #1. The argument is the rest of
431% the input line (except we remove a trailing comment). #1 should be a 436% the input line (except we remove a trailing comment). #1 should be a
432% macro which expects an ordinary undelimited TeX argument. 437% macro which expects an ordinary undelimited TeX argument.
438% For example, \def\foo{\parsearg\fooxxx}.
433% 439%
434\def\parsearg{\parseargusing{}} 440\def\parsearg{\parseargusing{}}
435\def\parseargusing#1#2{% 441\def\parseargusing#1#2{%
@@ -448,9 +454,11 @@
448 }% 454 }%
449} 455}
450 456
451% First remove any @comment, then any @c comment. 457% First remove any @comment, then any @c comment. Also remove a @texinfoc
458% comment (see \scanmacro for details). Pass the result on to \argcheckspaces.
452\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} 459\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
453\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} 460\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
461\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
454 462
455% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. 463% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
456% 464%
@@ -939,12 +947,20 @@ where each line of input produces a line of output.}
939% @c is the same as @comment 947% @c is the same as @comment
940% @ignore ... @end ignore is another way to write a comment 948% @ignore ... @end ignore is another way to write a comment
941% 949%
942\def\comment{\begingroup \catcode`\^^M=\other% 950\def\comment{\begingroup \catcode`\^^M=\active%
951\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}%
952
953{\catcode`\^^M=\active%
954\gdef\commentxxx#1^^M{\endgroup%
955\futurelet\nexttoken\commentxxxx}%
956\gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}%
957}
958
959\def\c{\begingroup \catcode`\^^M=\active%
943\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% 960\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
944\commentxxx} 961\cxxx}
945{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} 962{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
946% 963% See comment in \scanmacro about why the definitions of @c and @comment differ
947\let\c=\comment
948 964
949% @paragraphindent NCHARS 965% @paragraphindent NCHARS
950% We'll use ems for NCHARS, close enough. 966% We'll use ems for NCHARS, close enough.
@@ -1037,17 +1053,15 @@ where each line of input produces a line of output.}
1037\newif\iflinks \linkstrue % by default we want the aux files. 1053\newif\iflinks \linkstrue % by default we want the aux files.
1038\let\novalidate = \linksfalse 1054\let\novalidate = \linksfalse
1039 1055
1040% @setfilename is done at the beginning of every texinfo file. 1056% @setfilename is done at the beginning of every texinfo file. So open
1041% So open here the files we need to have open while reading the input. 1057% here some of the files we need to have open while reading the input.
1042% This makes it possible to make a .fmt file for texinfo. 1058% This makes it possible to make a .fmt file for texinfo.
1043\def\setfilename{% 1059\def\setfilename{%
1044 \fixbackslash % Turn off hack to swallow `\input texinfo'.
1045 \iflinks 1060 \iflinks
1046 \tryauxfile 1061 \tryauxfile
1047 % Open the new aux file. TeX will close it automatically at exit. 1062 % Open the new aux file. TeX will close it automatically at exit.
1048 \immediate\openout\auxfile=\jobname.aux 1063 \immediate\openout\auxfile=\jobname.aux
1049 \fi % \openindices needs to do some work in any case. 1064 \fi % \openindices needs to do some work in any case.
1050 \openindices
1051 \let\setfilename=\comment % Ignore extra @setfilename cmds. 1065 \let\setfilename=\comment % Ignore extra @setfilename cmds.
1052 % 1066 %
1053 % If texinfo.cnf is present on the system, read it. 1067 % If texinfo.cnf is present on the system, read it.
@@ -1059,17 +1073,6 @@ where each line of input produces a line of output.}
1059 \comment % Ignore the actual filename. 1073 \comment % Ignore the actual filename.
1060} 1074}
1061 1075
1062% Called from \setfilename.
1063%
1064\def\openindices{%
1065 \newindex{cp}%
1066 \newcodeindex{fn}%
1067 \newcodeindex{vr}%
1068 \newcodeindex{tp}%
1069 \newcodeindex{ky}%
1070 \newcodeindex{pg}%
1071}
1072
1073% @bye. 1076% @bye.
1074\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} 1077\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1075 1078
@@ -1884,6 +1887,7 @@ end
1884% Section fonts (14.4pt). 1887% Section fonts (14.4pt).
1885\def\secnominalsize{14pt} 1888\def\secnominalsize{14pt}
1886\setfont\secrm\rmbshape{12}{\magstep1}{OT1} 1889\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
1890\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
1887\setfont\secit\itbshape{10}{\magstep2}{OT1IT} 1891\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
1888\setfont\secsl\slbshape{10}{\magstep2}{OT1} 1892\setfont\secsl\slbshape{10}{\magstep2}{OT1}
1889\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} 1893\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
@@ -2881,9 +2885,6 @@ end
2881\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} 2885\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
2882\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% 2886\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
2883 2887
2884% ctrl is no longer a Texinfo command, but leave this definition for fun.
2885\def\ctrl #1{{\tt \rawbackslash \hat}#1}
2886
2887% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. 2888% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
2888% Ignore unless FMTNAME == tex; then it is like @iftex and @tex, 2889% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
2889% except specified as a normal braced arg, so no newlines to worry about. 2890% except specified as a normal braced arg, so no newlines to worry about.
@@ -4358,19 +4359,16 @@ end
4358% except not \outer, so it can be used within macros and \if's. 4359% except not \outer, so it can be used within macros and \if's.
4359\edef\newwrite{\makecsname{ptexnewwrite}} 4360\edef\newwrite{\makecsname{ptexnewwrite}}
4360 4361
4361% \newindex {foo} defines an index named foo. 4362% \newindex {foo} defines an index named IX.
4362% It automatically defines \fooindex such that 4363% It automatically defines \IXindex such that
4363% \fooindex ...rest of line... puts an entry in the index foo. 4364% \IXindex ...rest of line... puts an entry in the index IX.
4364% It also defines \fooindfile to be the number of the output channel for 4365% It also defines \IXindfile to be the number of the output channel for
4365% the file that accumulates this index. The file's extension is foo. 4366% the file that accumulates this index. The file's extension is IX.
4366% The name of an index should be no more than 2 characters long 4367% The name of an index should be no more than 2 characters long
4367% for the sake of vms. 4368% for the sake of vms.
4368% 4369%
4369\def\newindex#1{% 4370\def\newindex#1{%
4370 \iflinks 4371 \expandafter\chardef\csname#1indfile\endcsname=0
4371 \expandafter\newwrite \csname#1indfile\endcsname
4372 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
4373 \fi
4374 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index 4372 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4375 \noexpand\doindex{#1}} 4373 \noexpand\doindex{#1}}
4376} 4374}
@@ -4384,14 +4382,19 @@ end
4384\def\defcodeindex{\parsearg\newcodeindex} 4382\def\defcodeindex{\parsearg\newcodeindex}
4385% 4383%
4386\def\newcodeindex#1{% 4384\def\newcodeindex#1{%
4387 \iflinks 4385 \expandafter\chardef\csname#1indfile\endcsname=0
4388 \expandafter\newwrite \csname#1indfile\endcsname
4389 \openout \csname#1indfile\endcsname \jobname.#1
4390 \fi
4391 \expandafter\xdef\csname#1index\endcsname{% 4386 \expandafter\xdef\csname#1index\endcsname{%
4392 \noexpand\docodeindex{#1}}% 4387 \noexpand\docodeindex{#1}}%
4393} 4388}
4394 4389
4390% The default indices:
4391\newindex{cp}% concepts,
4392\newcodeindex{fn}% functions,
4393\newcodeindex{vr}% variables,
4394\newcodeindex{tp}% types,
4395\newcodeindex{ky}% keys
4396\newcodeindex{pg}% and programs.
4397
4395 4398
4396% @synindex foo bar makes index foo feed into index bar. 4399% @synindex foo bar makes index foo feed into index bar.
4397% Do this instead of @defindex foo if you don't want it as a separate index. 4400% Do this instead of @defindex foo if you don't want it as a separate index.
@@ -4420,24 +4423,19 @@ end
4420 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% 4423 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4421} 4424}
4422 4425
4423% Define \doindex, the driver for all \fooindex macros. 4426% Define \doindex, the driver for all index macros.
4424% Argument #1 is generated by the calling \fooindex macro, 4427% Argument #1 is generated by the calling \fooindex macro,
4425% and it is "foo", the name of the index. 4428% and it the two-letter name of the index.
4426
4427% \doindex just uses \parsearg; it calls \doind for the actual work.
4428% This is because \doind is more useful to call from other macros.
4429
4430% There is also \dosubind {index}{topic}{subtopic}
4431% which makes an entry in a two-level index such as the operation index.
4432 4429
4433\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} 4430\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
4434\def\singleindexer #1{\doind{\indexname}{#1}} 4431\def\doindexxxx #1{\doind{\indexname}{#1}}
4435 4432
4436% like the previous two, but they put @code around the argument. 4433% like the previous two, but they put @code around the argument.
4437\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} 4434\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
4438\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} 4435\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
4439 4436
4440% Take care of Texinfo commands that can appear in an index entry. 4437% Used when writing an index entry out to an index file, to prevent
4438% expansion of Texinfo commands that can appear in an index entry.
4441% Since there are some commands we want to expand, and others we don't, 4439% Since there are some commands we want to expand, and others we don't,
4442% we have to laboriously prevent expansion for those that we don't. 4440% we have to laboriously prevent expansion for those that we don't.
4443% 4441%
@@ -4455,31 +4453,6 @@ end
4455 \def\{{{\tt\char123}}% 4453 \def\{{{\tt\char123}}%
4456 \def\}{{\tt\char125}}% 4454 \def\}{{\tt\char125}}%
4457 % 4455 %
4458 % I don't entirely understand this, but when an index entry is
4459 % generated from a macro call, the \endinput which \scanmacro inserts
4460 % causes processing to be prematurely terminated. This is,
4461 % apparently, because \indexsorttmp is fully expanded, and \endinput
4462 % is an expandable command. The redefinition below makes \endinput
4463 % disappear altogether for that purpose -- although logging shows that
4464 % processing continues to some further point. On the other hand, it
4465 % seems \endinput does not hurt in the printed index arg, since that
4466 % is still getting written without apparent harm.
4467 %
4468 % Sample source (mac-idx3.tex, reported by Graham Percival to
4469 % help-texinfo, 22may06):
4470 % @macro funindex {WORD}
4471 % @findex xyz
4472 % @end macro
4473 % ...
4474 % @funindex commtest
4475 % This is not enough to reproduce the bug, but it gives the flavor.
4476 %
4477 % Sample whatsit resulting:
4478 % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
4479 %
4480 % So:
4481 \let\endinput = \empty
4482 %
4483 % Do the redefinitions. 4456 % Do the redefinitions.
4484 \commondummies 4457 \commondummies
4485} 4458}
@@ -4691,6 +4664,31 @@ end
4691% For testing: output @{ and @} in index sort strings as \{ and \}. 4664% For testing: output @{ and @} in index sort strings as \{ and \}.
4692\newif\ifusebracesinindexes 4665\newif\ifusebracesinindexes
4693 4666
4667\let\indexlbrace\relax
4668\let\indexrbrace\relax
4669
4670{\catcode`\@=0
4671\catcode`\\=13
4672 @gdef@backslashdisappear{@def\{}}
4673}
4674
4675{
4676\catcode`\<=13
4677\catcode`\-=13
4678 \gdef\indexnonalnumdisappear{%
4679 \backslashdisappear
4680 \def-{}%
4681 \def<{}%
4682 }
4683
4684 \gdef\indexnonalnumreappear{%
4685 \useindexbackslash
4686 \let-\normaldash
4687 \let<\normalless
4688 }
4689}
4690
4691
4694% \indexnofonts is used when outputting the strings to sort the index 4692% \indexnofonts is used when outputting the strings to sort the index
4695% by, and when constructing control sequence names. It eliminates all 4693% by, and when constructing control sequence names. It eliminates all
4696% control sequences and just writes whatever the best ASCII sort string 4694% control sequences and just writes whatever the best ASCII sort string
@@ -4716,16 +4714,10 @@ end
4716 \def\_{\normalunderscore}% 4714 \def\_{\normalunderscore}%
4717 \def\-{}% @- shouldn't affect sorting 4715 \def\-{}% @- shouldn't affect sorting
4718 % 4716 %
4719 % Unfortunately, texindex is not prepared to handle braces in the 4717 % Unfortunately, texindex < 6.0 is not prepared to handle braces in the
4720 % content at all. So for index sorting, we map @{ and @} to strings 4718 % content at all, so these won't be sorted in ASCII order.
4721 % starting with |, since that ASCII character is between ASCII { and }. 4719 \def\lbracechar{{\indexlbrace}}%
4722 \ifusebracesinindexes 4720 \def\rbracechar{{\indexrbrace}}%
4723 \def\lbracechar{\lbracecmd}%
4724 \def\rbracechar{\rbracecmd}%
4725 \else
4726 \def\lbracechar{|a}%
4727 \def\rbracechar{|b}%
4728 \fi
4729 \let\{=\lbracechar 4721 \let\{=\lbracechar
4730 \let\}=\rbracechar 4722 \let\}=\rbracechar
4731 % 4723 %
@@ -4737,7 +4729,7 @@ end
4737 \def\L{L}% 4729 \def\L{L}%
4738 \def\OE{OE}% 4730 \def\OE{OE}%
4739 \def\O{O}% 4731 \def\O{O}%
4740 \def\TH{ZZZ}% 4732 \def\TH{TH}%
4741 \def\aa{aa}% 4733 \def\aa{aa}%
4742 \def\ae{ae}% 4734 \def\ae{ae}%
4743 \def\dh{dzz}% 4735 \def\dh{dzz}%
@@ -4749,7 +4741,7 @@ end
4749 \def\o{o}% 4741 \def\o{o}%
4750 \def\questiondown{?}% 4742 \def\questiondown{?}%
4751 \def\ss{ss}% 4743 \def\ss{ss}%
4752 \def\th{zzz}% 4744 \def\th{th}%
4753 % 4745 %
4754 \def\LaTeX{LaTeX}% 4746 \def\LaTeX{LaTeX}%
4755 \def\TeX{TeX}% 4747 \def\TeX{TeX}%
@@ -4807,14 +4799,17 @@ end
4807{\catcode`\`=\active 4799{\catcode`\`=\active
4808 \gdef\indexlquoteignore{\let`=\empty}} 4800 \gdef\indexlquoteignore{\let`=\empty}}
4809 4801
4810\let\indexbackslash=0 %overridden during \printindex.
4811\let\SETmarginindex=\relax % put index entries in margin (undocumented)? 4802\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
4812 4803
4813% Most index entries go through here, but \dosubind is the general case. 4804% Most index entries go through here, but \dosubind is the general case.
4814% #1 is the index name, #2 is the entry text. 4805% #1 is the index name, #2 is the entry text.
4815\def\doind#1#2{\dosubind{#1}{#2}{}} 4806\def\doind#1#2{\dosubind{#1}{#2}{}}
4816 4807
4817% Workhorse for all \fooindexes. 4808% There is also \dosubind {index}{topic}{subtopic}
4809% which makes an entry in a two-level index such as the operation index.
4810% TODO: Two-level index? Operation index?
4811
4812% Workhorse for all indexes.
4818% #1 is name of index, #2 is stuff to put there, #3 is subentry -- 4813% #1 is name of index, #2 is stuff to put there, #3 is subentry --
4819% empty if called from \doind, as we usually are (the main exception 4814% empty if called from \doind, as we usually are (the main exception
4820% is with most defuns, which call us directly). 4815% is with most defuns, which call us directly).
@@ -4822,6 +4817,7 @@ end
4822\def\dosubind#1#2#3{% 4817\def\dosubind#1#2#3{%
4823 \iflinks 4818 \iflinks
4824 {% 4819 {%
4820 \requireopenindexfile{#1}%
4825 % Store the main index entry text (including the third arg). 4821 % Store the main index entry text (including the third arg).
4826 \toks0 = {#2}% 4822 \toks0 = {#2}%
4827 % If third arg is present, precede it with a space. 4823 % If third arg is present, precede it with a space.
@@ -4837,7 +4833,40 @@ end
4837 \fi 4833 \fi
4838} 4834}
4839 4835
4840% Write the entry in \toks0 to the index file: 4836% Check if an index file has been opened, and if not, open it.
4837\def\requireopenindexfile#1{%
4838\ifnum\csname #1indfile\endcsname=0
4839 \expandafter\newwrite \csname#1indfile\endcsname
4840 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
4841\fi}
4842
4843% Output \ as {\indexbackslash}, because \ is an escape character in
4844% the index files.
4845\let\indexbackslash=\relax
4846{\catcode`\@=0 \catcode`\\=\active
4847 @gdef@useindexbackslash{@def\{{@indexbackslash}}}
4848}
4849
4850% Definition for writing index entry text.
4851\def\sortas#1{\ignorespaces}%
4852
4853% Definition for writing index entry sort key. Should occur at the at
4854% the beginning of the index entry, like
4855% @cindex @sortas{september} \september
4856% The \ignorespaces takes care of following space, but there's no way
4857% to remove space before it.
4858{
4859\catcode`\-=13
4860\gdef\indexwritesortas{%
4861 \begingroup
4862 \indexnonalnumreappear
4863 \indexwritesortasxxx}
4864\gdef\indexwritesortasxxx#1{%
4865 \xdef\indexsortkey{#1}\endgroup}
4866}
4867
4868
4869% Write the entry in \toks0 to the index file.
4841% 4870%
4842\def\dosubindwrite{% 4871\def\dosubindwrite{%
4843 % Put the index entry in the margin if desired. 4872 % Put the index entry in the margin if desired.
@@ -4847,14 +4876,20 @@ end
4847 % 4876 %
4848 % Remember, we are within a group. 4877 % Remember, we are within a group.
4849 \indexdummies % Must do this here, since \bf, etc expand at this stage 4878 \indexdummies % Must do this here, since \bf, etc expand at this stage
4850 \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now 4879 \useindexbackslash % \indexbackslash isn't defined now so it will be output
4851 % so it will be output as is; and it will print as backslash. 4880 % as is; and it will print as backslash.
4852 % 4881 % Get the string to sort by, by processing the index entry with all
4853 % Process the index entry with all font commands turned off, to 4882 % font commands turned off.
4854 % get the string to sort by.
4855 {\indexnofonts 4883 {\indexnofonts
4856 \edef\temp{\the\toks0}% need full expansion 4884 \xdef\indexsortkey{}%
4857 \xdef\indexsorttmp{\temp}% 4885 \let\sortas=\indexwritesortas
4886 \indexnonalnumdisappear
4887 \edef\temp{\the\toks0}%
4888 \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
4889 \ifx\indexsortkey\empty
4890 \xdef\indexsortkey{\temp}%
4891 \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
4892 \fi
4858 }% 4893 }%
4859 % 4894 %
4860 % Set up the complete index entry, with both the sort key and 4895 % Set up the complete index entry, with both the sort key and
@@ -4864,10 +4899,11 @@ end
4864 % sorted result. 4899 % sorted result.
4865 \edef\temp{% 4900 \edef\temp{%
4866 \write\writeto{% 4901 \write\writeto{%
4867 \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% 4902 \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
4868 }% 4903 }%
4869 \temp 4904 \temp
4870} 4905}
4906\newbox\dummybox % used above
4871 4907
4872% Take care of unwanted page breaks/skips around a whatsit: 4908% Take care of unwanted page breaks/skips around a whatsit:
4873% 4909%
@@ -5012,7 +5048,9 @@ end
5012 % Index files are almost Texinfo source, but we use \ as the escape 5048 % Index files are almost Texinfo source, but we use \ as the escape
5013 % character. It would be better to use @, but that's too big a change 5049 % character. It would be better to use @, but that's too big a change
5014 % to make right now. 5050 % to make right now.
5015 \def\indexbackslash{\backslashcurfont}% 5051 \def\indexbackslash{\ttbackslash}%
5052 \let\indexlbrace\{ % Likewise, set these sequences for braces
5053 \let\indexrbrace\} % used in the sort key.
5016 \catcode`\\ = 0 5054 \catcode`\\ = 0
5017 \escapechar = `\\ 5055 \escapechar = `\\
5018 \begindoublecolumns 5056 \begindoublecolumns
@@ -5026,18 +5064,47 @@ end
5026% These macros are used by the sorted index file itself. 5064% These macros are used by the sorted index file itself.
5027% Change them to control the appearance of the index. 5065% Change them to control the appearance of the index.
5028 5066
5029\def\initial#1{{% 5067{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
5030 % Some minor font changes for the special characters. 5068\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
5031 \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt 5069\catcode`\$=3
5032 % 5070\gdef\initialglyphs{%
5071 % Some changes for non-alphabetic characters. Using the glyphs from the
5072 % math fonts looks more consistent than the typewriter font used elsewhere
5073 % for these characters.
5074 \def\indexbackslash{\math{\backslash}}%
5075 \let\\=\indexbackslash
5076 %
5077 % Can't get bold backslash so don't use bold forward slash
5078 \catcode`\/=13
5079 \def/{{\secrmnotbold \normalslash}}%
5080 \def-{{\normaldash\normaldash}}% en dash `--'
5081 \def^{{\chapbf \normalcaret}}
5082 \let~=\normaltilde
5083 \def\_{%
5084 \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
5085 \def|{$\vert$}%
5086 \def<{$\less$}%
5087 \def>{$\gtr$}%
5088 \def+{$\normalplus$}%
5089}}
5090
5091\def\initial{%
5092 \bgroup
5093 \initialglyphs
5094 \initialx
5095}
5096
5097\def\initialx#1{%
5033 % Remove any glue we may have, we'll be inserting our own. 5098 % Remove any glue we may have, we'll be inserting our own.
5034 \removelastskip 5099 \removelastskip
5035 % 5100 %
5036 % We like breaks before the index initials, so insert a bonus. 5101 % We like breaks before the index initials, so insert a bonus.
5102 % The glue before the bonus allows a little bit of space at the
5103 % bottom of a column to reduce an increase in inter-line spacing.
5037 \nobreak 5104 \nobreak
5038 \vskip 0pt plus 3\baselineskip 5105 \vskip 0pt plus 6\baselineskip
5039 \penalty 0 5106 \penalty -300
5040 \vskip 0pt plus -3\baselineskip 5107 \vskip 0pt plus -6\baselineskip
5041 % 5108 %
5042 % Typeset the initial. Making this add up to a whole number of 5109 % Typeset the initial. Making this add up to a whole number of
5043 % baselineskips increases the chance of the dots lining up from column 5110 % baselineskips increases the chance of the dots lining up from column
@@ -5046,23 +5113,20 @@ end
5046 % 5113 %
5047 % No shrink because it confuses \balancecolumns. 5114 % No shrink because it confuses \balancecolumns.
5048 \vskip 1.67\baselineskip plus .5\baselineskip 5115 \vskip 1.67\baselineskip plus .5\baselineskip
5049 \leftline{\secbf #1}% 5116 \leftline{\secfonts \secbf #1}%
5117 % \secfonts is inside the argument of \leftline so that the change of
5118 % \baselineskip will not affect any glue inserted before the vbox that
5119 % \leftline creates.
5050 % Do our best not to break after the initial. 5120 % Do our best not to break after the initial.
5051 \nobreak 5121 \nobreak
5052 \vskip .33\baselineskip plus .1\baselineskip 5122 \vskip .33\baselineskip plus .1\baselineskip
5053}} 5123 \egroup % \initialglyphs
5124}
5054 5125
5055% \entry typesets a paragraph consisting of the text (#1), dot leaders, and 5126% \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5056% then page number (#2) flushed to the right margin. It is used for index 5127% then page number (#2) flushed to the right margin. It is used for index
5057% and table of contents entries. The paragraph is indented by \leftskip. 5128% and table of contents entries. The paragraph is indented by \leftskip.
5058% 5129%
5059% A straightforward implementation would start like this:
5060% \def\entry#1#2{...
5061% But this freezes the catcodes in the argument, and can cause problems to
5062% @code, which sets - active. This problem was fixed by a kludge---
5063% ``-'' was active throughout whole index, but this isn't really right.
5064% The right solution is to prevent \entry from swallowing the whole text.
5065% --kasal, 21nov03
5066\def\entry{% 5130\def\entry{%
5067 \begingroup 5131 \begingroup
5068 % 5132 %
@@ -5095,7 +5159,7 @@ end
5095 % 5159 %
5096 % A bit of stretch before each entry for the benefit of balancing 5160 % A bit of stretch before each entry for the benefit of balancing
5097 % columns. 5161 % columns.
5098 \vskip 0pt plus1pt 5162 \vskip 0pt plus0.5pt
5099 % 5163 %
5100 % When reading the text of entry, convert explicit line breaks 5164 % When reading the text of entry, convert explicit line breaks
5101 % from @* into spaces. The user might give these in long section 5165 % from @* into spaces. The user might give these in long section
@@ -5227,7 +5291,7 @@ end
5227} 5291}
5228 5292
5229% The double-column output routine for all double-column pages except 5293% The double-column output routine for all double-column pages except
5230% the last. 5294% the last, which is done by \balancecolumns.
5231% 5295%
5232\def\doublecolumnout{% 5296\def\doublecolumnout{%
5233 \splittopskip=\topskip \splitmaxdepth=\maxdepth 5297 \splittopskip=\topskip \splitmaxdepth=\maxdepth
@@ -5309,28 +5373,45 @@ end
5309 \pagegoal = \vsize 5373 \pagegoal = \vsize
5310} 5374}
5311% 5375%
5312% Called at the end of the double column material. 5376% Only called for the last of the double column material. \doublecolumnout
5377% does the others.
5313\def\balancecolumns{% 5378\def\balancecolumns{%
5314 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. 5379 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
5315 \dimen@ = \ht0 5380 \dimen@ = \ht0
5316 \advance\dimen@ by \topskip 5381 \advance\dimen@ by \topskip
5317 \advance\dimen@ by-\baselineskip 5382 \advance\dimen@ by-\baselineskip
5318 \divide\dimen@ by 2 % target to split to 5383 \ifdim\dimen@<14\baselineskip
5319 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% 5384 % Don't split a short final column in two.
5320 \splittopskip = \topskip 5385 \setbox2=\vbox{}%
5321 % Loop until we get a decent breakpoint. 5386 \else
5322 {% 5387 \divide\dimen@ by 2 % target to split to
5323 \vbadness = 10000 5388 \dimen@ii = \dimen@
5324 \loop 5389 \splittopskip = \topskip
5325 \global\setbox3 = \copy0 5390 % Loop until the second column is no higher than the first
5326 \global\setbox1 = \vsplit3 to \dimen@ 5391 {%
5327 \ifdim\ht3>\dimen@ 5392 \vbadness = 10000
5328 \global\advance\dimen@ by 1pt 5393 \loop
5329 \repeat 5394 \global\setbox3 = \copy0
5330 }% 5395 \global\setbox1 = \vsplit3 to \dimen@
5331 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% 5396 % Remove glue from bottom of first column to
5332 \setbox0=\vbox to\dimen@{\unvbox1}% 5397 % make sure it is higher than the second.
5333 \setbox2=\vbox to\dimen@{\unvbox3}% 5398 \global\setbox1 = \vbox{\unvbox1\unpenalty\unskip}%
5399 \ifdim\ht3>\ht1
5400 \global\advance\dimen@ by 1pt
5401 \repeat
5402 }%
5403 \multiply\dimen@ii by 4
5404 \divide\dimen@ii by 5
5405 \ifdim\ht3<\dimen@ii
5406 % Column heights are too different, so don't make their bottoms
5407 % flush with each other
5408 \setbox0=\vbox to\dimen@{\unvbox1\vfill}%
5409 \setbox2=\vbox to\dimen@{\unvbox3\vfill}%
5410 \else
5411 \setbox0=\vbox to\dimen@{\unvbox1}%
5412 \setbox2=\vbox to\dimen@{\unvbox3}%
5413 \fi
5414 \fi
5334 % 5415 %
5335 \pagesofar 5416 \pagesofar
5336} 5417}
@@ -7315,34 +7396,42 @@ end
7315 } 7396 }
7316\fi 7397\fi
7317 7398
7318\def\scanmacro#1{\begingroup 7399\let\aftermacroxxx\relax
7400\def\aftermacro{\aftermacroxxx}
7401
7402% alias because \c means cedilla in @tex or @math
7403\let\texinfoc=\c
7404
7405% Used at the time of macro expansion.
7406% Argument is macro body with arguments substituted
7407\def\scanmacro#1{%
7319 \newlinechar`\^^M 7408 \newlinechar`\^^M
7320 \let\xeatspaces\eatspaces 7409 \let\xeatspaces\eatspaces
7321 % 7410 %
7322 % Undo catcode changes of \startcontents and \doprintindex 7411 % Process the macro body under the current catcode regime.
7323 % When called from @insertcopying or (short)caption, we need active 7412 \scantokens{#1\texinfoc}\aftermacro%
7324 % backslash to get it printed correctly. Previously, we had
7325 % \catcode`\\=\other instead. We'll see whether a problem appears
7326 % with macro expansion. --kasal, 19aug04
7327 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7328 %
7329 % ... and for \example:
7330 \spaceisspace
7331 % 7413 %
7332 % The \empty here causes a following catcode 5 newline to be eaten as 7414 % The \c is to remove the \newlinechar added by \scantokens, and
7333 % part of reading whitespace after a control sequence. It does not 7415 % can be noticed by \parsearg.
7334 % eat a catcode 13 newline. There's no good way to handle the two 7416 % The \aftermacro allows a \comment at the end of the macro definition
7335 % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX 7417 % to duplicate itself past the final \newlinechar added by \scantokens:
7336 % would then have different behavior). See the Macro Details node in 7418 % this is used in the definition of \group to comment out a newline. We
7337 % the manual for the workaround we recommend for macros and 7419 % don't do the same for \c to support Texinfo files with macros that ended
7338 % line-oriented commands. 7420 % with a @c, which should no longer be necessary.
7339 % 7421 % We avoid surrounding the call to \scantokens with \bgroup and \egroup
7340 \scantokens{#1\empty}% 7422 % to allow macros to open or close groups themselves.
7341\endgroup} 7423}
7342 7424
7343\def\scanexp#1{% 7425\def\scanexp#1{%
7426 \bgroup
7427 % Undo catcode changes of \startcontents and \printindex
7428 % When called from @insertcopying or (short)caption, we need active
7429 % backslash to get it printed correctly.
7430 % FIXME: This may not be needed.
7431 %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7344 \edef\temp{\noexpand\scanmacro{#1}}% 7432 \edef\temp{\noexpand\scanmacro{#1}}%
7345 \temp 7433 \temp
7434 \egroup
7346} 7435}
7347 7436
7348\newcount\paramno % Count of parameters 7437\newcount\paramno % Count of parameters
@@ -7408,7 +7497,6 @@ end
7408 \catcode`\+=\other 7497 \catcode`\+=\other
7409 \catcode`\<=\other 7498 \catcode`\<=\other
7410 \catcode`\>=\other 7499 \catcode`\>=\other
7411 \catcode`\@=\other
7412 \catcode`\^=\other 7500 \catcode`\^=\other
7413 \catcode`\_=\other 7501 \catcode`\_=\other
7414 \catcode`\|=\other 7502 \catcode`\|=\other
@@ -7418,37 +7506,28 @@ end
7418 7506
7419\def\scanargctxt{% used for copying and captions, not macros. 7507\def\scanargctxt{% used for copying and captions, not macros.
7420 \scanctxt 7508 \scanctxt
7509 \catcode`\@=\other
7421 \catcode`\\=\other 7510 \catcode`\\=\other
7422 \catcode`\^^M=\other 7511 \catcode`\^^M=\other
7423} 7512}
7424 7513
7425\def\macrobodyctxt{% used for @macro definitions 7514\def\macrobodyctxt{% used for @macro definitions
7426 \scanctxt 7515 \scanctxt
7516 \catcode`\ =\other
7517 \catcode`\@=\other
7427 \catcode`\{=\other 7518 \catcode`\{=\other
7428 \catcode`\}=\other 7519 \catcode`\}=\other
7429 \catcode`\^^M=\other 7520 \catcode`\^^M=\other
7430 \usembodybackslash 7521 \usembodybackslash
7431} 7522}
7432 7523
7433\def\macroargctxt{% used when scanning invocations 7524% Used when scanning braced macro arguments. Note, however, that catcode
7525% changes here are ineffectual if the macro invocation was nested inside
7526% an argument to another Texinfo command.
7527\def\macroargctxt{%
7434 \scanctxt 7528 \scanctxt
7435 \catcode`\\=0 7529 \catcode`\\=\active
7436} 7530}
7437% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
7438% for the single characters \ { }. Thus, we end up with the "commands"
7439% that would be written @\ @{ @} in a Texinfo document.
7440%
7441% We already have @{ and @}. For @\, we define it here, and only for
7442% this purpose, to produce a typewriter backslash (so, the @\ that we
7443% define for @math can't be used with @macro calls):
7444%
7445\def\\{\normalbackslash}%
7446%
7447% We would like to do this for \, too, since that is what makeinfo does.
7448% But it is not possible, because Texinfo already has a command @, for a
7449% cedilla accent. Documents must use @comma{} instead.
7450%
7451% \anythingelse will almost certainly be an error of some kind.
7452 7531
7453\def\macrolineargctxt{% used for whole-line arguments without braces 7532\def\macrolineargctxt{% used for whole-line arguments without braces
7454 \scanctxt 7533 \scanctxt
@@ -7610,12 +7689,12 @@ end
7610 7689
7611% These two commands read recursive and nonrecursive macro bodies. 7690% These two commands read recursive and nonrecursive macro bodies.
7612% (They're different since rec and nonrec macros end differently.) 7691% (They're different since rec and nonrec macros end differently.)
7613% 7692% Set \temp to the body of the macro, and call \defmacro.
7614\catcode `\@\texiatcatcode 7693\catcode `\@\texiatcatcode
7615\long\def\parsemacbody#1@end macro% 7694{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
7616{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% 7695\xdef\temp{\eatcr{#1}}\endgroup\defmacro}}%
7617\long\def\parsermacbody#1@end rmacro% 7696{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
7618{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% 7697\xdef\temp{\eatcr{#1}}\endgroup\defmacro}}%
7619\catcode `\@=11\relax 7698\catcode `\@=11\relax
7620 7699
7621\let\endargs@\relax 7700\let\endargs@\relax
@@ -7795,15 +7874,16 @@ end
7795 \long\def#2{#4}% 7874 \long\def#2{#4}%
7796} 7875}
7797 7876
7798% This defines a Texinfo @macro. There are eight cases: recursive and 7877% This defines a Texinfo @macro. \temp has the body of the macro in it.
7799% nonrecursive macros of zero, one, up to nine, and many arguments. 7878% There are eight cases: recursive and nonrecursive macros of zero, one,
7879% up to nine, and many arguments.
7800% Much magic with \expandafter here. 7880% Much magic with \expandafter here.
7801% \xdef is used so that macro definitions will survive the file 7881% \xdef is used so that macro definitions will survive the file
7802% they're defined in; @include reads the file inside a group. 7882% they're defined in; @include reads the file inside a group.
7803% 7883%
7804\def\defmacro{% 7884\def\defmacro{%
7805 \let\hash=##% convert placeholders to macro parameter chars 7885 \let\hash=##% convert placeholders to macro parameter chars
7806 \ifrecursive 7886 \ifrecursive %%%%%%%%%%%%%% Recursive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
7807 \ifcase\paramno 7887 \ifcase\paramno
7808 % 0 7888 % 0
7809 \expandafter\xdef\csname\the\macname\endcsname{% 7889 \expandafter\xdef\csname\the\macname\endcsname{%
@@ -7835,12 +7915,11 @@ end
7835 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble 7915 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
7836 \fi 7916 \fi
7837 \fi 7917 \fi
7838 \else 7918 \else %%%%%%%%%%%%%%%%%%%%%% Non-recursive %%%%%%%%%%%%%%%%%%%%%%%%%%
7839 \ifcase\paramno 7919 \ifcase\paramno
7840 % 0 7920 % 0
7841 \expandafter\xdef\csname\the\macname\endcsname{% 7921 \expandafter\xdef\csname\the\macname\endcsname{%
7842 \noexpand\norecurse{\the\macname}% 7922 \noexpand\scanmacro{\temp}}%
7843 \noexpand\scanmacro{\temp}\egroup}%
7844 \or % 1 7923 \or % 1
7845 \expandafter\xdef\csname\the\macname\endcsname{% 7924 \expandafter\xdef\csname\the\macname\endcsname{%
7846 \bgroup 7925 \bgroup
@@ -7848,8 +7927,8 @@ end
7848 \expandafter\noexpand\csname\the\macname xxx\endcsname}% 7927 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
7849 \expandafter\xdef\csname\the\macname xxx\endcsname##1{% 7928 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
7850 \egroup 7929 \egroup
7851 \noexpand\norecurse{\the\macname}% 7930 \noexpand\scanmacro{\temp}%
7852 \noexpand\scanmacro{\temp}\egroup}% 7931 }%
7853 \else % at most 9 7932 \else % at most 9
7854 \ifnum\paramno<10\relax 7933 \ifnum\paramno<10\relax
7855 \expandafter\xdef\csname\the\macname\endcsname{% 7934 \expandafter\xdef\csname\the\macname\endcsname{%
@@ -7863,8 +7942,8 @@ end
7863 \csname\the\macname xxx\endcsname 7942 \csname\the\macname xxx\endcsname
7864 \paramlist{% 7943 \paramlist{%
7865 \egroup 7944 \egroup
7866 \noexpand\norecurse{\the\macname}% 7945 \noexpand\scanmacro{\temp}%
7867 \noexpand\scanmacro{\temp}\egroup}% 7946 }%
7868 \else % 10 or more: 7947 \else % 10 or more:
7869 \expandafter\xdef\csname\the\macname\endcsname{% 7948 \expandafter\xdef\csname\the\macname\endcsname{%
7870 \noexpand\getargvals@{\the\macname}{\argl}% 7949 \noexpand\getargvals@{\the\macname}{\argl}%
@@ -7879,16 +7958,86 @@ end
7879 7958
7880\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} 7959\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
7881 7960
7961
7962{\catcode`\@=0 \catcode`\\=13
7963@catcode`@_=11
7964
7965% Call #1 with a list of tokens #2, with any doubled backslashes in #2
7966% compressed to one.
7967@gdef@passargtomacro#1#2{%
7968 @def@the_macro{#1}%
7969 @def@pending_backslash{}%
7970 @def@finish{@finish}%
7971 @def@arg_result{}%
7972 @let@next_token=@relax
7973 @add_segment#2\@finish\%
7974}
7975
7976% Input stream is just after a backslash. If the next token is not a
7977% backslash, process the rest of the argument; otherwise, remove the next
7978% token.
7979@gdef@look_ahead{%
7980 @futurelet@next_token@look_aheadzzz}
7981@gdef@look_aheadzzz{%
7982 @ifx@next_token\%
7983 @let@next=@gobble_and_check_finish
7984 @else
7985 @let@next=@add_segment
7986 @fi@next
7987}
7988
7989% Double backslash found. Add a single backslash here.
7990@gdef@gobble_and_check_finish#1{%
7991 @add_the_backslash
7992 @def@pending_backslash{}%
7993 @futurelet@next_token@add_segment
7994}
7995
7996% append a backslash to \arg_result
7997@gdef@add_the_backslash{%
7998 @expandafter@gdef@expandafter@arg_result@expandafter{@arg_result\}%
7999}
8000
8001% Input stream is either at the start of the argument, or just after a
8002% backslash sequence, either a lone backslash, or a doubled backslash.
8003% \next_token contains the first token in the input stream: if it is \finish,
8004% finish; otherwise, append to \arg_result the segment of the argument up until
8005% the next backslash. \pending_backslash contains a backslash to represent
8006% a backslash just before the start of the input stream that has not been
8007% added to \arg_result.
8008@gdef@add_segment#1\{%
8009@ifx@next_token@finish
8010 @let@next=@call_the_macro%
8011@else
8012 @let@next=@look_ahead
8013 %
8014 % append to @arg_result
8015 % token list registers might be better
8016 @expandafter@expandafter@expandafter@gdef
8017 @expandafter@expandafter@expandafter@arg_result
8018 @expandafter@expandafter@expandafter{%
8019 @expandafter@arg_result
8020 @pending_backslash#1}%
8021 @def@pending_backslash{\}%
8022@fi@next}
8023
8024@gdef@call_the_macro{@expandafter@the_macro@expandafter{@arg_result}}
8025
8026}
8027
7882% \braceorline MAC is used for a one-argument macro MAC. It checks 8028% \braceorline MAC is used for a one-argument macro MAC. It checks
7883% whether the next non-whitespace character is a {. It sets the context 8029% whether the next non-whitespace character is a {. It sets the context
7884% for reading the argument (slightly different in the two cases). Then, 8030% for reading the argument (slightly different in the two cases). Then,
7885% to read the argument, in the whole-line case, it then calls the 8031% to read the argument, in the whole-line case, it then calls the regular
7886% regular \parsearg MAC; in the lbrace case, it just calls MAC itself. 8032% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
7887% 8033%
7888\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} 8034\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
7889\def\braceorlinexxx{% 8035\def\braceorlinexxx{%
7890 \ifx\nchar\bgroup\macroargctxt 8036 \ifx\nchar\bgroup
7891 \else\macrolineargctxt\expandafter\parsearg 8037 \macroargctxt
8038 \expandafter\passargtomacro
8039 \else
8040 \macrolineargctxt\expandafter\parsearg
7892 \fi \macnamexxx} 8041 \fi \macnamexxx}
7893 8042
7894 8043
@@ -8009,9 +8158,12 @@ end
8009% node name, #4 the name of the Info file, #5 the name of the printed 8158% node name, #4 the name of the Info file, #5 the name of the printed
8010% manual. All but the node name can be omitted. 8159% manual. All but the node name can be omitted.
8011% 8160%
8012\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} 8161\def\pxref{\putwordsee{} \xrefXX}
8013\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} 8162\def\xref{\putwordSee{} \xrefXX}
8014\def\ref#1{\xrefX[#1,,,,,,,]} 8163\def\ref{\xrefXX}
8164
8165\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
8166\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
8015% 8167%
8016\newbox\toprefbox 8168\newbox\toprefbox
8017\newbox\printedrefnamebox 8169\newbox\printedrefnamebox
@@ -8155,6 +8307,12 @@ end
8155 % 8307 %
8156 % output the `page 3'. 8308 % output the `page 3'.
8157 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% 8309 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
8310 \ifx,\tokenafterxref
8311 \else\ifx.\tokenafterxref
8312 \else\ifx;\tokenafterxref
8313 \else\ifx)\tokenafterxref
8314 \else,% add a , if xref not followed by punctuation
8315 \fi\fi\fi\fi
8158 \fi\fi 8316 \fi\fi
8159 \fi 8317 \fi
8160 \endlink 8318 \endlink
@@ -10186,8 +10344,8 @@ directory should work if nowhere else does.}
10186\def\activedoublequote{{\tt\char34}} 10344\def\activedoublequote{{\tt\char34}}
10187\let"=\activedoublequote 10345\let"=\activedoublequote
10188\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde 10346\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
10189\chardef\hat=`\^ 10347\chardef\hatchar=`\^
10190\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat 10348\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
10191 10349
10192\catcode`\_=\active 10350\catcode`\_=\active
10193\def_{\ifusingtt\normalunderscore\_} 10351\def_{\ifusingtt\normalunderscore\_}
@@ -10204,6 +10362,8 @@ directory should work if nowhere else does.}
10204\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr 10362\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
10205\catcode`\+=\active \def+{{\tt \char 43}} 10363\catcode`\+=\active \def+{{\tt \char 43}}
10206\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix 10364\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
10365\catcode`\-=\active \let-=\normaldash
10366
10207 10367
10208% used for headline/footline in the output routine, in case the page 10368% used for headline/footline in the output routine, in case the page
10209% breaks in the middle of an @tex block. 10369% breaks in the middle of an @tex block.
@@ -10218,12 +10378,6 @@ directory should work if nowhere else does.}
10218 % in principle, all other definitions in \tex have to be undone too. 10378 % in principle, all other definitions in \tex have to be undone too.
10219} 10379}
10220 10380
10221% If a .fmt file is being used, characters that might appear in a file
10222% name cannot be active until we have parsed the command line.
10223% So turn them off again, and have \everyjob (or @setfilename) turn them on.
10224% \otherifyactive is called near the end of this file.
10225\def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
10226
10227% Used sometimes to turn off (effectively) the active characters even after 10381% Used sometimes to turn off (effectively) the active characters even after
10228% parsing them. 10382% parsing them.
10229\def\turnoffactive{% 10383\def\turnoffactive{%
@@ -10242,23 +10396,22 @@ directory should work if nowhere else does.}
10242% \doublebackslash is two of them (for the pdf outlines). 10396% \doublebackslash is two of them (for the pdf outlines).
10243{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} 10397{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
10244 10398
10245% In texinfo, backslash is an active character; it prints the backslash 10399% In Texinfo, backslash is an active character; it prints the backslash
10246% in fixed width font. 10400% in fixed width font.
10247\catcode`\\=\active % @ for escape char from now on. 10401\catcode`\\=\active % @ for escape char from now on.
10248 10402
10249% The story here is that in math mode, the \char of \backslashcurfont 10403% Print a typewriter backslash. For math mode, we can't simply use
10250% ends up printing the roman \ from the math symbol font (because \char 10404% \backslashcurfont: the story here is that in math mode, the \char
10251% in math mode uses the \mathcode, and plain.tex sets 10405% of \backslashcurfont ends up printing the roman \ from the math symbol
10252% \mathcode`\\="026E). It seems better for @backslashchar{} to always 10406% font (because \char in math mode uses the \mathcode, and plain.tex
10253% print a typewriter backslash, hence we use an explicit \mathchar, 10407% sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
10254% which is the decimal equivalent of "715c (class 7, e.g., use \fam; 10408% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
10255% ignored family value; char position "5C). We can't use " for the 10409% ignored family value; char position "5C). We can't use " for the
10256% usual hex value because it has already been made active. 10410% usual hex value because it has already been made active.
10257@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
10258@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
10259 10411
10260% On startup, @fixbackslash assigns: 10412@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
10261% @let \ = @normalbackslash 10413@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
10414
10262% \rawbackslash defines an active \ to do \backslashcurfont. 10415% \rawbackslash defines an active \ to do \backslashcurfont.
10263% \otherbackslash defines an active \ to be a literal `\' character with 10416% \otherbackslash defines an active \ to be a literal `\' character with
10264% catcode other. We switch back and forth between these. 10417% catcode other. We switch back and forth between these.
@@ -10266,8 +10419,7 @@ directory should work if nowhere else does.}
10266@gdef@otherbackslash{@let\=@realbackslash} 10419@gdef@otherbackslash{@let\=@realbackslash}
10267 10420
10268% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of 10421% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
10269% the literal character `\'. Also revert - to its normal character, in 10422% the literal character `\'.
10270% case the active - from code has slipped in.
10271% 10423%
10272{@catcode`- = @active 10424{@catcode`- = @active
10273 @gdef@normalturnoffactive{% 10425 @gdef@normalturnoffactive{%
@@ -10278,40 +10430,56 @@ directory should work if nowhere else does.}
10278 @let+=@normalplus 10430 @let+=@normalplus
10279 @let<=@normalless 10431 @let<=@normalless
10280 @let>=@normalgreater 10432 @let>=@normalgreater
10281 @let\=@normalbackslash
10282 @let^=@normalcaret 10433 @let^=@normalcaret
10283 @let_=@normalunderscore 10434 @let_=@normalunderscore
10284 @let|=@normalverticalbar 10435 @let|=@normalverticalbar
10285 @let~=@normaltilde 10436 @let~=@normaltilde
10437 @let\=@ttbackslash
10286 @markupsetuplqdefault 10438 @markupsetuplqdefault
10287 @markupsetuprqdefault 10439 @markupsetuprqdefault
10288 @unsepspaces 10440 @unsepspaces
10289 } 10441 }
10290} 10442}
10291 10443
10292% Make _ and + \other characters, temporarily. 10444% If a .fmt file is being used, characters that might appear in a file
10293% This is canceled by @fixbackslash. 10445% name cannot be active until we have parsed the command line.
10294@otherifyactive 10446% So turn them off again, and have @fixbackslash turn them back on.
10447@catcode`+=@other @catcode`@_=@other
10295 10448
10449% \enablebackslashhack - allow file to begin `\input texinfo'
10450%
10296% If a .fmt file is being used, we don't want the `\input texinfo' to show up. 10451% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
10297% That is what \eatinput is for; after that, the `\' should revert to printing 10452% That is what \eatinput is for; after that, the `\' should revert to printing
10298% a backslash. 10453% a backslash.
10299% 10454% If the file did not have a `\input texinfo', then it is turned off after
10300@gdef@eatinput input texinfo{@fixbackslash} 10455% the first line; otherwise the first `\' in the file would cause an error.
10301@global@let\ = @eatinput 10456% This is used on the very last line of this file, texinfo.tex.
10457% We also use @c to call @fixbackslash, in case ends of lines are hidden.
10458{
10459@catcode`@^=7
10460@catcode`@^^M=13@gdef@enablebackslashhack{%
10461 @global@let\ = @eatinput%
10462 @catcode`@^^M=13%
10463 @def@c{@fixbackslash@c}%
10464 @def ^^M{@let^^M@secondlinenl}%
10465 @gdef @secondlinenl{@let^^M@thirdlinenl}%
10466 @gdef @thirdlinenl{@fixbackslash}%
10467}}
10468
10469{@catcode`@^=7 @catcode`@^^M=13%
10470@gdef@eatinput input texinfo#1^^M{@fixbackslash}}
10302 10471
10303% On the other hand, perhaps the file did not have a `\input texinfo'. Then
10304% the first `\' in the file would cause an error. This macro tries to fix
10305% that, assuming it is called before the first `\' could plausibly occur.
10306% Also turn back on active characters that might appear in the input
10307% file name, in case not using a pre-dumped format.
10308%
10309@gdef@fixbackslash{% 10472@gdef@fixbackslash{%
10310 @ifx\@eatinput @let\ = @normalbackslash @fi 10473 @ifx\@eatinput @let\ = @ttbackslash @fi
10474 @catcode13=5 % regular end of line
10475 @let@c=@texinfoc
10476 % Also turn back on active characters that might appear in the input
10477 % file name, in case not using a pre-dumped format.
10311 @catcode`+=@active 10478 @catcode`+=@active
10312 @catcode`@_=@active 10479 @catcode`@_=@active
10313} 10480}
10314 10481
10482
10315% Say @foo, not \foo, in error messages. 10483% Say @foo, not \foo, in error messages.
10316@escapechar = `@@ 10484@escapechar = `@@
10317 10485
@@ -10351,3 +10519,4 @@ directory should work if nowhere else does.}
10351@ignore 10519@ignore
10352 arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 10520 arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
10353@end ignore 10521@end ignore
10522@enablebackslashhack