aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/it/ChangeLog6
-rw-r--r--doc/it/gawk.1290
-rw-r--r--doc/it/gawktexi.in43
-rw-r--r--doc/it/texinfo.tex1001
4 files changed, 649 insertions, 691 deletions
diff --git a/doc/it/ChangeLog b/doc/it/ChangeLog
index f25843b1..dca449fe 100644
--- a/doc/it/ChangeLog
+++ b/doc/it/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-22 Antonio Giovanni Colombo <azc100@gmail.com>
+
+ * gawktexi.in: Updated.
+ * gawk.1: Updated.
+ * texinfo.tex: Updated.
+
2019-07-08 Antonio Giovanni Colombo <azc100@gmail.com>
* gawktexi.in: Updated.
diff --git a/doc/it/gawk.1 b/doc/it/gawk.1
index bcc0c596..5bc8899b 100644
--- a/doc/it/gawk.1
+++ b/doc/it/gawk.1
@@ -10,6 +10,7 @@
.\"Aggiornam. a gawk-4.2.0 di A.G. Colombo - revis. M. Curreli - Dicembre 2017
.\"Aggiornam. a gawk-4.2.1 di A.G. Colombo - revis. M. Curreli - Febbraio 2018
.\"Aggiornam. a gawk-4.2.2 di A.G. Colombo - revis. M. Curreli - Dicembre 2018
+.\"Aggiornam. a gawk-5.1.0 di A.G. Colombo - Luglio 2019
.ds PX \s-1POSIX\s+1
.ds UX \s-1UNIX\s+1
@@ -26,7 +27,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Nov 29 2018" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "Jul 21 2019" "Free Software Foundation" "Utility Commands"
.SH NOME
gawk \- linguaggio per il riconoscimento e il trattamento di espressioni
regolari
@@ -65,17 +66,17 @@ La riga di comando contiene opzioni per
stesso, il testo del programma \*(AK (se non è stato fornito con le opzioni
.B \-f
o
-.BR \-i ),
+.B \-\^\-include ),
e valori da rendere disponibili
nelle variabili \*(AK predefinite
.B ARGC
e
-.BR ARGV .
+.B ARGV .
.PP
Quando
.I gawk
è invocato con l'opzione
-.BR \-\^\-profile ,
+.B \-\^\-profile ,
inizia a raccogliere statistiche sul comportamento del programma
durante l'esecuzione.
.I Gawk
@@ -97,7 +98,9 @@ carica il
codice sorgente di AWK e poi richiede l'inserimento di comandi di debug.
.I Gawk
può analizzare solo il sorgente di un programma AWK fornito tramite l'opzione
-.BR \-f .
+.BR \-f
+e
+.B \-\^\-include .
Il debugger è documentato in \*(EP.
.SH FORMATO DELLE OPZIONI
.PP
@@ -145,6 +148,9 @@ Si possono specificare più opzioni
.B \-f
(o
.BR \-\^\-file ).
+I file letti come specificato da
+.B \-f
+sono trattati come se iniziassero con la direttiva implicita \fB@namespace "awk"\fR.
.TP
.PD 0
.BI \-F " fs"
@@ -263,10 +269,13 @@ Quest'opzione permette di combinare in modo semplice funzioni di libreria
(usate attraverso i file indicati dalle opzioni
.B \-f
e
-.BR \-i )
+.B \-\^\-include )
con codice sorgente immesso sulla riga di comando.
È rivolta principalmente a programmi \*(AK di media e grande dimensione
usati all'interno di script di shell.
+Ogni argomento specificato da
+.B \-e
+è trattato come se iniziasse con la direttiva implicita \fB@namespace "awk"\fR.
.TP
.PD 0
.BI "\-E " file
@@ -296,7 +305,7 @@ nel programma. Il programma in sé non viene eseguito.
Si veda la distribuzione \*(GN
.I gettext
per maggiori informazioni sui file
-.BR \&.pot .
+.B \&.pot .
.TP
.PD 0
.B \-h
@@ -319,10 +328,13 @@ Cerca la libreria usando la variabile d'ambiente
.BR AWKPATH .
Se la ricerca iniziale non va a buon fine, viene
fatto un altro tentativo dopo aver aggiunto il suffisso
-.BR \&.awk .
+.B \&.awk .
Il file verrà caricato solo una volta
(cioè vengono ignorati i duplicati), e il codice non costituisce
il sorgente del programma principale.
+I file letti come specificato da
+.B \-\^\-include
+sono trattati come se iniziassero con la direttiva implicita \fB@namespace "awk"\fR.
.TP
.PD 0
.BI "\-l " lib
@@ -334,7 +346,7 @@ Carica un'estensione
dalla libreria condivisa
.IR lib .
Cerca la libreria usando la variabile d'ambiente
-.BR AWKLIBPATH .
+.B AWKLIBPATH .
Se la ricerca iniziale non va a buon fine, viene
fatto un altro tentativo dopo aver aggiunto il suffisso della libreria
condivisa predefinita per la piattaforma.
@@ -357,6 +369,11 @@ Con l'argomento opzionale
.BR invalid ,
vengono emessi solo gli avvertimenti relativi a quello che è
effettivamente non valido (funzionalità non ancora completamente implementata).
+Specificando l'argomento facoltativo
+.BR no-ext ,
+gli avvertimenti riguardo alle estensioni
+.I gawk
+sono disabilitati.
.TP
.PD 0
.B \-M
@@ -366,7 +383,7 @@ effettivamente non valido (funzionalità non ancora completamente implementata).
Forza il calcolo con precisione arbitraria sui numeri. Quest'opzione
non ha effetto se
.I gawk
-non è compilato per l'uso delle librerie GNU MPFR e MP.
+non è compilato per utilizzare le librerie GNU MPFR e GMP.
(In tal caso,
.I gawk
invia un messaggio di avvertimento.)
@@ -396,7 +413,7 @@ faccia questo quando l'opzione
il punto come separatore decimale, anche per le localizzazioni in cui
il carattere di separazione non è il punto. Quest'opzione ignora il
comportamento predefinito, senza il rigore draconiano dell'opzione
-.BR \-\^\-posix .
+.B \-\^\-posix .
.ig
.\" Quest'opzione è lasciata intenzionalmente non documentata.
.TP
@@ -423,7 +440,7 @@ Se non viene indicato un
usa un file di nome
.B awkprof.out
nella directory corrente.
-Sottintende
+Quest'opzione attiva anche l'opzione
.BR \-\^\-no\-optimize .
.TP
.PD 0
@@ -449,7 +466,7 @@ Quello predefinito è
Il profilo contiene il numero di esecuzioni di ogni istruzione sul margine
sinistro e il conteggio delle chiamate di funzione per ogni funzione definita
dall'utente.
-Sottindende
+Quest'opzione attiva anche l'opzione
.BR \-\^\-no\-optimize .
.TP
.PD 0
@@ -458,7 +475,7 @@ Sottindende
.PD
.B \-\^\-posix
Quest'opzione attiva la modalità di
-.IR compatibilità ,
+.I compatibilità ,
con le seguenti restrizioni aggiuntive:
.RS
.TP "\w'\(bu'u+1n"
@@ -477,7 +494,7 @@ e
Non viene riconosciuto il sinonimo
.B func
per la parola chiave
-.BR function .
+.B function .
.TP
\(bu
Non si possono usare gli operatori
@@ -507,7 +524,7 @@ mai state disponibili. Lo standard \*(PX le ha aggiunte, per rendere
ed
.I egrep
coerenti tra di loro. Sono abilitate in modalità predefinita, però quest'opzione
-rimane per essere usata con l'opzione
+rimane per essere usata insieme all'opzione
.BR \-\^\-traditional .
.TP
.PD 0
@@ -516,7 +533,7 @@ rimane per essere usata con l'opzione
.PD
.B \-\^\-no\-optimize
Disabilita le ottimizzazioni predefinite di
-.I gawk
+.IR gawk
nella rappresentazione interna del programma.
.TP
.PD 0
@@ -580,7 +597,7 @@ per l'elaborazione. Questo è particolarmente utile per eseguire i programmi
.BR #! .
.PP
Per compatibilità con \*(PX, si può usare l'opzione
-.BR \-W ,
+.B \-W ,
seguita dal nome di un'opzione lunga.
.SH ESECUZIONE DEL PROGRAMMA AWK
.PP
@@ -594,6 +611,8 @@ e definizioni di funzione opzionali.
.br
\fB@load "\fInome_del_file\fB"
.br
+\fB@namespace "\fInome\^\fB"
+.br
\fIcriterio di ricerca\fB { \fIistruzioni di azione\fB }\fR
.br
\fBfunction \fInome\fB(\fIlista di parametri\fB) { \fIistruzioni\fB }\fR
@@ -624,13 +643,13 @@ Oltre a ciò, le righe che iniziano con
possono essere usate per includere altri file sorgenti nel programma,
rendendo l'uso della libreria ancora più facile. Questo è equivalente
all'uso dell'opzione
-.BR \-i .
+.B \-\^\-include .
.PP
Le righe che iniziano con
.B @load
possono essere usate per caricare funzioni di estensione nel programma. Questo è
equivalente all'uso dell'opzione
-.BR \-l .
+.B \-\^\-load .
.PP
La variabile d'ambiente
.B AWKPATH
@@ -638,7 +657,7 @@ specifica il percorso lungo il quale cercare i file sorgenti
indicati con le opzioni
.B \-f
e
-.BR \-i .
+.B \-\^\-include .
Se questa variabile non esiste, il percorso predefinito è
\fB"/usr/local/share/awk"\fR
(la directory in questione può variare a seconda di come
@@ -653,7 +672,7 @@ La variabile d'ambiente
.B AWKLIBPATH
specifica il percorso lungo il quale cercare i file sorgenti
indicati con l'opzione
-.BR \-l ,
+.B \-\^\-load .
Se questa variabile non esiste, il percorso predefinito è
\fB"/usr/local/lib/gawk"\fR
(la directory in questione può variare a seconda di come
@@ -857,7 +876,8 @@ Ogni campo nel record in input può essere individuato dalla sua posizione:
.BR $2 ,
e così via.
.B $0
-è l'intero record.
+è l'intero record,
+compresi eventuali spazi bianchi iniziali e finali.
Non è necessario che i campi siano indicati da costanti:
.RS
.PP
@@ -1015,7 +1035,7 @@ Se impostato,
.I gawk
suddivide l'input in campi, dove i campi corrispondono
all'espressione regolare, invece di usare il
-valore della variabile
+valore di
.B FS
come separatore di campo.
Si veda
@@ -1139,7 +1159,7 @@ Gli indici partono dallo zero.
.TP
\fBPROCINFO["egid"]\fP
Il valore della chiamata di sistema
-.IR getegid (2).
+.IR getegid (2) .
.TP
\fBPROCINFO["errno"]\fP
Il valore di
@@ -1150,7 +1170,7 @@ quando
.TP
\fBPROCINFO["euid"]\fP
Il valore della chiamata di sistema
-.IR geteuid (2).
+.IR geteuid (2) .
.TP
\fBPROCINFO["FS"]\fP
\fB"FS"\fP se la separazione in campi con
@@ -1167,7 +1187,7 @@ o \fB"API"\fP se la separazione in campi con l'analizzatore di input API
.TP
\fBPROCINFO["gid"]\fP
Il valore della chiamata di sistema
-.IR getgid (2).
+.IR getgid (2) .
.TP
\fBPROCINFO["identifiers"]\fP
Un sottovettore, avente come indici i nomi di tutti gli identificatori usati
@@ -1191,7 +1211,7 @@ L'identificatore è una funzione predefinita.
L'identificatore è una funzione di estensione caricata con
.B @load
o
-.BR \-l .
+.BR \-\^\-load .
.TP
\fB"scalar"\fR
L'identificatore è uno scalare.
@@ -1206,47 +1226,50 @@ ancora non lo sa).
L'identificatore è una funzione definita dall'utente.
.RE
.TP
+\fBPROCINFO["pgrpid"]\fP
+Il valore dalla chiamata di sistema
+.IR getpgrp (2) .
+.TP
+\fBPROCINFO["pid"]\fP
+Il valore dalla chiamata di sistema
+.IR getpid (2) .
+.TP
\fBPROCINFO["platform"]\fP
Una stringa che indica la piattaforma sulla quale
.I gawk
è stato compilato. Può essere una delle alternative seguenti:
.RS
.TP
-\fB"vms"\fR
-OpenVMS o Vax/VMS.
-.TP
-\fB"macosx"\fR
-Mac OS X.
-.TP
-\fB"cygwin"\fR, \fB"djgpp"\fR, \fB"mingw"\fR
-Microsoft Windows, avendo compilato in Cygwin, DJGPP, o MinGW, rispettivamente.
+\fB"djgpp"\fR, \fB"mingw"\fR
+Microsoft Windows, compilato tramite DJGPP o MinGW, rispettivamente.
.TP
\fB"os2"\fR
OS/2.
.TP
\fB"posix"\fR
-GNU/Linux e i sistemi Unix precedenti.
-.RE
+GNU/Linux, Cygwin, Mac OS X, e i sistemi Unix precedenti.
.TP
-\fBPROCINFO["pgrpid"]\fP
-Il process group ID del processo corrente.
-.TP
-\fBPROCINFO["pid"]\fP
-L'ID di processo del processo corrente.
+\fB"vms"\fR
+OpenVMS o Vax/VMS.
+.RE
.TP
\fBPROCINFO["ppid"]\fP
-Il process ID del "padre" [parent] del processo corrente.
+Il valore della chiamata di sistema
+.IR getppid (2) .
.TP
\fBPROCINFO["strftime"]\fP
La stringa di formato data/ora predefinita per
.BR strftime() .
+Cambiandone il valore cambia anche il modo con cui
+.B strftime()
+visualizza i valori di data e ora se chiamata senza specificare argomenti.
.TP
\fBPROCINFO["uid"]\fP
Il valore della chiamata di sistema
-.IR getuid (2).
+.IR getuid (2) .
.TP
\fBPROCINFO["version"]\fP
-la versione di
+La versione di
.IR gawk .
.PP
I seguenti elementi sono presenti se è disponibile il caricamento delle
@@ -1263,7 +1286,7 @@ compilato in
.IR gawk\^ :
.TP
\fBPROCINFO["gmp_version"]\fP
-La versione della libreria GNU MP usata per il supporto ai numeri
+La versione della libreria GNU GMP usata per il supporto ai numeri
con precisione arbitraria in
.IR gawk .
.TP
@@ -1367,16 +1390,29 @@ devono essere ordinati gli elementi del vettore.
.B ROUNDMODE
La modalità di arrotondamento da usare per operazioni sui numeri con precisione
arbitraria, quella predefinita è \fB"N"\fR (IEEE-754 roundTiesToEven mode).
-Sono accettati i valori
-\fB"N"\fR o \fB"n"\fR per roundTiesToEven,
-\fB"U"\fR o \fB"u"\fR per roundTowardPositive,
-\fB"D"\fR o \fB"d"\fR per roundTowardNegative,
-\fB"Z"\fR o \fB"z"\fR per roundTowardZero
-e, se la versione della libreria GNU MPFR in uso li supporta,
-\fB"A"\fR o \fB"a"\fR per arrotondamento lontano da zero (per eccesso).
+Sono accettati i valori:
+.RS
+.TP
+\fB"A"\fR o \fB"a"\fR
+per arrotondamento lontano da zero (per eccesso).
+Questi valori sono disponibili solo se la versione della libreria GNU MPFR
+supporta gli arrotondamenti lontano da zero.
+.TP "\w'\fB\(dqD\(dq\fR o \fB\(dqd\(dq\fR'u+1n"
+\fB"D"\fR o \fB"d"\fR
+per roundTowardNegative.
+.TP
+\fB"N"\fR o \fB"n"\fR
+per roundTiesToEven.
+.TP
+\fB"U"\fR o \fB"u"\fR
+per roundTowardPositive.
+.TP
+\fB"Z"\fR o \fB"z"\fR
+per roundTowardZero.
+.RE
.TP
.B RS
-Il separatore di record in input, normalmente "newline".
+Il separatore di record in input (se non specificato è "newline").
.TP
.B RT
Il terminatore di record.
@@ -1399,8 +1435,8 @@ La lunghezza della stringa trovata da
oppure \-1 se non ci sono corrispondenze.
.TP
.B SUBSEP
-Il carattere usato per separare indici multipli negli elementi di un vettore,
-quello predefinito è \fB"\e034"\fR.
+La stringa usata per separare indici multipli negli elementi di un vettore,
+quella predefinita è \fB"\e034"\fR.
.TP
.B SYMTAB
Un vettore i cui indici sono i nomi di tutti i vettori e le variabili
@@ -1442,7 +1478,7 @@ Se l'espressione è formata da una lista di espressioni
l'indice del vettore è una stringa ottenuta concatenando
i valori (stringa) di ogni espressione, separati dal valore della
variabile
-.BR SUBSEP .
+.B SUBSEP .
Questa modalità è usata per simulare vettori multidimensionali.
Per esempio:
.PP
@@ -1517,7 +1553,37 @@ si aspetta di trovare un vettore (come nel secondo argomento di
.BR split() ).
Si può fare questo creando un elemento nel sottovettore e cancellandolo
poi con l'istruzione
-.BR delete .
+.B delete .
+.SS Spazi-dei-nomi
+.I Gawk
+fornisce una semplice funzionalità,
+.I namespace ,
+(spazio-dei-nomi) per ovviare al fatto che tutte le variabili in
+AWK sono globali.
+.PP
+Un
+.I "nome qualificato"
+consiste di due identificativi semplici, congiunti da una coppia di ":"
+.RB ( :: ).
+Il primo dei due identificativi designa lo spazio-dei-nomi (namespace)
+mentre il secondo è il nome della variabile al suo interno.
+Tutti i nomi semplici (non qualificati) sono considerati come appartenenti
+allo spazio-dei-nomi ``corrente''; lo spazio-dei-nomi predefinito ha nome
+.BR awk .
+Comunque, gli identificativi i cui nomi sono composti solo da lettere
+maiuscole, vengono sempre considerati come facenti parte dello spazio-dei-nomi
+.B awk ,
+anche se lo spazio-dei-nomi corrente è diverso da quello predefinito.
+.PP
+Si può cambiare lo spazio-dei-nomi corente tramite la direttiva
+\fB@namespace "\fInome\^\fB"\fR .
+.PP
+I nomi delle funzioni interne predefinite non possono essere usati come
+nomi di uno spazio-dei-nomi. I nomi di ulteriori funzioni, fornite da
+.I gawk
+possono essere usati come nomi di uno spazio-dei-nomi o come semplici
+identificativi in altri spazi-dei-nomi.
+Per ulteriori dettagli, vedere \*(EP.
.SS Notazione e conversione delle variabili
.PP
Le variabili e i campi
@@ -1535,7 +1601,7 @@ valore di stringa "" (la stringa nulla, o vuota).
.PP
Quando una stringa deve essere convertita in un numero, la conversione
è compiuta con
-.IR strtod (3).
+.IR strtod (3) .
I numeri sono convertiti a stringhe usando
.IR sprintf (3)
col valore di
@@ -1592,7 +1658,7 @@ a
agli elementi di
.B ARGV
di
-.BR ENVIRON ,
+.B ENVIRON ,
ed agli elementi di un vettore creato da
.B split()
o da
@@ -1667,7 +1733,7 @@ costituite da espressioni regolari. Così,
.B /a\e52b/
è equivalente a
.BR /a\e*b/ .
-.SS "Costanti di tipo Regexp"
+.SS Costanti di tipo Regexp
Una costante di tipo espressione regolare è una sequenza di caratteri
racchiusa tra barre (come
.BR /valore/ ).
@@ -1680,7 +1746,7 @@ all'interno di costanti che sono espressioni regolari
(p.es.,
.B "/[\ \et\ef\en\er\ev]/"
corrisponde a tutti i caratteri non stampabili [bianchi]).
-.TP
+.PP
.I Gawk
consente anche di usare costanti formate da espressioni regolari
.IR "fortemente tipizzate" .
@@ -1722,13 +1788,16 @@ virgola,
.BR && ,
o
.BR || .
-Le istruzioni in righe terminanti con
+Anche le istruzioni in righe terminanti con
.B do
o
.B else
continuano automaticamente alla riga successiva.
-Negli altri casi, una riga terminante con un \*(lq\e\*(rq
-continua alla successiva, e il "newline" è ignorato.
+Negli altri casi, un'istruzione può continua sulla riga successiva
+se termina con \*(lq\e\*(rq, nel qual caso il "newline" è ignorato.
+Comunque, un \*(lq\e\*(rq che venga dopo un carattere
+.B #
+non è speciale.
.PP
Si possono scrivere più istruzioni sulla stessa riga separandole con
\*(lq;\*(rq.
@@ -1763,13 +1832,13 @@ Le azioni di tutti i criteri di ricerca
.B BEGIN
sono unite insieme, come se tutte le istruzioni fossero
scritte in un'unica regola
-.BR BEGIN ,
+.B BEGIN ,
e sono eseguite prima che sia letto qualsiasi input.
Allo stesso modo, tutte le regole
.B END
sono fuse insieme, ed eseguite dopo che tutti i dati in input sono
terminati o dopo che si è incontrata l'istruzione
-.BR exit .
+.B exit .
.B BEGIN
e
.B END
@@ -1783,11 +1852,11 @@ devono necessariamente essere seguiti dall'indicazione di un'azione
.B BEGINFILE
e
.B ENDFILE
-sono altri criteri speciali il cui contenuto è eseguito
+sono altri criteri speciali le cui azioni sono eseguite
prima della lettura del primo record di ogni file di input richiamato sulla riga
di comando, e dopo la lettura dell'ultimo record di ognuno di questi file.
All'interno della regola
-.B BEGINFILE
+.B BEGINFILE ,
il valore di
.B ERRNO
è una stringa vuota se il file è stato aperto con successo.
@@ -1867,6 +1936,8 @@ Corrisponde alla fine di una stringa.
Una lista di caratteri: corrisponde a uno qualsiasi dei caratteri
.IR abc.\|.\|. .
Si possono includere intervalli di caratteri separandoli con un trattino.
+Per aggiungere alla lista il carattere trattino, inserirlo all'inizio o
+alla fine della lista stessa.
.TP
\fB[^\fIabc.\|.\|.\fB]\fR
Una lista di caratteri negata: corrisponde a qualsiasi carattere eccetto
@@ -2302,7 +2373,7 @@ imposta
.TP
\fIcomando\fB | getline \fR[\fIvariabile\fR]
Esegue
-.I comando
+.IR comando
dirigendo l'output [del comando] o in
.B $0
o in
@@ -2322,33 +2393,36 @@ come sopra, e
.BR RT .
I coprocessi sono un'estensione
.IR gawk .
-.RI (il " comando
+.RI "(Il " comando
può anche essere un socket. Vedere la sottosezione
.BR "Nomi di file speciali" ,
più avanti.)
.TP
.B next
-Cessa l'elaborazione della riga di input corrente. È letta la successiva,
-e l'elaborazione ricomincia dal primo criterio di ricerca del
+Cessa l'elaborazione della riga di input corrente.
+Legge la successiva riga di input,
+e l'elaborazione ricomincia a partire dal primo criterio di ricerca del
programma \*(AK.
Se non ci sono più righe in input,
.I gawk
-esegue i comandi delle regole
+esegue i comandi di ogni regola
.BR END ,
se presenti.
.TP
.B "nextfile"
Cessa l'elaborazione del file di input corrente. La prossima riga
-sarà letta dal file di input successivo. Sono aggiornati
+letta proverrà dal file di input successivo.
+Aggiorna
.B FILENAME
e
.BR ARGIND ,
+reimposta
.B FNR
-è reimpostato a 1, e l'elaborazione riprende dal primo criterio di ricerca
+a 1, e l'elaborazione riprende dal primo criterio di ricerca
del programma \*(AK.
-Quando non ci sono più righe in input,
+Se non ci sono più righe in input,
.I gawk
-esegue i comandi delle regole
+esegue i comandi di ogni regola
.B ENDFILE
ed
.BR END ,
@@ -2405,7 +2479,7 @@ e
.BR printf .
.TP
.BI "print .\|.\|. >>" " file"
-Aggiunge righe alla fine di
+Aggiunge l'output alla fine di
.IR file .
.TP
.BI "print .\|.\|. |" " comando"
@@ -2536,7 +2610,7 @@ invece di
.TP
.B %%
Un singolo carattere
-.BR % ;
+.B % ;
non c'è alcuna conversione di argomenti.
.PP
Alcuni ulteriori parametri facoltativi possono comparire fra il
@@ -2648,7 +2722,7 @@ Con i formati
e
.BR %X ,
specifica il numero minimo di
-cifre da stampare. Per
+cifre da stampare. Per il formato
.BR %s ,
specifica il massimo numero di caratteri
della stringa che dovrebbero essere stampati.
@@ -2758,7 +2832,9 @@ e
per richiedere una connessione IPv6.
Specificando semplicemente
.B /inet
-usa quello predefinito del sistema (molto probabilmente sarà IPv4).
+usa quello predefinito del sistema (molto probabilmente IPv4).
+Si può usare solo con l'operatore bidirezionale di I/O
+.B |& .
.TP
.PD 0
.BI /inet/udp/ lport / rhost / rport
@@ -3259,7 +3335,7 @@ Se
Se
.I format
è omesso, è assunto un formato equivalente a quello dell'output del comando
-.IR date (1).
+.IR date (1) .
Il formato predefinito è disponibile in
.BR PROCINFO["strftime"] .
Vedere le specifiche per la funzione
@@ -3318,27 +3394,28 @@ XOR bit per bit ai valori degli argomenti della lista degli argomenti. Gli
argomenti devono essere almeno due.
.PP
.SS Funzioni di tipo
-La funzione seguente va usata per vettori multidimensionali.
-.TP
+Le seguenti funzioni forniscono informazioni relative agli argomenti
+che vengono loro passati.
+.TP \w'\fBisarray(\fIx\fB)\fR'u+1n
\fBisarray(\fIx\fB)\fR
Restituisce "Vero" se
.I x
è un vettore, altrimenti restituisce "Falso".
[0 e la stringa nulla significano "Falso". Qualsiasi altro valore sta per "Vero".]
-.PP
-È possibile conoscere il tipo di qualsiasi variabile o elemento di vettore
-con la seguente funzione:
+Questa funzione è destinata principalmente a essere usata con elementi di
+vettori multidimensionali, e con parametri usati da funzioni.
.TP
\fBtypeof(\fIx\fB)\fR
-Return a string indicating the type of
+Restituisce una stringa che indica il tipo di
.IR x .
-The string will be one of
+La stringa sarà una di queste:
\fB"array"\fP,
\fB"number"\fP,
\fB"regexp"\fP,
\fB"string"\fP,
\fB"strnum"\fP,
-or
+\fB"unassigned"\fP
+o
\fB"undefined"\fP.
.SS Funzioni di internazionalizzazione
Le seguenti funzioni possono essere usate all'interno di un programma AWK
@@ -3509,9 +3586,10 @@ al posto di
.BR function .
anche se questo modo di operare è deprecato.
.SH CARICARE DINAMICAMENTE NUOVE FUNZIONI
-Si possono aggiungere dinamicamente nuove funzioni predefinite all'interpreter
+Si possono aggiungere dinamicamente nuove funzioni scritte in C o C++
+all'interpreter
.I gawk
-con l'istruzione
+in esecuzione tramite l'istruzione
.BR @load .
Una descrizione dettagliata non è possibile in questa pagina di manuale;
vedere \*(EP.
@@ -3637,7 +3715,7 @@ assegnazione compariva prima di un nome di file, l'assegnazione sarebbe
avvenuta
.I prima
di eseguire la regola
-.BR BEGIN .
+.B BEGIN .
Esistono applicazioni che dipendono da questa \*(lqfunzionalità.\*(rq
Quando
.I awk
@@ -3645,8 +3723,8 @@ Quando
.B \-v
per assegnare valori alle variabili prima dell'inizio dell'esecuzione è stata aggiunta
per tener conto delle applicazioni che dipendevano dal precedente comportamento.
-(Questa funzionalità ha ottenuto l'approvazione sia dei Bell Laboratories
-che degli sviluppatori di \*(GN .)
+(Questa funzionalità ha ottenuto l'approvazione sia dagli sviluppatori
+dei Bell Laboratories che dagli sviluppatori di \*(GN .)
.PP
Nella scansione degli argomenti,
.I gawk
@@ -3971,7 +4049,7 @@ può essere usata per fornire una lista di directory che
.I gawk
esamina alla ricerca di file coi nomi indicati tramite le opzioni
.BR \-f ,
-.RB \-\^\-file ,
+.BR \-\^\-file ,
.B \-i
e
.BR \-\^\-include ,
@@ -4002,7 +4080,7 @@ Per le connessioni a un host remoto via socket,
.B GAWK_SOCK_RETRIES
controlla il numero di tentativi di lettura, e
.B GAWK_MSEC_SLEEP
-l'intervallo fra un tentativo di lettura e l'altro.
+l'intervallo fra un tentativo di lettura e quello successivo.
L'intervallo è in millisecondi. Su sistemi che non supportano
.IR usleep (3),
il valore è arrotondato a un numero intero di secondi.
@@ -4048,7 +4126,7 @@ non-POSIX, questo valore può essere visualizzato come
.SH INFORMAZIONE SULLA VERSIONE
Questa pagina man documenta
.IR gawk ,
-versione 4.2.
+versione 5.1.
.SH AUTORI
La versione originale di \*(UX
.I awk
@@ -4119,8 +4197,12 @@ inviate un messaggio per segnalare l'errore a
Anche se gli sviluppatori di
.I gawk
di tanto in tanto leggono questo forum, inviare qui messaggi di segnalazione
-di errore è una maniera poco affidabile per segnalare errori. Siete invece
-pregati di usare l'indirizzo di posta elettronica scritto più sopra.
+di errore è una maniera poco affidabile per segnalare errori.
+Analogamente,
+.B NON
+usare una comunità web (tipo Stack Overflow) per segnalare errori.
+Siete invece pregati di usare gli indirizzi di posta elettronica
+riportati più sopra.
Veramente!
.PP
Se state usando un sistema GNU/Linux o basato sulla distribuzione BSD,
@@ -4157,7 +4239,7 @@ Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger,
Addison-Wesley, 1988. ISBN 0-201-07981-X.
.PP
\*(EP,
-Edition 4.2, disponibile con il codice sorgente
+Edizione 5.1, disponibile con il codice sorgente
.IR gawk .
La versione originale corrente di questo documento è
disponibile online a:
@@ -4209,7 +4291,7 @@ Lo ringraziamo.
.SH COPYING PERMISSIONS
Copyright \(co 1989, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
-2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
+2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019,
Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
diff --git a/doc/it/gawktexi.in b/doc/it/gawktexi.in
index 7dc5d1f7..b81468a6 100644
--- a/doc/it/gawktexi.in
+++ b/doc/it/gawktexi.in
@@ -56,9 +56,9 @@
@c applies to and all the info about who's publishing this edition
@c These apply across the board.
-@set UPDATE-MONTH Giugno 2019
-@set VERSION 5.0
-@set PATCHLEVEL 1
+@set UPDATE-MONTH Luglio 2019
+@set VERSION 5.1
+@set PATCHLEVEL 0
@c added Italian hyphenation stuff
@hyphenation{ven-go-no o-met-te-re o-met-ten-do}
@@ -71,7 +71,7 @@
@set TITLE GAWK: Programmare efficacemente in AWK
@end ifclear
@set SUBTITLE Una Guida Utente per GNU Awk
-@set EDITION 5.0
+@set EDITION 5.1
@iftex
@set DOCUMENT libro
@@ -1033,8 +1033,8 @@ Copyright dell'edizione italiana @copyright{} 2016 -- Free Software Foundation,
* Supporto per Readline:: Supporto per Readline.
* Limitazioni:: Limitazioni.
* Sommario sul debug:: Sommario sul debug.
-* Spazio-dei-nomi globale:: Lo spazio-dei-nomi globale in @command{awk}
- standard.
+* Spazio-dei-nomi globale:: Lo spazio-dei-nomi globale in
+ @command{awk} standard.
* Nomi qualificati:: Come qualificare nomi con uno
spazio-dei-nomi.
* Spazio-dei-nomi di default:: Lo spazio-dei-nomi di default.
@@ -1042,9 +1042,9 @@ Copyright dell'edizione italiana @copyright{} 2016 -- Free Software Foundation,
* Regole per i nomi:: Regole per assegnare nomi a uno
spazio-dei-nomi e ai suoi componenti.
* Gestione interna dei nomi:: Come i nomi sono gestiti internamente.
-* Esempio di spazio-dei-nomi:: Esempio di codice che usa uno spazio-dei-nomi.
-* Spazio-dei-nomi e funzionalit@`a:: Lo spazio-dei-nomi e le altre funzionalit@`a
- di @command{gawk}.
+* Esempio di spazio-dei-nomi:: Esempio di codice che usa uno spazio-dei-nomi.
+* Spazio-dei-nomi e funzionalit@`a:: Lo spazio-dei-nomi e le altre
+ funzionalit@`a di @command{gawk}.
* Sommario sugli spazi-dei-nomi:: Sommario sugli spazi-dei-nomi.
* Aritmetica del computer:: Una rapida introduzione alla matematica del
computer.
@@ -1134,7 +1134,7 @@ Copyright dell'edizione italiana @copyright{} 2016 -- Free Software Foundation,
* Esempio di estensione Readfile:: Leggere un intero file in una stringa.
* Esempio di estensione Time:: Un'interfaccia a @code{gettimeofday()}
e @code{sleep()}.
-* Esempio di estensione API Test:: Test per la API.
+* Esempio di estensione API Test:: Test per l'API.
* gawkextlib:: Il progetto @code{gawkextlib}.
* Sommario delle estensioni:: Sommario delle estensioni.
* Esercizi sulle estensioni:: Esercizi.
@@ -11512,7 +11512,7 @@ Per esempio in C:
int main()
@{
- printf "ciao, \
+ printf("ciao, \
mondo\n");
return 0;
@}
@@ -33494,8 +33494,8 @@ Chi ne trovasse, @`e pregato di notificarlo (@xref{Bug}).
@end quotation
@menu
-* Spazio-dei-nomi globale:: Lo spazio-dei-nomi globale in @command{awk}
- standard.
+* Spazio-dei-nomi globale:: Lo spazio-dei-nomi globale in
+ @command{awk} standard.
* Nomi qualificati:: Come qualificare nomi con uno
spazio-dei-nomi.
* Spazio-dei-nomi di default:: Lo spazio-dei-nomi di default.
@@ -33503,9 +33503,9 @@ Chi ne trovasse, @`e pregato di notificarlo (@xref{Bug}).
* Regole per i nomi:: Regole per assegnare nomi a uno
spazio-dei-nomi ai suoi componenti.
* Gestione interna dei nomi:: Come i nomi sono gestiti internamente.
-* Esempio di spazio-dei-nomi:: Esempio di codice che usa uno spazio-dei-nomi.
-* Spazio-dei-nomi e funzionalit@`a:: Lo spazio-dei-nomi e le altre funzionalit@`a
- di @command{gawk}.
+* Esempio di spazio-dei-nomi:: Esempio di codice che usa uno spazio-dei-nomi.
+* Spazio-dei-nomi e funzionalit@`a:: Lo spazio-dei-nomi e le altre
+ funzionalit@`a di @command{gawk}.
* Sommario sugli spazi-dei-nomi:: Sommario sugli spazi-dei-nomi.
@end menu
@@ -35555,7 +35555,7 @@ Questa
@ifinfo
Questo
@end ifinfo
-(non breve) @value{SECTION} descrive l'API in detttaglio.
+(non breve) @value{SECTION} descrive l'API in dettaglio.
@menu
* Intro funzioni estensione API:: Introduzione alle funzioni dell'API.
@@ -39407,7 +39407,7 @@ si usa l'estensione API.
* Esempio di estensione Readfile:: Leggere un intero file in una stringa.
* Esempio di estensione Time:: Un'interfaccia a @code{gettimeofday()}
e @code{sleep()}.
-* Esempio di estensione API Test:: Test per la API.
+* Esempio di estensione API Test:: Test per l'API.
@end menu
@node Esempio di estensione funzioni file
@@ -40166,7 +40166,7 @@ ottenere il tempo di attesa richiesto.
@end table
@node Esempio di estensione API Test
-@subsection Test per la API
+@subsection Test per l'API
@cindex @code{testext}, estensione
@cindex estensione @code{testext()}
@@ -41988,6 +41988,11 @@ L'elemento di vettore @code{PROCINFO["platform"]}, che permette di
scrivere del codice che tiene conto di piattaforma / sistema operativo.
@end itemize
+La @value{PVERSION} 5.1 @`e stata creata per distribuire @command{gawk} con
+un nuovo numero di versione maggiore per l'API. Sfortunatamente questo
+dettaglio era stato dimenticato al momento in cui era stata preparata la
+@value{PVERSION} 5.0.
+
@c XXX ADD MORE STUFF HERE
@end ifclear
diff --git a/doc/it/texinfo.tex b/doc/it/texinfo.tex
index 2ae6710a..d97820cb 100644
--- a/doc/it/texinfo.tex
+++ b/doc/it/texinfo.tex
@@ -3,12 +3,9 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
-\def\texinfoversion{2018-03-10.14}
+\def\texinfoversion{2019-06-01.23}
%
-% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018
-% Free Software Foundation, Inc.
+% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc.
%
% This texinfo.tex file is free software: you can redistribute it and/or
% modify it under the terms of the GNU General Public License as
@@ -163,6 +160,7 @@
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
%
% added for Italian
+%
\gdef\putwordla{la}
\gdef\putwordLa{La}
\gdef\putwordsivedail{si veda il}
@@ -175,6 +173,7 @@
\def\pxrefIl#1{\putwordSivedail{} \xrefX[#1,,,,,,,]}
\def\xrefil#1{\putwordsivedail{} \xrefX[#1,,,,,,,]}
\def\xrefIl#1{\putwordSivedail{} \xrefX[#1,,,,,,,]}
+%
% Give the space character the catcode for a space.
\def\spaceisspace{\catcode`\ =10\relax}
@@ -258,17 +257,7 @@
%
\def\finalout{\overfullrule=0pt }
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
\newdimen\topandbottommargin \topandbottommargin=.75in
% Output a mark which sets \thischapter, \thissection and \thiscolor.
@@ -284,8 +273,8 @@
% \domark is called twice inside \chapmacro, to add one
% mark before the section break, and one after.
-% In the second call \prevchapterdefs is the same as \lastchapterdefs,
-% and \prevsectiondefs is the same as \lastsectiondefs.
+% In the second call \prevchapterdefs is the same as \currentchapterdefs,
+% and \prevsectiondefs is the same as \currentsectiondefs.
% Then if the page is not broken at the mark, some of the previous
% section appears on the page, and we can get the name of this section
% from \firstmark for @everyheadingmarks top.
@@ -293,11 +282,11 @@
%
% See page 260 of The TeXbook.
\def\domark{%
- \toks0=\expandafter{\lastchapterdefs}%
- \toks2=\expandafter{\lastsectiondefs}%
+ \toks0=\expandafter{\currentchapterdefs}%
+ \toks2=\expandafter{\currentsectiondefs}%
\toks4=\expandafter{\prevchapterdefs}%
\toks6=\expandafter{\prevsectiondefs}%
- \toks8=\expandafter{\lastcolordefs}%
+ \toks8=\expandafter{\currentcolordefs}%
\mark{%
\the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
\noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
@@ -314,19 +303,19 @@
% @setcolor (or @url, or @link, etc.) between @contents and the very
% first @chapter.
\def\gettopheadingmarks{%
- \ifcase0\topmark\fi
+ \ifcase0\the\savedtopmark\fi
\ifx\thischapter\empty \ifcase0\firstmark\fi \fi
}
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\topmark\fi}
+\def\getcolormarks{\ifcase2\the\savedtopmark\fi}
% Avoid "undefined control sequence" errors.
-\def\lastchapterdefs{}
-\def\lastsectiondefs{}
-\def\lastsection{}
+\def\currentchapterdefs{}
+\def\currentsectiondefs{}
+\def\currentsection{}
\def\prevchapterdefs{}
\def\prevsectiondefs{}
-\def\lastcolordefs{}
+\def\currentcolordefs{}
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
@@ -336,39 +325,57 @@
% Main output routine.
%
\chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
+\newtoks\defaultoutput
+\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
+\output=\expandafter{\the\defaultoutput}
\newbox\headlinebox
\newbox\footlinebox
+% When outputting the double column layout for indices, an output routine
+% is run several times, which hides the original value of \topmark. This
+% can lead to a page heading being output and duplicating the chapter heading
+% of the index. Hence, save the contents of \topmark at the beginning of
+% the output routine. The saved contents are valid until we actually
+% \shipout a page.
+%
+% (We used to run a short output routine to actually set \topmark and
+% \firstmark to the right values, but if this was called with an empty page
+% containing whatsits for writing index entries, the whatsits would be thrown
+% away and the index auxiliary file would remain empty.)
+%
+\newtoks\savedtopmark
+\newif\iftopmarksaved
+\topmarksavedtrue
+\def\savetopmark{%
+ \iftopmarksaved\else
+ \global\savedtopmark=\expandafter{\topmark}%
+ \global\topmarksavedtrue
+ \fi
+}
+
% \onepageout takes a vbox as an argument.
-% \shipout a vbox for a single page, adding an optional header, footer,
-% cropmarks, and footnote. This also causes index entries for this page
-% to be written to the auxiliary files.
+% \shipout a vbox for a single page, adding an optional header, footer
+% and footnote. This also causes index entries for this page to be written
+% to the auxiliary files.
%
\def\onepageout#1{%
- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+ \hoffset=\normaloffset
%
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
%
- % Common context changes for both heading and footing.
- % Do this outside of the \shipout so @code etc. will be expanded in
- % the headline as they should be, not taken literally (outputting ''code).
- \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
- %
% Retrieve the information for the headings from the marks in the page,
% and call Plain TeX's \makeheadline and \makefootline, which use the
% values in \headline and \footline.
%
% This is used to check if we are on the first page of a chapter.
- \ifcase1\topmark\fi
+ \ifcase1\the\savedtopmark\fi
\let\prevchaptername\thischaptername
\ifcase0\firstmark\fi
\let\curchaptername\thischaptername
%
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
- \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
%
\ifx\curchaptername\prevchaptername
\let\thischapterheading\thischapter
@@ -379,7 +386,14 @@
\def\thischapterheading{}%
\fi
%
+ % Common context changes for both heading and footing.
+ % Do this outside of the \shipout so @code etc. will be expanded in
+ % the headline as they should be, not taken literally (outputting ''code).
+ \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
+ %
\global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
+ %
+ \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
\global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
%
{%
@@ -388,37 +402,12 @@
% 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
%
- \ifcropmarks \vbox to \outervsize\bgroup
- \hsize = \outerhsize
- \vskip-\topandbottommargin
- \vtop to0pt{%
- \line{\ewtop\hfil\ewtop}%
- \nointerlineskip
- \line{%
- \vbox{\moveleft\cornerthick\nstop}%
- \hfill
- \vbox{\moveright\cornerthick\nstop}%
- }%
- \vss}%
- \vskip\topandbottommargin
- \line\bgroup
- \hfil % center the page within the outer (page) hsize.
- \ifodd\pageno\hskip\bindingoffset\fi
- \vbox\bgroup
- \fi
- %
\unvbox\headlinebox
\pagebody{#1}%
\ifdim\ht\footlinebox > 0pt
@@ -429,24 +418,9 @@
\unvbox\footlinebox
\fi
%
- \ifcropmarks
- \egroup % end of \vbox\bgroup
- \hfil\egroup % end of (centering) \line\bgroup
- \vskip\topandbottommargin plus1fill minus1fill
- \boxmaxdepth = \cornerthick
- \vbox to0pt{\vss
- \line{%
- \vbox{\moveleft\cornerthick\nsbot}%
- \hfill
- \vbox{\moveright\cornerthick\nsbot}%
- }%
- \nointerlineskip
- \line{\ewbot\hfil\ewbot}%
- }%
- \egroup % \vbox from first cropmarks clause
- \fi
- }% end of \shipout\vbox
- }% end of group with \indexdummies
+ }%
+ }%
+ \global\topmarksavedfalse
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
@@ -465,17 +439,6 @@
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
-% Here are the rules for the cropmarks. Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
- {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
- {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
% Argument parsing
@@ -501,11 +464,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.
%
@@ -1177,6 +1139,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
@@ -1233,7 +1205,7 @@ output) for that.)}
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
\def\setcolor#1{%
- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
}
@@ -1241,7 +1213,7 @@ output) for that.)}
\def\maincolor{\rgbBlack}
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
- \def\lastcolordefs{}
+ \def\currentcolordefs{}
%
\def\makefootline{%
\baselineskip24pt
@@ -1542,6 +1514,9 @@ output) for that.)}
\startlink attr{/Border [0 0 0]}%
user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
\endgroup}
+ % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
+ % be a simple number, or a list of numbers in the case of an index
+ % entry.
\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
@@ -1616,7 +1591,7 @@ output) for that.)}
% Set color, and create a mark which defines \thiscolor accordingly,
% so that \makeheadline knows which color to restore.
\def\setcolor#1{%
- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
\domark
\pdfsetcolor{#1}%
}
@@ -1624,7 +1599,7 @@ output) for that.)}
\def\maincolor{\rgbBlack}
\pdfsetcolor{\maincolor}
\edef\thiscolor{\maincolor}
- \def\lastcolordefs{}
+ \def\currentcolordefs{}
%
\def\makefootline{%
\baselineskip24pt
@@ -2216,7 +2191,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}
@@ -2364,7 +2339,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}
@@ -2887,7 +2862,7 @@ end
% @t, explicit typewriter.
\def\t#1{%
- {\tt \rawbackslash \plainfrenchspacing #1}%
+ {\tt \plainfrenchspacing #1}%
\null
}
@@ -2914,7 +2889,6 @@ end
% Turn off hyphenation.
\nohyphenation
%
- \rawbackslash
\plainfrenchspacing
#1%
}%
@@ -3101,41 +3075,33 @@ end
\global\def/{\normalslash}
}
-% we put a little stretch before and after the breakable chars, to help
-% line breaking of long url's. The unequal skips make look better in
-% cmtt at least, especially for dots.
-\def\urefprestretchamount{.13em}
-\def\urefpoststretchamount{.1em}
-\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
-\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
-%
-\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
-\def\urefcodedot{\urefprestretch .\urefpoststretch}
-\def\urefcodehash{\urefprestretch \#\urefpoststretch}
-\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeamp{\urefprebreak \&\urefpostbreak}
+\def\urefcodedot{\urefprebreak .\urefpostbreak}
+\def\urefcodehash{\urefprebreak \#\urefpostbreak}
+\def\urefcodequest{\urefprebreak ?\urefpostbreak}
\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
{
\catcode`\/=\active
\global\def\urefcodeslashfinish{%
- \urefprestretch \slashChar
+ \urefprebreak \slashChar
% Allow line break only after the final / in a sequence of
% slashes, to avoid line break between the slashes in http://.
- \ifx\next/\else \urefpoststretch \fi
+ \ifx\next/\else \urefpostbreak \fi
}
}
-% One more complication: by default we'll break after the special
-% characters, but some people like to break before the special chars, so
-% allow that. Also allow no breaking at all, for manual control.
+% By default we'll break after the special characters, but some people like to
+% break before the special chars, so allow that. Also allow no breaking at
+% all, for manual control.
%
\parseargdef\urefbreakstyle{%
\def\txiarg{#1}%
\ifx\txiarg\wordnone
\def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordbefore
- \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+ \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordafter
- \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+ \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
\else
\errhelp = \EMsimple
\errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
@@ -3145,6 +3111,14 @@ end
\def\wordbefore{before}
\def\wordnone{none}
+% 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 4 em\relax
+ \allowbreak
+ \hskip 0pt plus -4 em\relax
+}
+
\urefbreakstyle after
% @url synonym for @uref, since that's how everyone uses it.
@@ -3155,7 +3129,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
@@ -3165,18 +3139,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),
@@ -4710,19 +4673,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'']}%
@@ -4751,7 +4701,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
@@ -4901,23 +4851,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\@%
@@ -4947,8 +4882,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{%
%
@@ -4997,6 +4931,7 @@ end
% Assorted special characters.
\definedummyword\atchar
\definedummyword\arrow
+ \definedummyword\backslashchar
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
@@ -5033,6 +4968,8 @@ end
\definedummyword\sup
\definedummyword\textdegree
%
+ \definedummyword\subentry
+ %
% We want to disable all macros so that they are not expanded by \write.
\macrolist
\let\value\dummyvalue
@@ -5113,11 +5050,10 @@ end
\commondummyword\xref
}
-% For testing: output @{ and @} in index sort strings as \{ and \}.
-\newif\ifusebracesinindexes
-
\let\indexlbrace\relax
\let\indexrbrace\relax
+\let\indexatchar\relax
+\let\indexbackslash\relax
{\catcode`\@=0
\catcode`\\=13
@@ -5151,10 +5087,8 @@ end
}
\gdef\indexnonalnumreappear{%
- \useindexbackslash
\let-\normaldash
\let<\normalless
- \def\@{@}%
}
}
@@ -5265,36 +5199,16 @@ end
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
-
-% Most index entries go through here, but \dosubind is the general case.
% #1 is the index name, #2 is the entry text.
-\def\doind#1#2{\dosubind{#1}{#2}{}}
-
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-% TODO: Two-level index? Operation index?
-
-% Workhorse for all indexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% empty if called from \doind, as we usually are (the main exception
-% is with most defuns, which call us directly).
-%
-\def\dosubind#1#2#3{%
+\def\doind#1#2{%
\iflinks
{%
- \requireopenindexfile{#1}%
- % Store the main index entry text (including the third arg).
- \toks0 = {#2}%
- % If third arg is present, precede it with a space.
- \def\thirdarg{#3}%
- \ifx\thirdarg\empty \else
- \toks0 = \expandafter{\the\toks0 \space #3}%
- \fi
%
+ \requireopenindexfile{#1}%
\edef\writeto{\csname#1indfile\endcsname}%
%
- \safewhatsit\dosubindwrite
+ \def\indextext{#2}%
+ \safewhatsit\doindwrite
}%
\fi
}
@@ -5316,21 +5230,7 @@ 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 text.
-\def\sortas#1{\ignorespaces}%
-
-% Definition for writing index entry sort key. Should occur at the at
-% the beginning of the index entry, like
-% @cindex @sortas{september} \september
-% The \ignorespaces takes care of following space, but there's no way
-% to remove space before it.
+% Definition for writing index entry sort key.
{
\catcode`\-=13
\gdef\indexwritesortas{%
@@ -5341,51 +5241,150 @@ end
\xdef\indexsortkey{#1}\endgroup}
}
+\def\indexwriteseealso#1{
+ \gdef\pagenumbertext{\string\seealso{#1}}%
+}
+\def\indexwriteseeentry#1{
+ \gdef\pagenumbertext{\string\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
-% Write the entry in \toks0 to the index file.
+
+% 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\dosubindwrite{%
- % Put the index entry in the margin if desired.
- \ifx\SETmarginindex\relax\else
- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+\def\splitindexentry#1{%
+ \gdef\fullindexsortkey{}%
+ \xdef\bracedtext{}%
+ \def\sep{}%
+ \def\seealso##1{}%
+ \def\seeentry##1{}%
+ \expandafter\doindexsegment#1\subentry\finish\subentry
+}
+
+% append the results from the next segment
+\def\doindexsegment#1\subentry{%
+ \def\segment{#1}%
+ \ifx\segment\isfinish
+ \else
+ %
+ % Fully expand the segment, throwing away any @sortas directives, and
+ % trim spaces.
+ \edef\trimmed{\segment}%
+ \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+ %
+ \xdef\bracedtext{\bracedtext{\trimmed}}%
+ %
+ % Get the string to sort by. Process the segment with all
+ % 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{{\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 or @seealso commands in this segment.
+ \setbox\dummybox = \hbox{\segment}%
+ \ifx\indexsortkey\empty{%
+ \indexnonalnumdisappear
+ \xdef\trimmed{\segment}%
+ \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+ \xdef\indexsortkey{\trimmed}%
+ \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
+ }\fi
+ %
+ % Append to \fullindexsortkey.
+ \edef\tmp{\gdef\noexpand\fullindexsortkey{%
+ \fullindexsortkey\sep\indexsortkey}}%
+ \tmp
+ \egroup
+ \def\sep{\subentry}%
+ %
+ \expandafter\doindexsegment
\fi
+}
+\def\isfinish{\finish}%
+\newbox\dummybox % used above
+
+\let\subentry\relax
+
+% 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=`\\}
+
+% Use \ in index files by default. texi2dvi didn't support @ as the escape
+% character (as it checked for "\entry" in the files, and not "@entry"). When
+% the new version of texi2dvi has had a chance to become more prevalent, then
+% the escape character can change back to @ again. This should be an easy
+% change to make now because both @ and \ are only used as escape characters in
+% index files, never standing for themselves.
+%
+\set txiindexescapeisbackslash
+
+% Write the entry in \indextext to the index file.
+%
+\def\doindwrite{%
+ \maybemarginindex
%
- % 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.
- % The braces around \indexbrace are recognized by texindex.
- %
- % Get the string to sort by, by processing the index entry with all
- % font commands turned off.
- {\indexnofonts
- \def\lbracechar{{\indexlbrace}}%
- \def\rbracechar{{\indexrbrace}}%
- \let\{=\lbracechar
- \let\}=\rbracechar
- \indexnonalnumdisappear
- \xdef\indexsortkey{}%
- \let\sortas=\indexwritesortas
- \edef\temp{\the\toks0}%
- \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
- \ifx\indexsortkey\empty
- \xdef\indexsortkey{\temp}%
- \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
- \fi
- }%
+ \atdummies
+ %
+ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
+ \escapeisbackslash
+ \fi
+ %
+ % 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.
+ \splitindexentry\indextext
%
% Set up the complete index entry, with both the sort key and
% the original text, including any font commands. We write
% three arguments to \entry to the .?? file (four in the
% subentry case), texindex reduces to two when writing the .??s
% sorted result.
+ %
\edef\temp{%
\write\writeto{%
- \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
+ \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:
%
@@ -5473,9 +5472,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.
@@ -5487,11 +5491,6 @@ end
\def\tindex {\tpindex}
\def\pindex {\pgindex}
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
% Define the macros used in formatting output of the sorted index material.
% @printindex causes a particular index (the ??s file) to get printed.
@@ -5505,14 +5504,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,
@@ -5522,8 +5517,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.
@@ -5531,47 +5524,51 @@ 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
+ \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.
@@ -5580,12 +5577,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}}%
@@ -5645,12 +5649,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
@@ -5683,35 +5681,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.
%
@@ -5777,55 +5771,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.
@@ -5835,24 +5785,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,
@@ -5862,60 +5803,21 @@ end
\newbox\partialpage
\newdimen\doublecolumnhsize
-% Use inside an output routine to save \topmark and \firstmark
-\def\savemarks{%
- \global\savedtopmark=\expandafter{\topmark }%
- \global\savedfirstmark=\expandafter{\firstmark }%
-}
-\newtoks\savedtopmark
-\newtoks\savedfirstmark
-
-% Set \topmark and \firstmark for next time \output runs.
-% Can't be run from withinside \output (because any material
-% added while an output routine is active, including
-% penalties, is saved for after it finishes). The page so far
-% should be empty, otherwise what's on it will be thrown away.
-\def\restoremarks{%
- \mark{\the\savedtopmark}%
- \bgroup\output = {%
- \setbox\dummybox=\box\PAGE
- }abc\eject\egroup
- % "abc" because output routine doesn't fire for a completely empty page.
- \mark{\the\savedfirstmark}%
-}
-
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% If not much space left on page, start a new page.
\ifdim\pagetotal>0.8\vsize\vfill\eject\fi
%
% Grab any single-column material above us.
\output = {%
- %
- % 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
+ \savetopmark
%
\global\setbox\partialpage = \vbox{%
% Unvbox the main output page.
\unvbox\PAGE
\kern-\topskip \kern\baselineskip
}%
- \savemarks
}%
\eject % run that output routine to set \partialpage
- \restoremarks
- %
- % We recover the two marks that the last output routine saved in order
- % to propagate the information in marks added around a chapter heading,
- % which could be otherwise be lost by the time the final page is output.
- %
%
% Use the double-column output routine for subsequent pages.
\output = {\doublecolumnout}%
@@ -5941,7 +5843,9 @@ end
\divide\doublecolumnhsize by 2
\hsize = \doublecolumnhsize
%
- % Double the \vsize as well.
+ % Get the available space for the double columns -- the normal
+ % (undoubled) page height minus any material left over from the
+ % previous page.
\advance\vsize by -\ht\partialpage
\vsize = 2\vsize
%
@@ -5954,17 +5858,15 @@ end
%
\def\doublecolumnout{%
%
+ \savetopmark
\splittopskip=\topskip \splitmaxdepth=\maxdepth
- % Get the available space for the double columns -- the normal
- % (undoubled) page height minus any material left over from the
- % previous page.
\dimen@ = \vsize
\divide\dimen@ by 2
%
% box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
\global\advance\vsize by 2\ht\partialpage
- \onepageout\pagesofar
+ \onepageout\pagesofar % empty except for the first time we are called
\unvbox\PAGE
\penalty\outputpenalty
}
@@ -5980,7 +5882,7 @@ end
}
-% Finished with with double columns.
+% Finished with double columns.
\def\enddoublecolumns{%
% The following penalty ensures that the page builder is exercised
% _before_ we change the output routine. This is necessary in the
@@ -6012,7 +5914,7 @@ end
%
\output = {%
% Split the last of the double-column material.
- \savemarks
+ \savetopmark
\balancecolumns
}%
\eject % call the \output just set
@@ -6020,10 +5922,9 @@ end
% Having called \balancecolumns once, we do not
% want to call it again. Therefore, reset \output to its normal
% definition right away.
- \global\output = {\onepageout{\pagecontents\PAGE}}%
+ \global\output=\expandafter{\the\defaultoutput}
%
\endgroup % started in \begindoublecolumns
- \restoremarks
% Leave the double-column material on the current page, no automatic
% page break.
\box\balancedcolumns
@@ -6047,13 +5948,14 @@ end
\def\balancecolumns{%
\setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
- \advance\dimen@ by \topskip
- \advance\dimen@ by-\baselineskip
- \ifdim\dimen@<5\baselineskip
+ \ifdim\dimen@<7\baselineskip
% Don't split a short final column in two.
\setbox2=\vbox{}%
\global\setbox\balancedcolumns=\vbox{\pagesofar}%
\else
+ % double the leading vertical space
+ \advance\dimen@ by \topskip
+ \advance\dimen@ by-\baselineskip
\divide\dimen@ by 2 % target to split to
\dimen@ii = \dimen@
\splittopskip = \topskip
@@ -6188,11 +6090,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
@@ -6537,27 +6437,22 @@ end
\expandafter\ifx\thisenv\titlepage\else
\checkenv{}% chapters, etc., should not start inside an environment.
\fi
- % FIXME: \chapmacro is currently called from inside \titlepage when
- % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
- % this should probably be done by \sectionheading with an option to print
- % in chapter size.
- %
% Insert the first mark before the heading break (see notes for \domark).
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
- \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+ \let\prevchapterdefs=\currentchapterdefs
+ \let\prevsectiondefs=\currentsectiondefs
+ \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
\gdef\thissection{}}%
%
\def\temptype{#2}%
\ifx\temptype\Ynothingkeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{\thischaptername}}%
\else\ifx\temptype\Yomitfromtockeyword
- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+ \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{}}%
\else\ifx\temptype\Yappendixkeyword
\toks0={#1}%
- \xdef\lastchapterdefs{%
+ \xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\appendixletter}%
% \noexpand\putwordAppendix avoids expanding indigestible
@@ -6568,7 +6463,7 @@ end
}%
\else
\toks0={#1}%
- \xdef\lastchapterdefs{%
+ \xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\the\chapno}%
% \noexpand\putwordChapter avoids expanding indigestible
@@ -6588,18 +6483,18 @@ end
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
- \let\prevchapterdefs=\lastchapterdefs
- \let\prevsectiondefs=\lastsectiondefs
+ \let\prevchapterdefs=\currentchapterdefs
+ \let\prevsectiondefs=\currentsectiondefs
\domark
%
{%
\chapfonts \rm
\let\footnote=\errfootnoteheading % give better error message
%
- % Have to define \lastsection before calling \donoderef, because the
+ % Have to define \currentsection before calling \donoderef, because the
% xref code eventually uses it. On the other hand, it has to be called
% after \pchapsepmacro, or the headline will change too soon.
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
%
% Only insert the separating space if we have a chapter/appendix
% number, and don't print the unnumbered ``number''.
@@ -6688,10 +6583,10 @@ end
\csname #2fonts\endcsname \rm
%
% Insert first mark before the heading break (see notes for \domark).
- \let\prevsectiondefs=\lastsectiondefs
+ \let\prevsectiondefs=\currentsectiondefs
\ifx\temptype\Ynothingkeyword
\ifx\sectionlevel\seckeyword
- \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+ \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
\gdef\thissection{\thissectionname}}%
\fi
\else\ifx\temptype\Yomitfromtockeyword
@@ -6699,7 +6594,7 @@ end
\else\ifx\temptype\Yappendixkeyword
\ifx\sectionlevel\seckeyword
\toks0={#1}%
- \xdef\lastsectiondefs{%
+ \xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
@@ -6712,7 +6607,7 @@ end
\else
\ifx\sectionlevel\seckeyword
\toks0={#1}%
- \xdef\lastsectiondefs{%
+ \xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
@@ -6738,28 +6633,28 @@ end
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
- \global\let\prevsectiondefs=\lastsectiondefs
+ \global\let\prevsectiondefs=\currentsectiondefs
\domark
%
% Only insert the space after the number if we have a section number.
\ifx\temptype\Ynothingkeyword
\setbox0 = \hbox{}%
\def\toctype{unn}%
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
\else\ifx\temptype\Yomitfromtockeyword
% for @headings -- no section number, don't include in toc,
- % and don't redefine \lastsection.
+ % and don't redefine \currentsection.
\setbox0 = \hbox{}%
\def\toctype{omit}%
\let\sectionlevel=\empty
\else\ifx\temptype\Yappendixkeyword
\setbox0 = \hbox{#4\enspace}%
\def\toctype{app}%
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
\else
\setbox0 = \hbox{#4\enspace}%
\def\toctype{num}%
- \gdef\lastsection{#1}%
+ \gdef\currentsection{#1}%
\fi\fi\fi
%
% Write the toc entry (before \donoderef). See comments in \chapmacro.
@@ -6849,13 +6744,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
}
@@ -7218,11 +7108,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}}
@@ -7237,7 +7123,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
@@ -7416,13 +7313,9 @@ end
% @raggedright does more-or-less normal line breaking but no right
-% justification. From plain.tex. Don't stretch around special
-% characters in urls in this environment, since the stretch at the right
-% should be enough.
+% justification. From plain.tex.
\envdef\raggedright{%
\rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
- \def\urefprestretchamount{0pt}%
- \def\urefpoststretchamount{0pt}%
}
\let\Eraggedright\par
@@ -7584,7 +7477,7 @@ end
\nonfillstart
\tt % easiest (and conventionally used) font for verbatim
% The \leavevmode here is for blank lines. Otherwise, we would
- % never \starttabox and the \egroup would end verbatim mode.
+ % never \starttabbox and the \egroup would end verbatim mode.
\def\par{\leavevmode\egroup\box\verbbox\endgraf}%
\tabexpand
\setupmarkupstyle{verbatim}%
@@ -7647,9 +7540,12 @@ end
{%
\makevalueexpandable
\setupverbatim
- \indexnofonts % Allow `@@' and other weird things in file names.
- \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
- \input #1
+ {%
+ \indexnofonts % Allow `@@' and other weird things in file names.
+ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+ \edef\tmp{\noexpand\input #1 }
+ \expandafter
+ }\tmp
\afterenvbreak
}%
}
@@ -7794,6 +7690,21 @@ end
\fi\fi
}
+% \dosubind {index}{topic}{subtopic}
+%
+% If SUBTOPIC is present, precede it with a space, and call \doind.
+% (At some time during the 20th century, this made a two-level entry in an
+% index such as the operation index. Nobody seemed to notice the change in
+% behaviour though.)
+\def\dosubind#1#2#3{%
+ \def\thirdarg{#3}%
+ \ifx\thirdarg\empty
+ \doind{#1}{#2}%
+ \else
+ \doind{#1}{#2\space#3}%
+ \fi
+}
+
% Untyped functions:
% @deffn category name args
@@ -7808,7 +7719,6 @@ end
% \deffngeneral {subind}category name args
%
\def\deffngeneral#1#2 #3 #4\endheader{%
- % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
\dosubind{fn}{\code{#3}}{#1}%
\defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
@@ -8015,6 +7925,7 @@ end
\gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
\gdef\magicamp{\let&=\amprm}
}
+\let\ampchar\&
\newcount\parencount
@@ -8095,36 +8006,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}%
+ \scantokens{#1@comment}%
%
- \catcode`\@=\savedcatcodeone
- \catcode`\\=\savedcatcodetwo
- %
- % 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
@@ -8225,12 +8118,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
}
@@ -8794,9 +8689,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
@@ -8819,7 +8734,7 @@ end
% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
% anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \lastsection,
+% 1) NAME-title - the current sectioning name taken from \currentsection,
% or the anchor name.
% 2) NAME-snt - section number and type, passed as the SNT arg, or
% empty for anchors.
@@ -8841,7 +8756,7 @@ end
\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
##1}{##2}}% these are parameters of \writexrdef
}%
- \toks0 = \expandafter{\lastsection}%
+ \toks0 = \expandafter{\currentsection}%
\immediate \writexrdef{title}{\the\toks0 }%
\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
\safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
@@ -9271,19 +9186,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...
@@ -9301,14 +9203,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
@@ -9639,13 +9534,13 @@ end
\global\advance\floatno by 1
%
{%
- % This magic value for \lastsection is output by \setref as the
+ % This magic value for \currentsection is output by \setref as the
% XREFLABEL-title value. \xrefX uses it to distinguish float
% labels (which have a completely different output format) from
% node and anchor labels. And \xrdef uses it to construct the
% lists of floats.
%
- \edef\lastsection{\floatmagic=\safefloattype}%
+ \edef\currentsection{\floatmagic=\safefloattype}%
\setref{\floatlabel}{Yfloat}%
}%
\fi
@@ -9768,7 +9663,7 @@ end
% #1 is the control sequence we are passed; we expand into a conditional
% which is true if #1 represents a float ref. That is, the magic
-% \lastsection value which we \setref above.
+% \currentsection value which we \setref above.
%
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
%
@@ -11256,21 +11151,14 @@ directory should work if nowhere else does.}
\relax
}
-% define all Unicode characters we know about, for the sake of @U.
+% Define all Unicode characters we know about. This makes UTF-8 the default
+% input encoding and allows @U to work.
\iftxinativeunicodecapable
\nativeunicodechardefsatu
\else
\utfeightchardefs
\fi
-
-% Make non-ASCII characters printable again for compatibility with
-% existing Texinfo documents that may use them, even without declaring a
-% document encoding.
-%
-\setnonasciicharscatcode \other
-
-
\message{formatting,}
\newdimen\defaultparindent \defaultparindent = 15pt
@@ -11453,25 +11341,6 @@ directory should work if nowhere else does.}
\globaldefs = 0
}}
- % Aggiunto formato 17x24, comunemente usato per i testi scientifici.
-\def\manuale{{\globaldefs = 1
- \parskip = 2pt plus 1pt minus 0.1pt
- \textleading = 12.0pt
- %
- \internalpagesizes{190mm}{120mm}%
- {\voffset}{0mm}%
- {\hoffset}{0mm}%
- {\bindingoffset}{4.6mm}%
- {240mm}{170mm}%
- %
- \lispnarrowing = 0.2in
- \tolerance = 800
- \hfuzz = 1.2pt
- \contentsrightmargin = 0pt
- \defbodyindent = 2mm
- \tableindent = 12mm
-}}
-
% Use @afourwide to print on A4 paper in landscape format.
\def\afourwide{{\globaldefs = 1
\afourpaper
@@ -11605,11 +11474,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.
@@ -11627,10 +11494,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
@@ -11702,7 +11567,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.