texlive[59487] Build/source/texk/mendexk: mendex: v3.5, accept

commits+takuji at tug.org commits+takuji at tug.org
Sun Jun 6 15:45:27 CEST 2021


Revision: 59487
          http://tug.org/svn/texlive?view=revision&revision=59487
Author:   takuji
Date:     2021-06-06 15:45:27 +0200 (Sun, 06 Jun 2021)
Log Message:
-----------
mendex: v3.5, accept multiple number of style files

Modified Paths:
--------------
    trunk/Build/source/texk/mendexk/ChangeLog
    trunk/Build/source/texk/mendexk/configure
    trunk/Build/source/texk/mendexk/configure.ac
    trunk/Build/source/texk/mendexk/main.c
    trunk/Build/source/texk/mendexk/mendex.1
    trunk/Build/source/texk/mendexk/mendex.1.ja
    trunk/Build/source/texk/mendexk/mendex.ja.txt
    trunk/Build/source/texk/mendexk/styfile.c
    trunk/Build/source/texk/mendexk/tests/mendex.test
    trunk/Build/source/texk/mendexk/version.h

Added Paths:
-----------
    trunk/Build/source/texk/mendexk/tests/uni1.ist
    trunk/Build/source/texk/mendexk/tests/uni2.ist

Modified: trunk/Build/source/texk/mendexk/ChangeLog
===================================================================
--- trunk/Build/source/texk/mendexk/ChangeLog	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/ChangeLog	2021-06-06 13:45:27 UTC (rev 59487)
@@ -1,3 +1,14 @@
+2021-06-06  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* configure.ac, version.h:
+	Version 3.5 [6-Jun-2021].
+	* main.c, styfile.c:
+	Accept multiple numbers of style files by option '-s'.
+	* tests/mendex.test, tests/uni[12].ist:
+	Add a new test.
+	* mendex.1{,ja}, mendex.ja.txt:
+	Update documents.
+
 2021-05-19  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* main.c, configure.ac, version.h:

Modified: trunk/Build/source/texk/mendexk/configure
===================================================================
--- trunk/Build/source/texk/mendexk/configure	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/configure	2021-06-06 13:45:27 UTC (rev 59487)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mendex (TeX Live) 3.4.
+# Generated by GNU Autoconf 2.69 for mendex (TeX Live) 3.5.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@
 # Identity of this package.
 PACKAGE_NAME='mendex (TeX Live)'
 PACKAGE_TARNAME='mendex--tex-live-'
