Mercurial > gnulib
comparison build-aux/texinfo.tex @ 9862:24b5bbef71de
update from texinfo
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Thu, 03 Apr 2008 06:18:57 -0700 |
parents | 7898b15f2c3f |
children | 08e89df21156 |
comparison
equal
deleted
inserted
replaced
9861:fda9bc12e47f | 9862:24b5bbef71de |
---|---|
459 | 459 |
460 % First remove any @comment, then any @c comment. | 460 % First remove any @comment, then any @c comment. |
461 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} | 461 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} |
462 \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} | 462 \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} |
463 | 463 |
464 % Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space. | 464 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space. |
465 % | 465 % |
466 % \argremovec might leave us with trailing space, e.g., | 466 % \argremovec might leave us with trailing space, e.g., |
467 % @end itemize @c foo | 467 % @end itemize @c foo |
468 % This space token undergoes the same procedure and is eventually removed | 468 % This space token undergoes the same procedure and is eventually removed |
469 % by \finishparsearg. | 469 % by \finishparsearg. |
484 | 484 |
485 % If a _delimited_ argument is enclosed in braces, they get stripped; so | 485 % If a _delimited_ argument is enclosed in braces, they get stripped; so |
486 % to get _exactly_ the rest of the line, we had to prevent such situation. | 486 % to get _exactly_ the rest of the line, we had to prevent such situation. |
487 % We prepended an \empty token at the very beginning and we expand it now, | 487 % We prepended an \empty token at the very beginning and we expand it now, |
488 % just before passing the control to \argtorun. | 488 % just before passing the control to \argtorun. |
489 % (Similarily, we have to think about #3 of \argcheckspacesY above: it is | 489 % (Similarly, we have to think about #3 of \argcheckspacesY above: it is |
490 % either the null string, or it ends with \^^M---thus there is no danger | 490 % either the null string, or it ends with \^^M---thus there is no danger |
491 % that a pair of braces would be stripped. | 491 % that a pair of braces would be stripped. |
492 % | 492 % |
493 % But first, we have to remove the trailing space token. | 493 % But first, we have to remove the trailing space token. |
494 % | 494 % |
541 % defines \thisenv, so the current environment is known; @end checks | 541 % defines \thisenv, so the current environment is known; @end checks |
542 % whether the environment name matches. The \checkenv macro can also be | 542 % whether the environment name matches. The \checkenv macro can also be |
543 % used to check whether the current environment is the one expected. | 543 % used to check whether the current environment is the one expected. |
544 % | 544 % |
545 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they | 545 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they |
546 % are not treated as enviroments; they don't open a group. (The | 546 % are not treated as environments; they don't open a group. (The |
547 % implementation of @end takes care not to call \endgroup in this | 547 % implementation of @end takes care not to call \endgroup in this |
548 % special case.) | 548 % special case.) |
549 | 549 |
550 | 550 |
551 % At runtime, environments start with this: | 551 % At run-time, environments start with this: |
552 \def\startenvironment#1{\begingroup\def\thisenv{#1}} | 552 \def\startenvironment#1{\begingroup\def\thisenv{#1}} |
553 % initialize | 553 % initialize |
554 \let\thisenv\empty | 554 \let\thisenv\empty |
555 | 555 |
556 % ... but they get defined via ``\envdef\foo{...}'': | 556 % ... but they get defined via ``\envdef\foo{...}'': |
564 \else | 564 \else |
565 \badenverr | 565 \badenverr |
566 \fi | 566 \fi |
567 } | 567 } |
568 | 568 |
569 % Evironment mismatch, #1 expected: | 569 % Environment mismatch, #1 expected: |
570 \def\badenverr{% | 570 \def\badenverr{% |
571 \errhelp = \EMsimple | 571 \errhelp = \EMsimple |
572 \errmessage{This command can appear only \inenvironment\temp, | 572 \errmessage{This command can appear only \inenvironment\temp, |
573 not \inenvironment\thisenv}% | 573 not \inenvironment\thisenv}% |
574 } | 574 } |
4445 % then page number (#2) flushed to the right margin. It is used for index | 4445 % then page number (#2) flushed to the right margin. It is used for index |
4446 % and table of contents entries. The paragraph is indented by \leftskip. | 4446 % and table of contents entries. The paragraph is indented by \leftskip. |
4447 % | 4447 % |
4448 % A straightforward implementation would start like this: | 4448 % A straightforward implementation would start like this: |
4449 % \def\entry#1#2{... | 4449 % \def\entry#1#2{... |
4450 % But this frozes the catcodes in the argument, and can cause problems to | 4450 % But this freezes the catcodes in the argument, and can cause problems to |
4451 % @code, which sets - active. This problem was fixed by a kludge--- | 4451 % @code, which sets - active. This problem was fixed by a kludge--- |
4452 % ``-'' was active throughout whole index, but this isn't really right. | 4452 % ``-'' was active throughout whole index, but this isn't really right. |
4453 % | 4453 % |
4454 % The right solution is to prevent \entry from swallowing the whole text. | 4454 % The right solution is to prevent \entry from swallowing the whole text. |
4455 % --kasal, 21nov03 | 4455 % --kasal, 21nov03 |
6261 } | 6261 } |
6262 | 6262 |
6263 \def\Edefun{\endgraf\medbreak} | 6263 \def\Edefun{\endgraf\medbreak} |
6264 | 6264 |
6265 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; | 6265 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; |
6266 % the only thing remainnig is to define \deffnheader. | 6266 % the only thing remaining is to define \deffnheader. |
6267 % | 6267 % |
6268 \def\makedefun#1{% | 6268 \def\makedefun#1{% |
6269 \expandafter\let\csname E#1\endcsname = \Edefun | 6269 \expandafter\let\csname E#1\endcsname = \Edefun |
6270 \edef\temp{\noexpand\domakedefun | 6270 \edef\temp{\noexpand\domakedefun |
6271 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% | 6271 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% |
7334 }%end \catcode `\@=11 | 7334 }%end \catcode `\@=11 |
7335 | 7335 |
7336 % In case a @footnote appears in a vbox, save the footnote text and create | 7336 % In case a @footnote appears in a vbox, save the footnote text and create |
7337 % the real \insert just after the vbox finished. Otherwise, the insertion | 7337 % the real \insert just after the vbox finished. Otherwise, the insertion |
7338 % would be lost. | 7338 % would be lost. |
7339 % Similarily, if a @footnote appears inside an alignment, save the footnote | 7339 % Similarly, if a @footnote appears inside an alignment, save the footnote |
7340 % text to a box and make the \insert when a row of the table is finished. | 7340 % text to a box and make the \insert when a row of the table is finished. |
7341 % And the same can be done for other insert classes. --kasal, 16nov03. | 7341 % And the same can be done for other insert classes. --kasal, 16nov03. |
7342 | 7342 |
7343 % Replace the \insert primitive by a cheating macro. | 7343 % Replace the \insert primitive by a cheating macro. |
7344 % Deeper inside, just make sure that the saved insertions are not spilled | 7344 % Deeper inside, just make sure that the saved insertions are not spilled |