texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Index commands end paragraphs


From: Gavin D. Smith
Subject: branch master updated: Index commands end paragraphs
Date: Sun, 19 Feb 2023 09:28:52 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new a37a324949 Index commands end paragraphs
a37a324949 is described below

commit a37a32494924ace004f0de1094f6d0b7d02616ba
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Feb 19 14:22:59 2023 +0000

    Index commands end paragraphs
    
    * doc/texinfo.tex (\indexpar): New macro to end open paragraphs.
    (\doindex, \docodeindex): Use \indexpar.
    (\itemzzz, \itemizeitem): Add penalty that will be recognized in
    \indexpar to make an exception immediately after @item.
    (\safewhatsit): Propagate \lastpenalty in horizontal mode.
    (\newindex): Remove obsolete comment about vms filenames.
---
 ChangeLog       | 11 +++++++++++
 doc/texinfo.tex | 20 ++++++++++++++------
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 16ecdc4dd2..d9d1e0c3c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2023-02-19  Gavin Smith <gavinsmith0123@gmail.com>
+
+       Index commands end paragraphs
+
+       * doc/texinfo.tex (\indexpar): New macro to end open paragraphs.
+       (\doindex, \docodeindex): Use \indexpar.
+       (\itemzzz, \itemizeitem): Add penalty that will be recognized in
+       \indexpar to make an exception immediately after @item.
+       (\safewhatsit): Propagate \lastpenalty in horizontal mode.
+       (\newindex): Remove obsolete comment about vms filenames.
+
 2023-02-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Common.pm (@variable_string_settables),
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index e57d08a800..35f71d5757 100644
--- a/doc/texinfo.tex
+++ b/doc/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{2023-02-16.19}
+\def\texinfoversion{2023-02-19.14}
 %
 % Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
 %
@@ -4102,6 +4102,7 @@ $$%
     \nobreak\kern\dimen0
     \endgroup
     \itemxneedsnegativevskiptrue
+    \penalty 10021 % for \indexpar
   \fi
 }
 
@@ -4218,6 +4219,7 @@ $$%
    % We can be in inner vertical mode in a footnote, although an
    % @itemize looks awful there.
   }%
+  \penalty 10021 % for \indexpar
   \flushcr
 }
 
@@ -4722,13 +4724,11 @@ $$%
 % except not \outer, so it can be used within macros and \if's.
 \edef\newwrite{\makecsname{ptexnewwrite}}
 
-% \newindex {foo} defines an index named IX.
+% \newindex {IX} defines an index named IX.
 % It automatically defines \IXindex such that
 % \IXindex ...rest of line... puts an entry in the index IX.
 % It also defines \IXindfile to be the number of the output channel for
 % the file that accumulates this index.  The file's extension is IX.
-% The name of an index should be no more than 2 characters long
-% for the sake of vms.
 %
 \def\newindex#1{%
   \expandafter\chardef\csname#1indfile\endcsname=0
@@ -4784,11 +4784,17 @@ $$%
 % and it is the two-letter name of the index.
 
 \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
-\def\doindexxxx #1{\doind{\indexname}{#1}}
+\def\doindexxxx #1{\indexpar\doind{\indexname}{#1}}
 
 % like the previous two, but they put @code around the argument.
 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
-\def\docodeindexxxx #1{\docind{\indexname}{#1}}
+\def\docodeindexxxx #1{\indexpar\docind{\indexname}{#1}}
+
+% End any open paragraph, unless we are immediately after @item in
+% @itemize or @enumerate.
+\def\indexpar{%
+\ifnum\lastpenalty=10021 \else\endgraf\fi
+}
 
 
 % \definedummyword defines \#1 as \string\#1\space, thus effectively
@@ -5345,7 +5351,9 @@ $$%
 % ..., ready, GO:
 %
 \def\safewhatsit#1{\ifhmode
+  \whatsitpenalty = \lastpenalty
   #1%
+  \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
  \else
   % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
   \whatsitskip = \lastskip



reply via email to

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