-PACKAGE_VERSION='3.4'
-PACKAGE_STRING='mendex (TeX Live) 3.4'
+PACKAGE_VERSION='3.5'
+PACKAGE_STRING='mendex (TeX Live) 3.5'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1329,7 +1329,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mendex (TeX Live) 3.4 to adapt to many kinds of systems.
+\`configure' configures mendex (TeX Live) 3.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1400,7 +1400,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mendex (TeX Live) 3.4:";;
+     short | recursive ) echo "Configuration of mendex (TeX Live) 3.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1521,7 +1521,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mendex (TeX Live) configure 3.4
+mendex (TeX Live) configure 3.5
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2173,7 +2173,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mendex (TeX Live) $as_me 3.4, which was
+It was created by mendex (TeX Live) $as_me 3.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -7855,7 +7855,7 @@
 
 # Define the identity of the package.
  PACKAGE='mendex--tex-live-'
- VERSION='3.4'
+ VERSION='3.5'
 
 
 # Some tools Automake needs.
@@ -13907,7 +13907,7 @@
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-mendex (TeX Live) config.lt 3.4
+mendex (TeX Live) config.lt 3.5
 configured by $0, generated by GNU Autoconf 2.69.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -15516,7 +15516,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mendex (TeX Live) $as_me 3.4, which was
+This file was extended by mendex (TeX Live) $as_me 3.5, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15582,7 +15582,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-mendex (TeX Live) config.status 3.4
+mendex (TeX Live) config.status 3.5
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/texk/mendexk/configure.ac
===================================================================
--- trunk/Build/source/texk/mendexk/configure.ac	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/configure.ac	2021-06-06 13:45:27 UTC (rev 59487)
@@ -8,7 +8,7 @@
 dnl   gives unlimited permission to copy and/or distribute it,
 dnl   with or without modifications, as long as this notice is preserved.
 dnl
-AC_INIT([mendex (TeX Live)], [3.4])
+AC_INIT([mendex (TeX Live)], [3.5])
 AC_PREREQ([2.63])
 AC_CONFIG_SRCDIR([main.c])
 AC_CONFIG_AUX_DIR([../../build-aux])

Modified: trunk/Build/source/texk/mendexk/main.c
===================================================================
--- trunk/Build/source/texk/mendexk/main.c	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/main.c	2021-06-06 13:45:27 UTC (rev 59487)
@@ -9,7 +9,7 @@
 
 #include "kp.h"
 
-char *styfile,*idxfile[256],*indfile,*dicfile,*logfile;
+char *styfile[64],*idxfile[256],*indfile,*dicfile,*logfile;
 
 /* default paths */
 #ifndef DEFAULT_INDEXSTYLES
@@ -22,7 +22,7 @@
 
 int main(int argc, char **argv)
 {
-	int i,j,cc=0,startpagenum=-1,ecount=0,chkopt=1;
+	int i,j,k,cc=0,startpagenum=-1,ecount=0,chkopt=1;
 	const char *envbuff;
 	char *p;
 
@@ -60,7 +60,7 @@
 
 /*   check options   */
 
-	for (i=1,j=0;i<argc && j<256;i++) {
+	for (i=1,j=k=0;i<argc && j<256;i++) {
 		if ((argv[i][0]=='-')&&(strlen(argv[i])>=2)&&chkopt) {
 			switch (argv[i][1]) {
 			case 'c':
@@ -141,12 +141,17 @@
 				break;
 
 			case 's':
+				if (k==64) {
+					fprintf (stderr, "Too many style files.\n");
+					exit(255);
+				}
 				if ((argv[i][2]=='\0')&&(i+1<argc)) {
-					styfile=xstrdup(argv[++i]);
+					styfile[k]=xstrdup(argv[++i]);
 				}
 				else {
-					styfile=xstrdup(&argv[i][2]);
+					styfile[k]=xstrdup(&argv[i][2]);
 				}
+				k++;
 				break;
 
 			case 'v':
@@ -228,10 +233,10 @@
 
 	if (idxcount==0) idxcount=fsti=1;
 
-	if (styfile==NULL) {
+	if (styfile[0]==NULL) {
 		envbuff=kpse_var_value("INDEXDEFAULTSTYLE");
 		if (envbuff!=NULL) {
-			styfile=xstrdup(envbuff);
+			styfile[0]=xstrdup(envbuff);
 		}
 	}
 
@@ -265,8 +270,6 @@
 		logfile=xstrdup("stderr");
 	}
 
-	if (styfile!=NULL) styread(styfile);
-
 	if (strcmp(argv[0],"makeindex")==0) {
 		verb_printf(efp,"This is Not `MAKEINDEX\', But `MENDEX\' %s (%s) (%s).\n",
 			    VERSION, get_enc_string(), TL_VERSION);
@@ -280,6 +283,10 @@
 
 	initkanatable();
 
+	for (k=0;styfile[k]!=NULL;k++) {
+		styread(styfile[k]);
+	}
+
 /*   read dictionary   */
 
 	ecount+=dicread(dicfile);

Modified: trunk/Build/source/texk/mendexk/mendex.1
===================================================================
--- trunk/Build/source/texk/mendexk/mendex.1	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/mendex.1	2021-06-06 13:45:27 UTC (rev 59487)
@@ -47,9 +47,9 @@
 By default, blanks in the index key are retained.
 .TP 10
 \fB-g\fR
-Make Japanese index head \fIA\fR-line (\fIA, Ka, Sa, ...\fR) of the gojuon table (Japanese
-syllabary). By default, all the characters in the gojuon table
-are used.
+Make Japanese index head \fIA\fR-line (\fIA, Ka, Sa, ...\fR; 10 characters)
+of the \fIgojuon\fR table (Japanese syllabary). By default, all 48 characters
+in the \fIgojuon\fR table are used.
 .TP 10
 \fB-f\fR
 Force to output Kanji characters even non-existent in dictionaries.
