[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[6592] make some characters disappear for index sort keys
From: |
Gavin D. Smith |
Subject: |
[6592] make some characters disappear for index sort keys |
Date: |
Thu, 03 Sep 2015 20:49:56 +0000 |
Revision: 6592
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6592
Author: gavin
Date: 2015-09-03 20:49:54 +0000 (Thu, 03 Sep 2015)
Log Message:
-----------
make some characters disappear for index sort keys
Modified Paths:
--------------
trunk/ChangeLog
trunk/doc/texinfo.tex
trunk/doc/texinfo.texi
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2015-09-01 14:56:52 UTC (rev 6591)
+++ trunk/ChangeLog 2015-09-03 20:49:54 UTC (rev 6592)
@@ -1,3 +1,21 @@
+2015-08-03 Gavin Smith <address@hidden>
+
+ * doc/texinfo.tex: Let - always be active, and set it to
+ \normaldash.
+ (\indexnonalnumdisappear, \indexnonalnumreappear): New control
+ sequences. Make -, < and \ disappear by default for index sort
+ keys.
+ (\dosubindwrite): Call \indexnonalnumdisappear.
+ (\indexwritesortas): Call \indexnonalnumreappear.
+ (\indexwritesortas, \dosubindwrite): Cope better if @sortas{...}
+ is not put at the very beginning of the argument.
+ (\normalhyphen): Remove, and replace \normalhyphen with
+ \normaldash.
+
+ * doc/texinfo.texi: Add @sortas keys for some index entries.
+ Remove it for \mathopsup.
+ Correct entry <<' (umlaut accent)>> to <<' (acute accent)>>.
+
2015-08-01 Gavin Smith <address@hidden>
* info/info-utils.c (printed_representation): Cast a char * to
Modified: trunk/doc/texinfo.tex
===================================================================
--- trunk/doc/texinfo.tex 2015-09-01 14:56:52 UTC (rev 6591)
+++ trunk/doc/texinfo.tex 2015-09-03 20:49:54 UTC (rev 6592)
@@ -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-08-31.16}
+\def\texinfoversion{2015-09-03.22}
%
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -4667,6 +4667,28 @@
\let\indexlbrace\relax
\let\indexrbrace\relax
address@hidden
+\catcode`\\=13
+ @address@hidden@def\{}}
+}
+
+{
+\catcode`\<=13
+\catcode`\-=13
+ \gdef\indexnonalnumdisappear{%
+ \backslashdisappear
+ \def-{}%
+ \def<{}%
+ }
+
+ \gdef\indexnonalnumreappear{%
+ \useindexbackslash
+ \let-\normaldash
+ \let<\normalless
+ }
+}
+
+
% \indexnofonts is used when outputting the strings to sort the index
% by, and when constructing control sequence names. It eliminates all
% control sequences and just writes whatever the best ASCII sort string
@@ -4828,13 +4850,23 @@
% Definition for writing index entry text.
\def\sortas#1{\ignorespaces}%
-% Definition for writing index entry sort key. @sortas{} must occur at
+% Definition for writing index entry sort key. Should occur at the at
% the beginning of the index entry, like
-% @cindex @sortas{september} \september
-\def\indexwritesortas#1#2\endofindexentry{#1}
+% @cindex @sortas{september} \september
+% The \ignorespaces takes care of following space, but there's no way
+% to remove space before it.
+{
+\catcode`\-=13
+\gdef\indexwritesortas{%
+ \begingroup
+ \indexnonalnumreappear
+ \indexwritesortasxxx}
+\gdef\indexwritesortasxxx#1{%
+ \xdef\indexsortkey{#1}\endgroup}
+}
-% Write the entry in \toks0 to the index file:
+% Write the entry in \toks0 to the index file.
%
\def\dosubindwrite{%
% Put the index entry in the margin if desired.
@@ -4849,10 +4881,14 @@
% Get the string to sort by, by processing the index entry with all
% font commands turned off.
{\indexnofonts
- \def\endofindexentry{}%
+ \xdef\indexsortkey{}%
\let\sortas=\indexwritesortas
- \edef\temp{\the\toks0 \noexpand\endofindexentry}%
- \xdef\indexsortkey{\temp}%
+ \indexnonalnumdisappear
+ \edef\temp{\the\toks0}%
+ \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
+ \ifx\indexsortkey\empty
+ \xdef\indexsortkey{\temp}%
+ \fi
}%
%
% Set up the complete index entry, with both the sort key and
@@ -4866,6 +4902,7 @@
}%
\temp
}
+\newbox\dummybox % used above
% Take care of unwanted page breaks/skips around a whatsit:
%
@@ -5026,7 +5063,6 @@
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
-\let\normalhyphen=-
{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
\catcode`\$=3
@@ -5040,8 +5076,7 @@
% Can't get bold backslash so don't use bold forward slash
\catcode`\/=13
\def/{{\secrmnotbold \normalslash}}%
- \catcode`\-=13
- \def-{{\normalhyphen\normalhyphen}}%
+ \def-{{\normaldash\normaldash}}% en dash `--'
\let^=\normalcaret
\let~=\normaltilde
\def\_{%
@@ -10329,7 +10364,9 @@
\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
\catcode`\+=\active \def+{{\tt \char 43}}
\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
+\catcode`\-=\active \let-=\normaldash
+
% used for headline/footline in the output routine, in case the page
% breaks in the middle of an @tex block.
\def\texinfochars{%
@@ -10384,8 +10421,7 @@
@address@hidden@address@hidden
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
-% the literal character `\'. Also revert - to its normal character, in
-% case the active - from code has slipped in.
+% the literal character `\'.
%
address@hidden = @active
@address@hidden
Modified: trunk/doc/texinfo.texi
===================================================================
--- trunk/doc/texinfo.texi 2015-09-01 14:56:52 UTC (rev 6591)
+++ trunk/doc/texinfo.texi 2015-09-03 20:49:54 UTC (rev 6592)
@@ -8926,7 +8926,7 @@
@cindex Alt attribute for images
@cindex Images, alternate text for
address@hidden - (in image alt string)
address@hidden @sortas{-} address@hidden (in image alt string)}
For HTML output, @code{makeinfo} sets the @dfn{alt attribute} for
inline images to the optional @var{alttext} (fourth) argument to
@code{@@image}, if supplied. If not supplied, @code{makeinfo} uses
@@ -9364,7 +9364,7 @@
@samp{@@findex \mathopsup}. In the printed output, this will be sorted
under its first character, a backslash, but it might be nicer to sort it
under the letter `M', as if the backslash were not there. For such
-cases, you can specify a sort key with @code{@@sortkey} immediately
+cases, you can specify a sort key with @code{@@sortas} immediately
following the index command. For example: @samp{@@findex
@@address@hidden@} \mathopsup}.
@@ -10294,7 +10294,7 @@
@findex " @r{(umlaut accent)}
@cindex Umlaut accent
address@hidden ' @r{(umlaut accent)}
address@hidden ' @r{(acute accent)}
@cindex Acute accent
@findex = @r{(macron accent)}
@cindex Macron accent
@@ -10653,7 +10653,7 @@
(no use of MathML, etc.). The HTML output is enclosed by
@code{<em>...</em>}, but nothing more.
address@hidden @sortas{mathopsup} \mathopsup
address@hidden \mathopsup
However, as far as the @TeX{} output is concerned, plain @TeX{}
mathematical commands are allowed in @code{@@math}, starting with
@samp{\}. In essence, @code{@@math} switches into plain @TeX{} math
@@ -10697,7 +10697,7 @@
\sin 2\pi \equiv \cos 3\pi
@end example
address@hidden \ @r{(literal \ in @code{@@math})}
address@hidden @sortas{\} \ @r{(literal \ in @code{@@math})}
Since @samp{\} is an escape character inside @code{@@math}, you can
use @code{@@\} to get a literal backslash (@code{\\} will work in
@TeX{}, but you'd get the literal two characters @samp{\\} in Info).
@@ -11495,7 +11495,7 @@
@section @code{@@-} and @code{@@hyphenation}: Helping @TeX{} Hyphenate
@anchor{- and address@hidden old name
address@hidden - @r{(discretionary hyphen)}
address@hidden @sortas{-} - @r{(discretionary hyphen)}
@findex hyphenation
@cindex Hyphenation, helping @TeX{} do
@cindex Fine-tuning, and hyphenation
@@ -11534,7 +11534,7 @@
@address@hidden old name
@findex allowcodebreaks
@cindex Breaks, within @code{@@code}
address@hidden -, breakpoint within @code{@@code}
address@hidden @sortas{-} -, breakpoint within @code{@@code}
@cindex Hyphen, breakpoint within @code{@@code}
@cindex Dash, breakpoint within @code{@@code}
@cindex _, breakpoint within @code{@@code}
@@ -15614,8 +15614,8 @@
@section Preparing for @TeX{}
@cindex Preparing for @TeX{}
@cindex @TeX{} input initialization
address@hidden @b{.profile} initialization file
address@hidden @b{.cshrc} initialization file
address@hidden @sortas{profile init} @file{.profile} initialization file
address@hidden @sortas{cshrc init} @file{.cshrc} initialization file
@cindex Initialization file for @TeX{} input
@TeX{} needs to know where to find the @file{texinfo.tex} file that the
@@ -18967,7 +18967,7 @@
details are somewhat tricky, as described in the following, to provide
maximum flexibility.
address@hidden @@import specifications, in CSS files
address@hidden @samp{@@import} specifications, in CSS files
The CSS file may begin with so-called @samp{@@import} directives,
which link to external CSS specifications for browsers to use when
interpreting the document. Again, a full description is beyond our
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [6592] make some characters disappear for index sort keys,
Gavin D. Smith <=