emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 0bb27cd: Merge from gnulib


From: Paul Eggert
Subject: [Emacs-diffs] master 0bb27cd: Merge from gnulib
Date: Thu, 22 Oct 2015 03:11:27 +0000

branch: master
commit 0bb27cd32e4a6a7fc4485381efc9ff0026e15689
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Merge from gnulib
    
    This incorporates:
    2015-10-18 stdalign: work around pre-4.9 GCC x86 bug
    2015-10-18 time_rz: avoid warning from bleeding-edge gcc's -Wnonnull
    * doc/misc/texinfo.tex, lib/stdalign.in.h, lib/time_rz.c:
    Copy from gnulib.
---
 doc/misc/texinfo.tex |  146 ++++++++++++++++++++++++++++++-------------------
 lib/stdalign.in.h    |    5 ++-
 lib/time_rz.c        |    9 +--
 3 files changed, 96 insertions(+), 64 deletions(-)

diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex
index 46a9d15..c75ddd6 100644
--- a/doc/misc/texinfo.tex
+++ b/doc/misc/texinfo.tex
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2015-10-09.18}
+\def\texinfoversion{2015-10-17.11}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1106,6 +1106,7 @@ where each line of input produces a line of output.}
 \newtoks\toksC
 \newtoks\toksD
 \newbox\boxA
+\newbox\boxB
 \newcount\countA
 \newif\ifpdf
 \newif\ifpdfmakepagedest
@@ -4605,6 +4606,8 @@ end
 }
 
 % \commondummiesnofonts: common to \commondummies and \indexnofonts.