@@ -99,6 +99,7 @@
 .TP 10
 \fB--\fR
 Arguments after \fB--\fR are not taken as options.
+This is useful when the input file name starts with '-'.
 
 .SH "STYLE FILE"
 The style file informs \fImendex\fR about the format of the
@@ -116,7 +117,7 @@
 \fBkeyword\fR  <string>
 "\\\\indexentry"
 .RS
-Command with an argument of index entry.
+Command with an argument of index entry which is going to be processed.
 .RE
 .TP 30
 \fBarg_open\fR  <char>
@@ -230,7 +231,7 @@
 \fBheading_prefix\fR  <string>
 ""
 .RS
-Same as \fBlethead_prefix\fR.
+Same as \fBlethead_prefix\fR. (compatible with makeindex)
 .RE
 .TP 30
 \fBlethead_suffix\fR  <string>
@@ -242,7 +243,7 @@
 \fBheading_suffix\fR  <string>
 ""
 .RS
-Same as \fBlethead_suffix\fR.
+Same as \fBlethead_suffix\fR. (compatible with makeindex)
 .RE
 .TP 30
 \fBlethead_flag\fR  <number>
@@ -255,7 +256,7 @@
 \fBheading_flag\fR  <number>
 0
 .RS
-Same as \fBlethead_flag\fR.
+Same as \fBlethead_flag\fR. (Note: makeindex uses a different name \fBheadings_flag\fR)
 .RE
 .TP 30
 \fBitem_0\fR  <string>
@@ -458,11 +459,13 @@
 .RE
 .TP 30
 \fBcharacter_order\fR  <string>
-"SEJ"
+"SNEJ"
 .RS
 Order of scripts and symbols.
-\'S\', \'E\' and \'J\' respectively denotes symbol, English and Japanese.
+\'S\', \'N\', \'E\' and \'J\' respectively denotes symbol, numbers, English and Japanese.
 (Extended by mendex)
+Please make sure that \'S\' and \'N\' are next to each other,
+since \fBmendex\fR considers numbers as part of symbol.
 .RE
 .PP
 .SH ABOUT JAPANESE PROCESSING

Modified: trunk/Build/source/texk/mendexk/mendex.1.ja
===================================================================
--- trunk/Build/source/texk/mendexk/mendex.1.ja	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/mendex.1.ja	2021-06-06 13:45:27 UTC (rev 59487)
@@ -36,7 +36,7 @@
 スペースやタブといったブランクを短縮して、すべて1個の半角スペースにします。また、前後のブランクは削除されます。
 .TP 10
 \fB-g\fR
-日本語の頭文字の区切りを "あかさた・・・わ" にします。指定しないと "あいうえ・・・わをん" になります。
+日本語の頭文字の区切りを "あかさた・・・わ" にします。指定しないと "あいうえ・・・わゐゑをん" になります。
 .TP 10
 \fB-f\fR
 辞書ファイルにない漢字も強制的に出力するモードです。
@@ -77,6 +77,7 @@
 .TP 10
 \fB--\fR
 以降はオプション文字列と解釈しません。
+これは,ファイル名の先頭の文字が '-' であるファイルを扱う場合に有用です。
 
 
 .SH スタイルファイル
@@ -89,7 +90,7 @@
 \fBkeyword\fR  <文字列>
 "\\\\indexentry"
 .RS
-索引エントリを引数として持つコマンド。
+処理対象とする索引エントリを引数として持つコマンド。
 .RE
 .TP 30
 \fBarg_open\fR  <文字>
@@ -199,7 +200,7 @@
 \fBheading_prefix\fR  <文字列>
 ""
 .RS
-lethead_prefixと同じ。
+lethead_prefixと同じ。(makeindex互換)
 .RE
 .TP 30
 \fBlethead_suffix\fR  <文字列>
@@ -211,7 +212,7 @@
 \fBheading_suffix\fR  <文字列>
 ""
 .RS
