put back matchcharsdiff -r1.1.1.1 -r1.2 src/dist/nvi/catalog/dutch.base
(christos)
--- src/dist/nvi/catalog/Attic/dutch.base 2008/05/16 18:03:04 1.1.1.1
+++ src/dist/nvi/catalog/Attic/dutch.base 2008/10/01 21:20:09 1.2
@@ -33,28 +33,27 @@ | @@ -33,28 +33,27 @@ | |||
33 | 034 "set: [no]%s optie kan geen waarde hebben" | 33 | 034 "set: [no]%s optie kan geen waarde hebben" | |
34 | 035 "set: %s optie moet een waarde hebben" | 34 | 035 "set: %s optie moet een waarde hebben" | |
35 | 036 "set: %s optie: %s" | 35 | 036 "set: %s optie: %s" | |
36 | 037 "set: %s optie: %s: getal is te groot" | 36 | 037 "set: %s optie: %s: getal is te groot" | |
37 | 038 "set: %s optie: %s is een ongeldige waarde" | 37 | 038 "set: %s optie: %s is een ongeldige waarde" | |
38 | 039 "set: %s optie moet een waarde hebben" | 38 | 039 "set: %s optie moet een waarde hebben" | |
39 | 040 "Te weinig kolommen op het scherm, minder dan %d" | 39 | 040 "Te weinig kolommen op het scherm, minder dan %d" | |
40 | 041 "Aantal kolommen te groot, meer dan %d" | 40 | 041 "Aantal kolommen te groot, meer dan %d" | |
41 | 042 "Te weinig regels op het scherm, minder dan %d" | 41 | 042 "Te weinig regels op het scherm, minder dan %d" | |
42 | 043 "Aantal regels te groot, meer dan %d" | 42 | 043 "Aantal regels te groot, meer dan %d" | |
43 | 044 "De lisp optie is niet ondersteund" | 43 | 044 "De lisp optie is niet ondersteund" | |
44 | 045 "messages niet uitgeschakeld: %s" | 44 | 045 "messages niet uitgeschakeld: %s" | |
45 | 046 "messages niet geactiveerd: %s" | 45 | 046 "messages niet geactiveerd: %s" | |
46 | 048 "De paragraph optie moet karakter paren bevatten" | 46 | 047 "set: de %s optie moet karakter paren bevatten" | |
47 | 049 "De section optie moet karakter paren bevatten" | |||
48 | 053 "De standaard buffer is leeg" | 47 | 053 "De standaard buffer is leeg" | |
49 | 054 "Buffer %s is leeg" | 48 | 054 "Buffer %s is leeg" | |
50 | 055 "Bestanden met newlines in de naam kunnen niet hersteld worden" | 49 | 055 "Bestanden met newlines in de naam kunnen niet hersteld worden" | |
51 | 056 "Wijzigingen kunnen niet ongedaan gemaakt worden als deze sessie mislukt" | 50 | 056 "Wijzigingen kunnen niet ongedaan gemaakt worden als deze sessie mislukt" | |
52 | 057 "Bestand wordt gecopieerd voor herstel..." | 51 | 057 "Bestand wordt gecopieerd voor herstel..." | |
53 | 058 "Herstel mechanisme werkt niet: %s" | 52 | 058 "Herstel mechanisme werkt niet: %s" | |
54 | 059 "Wijzigingen kunnen niet ongedaan gemaakt worden als deze sessie mislukt" | 53 | 059 "Wijzigingen kunnen niet ongedaan gemaakt worden als deze sessie mislukt" | |
55 | 060 "Kon bestand niet veilig stellen: %s" | 54 | 060 "Kon bestand niet veilig stellen: %s" | |
56 | 061 "Bestand wordt gecopieerd voor herstel..." | 55 | 061 "Bestand wordt gecopieerd voor herstel..." | |
57 | 062 "Informatie met betrekking tot gebruiker nummer %u niet gevonden" | 56 | 062 "Informatie met betrekking tot gebruiker nummer %u niet gevonden" | |
58 | 063 "Kan herstel bestand niet beveiligen" | 57 | 063 "Kan herstel bestand niet beveiligen" | |
59 | 064 "herstel buffer overgelopen" | 58 | 064 "herstel buffer overgelopen" | |
60 | 065 "herstel bestand" | 59 | 065 "herstel bestand" |
--- src/dist/nvi/catalog/Attic/french.base 2008/05/16 18:03:05 1.1.1.1
+++ src/dist/nvi/catalog/Attic/french.base 2008/10/01 21:20:09 1.2
@@ -33,28 +33,27 @@ | @@ -33,28 +33,27 @@ | |||
33 | 034 "Définition : option [no]%s ne prend pas de valeur" | 33 | 034 "Définition : option [no]%s ne prend pas de valeur" | |
34 | 035 "Définition : l'option %s n'est pas booléenne" | 34 | 035 "Définition : l'option %s n'est pas booléenne" | |
35 | 036 "Définition : option %s : %s" | 35 | 036 "Définition : option %s : %s" | |
36 | 037 "Définition : option %s : %s : Dépassement de valeur" | 36 | 037 "Définition : option %s : %s : Dépassement de valeur" | |
37 | 038 "Définition : option %s : %s n'est pas un nombre valide" | 37 | 038 "Définition : option %s : %s n'est pas un nombre valide" | |
38 | 039 "Définition : l'option %s n'est pas booléenne" | 38 | 039 "Définition : l'option %s n'est pas booléenne" | |
39 | 040 "Les colonnes de l'écran sont trop petites, inférieures à %d" | 39 | 040 "Les colonnes de l'écran sont trop petites, inférieures à %d" | |
40 | 041 "Les colonnes de l'écran sont trop grandes, supérieures à %d" | 40 | 041 "Les colonnes de l'écran sont trop grandes, supérieures à %d" | |
41 | 042 "Les lignes de l'écran sont trop courtes, inférieures à %d" | 41 | 042 "Les lignes de l'écran sont trop courtes, inférieures à %d" | |
42 | 043 "Les lignes de l'écran sont trop longues, supérieures à %d" | 42 | 043 "Les lignes de l'écran sont trop longues, supérieures à %d" | |
43 | 044 "L'option lisp n'est pas implémentée" | 43 | 044 "L'option lisp n'est pas implémentée" | |
44 | 045 "Les messages ne sont pas désactivés : %s" | 44 | 045 "Les messages ne sont pas désactivés : %s" | |
45 | 046 "Les messages ne sont pas activés : %s" | 45 | 046 "Les messages ne sont pas activés : %s" | |
46 | 048 "L'option de paragraphe doit être en groupe de deux caractères" | 46 | 047 "D‚finition : l'option de %s doit ˆtre en groupe de deux caractŠres" | |
47 | 049 "L'option de section doit être en groupe de deux caractères" | |||
48 | 053 "Le tampon par défaut est vide" | 47 | 053 "Le tampon par défaut est vide" | |
49 | 054 "Le tampon %s est vide" | 48 | 054 "Le tampon %s est vide" | |
50 | 055 "Les fichiers dont le nom contient des caractères de saut de ligne sont irrécupérables" | 49 | 055 "Les fichiers dont le nom contient des caractères de saut de ligne sont irrécupérables" | |
51 | 056 "Impossible de récupérer les modifications si la session échoue" | 50 | 056 "Impossible de récupérer les modifications si la session échoue" | |
52 | 057 "Copie en cours du fichier pour récupération..." | 51 | 057 "Copie en cours du fichier pour récupération..." | |
53 | 058 "La préservation a échoué : %s" | 52 | 058 "La préservation a échoué : %s" | |
54 | 059 "Impossible de récupérer les modifications si la session échoue" | 53 | 059 "Impossible de récupérer les modifications si la session échoue" | |
55 | 060 "La sauvegarde du fichier a échoué : %s" | 54 | 060 "La sauvegarde du fichier a échoué : %s" | |
56 | 061 "Copie en cours du fichier pour récupération..." | 55 | 061 "Copie en cours du fichier pour récupération..." | |
57 | 062 "Les renseignements sur l'identité %u de l'utilisateur sont introuvables" | 56 | 062 "Les renseignements sur l'identité %u de l'utilisateur sont introuvables" | |
58 | 063 "Impossible de verrouiller le fichier de récupération" | 57 | 063 "Impossible de verrouiller le fichier de récupération" | |
59 | 064 "Débordement de tampon du fichier de récupération" | 58 | 064 "Débordement de tampon du fichier de récupération" | |
60 | 065 "Fichier de récupération" | 59 | 065 "Fichier de récupération" |
--- src/dist/nvi/catalog/Attic/german.base 2008/05/16 18:03:06 1.1.1.1
+++ src/dist/nvi/catalog/Attic/german.base 2008/10/01 21:20:09 1.2
@@ -33,28 +33,27 @@ | @@ -33,28 +33,27 @@ | |||
33 | 034 "set: der [no]%s Option kann kein Wert zugewiesen werden" | 33 | 034 "set: der [no]%s Option kann kein Wert zugewiesen werden" | |
34 | 035 "set: %s ist keine Boolsche Option" | 34 | 035 "set: %s ist keine Boolsche Option" | |
35 | 036 "set: %s Option: %s" | 35 | 036 "set: %s Option: %s" | |
36 | 037 "set: %s Option: %s: Werte-Überlauf" | 36 | 037 "set: %s Option: %s: Werte-Überlauf" | |
37 | 038 "set: %s Option: %s ist eine ungültige Zahl" | 37 | 038 "set: %s Option: %s ist eine ungültige Zahl" | |
38 | 039 "set: %s ist keine Boolsche Option" | 38 | 039 "set: %s ist keine Boolsche Option" | |
39 | 040 "Bildschirm hat zu wenig Spalten, weniger als %d" | 39 | 040 "Bildschirm hat zu wenig Spalten, weniger als %d" | |
40 | 041 "Bildschirm hat zu viele Spalten, mehr als %d" | 40 | 041 "Bildschirm hat zu viele Spalten, mehr als %d" | |
41 | 042 "Bildschirm hat zu wenig Zeilen, weniger als %d" | 41 | 042 "Bildschirm hat zu wenig Zeilen, weniger als %d" | |
42 | 043 "Bildschirm hat zu viele Zeilen, mehr als %d" | 42 | 043 "Bildschirm hat zu viele Zeilen, mehr als %d" | |
43 | 044 "Die lisp-Option ist nicht implementiert" | 43 | 044 "Die lisp-Option ist nicht implementiert" | |
44 | 045 "Meldungen nicht abgeschaltet: %s" | 44 | 045 "Meldungen nicht abgeschaltet: %s" | |
45 | 046 "Meldungen nicht eingeschaltet: %s" | 45 | 046 "Meldungen nicht eingeschaltet: %s" | |
46 | 048 "Die paragraph-Option muß Gruppen zu zwei Zeichen enthalten" | 46 | 047 "set: Die %s Option muss Gruppen zu zwei Zeichen enthalten" | |
47 | 049 "Die section-Option muß Gruppen zu zwei Zeichen enthalten" | |||
48 | 053 "Der Standardpuffer ist leer" | 47 | 053 "Der Standardpuffer ist leer" | |
49 | 054 "Puffer %s ist leer" | 48 | 054 "Puffer %s ist leer" | |
50 | 055 "Dateien mit newlines im Namen sind nicht wiederherstellbar" | 49 | 055 "Dateien mit newlines im Namen sind nicht wiederherstellbar" | |
51 | 056 "Änderungen nicht wiederherstellbar, falls die Editorsitzung schiefgeht" | 50 | 056 "Änderungen nicht wiederherstellbar, falls die Editorsitzung schiefgeht" | |
52 | 057 "kopiere Datei für Wiederherstellung ..." | 51 | 057 "kopiere Datei für Wiederherstellung ..." | |
53 | 058 "Rettungsmechanismus funktioniert nicht: %s" | 52 | 058 "Rettungsmechanismus funktioniert nicht: %s" | |
54 | 059 "Änderungen nicht wiederherstellbar, falls die Editorsitzung schiefgeht" | 53 | 059 "Änderungen nicht wiederherstellbar, falls die Editorsitzung schiefgeht" | |
55 | 060 "Sicherung der Datei gescheitert: %s" | 54 | 060 "Sicherung der Datei gescheitert: %s" | |
56 | 061 "kopiere Datei für Wiederherstellung ..." | 55 | 061 "kopiere Datei für Wiederherstellung ..." | |
57 | 062 "Informationen über den Benutzer mit id %u nicht gefunden" | 56 | 062 "Informationen über den Benutzer mit id %u nicht gefunden" | |
58 | 063 "Wiederherstellungsdatei kann nicht gelockt werden" | 57 | 063 "Wiederherstellungsdatei kann nicht gelockt werden" | |
59 | 064 "Puffer der Wiederherstellungsdatei übergelaufen" | 58 | 064 "Puffer der Wiederherstellungsdatei übergelaufen" | |
60 | 065 "Wiederherstellungsdatei" | 59 | 065 "Wiederherstellungsdatei" |
--- src/dist/nvi/catalog/Attic/spanish.base 2008/05/16 18:03:07 1.1.1.1
+++ src/dist/nvi/catalog/Attic/spanish.base 2008/10/01 21:20:09 1.2
@@ -33,28 +33,27 @@ | @@ -33,28 +33,27 @@ | |||
33 | 034 "determinar: [no] hay opci¢n %s no tiene valor" | 33 | 034 "determinar: [no] hay opci¢n %s no tiene valor" | |
34 | 035 "determinar: opci¢n %s no es booleano" | 34 | 035 "determinar: opci¢n %s no es booleano" | |
35 | 036 "determinar: opci¢n %s: %s" | 35 | 036 "determinar: opci¢n %s: %s" | |
36 | 037 "determinar: opci¢n %s: %s: desbordamiento de valores" | 36 | 037 "determinar: opci¢n %s: %s: desbordamiento de valores" | |
37 | 038 "determinar: opci¢n %s: %s es un n£mero ilegal" | 37 | 038 "determinar: opci¢n %s: %s es un n£mero ilegal" | |
38 | 039 "determinar: opci¢n %s no es booleano" | 38 | 039 "determinar: opci¢n %s no es booleano" | |
39 | 040 "Las columnas en pantalla son demasiado peque¤as, menos de %d" | 39 | 040 "Las columnas en pantalla son demasiado peque¤as, menos de %d" | |
40 | 041 "Las columnas en pantalla son demasiado grandes, m s de %d" | 40 | 041 "Las columnas en pantalla son demasiado grandes, m s de %d" | |
41 | 042 "Las l¡neas en pantalla son demasiado peque¤as, menos de %d" | 41 | 042 "Las l¡neas en pantalla son demasiado peque¤as, menos de %d" | |
42 | 043 "Las l¡neas en pantalla son demasiado grandes, m s de %d" | 42 | 043 "Las l¡neas en pantalla son demasiado grandes, m s de %d" | |
43 | 044 "La opci¢n lisp no est implementada" | 43 | 044 "La opci¢n lisp no est implementada" | |
44 | 045 "mensajes no desconectados: %s" | 44 | 045 "mensajes no desconectados: %s" | |
45 | 046 "mensajes no conectados: %s" | 45 | 046 "mensajes no conectados: %s" | |
46 | 048 "La opci¢n de p rrafo debe estar en dos grupos de caracteres" | 46 | 047 "determinar: La opci¢n de %s debe estar en dos grupos de caracteres" | |
47 | 049 "La opci¢n de secci¢n debe estar en dos grupos de caracteres" | |||
48 | 053 "El buffer por omisi¢n est vac¡o" | 47 | 053 "El buffer por omisi¢n est vac¡o" | |
49 | 054 "El buffer %s est vac¡o" | 48 | 054 "El buffer %s est vac¡o" | |
50 | 055 "Los archivos con nuevas l¡neas en el nombre son irrecuperables" | 49 | 055 "Los archivos con nuevas l¡neas en el nombre son irrecuperables" | |
51 | 056 "Las modificaciones no pueden recuperarse si la sesi¢n falla" | 50 | 056 "Las modificaciones no pueden recuperarse si la sesi¢n falla" | |
52 | 057 "Copiando archivo para recuperaci¢n..." | 51 | 057 "Copiando archivo para recuperaci¢n..." | |
53 | 058 "Preservaci¢n fracasada: %s" | 52 | 058 "Preservaci¢n fracasada: %s" | |
54 | 059 "Las modificaciones no pueden recuperarse si la sesi¢n falla" | 53 | 059 "Las modificaciones no pueden recuperarse si la sesi¢n falla" | |
55 | 060 "Archivo de respaldo fracasado: %s" | 54 | 060 "Archivo de respaldo fracasado: %s" | |
56 | 061 "Copiando archivo para recuperaci¢n..." | 55 | 061 "Copiando archivo para recuperaci¢n..." | |
57 | 062 "Informaci¢n sobre identificaci¢n del usuario %u no encontrada" | 56 | 062 "Informaci¢n sobre identificaci¢n del usuario %u no encontrada" | |
58 | 063 "No se puede trabar archivo de recuperaci¢n" | 57 | 063 "No se puede trabar archivo de recuperaci¢n" | |
59 | 064 "Desbordamiento de buffer de archivo de recuperaci¢n" | 58 | 064 "Desbordamiento de buffer de archivo de recuperaci¢n" | |
60 | 065 "Archivo de recuperaci¢n" | 59 | 065 "Archivo de recuperaci¢n" |
--- src/dist/nvi/catalog/Attic/swedish.base 2008/05/16 18:03:08 1.1.1.1
+++ src/dist/nvi/catalog/Attic/swedish.base 2008/10/01 21:20:09 1.2
@@ -33,28 +33,27 @@ | @@ -33,28 +33,27 @@ | |||
33 | 034 "set: [no]%s flaggan kan inte ges ett värde" | 33 | 034 "set: [no]%s flaggan kan inte ges ett värde" | |
34 | 035 "set: %s flaggan är inte boleansk" | 34 | 035 "set: %s flaggan är inte boleansk" | |
35 | 036 "set: %s flaggan: %s" | 35 | 036 "set: %s flaggan: %s" | |
36 | 037 "set: %s flaggan: %s: för stort värde" | 36 | 037 "set: %s flaggan: %s: för stort värde" | |
37 | 038 "set: %s flaggan: %s är ett otillåtet tal" | 37 | 038 "set: %s flaggan: %s är ett otillåtet tal" | |
38 | 039 "set: %s flaggan är inte boleansk" | 38 | 039 "set: %s flaggan är inte boleansk" | |
39 | 040 "Fönsterkolumnerna är för få, mindre än %d" | 39 | 040 "Fönsterkolumnerna är för få, mindre än %d" | |
40 | 041 "Fönsterkolumnerna är för många, fler än %d" | 40 | 041 "Fönsterkolumnerna är för många, fler än %d" | |
41 | 042 "Fönsterraderna är för få, mindre än %d" | 41 | 042 "Fönsterraderna är för få, mindre än %d" | |
42 | 043 "Fönsterraderna är för många, fler än %d" | 42 | 043 "Fönsterraderna är för många, fler än %d" | |
43 | 044 "Lisp flaggan är inte implementerad" | 43 | 044 "Lisp flaggan är inte implementerad" | |
44 | 045 "meddelanden är inte avslagna: %s" | 44 | 045 "meddelanden är inte avslagna: %s" | |
45 | 046 "meddelanden är inte påslagna: %s" | 45 | 046 "meddelanden är inte påslagna: %s" | |
46 | 048 "Paragraph flaggan måste ges i teckengrupper om två" | 46 | 047 "set: %s flaggan måste ges i teckengrupper om två" | |
47 | 049 "Section flaggan måste ges i teckengrupper om två" | |||
48 | 053 "Standardbufferten är tom" | 47 | 053 "Standardbufferten är tom" | |
49 | 054 "Buffer %s är tom" | 48 | 054 "Buffer %s är tom" | |
50 | 055 "Filer med radmatning i namnet kan inte återskapas" | 49 | 055 "Filer med radmatning i namnet kan inte återskapas" | |
51 | 056 "Ändringar kan inte återskapas om programmet kraschar" | 50 | 056 "Ändringar kan inte återskapas om programmet kraschar" | |
52 | 057 "Kopierar filen för återskapning..." | 51 | 057 "Kopierar filen för återskapning..." | |
53 | 058 "Säkerhetskopiering misslyckades: %s" | 52 | 058 "Säkerhetskopiering misslyckades: %s" | |
54 | 059 "Ändringar kan inte återskapas om programmet kraschar" | 53 | 059 "Ändringar kan inte återskapas om programmet kraschar" | |
55 | 060 "Misslyckades att säkerhetskopiera filen: %s" | 54 | 060 "Misslyckades att säkerhetskopiera filen: %s" | |
56 | 061 "Kopierar filen för återskapning..." | 55 | 061 "Kopierar filen för återskapning..." | |
57 | 062 "Kan inte hitta information om användaridentitet %u" | 56 | 062 "Kan inte hitta information om användaridentitet %u" | |
58 | 063 "Kan inte låsa återskapningsfilen" | 57 | 063 "Kan inte låsa återskapningsfilen" | |
59 | 064 "Återskapningsfilens buffer överskriven" | 58 | 064 "Återskapningsfilens buffer överskriven" | |
60 | 065 "Återskapningsfil" | 59 | 065 "Återskapningsfil" |
--- src/dist/nvi/common/Attic/options.awk 2008/05/18 14:29:48 1.1.1.2
+++ src/dist/nvi/common/Attic/options.awk 2008/10/01 21:20:09 1.2
@@ -1,9 +1,21 @@ | @@ -1,9 +1,21 @@ | |||
1 | # Id: options.awk,v 10.1 1995/06/08 19:00:01 bostic Exp (Berkeley) Date: 1995/06/08 19:00:01 | 1 | # Id: options.awk,v 10.1 1995/06/08 19:00:01 bostic Exp (Berkeley) Date: 1995/06/08 19:00:01 | |
2 | 2 | |||
3 | /^\/\* O_[0-9A-Z_]*/ { | 3 | /^\/\* O_[0-9A-Z_]*/ { | |
4 | printf("#define %s %d\n", $2, cnt++); | 4 | opt = $2 | |
5 | next; | 5 | printf("#define %s %d\n", opt, cnt++) | |
6 | ofs = FS | |||
7 | FS="\"" | |||
8 | do getline | |||
9 | while ($1 != " {L(") | |||
10 | FS=ofs | |||
11 | opt_name = $2 | |||
12 | if (opt_name < prev_name) { | |||
13 | printf "missorted %s: \"%s\" < \"%s\"\n", opt, opt_name, prev_name >"/dev/stderr" | |||
14 | exit 1 | |||
15 | } | |||
16 | prev_name = opt_name | |||
17 | next | |||
6 | } | 18 | } | |
7 | END { | 19 | END { | |
8 | printf("#define O_OPTIONCOUNT %d\n", cnt); | 20 | printf("#define O_OPTIONCOUNT %d\n", cnt); | |
9 | } | 21 | } |
--- src/dist/nvi/common/Attic/options.c 2008/05/18 14:29:49 1.1.1.2
+++ src/dist/nvi/common/Attic/options.c 2008/10/01 21:20:09 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: options.c,v 1.1.1.2 2008/05/18 14:29:49 aymeric Exp $ */ | 1 | /* $NetBSD: options.c,v 1.2 2008/10/01 21:20:09 christos Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1991, 1993, 1994 | 4 | * Copyright (c) 1991, 1993, 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * Copyright (c) 1991, 1993, 1994, 1995, 1996 | 6 | * Copyright (c) 1991, 1993, 1994, 1995, 1996 | |
7 | * Keith Bostic. All rights reserved. | 7 | * Keith Bostic. All rights reserved. | |
8 | * | 8 | * | |
9 | * See the LICENSE file for redistribution information. | 9 | * See the LICENSE file for redistribution information. | |
10 | */ | 10 | */ | |
11 | 11 | |||
12 | #include "config.h" | 12 | #include "config.h" | |
13 | 13 | |||
14 | #ifndef lint | 14 | #ifndef lint | |
@@ -40,26 +40,28 @@ static int opts_print __P((SCR *, OPT | @@ -40,26 +40,28 @@ static int opts_print __P((SCR *, OPT | |||
40 | #ifdef USE_WIDECHAR | 40 | #ifdef USE_WIDECHAR | |
41 | #define OPT_WC 0 | 41 | #define OPT_WC 0 | |
42 | #else | 42 | #else | |
43 | #define OPT_WC (OPT_NOSAVE | OPT_NDISP) | 43 | #define OPT_WC (OPT_NOSAVE | OPT_NDISP) | |
44 | #endif | 44 | #endif | |
45 | 45 | |||
46 | /* | 46 | /* | |
47 | * O'Reilly noted options and abbreviations are from "Learning the VI Editor", | 47 | * O'Reilly noted options and abbreviations are from "Learning the VI Editor", | |
48 | * Fifth Edition, May 1992. There's no way of knowing what systems they are | 48 | * Fifth Edition, May 1992. There's no way of knowing what systems they are | |
49 | * actually from. | 49 | * actually from. | |
50 | * | 50 | * | |
51 | * HPUX noted options and abbreviations are from "The Ultimate Guide to the | 51 | * HPUX noted options and abbreviations are from "The Ultimate Guide to the | |
52 | * VI and EX Text Editors", 1990. | 52 | * VI and EX Text Editors", 1990. | |
53 | * | |||
54 | * This list must be sorted... | |||
53 | */ | 55 | */ | |
54 | OPTLIST const optlist[] = { | 56 | OPTLIST const optlist[] = { | |
55 | /* O_ALTWERASE 4.4BSD */ | 57 | /* O_ALTWERASE 4.4BSD */ | |
56 | {L("altwerase"), f_altwerase, OPT_0BOOL, 0}, | 58 | {L("altwerase"), f_altwerase, OPT_0BOOL, 0}, | |
57 | /* O_AUTOINDENT 4BSD */ | 59 | /* O_AUTOINDENT 4BSD */ | |
58 | {L("autoindent"), NULL, OPT_0BOOL, 0}, | 60 | {L("autoindent"), NULL, OPT_0BOOL, 0}, | |
59 | /* O_AUTOPRINT 4BSD */ | 61 | /* O_AUTOPRINT 4BSD */ | |
60 | {L("autoprint"), NULL, OPT_1BOOL, 0}, | 62 | {L("autoprint"), NULL, OPT_1BOOL, 0}, | |
61 | /* O_AUTOWRITE 4BSD */ | 63 | /* O_AUTOWRITE 4BSD */ | |
62 | {L("autowrite"), NULL, OPT_0BOOL, 0}, | 64 | {L("autowrite"), NULL, OPT_0BOOL, 0}, | |
63 | /* O_BACKUP 4.4BSD */ | 65 | /* O_BACKUP 4.4BSD */ | |
64 | {L("backup"), NULL, OPT_STR, 0}, | 66 | {L("backup"), NULL, OPT_STR, 0}, | |
65 | /* O_BEAUTIFY 4BSD */ | 67 | /* O_BEAUTIFY 4BSD */ | |
@@ -68,30 +70,30 @@ OPTLIST const optlist[] = { | @@ -68,30 +70,30 @@ OPTLIST const optlist[] = { | |||
68 | {L("cdpath"), NULL, OPT_STR, 0}, | 70 | {L("cdpath"), NULL, OPT_STR, 0}, | |
69 | /* O_CEDIT 4.4BSD */ | 71 | /* O_CEDIT 4.4BSD */ | |
70 | {L("cedit"), NULL, OPT_STR, 0}, | 72 | {L("cedit"), NULL, OPT_STR, 0}, | |
71 | /* O_COLUMNS 4.4BSD */ | 73 | /* O_COLUMNS 4.4BSD */ | |
72 | {L("columns"), f_columns, OPT_NUM, OPT_NOSAVE}, | 74 | {L("columns"), f_columns, OPT_NUM, OPT_NOSAVE}, | |
73 | /* O_COMBINED */ | 75 | /* O_COMBINED */ | |
74 | {L("combined"), NULL, OPT_0BOOL, OPT_NOSET|OPT_WC}, | 76 | {L("combined"), NULL, OPT_0BOOL, OPT_NOSET|OPT_WC}, | |
75 | /* O_COMMENT 4.4BSD */ | 77 | /* O_COMMENT 4.4BSD */ | |
76 | {L("comment"), NULL, OPT_0BOOL, 0}, | 78 | {L("comment"), NULL, OPT_0BOOL, 0}, | |
77 | /* O_TMP_DIRECTORY 4BSD */ | 79 | /* O_TMP_DIRECTORY 4BSD */ | |
78 | {L("directory"), NULL, OPT_STR, 0}, | 80 | {L("directory"), NULL, OPT_STR, 0}, | |
79 | /* O_EDCOMPATIBLE 4BSD */ | 81 | /* O_EDCOMPATIBLE 4BSD */ | |
80 | {L("edcompatible"),NULL, OPT_0BOOL, 0}, | 82 | {L("edcompatible"),NULL, OPT_0BOOL, 0}, | |
81 | /* O_ESCAPETIME 4.4BSD */ | |||
82 | {L("escapetime"), NULL, OPT_NUM, 0}, | |||
83 | /* O_ERRORBELLS 4BSD */ | 83 | /* O_ERRORBELLS 4BSD */ | |
84 | {L("errorbells"), NULL, OPT_0BOOL, 0}, | 84 | {L("errorbells"), NULL, OPT_0BOOL, 0}, | |
85 | /* O_ESCAPETIME 4.4BSD */ | |||
86 | {L("escapetime"), NULL, OPT_NUM, 0}, | |||
85 | /* O_EXRC System V (undocumented) */ | 87 | /* O_EXRC System V (undocumented) */ | |
86 | {L("exrc"), NULL, OPT_0BOOL, 0}, | 88 | {L("exrc"), NULL, OPT_0BOOL, 0}, | |
87 | /* O_EXTENDED 4.4BSD */ | 89 | /* O_EXTENDED 4.4BSD */ | |
88 | {L("extended"), f_recompile, OPT_0BOOL, 0}, | 90 | {L("extended"), f_recompile, OPT_0BOOL, 0}, | |
89 | /* O_FILEC 4.4BSD */ | 91 | /* O_FILEC 4.4BSD */ | |
90 | {L("filec"), NULL, OPT_STR, 0}, | 92 | {L("filec"), NULL, OPT_STR, 0}, | |
91 | /* O_FILEENCODING */ | 93 | /* O_FILEENCODING */ | |
92 | {L("fileencoding"),f_encoding, OPT_STR, OPT_WC}, | 94 | {L("fileencoding"),f_encoding, OPT_STR, OPT_WC}, | |
93 | /* O_FLASH HPUX */ | 95 | /* O_FLASH HPUX */ | |
94 | {L("flash"), NULL, OPT_1BOOL, 0}, | 96 | {L("flash"), NULL, OPT_1BOOL, 0}, | |
95 | /* O_HARDTABS 4BSD */ | 97 | /* O_HARDTABS 4BSD */ | |
96 | {L("hardtabs"), NULL, OPT_NUM, 0}, | 98 | {L("hardtabs"), NULL, OPT_NUM, 0}, | |
97 | /* O_ICLOWER 4.4BSD */ | 99 | /* O_ICLOWER 4.4BSD */ | |
@@ -112,77 +114,79 @@ OPTLIST const optlist[] = { | @@ -112,77 +114,79 @@ OPTLIST const optlist[] = { | |||
112 | * so that :mkexrc dumps it. | 114 | * so that :mkexrc dumps it. | |
113 | */ | 115 | */ | |
114 | {L("lisp"), f_lisp, OPT_0BOOL, OPT_NOSAVE}, | 116 | {L("lisp"), f_lisp, OPT_0BOOL, OPT_NOSAVE}, | |
115 | /* O_LIST 4BSD */ | 117 | /* O_LIST 4BSD */ | |
116 | {L("list"), f_reformat, OPT_0BOOL, 0}, | 118 | {L("list"), f_reformat, OPT_0BOOL, 0}, | |
117 | /* O_LOCKFILES 4.4BSD | 119 | /* O_LOCKFILES 4.4BSD | |
118 | * XXX | 120 | * XXX | |
119 | * Locking isn't reliable enough over NFS to require it, in addition, | 121 | * Locking isn't reliable enough over NFS to require it, in addition, | |
120 | * it's a serious startup performance problem over some remote links. | 122 | * it's a serious startup performance problem over some remote links. | |
121 | */ | 123 | */ | |
122 | {L("lock"), NULL, OPT_1BOOL, 0}, | 124 | {L("lock"), NULL, OPT_1BOOL, 0}, | |
123 | /* O_MAGIC 4BSD */ | 125 | /* O_MAGIC 4BSD */ | |
124 | {L("magic"), NULL, OPT_1BOOL, 0}, | 126 | {L("magic"), NULL, OPT_1BOOL, 0}, | |
127 | /* O_MATCHCHARS netbsd 2.0 */ | |||
128 | {L("matchchars"), NULL, OPT_STR, OPT_PAIRS}, | |||
125 | /* O_MATCHTIME 4.4BSD */ | 129 | /* O_MATCHTIME 4.4BSD */ | |
126 | {L("matchtime"), NULL, OPT_NUM, 0}, | 130 | {L("matchtime"), NULL, OPT_NUM, 0}, | |
127 | /* O_MESG 4BSD */ | 131 | /* O_MESG 4BSD */ | |
128 | {L("mesg"), NULL, OPT_1BOOL, 0}, | 132 | {L("mesg"), NULL, OPT_1BOOL, 0}, | |
129 | /* O_MODELINE 4BSD | 133 | /* O_MODELINE 4BSD | |
130 | * !!! | 134 | * !!! | |
131 | * This has been documented in historical systems as both "modeline" | 135 | * This has been documented in historical systems as both "modeline" | |
132 | * and as "modelines". Regardless of the name, this option represents | 136 | * and as "modelines". Regardless of the name, this option represents | |
133 | * a security problem of mammoth proportions, not to mention a stunning | 137 | * a security problem of mammoth proportions, not to mention a stunning | |
134 | * example of what your intro CS professor referred to as the perils of | 138 | * example of what your intro CS professor referred to as the perils of | |
135 | * mixing code and data. Don't add it, or I will kill you. | 139 | * mixing code and data. Don't add it, or I will kill you. | |
136 | */ | 140 | */ | |
137 | {L("modeline"), NULL, OPT_0BOOL, OPT_NOSET}, | 141 | {L("modeline"), NULL, OPT_0BOOL, OPT_NOSET}, | |
138 | /* O_MSGCAT 4.4BSD */ | 142 | /* O_MSGCAT 4.4BSD */ | |
139 | {L("msgcat"), f_msgcat, OPT_STR, 0}, | 143 | {L("msgcat"), f_msgcat, OPT_STR, 0}, | |
140 | /* O_NOPRINT 4.4BSD */ | 144 | /* O_NOPRINT 4.4BSD */ | |
141 | {L("noprint"), f_print, OPT_STR, 0}, | 145 | {L("noprint"), f_print, OPT_STR, 0}, | |
142 | /* O_NUMBER 4BSD */ | 146 | /* O_NUMBER 4BSD */ | |
143 | {L("number"), f_reformat, OPT_0BOOL, 0}, | 147 | {L("number"), f_reformat, OPT_0BOOL, 0}, | |
144 | /* O_OCTAL 4.4BSD */ | 148 | /* O_OCTAL 4.4BSD */ | |
145 | {L("octal"), f_print, OPT_0BOOL, 0}, | 149 | {L("octal"), f_print, OPT_0BOOL, 0}, | |
146 | /* O_OPEN 4BSD */ | 150 | /* O_OPEN 4BSD */ | |
147 | {L("open"), NULL, OPT_1BOOL, 0}, | 151 | {L("open"), NULL, OPT_1BOOL, 0}, | |
148 | /* O_OPTIMIZE 4BSD */ | 152 | /* O_OPTIMIZE 4BSD */ | |
149 | {L("optimize"), NULL, OPT_1BOOL, 0}, | 153 | {L("optimize"), NULL, OPT_1BOOL, 0}, | |
150 | /* O_PARAGRAPHS 4BSD */ | 154 | /* O_PARAGRAPHS 4BSD */ | |
151 | {L("paragraphs"), f_paragraph, OPT_STR, 0}, | 155 | {L("paragraphs"), NULL, OPT_STR, OPT_PAIRS}, | |
152 | /* O_PATH 4.4BSD */ | 156 | /* O_PATH 4.4BSD */ | |
153 | {L("path"), NULL, OPT_STR, 0}, | 157 | {L("path"), NULL, OPT_STR, 0}, | |
154 | /* O_PRINT 4.4BSD */ | 158 | /* O_PRINT 4.4BSD */ | |
155 | {L("print"), f_print, OPT_STR, 0}, | 159 | {L("print"), f_print, OPT_STR, 0}, | |
156 | /* O_PROMPT 4BSD */ | 160 | /* O_PROMPT 4BSD */ | |
157 | {L("prompt"), NULL, OPT_1BOOL, 0}, | 161 | {L("prompt"), NULL, OPT_1BOOL, 0}, | |
158 | /* O_READONLY 4BSD (undocumented) */ | 162 | /* O_READONLY 4BSD (undocumented) */ | |
159 | {L("readonly"), f_readonly, OPT_0BOOL, OPT_ALWAYS}, | 163 | {L("readonly"), f_readonly, OPT_0BOOL, OPT_ALWAYS}, | |
160 | /* O_RECDIR 4.4BSD */ | 164 | /* O_RECDIR 4.4BSD */ | |
161 | {L("recdir"), NULL, OPT_STR, 0}, | 165 | {L("recdir"), NULL, OPT_STR, 0}, | |
162 | /* O_REDRAW 4BSD */ | 166 | /* O_REDRAW 4BSD */ | |
163 | {L("redraw"), NULL, OPT_0BOOL, 0}, | 167 | {L("redraw"), NULL, OPT_0BOOL, 0}, | |
164 | /* O_REMAP 4BSD */ | 168 | /* O_REMAP 4BSD */ | |
165 | {L("remap"), NULL, OPT_1BOOL, 0}, | 169 | {L("remap"), NULL, OPT_1BOOL, 0}, | |
166 | /* O_REPORT 4BSD */ | 170 | /* O_REPORT 4BSD */ | |
167 | {L("report"), NULL, OPT_NUM, 0}, | 171 | {L("report"), NULL, OPT_NUM, 0}, | |
168 | /* O_RULER 4.4BSD */ | 172 | /* O_RULER 4.4BSD */ | |
169 | {L("ruler"), NULL, OPT_0BOOL, 0}, | 173 | {L("ruler"), NULL, OPT_0BOOL, 0}, | |
170 | /* O_SCROLL 4BSD */ | 174 | /* O_SCROLL 4BSD */ | |
171 | {L("scroll"), NULL, OPT_NUM, 0}, | 175 | {L("scroll"), NULL, OPT_NUM, 0}, | |
172 | /* O_SEARCHINCR 4.4BSD */ | 176 | /* O_SEARCHINCR 4.4BSD */ | |
173 | {L("searchincr"), NULL, OPT_0BOOL, 0}, | 177 | {L("searchincr"), NULL, OPT_0BOOL, 0}, | |
174 | /* O_SECTIONS 4BSD */ | 178 | /* O_SECTIONS 4BSD */ | |
175 | {L("sections"), f_section, OPT_STR, 0}, | 179 | {L("sections"), NULL, OPT_STR, OPT_PAIRS}, | |
176 | /* O_SECURE 4.4BSD */ | 180 | /* O_SECURE 4.4BSD */ | |
177 | {L("secure"), NULL, OPT_0BOOL, OPT_NOUNSET}, | 181 | {L("secure"), NULL, OPT_0BOOL, OPT_NOUNSET}, | |
178 | /* O_SHELL 4BSD */ | 182 | /* O_SHELL 4BSD */ | |
179 | {L("shell"), NULL, OPT_STR, 0}, | 183 | {L("shell"), NULL, OPT_STR, 0}, | |
180 | /* O_SHELLMETA 4.4BSD */ | 184 | /* O_SHELLMETA 4.4BSD */ | |
181 | {L("shellmeta"), NULL, OPT_STR, 0}, | 185 | {L("shellmeta"), NULL, OPT_STR, 0}, | |
182 | /* O_SHIFTWIDTH 4BSD */ | 186 | /* O_SHIFTWIDTH 4BSD */ | |
183 | {L("shiftwidth"), NULL, OPT_NUM, OPT_NOZERO}, | 187 | {L("shiftwidth"), NULL, OPT_NUM, OPT_NOZERO}, | |
184 | /* O_SHOWMATCH 4BSD */ | 188 | /* O_SHOWMATCH 4BSD */ | |
185 | {L("showmatch"), NULL, OPT_0BOOL, 0}, | 189 | {L("showmatch"), NULL, OPT_0BOOL, 0}, | |
186 | /* O_SHOWMODE 4.4BSD */ | 190 | /* O_SHOWMODE 4.4BSD */ | |
187 | {L("showmode"), NULL, OPT_0BOOL, 0}, | 191 | {L("showmode"), NULL, OPT_0BOOL, 0}, | |
188 | /* O_SIDESCROLL 4.4BSD */ | 192 | /* O_SIDESCROLL 4.4BSD */ | |
@@ -299,26 +303,33 @@ static OABBREV const abbrev[] = { | @@ -299,26 +303,33 @@ static OABBREV const abbrev[] = { | |||
299 | */ | 303 | */ | |
300 | int | 304 | int | |
301 | opts_init(SCR *sp, int *oargs) | 305 | opts_init(SCR *sp, int *oargs) | |
302 | { | 306 | { | |
303 | ARGS *argv[2], a, b; | 307 | ARGS *argv[2], a, b; | |
304 | OPTLIST const *op; | 308 | OPTLIST const *op; | |
305 | u_long isset, v; | 309 | u_long isset, v; | |
306 | int cnt, optindx; | 310 | int cnt, optindx; | |
307 | char *s; | 311 | char *s; | |
308 | CHAR_T b2[1024]; | 312 | CHAR_T b2[1024]; | |
309 | CHAR_T *wp; | 313 | CHAR_T *wp; | |
310 | size_t wlen; | 314 | size_t wlen; | |
311 | 315 | |||
316 | if (sizeof optlist / sizeof optlist[0] - 1 != O_OPTIONCOUNT) { | |||
317 | fprintf(stderr, "vi: option table size error (%d != %d)\n", | |||
318 | (int)(sizeof optlist / sizeof optlist[0] - 1), | |||
319 | O_OPTIONCOUNT); | |||
320 | exit(1); | |||
321 | } | |||
322 | ||||
312 | a.bp = b2; | 323 | a.bp = b2; | |
313 | b.bp = NULL; | 324 | b.bp = NULL; | |
314 | a.len = b.len = 0; | 325 | a.len = b.len = 0; | |
315 | argv[0] = &a; | 326 | argv[0] = &a; | |
316 | argv[1] = &b; | 327 | argv[1] = &b; | |
317 | 328 | |||
318 | /* Set numeric and string default values. */ | 329 | /* Set numeric and string default values. */ | |
319 | #define OI(indx, str) { \ | 330 | #define OI(indx, str) { \ | |
320 | a.len = STRLEN(str); \ | 331 | a.len = STRLEN(str); \ | |
321 | if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ | 332 | if ((CHAR_T*)str != b2) /* GCC puts strings in text-space. */ \ | |
322 | (void)MEMCPY(b2, str, a.len+1); \ | 333 | (void)MEMCPY(b2, str, a.len+1); \ | |
323 | if (opts_set(sp, argv, NULL)) { \ | 334 | if (opts_set(sp, argv, NULL)) { \ | |
324 | optindx = indx; \ | 335 | optindx = indx; \ | |
@@ -350,26 +361,27 @@ opts_init(SCR *sp, int *oargs) | @@ -350,26 +361,27 @@ opts_init(SCR *sp, int *oargs) | |||
350 | 361 | |||
351 | /* | 362 | /* | |
352 | * !!! | 363 | * !!! | |
353 | * Vi historically stored temporary files in /var/tmp. We store them | 364 | * Vi historically stored temporary files in /var/tmp. We store them | |
354 | * in /tmp by default, hoping it's a memory based file system. There | 365 | * in /tmp by default, hoping it's a memory based file system. There | |
355 | * are two ways to change this -- the user can set either the directory | 366 | * are two ways to change this -- the user can set either the directory | |
356 | * option or the TMPDIR environmental variable. | 367 | * option or the TMPDIR environmental variable. | |
357 | */ | 368 | */ | |
358 | (void)SPRINTF(b2, SIZE(b2), | 369 | (void)SPRINTF(b2, SIZE(b2), | |
359 | L("directory=%s"), (s = getenv("TMPDIR")) == NULL ? _PATH_TMP : s); | 370 | L("directory=%s"), (s = getenv("TMPDIR")) == NULL ? _PATH_TMP : s); | |
360 | OI(O_TMP_DIRECTORY, b2); | 371 | OI(O_TMP_DIRECTORY, b2); | |
361 | OI(O_ESCAPETIME, L("escapetime=1")); | 372 | OI(O_ESCAPETIME, L("escapetime=1")); | |
362 | OI(O_KEYTIME, L("keytime=6")); | 373 | OI(O_KEYTIME, L("keytime=6")); | |
374 | OI(O_MATCHCHARS, L("matchchars=()[]{}<>")); | |||
363 | OI(O_MATCHTIME, L("matchtime=7")); | 375 | OI(O_MATCHTIME, L("matchtime=7")); | |
364 | (void)SPRINTF(b2, SIZE(b2), L("msgcat=%s"), _PATH_MSGCAT); | 376 | (void)SPRINTF(b2, SIZE(b2), L("msgcat=%s"), _PATH_MSGCAT); | |
365 | OI(O_MSGCAT, b2); | 377 | OI(O_MSGCAT, b2); | |
366 | OI(O_REPORT, L("report=5")); | 378 | OI(O_REPORT, L("report=5")); | |
367 | OI(O_PARAGRAPHS, L("paragraphs=IPLPPPQPP LIpplpipbp")); | 379 | OI(O_PARAGRAPHS, L("paragraphs=IPLPPPQPP LIpplpipbp")); | |
368 | (void)SPRINTF(b2, SIZE(b2), L("path=%s"), ""); | 380 | (void)SPRINTF(b2, SIZE(b2), L("path=%s"), ""); | |
369 | OI(O_PATH, b2); | 381 | OI(O_PATH, b2); | |
370 | (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), _PATH_PRESERVE); | 382 | (void)SPRINTF(b2, SIZE(b2), L("recdir=%s"), _PATH_PRESERVE); | |
371 | OI(O_RECDIR, b2); | 383 | OI(O_RECDIR, b2); | |
372 | OI(O_SECTIONS, L("sections=NHSHH HUnhsh")); | 384 | OI(O_SECTIONS, L("sections=NHSHH HUnhsh")); | |
373 | (void)SPRINTF(b2, SIZE(b2), | 385 | (void)SPRINTF(b2, SIZE(b2), | |
374 | L("shell=%s"), (s = getenv("SHELL")) == NULL ? _PATH_BSHELL : s); | 386 | L("shell=%s"), (s = getenv("SHELL")) == NULL ? _PATH_BSHELL : s); | |
375 | OI(O_SHELL, b2); | 387 | OI(O_SHELL, b2); | |
@@ -700,26 +712,34 @@ badnum: INT2CHAR(sp, name, STRLEN(nam | @@ -700,26 +712,34 @@ badnum: INT2CHAR(sp, name, STRLEN(nam | |||
700 | if (turnoff) { | 712 | if (turnoff) { | |
701 | msgq_wstr(sp, M_ERR, name, | 713 | msgq_wstr(sp, M_ERR, name, | |
702 | "039|set: %s option isn't a boolean"); | 714 | "039|set: %s option isn't a boolean"); | |
703 | rval = 1; | 715 | rval = 1; | |
704 | break; | 716 | break; | |
705 | } | 717 | } | |
706 | if (qmark || !equals) { | 718 | if (qmark || !equals) { | |
707 | if (!disp) | 719 | if (!disp) | |
708 | disp = SELECT_DISPLAY; | 720 | disp = SELECT_DISPLAY; | |
709 | F_SET(spo, OPT_SELECTED); | 721 | F_SET(spo, OPT_SELECTED); | |
710 | break; | 722 | break; | |
711 | } | 723 | } | |
712 | 724 | |||
725 | /* Check for strings that must have even length */ | |||
726 | if (F_ISSET(op, OPT_PAIRS) && STRLEN(sep) & 1) { | |||
727 | msgq_wstr(sp, M_ERR, name, | |||
728 | "047|set: the %s option must be in two character groups"); | |||
729 | rval = 1; | |||
730 | break; | |||
731 | } | |||
732 | ||||
713 | /* | 733 | /* | |
714 | * Do nothing if the value is unchanged, the underlying | 734 | * Do nothing if the value is unchanged, the underlying | |
715 | * functions can be expensive. | 735 | * functions can be expensive. | |
716 | */ | 736 | */ | |
717 | INT2CHAR(sp, sep, STRLEN(sep) + 1, np, nlen); | 737 | INT2CHAR(sp, sep, STRLEN(sep) + 1, np, nlen); | |
718 | if (!F_ISSET(op, OPT_ALWAYS) && | 738 | if (!F_ISSET(op, OPT_ALWAYS) && | |
719 | O_STR(sp, offset) != NULL && | 739 | O_STR(sp, offset) != NULL && | |
720 | !strcmp(O_STR(sp, offset), np)) | 740 | !strcmp(O_STR(sp, offset), np)) | |
721 | break; | 741 | break; | |
722 | 742 | |||
723 | /* Report to subsystems. */ | 743 | /* Report to subsystems. */ | |
724 | if (op->func != NULL && | 744 | if (op->func != NULL && | |
725 | op->func(sp, spo, np, NULL) || | 745 | op->func(sp, spo, np, NULL) || |
--- src/dist/nvi/common/Attic/options.h 2008/05/18 14:29:49 1.1.1.2
+++ src/dist/nvi/common/Attic/options.h 2008/10/01 21:20:09 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: options.h,v 1.1.1.2 2008/05/18 14:29:49 aymeric Exp $ */ | 1 | /* $NetBSD: options.h,v 1.2 2008/10/01 21:20:09 christos Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1991, 1993, 1994 | 4 | * Copyright (c) 1991, 1993, 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * Copyright (c) 1991, 1993, 1994, 1995, 1996 | 6 | * Copyright (c) 1991, 1993, 1994, 1995, 1996 | |
7 | * Keith Bostic. All rights reserved. | 7 | * Keith Bostic. All rights reserved. | |
8 | * | 8 | * | |
9 | * See the LICENSE file for redistribution information. | 9 | * See the LICENSE file for redistribution information. | |
10 | * | 10 | * | |
11 | * Id: options.h,v 10.20 2001/06/09 18:26:28 skimo Exp (Berkeley) Date: 2001/06/09 18:26:28 | 11 | * Id: options.h,v 10.20 2001/06/09 18:26:28 skimo Exp (Berkeley) Date: 2001/06/09 18:26:28 | |
12 | */ | 12 | */ | |
13 | 13 | |||
14 | /* | 14 | /* | |
@@ -81,23 +81,24 @@ struct _optlist { | @@ -81,23 +81,24 @@ struct _optlist { | |||
81 | CHAR_T *name; /* Name. */ | 81 | CHAR_T *name; /* Name. */ | |
82 | /* Change function. */ | 82 | /* Change function. */ | |
83 | int (*func) __P((SCR *, OPTION *, char *, u_long *)); | 83 | int (*func) __P((SCR *, OPTION *, char *, u_long *)); | |
84 | /* Type of object. */ | 84 | /* Type of object. */ | |
85 | enum { OPT_0BOOL, OPT_1BOOL, OPT_NUM, OPT_STR } type; | 85 | enum { OPT_0BOOL, OPT_1BOOL, OPT_NUM, OPT_STR } type; | |
86 | 86 | |||
87 | #define OPT_ADISP 0x001 /* Always display the option. */ | 87 | #define OPT_ADISP 0x001 /* Always display the option. */ | |
88 | #define OPT_ALWAYS 0x002 /* Always call the support function. */ | 88 | #define OPT_ALWAYS 0x002 /* Always call the support function. */ | |
89 | #define OPT_NDISP 0x004 /* Never display the option. */ | 89 | #define OPT_NDISP 0x004 /* Never display the option. */ | |
90 | #define OPT_NOSAVE 0x008 /* Mkexrc command doesn't save. */ | 90 | #define OPT_NOSAVE 0x008 /* Mkexrc command doesn't save. */ | |
91 | #define OPT_NOSET 0x010 /* Option may not be set. */ | 91 | #define OPT_NOSET 0x010 /* Option may not be set. */ | |
92 | #define OPT_NOUNSET 0x020 /* Option may not be unset. */ | 92 | #define OPT_NOUNSET 0x020 /* Option may not be unset. */ | |
93 | #define OPT_NOZERO 0x040 /* Option may not be set to 0. */ | 93 | #define OPT_NOZERO 0x040 /* Option may not be set to 0. */ | |
94 | #define OPT_PAIRS 0x080 /* String with even length */ | |||
94 | u_int8_t flags; | 95 | u_int8_t flags; | |
95 | }; | 96 | }; | |
96 | 97 | |||
97 | /* Option argument to opts_dump(). */ | 98 | /* Option argument to opts_dump(). */ | |
98 | enum optdisp { NO_DISPLAY, ALL_DISPLAY, CHANGED_DISPLAY, SELECT_DISPLAY }; | 99 | enum optdisp { NO_DISPLAY, ALL_DISPLAY, CHANGED_DISPLAY, SELECT_DISPLAY }; | |
99 | 100 | |||
100 | /* Options array. */ | 101 | /* Options array. */ | |
101 | extern OPTLIST const optlist[]; | 102 | extern OPTLIST const optlist[]; | |
102 | 103 | |||
103 | #include "options_def.h" | 104 | #include "options_def.h" |
--- src/dist/nvi/common/Attic/options_f.c 2008/05/18 14:29:50 1.1.1.2
+++ src/dist/nvi/common/Attic/options_f.c 2008/10/01 21:20:09 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: options_f.c,v 1.1.1.2 2008/05/18 14:29:50 aymeric Exp $ */ | 1 | /* $NetBSD: options_f.c,v 1.2 2008/10/01 21:20:09 christos Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1993, 1994 | 4 | * Copyright (c) 1993, 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * Copyright (c) 1993, 1994, 1995, 1996 | 6 | * Copyright (c) 1993, 1994, 1995, 1996 | |
7 | * Keith Bostic. All rights reserved. | 7 | * Keith Bostic. All rights reserved. | |
8 | * | 8 | * | |
9 | * See the LICENSE file for redistribution information. | 9 | * See the LICENSE file for redistribution information. | |
10 | */ | 10 | */ | |
11 | 11 | |||
12 | #include "config.h" | 12 | #include "config.h" | |
13 | 13 | |||
14 | #ifndef lint | 14 | #ifndef lint | |
@@ -52,27 +52,27 @@ f_columns(SCR *sp, OPTION *op, char *str | @@ -52,27 +52,27 @@ f_columns(SCR *sp, OPTION *op, char *str | |||
52 | msgq(sp, M_ERR, "040|Screen columns too small, less than %d", | 52 | msgq(sp, M_ERR, "040|Screen columns too small, less than %d", | |
53 | MINIMUM_SCREEN_COLS); | 53 | MINIMUM_SCREEN_COLS); | |
54 | return (1); | 54 | return (1); | |
55 | } | 55 | } | |
56 | 56 | |||
57 | /* | 57 | /* | |
58 | * !!! | 58 | * !!! | |
59 | * It's not uncommon for allocation of huge chunks of memory to cause | 59 | * It's not uncommon for allocation of huge chunks of memory to cause | |
60 | * core dumps on various systems. So, we prune out numbers that are | 60 | * core dumps on various systems. So, we prune out numbers that are | |
61 | * "obviously" wrong. Vi will not work correctly if it has the wrong | 61 | * "obviously" wrong. Vi will not work correctly if it has the wrong | |
62 | * number of lines/columns for the screen, but at least we don't drop | 62 | * number of lines/columns for the screen, but at least we don't drop | |
63 | * core. | 63 | * core. | |
64 | */ | 64 | */ | |
65 | #define MAXIMUM_SCREEN_COLS 500 | 65 | #define MAXIMUM_SCREEN_COLS 4000 | |
66 | if (*valp > MAXIMUM_SCREEN_COLS) { | 66 | if (*valp > MAXIMUM_SCREEN_COLS) { | |
67 | msgq(sp, M_ERR, "041|Screen columns too large, greater than %d", | 67 | msgq(sp, M_ERR, "041|Screen columns too large, greater than %d", | |
68 | MAXIMUM_SCREEN_COLS); | 68 | MAXIMUM_SCREEN_COLS); | |
69 | return (1); | 69 | return (1); | |
70 | } | 70 | } | |
71 | return (0); | 71 | return (0); | |
72 | } | 72 | } | |
73 | 73 | |||
74 | /* | 74 | /* | |
75 | * PUBLIC: int f_lines __P((SCR *, OPTION *, char *, u_long *)); | 75 | * PUBLIC: int f_lines __P((SCR *, OPTION *, char *, u_long *)); | |
76 | */ | 76 | */ | |
77 | int | 77 | int | |
78 | f_lines(SCR *sp, OPTION *op, char *str, u_long *valp) | 78 | f_lines(SCR *sp, OPTION *op, char *str, u_long *valp) | |
@@ -82,27 +82,27 @@ f_lines(SCR *sp, OPTION *op, char *str, | @@ -82,27 +82,27 @@ f_lines(SCR *sp, OPTION *op, char *str, | |||
82 | msgq(sp, M_ERR, "042|Screen lines too small, less than %d", | 82 | msgq(sp, M_ERR, "042|Screen lines too small, less than %d", | |
83 | MINIMUM_SCREEN_ROWS); | 83 | MINIMUM_SCREEN_ROWS); | |
84 | return (1); | 84 | return (1); | |
85 | } | 85 | } | |
86 | 86 | |||
87 | /* | 87 | /* | |
88 | * !!! | 88 | * !!! | |
89 | * It's not uncommon for allocation of huge chunks of memory to cause | 89 | * It's not uncommon for allocation of huge chunks of memory to cause | |
90 | * core dumps on various systems. So, we prune out numbers that are | 90 | * core dumps on various systems. So, we prune out numbers that are | |
91 | * "obviously" wrong. Vi will not work correctly if it has the wrong | 91 | * "obviously" wrong. Vi will not work correctly if it has the wrong | |
92 | * number of lines/columns for the screen, but at least we don't drop | 92 | * number of lines/columns for the screen, but at least we don't drop | |
93 | * core. | 93 | * core. | |
94 | */ | 94 | */ | |
95 | #define MAXIMUM_SCREEN_ROWS 500 | 95 | #define MAXIMUM_SCREEN_ROWS 4000 | |
96 | if (*valp > MAXIMUM_SCREEN_ROWS) { | 96 | if (*valp > MAXIMUM_SCREEN_ROWS) { | |
97 | msgq(sp, M_ERR, "043|Screen lines too large, greater than %d", | 97 | msgq(sp, M_ERR, "043|Screen lines too large, greater than %d", | |
98 | MAXIMUM_SCREEN_ROWS); | 98 | MAXIMUM_SCREEN_ROWS); | |
99 | return (1); | 99 | return (1); | |
100 | } | 100 | } | |
101 | 101 | |||
102 | /* | 102 | /* | |
103 | * Set the value, and the related scroll value. If no window | 103 | * Set the value, and the related scroll value. If no window | |
104 | * value set, set a new default window. | 104 | * value set, set a new default window. | |
105 | */ | 105 | */ | |
106 | o_set(sp, O_LINES, 0, NULL, *valp); | 106 | o_set(sp, O_LINES, 0, NULL, *valp); | |
107 | if (*valp == 1) { | 107 | if (*valp == 1) { | |
108 | sp->defscroll = 1; | 108 | sp->defscroll = 1; | |
@@ -135,40 +135,26 @@ f_lisp(SCR *sp, OPTION *op, char *str, u | @@ -135,40 +135,26 @@ f_lisp(SCR *sp, OPTION *op, char *str, u | |||
135 | } | 135 | } | |
136 | 136 | |||
137 | /* | 137 | /* | |
138 | * PUBLIC: int f_msgcat __P((SCR *, OPTION *, char *, u_long *)); | 138 | * PUBLIC: int f_msgcat __P((SCR *, OPTION *, char *, u_long *)); | |
139 | */ | 139 | */ | |
140 | int | 140 | int | |
141 | f_msgcat(SCR *sp, OPTION *op, char *str, u_long *valp) | 141 | f_msgcat(SCR *sp, OPTION *op, char *str, u_long *valp) | |
142 | { | 142 | { | |
143 | (void)msg_open(sp, str); | 143 | (void)msg_open(sp, str); | |
144 | return (0); | 144 | return (0); | |
145 | } | 145 | } | |
146 | 146 | |||
147 | /* | 147 | /* | |
148 | * PUBLIC: int f_paragraph __P((SCR *, OPTION *, char *, u_long *)); | |||
149 | */ | |||
150 | int | |||
151 | f_paragraph(SCR *sp, OPTION *op, char *str, u_long *valp) | |||
152 | { | |||
153 | if (strlen(str) & 1) { | |||
154 | msgq(sp, M_ERR, | |||
155 | "048|The paragraph option must be in two character groups"); | |||
156 | return (1); | |||
157 | } | |||
158 | return (0); | |||
159 | } | |||
160 | ||||
161 | /* | |||
162 | * PUBLIC: int f_print __P((SCR *, OPTION *, char *, u_long *)); | 148 | * PUBLIC: int f_print __P((SCR *, OPTION *, char *, u_long *)); | |
163 | */ | 149 | */ | |
164 | int | 150 | int | |
165 | f_print(SCR *sp, OPTION *op, char *str, u_long *valp) | 151 | f_print(SCR *sp, OPTION *op, char *str, u_long *valp) | |
166 | { | 152 | { | |
167 | int offset = op - sp->opts; | 153 | int offset = op - sp->opts; | |
168 | 154 | |||
169 | /* Preset the value, needed for reinitialization of lookup table. */ | 155 | /* Preset the value, needed for reinitialization of lookup table. */ | |
170 | if (offset == O_OCTAL) { | 156 | if (offset == O_OCTAL) { | |
171 | if (*valp) | 157 | if (*valp) | |
172 | O_SET(sp, offset); | 158 | O_SET(sp, offset); | |
173 | else | 159 | else | |
174 | O_CLR(sp, offset); | 160 | O_CLR(sp, offset); | |
@@ -218,40 +204,26 @@ f_recompile(SCR *sp, OPTION *op, char *s | @@ -218,40 +204,26 @@ f_recompile(SCR *sp, OPTION *op, char *s | |||
218 | } | 204 | } | |
219 | 205 | |||
220 | /* | 206 | /* | |
221 | * PUBLIC: int f_reformat __P((SCR *, OPTION *, char *, u_long *)); | 207 | * PUBLIC: int f_reformat __P((SCR *, OPTION *, char *, u_long *)); | |
222 | */ | 208 | */ | |
223 | int | 209 | int | |
224 | f_reformat(SCR *sp, OPTION *op, char *str, u_long *valp) | 210 | f_reformat(SCR *sp, OPTION *op, char *str, u_long *valp) | |
225 | { | 211 | { | |
226 | F_SET(sp, SC_SCR_REFORMAT); | 212 | F_SET(sp, SC_SCR_REFORMAT); | |
227 | return (0); | 213 | return (0); | |
228 | } | 214 | } | |
229 | 215 | |||
230 | /* | 216 | /* | |
231 | * PUBLIC: int f_section __P((SCR *, OPTION *, char *, u_long *)); | |||
232 | */ | |||
233 | int | |||
234 | f_section(SCR *sp, OPTION *op, char *str, u_long *valp) | |||
235 | { | |||
236 | if (strlen(str) & 1) { | |||
237 | msgq(sp, M_ERR, | |||
238 | "049|The section option must be in two character groups"); | |||
239 | return (1); | |||
240 | } | |||
241 | return (0); | |||
242 | } | |||
243 | ||||
244 | /* | |||
245 | * PUBLIC: int f_ttywerase __P((SCR *, OPTION *, char *, u_long *)); | 217 | * PUBLIC: int f_ttywerase __P((SCR *, OPTION *, char *, u_long *)); | |
246 | */ | 218 | */ | |
247 | int | 219 | int | |
248 | f_ttywerase(SCR *sp, OPTION *op, char *str, u_long *valp) | 220 | f_ttywerase(SCR *sp, OPTION *op, char *str, u_long *valp) | |
249 | { | 221 | { | |
250 | if (*valp) | 222 | if (*valp) | |
251 | O_CLR(sp, O_ALTWERASE); | 223 | O_CLR(sp, O_ALTWERASE); | |
252 | return (0); | 224 | return (0); | |
253 | } | 225 | } | |
254 | 226 | |||
255 | /* | 227 | /* | |
256 | * PUBLIC: int f_w300 __P((SCR *, OPTION *, char *, u_long *)); | 228 | * PUBLIC: int f_w300 __P((SCR *, OPTION *, char *, u_long *)); | |
257 | */ | 229 | */ |
--- src/dist/nvi/docs/vi.man/Attic/vi.1 2008/05/18 14:30:57 1.1.1.2
+++ src/dist/nvi/docs/vi.man/Attic/vi.1 2008/10/01 21:20:09 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | .\" $NetBSD: vi.1,v 1.1.1.2 2008/05/18 14:30:57 aymeric Exp $ | 1 | .\" $NetBSD: vi.1,v 1.2 2008/10/01 21:20:09 christos Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 1994 | 3 | .\" Copyright (c) 1994 | |
4 | .\" The Regents of the University of California. All rights reserved. | 4 | .\" The Regents of the University of California. All rights reserved. | |
5 | .\" Copyright (c) 1994, 1995, 1996 | 5 | .\" Copyright (c) 1994, 1995, 1996 | |
6 | .\" Keith Bostic. All rights reserved. | 6 | .\" Keith Bostic. All rights reserved. | |
7 | .\" | 7 | .\" | |
8 | .\" This document may not be republished without written permission from | 8 | .\" This document may not be republished without written permission from | |
9 | .\" Keith Bostic. | 9 | .\" Keith Bostic. | |
10 | .\" | 10 | .\" | |
11 | .\" See the LICENSE file for redistribution information. | 11 | .\" See the LICENSE file for redistribution information. | |
12 | .\" | 12 | .\" | |
13 | .\" Id: vi.1,v 8.53 2001/01/28 13:20:06 skimo Exp (Berkeley) Date: 2001/01/28 13:20:06 | 13 | .\" Id: vi.1,v 8.53 2001/01/28 13:20:06 skimo Exp (Berkeley) Date: 2001/01/28 13:20:06 | |
14 | .\" | 14 | .\" | |
@@ -1143,26 +1143,29 @@ only. | @@ -1143,26 +1143,29 @@ only. | |||
1143 | Modify various search commands and options to work with Lisp. | 1143 | Modify various search commands and options to work with Lisp. | |
1144 | .I "This option is not yet implemented." | 1144 | .I "This option is not yet implemented." | |
1145 | .TP | 1145 | .TP | |
1146 | .B "list [off]" | 1146 | .B "list [off]" | |
1147 | Display lines in an unambiguous fashion. | 1147 | Display lines in an unambiguous fashion. | |
1148 | .TP | 1148 | .TP | |
1149 | .B "lock [on]" | 1149 | .B "lock [on]" | |
1150 | Attempt to get an exclusive lock on any file being edited, | 1150 | Attempt to get an exclusive lock on any file being edited, | |
1151 | read or written. | 1151 | read or written. | |
1152 | .TP | 1152 | .TP | |
1153 | .B "magic [on]" | 1153 | .B "magic [on]" | |
1154 | Treat certain characters specially in regular expressions. | 1154 | Treat certain characters specially in regular expressions. | |
1155 | .TP | 1155 | .TP | |
1156 | .B "matchchars [[]{}()<>]" | |||
1157 | Character pairs looked for by the % command. | |||
1158 | .TP | |||
1156 | .B "matchtime [7]" | 1159 | .B "matchtime [7]" | |
1157 | .I \&Vi | 1160 | .I \&Vi | |
1158 | only. | 1161 | only. | |
1159 | The 10th's of a second | 1162 | The 10th's of a second | |
1160 | .I ex/vi | 1163 | .I ex/vi | |
1161 | pauses on the matching character when the | 1164 | pauses on the matching character when the | |
1162 | .B showmatch | 1165 | .B showmatch | |
1163 | option is set. | 1166 | option is set. | |
1164 | .TP | 1167 | .TP | |
1165 | .B "mesg [on]" | 1168 | .B "mesg [on]" | |
1166 | Permit messages from other users. | 1169 | Permit messages from other users. | |
1167 | .TP | 1170 | .TP | |
1168 | .B "modelines, modeline [off]" | 1171 | .B "modelines, modeline [off]" |
--- src/dist/nvi/docs/vi.ref/Attic/set.opt.texi 2008/05/18 14:31:00 1.1.1.2
+++ src/dist/nvi/docs/vi.ref/Attic/set.opt.texi 2008/10/01 21:20:09 1.2
@@ -1,15 +1,15 @@ | @@ -1,15 +1,15 @@ | |||
1 | @comment Copyright (c) 1994 | 1 | @comment Copyright (c) 1994 | |
2 | @c $NetBSD: set.opt.texi,v 1.1.1.2 2008/05/18 14:31:00 aymeric Exp $ | 2 | @c $NetBSD: set.opt.texi,v 1.2 2008/10/01 21:20:09 christos Exp $ | |
3 | @comment The Regents of the University of California. All rights reserved. | 3 | @comment The Regents of the University of California. All rights reserved. | |
4 | @comment Copyright (c) 1994, 1995, 1996 | 4 | @comment Copyright (c) 1994, 1995, 1996 | |
5 | @comment Keith Bostic. All rights reserved. | 5 | @comment Keith Bostic. All rights reserved. | |
6 | @comment | 6 | @comment | |
7 | @comment See the LICENSE file for redistribution information. | 7 | @comment See the LICENSE file for redistribution information. | |
8 | @comment | 8 | @comment | |
9 | @comment Id: set.opt.texi,v 8.1 2001/08/18 20:43:48 skimo Exp (Berkeley) Date: 2001/08/18 20:43:48 | 9 | @comment Id: set.opt.texi,v 8.1 2001/08/18 20:43:48 skimo Exp (Berkeley) Date: 2001/08/18 20:43:48 | |
10 | @comment | 10 | @comment | |
11 | @chapter Set Options | 11 | @chapter Set Options | |
12 | 12 | |||
13 | There are a large number of options that may be set (or unset) to | 13 | There are a large number of options that may be set (or unset) to | |
14 | change the editor's behavior. | 14 | change the editor's behavior. | |
15 | This section describes the options, their abbreviations and their | 15 | This section describes the options, their abbreviations and their | |
@@ -584,26 +584,35 @@ option off causes all regular expression | @@ -584,26 +584,35 @@ option off causes all regular expression | |||
584 | @QT{^} | 584 | @QT{^} | |
585 | and | 585 | and | |
586 | @QT{$}, | 586 | @QT{$}, | |
587 | to be treated as ordinary characters. | 587 | to be treated as ordinary characters. | |
588 | To re-enable characters individually, when the | 588 | To re-enable characters individually, when the | |
589 | @OP{magic} | 589 | @OP{magic} | |
590 | option is off, | 590 | option is off, | |
591 | precede them with a backslash | 591 | precede them with a backslash | |
592 | @QT{\e} | 592 | @QT{\e} | |
593 | character. | 593 | character. | |
594 | See the section entitled | 594 | See the section entitled | |
595 | @QB{Regular Expressions and Replacement Strings} | 595 | @QB{Regular Expressions and Replacement Strings} | |
596 | for more information. | 596 | for more information. | |
597 | @cindex matchchars | |||
598 | @IP{matchchars [[]{}()<>]} | |||
599 | ||||
600 | @CO{Vi} | |||
601 | only. | |||
602 | This option defines the character pairs used by the | |||
603 | @CO{%} | |||
604 | command. | |||
605 | ||||
597 | @cindex matchtime | 606 | @cindex matchtime | |
598 | @IP{matchtime [7]} | 607 | @IP{matchtime [7]} | |
599 | 608 | |||
600 | @CO{Vi} | 609 | @CO{Vi} | |
601 | only. | 610 | only. | |
602 | The 10th's of a second | 611 | The 10th's of a second | |
603 | @CO{vi} | 612 | @CO{vi} | |
604 | pauses on the matching character when the | 613 | pauses on the matching character when the | |
605 | @OP{showmatch} | 614 | @OP{showmatch} | |
606 | option is set. | 615 | option is set. | |
607 | @cindex mesg | 616 | @cindex mesg | |
608 | @IP{mesg [on]} | 617 | @IP{mesg [on]} | |
609 | 618 |
--- src/dist/nvi/docs/vi.ref/Attic/vi.cmd.texi 2008/05/18 14:31:02 1.1.1.2
+++ src/dist/nvi/docs/vi.ref/Attic/vi.cmd.texi 2008/10/01 21:20:09 1.2
@@ -1,15 +1,15 @@ | @@ -1,15 +1,15 @@ | |||
1 | @comment Copyright (c) 1994 | 1 | @comment Copyright (c) 1994 | |
2 | @c $NetBSD: vi.cmd.texi,v 1.1.1.2 2008/05/18 14:31:02 aymeric Exp $ | 2 | @c $NetBSD: vi.cmd.texi,v 1.2 2008/10/01 21:20:09 christos Exp $ | |
3 | @comment The Regents of the University of California. All rights reserved. | 3 | @comment The Regents of the University of California. All rights reserved. | |
4 | @comment Copyright (c) 1994, 1995, 1996 | 4 | @comment Copyright (c) 1994, 1995, 1996 | |
5 | @comment Keith Bostic. All rights reserved. | 5 | @comment Keith Bostic. All rights reserved. | |
6 | @comment | 6 | @comment | |
7 | @comment See the LICENSE file for redistribution information. | 7 | @comment See the LICENSE file for redistribution information. | |
8 | @comment | 8 | @comment | |
9 | @comment Id: vi.cmd.texi,v 8.1 2001/08/18 20:43:49 skimo Exp (Berkeley) Date: 2001/08/18 20:43:49 | 9 | @comment Id: vi.cmd.texi,v 8.1 2001/08/18 20:43:49 skimo Exp (Berkeley) Date: 2001/08/18 20:43:49 | |
10 | @comment | 10 | @comment | |
11 | @chapter Vi Description | 11 | @chapter Vi Description | |
12 | 12 | |||
13 | @CO{Vi} takes up the entire screen to display the edited file, | 13 | @CO{Vi} takes up the entire screen to display the edited file, | |
14 | except for the bottom line of the screen. | 14 | except for the bottom line of the screen. | |
15 | The bottom line of the screen is used to enter | 15 | The bottom line of the screen is used to enter | |
@@ -1035,33 +1035,43 @@ in the line, although it is an error whe | @@ -1035,33 +1035,43 @@ in the line, although it is an error whe | |||
1035 | @item Line: | 1035 | @item Line: | |
1036 | Set to the current line plus | 1036 | Set to the current line plus | |
1037 | @LI{count}minus 1. | 1037 | @LI{count}minus 1. | |
1038 | @item Column: | 1038 | @item Column: | |
1039 | Set to the last character in the line. | 1039 | Set to the last character in the line. | |
1040 | @item Options: | 1040 | @item Options: | |
1041 | None. | 1041 | None. | |
1042 | @end table | 1042 | @end table | |
1043 | @end deftypefn | 1043 | @end deftypefn | |
1044 | @cindex % | 1044 | @cindex % | |
1045 | @deftypefn Command {} {%} | 1045 | @deftypefn Command {} {%} | |
1046 | 1046 | |||
1047 | Move to the matching character. | 1047 | Move to the matching character. | |
1048 | The cursor moves to the parenthesis or curly brace which | 1048 | The cursor moves to the bracket character which | |
1049 | @emph{matches} | 1049 | @emph{matches} | |
1050 | the parenthesis or curly brace found at the current cursor position | 1050 | the bracket found at the current cursor position | |
1051 | or which is the closest one to the right of the cursor on the line. | 1051 | or which is the closest one to the right of the cursor on the line. | |
1052 | It is an error to execute the | 1052 | The bracket characters are defined by the | |
1053 | @OP{matchchars} | |||
1054 | option. | |||
1055 | An error will be reported if none of the | |||
1056 | @OP{matchchars} | |||
1057 | characters is found, or if no matching character is found. | |||
1058 | If the open and close brackes are identical (e.g.: if they are | |||
1059 | @QT{'} | |||
1060 | or | |||
1061 | @QT{"}, | |||
1062 | then repeating a | |||
1053 | @CO{%} | 1063 | @CO{%} | |
1054 | command on a line without a parenthesis or curly brace. | 1064 | command will perform a backwards search from the original opening bracket. | |
1055 | Historically, any | 1065 | Historically, any | |
1056 | @LI{count}specified to the | 1066 | @LI{count}specified to the | |
1057 | @CO{%} | 1067 | @CO{%} | |
1058 | command was ignored. | 1068 | command was ignored. | |
1059 | @sp 1 | 1069 | @sp 1 | |
1060 | The | 1070 | The | |
1061 | @CO{%} | 1071 | @CO{%} | |
1062 | command is an absolute movement. | 1072 | command is an absolute movement. | |
1063 | The | 1073 | The | |
1064 | @CO{%} | 1074 | @CO{%} | |
1065 | command may be used as the motion component of other | 1075 | command may be used as the motion component of other | |
1066 | @CO{vi} | 1076 | @CO{vi} | |
1067 | commands, in which case any text copied into a buffer is | 1077 | commands, in which case any text copied into a buffer is |
--- src/dist/nvi/vi/Attic/v_match.c 2008/05/18 14:31:42 1.1.1.2
+++ src/dist/nvi/vi/Attic/v_match.c 2008/10/01 21:20:09 1.2
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: v_match.c,v 1.1.1.2 2008/05/18 14:31:42 aymeric Exp $ */ | 1 | /* $NetBSD: v_match.c,v 1.2 2008/10/01 21:20:09 christos Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1992, 1993, 1994 | 4 | * Copyright (c) 1992, 1993, 1994 | |
5 | * The Regents of the University of California. All rights reserved. | 5 | * The Regents of the University of California. All rights reserved. | |
6 | * Copyright (c) 1992, 1993, 1994, 1995, 1996 | 6 | * Copyright (c) 1992, 1993, 1994, 1995, 1996 | |
7 | * Keith Bostic. All rights reserved. | 7 | * Keith Bostic. All rights reserved. | |
8 | * | 8 | * | |
9 | * See the LICENSE file for redistribution information. | 9 | * See the LICENSE file for redistribution information. | |
10 | */ | 10 | */ | |
11 | 11 | |||
12 | #include "config.h" | 12 | #include "config.h" | |
13 | 13 | |||
14 | #ifndef lint | 14 | #ifndef lint | |
@@ -31,126 +31,125 @@ static const char sccsid[] = "Id: v_matc | @@ -31,126 +31,125 @@ static const char sccsid[] = "Id: v_matc | |||
31 | * v_match -- % | 31 | * v_match -- % | |
32 | * Search to matching character. | 32 | * Search to matching character. | |
33 | * | 33 | * | |
34 | * PUBLIC: int v_match __P((SCR *, VICMD *)); | 34 | * PUBLIC: int v_match __P((SCR *, VICMD *)); | |
35 | */ | 35 | */ | |
36 | int | 36 | int | |
37 | v_match(SCR *sp, VICMD *vp) | 37 | v_match(SCR *sp, VICMD *vp) | |
38 | { | 38 | { | |
39 | VCS cs; | 39 | VCS cs; | |
40 | MARK *mp; | 40 | MARK *mp; | |
41 | size_t cno, len, off; | 41 | size_t cno, len, off; | |
42 | int cnt, isempty, matchc, startc, (*gc)__P((SCR *, VCS *)); | 42 | int cnt, isempty, matchc, startc, (*gc)__P((SCR *, VCS *)); | |
43 | CHAR_T *p; | 43 | CHAR_T *p; | |
44 | char *cp; | |||
45 | char *match_chars; | |||
46 | ||||
47 | static int match_lno, match_col, match_dir; | |||
48 | ||||
49 | /* | |||
50 | * Historically vi would match (), {} and [] however | |||
51 | * an update included <>. This is ok for editing HTML | |||
52 | * but a pain in the butt for C source. | |||
53 | * Making it an option lets the user decide what is 'right'. | |||
54 | * Also fixed to do something sensible with "". | |||
55 | */ | |||
56 | match_chars = O_STR(sp, O_MATCHCHARS); | |||
44 | 57 | |||
45 | /* | 58 | /* | |
46 | * !!! | 59 | * !!! | |
47 | * Historic practice; ignore the count. | 60 | * Historic practice; ignore the count. | |
48 | * | 61 | * | |
49 | * !!! | 62 | * !!! | |
50 | * Historical practice was to search for the initial character in the | 63 | * Historical practice was to search for the initial character in the | |
51 | * forward direction only. | 64 | * forward direction only. | |
52 | */ | 65 | */ | |
53 | if (db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { | 66 | if (db_eget(sp, vp->m_start.lno, &p, &len, &isempty)) { | |
54 | if (isempty) | 67 | if (isempty) | |
55 | goto nomatch; | 68 | goto nomatch; | |
56 | return (1); | 69 | return (1); | |
57 | } | 70 | } | |
58 | for (off = vp->m_start.cno;; ++off) { | 71 | for (off = vp->m_start.cno;; ++off) { | |
59 | if (off >= len) { | 72 | if (off >= len) { | |
60 | nomatch: msgq(sp, M_BERR, "184|No match character on this line"); | 73 | nomatch: msgq(sp, M_BERR, "184|No match character on this line"); | |
61 | return (1); | 74 | return (1); | |
62 | } | 75 | } | |
63 | switch (startc = p[off]) { | 76 | startc = p[off]; | |
64 | case '(': | 77 | cp = strchr(match_chars, startc); | |
65 | matchc = ')'; | 78 | if (cp != NULL) | |
66 | gc = cs_next; | |||
67 | break; | |||
68 | case ')': | |||
69 | matchc = '('; | |||
70 | gc = cs_prev; | |||
71 | break; | |||
72 | case '[': | |||
73 | matchc = ']'; | |||
74 | gc = cs_next; | |||
75 | break; | |||
76 | case ']': | |||
77 | matchc = '['; | |||
78 | gc = cs_prev; | |||
79 | break; | |||
80 | case '{': | |||
81 | matchc = '}'; | |||
82 | gc = cs_next; | |||
83 | break; | |||
84 | case '}': | |||
85 | matchc = '{'; | |||
86 | gc = cs_prev; | |||
87 | break; | 79 | break; | |
88 | case '<': | |||
89 | matchc = '>'; | |||
90 | gc = cs_next; | |||
91 | break; | |||
92 | case '>': | |||
93 | matchc = '<'; | |||
94 | gc = cs_prev; | |||
95 | break; | |||
96 | default: | |||
97 | continue; | |||
98 | } | |||
99 | break; | |||
100 | } | 80 | } | |
81 | cnt = cp - match_chars; | |||
82 | matchc = match_chars[cnt ^ 1]; | |||
83 | ||||
84 | /* Alternate back-forward search if startc and matchc the same */ | |||
85 | if (startc == matchc) { | |||
86 | /* are we continuing from where last match finished? */ | |||
87 | if (match_lno == vp->m_start.lno && match_col ==vp->m_start.cno) | |||
88 | /* yes - continue in sequence */ | |||
89 | match_dir++; | |||
90 | else | |||
91 | /* no - go forward, back, back, forward */ | |||
92 | match_dir = 1; | |||
93 | if (match_dir & 2) | |||
94 | cnt++; | |||
95 | } | |||
96 | gc = cnt & 1 ? cs_prev : cs_next; | |||
101 | 97 | |||
102 | cs.cs_lno = vp->m_start.lno; | 98 | cs.cs_lno = vp->m_start.lno; | |
103 | cs.cs_cno = off; | 99 | cs.cs_cno = off; | |
104 | if (cs_init(sp, &cs)) | 100 | if (cs_init(sp, &cs)) | |
105 | return (1); | 101 | return (1); | |
106 | for (cnt = 1;;) { | 102 | for (cnt = 1;;) { | |
107 | if (gc(sp, &cs)) | 103 | if (gc(sp, &cs)) | |
108 | return (1); | 104 | return (1); | |
109 | if (cs.cs_flags != 0) { | 105 | if (cs.cs_flags != 0) { | |
110 | if (cs.cs_flags == CS_EOF || cs.cs_flags == CS_SOF) | 106 | if (cs.cs_flags == CS_EOF || cs.cs_flags == CS_SOF) | |
111 | break; | 107 | break; | |
112 | continue; | 108 | continue; | |
113 | } | 109 | } | |
110 | if (cs.cs_ch == matchc && --cnt == 0) | |||
111 | break; | |||
114 | if (cs.cs_ch == startc) | 112 | if (cs.cs_ch == startc) | |
115 | ++cnt; | 113 | ++cnt; | |
116 | else if (cs.cs_ch == matchc && --cnt == 0) | |||
117 | break; | |||
118 | } | 114 | } | |
119 | if (cnt) { | 115 | if (cnt) { | |
120 | msgq(sp, M_BERR, "185|Matching character not found"); | 116 | msgq(sp, M_BERR, "185|Matching character not found"); | |
121 | return (1); | 117 | return (1); | |
122 | } | 118 | } | |
123 | 119 | |||
124 | vp->m_stop.lno = cs.cs_lno; | 120 | vp->m_stop.lno = cs.cs_lno; | |
125 | vp->m_stop.cno = cs.cs_cno; | 121 | vp->m_stop.cno = cs.cs_cno; | |
126 | 122 | |||
127 | /* | 123 | /* | |
128 | * If moving right, non-motion commands move to the end of the range. | 124 | * If moving right, non-motion commands move to the end of the range. | |
129 | * Delete and yank stay at the start. | 125 | * Delete and yank stay at the start. | |
130 | * | 126 | * | |
131 | * If moving left, all commands move to the end of the range. | 127 | * If moving left, all commands move to the end of the range. | |
132 | * | 128 | * | |
133 | * !!! | 129 | * !!! | |
134 | * Don't correct for leftward movement -- historic vi deleted the | 130 | * Don't correct for leftward movement -- historic vi deleted the | |
135 | * starting cursor position when deleting to a match. | 131 | * starting cursor position when deleting to a match. | |
136 | */ | 132 | */ | |
137 | if (vp->m_start.lno < vp->m_stop.lno || | 133 | if (vp->m_start.lno < vp->m_stop.lno || | |
138 | vp->m_start.lno == vp->m_stop.lno && | 134 | vp->m_start.lno == vp->m_stop.lno && | |
139 | vp->m_start.cno < vp->m_stop.cno) | 135 | vp->m_start.cno < vp->m_stop.cno) | |
140 | vp->m_final = ISMOTION(vp) ? vp->m_start : vp->m_stop; | 136 | vp->m_final = ISMOTION(vp) ? vp->m_start : vp->m_stop; | |
141 | else | 137 | else | |
142 | vp->m_final = vp->m_stop; | 138 | vp->m_final = vp->m_stop; | |
143 | 139 | |||
140 | match_lno = vp->m_final.lno; | |||
141 | match_col = vp->m_final.cno; | |||
142 | ||||
144 | /* | 143 | /* | |
145 | * !!! | 144 | * !!! | |
146 | * If the motion is across lines, and the earliest cursor position | 145 | * If the motion is across lines, and the earliest cursor position | |
147 | * is at or before any non-blank characters in the line, i.e. the | 146 | * is at or before any non-blank characters in the line, i.e. the | |
148 | * movement is cutting all of the line's text, and the later cursor | 147 | * movement is cutting all of the line's text, and the later cursor | |
149 | * position has nothing other than whitespace characters between it | 148 | * position has nothing other than whitespace characters between it | |
150 | * and the end of its line, the buffer is in line mode. | 149 | * and the end of its line, the buffer is in line mode. | |
151 | */ | 150 | */ | |
152 | if (!ISMOTION(vp) || vp->m_start.lno == vp->m_stop.lno) | 151 | if (!ISMOTION(vp) || vp->m_start.lno == vp->m_stop.lno) | |
153 | return (0); | 152 | return (0); | |
154 | mp = vp->m_start.lno < vp->m_stop.lno ? &vp->m_start : &vp->m_stop; | 153 | mp = vp->m_start.lno < vp->m_stop.lno ? &vp->m_start : &vp->m_stop; | |
155 | if (mp->cno != 0) { | 154 | if (mp->cno != 0) { | |
156 | cno = 0; | 155 | cno = 0; |