+% Define \definedumyletter, \definedummyaccent and \definedummyword before
+% using.
 %
 \def\commondummiesnofonts{%
   % Control letters and accents.
@@ -4700,11 +4703,27 @@ end
 {
 \catcode`\<=13
 \catcode`\-=13
+\catcode`\`=13
   \gdef\indexnonalnumdisappear{%
-    \backslashdisappear
-    \def-{}%
-    \def<{}%
-    address@hidden
+    \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
+      % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
+      % (Introduced for FSFS 2nd ed.)
+      \let`=\empty
+    \fi
+    %
+    \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
+      \backslashdisappear
+    \fi
+    %
+    \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
+      \def-{}%
+    \fi
+    \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
+      \def<{}%
+    \fi
+    \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
+      address@hidden
+    \fi
   }
 
   \gdef\indexnonalnumreappear{%
@@ -4728,7 +4747,6 @@ end
   \def\definedummyletter##1{\let##1\empty}%
   % All control words become @asis by default; overrides below.
   \let\definedummyword\definedummyaccent
-  %
   \commondummiesnofonts
   %
   % Don't no-op \tt, since it isn't a user-level command
@@ -4741,8 +4759,6 @@ end
   \def\_{\normalunderscore}%
   \def\-{}% @- shouldn't affect sorting
   %
-  % Unfortunately, texindex < 6.0 is not prepared to handle braces in the
-  % content at all, so these won't be sorted in ASCII order.
   \def\lbracechar{{\indexlbrace}}%
   \def\rbracechar{{\indexrbrace}}%
   \let\{=\lbracechar
@@ -4805,9 +4821,6 @@ end
   \def\result{=>}%
   \def\textdegree{o}%
   %
-  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
-  \else \indexlquoteignore \fi
-  %
   % We need to get rid of all macros, leaving only the arguments (if present).
   % Of course this is not nearly correct, but it is the best we can do for now.
   % makeinfo does not expand macros in the argument to @deffn, which ends up
@@ -4821,10 +4834,6 @@ end
   \macrolist
 }
 
-% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
-% ignore left quotes in the sort term.
-{\catcode`\`=\active
- \gdef\indexlquoteignore{\let`=\empty}}
 
 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
@@ -4917,9 +4926,9 @@ end
   % Get the string to sort by, by processing the index entry with all
   % font commands turned off.
   {\indexnofonts
+   \indexnonalnumdisappear
    \xdef\indexsortkey{}%
    \let\sortas=\indexwritesortas
-   \indexnonalnumdisappear
    \edef\temp{\the\toks0}%
    \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
    \ifx\indexsortkey\empty
@@ -5214,30 +5223,6 @@ end
     %  How much \indexdotfill is stretched, or how much \parfillskip is shrunk
     %  Number of lines (\linepenalty)
     %  
-    % Do not prefer a separate line ending with a hyphen to fewer lines.
-    \finalhyphendemerits = 0
-    %
-    % Word spacing - no stretch
-    \spaceskip=\fontdimen2\font minus \fontdimen4\font
-    %
-    \linepenalty=1000  % Discourage line breaks.
-    \hyphenpenalty=5000  % Discourage hyphenation.
-    %
-    % Ragged right margin, but not for the last line with the leaders in it.
-    % When an index entry spans lines, this stretch competes with the stretch
-    % in \indexdotfill to determine how the line will be split.
-    \rightskip=\entryrightmargin
-    \advance\rightskip by 0pt plus .6\hsize
-    %
-    % \parfillskip is at the end of the line with the page number
-    \parfillskip=0pt
-    % Cancel the \rightskip stretch
-    \advance \parfillskip by 0pt plus -.6\hsize
-    % Determine how far we can stretch into the margin.
-    % This allows, e.g., "Appendix H  GNU Free Documentation License" to fit
-    % on one line.
-    \advance \parfillskip by 0pt minus .6\entryrightmargin
-    %
     % Swallow the left brace of the text (first parameter):
     \afterassignment\doentry
     \let\temp =
@@ -5245,20 +5230,26 @@ end
 \def\entrybreak{\unskip\space\ignorespaces}%
 \def\doentry{%
     % Save the text of the entry in a \vtop.
-    \global\setbox\entryindexbox=\vtop\bgroup
+    \global\setbox\boxA=\hbox\bgroup
     \bgroup % Instead of the swallowed brace.
       \noindent
       \aftergroup\finishentry
       % And now comes the text of the entry.
+      % Not absorbing as a macro argument reduces the chance of problems
+      % with catcodes occurring.
 }
-\def\finishentry#1{%
address@hidden
+\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.
     %
     % The following is kludged to not output a line of dots in the index if
     % there are no page numbers.  The next person who breaks this will be
     % cursed by a Unix daemon.
-    \setbox\boxA = \hbox{#1}%
-    \ifdim\wd\boxA = 0pt
+    \setbox\boxB = \hbox{#1}%
+    \ifdim\wd\boxB = 0pt
       \null\nobreak\hfill\ %
     \else
       %
@@ -5271,23 +5262,62 @@ end
         \hskip\skip\thinshrinkable #1%
       \fi
     \fi
-    % Parameters for formatting this paragraph, reset for each paragraph.
+    \egroup % end \boxA
+    \global\setbox\entryindexbox=\vtop\bgroup\noindent
+    % We want the text of the entries to be aligned to the left, and the
+    % page numbers to be aligned to the right.
     %
-    % \hangindent is only relevant when the entry text and page number
-    % don't both fit on one line.  In that case, bob suggests starting the
-    % dots pretty far over on the line.  Unfortunately, a large
-    % indentation looks wrong when the entry text itself is broken across
-    % lines.  So we use a small indentation and put up with long leaders.
+    \advance\leftskip by 0pt plus 1fil
+    \advance\leftskip by 0pt plus -1fill
+    \rightskip = 0pt plus -1fil
+    \advance\rightskip by 0pt plus 1fill
+    % Cause last line, which could consist of page numbers on their own if the 
+    % list of page numbers is long, to be aligned to the right.
+    \parfillskip=0pt plus -1fill
     %
-    \hangafter = 1
-    \hangindent = 1em
-    \par
+    \hangindent=1em
+    %
+    \advance\rightskip by \entryrightmargin
+    % Determine how far we can stretch into the margin.
+    % This allows, e.g., "Appendix H  GNU Free Documentation License" to fit
+    % on one line.
+    \advance \parfillskip by 0pt minus .6\entryrightmargin
+    %
+    \ifdim\wd\boxA > \hsize % If the entry doesn't fit in one line
+    \ifdim\dimen@ > 0.9\hsize   % due to long index text
+      \dimen@ = 0.6\dimen@ % Try to split the text roughly evenly
+      address@hidden = \hsize
+      \advance address@hidden by -1em
+      \ifnum\dimen@>address@hidden
+        % If the entry is too long, use the whole line
+        \dimen@ = address@hidden
+      \else
+        % Cause stretch of 1fill at the end of the first line, to avoid
+        % extra spacing in a short first line.
+        \hskip 0pt plus 1fill
+      \fi
+      \parshape = 2 0pt \dimen@ 1em address@hidden
+      % Ideally we'd add a finite glue at the end of the first line only, but
+      % TeX doesn't seem to provide a way to do such a thing.
+    \fi\fi
+    \unhbox\boxA
+    %
+    % Do not prefer a separate line ending with a hyphen to fewer lines.
+    \finalhyphendemerits = 0
+    %
+    % Word spacing - no stretch
+    \spaceskip=\fontdimen2\font minus \fontdimen4\font
+    %
+    \linepenalty=1000  % Discourage line breaks.
+    \hyphenpenalty=10000  % Discourage hyphenation.
+    %
+    \par % format the paragraph
     \egroup % The \vtop
   \endgroup
   % delay text of entry until after penalty
   \bgroup\aftergroup\insertindexentrybox
   \entryorphanpenalty
-}
+}}
 
 \newskip\thinshrinkable
 \skip\thinshrinkable=.15em minus .15em
@@ -5322,10 +5352,11 @@ end
 }
 
 % Like plain.tex's \dotfill, except uses up at least 1 em.