-lethead_suffixと同じ。
+lethead_suffixと同じ。(makeindex互換)
 .RE
 .TP 30
 \fBlethead_flag\fR  <数値>
@@ -223,7 +224,7 @@
 \fBheading_flag\fR  <数値>
 0
 .RS
-lethead_flagと同じ。
+lethead_flagと同じ。makeindexではheadings_flagという名称のため、互換性がありません。
 .RE
 .TP 30
 \fBitem_0\fR  <文字列>
@@ -403,9 +404,11 @@
 .RE
 .TP 30
 \fBcharacter_order\fR  <文字列>
-"SEJ"
+"SNEJ"
 .RS
-記号、英字、日本語の優先順位。\'S\'は記号、\'E\'は英字、\'J\'は日本語を表す。(mendex専用)
+記号、英字、日本語の優先順位。
+\'S\'は記号、\'N\'は数字、\'E\'は英字、\'J\'は日本語を表す。(mendex専用)
+mendexでは索引項目の分類として「数字」は「記号」に含める仕様としていますので、\'S\'と\'N\'は必ず隣り合わせてください(数字と数字以外の記号の順序入れ替えは可能です)。
 .RE
 .PP
 .SH 日本語の扱いについて

Modified: trunk/Build/source/texk/mendexk/mendex.ja.txt
===================================================================
--- trunk/Build/source/texk/mendexk/mendex.ja.txt	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/mendex.ja.txt	2021-06-06 13:45:27 UTC (rev 59487)
@@ -34,7 +34,7 @@
            します。また、前後のブランクは削除されます。
 
    -g      日本語の頭文字の区切りを "あかさた・・・わ" にします。指定しないと
-           "あいうえ・・・わをん" になります。
+           "あいうえ・・・わゐゑをん" になります。
 
    -f      辞書ファイルにない漢字も強制的に出力するモードです。
 
@@ -75,6 +75,7 @@
    --help  オプションの要約を表示します。
 
    --      以降はオプション文字列と解釈しません。
+           これは,ファイル名の先頭の文字が '-' であるファイルを扱う場合に有用です。
 
 スタイルファイル
 
@@ -86,7 +87,7 @@
 入力ファイルスタイルパラメータ
    keyword  <文字列>
       "\\indexentry"
-      索引エントリを引数として持つコマンド。
+      処理対象とする索引エントリを引数として持つコマンド。
 
    arg_open  <文字>
       '{'
@@ -161,7 +162,7 @@
 
    heading_prefix  <文字列>
       ""
-      lethead_prefixと同じ。
+      lethead_prefixと同じ。(makeindex互換)
 
    lethead_suffix  <文字列>
       ""
@@ -169,7 +170,7 @@
 
    heading_suffix  <文字列>
       ""
-      lethead_suffixと同じ。
+      lethead_suffixと同じ。(makeindex互換)
 
    lethead_flag  <数値>
       0
@@ -179,6 +180,7 @@
    heading_flag  <数値>
       0
       lethead_flagと同じ。
+      makeindexではheadings_flagという名称のため、互換性がありません。
 
    item_0  <文字列>
       "\n  \\item "
@@ -306,9 +308,12 @@
       英字と日本語との間に半角スペースを入れた状態でソートする。(mendex専用)
 
    character_order  <文字列>
-      "SEJ"
-      記号、英字、日本語の優先順位。'S'は記号、'E'は英字、'J'は日本語を表す。
-      (mendex専用)
+      "SNEJ"
+      記号、英字、日本語の優先順位。'S'は記号、'N'は数字、'E'は英字、'J'は
+      日本語を表す。(mendex専用)
+      mendexでは索引項目の分類として「数字」は「記号」に含める仕様としています
+      ので、'S'と'N'は必ず隣り合わせてください
+      (数字と数字以外の記号の順序入れ替えは可能です)。
 
 
 日本語の扱いについて

Modified: trunk/Build/source/texk/mendexk/styfile.c
===================================================================
--- trunk/Build/source/texk/mendexk/styfile.c	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/styfile.c	2021-06-06 13:45:27 UTC (rev 59487)
@@ -48,6 +48,7 @@
 		fprintf(stderr,"%s does not exist.\n",filename);
 		exit(0);
 	}
