summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-04-30 09:44:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-04-30 09:45:08 -0700
commit46b434a62cea06bdcb3c8d9ee18284ab59e9b012 (patch)
treeb14b9963adc009ecbf2f380630bf443a57f2ee87
parent826f1e260121edc5185e0ed3fa20a781fbddc9a2 (diff)
downloademacs-46b434a62cea06bdcb3c8d9ee18284ab59e9b012.tar.gz
Update from Gnulib
* build-aux/config.guess, doc/misc/texinfo.tex: * lib/mktime-internal.h, lib/mktime.c, lib/timegm.c: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
-rwxr-xr-xbuild-aux/config.guess27
-rw-r--r--doc/misc/texinfo.tex516
-rw-r--r--lib/gnulib.mk.in1
-rw-r--r--lib/mktime-internal.h60
-rw-r--r--lib/mktime.c71
-rw-r--r--lib/timegm.c32
6 files changed, 349 insertions, 358 deletions
diff --git a/build-aux/config.guess b/build-aux/config.guess
index 79d1317f52b..4cd9454b35c 100755
--- a/build-aux/config.guess
+++ b/build-aux/config.guess
@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2019 Free Software Foundation, Inc.
-timestamp='2019-03-04'
+timestamp='2019-04-28'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -1468,6 +1468,14 @@ cat > "$dummy.c" <<EOF
#include <sys/types.h>
#include <sys/utsname.h>
#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
main ()
{
#if defined (sony)
@@ -1555,18 +1563,23 @@ main ()
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
+#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
-#include <signal.h>
-#if defined(_SIZE_T_) /* >= ULTRIX4 */
- printf ("mips-dec-ultrix4\n"); exit (0);
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
-#if defined(ULTRIX3) || defined(ultrix3) || defined(SIGLOST)
- printf ("mips-dec-ultrix3\n"); exit (0);
-#endif
+ printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index 192284cccc1..ccd112941ac 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,8 +3,7 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2019-03-03.15}
-
+\def\texinfoversion{2019-04-12.13}
%
% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc.
%
@@ -387,14 +386,8 @@
% take effect in \write's, yet the group defined by the \vbox ends
% before the \shipout runs.
%
- \indexdummies % don't expand commands in the output.
- \normalturnoffactive % \ in index entries must not stay \, e.g., if
- % the page break happens to be in the middle of an example.
- % We don't want .vr (or whatever) entries like this:
- % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
- % "\acronym" won't work when it's read back in;
- % it needs to be
- % {\code {{\backslashcurfont }acronym}
+ \atdummies % don't expand commands in the output.
+ \turnoffactive
\shipout\vbox{%
% Do this early so pdf references go to the beginning of the page.
\ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
@@ -455,11 +448,10 @@
}%
}
-% First remove any @comment, then any @c comment. Also remove a @texinfoc
-% comment (see \scanmacro for details). Pass the result on to \argcheckspaces.
+% First remove any @comment, then any @c comment. Pass the result on to
+% \argcheckspaces.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
-\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
-\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
% Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
%
@@ -1131,6 +1123,16 @@ where each line of input produces a line of output.}
\fi
\fi
+\newif\ifpdforxetex
+\pdforxetexfalse
+\ifpdf
+ \pdforxetextrue
+\fi
+\ifx\XeTeXrevision\thisisundefined\else
+ \pdforxetextrue
+\fi
+
+
% PDF uses PostScript string constants for the names of xref targets,
% for display in the outlines, and in other places. Thus, we have to
% double any backslashes. Otherwise, a name like "\node" will be
@@ -2173,7 +2175,7 @@ end
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
-\setfont\defsl\slshape{10}{\magstep1}{OT1TT}
+\setfont\defsl\slshape{10}{\magstep1}{OT1}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\ttslfont=\defttsl \let\slfont=\defsl \bf}
@@ -2321,7 +2323,7 @@ end
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
-\setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
+\setfont\defsl\slshape{10}{\magstephalf}{OT1}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\slfont=\defsl \let\ttslfont=\defttsl \bf}
@@ -2844,7 +2846,7 @@ end
% @t, explicit typewriter.
\def\t#1{%
- {\tt \rawbackslash \plainfrenchspacing #1}%
+ {\tt \plainfrenchspacing #1}%
\null
}
@@ -2871,7 +2873,6 @@ end
% Turn off hyphenation.
\nohyphenation
%
- \rawbackslash
\plainfrenchspacing
#1%
}%
@@ -3097,9 +3098,9 @@ end
% Allow a ragged right output to aid breaking long URL's. Putting stretch in
% between characters of the URL doesn't look good.
\def\urefallowbreak{%
- \hskip 0pt plus 1fil\relax
+ \hskip 0pt plus 4 em\relax
\allowbreak
- \hskip 0pt plus -1fil\relax
+ \hskip 0pt plus -4 em\relax
}
\urefbreakstyle after
@@ -3112,7 +3113,7 @@ end
% So now @email is just like @uref, unless we are pdf.
%
%\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdf
+\ifpdforxetex
\def\email#1{\doemail#1,,\finish}
\def\doemail#1,#2,#3\finish{\begingroup
\unsepspaces
@@ -3122,18 +3123,7 @@ end
\endlink
\endgroup}
\else
- \ifx\XeTeXrevision\thisisundefined
- \let\email=\uref
- \else
- \def\email#1{\doemail#1,,\finish}
- \def\doemail#1,#2,#3\finish{\begingroup
- \unsepspaces
- \pdfurl{mailto:#1}%
- \setbox0 = \hbox{\ignorespaces #2}%
- \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
- \endlink
- \endgroup}
- \fi
+ \let\email=\uref
\fi
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
@@ -4667,19 +4657,6 @@ end
}
}
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we call \makevalueexpandable in \indexdummies).
-% The command has to be fully expandable (if the variable is set), since
-% the result winds up in the index file. This means that if the
-% variable's value contains other Texinfo commands, it's almost certain
-% it will fail (although perhaps we could fix that with sufficient work
-% to do a one-level expansion on the result, instead of complete).
-%
-% Unfortunately, this has the consequence that when _ is in the *value*
-% of an @set, it does not print properly in the roman fonts (get the cmr
-% dot accent at position 126 instead). No fix comes to mind, and it's
-% been this way since 2003 or earlier, so just ignore it.
-%
\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
{[No value for ``#1'']}%
@@ -4708,7 +4685,7 @@ end
% if possible, otherwise sort late.
\def\indexnofontsvalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
- ZZZZZZZ
+ ZZZZZZZ%
\else
\csname SET#1\endcsname
\fi
@@ -4858,23 +4835,8 @@ end
\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
-% Used when writing an index entry out to an index file to prevent
-% expansion of Texinfo commands that can appear in an index entry.
-%
-\def\indexdummies{%
- \escapechar = `\\ % use backslash in output files.
- \definedummyletter\@%
- \definedummyletter\ %
- %
- % For texindex which always views { and } as separators.
- \def\{{\lbracechar{}}%
- \def\}{\rbracechar{}}%
- %
- % Do the redefinitions.
- \definedummies
-}
-
-% Used for the aux and toc files, where @ is the escape character.
+% Used for the aux, toc and index files to prevent expansion of Texinfo
+% commands.
%
\def\atdummies{%
\definedummyletter\@%
@@ -4904,8 +4866,7 @@ end
\def\definedummyletter#1{\def#1{\string#1}}%
\let\definedummyaccent\definedummyletter
-% Called from \indexdummies and \atdummies, to effectively prevent
-% the expansion of commands.
+% Called from \atdummies to prevent the expansion of commands.
%
\def\definedummies{%
%
@@ -4954,6 +4915,7 @@ end
% Assorted special characters.
\definedummyword\atchar
\definedummyword\arrow
+ \definedummyword\backslashchar
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
@@ -5070,11 +5032,10 @@ end
\commondummyword\xref
}
-% This does nothing, but for a time it was recommended to use
-% \usebracesinindexestrue to be able to use braces in index entries.
-
\let\indexlbrace\relax
\let\indexrbrace\relax
+\let\indexatchar\relax
+\let\indexbackslash\relax
{\catcode`\@=0
\catcode`\\=13
@@ -5108,10 +5069,8 @@ end
}
\gdef\indexnonalnumreappear{%
- \useindexbackslash
\let-\normaldash
\let<\normalless
- \def\@{@}%
}
}
@@ -5222,8 +5181,6 @@ end
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-
% #1 is the index name, #2 is the entry text.
\def\doind#1#2{%
\iflinks
@@ -5255,13 +5212,6 @@ end
\fi}
\def\indexisfl{fl}
-% Output \ as {\indexbackslash}, because \ is an escape character in
-% the index files.
-\let\indexbackslash=\relax
-{\catcode`\@=0 \catcode`\\=\active
- @gdef@useindexbackslash{@def\{{@indexbackslash}}}
-}
-
% Definition for writing index entry sort key.
{
\catcode`\-=13
@@ -5273,14 +5223,31 @@ end
\xdef\indexsortkey{#1}\endgroup}
}
+\def\indexwriteseealso#1{
+ \gdef\pagenumbertext{@seealso{#1}}%
+}
+\def\indexwriteseeentry#1{
+ \gdef\pagenumbertext{@seeentry{#1}}%
+}
+
+% The default definitions
+\def\sortas#1{}%
+\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
+\def\putwordSeeAlso{See also}
+\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
+
+
% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
% * Set \bracedtext to "{aaa}{bbb}"
% * Set \fullindexsortkey to "aaa @subentry ZZZ"
+% * If @seealso occurs, set \pagenumbertext
%
\def\splitindexentry#1{%
\gdef\fullindexsortkey{}%
\xdef\bracedtext{}%
\def\sep{}%
+ \def\seealso##1{}%
+ \def\seeentry##1{}%
\expandafter\doindexsegment#1\subentry\finish\subentry
}
@@ -5292,7 +5259,6 @@ end
%
% Fully expand the segment, throwing away any @sortas directives, and
% trim spaces.
- \def\sortas##1{}%
\edef\trimmed{\segment}%
\edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
%
@@ -5302,16 +5268,23 @@ end
% font commands turned off.
\bgroup
\let\sortas\indexwritesortas
+ \let\seealso\indexwriteseealso
+ \let\seeentry\indexwriteseeentry
\indexnofonts
% The braces around the commands are recognized by texindex.
- \def\lbracechar{{\indexlbrace}}%
- \def\rbracechar{{\indexrbrace}}%
+ \def\lbracechar{{\string\indexlbrace}}%
+ \def\rbracechar{{\string\indexrbrace}}%
\let\{=\lbracechar
\let\}=\rbracechar
+ \def\@{{\string\indexatchar}}%
+ \def\atchar##1{\@}%
+ \def\backslashchar{{\string\indexbackslash}}%
+ \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
%
\let\indexsortkey\empty
+ \global\let\pagenumbertext\empty
% Execute the segment and throw away the typeset output. This executes
- % any @sortas commands in this segment.
+ % any @sortas or @seealso commands in this segment.
\setbox\dummybox = \hbox{\segment}%
\ifx\indexsortkey\empty{%
\indexnonalnumdisappear
@@ -5332,21 +5305,31 @@ end
\fi
}
\def\isfinish{\finish}%
+\newbox\dummybox % used above
\let\subentry\relax
-% Write the entry in \toks0 to the index file.
+% Use \ instead of @ in index files. To support old texi2dvi and texindex.
+% This works without changing the escape character used in the toc or aux
+% files because the index entries are fully expanded here, and \string uses
+% the current value of \escapechar.
+\def\escapeisbackslash{\escapechar=`\\}
+
+% Write the entry in \indextext to the index file.
%
\def\doindwrite{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+ \maybemarginindex
+ %
+ \atdummies
+ %
+ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
+ \escapeisbackslash
\fi
%
- % Remember, we are within a group.
- \indexdummies % Must do this here, since \bf, etc expand at this stage
- \useindexbackslash % \indexbackslash isn't defined now so it will be output
- % as is; and it will print as backslash.
+ % For texindex which always views { and } as separators.
+ \def\{{\lbracechar{}}%
+ \def\}{\rbracechar{}}%
+ \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
%
% Split the entry into primary entry and any subentries, and get the index
% sort key.
@@ -5360,11 +5343,21 @@ end
%
\edef\temp{%
\write\writeto{%
- \string\entry{\fullindexsortkey}{\noexpand\folio}\bracedtext}%
+ \string\entry{\fullindexsortkey}%
+ {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
+ \bracedtext}%
}%
\temp
}
-\newbox\dummybox % used above
+
+% Put the index entry in the margin if desired (undocumented).
+\def\maybemarginindex{%
+ \ifx\SETmarginindex\relax\else
+ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
+ \fi
+}
+\let\SETmarginindex=\relax
+
% Take care of unwanted page breaks/skips around a whatsit:
%
@@ -5452,9 +5445,14 @@ end
% \entry {topic}{pagelist}
% for a topic that is used without subtopics
% \primary {topic}
+% \entry {topic}{}
% for the beginning of a topic that is used with subtopics
% \secondary {subtopic}{pagelist}
% for each subtopic.
+% \secondary {subtopic}{}
+% for a subtopic with sub-subtopics
+% \tertiary {subtopic}{subsubtopic}{pagelist}
+% for each sub-subtopic.
% Define the user-accessible indexing commands
% @findex, @vindex, @kindex, @cindex.
@@ -5479,14 +5477,10 @@ end
\plainfrenchspacing
\everypar = {}% don't want the \kern\-parindent from indentation suppression.
%
- % See if the index file exists and is nonempty.
- % Change catcode of @ here so that if the index file contains
- % \initial {@}
- % as its first line, TeX doesn't complain about mismatched braces
- % (because it thinks @} is a control sequence).
- \catcode`\@ = 12
% See comment in \requireopenindexfile.
\def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
+ %
+ % See if the index file exists and is nonempty.
\openin 1 \jobname.\indexname s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
@@ -5496,8 +5490,6 @@ end
\putwordIndexNonexistent
\typeout{No file \jobname.\indexname s.}%
\else
- \catcode`\\ = 0
- %
% If the index file exists but is empty, then \openin leaves \ifeof
% false. We have to make TeX try to read something from the file, so
% it can discover if there is anything in it.
@@ -5505,47 +5497,52 @@ end
\ifeof 1
\putwordIndexIsEmpty
\else
- % Index files are almost Texinfo source, but we use \ as the escape
- % character. It would be better to use @, but that's too big a change
- % to make right now.
- \def\indexbackslash{\ttbackslash}%
- \let\indexlbrace\{ % Likewise, set these sequences for braces
- \let\indexrbrace\} % used in the sort key.
- \begindoublecolumns
- \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty
- %
- % Read input from the index file line by line.
- \loopdo
- \ifeof1 \else
- \read 1 to \nextline
- \fi
- %
- \indexinputprocessing
- \thisline
- %
- \ifeof1\else
- \let\thisline\nextline
- \repeat
- %%
- \enddoublecolumns
+ \expandafter\printindexzz\thisline\relax\relax\finish%
\fi
\fi
\closein 1
\endgroup}
-\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
-\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
-\def\indexinputprocessing{%
- \ifeof1
- \let\firsttoken\relax
+% If the index file starts with a backslash, forgo reading the index
+% file altogether. If somebody upgrades texinfo.tex they may still have
+% old index files using \ as the escape character. Reading this would
+% at best lead to typesetting garbage, at worst a TeX syntax error.
+\def\printindexzz#1#2\finish{%
+ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
+ \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
+ \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax
+\errmessage{%
+ERROR: A sorted index file in an obsolete format was skipped.
+To fix this problem, please upgrade your version of 'texi2dvi'
+or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
+If you are using an old version of 'texindex' (part of the Texinfo
+distribution), you may also need to upgrade to a newer version (at least 6.0).
+You may be able to typeset the index if you run
+'texindex \jobname.\indexname' yourself.
+You could also try setting the 'txiindexescapeisbackslash' flag by
+running a command like
+'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
+this, Texinfo will try to use index files in the old format.
+If you continue to have problems, deleting the index files and starting again
+might help (with 'rm \jobname.?? \jobname.??s')%
+}%
+ \else
+ (Skipped sorted index file in obsolete format)
+ \fi
+ \else
+ \begindoublecolumns
+ \input \jobname.\indexname s
+ \enddoublecolumns
+ \fi
\else
- \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
- \act
+ \message{trying to print index \indexname}%
+ \begindoublecolumns
+ \catcode`\\=0\relax
+ \catcode`\@=12\relax
+ \input \jobname.\indexname s
+ \enddoublecolumns
\fi
}
-\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
-\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
-
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
@@ -5554,12 +5551,19 @@ end
\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
\catcode`\$=3
\gdef\initialglyphs{%
+ % special control sequences used in the index sort key
+ \let\indexlbrace\{%
+ \let\indexrbrace\}%
+ \let\indexatchar\@%
+ \def\indexbackslash{\math{\backslash}}%
+ %
% Some changes for non-alphabetic characters. Using the glyphs from the
% math fonts looks more consistent than the typewriter font used elsewhere
% for these characters.
- \def\indexbackslash{\math{\backslash}}%
- \let\\=\indexbackslash
+ \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
%
+ % In case @\ is used for backslash
+ \uppercase{\let\\=~}
% Can't get bold backslash so don't use bold forward slash
\catcode`\/=13
\def/{{\secrmnotbold \normalslash}}%
@@ -5619,12 +5623,6 @@ end
\def\entry{%
\begingroup
%
- % For pdfTeX and XeTeX.
- % The redefinition of \domark stops marks being added in \pdflink to
- % preserve coloured links across page boundaries. Otherwise the marks
- % would get in the way of \lastbox in \insertentrybox.
- \let\domark\relax
- %
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
\par
@@ -5657,35 +5655,31 @@ end
\gdef\finishentry#1{%
\egroup % end box A
\dimen@ = \wd\boxA % Length of text of entry
- \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
- % #1 is the page number.
- %
- % Get the width of the page numbers, and only use
- % leaders if they are present.
- \global\setbox\boxB = \hbox{#1}%
- \ifdim\wd\boxB = 0pt
- \null\nobreak\hfill\ %
- \else
- %
- \null\nobreak\indexdotfill % Have leaders before the page number.
+ \global\setbox\boxA=\hbox\bgroup
+ \unhbox\boxA
+ % #1 is the page number.
%
- \ifpdf
- \pdfgettoks#1.%
- \hskip\skip\thinshrinkable\the\toksA
+ % Get the width of the page numbers, and only use
+ % leaders if they are present.
+ \global\setbox\boxB = \hbox{#1}%
+ \ifdim\wd\boxB = 0pt
+ \null\nobreak\hfill\ %
\else
- \ifx\XeTeXrevision\thisisundefined
- \hskip\skip\thinshrinkable #1%
- \else
+ %
+ \null\nobreak\indexdotfill % Have leaders before the page number.
+ %
+ \ifpdforxetex
\pdfgettoks#1.%
\hskip\skip\thinshrinkable\the\toksA
+ \else
+ \hskip\skip\thinshrinkable #1%
\fi
\fi
- \fi
\egroup % end \boxA
\ifdim\wd\boxB = 0pt
- \global\setbox\entrybox=\vbox{\unhbox\boxA}%
- \else
- \global\setbox\entrybox=\vbox\bgroup
+ \noindent\unhbox\boxA\par
+ \nobreak
+ \else\bgroup
% We want the text of the entries to be aligned to the left, and the
% page numbers to be aligned to the right.
%
@@ -5751,55 +5745,11 @@ end
\egroup % The \vbox
\fi
\endgroup
- \dotheinsertentrybox
}}
\newskip\thinshrinkable
\skip\thinshrinkable=.15em minus .15em
-\newbox\entrybox
-\def\insertentrybox{%
- \ourunvbox\entrybox
-}
-
-% default definition
-\let\dotheinsertentrybox\insertentrybox
-
-% Use \lastbox to take apart vbox box by box, and add each sub-box
-% to the current vertical list.
-\def\ourunvbox#1{%
-\bgroup % for local binding of \delayedbox
- % Remove the last box from box #1
- \global\setbox#1=\vbox{%
- \unvbox#1%
- \unskip % remove any glue
- \unpenalty
- \global\setbox\interbox=\lastbox
- }%
- \setbox\delayedbox=\box\interbox
- \ifdim\ht#1=0pt\else
- \ourunvbox#1 % Repeat on what's left of the box
- \nobreak
- \fi
- \box\delayedbox
-\egroup
-}
-\newbox\delayedbox
-\newbox\interbox
-
-% Used from \printindex. \firsttoken should be the first token
-% after the \entry. If it's not another \entry, we are at the last
-% line of a group of index entries, so insert a penalty to discourage
-% widowed index entries.
-\def\dotheinsertentryboxwithpenalty{%
- \ifx\firsttoken\isentry
- \else
- \penalty 9000
- \fi
- \insertentrybox
-}
-\def\isentry{\entry}%
-
% Like plain.tex's \dotfill, except uses up at least 1 em.
% The filll stretch here overpowers both the fil and fill stretch to push
% the page number to the right.
@@ -5809,24 +5759,15 @@ end
\def\primary #1{\line{#1\hfil}}
-\newskip\secondaryindent \secondaryindent=0.5cm
-\def\secondary#1#2{{%
- \parfillskip=0in
- \parskip=0in
- \hangindent=1in
- \hangafter=1
- \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
- \ifpdf
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
- \else
- \ifx\XeTeXrevision\thisisundefined
- #2
- \else
- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
- \fi
- \fi
- \par
-}}
+\def\secondary{\indententry{0.5cm}}
+\def\tertiary{\indententry{1cm}}
+
+\def\indententry#1#2#3{%
+ \bgroup
+ \leftskip=#1
+ \entry{#2}{#3}%
+ \egroup
+}
% Define two-column mode, which we use to typeset indexes.
% Adapted from the TeXbook, page 416, which is to say,
@@ -5844,17 +5785,6 @@ end
\output = {%
\savetopmark
%
- % Here is a possibility not foreseen in manmac: if we accumulate a
- % whole lot of material, we might end up calling this \output
- % routine twice in a row (see the doublecol-lose test, which is
- % essentially a couple of indexes with @setchapternewpage off). In
- % that case we just ship out what is in \partialpage with the normal
- % output routine. Generally, \partialpage will be empty when this
- % runs and this will be a no-op. See the indexspread.tex test case.
- \ifvoid\partialpage \else
- \onepageout{\pagecontents\partialpage}%
- \fi
- %
\global\setbox\partialpage = \vbox{%
% Unvbox the main output page.
\unvbox\PAGE
@@ -6134,11 +6064,9 @@ end
% @raisesections: treat @section as chapter, @subsection as section, etc.
\def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
% @lowersections: treat @chapter as section, @section as subsection, etc.
\def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
% we only have subsub.
\chardef\maxseclevel = 3
@@ -6790,13 +6718,8 @@ end
% 1 and 2 (the page numbers aren't printed), and so are the first
% two pages of the document. Thus, we'd have two destinations named
% `1', and two named `2'.
- \ifpdf
+ \ifpdforxetex
\global\pdfmakepagedesttrue
- \else
- \ifx\XeTeXrevision\thisisundefined
- \else
- \global\pdfmakepagedesttrue
- \fi
\fi
}
@@ -7159,11 +7082,7 @@ end
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% environment contents.
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
+
%
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctr{{\hskip 6pt\circle\char'010}}
@@ -7178,7 +7097,18 @@ end
%
\newskip\lskip\newskip\rskip
+% only require the font if @cartouche is actually used
+\def\cartouchefontdefs{%
+ \font\circle=lcircle10\relax
+ \circthick=\fontdimen8\circle
+}
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+
+
\envdef\cartouche{%
+ \cartouchefontdefs
\ifhmode\par\fi % can't be in the midst of a paragraph.
\startsavinginserts
\lskip=\leftskip \rskip=\rightskip
@@ -8050,36 +7980,18 @@ end
}
\fi
-% alias because \c means cedilla in @tex or @math
-\let\texinfoc=\c
-
-\newcount\savedcatcodeone
-\newcount\savedcatcodetwo
-
% Used at the time of macro expansion.
% Argument is macro body with arguments substituted
\def\scanmacro#1{%
\newlinechar`\^^M
\def\xeatspaces{\eatspaces}%
%
- % Temporarily undo catcode changes of \printindex. Set catcode of @ to
- % 0 so that @-commands in macro expansions aren't printed literally when
- % formatting an index file, where \ is used as the escape character.
- \savedcatcodeone=\catcode`\@
- \savedcatcodetwo=\catcode`\\
- \catcode`\@=0
- \catcode`\\=\active
- %
% Process the macro body under the current catcode regime.
- \scantokens{#1@texinfoc}%
- %
- \catcode`\@=\savedcatcodeone
- \catcode`\\=\savedcatcodetwo
+ \scantokens{#1@comment}%
%
- % The \texinfoc is to remove the \newlinechar added by \scantokens, and
- % can be noticed by \parsearg.
- % We avoid surrounding the call to \scantokens with \bgroup and \egroup
- % to allow macros to open or close groups themselves.
+ % The \comment is to remove the \newlinechar added by \scantokens, and
+ % can be noticed by \parsearg. Note \c isn't used because this means cedilla
+ % in math mode.
}
% Used for copying and captions
@@ -8180,12 +8092,14 @@ end
\def\macroargctxt{%
\scanctxt
\catcode`\ =\active
+ \catcode`\@=\other
\catcode`\^^M=\other
\catcode`\\=\active
}
\def\macrolineargctxt{% used for whole-line arguments without braces
\scanctxt
+ \catcode`\@=\other
\catcode`\{=\other
\catcode`\}=\other
}
@@ -8749,9 +8663,29 @@ end
% also remove a trailing comma, in case of something like this:
% @node Help-Cross, , , Cross-refs
\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
+
+% Used so that the @top node doesn't have to be wrapped in an @ifnottex
+% conditional.
+% \doignore goes to more effort to skip nested conditionals but we don't need
+% that here.
+\def\omittopnode{%
+ \ifx\lastnode\wordTop
+ \expandafter\ignorenode\fi
+}
+\def\wordTop{Top}
+
+% Until the next @node or @bye command, divert output to a box that is not
+% output.
+\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
+\ignorenodebye
+}
+
+{\let\bye\relax
+\gdef\ignorenodebye{\let\bye\ignorenodebyedef}
+\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
+% The redefinition of \bye here is because it is declared \outer
-\let\nwnode=\node
\let\lastnode=\empty
% Write a cross-reference definition for the current node. #1 is the
@@ -9226,19 +9160,6 @@ end
\catcode`\^^]=\other
\catcode`\^^^=\other
\catcode`\^^_=\other
- % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
- % in xref tags, i.e., node names. But since ^^e4 notation isn't
- % supported in the main text, it doesn't seem desirable. Furthermore,
- % that is not enough: for node names that actually contain a ^
- % character, we would end up writing a line like this: 'xrdef {'hat
- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
- % argument, and \hat is not an expandable control sequence. It could
- % all be worked out, but why? Either we support ^^ or we don't.
- %
- % The other change necessary for this was to define \auxhat:
- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
- % and then to call \auxhat in \setq.
- %
\catcode`\^=\other
%
% Special characters. Should be turned off anyway, but...
@@ -9256,14 +9177,7 @@ end
\catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
%
- % This is to support \ in node names and titles, since the \
- % characters end up in a \csname. It's easier than
- % leaving it active and making its active definition an actual \
- % character. What I don't understand is why it works in the *value*
- % of the xrdef. Seems like it should be a catcode12 \, and that
- % should not typeset properly. But it works, so I'm moving on for
- % now. --karl, 15jan04.
- \catcode`\\=\other
+ \catcode`\\=\active
%
% @ is our escape character in .aux files, and we need braces.
\catcode`\{=1
@@ -11534,11 +11448,9 @@ directory should work if nowhere else does.}
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
-\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
-% \realbackslash is an actual character `\' with catcode other, and
-% \doublebackslash is two of them (for the pdf outlines).
-{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+% \realbackslash is an actual character `\' with catcode other.
+{\catcode`\\=\other @gdef@realbackslash{\}}
% In Texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
@@ -11556,10 +11468,8 @@ directory should work if nowhere else does.}
@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
@let@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.
-@gdef@rawbackslash{@let\=@backslashcurfont}
+% catcode other.
@gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
@@ -11631,7 +11541,7 @@ directory should work if nowhere else does.}
@ifx\@eatinput @let\ = @ttbackslash @fi
@catcode13=5 % regular end of line
@enableemergencynewline
- @let@c=@texinfoc
+ @let@c=@comment
@let@parsearg@originalparsearg
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index ade4ff8ebdb..1cbbff212bb 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -1046,6 +1046,7 @@ datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
+emacs_major_version = @emacs_major_version@
etcdir = @etcdir@
etcdocdir = @etcdocdir@
exec_prefix = @exec_prefix@
diff --git a/lib/mktime-internal.h b/lib/mktime-internal.h
index d13d89cfae7..52ab7814429 100644
--- a/lib/mktime-internal.h
+++ b/lib/mktime-internal.h
@@ -1,40 +1,56 @@
-/* mktime variant that also uses an offset guess
-
+/* Internals of mktime and related functions
Copyright 2016-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Paul Eggert <eggert@cs.ucla.edu>.
- This program is free software; you can redistribute it and/or
+ The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful,
+ The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public
- License along with this program; if not, see
+ License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <time.h>
+#ifndef _LIBC
+# include <time.h>
+#endif
/* mktime_offset_t is a signed type wide enough to hold a UTC offset
in seconds, and used as part of the type of the offset-guess
- argument to mktime_internal. Use time_t on platforms where time_t
+ argument to mktime_internal. In Glibc, it is always long int.
+ When in Gnulib, use time_t on platforms where time_t
is signed, to be compatible with platforms like BeOS that export
this implementation detail of mktime. On platforms where time_t is
unsigned, GNU and POSIX code can assume 'int' is at least 32 bits
which is wide enough for a UTC offset. */
-
-#if TIME_T_IS_SIGNED
+#ifdef _LIBC
+typedef long int mktime_offset_t;
+#elif defined TIME_T_IS_SIGNED
typedef time_t mktime_offset_t;
#else
typedef int mktime_offset_t;
#endif
-time_t mktime_internal (struct tm *,
- struct tm * (*) (time_t const *, struct tm *),
- mktime_offset_t *);
+/* The source code uses identifiers like __time64_t for glibc
+ timestamps that can contain 64-bit values even when time_t is only
+ 32 bits. These are just macros for the ordinary identifiers unless
+ compiling within glibc when time_t is 32 bits. */
+#if ! (defined _LIBC && __TIMESIZE != 64)
+# undef __time64_t
+# define __time64_t time_t
+# define __gmtime64_r __gmtime_r
+# define __localtime64_r __localtime_r
+# define __mktime64 mktime
+# define __timegm64 timegm
+#endif
+
+#ifndef _LIBC
/* Although glibc source code uses leading underscores, Gnulib wants
ordinary names.
@@ -45,9 +61,19 @@ time_t mktime_internal (struct tm *,
Similarly for gmtime_r. See the gnulib time_r module for one way
to implement this. */
-#undef __gmtime_r
-#undef __localtime_r
-#define __gmtime_r gmtime_r
-#define __localtime_r localtime_r
+# undef __gmtime_r
+# undef __localtime_r
+# define __gmtime_r gmtime_r
+# define __localtime_r localtime_r
+
+# define __mktime_internal mktime_internal
+
+#endif
-#define __mktime_internal mktime_internal
+/* Subroutine of mktime. Return the time_t representation of TP and
+ normalize TP, given that a struct tm * maps to a time_t as performed
+ by FUNC. Record next guess for localtime-gmtime offset in *OFFSET. */
+extern __time64_t __mktime_internal (struct tm *tp,
+ struct tm *(*func) (__time64_t const *,
+ struct tm *),
+ mktime_offset_t *offset) attribute_hidden;
diff --git a/lib/mktime.c b/lib/mktime.c
index e3783d7a95e..b00af96c8c4 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -112,11 +112,11 @@ my_tzset (void)
added to them, and then with another timestamp added, without
worrying about overflow.
- Much of the code uses long_int to represent time_t values, to
- lessen the hassle of dealing with platforms where time_t is
+ Much of the code uses long_int to represent __time64_t values, to
+ lessen the hassle of dealing with platforms where __time64_t is
unsigned, and because long_int should suffice to represent all
- time_t values that mktime can generate even on platforms where
- time_t is excessively wide. */
+ __time64_t values that mktime can generate even on platforms where
+ __time64_t is wider than the int components of struct tm. */
#if INT_MAX <= LONG_MAX / 4 / 366 / 24 / 60 / 60
typedef long int long_int;
@@ -144,16 +144,15 @@ shr (long_int a, int b)
: a / (one << b) - (a % (one << b) < 0));
}
-/* Bounds for the intersection of time_t and long_int. */
+/* Bounds for the intersection of __time64_t and long_int. */
static long_int const mktime_min
- = ((TYPE_SIGNED (time_t) && TYPE_MINIMUM (time_t) < TYPE_MINIMUM (long_int))
- ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (time_t));
+ = ((TYPE_SIGNED (__time64_t)
+ && TYPE_MINIMUM (__time64_t) < TYPE_MINIMUM (long_int))
+ ? TYPE_MINIMUM (long_int) : TYPE_MINIMUM (__time64_t));
static long_int const mktime_max
- = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (time_t)
- ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (time_t));
-
-verify (TYPE_IS_INTEGER (time_t));
+ = (TYPE_MAXIMUM (long_int) < TYPE_MAXIMUM (__time64_t)
+ ? TYPE_MAXIMUM (long_int) : TYPE_MAXIMUM (__time64_t));
#define EPOCH_YEAR 1970
#define TM_YEAR_BASE 1900
@@ -252,23 +251,23 @@ tm_diff (long_int year, long_int yday, int hour, int min, int sec,
}
/* Use CONVERT to convert T to a struct tm value in *TM. T must be in
- range for time_t. Return TM if successful, NULL (setting errno) on
+ range for __time64_t. Return TM if successful, NULL (setting errno) on
failure. */
static struct tm *
-convert_time (struct tm *(*convert) (const time_t *, struct tm *),
+convert_time (struct tm *(*convert) (const __time64_t *, struct tm *),
long_int t, struct tm *tm)
{
- time_t x = t;
+ __time64_t x = t;
return convert (&x, tm);
}
/* Use CONVERT to convert *T to a broken down time in *TP.
If *T is out of range for conversion, adjust it so that
it is the nearest in-range value and then convert that.
- A value is in range if it fits in both time_t and long_int.
+ A value is in range if it fits in both __time64_t and long_int.
Return TP on success, NULL (setting errno) on failure. */
static struct tm *
-ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
+ranged_convert (struct tm *(*convert) (const __time64_t *, struct tm *),
long_int *t, struct tm *tp)
{
long_int t1 = (*t < mktime_min ? mktime_min
@@ -310,7 +309,7 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
}
-/* Convert *TP to a time_t value, inverting
+/* Convert *TP to a __time64_t value, inverting
the monotonic and mostly-unit-linear conversion function CONVERT.
Use *OFFSET to keep track of a guess at the offset of the result,
compared to what the result would be for UTC without leap seconds.
@@ -318,9 +317,9 @@ ranged_convert (struct tm *(*convert) (const time_t *, struct tm *),
If successful, set *TP to the canonicalized struct tm;
otherwise leave *TP alone, return ((time_t) -1) and set errno.
This function is external because it is used also by timegm.c. */
-time_t
+__time64_t
__mktime_internal (struct tm *tp,
- struct tm *(*convert) (const time_t *, struct tm *),
+ struct tm *(*convert) (const __time64_t *, struct tm *),
mktime_offset_t *offset)
{
struct tm tm;
@@ -520,9 +519,9 @@ __mktime_internal (struct tm *tp,
#if defined _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS
-/* Convert *TP to a time_t value. */
-time_t
-mktime (struct tm *tp)
+/* Convert *TP to a __time64_t value. */
+__time64_t
+__mktime64 (struct tm *tp)
{
/* POSIX.1 8.1.1 requires that whenever mktime() is called, the
time zone names contained in the external variable 'tzname' shall
@@ -531,7 +530,7 @@ mktime (struct tm *tp)
# if defined _LIBC || NEED_MKTIME_WORKING
static mktime_offset_t localtime_offset;
- return __mktime_internal (tp, __localtime_r, &localtime_offset);
+ return __mktime_internal (tp, __localtime64_r, &localtime_offset);
# else
# undef mktime
return mktime (tp);
@@ -539,11 +538,29 @@ mktime (struct tm *tp)
}
#endif /* _LIBC || NEED_MKTIME_WORKING || NEED_MKTIME_WINDOWS */
-#ifdef weak_alias
-weak_alias (mktime, timelocal)
+#if defined _LIBC && __TIMESIZE != 64
+
+libc_hidden_def (__mktime64)
+
+time_t
+mktime (struct tm *tp)
+{
+ struct tm tm = *tp;
+ __time64_t t = __mktime64 (&tm);
+ if (in_time_t_range (t))
+ {
+ *tp = tm;
+ return t;
+ }
+ else
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+}
+
#endif
-#ifdef _LIBC
+weak_alias (mktime, timelocal)
libc_hidden_def (mktime)
libc_hidden_weak (timelocal)
-#endif
diff --git a/lib/timegm.c b/lib/timegm.c
index 2ca57444d43..c440480cb2d 100644
--- a/lib/timegm.c
+++ b/lib/timegm.c
@@ -18,17 +18,41 @@
<http://www.gnu.org/licenses/>. */
#ifndef _LIBC
-# include <config.h>
+# include <libc-config.h>
#endif
#include <time.h>
+#include <errno.h>
#include "mktime-internal.h"
-time_t
-timegm (struct tm *tmp)
+__time64_t
+__timegm64 (struct tm *tmp)
{
static mktime_offset_t gmtime_offset;
tmp->tm_isdst = 0;
- return __mktime_internal (tmp, __gmtime_r, &gmtime_offset);
+ return __mktime_internal (tmp, __gmtime64_r, &gmtime_offset);
}
+
+#if defined _LIBC && __TIMESIZE != 64
+
+libc_hidden_def (__timegm64)
+
+time_t
+timegm (struct tm *tmp)
+{
+ struct tm tm = *tmp;
+ __time64_t t = __timegm64 (&tm);
+ if (in_time_t_range (t))
+ {
+ *tmp = tm;
+ return t;
+ }
+ else
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+}
+
+#endif