-% Using a finite stretch encourages several words to appear on a second line
-% if the entry is broken.
+% The filll stretch here overpowers both the fil and fill stretch to push
+% the page number to the right.
 \def\indexdotfill{\cleaders
-  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus .4\hsize}
+  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
+
 
 \def\primary #1{\line{#1\hfil}}
 
@@ -8945,6 +8976,7 @@ end
 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
   \catcode`\^^M = 5     % in case we're inside an example
   \normalturnoffactive  % allow _ et al. in names
+  \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
   % If the image is by itself, center it.
   \ifvmode
     \imagevmodetrue
diff --git a/lib/stdalign.in.h b/lib/stdalign.in.h
index c6115b6..ce1e793 100644
--- a/lib/stdalign.in.h
+++ b/lib/stdalign.in.h
@@ -52,7 +52,10 @@
 #undef _Alignas
 #undef _Alignof
 
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+/* GCC releases before GCC 4.9 had a bug in _Alignof.  See GCC bug 52023
+   <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
+#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
+     || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9)))
 # ifdef __cplusplus
 #  if 201103 <= __cplusplus
 #   define _Alignof(type) alignof (type)
diff --git a/lib/time_rz.c b/lib/time_rz.c
index f94893a..a89b7e7 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -90,8 +90,7 @@ extend_abbrs (char *abbrs, char const *abbr, size_t abbr_size)
 }
 
 /* Return a newly allocated time zone for NAME, or NULL on failure.
-   As a special case, return a nonzero constant for wall clock time, a
-   constant that survives freeing.  */
+   A null NAME stands for wall clock time (which is like unset TZ).  */
 timezone_t
 tzalloc (char const *name)
 {
@@ -288,10 +287,8 @@ localtime_rz (timezone_t tz, time_t const *t, struct tm 
*tm)
       timezone_t old_tz = set_tz (tz);
       if (old_tz)
         {
-          tm = localtime_r (t, tm);
-          if (tm && !save_abbr (tz, tm))
-            tm = NULL;
-          if (revert_tz (old_tz))
+          bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm);
+          if (revert_tz (old_tz) && abbr_saved)
             return tm;
         }
       return NULL;



reply via email to

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