+	verb_printf(efp,"Scanning style file %s.",filename);
 
 	for (i=0;;i++) {
 		if (fgets(buff,4095,fp)==NULL) break;
@@ -130,12 +131,13 @@
 			letter_head=atoi(&buff[cc]);
 			continue;
 		}
-		if (getparam(buff,"atama",atama)) continue;
 		if (getparam(buff,"page_compositor",page_compositor)) continue;
 		if (getparam(buff,"page_precedence",page_precedence)) continue;
 		if (getparam(buff,"character_order",character_order)) continue;
 	}
 	nkf_close(fp);
+
+	verb_printf(efp,"...done.\n");
 }
 
 /*   analize string parameter of style file   */

Modified: trunk/Build/source/texk/mendexk/tests/mendex.test
===================================================================
--- trunk/Build/source/texk/mendexk/tests/mendex.test	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/tests/mendex.test	2021-06-06 13:45:27 UTC (rev 59487)
@@ -7,7 +7,7 @@
 TEXMFCNF=$srcdir/../kpathsea
 export TEXMFCNF
 
-rm -f foo.* uni.* pprec*.*
+rm -f foo.* uni.* pprec*.* rangetwo.*
 
 ./mendex $srcdir/tests/foo.idx -o foo.ind1 -t foo.ilg1 \
 	&& diff $srcdir/tests/foo.ind foo.ind1 || exit 1
@@ -24,6 +24,10 @@
 	>uni.ind2 2>uni.ilg2 \
 	&& diff $srcdir/tests/uni.ind uni.ind2 || exit 1
 
+./mendex -U -d $srcdir/tests/uni.dict -s $srcdir/tests/uni1.ist -s $srcdir/tests/uni2.ist \
+	$srcdir/tests/uni.idx -o uni.ind3 -t uni.ilg3 \
+	&& diff $srcdir/tests/uni.ind uni.ind3 || exit 1
+
 # test for two-element range suffix_2p
 ./mendex -s $srcdir/tests/rangetwo.ist $srcdir/tests/rangetwo.idx \
 	-o rangetwo.ind1 -t rangetwo.ilg \

Added: trunk/Build/source/texk/mendexk/tests/uni1.ist
===================================================================
--- trunk/Build/source/texk/mendexk/tests/uni1.ist	                        (rev 0)
+++ trunk/Build/source/texk/mendexk/tests/uni1.ist	2021-06-06 13:45:27 UTC (rev 59487)
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+
+delim_0 "\\leaders\\hbox{$\\cdot$}\\hfill "
+delim_1 "\\leaders\\hbox{$\\cdot$}\\hfill "
+delim_2 "\\leaders\\hbox{$\\cdot$}\\hfill "
+

Added: trunk/Build/source/texk/mendexk/tests/uni2.ist
===================================================================
--- trunk/Build/source/texk/mendexk/tests/uni2.ist	                        (rev 0)
+++ trunk/Build/source/texk/mendexk/tests/uni2.ist	2021-06-06 13:45:27 UTC (rev 59487)
@@ -0,0 +1,6 @@
+% -*- coding: utf-8 -*-
+
+lethead_flag 1
+lethead_prefix "\n\\centerline{\\bfseries ◆◆◆ "
+lethead_suffix  " ◆◆◆}\\par\\nobreak"
+

Modified: trunk/Build/source/texk/mendexk/version.h
===================================================================
--- trunk/Build/source/texk/mendexk/version.h	2021-06-06 10:49:47 UTC (rev 59486)
+++ trunk/Build/source/texk/mendexk/version.h	2021-06-06 13:45:27 UTC (rev 59487)
@@ -1,2 +1,2 @@
-#define VERSION  "version " PACKAGE_VERSION " [19-May-2021]"
+#define VERSION  "version " PACKAGE_VERSION " [6-Jun-2021]"
 #define BUG_ADDRESS "issue at texjp.org"



More information about the tex-live-commits mailing list.