Compare commits
1245 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
665b1fbac6 | ||
|
|
5cbe08fc03 | ||
|
|
73bf89fa56 | ||
|
|
a73025d731 | ||
|
|
7bde05399f | ||
|
|
6168cb7391 | ||
|
|
44e0c03fff | ||
|
|
1aee5cc599 | ||
|
|
85c0b3c37e | ||
|
|
69163af499 | ||
|
|
f816119b36 | ||
|
|
5beae58597 | ||
|
|
4e05b755ed | ||
|
|
a96c819b50 | ||
|
|
5593e20964 | ||
|
|
651853aa21 | ||
|
|
9e21c62c68 | ||
|
|
43d3e9324b | ||
|
|
b2072b0999 | ||
|
|
9905b6ae74 | ||
|
|
3b2fdb00e4 | ||
|
|
2cf6d717f1 | ||
|
|
6ad6b85862 | ||
|
|
18d6a7ae1a | ||
|
|
5423680d67 | ||
|
|
7f7c66c237 | ||
|
|
b8351c1c8b | ||
|
|
27ae93d26b | ||
|
|
95a2db7a4a | ||
|
|
23555f29ba | ||
|
|
a899ab185f | ||
|
|
c5632a7e40 | ||
|
|
9c351e8831 | ||
|
|
23d3b7457b | ||
|
|
85f6a2daab | ||
|
|
6ea410e14e | ||
|
|
d4471ebe0e | ||
|
|
7f77e1dcdd | ||
|
|
a8824a197e | ||
|
|
059ba19ff7 | ||
|
|
bec2606ce2 | ||
|
|
9d658cec7a | ||
|
|
fe7d53e51e | ||
|
|
5e50e2f51e | ||
|
|
b2ca88cc74 | ||
|
|
7a3f49c019 | ||
|
|
bebfc6da0f | ||
|
|
0517c482e4 | ||
|
|
16799baccd | ||
|
|
d4ea5b69c5 | ||
|
|
8d5beb560c | ||
|
|
ba61cc382f | ||
|
|
3f301dd437 | ||
|
|
c3e52f16ba | ||
|
|
b725353ab7 | ||
|
|
99466bfa71 | ||
|
|
261da14301 | ||
|
|
6dd67790df | ||
|
|
01e13ea1c1 | ||
|
|
68c10963c4 | ||
|
|
d0c4d378b4 | ||
|
|
6c25819c34 | ||
|
|
bd11c0171b | ||
|
|
739fc8ac3d | ||
|
|
8d0fb01ff2 | ||
|
|
d7cf373358 | ||
|
|
e0a0d23f78 | ||
|
|
da419bcbe4 | ||
|
|
b2bff724da | ||
|
|
a62e8e3de9 | ||
|
|
483f3ac1b5 | ||
|
|
90d505cc4a | ||
|
|
9c6d78669e | ||
|
|
5290e1bc84 | ||
|
|
b5aaf72b6a | ||
|
|
1ea53709d8 | ||
|
|
0227ccca7c | ||
|
|
25799f6862 | ||
|
|
c54c4d1eea | ||
|
|
7431fe5e93 | ||
|
|
166da9c893 | ||
|
|
cd0210ff3e | ||
|
|
7098ec233c | ||
|
|
62898233ac | ||
|
|
26e637bf12 | ||
|
|
d873447f5f | ||
|
|
84635cd8e8 | ||
|
|
03987abebd | ||
|
|
c661853315 | ||
|
|
4f673d802c | ||
|
|
bf51aa4c0a | ||
|
|
954aba7430 | ||
|
|
3435a0ff64 | ||
|
|
66357b5462 | ||
|
|
e29111f7ec | ||
|
|
6399000a48 | ||
|
|
ea01474c4b | ||
|
|
077d0647c9 | ||
|
|
9b494fa90c | ||
|
|
18a89a6cef | ||
|
|
c4ca596a90 | ||
|
|
5c8197d78f | ||
|
|
62e117421f | ||
|
|
f3ecffd24d | ||
|
|
f774017801 | ||
|
|
d1cc007136 | ||
|
|
25fb1025e9 | ||
|
|
a9a3f4f599 | ||
|
|
e6a55fa1e5 | ||
|
|
95f7a7431e | ||
|
|
fa6c29cc2e | ||
|
|
b2b6976bd9 | ||
|
|
7a4aaa53a1 | ||
|
|
77d0feae05 | ||
|
|
c1b960947e | ||
|
|
4846ce7a6a | ||
|
|
34c75746c2 | ||
|
|
3129c2928b | ||
|
|
21374584e2 | ||
|
|
a2ea733e3b | ||
|
|
40ad177210 | ||
|
|
6f143c8124 | ||
|
|
072f86c5f9 | ||
|
|
f271f9c962 | ||
|
|
5a6caf0ca8 | ||
|
|
da72453859 | ||
|
|
203026c632 | ||
|
|
ed7ad33802 | ||
|
|
ff6c1997b9 | ||
|
|
a01690c410 | ||
|
|
ff1a0ea32b | ||
|
|
42e271d2d3 | ||
|
|
9c06f34ef9 | ||
|
|
ab41ab9246 | ||
|
|
2515ccc0a0 | ||
|
|
d1323e4e35 | ||
|
|
7ae1a79641 | ||
|
|
e221311f2e | ||
|
|
d26f1ebdf1 | ||
|
|
1e64db6629 | ||
|
|
ce9d299c47 | ||
|
|
bdfa927d62 | ||
|
|
789867b6a0 | ||
|
|
3a4eb48d5c | ||
|
|
bfc183ba10 | ||
|
|
6209e0eb15 | ||
|
|
e534aae701 | ||
|
|
d5d4dde1eb | ||
|
|
42af2216fe | ||
|
|
356d2482c5 | ||
|
|
399fe939f9 | ||
|
|
40c3cd1aa9 | ||
|
|
b300af3f63 | ||
|
|
30d0a81656 | ||
|
|
6a0d5b8fec | ||
|
|
7b601fdbe1 | ||
|
|
8b698f4a29 | ||
|
|
9880afc47a | ||
|
|
5ed8819f35 | ||
|
|
7291daabe3 | ||
|
|
d2edb8a538 | ||
|
|
33d07ef055 | ||
|
|
f26d386191 | ||
|
|
67287088dc | ||
|
|
d16d0bfb9a | ||
|
|
5b9f52265a | ||
|
|
a049c8364f | ||
|
|
1a76845aa5 | ||
|
|
e90f0b8a33 | ||
|
|
d232fa2fc3 | ||
|
|
e010edd1f8 | ||
|
|
19462616d4 | ||
|
|
d8640480c3 | ||
|
|
6315e2ff39 | ||
|
|
068edf44fc | ||
|
|
aeeb96e628 | ||
|
|
3db0dc3d8d | ||
|
|
c00f658026 | ||
|
|
8767da4e63 | ||
|
|
d0d5b8fc0e | ||
|
|
44491acfef | ||
|
|
8bcac8ad26 | ||
|
|
53aca71420 | ||
|
|
a9d45bba01 | ||
|
|
a644af58a3 | ||
|
|
7c78b45e76 | ||
|
|
746214d5aa | ||
|
|
0df61f1aac | ||
|
|
4428975e95 | ||
|
|
c7935e20b7 | ||
|
|
01458cd380 | ||
|
|
7bf86e1707 | ||
|
|
23d3cf4515 | ||
|
|
9af6a203fb | ||
|
|
092af14a82 | ||
|
|
3da5580c9c | ||
|
|
3925bdafda | ||
|
|
f47f150c82 | ||
|
|
457847f0fe | ||
|
|
7e62d109ba | ||
|
|
193b0e56f3 | ||
|
|
9b108c2110 | ||
|
|
da33153379 | ||
|
|
f4595bb5ae | ||
|
|
c4dbdd55f5 | ||
|
|
d29b9d5bd6 | ||
|
|
810d02c6a4 | ||
|
|
f99acbf29a | ||
|
|
6fdc81ae04 | ||
|
|
81dabf2be7 | ||
|
|
3db02389f4 | ||
|
|
cc81436f81 | ||
|
|
6529ab434a | ||
|
|
160c5fec87 | ||
|
|
81e49a0d4a | ||
|
|
c10d8ffe9f | ||
|
|
8fda94246b | ||
|
|
1addd601bc | ||
|
|
8e15674c70 | ||
|
|
5854a87070 | ||
|
|
47ae0d764e | ||
|
|
73857558ec | ||
|
|
854b71d775 | ||
|
|
cef24f2254 | ||
|
|
8d07efac66 | ||
|
|
d922f199a7 | ||
|
|
34bdc35d94 | ||
|
|
1726050ef9 | ||
|
|
8234f672d4 | ||
|
|
95778fda70 | ||
|
|
dac3bca274 | ||
|
|
e0b55138b9 | ||
|
|
5e068c6031 | ||
|
|
bec2f20da0 | ||
|
|
d20c0c34f5 | ||
|
|
0998a64fb9 | ||
|
|
527f1743f6 | ||
|
|
54b74cee91 | ||
|
|
b9b572236a | ||
|
|
df2a82509b | ||
|
|
1a1ea3d42f | ||
|
|
15aaa2c31a | ||
|
|
10796ac2fc | ||
|
|
aff5a1c6b1 | ||
|
|
217f241be5 | ||
|
|
11846fa576 | ||
|
|
32fe95d35e | ||
|
|
920e350d85 | ||
|
|
e5b23bd2ff | ||
|
|
7de678798a | ||
|
|
638cbe5407 | ||
|
|
0e0fef03c5 | ||
|
|
f1d3d9581a | ||
|
|
40e4acf55e | ||
|
|
5d8d0b19be | ||
|
|
86d8fc37d7 | ||
|
|
e8bb90bd2b | ||
|
|
e2ce2792a3 | ||
|
|
045d130cfa | ||
|
|
31b159c1b3 | ||
|
|
e4acb69611 | ||
|
|
e3970f503c | ||
|
|
16f88134f7 | ||
|
|
8b3266e83c | ||
|
|
0a8ec176e4 | ||
|
|
86a9452702 | ||
|
|
c5e9a434b1 | ||
|
|
67e3b93861 | ||
|
|
e5bc1c45ce | ||
|
|
2fba43c842 | ||
|
|
934f9687bb | ||
|
|
7ae4cc6964 | ||
|
|
0f476b99b7 | ||
|
|
30f164a015 | ||
|
|
86ce3903f9 | ||
|
|
6f25a67833 | ||
|
|
5754201944 | ||
|
|
172767187e | ||
|
|
d3d37433ae | ||
|
|
f83e5e2b13 | ||
|
|
650b39c43d | ||
|
|
9245f97960 | ||
|
|
60a9bddcf6 | ||
|
|
e1ce92c90f | ||
|
|
c5659d320e | ||
|
|
2f0cd35322 | ||
|
|
b68c01b753 | ||
|
|
50995bd024 | ||
|
|
9c8baed321 | ||
|
|
775eeba38a | ||
|
|
6e925cf330 | ||
|
|
066713e87e | ||
|
|
546f5b3d8a | ||
|
|
e781ddf3b1 | ||
|
|
6d39f4ba66 | ||
|
|
5ebd73f9a5 | ||
|
|
02173c05dc | ||
|
|
7f4dd35406 | ||
|
|
8f5e50991b | ||
|
|
340e5ca881 | ||
|
|
75f4b7cb84 | ||
|
|
5e73eec3cc | ||
|
|
0f83c89b09 | ||
|
|
6bc26a9a8b | ||
|
|
198bd592ff | ||
|
|
fcdfb7f75f | ||
|
|
e41e8dbead | ||
|
|
10f880c62f | ||
|
|
5e360dc065 | ||
|
|
6595b715d0 | ||
|
|
56c1e34e5a | ||
|
|
e4cb3158fd | ||
|
|
6439330d59 | ||
|
|
0bfec6e58d | ||
|
|
29be8031df | ||
|
|
c5fe41cec8 | ||
|
|
72bff8eee4 | ||
|
|
d4a1c0ad29 | ||
|
|
1ccada16ae | ||
|
|
5b2f17e591 | ||
|
|
3705924fc8 | ||
|
|
c596c0c4da | ||
|
|
9cf1df1f06 | ||
|
|
56074a1da6 | ||
|
|
f79a3fa51a | ||
|
|
b9180f4a82 | ||
|
|
ad11460eb7 | ||
|
|
04652518fd | ||
|
|
22425a204d | ||
|
|
e527e458f4 | ||
|
|
ac71fdde97 | ||
|
|
ffda704ef6 | ||
|
|
6a244b689f | ||
|
|
c2b07472e2 | ||
|
|
f1aed80922 | ||
|
|
95660ee4d9 | ||
|
|
ddedf2dbd4 | ||
|
|
c32a5e7b4e | ||
|
|
a3e5fad059 | ||
|
|
7accda6dd7 | ||
|
|
b9f28013a7 | ||
|
|
c504dffa39 | ||
|
|
fc0ebe982d | ||
|
|
dcb4e3a66d | ||
|
|
00762ffaeb | ||
|
|
4857728f6e | ||
|
|
c0718343f5 | ||
|
|
d9a4dedd35 | ||
|
|
de85d63520 | ||
|
|
53d7bce68a | ||
|
|
a716bf42bc | ||
|
|
403e0feced | ||
|
|
e61e2c6f49 | ||
|
|
d4a071e492 | ||
|
|
894d80fc5d | ||
|
|
612caef65f | ||
|
|
88ad64d597 | ||
|
|
aa683853d4 | ||
|
|
050469c595 | ||
|
|
4811b81456 | ||
|
|
050b13ae5d | ||
|
|
6a84684571 | ||
|
|
caac92012d | ||
|
|
32a285c1eb | ||
|
|
b80d49f071 | ||
|
|
fe605247cb | ||
|
|
78d05481db | ||
|
|
b56ca1b7bb | ||
|
|
d37f6a3f5c | ||
|
|
5f3695bdb5 | ||
|
|
d8367986ce | ||
|
|
6e0ed3c1c6 | ||
|
|
c15583da31 | ||
|
|
8ac9087d75 | ||
|
|
c8857a2c26 | ||
|
|
297851a647 | ||
|
|
cb4f14b8ce | ||
|
|
263b447323 | ||
|
|
bc6a36e40d | ||
|
|
eb5092226d | ||
|
|
cf4db89d56 | ||
|
|
4e0b1ae332 | ||
|
|
c4daf5d49e | ||
|
|
b41df4a140 | ||
|
|
a853e2d650 | ||
|
|
6b94e95ec9 | ||
|
|
aad85151ae | ||
|
|
7ec8d7c6a3 | ||
|
|
39e8ce6f8e | ||
|
|
afbcf68c1a | ||
|
|
b9dec213be | ||
|
|
928babf8a1 | ||
|
|
2d825bae79 | ||
|
|
3dfc879f63 | ||
|
|
bec01bd97d | ||
|
|
3dd744f392 | ||
|
|
adc30a839b | ||
|
|
8974efa27b | ||
|
|
d96ee5260a | ||
|
|
ba1ab86db5 | ||
|
|
1fc55a268f | ||
|
|
543ecf65a6 | ||
|
|
735b30c13f | ||
|
|
40e211bcec | ||
|
|
9bd56204ee | ||
|
|
d456bfa10d | ||
|
|
22a3564a2e | ||
|
|
d44a005e3d | ||
|
|
df21a2cbdf | ||
|
|
b349c80f0d | ||
|
|
85616c499b | ||
|
|
b9ddb80123 | ||
|
|
27f2b258d3 | ||
|
|
102d01da6c | ||
|
|
fd81a7189b | ||
|
|
efec641a82 | ||
|
|
77abec7ecf | ||
|
|
ba5b12c1fa | ||
|
|
40ea2a2ea0 | ||
|
|
496488c5d2 | ||
|
|
a17a130d6c | ||
|
|
2161fa6254 | ||
|
|
bb0060eb96 | ||
|
|
631242dd96 | ||
|
|
4dc5838ccc | ||
|
|
0099a8f45c | ||
|
|
38156d4491 | ||
|
|
666644efbc | ||
|
|
15540051ac | ||
|
|
7b918c76ee | ||
|
|
7d7e7d58ad | ||
|
|
f0195a8839 | ||
|
|
08c70ae1e9 | ||
|
|
9389ca29cf | ||
|
|
af40eeaa06 | ||
|
|
b159605a5b | ||
|
|
801a8b51d1 | ||
|
|
ff4a487efa | ||
|
|
9ec5db8b42 | ||
|
|
8d0d3abb72 | ||
|
|
7f9ed903ec | ||
|
|
96b21be5cf | ||
|
|
7253929a55 | ||
|
|
e9ac1d7930 | ||
|
|
59fe758a10 | ||
|
|
cefd29e9fe | ||
|
|
bca59d6ac0 | ||
|
|
800dd18fa4 | ||
|
|
b1d9b418b8 | ||
|
|
e0fb4d5641 | ||
|
|
55dfc3d3e9 | ||
|
|
6e60db6989 | ||
|
|
202d3c2f97 | ||
|
|
40f11ae622 | ||
|
|
3cf525d46f | ||
|
|
23f7e1b138 | ||
|
|
256a8908aa | ||
|
|
b199caef7d | ||
|
|
c275dc575a | ||
|
|
9d69169072 | ||
|
|
09b1c02c62 | ||
|
|
5f9acfeee5 | ||
|
|
9adace8c76 | ||
|
|
bd2eb289fb | ||
|
|
e6bbee8fe4 | ||
|
|
7e110bd28f | ||
|
|
eb4d81f3c1 | ||
|
|
aed09427f8 | ||
|
|
5d2ab88f0e | ||
|
|
65ef166a40 | ||
|
|
b6e79fddaf | ||
|
|
0c23aed600 | ||
|
|
ad96aff50d | ||
|
|
60e329e3b2 | ||
|
|
32f56814c7 | ||
|
|
45edf361a8 | ||
|
|
4c75faa211 | ||
|
|
7d367710ae | ||
|
|
b680326c37 | ||
|
|
e1c16b3744 | ||
|
|
bc14941e34 | ||
|
|
1b9d3f9898 | ||
|
|
2724c88717 | ||
|
|
54dca7b7b3 | ||
|
|
0df875a45d | ||
|
|
d7ca85c86c | ||
|
|
d9661dc301 | ||
|
|
0b80f936bf | ||
|
|
65e6ecb1d4 | ||
|
|
daa533a767 | ||
|
|
3eeb823f92 | ||
|
|
2921be2f38 | ||
|
|
d15de73bf3 | ||
|
|
798e67e0a1 | ||
|
|
96de1b0650 | ||
|
|
23c44504ad | ||
|
|
7c60eab744 | ||
|
|
3f9c63589e | ||
|
|
14ace1711d | ||
|
|
3e93c63e60 | ||
|
|
83ba47a964 | ||
|
|
345260c624 | ||
|
|
3ee4cf3027 | ||
|
|
17b8a36d17 | ||
|
|
42abfe057e | ||
|
|
159bdfdc60 | ||
|
|
122ae849b8 | ||
|
|
5040666fbb | ||
|
|
b80077dae3 | ||
|
|
314be2cfa9 | ||
|
|
21954765ca | ||
|
|
2bd22761ac | ||
|
|
d23277fbc9 | ||
|
|
4ce3b49597 | ||
|
|
5cc14f2f9a | ||
|
|
637b8bb36c | ||
|
|
65658ef574 | ||
|
|
18d616f253 | ||
|
|
c5e21dafb7 | ||
|
|
3a1fc8f0ab | ||
|
|
721fe6704a | ||
|
|
63d8f2b42f | ||
|
|
776cf3771d | ||
|
|
ce0451348c | ||
|
|
31055b3ba8 | ||
|
|
7801d7bed9 | ||
|
|
d24fbb760d | ||
|
|
1fe2eebf74 | ||
|
|
52e5f23184 | ||
|
|
b3aeb13682 | ||
|
|
c4c45aa532 | ||
|
|
e3013e3ed0 | ||
|
|
f6e4d33afc | ||
|
|
1bdccc5281 | ||
|
|
9b95ca8c29 | ||
|
|
8eb9c029be | ||
|
|
8f2906ba61 | ||
|
|
5508cc5b0a | ||
|
|
49ff08b251 | ||
|
|
116c828c50 | ||
|
|
78dadd4550 | ||
|
|
ea9370f231 | ||
|
|
610929c6ed | ||
|
|
c1e3d941a5 | ||
|
|
487d08cad0 | ||
|
|
0c9df578ea | ||
|
|
8a31afdc55 | ||
|
|
4c6956b433 | ||
|
|
b54155c4a4 | ||
|
|
775d46daf9 | ||
|
|
cac0293bce | ||
|
|
577298a3f9 | ||
|
|
f4a799aaec | ||
|
|
35e9713543 | ||
|
|
d96851f534 | ||
|
|
12054fe11b | ||
|
|
1307aae01a | ||
|
|
6d594a9cbb | ||
|
|
9ac20c85b0 | ||
|
|
0251bdb0a5 | ||
|
|
8ec1e2d903 | ||
|
|
851bea2ccd | ||
|
|
bbd63e136d | ||
|
|
28e19f8bbc | ||
|
|
9dffac90e7 | ||
|
|
930b1d7809 | ||
|
|
913db834d2 | ||
|
|
b6fbdd00cf | ||
|
|
d90d64f718 | ||
|
|
179f0ea742 | ||
|
|
22e5eff432 | ||
|
|
4d709f351c | ||
|
|
68e3016557 | ||
|
|
2524a70a49 | ||
|
|
f647c48035 | ||
|
|
f0a53f02a1 | ||
|
|
423326fc71 | ||
|
|
956da0d0e1 | ||
|
|
6e1cd06b96 | ||
|
|
1b1e8b632f | ||
|
|
d9ad76ba3c | ||
|
|
11c83d3ed3 | ||
|
|
b8a2a6d7e5 | ||
|
|
08cd7ef274 | ||
|
|
4840cb557f | ||
|
|
295d172f2d | ||
|
|
c13b7f0699 | ||
|
|
3e81914b82 | ||
|
|
0d847aadd9 | ||
|
|
f282428a42 | ||
|
|
4d97a588e6 | ||
|
|
c8ade44741 | ||
|
|
a9b9913c6b | ||
|
|
c195820456 | ||
|
|
6a643cd596 | ||
|
|
a35bdd1f03 | ||
|
|
4fd76bab73 | ||
|
|
fe3627ddfd | ||
|
|
61a71403f4 | ||
|
|
7ddca3a9a6 | ||
|
|
1903ace275 | ||
|
|
93c4a5656b | ||
|
|
9ec76e5573 | ||
|
|
fc693210d5 | ||
|
|
c0b9d19ed7 | ||
|
|
415b5d91cf | ||
|
|
3ba9c3512c | ||
|
|
f3bea022d6 | ||
|
|
6a2f068c7f | ||
|
|
e750fe68cf | ||
|
|
4564170c61 | ||
|
|
6eea1473b4 | ||
|
|
fbba5bf249 | ||
|
|
6a2f58e2ef | ||
|
|
78ea5e4a8a | ||
|
|
164bf36ea8 | ||
|
|
c2ac02ff46 | ||
|
|
abc9423709 | ||
|
|
60448895f6 | ||
|
|
263240c7c7 | ||
|
|
32085a88e8 | ||
|
|
eae97caa83 | ||
|
|
43953bba6f | ||
|
|
91851f3e60 | ||
|
|
bed32a370b | ||
|
|
f812e4f7d9 | ||
|
|
10820de467 | ||
|
|
98b61e3702 | ||
|
|
95a0224820 | ||
|
|
eb711b034b | ||
|
|
bfcba16761 | ||
|
|
2c70a4e608 | ||
|
|
bce3aad885 | ||
|
|
f326ed7910 | ||
|
|
846658eb6b | ||
|
|
c41285fb0b | ||
|
|
9c3edc026b | ||
|
|
7483571f7f | ||
|
|
68ebb61fb1 | ||
|
|
fc54d6e431 | ||
|
|
c0e42bd3c5 | ||
|
|
3ece0b9aeb | ||
|
|
1483ee3db1 | ||
|
|
63e73cbd14 | ||
|
|
53d3db4ba6 | ||
|
|
832db768a4 | ||
|
|
6ecbdd30b1 | ||
|
|
40a6c8cb64 | ||
|
|
800ee0d3f9 | ||
|
|
7a6fb48cf5 | ||
|
|
62a217d35d | ||
|
|
c109549a7e | ||
|
|
15dbc6ef07 | ||
|
|
c82997d460 | ||
|
|
08eab72517 | ||
|
|
e08765dca5 | ||
|
|
ca018c3e23 | ||
|
|
2dbcc801bf | ||
|
|
698263ca5c | ||
|
|
12642edfc9 | ||
|
|
5b3dd0f423 | ||
|
|
329d6a3259 | ||
|
|
8a2c0ba4b6 | ||
|
|
eeec999548 | ||
|
|
cc89513f14 | ||
|
|
6e738ac712 | ||
|
|
d994ad5284 | ||
|
|
304129315c | ||
|
|
4d6ec37676 | ||
|
|
bc3b92605e | ||
|
|
93c8405bfa | ||
|
|
b5a7a5a2d6 | ||
|
|
962202e4fa | ||
|
|
2c86dc6dc9 | ||
|
|
3de81bc33d | ||
|
|
3f35864b10 | ||
|
|
74d87073f0 | ||
|
|
e56d936bd4 | ||
|
|
831c640e62 | ||
|
|
b908a36d60 | ||
|
|
b75763e07e | ||
|
|
188f169e1d | ||
|
|
c0d3b20bdc | ||
|
|
42ca620e11 | ||
|
|
69a90c6b3b | ||
|
|
d7b632560c | ||
|
|
55381aa614 | ||
|
|
f6159047bc | ||
|
|
4db3d0adf7 | ||
|
|
6b769e5f5b | ||
|
|
0317c86a8a | ||
|
|
a98fd75b32 | ||
|
|
8091d334a3 | ||
|
|
9df069cc5f | ||
|
|
97b9046239 | ||
|
|
036a3d4646 | ||
|
|
4a3879f1ed | ||
|
|
56cf034a12 | ||
|
|
649b431171 | ||
|
|
bfb98f8bd4 | ||
|
|
8001e27e67 | ||
|
|
907725fde8 | ||
|
|
8781fc62cb | ||
|
|
1f1ebb85b7 | ||
|
|
e3016d90aa | ||
|
|
6299b0d752 | ||
|
|
2c31540fa9 | ||
|
|
fd9da07e6c | ||
|
|
fdd3becc1e | ||
|
|
c136f75f62 | ||
|
|
a084ad94f7 | ||
|
|
c15802f8c3 | ||
|
|
7105cf4f8e | ||
|
|
02085d7b92 | ||
|
|
50af6ea21e | ||
|
|
8ae06a86b8 | ||
|
|
29f446ec40 | ||
|
|
eb5d8383c8 | ||
|
|
00cca05ebb | ||
|
|
8c16bacbbf | ||
|
|
bde3e0e294 | ||
|
|
cb09337993 | ||
|
|
46c604a14e | ||
|
|
90e59c1a18 | ||
|
|
93eb293fbb | ||
|
|
d5402232ac | ||
|
|
0432e70850 | ||
|
|
78d644a635 | ||
|
|
1c293d2e28 | ||
|
|
31f99361b6 | ||
|
|
3d67c11473 | ||
|
|
b73c0c0b09 | ||
|
|
1539837fe0 | ||
|
|
dcc201b5b2 | ||
|
|
f643fc2149 | ||
|
|
f978f040bd | ||
|
|
8cbd4cb67f | ||
|
|
07e2589f80 | ||
|
|
be246c008b | ||
|
|
3e0c8a614d | ||
|
|
84d0d59cbb | ||
|
|
164c79883b | ||
|
|
e1ee22fba2 | ||
|
|
40bdb686aa | ||
|
|
29f03dcff9 | ||
|
|
182b2c936f | ||
|
|
6d9aa085d1 | ||
|
|
99869f54b5 | ||
|
|
4a1fc558cf | ||
|
|
1e1f572c51 | ||
|
|
4b4b608806 | ||
|
|
8381fdd83a | ||
|
|
d402e71a2f | ||
|
|
2e83a50e95 | ||
|
|
3d002ed602 | ||
|
|
add65085d6 | ||
|
|
e5e88fd9f2 | ||
|
|
85f8f46c40 | ||
|
|
687776b1a8 | ||
|
|
7a97e18667 | ||
|
|
59f5e04fa8 | ||
|
|
ace1037faf | ||
|
|
77b284af68 | ||
|
|
233f336112 | ||
|
|
d4ca9f2acb | ||
|
|
9bf486fe5d | ||
|
|
410efe9a47 | ||
|
|
1758640682 | ||
|
|
0ff01a92bc | ||
|
|
cc823ab6d6 | ||
|
|
cfa4a9c4fe | ||
|
|
e93e03e1dc | ||
|
|
c151b475e7 | ||
|
|
da952f8ded | ||
|
|
2690bafa15 | ||
|
|
e7c4168ee1 | ||
|
|
9abd1d18e4 | ||
|
|
7975408f66 | ||
|
|
c59979f067 | ||
|
|
bf1346f342 | ||
|
|
6a715b69a7 | ||
|
|
ca92becf9d | ||
|
|
2c4e34cfce | ||
|
|
d9fb3e6bde | ||
|
|
1601c28976 | ||
|
|
fe65657f6f | ||
|
|
484352241e | ||
|
|
2eb745939e | ||
|
|
3288925efb | ||
|
|
9819ed031b | ||
|
|
27fbc69ec4 | ||
|
|
53752e8f9a | ||
|
|
b802e70208 | ||
|
|
db85ac7564 | ||
|
|
cbc13a2a62 | ||
|
|
c6899cb734 | ||
|
|
2cc2a57dea | ||
|
|
381d483986 | ||
|
|
6be5339265 | ||
|
|
439fbe3e93 | ||
|
|
9cf7b28248 | ||
|
|
4b7e3c3efa | ||
|
|
fc965a4869 | ||
|
|
1f204c0204 | ||
|
|
4e8e495301 | ||
|
|
a870ca2d72 | ||
|
|
5780b24759 | ||
|
|
e53181d423 | ||
|
|
646bf9111c | ||
|
|
49d5c1bf1c | ||
|
|
731e7f28e7 | ||
|
|
1929982ec3 | ||
|
|
b6377c9d14 | ||
|
|
b112fe627d | ||
|
|
d93ee682c0 | ||
|
|
3497666a21 | ||
|
|
491cad3e5d | ||
|
|
f3b10e8e05 | ||
|
|
6b1c2adc86 | ||
|
|
7cfea8bb8c | ||
|
|
28caf14863 | ||
|
|
211dc82738 | ||
|
|
b6d97c15ac | ||
|
|
487149e713 | ||
|
|
045883aa34 | ||
|
|
056c5ef4a6 | ||
|
|
b49daec3f2 | ||
|
|
4dd723a095 | ||
|
|
d532f197b0 | ||
|
|
e663dcd6aa | ||
|
|
4c9e8f4211 | ||
|
|
77e02a3e74 | ||
|
|
951d7148d1 | ||
|
|
f1c395da79 | ||
|
|
3e189a8b9c | ||
|
|
7c1f17ab6d | ||
|
|
360191c434 | ||
|
|
ca744153fd | ||
|
|
be908f6992 | ||
|
|
e5d8f32834 | ||
|
|
47e82b1752 | ||
|
|
04a8d1c040 | ||
|
|
03225330dc | ||
|
|
25884f3bdb | ||
|
|
9bab9ff5b4 | ||
|
|
670a56c241 | ||
|
|
9b6e476a46 | ||
|
|
1e7297116b | ||
|
|
b77ec62cde | ||
|
|
45f971d69b | ||
|
|
eb16f43cf9 | ||
|
|
72d8e54f6e | ||
|
|
09b34ed34e | ||
|
|
f3ca80e11d | ||
|
|
013344c4c5 | ||
|
|
d08348b99c | ||
|
|
e6ef8b9bb9 | ||
|
|
807657b0fe | ||
|
|
f887298c6e | ||
|
|
db6015c7d7 | ||
|
|
fd73c462f4 | ||
|
|
12d5b2f6bd | ||
|
|
c7ca28a6ba | ||
|
|
6ccf0e2386 | ||
|
|
1a5c4c691c | ||
|
|
02517e0a0f | ||
|
|
8bf08097ee | ||
|
|
1fabded68f | ||
|
|
30d82b787d | ||
|
|
cc79a9ae96 | ||
|
|
66e19ba5f3 | ||
|
|
2a60ea8fe3 | ||
|
|
4aece064db | ||
|
|
6da969e44b | ||
|
|
146bb6026a | ||
|
|
c510042bcd | ||
|
|
50c7f2de2f | ||
|
|
0c4c58e457 | ||
|
|
20b83508f4 | ||
|
|
d1322107a5 | ||
|
|
fe0d366ce2 | ||
|
|
a16b27f102 | ||
|
|
dfca1c4ea6 | ||
|
|
a0b5ba2f7f | ||
|
|
19420aac9d | ||
|
|
013e8d1eb1 | ||
|
|
c6718cf209 | ||
|
|
a88347069c | ||
|
|
35fb55aba2 | ||
|
|
c08368bd19 | ||
|
|
b4041d6821 | ||
|
|
95f3812db1 | ||
|
|
a27bd65057 | ||
|
|
bb50b305d5 | ||
|
|
7e8dd19a72 | ||
|
|
df13e3beef | ||
|
|
7dfec43f42 | ||
|
|
69a28122c1 | ||
|
|
76356bd05b | ||
|
|
82dc1c17f2 | ||
|
|
95e39e5f46 | ||
|
|
1e7f1ea1e8 | ||
|
|
6420d445c2 | ||
|
|
049e4a5db3 | ||
|
|
6b24856c2f | ||
|
|
c7b6ac5afe | ||
|
|
00d7798756 | ||
|
|
ce62e82a93 | ||
|
|
73cd1a5ded | ||
|
|
76f63ff58d | ||
|
|
22fac783f5 | ||
|
|
c53ab2a854 | ||
|
|
4d44d2de0e | ||
|
|
8bf9ba0c16 | ||
|
|
76fb3eccda | ||
|
|
b8c479a9e9 | ||
|
|
a6d26d04fd | ||
|
|
906257932f | ||
|
|
9ef3adbc1d | ||
|
|
819c7f0327 | ||
|
|
f56cc9e0e9 | ||
|
|
360093a652 | ||
|
|
86e851b4e7 | ||
|
|
2d140c2980 | ||
|
|
7d3817fb3e | ||
|
|
331e659e98 | ||
|
|
8aaf03000b | ||
|
|
ad1fd0d968 | ||
|
|
1536f8613d | ||
|
|
c41d428b41 | ||
|
|
8037fe076b | ||
|
|
94b975ce7c | ||
|
|
04419b9702 | ||
|
|
36dd87b1fb | ||
|
|
24f10c30c3 | ||
|
|
fd3039a8e7 | ||
|
|
fb8bf40efb | ||
|
|
aea4dabf59 | ||
|
|
300b87fda6 | ||
|
|
49c3f2406d | ||
|
|
576bf331ef | ||
|
|
d717d4bac6 | ||
|
|
0273829353 | ||
|
|
f708037715 | ||
|
|
a5dda84a07 | ||
|
|
0af8604ec9 | ||
|
|
ec721c8e80 | ||
|
|
2ad320926f | ||
|
|
962cc74620 | ||
|
|
25529074d3 | ||
|
|
f7b5d930a9 | ||
|
|
309fbcbddf | ||
|
|
4693864a78 | ||
|
|
01a6bf4f9a | ||
|
|
c8c69d5449 | ||
|
|
edab0cc0a5 | ||
|
|
72e51ab037 | ||
|
|
74912c6090 | ||
|
|
ebd0d7c859 | ||
|
|
0fb841a78a | ||
|
|
cff5558394 | ||
|
|
db357a1ece | ||
|
|
a539fce4ad | ||
|
|
d36715e8ac | ||
|
|
e1151561ad | ||
|
|
dbde9d7577 | ||
|
|
524534405b | ||
|
|
21ad762998 | ||
|
|
d350727726 | ||
|
|
91bc83a97a | ||
|
|
537a880856 | ||
|
|
85529b37c6 | ||
|
|
973a96be62 | ||
|
|
4e1a98c9c3 | ||
|
|
45eda52d7e | ||
|
|
74af3a7419 | ||
|
|
3b0729cf5d | ||
|
|
2b6c3018b0 | ||
|
|
452513750b | ||
|
|
a9a6ce09d6 | ||
|
|
7ea39efdbd | ||
|
|
d8974451f0 | ||
|
|
e65e639465 | ||
|
|
16eb518dcd | ||
|
|
498e13df30 | ||
|
|
ae064bf255 | ||
|
|
e7638ea75f | ||
|
|
ce1d7652f3 | ||
|
|
0675c2f355 | ||
|
|
18b583d55b | ||
|
|
9a527f5a17 | ||
|
|
684b19380e | ||
|
|
4a80fcff4e | ||
|
|
f521b60f52 | ||
|
|
28260475bb | ||
|
|
c21790d6d9 | ||
|
|
be26561620 | ||
|
|
b6a4b10daf | ||
|
|
8d911991a3 | ||
|
|
89bb93733a | ||
|
|
2c62b07d2b | ||
|
|
483ea32c75 | ||
|
|
c833d9e80f | ||
|
|
12e066f9d4 | ||
|
|
9d325a03d9 | ||
|
|
32e3b88e09 | ||
|
|
dd7cc7230e | ||
|
|
3aedb36e68 | ||
|
|
570ea8969b | ||
|
|
2ed225f78d | ||
|
|
48ae986730 | ||
|
|
d12fd4b1fb | ||
|
|
0aa2264687 | ||
|
|
2f0d03b4a2 | ||
|
|
228148b87a | ||
|
|
c372488179 | ||
|
|
8328fc2439 | ||
|
|
da141063e3 | ||
|
|
0d29555a13 | ||
|
|
c279a63100 | ||
|
|
5a8995a097 | ||
|
|
32613fa3f6 | ||
|
|
2e3aeae5bc | ||
|
|
32d19ce47c | ||
|
|
a9fcaa589a | ||
|
|
1b525e9ad6 | ||
|
|
4be15f0158 | ||
|
|
4178db0328 | ||
|
|
1dcf36a370 | ||
|
|
fa394047ba | ||
|
|
bcebe325f0 | ||
|
|
14bf80399f | ||
|
|
c7acf69cb2 | ||
|
|
684e7ebd37 | ||
|
|
8e4adcdac3 | ||
|
|
e608f94a6f | ||
|
|
fd462b164e | ||
|
|
837a02b256 | ||
|
|
d7fd200a6a | ||
|
|
36e363f525 | ||
|
|
1cadddd111 | ||
|
|
7097d7b6d2 | ||
|
|
1d43db879e | ||
|
|
97133f5963 | ||
|
|
fda18c3935 | ||
|
|
d4693cb0be | ||
|
|
021960dfb7 | ||
|
|
68a44a4905 | ||
|
|
f613ca78c6 | ||
|
|
94e7094cee | ||
|
|
1122c85e34 | ||
|
|
8d3e7f3217 | ||
|
|
9830d7500f | ||
|
|
71d0a1fab3 | ||
|
|
2c4c788477 | ||
|
|
5aa39834aa | ||
|
|
a849ab12ea | ||
|
|
0381c2199d | ||
|
|
4b741b9c7b | ||
|
|
d893fa946d | ||
|
|
e5b2f83031 | ||
|
|
d62b63492a | ||
|
|
b88234049d | ||
|
|
dc35cb8e16 | ||
|
|
0a25808f34 | ||
|
|
805547fed0 | ||
|
|
45108343c8 | ||
|
|
f38230ae6d | ||
|
|
9be546b2f3 | ||
|
|
604caf3d6c | ||
|
|
07d3febe1b | ||
|
|
e1e7cb250e | ||
|
|
edc1ea4c16 | ||
|
|
d7db0a6dbf | ||
|
|
5520e85ee4 | ||
|
|
a3370c4232 | ||
|
|
befb25a4e6 | ||
|
|
f70f0cf6bd | ||
|
|
44e7f82e0e | ||
|
|
0b047c561d | ||
|
|
ce991bb3ad | ||
|
|
fd1768a902 | ||
|
|
1576d537a6 | ||
|
|
7947544460 | ||
|
|
b977515bd7 | ||
|
|
aca5d04f42 | ||
|
|
6aec4b85e6 | ||
|
|
dc10ecbbd6 | ||
|
|
b6aa42864e | ||
|
|
bf3c93e268 | ||
|
|
c6908f28b7 | ||
|
|
58924035c8 | ||
|
|
2a464cb07d | ||
|
|
35557c555c | ||
|
|
221ebcdf70 | ||
|
|
da35251e98 | ||
|
|
a9cd41c42d | ||
|
|
37be3edebc | ||
|
|
5ae684fc81 | ||
|
|
d7f5ad9786 | ||
|
|
a619ae69bf | ||
|
|
8911e235ba | ||
|
|
ce364e2a57 | ||
|
|
ea43a1dbca | ||
|
|
b34c683f3f | ||
|
|
ba7b1681a2 | ||
|
|
588ca6b79e | ||
|
|
04e42a6bcc | ||
|
|
6a2877d399 | ||
|
|
81e157cd38 | ||
|
|
807681ac7e | ||
|
|
281e0563c6 | ||
|
|
95b7bdbdb0 | ||
|
|
24ae56cd4b | ||
|
|
60b942c64f | ||
|
|
b55e382dfc | ||
|
|
3af54d3ff5 | ||
|
|
37853fd4ce | ||
|
|
475a2a7410 | ||
|
|
a7c9364641 | ||
|
|
f5300af90a | ||
|
|
1044d74fd3 | ||
|
|
656dd9c7eb | ||
|
|
369732ff81 | ||
|
|
795a16b959 | ||
|
|
b7e5cf6538 | ||
|
|
d390dd8ea7 | ||
|
|
815cba87e5 | ||
|
|
cb34a67ea1 | ||
|
|
ee383dbd6c | ||
|
|
1bc9219beb | ||
|
|
00c2054780 | ||
|
|
250267777c | ||
|
|
be66a6b078 | ||
|
|
53809440f3 | ||
|
|
273d2ce2d5 | ||
|
|
c91696e6df | ||
|
|
d03216a1ac | ||
|
|
58f6d836d9 | ||
|
|
2897d2b8b8 | ||
|
|
0ee54d9fb2 | ||
|
|
1eadebe21f | ||
|
|
35961c4252 | ||
|
|
c2c5a51e52 | ||
|
|
66081d4e70 | ||
|
|
fdece4621f | ||
|
|
250613665f | ||
|
|
70bd6e0dcb | ||
|
|
41151ac50d | ||
|
|
3e3fab5a0f | ||
|
|
62187d9ced | ||
|
|
9da0831dbf | ||
|
|
e97c8d5918 | ||
|
|
9591ee5d0a | ||
|
|
760a2dc9b2 | ||
|
|
c53a92d973 | ||
|
|
d5be947021 | ||
|
|
f0b3009400 | ||
|
|
606dfda47a | ||
|
|
fa1497b38f | ||
|
|
6481c3fb2d | ||
|
|
f28f50e6b5 | ||
|
|
f8ddf31bfb | ||
|
|
9e45a47054 | ||
|
|
9b5bd42978 | ||
|
|
47162bc428 | ||
|
|
e190ff30f2 | ||
|
|
afb75f22b2 | ||
|
|
32559294e8 | ||
|
|
c2946fbe09 | ||
|
|
2a4ab6d29d | ||
|
|
76c4b33ef4 | ||
|
|
8213850df6 | ||
|
|
f427694400 | ||
|
|
18394ac621 | ||
|
|
d29146040b | ||
|
|
a593f538dd | ||
|
|
45cfbece4c | ||
|
|
895e65ce1a | ||
|
|
4dca76f2e9 | ||
|
|
82a8f91392 | ||
|
|
bc503c80db | ||
|
|
a5d8e54ab9 | ||
|
|
10dd6c7714 | ||
|
|
4e25410680 | ||
|
|
637f6e50c0 | ||
|
|
7776ef9149 | ||
|
|
8fa1976796 | ||
|
|
7127857924 | ||
|
|
b7cb6a38c8 | ||
|
|
b78649b664 | ||
|
|
95114c1bc4 | ||
|
|
133f7b16ea | ||
|
|
8bbd1eb89f | ||
|
|
f6cf4a7d7c | ||
|
|
13dfdb2493 | ||
|
|
699412175d | ||
|
|
3a420879d6 | ||
|
|
c1f630e914 | ||
|
|
5f34d6e3b0 | ||
|
|
25307257c9 | ||
|
|
bb7e2cbfad | ||
|
|
f5b256bb9f | ||
|
|
4dcd070cdf | ||
|
|
0362c58b37 | ||
|
|
99bede34e7 | ||
|
|
2dd7ed14bc | ||
|
|
f03c78b382 | ||
|
|
5dcba30395 | ||
|
|
7bf00de84f | ||
|
|
a3831ab2b8 | ||
|
|
f0b7dcaa99 | ||
|
|
9eff7465d9 | ||
|
|
da8fd8f894 | ||
|
|
5ffbec56f6 | ||
|
|
b23554fa25 | ||
|
|
1356a0a72d | ||
|
|
c97acfb2d6 | ||
|
|
14509a3aa2 | ||
|
|
7f47d42289 | ||
|
|
d91ab6e912 | ||
|
|
dc9c40a56d | ||
|
|
e0a9f50a64 | ||
|
|
298b975264 | ||
|
|
417b03a4c3 | ||
|
|
21cc550752 | ||
|
|
3bd9628b38 | ||
|
|
74ea836fcc | ||
|
|
8faf305d0c | ||
|
|
954b00de74 | ||
|
|
79c849a4a9 | ||
|
|
cb7ee0e491 | ||
|
|
aaad3af523 | ||
|
|
ec290f2385 | ||
|
|
27863665ca | ||
|
|
ba6fd42b3c | ||
|
|
e04970675f | ||
|
|
222feaa953 | ||
|
|
10187610f8 | ||
|
|
a9cebd8054 | ||
|
|
4d7c260270 | ||
|
|
f3fee5db91 | ||
|
|
21599f805b | ||
|
|
6954f05276 | ||
|
|
194c26f879 |
@@ -11,6 +11,7 @@ config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.rpath
|
||||
configure
|
||||
config.guess
|
||||
config.sub
|
||||
@@ -18,10 +19,7 @@ depcomp
|
||||
install-sh
|
||||
missing
|
||||
mkinstalldirs
|
||||
nano
|
||||
nano.info
|
||||
nano.spec
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
texinfo.tex
|
||||
|
||||
26
AUTHORS
26
AUTHORS
@@ -1,10 +1,16 @@
|
||||
$Id$
|
||||
This file lists people who have made significant contribution to the nano
|
||||
editor. Please see the ChangeLog for specific changes by author.
|
||||
This file lists people who have made significant contribution to the
|
||||
nano editor. Please see the ChangeLog for specific changes by author.
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
Chris Allegretta <chrisa@asty.org>
|
||||
* Main program author and maintainer.
|
||||
* Original program author, stable series maintainer.
|
||||
|
||||
David Lawrence Ramsey <pooka_regent@sluggy.net>
|
||||
* Development series maintainer. Multiple buffer support,
|
||||
operating dir (-o) option, bug fixes for display routines,
|
||||
wrapping code, spelling fixes, const mode, parts of the UTF-8
|
||||
support, and various other fixes.
|
||||
|
||||
Jordi Mallach <jordi@sindominio.net>
|
||||
* Debian package maintainer, fellow bug squasher.
|
||||
@@ -21,15 +27,11 @@ Robert Siemborski <rjs3@andrew.cmu.edu>
|
||||
edit display routines.
|
||||
|
||||
Rocco Corsi <rocco.corsi@sympatico.ca>
|
||||
* Internal spelling code, many optimizations and bug fixes for
|
||||
findnextstr and search-related functions, various display and
|
||||
file handling fixes.
|
||||
|
||||
David Lawrence Ramsey <pooka_regent@sluggy.net>
|
||||
* Multiple buffer support, operating dir (-o) option, bug fixes
|
||||
for display routines, wrapping code, spelling fixes, const
|
||||
mode and various other fixes.
|
||||
* Internal spelling code, many optimizations and bug fixes for
|
||||
findnextstr() and search-related functions, various display
|
||||
and file handling fixes.
|
||||
|
||||
David Benbennick <dbenbenn@math.cornell.edu>
|
||||
* Wrap and justify bugfixes/enhancements, new color syntax
|
||||
code, memleak fixes and other miscellaneous fixes.
|
||||
code, memleak fixes, parts of the UTF-8 support, and other
|
||||
miscellaneous fixes.
|
||||
|
||||
34
Makefile.am
34
Makefile.am
@@ -1,36 +1,10 @@
|
||||
## $Id$
|
||||
AUTOMAKE_OPTIONS = gnu no-dependencies
|
||||
|
||||
DEFS= -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
SUBDIRS = doc m4 po src
|
||||
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = color.c \
|
||||
cut.c \
|
||||
files.c \
|
||||
global.c \
|
||||
move.c \
|
||||
nano.c \
|
||||
nano.h \
|
||||
proto.h \
|
||||
rcfile.c \
|
||||
search.c \
|
||||
utils.c \
|
||||
winio.c
|
||||
|
||||
man_MANS = nano.1 nanorc.5
|
||||
nano_LDADD = @GLIB_LIBS@ @LIBINTL@
|
||||
|
||||
info_TEXINFOS = nano.texi
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
|
||||
README THANKS TODO UPGRADE config.rpath install-sh missing \
|
||||
mkinstalldirs nano.1.html nanorc.5.html faq.html \
|
||||
nanorc.sample nano.spec $(man_MANS)
|
||||
|
||||
SUBDIRS = po m4
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@
|
||||
EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \
|
||||
README THANKS TODO UPGRADE config.rpath install-sh \
|
||||
missing mkinstalldirs nano.spec
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
46
README
46
README
@@ -7,19 +7,20 @@ Overview
|
||||
wonderfully easy-to-use and friendly Pico text editor.
|
||||
|
||||
First and foremost is its license: the Pine suite does not use the
|
||||
GPL or a GPL-friendly license, and has unclear restrictions on
|
||||
redistribution. Because of this, Pine and Pico are not included with
|
||||
many GNU/Linux distributions. Also, other features (like goto line
|
||||
number or search and replace) were unavailable until recently or
|
||||
require a command line flag. Yuck.
|
||||
GPL or a GPL-friendly license, and has unclear restrictions on
|
||||
redistribution. Because of this, Pine and Pico are not included
|
||||
with many GNU/Linux distributions. Also, other features (like goto
|
||||
line number or search and replace) were unavailable until recently
|
||||
or require a command line flag. Yuck.
|
||||
|
||||
nano aims to solve these problems by emulating the functionality of
|
||||
Pico as closely as possible while addressing the problems above and
|
||||
perhaps providing other extra functionality.
|
||||
|
||||
The nano editor is now an official GNU package. For more information
|
||||
on GNU and the Free Software Foundation please see http://www.gnu.org.
|
||||
|
||||
The nano editor is now an official GNU package. For more
|
||||
information on GNU and the Free Software Foundation please see
|
||||
http://www.gnu.org.
|
||||
|
||||
How to compile and install nano
|
||||
|
||||
Download the nano source code, then:
|
||||
@@ -28,37 +29,40 @@ How to compile and install nano
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
It's that simple. Use --prefix with configure to override the
|
||||
|
||||
It's that simple. Use --prefix with configure to override the
|
||||
default installation directory of /usr/local.
|
||||
|
||||
|
||||
Web Page
|
||||
|
||||
http://www.nano-editor.org
|
||||
|
||||
http://www.nano-editor.org/
|
||||
|
||||
Mailing List and Bug Reports
|
||||
|
||||
Savannah hosts all the nano-related mailing-lists.
|
||||
|
||||
+ info-nano@gnu.org is a very low traffic list
|
||||
used to announce new Nano versions or other important information
|
||||
about the project.
|
||||
used to announce new nano versions or other important
|
||||
information about the project.
|
||||
+ help-nano@gnu.org is for those seeking to get help without
|
||||
wanting to hear about the technical details of its
|
||||
development.
|
||||
+ nano-devel@gnu.org is the list used by the people
|
||||
that make Nano and a general development discussion list, with
|
||||
that make nano and a general development discussion list, with
|
||||
moderate traffic.
|
||||
To subscribe, send email to nano-<name>-request@gnu.org
|
||||
with a subject of "subscribe", where <name> is the list you want to
|
||||
|
||||
To subscribe, send email to nano-<name>-request@gnu.org with a
|
||||
subject of "subscribe", where <name> is the list you want to
|
||||
subscribe to.
|
||||
|
||||
For general bug reports, send a description of the problem to
|
||||
nano@nano-editor.org or directly to the development list.
|
||||
|
||||
Current Status
|
||||
|
||||
GNU nano has reaching its second major milestone, 1.2.x. Development
|
||||
of new features will continue in the 1.3.x branch, while 1.2.x
|
||||
versions will be dedicated to bugfixing and polishing.
|
||||
GNU nano has reached its second stable milestone, 1.2.x.
|
||||
Development of new features continues in the 1.3.x branch, while
|
||||
1.2.x versions are dedicated to bug-fixing and polishing.
|
||||
|
||||
Chris Allegretta (chrisa@asty.org)
|
||||
|
||||
|
||||
48
README.CVS
48
README.CVS
@@ -1,38 +1,46 @@
|
||||
INSTRUCTIONS TO COMPILE AND INSTALL NANO CVS VERSIONS
|
||||
-----------------------------------------------------
|
||||
|
||||
GNU nano is available from CVS, but building this needs a bit
|
||||
more care than the official stable and unstable tarballs.
|
||||
GNU nano is available from CVS, but building this needs a bit more care
|
||||
than the official stable and unstable tarballs.
|
||||
|
||||
To successfully compile GNU nano from CVS, you'll need the
|
||||
following packages:
|
||||
To successfully compile GNU nano from CVS, you'll need the following
|
||||
packages:
|
||||
|
||||
- autoconf (version >= 2.52)
|
||||
- automake (version >= 1.6, 1.7.x recommended)
|
||||
- autoconf (version >= 2.54)
|
||||
- automake (version >= 1.7)
|
||||
- gettext (version >= 0.11.5)
|
||||
- groff
|
||||
- texinfo
|
||||
- cvs
|
||||
- glib (if your system doesn't have snprintf() and/or vsnprintf())
|
||||
- make, gcc and the normal development libraries (ncurses, etc)
|
||||
These should be available on your GNU mirror.
|
||||
- ssh (with support for the SSH version 2 protocol)
|
||||
- glib 2.x (if your system doesn't have snprintf() and/or vsnprintf())
|
||||
- make, gcc and the normal development libraries (curses or slang, etc.)
|
||||
|
||||
These should be available on your GNU mirror. Note that you'll need a
|
||||
version of curses or slang with wide character support if you want nano
|
||||
to use UTF-8.
|
||||
|
||||
To download the CVS tree, execute the following command:
|
||||
$ cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/nano login
|
||||
and press enter at the password prompt.
|
||||
Then, do
|
||||
$ cvs -z3 -d:pserver:anoncvs@subversions.gnu.org:/cvsroot/nano checkout nano
|
||||
and the nano tree will download.
|
||||
If you want to checkout the stable CVS branch, append -r nano_1_0_branch:
|
||||
$ cvs -z3 -d:pserver:anonymous@subversions.gnu.org:/cvsroot/nano checkout -r nano_1_0_branch nano
|
||||
First, you need to set up cvs to download the CVS tree using ssh. If
|
||||
you're using a Bourne shell (e.g. bash or sh), do
|
||||
$ export CVS_RSH=ssh
|
||||
If you're using a C shell (e.g. tcsh or csh), do
|
||||
$ setenv CVS_RSH ssh
|
||||
|
||||
After it's set up, use the following command to download the CVS tree:
|
||||
$ cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/nano checkout nano
|
||||
|
||||
If you want to download the stable CVS branch, add "-r nano_1_2_branch":
|
||||
$ cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/nano checkout -r nano_1_2_branch nano
|
||||
|
||||
Once you have the sources in the "nano" directory, cd into it, and
|
||||
execute the "autogen.sh" script in the top dir. This will setup a
|
||||
configure script and Makefile.in, and you will be ready to compile with
|
||||
execute the "autogen.sh" script in the top directory. This will set up
|
||||
a configure script and Makefile.in, and you will be ready to compile
|
||||
with
|
||||
$ ./configure [--add-options-here] && make
|
||||
|
||||
Once it's done compiling,
|
||||
$ make install
|
||||
(as root) should put the required files in their respective directories.
|
||||
|
||||
|
||||
Please submit any bugs in the CVS branch to nano-devel@gnu.org.
|
||||
|
||||
4
THANKS
4
THANKS
@@ -4,6 +4,7 @@ If we missed you here, let us know!
|
||||
Sharuzzaman Ahmat Raslan <sharuzzaman@excite.com>
|
||||
Malay translator
|
||||
Laurentiu Buzdugan <buzdugan@voyager.net> Romanian translator
|
||||
CHAO Wei-Lun <chaoweilun@pcmail.com.tw> Traditional Chinese translator
|
||||
Ricardo Cárdenes Medina <ricardo@conisys.com> Spanish translator
|
||||
Marco Colombo <magicdice@inwind.it> Italian translator
|
||||
Karl Eichwalder <keichwa@gmx.net> German translator
|
||||
@@ -28,6 +29,7 @@ Sergey A. Ribalchenko <fisher@obu.ck.ua> Russian, Ukrainian translator
|
||||
Michel Robitaille <robitail@IRO.UMontreal.CA> French translator
|
||||
Christian Rose <menthos@menthos.com> Swedish translator
|
||||
Stig E Sandoe <stig@ii.uib.no> Norwegian bokmål translator
|
||||
Danilo Segan <dsegan@gmx.net> Serbian translator
|
||||
Keld Simonsen <keld@dkuug.dk> Danish translator
|
||||
Guus Sliepen <guus@nl.linux.org> Dutch translator
|
||||
Cezary Sliwa <sliwa@cft.edu.pl> Polish translator
|
||||
@@ -35,6 +37,7 @@ Pierre Tane <tanep@bigfoot.com> French translator
|
||||
Jacobo Tarrío <jtarrio@trasno.net> Galician translator
|
||||
Kjetil Torgrim Homme <kjetilho@linpro.no> Norwegian nynorsk translator
|
||||
Miquel Vidal <miquel@sindominio.net> Catalan translator
|
||||
Phan Vinh Thinh <teppi82@gmail.com> Vietnamese translator
|
||||
Pauli Virtanen <pauli.virtanen@saunalahti.fi> Finnish translator
|
||||
Peio Ziarsolo <peio@sindominio.net> Basque translator
|
||||
|
||||
@@ -51,5 +54,4 @@ Jeremy Robichaud <robicj@yahoo.com> Beta tester
|
||||
Bill Soudan <wes0472@rit.edu> Regex code, etc
|
||||
Ken Tyler <kent@werple.net.au> Search fixes and more
|
||||
|
||||
|
||||
$Id$
|
||||
|
||||
21
TODO
21
TODO
@@ -2,17 +2,20 @@ TODO file (? means the feature may be implemented, but not definitely)
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
For version 1.4:
|
||||
- UTF-8 support.
|
||||
- Support for Pico's paragraph searching ability.
|
||||
- Undo/Redo key?
|
||||
- UTF-8 support. [DONE]
|
||||
- Support for paragraph searches. [DONE]
|
||||
- Support for justifying the entire file at once. [DONE]
|
||||
- Support for filename searches in the file browser.
|
||||
- Undo/Redo keys?
|
||||
- Rebindable keys?
|
||||
- Keystroke to implement "Add next sequence as raw" like vi's ^V.
|
||||
- Spell check selected text only.
|
||||
- Make "To line" (^W^T) and "Read from Command" (^R^X) re-enter their
|
||||
- Keystroke to implement "Add next sequence as raw" like vi's ^V. [DONE]
|
||||
- Spell check selected text only. [DONE]
|
||||
- Make "To Line" (^W^T) and "Read from Command" (^R^X) reenter their
|
||||
parent menu when their keystroke is entered a second time (^W^T^T and
|
||||
(^R^X^X)(requires figuring out when to keep cursor pos and when not
|
||||
to).
|
||||
- Fix resetstatuspos global which we shouldn't have.
|
||||
(^R^X^X) (requires figuring out when to keep cursor position and when
|
||||
not to). [DONE]
|
||||
- Fix resetstatuspos global which we shouldn't have. [DONE]
|
||||
- Rewrite the nano FAQ in SGML.
|
||||
|
||||
Old requests:
|
||||
|
||||
|
||||
513
config.rpath
513
config.rpath
@@ -1,513 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2002 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except M$VC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shlibext=
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
linux*)
|
||||
echo '__INTEL_COMPILER' > conftest.$ac_ext
|
||||
if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
# Intel icc
|
||||
wl='-Qoption,ld,'
|
||||
fi
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
if test "x$host_vendor" = xsni; then
|
||||
wl='-LD'
|
||||
else
|
||||
wl='-Wl,'
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX, the GNU linker is very broken
|
||||
ld_shlibs=no
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we can use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes # Not in the search PATH, but as the default
|
||||
# location of the library.
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
openbsd*)
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
if test "x$host_vendor" = xsno; then
|
||||
hardcode_direct=yes # is this really true???
|
||||
else
|
||||
hardcode_direct=no # Motorola manual says yes, but my tests say they lie
|
||||
fi
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv5*)
|
||||
hardcode_libdir_flag_spec=
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4.2uw2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
;;
|
||||
sysv5uw7* | unixware7*)
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
libname_spec='lib$name'
|
||||
sys_lib_dlsearch_path_spec="/lib /usr/lib"
|
||||
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
shlibext=so
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
shlibext=so
|
||||
;;
|
||||
amigaos*)
|
||||
shlibext=ixlibrary
|
||||
;;
|
||||
beos*)
|
||||
shlibext=so
|
||||
;;
|
||||
bsdi4*)
|
||||
shlibext=so
|
||||
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
|
||||
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
case $GCC,$host_os in
|
||||
yes,cygwin*)
|
||||
shlibext=dll.a
|
||||
;;
|
||||
yes,mingw*)
|
||||
shlibext=dll
|
||||
sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
|
||||
;;
|
||||
yes,pw32*)
|
||||
shlibext=dll
|
||||
;;
|
||||
*)
|
||||
shlibext=dll
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shlibext=dylib
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd*)
|
||||
shlibext=so
|
||||
;;
|
||||
gnu*)
|
||||
shlibext=so
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
shlibext=sl
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
shlibext=so
|
||||
case "$host_os" in
|
||||
irix5*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
|
||||
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
|
||||
;;
|
||||
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
|
||||
;;
|
||||
linux-gnu*)
|
||||
shlibext=so
|
||||
;;
|
||||
netbsd*)
|
||||
shlibext=so
|
||||
;;
|
||||
newsos6)
|
||||
shlibext=so
|
||||
;;
|
||||
openbsd*)
|
||||
shlibext=so
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shlibext=dll
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
shlibext=so
|
||||
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
|
||||
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
|
||||
;;
|
||||
sco3.2v5*)
|
||||
shlibext=so
|
||||
;;
|
||||
solaris*)
|
||||
shlibext=so
|
||||
;;
|
||||
sunos4*)
|
||||
shlibext=so
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
shlibext=so
|
||||
case "$host_vendor" in
|
||||
motorola)
|
||||
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
uts4*)
|
||||
shlibext=so
|
||||
;;
|
||||
dgux*)
|
||||
shlibext=so
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
shlibext=so
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
# Compile-time system search path for libraries
|
||||
sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
|
||||
|
||||
# Run-time system search path for libraries
|
||||
sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
|
||||
|
||||
EOF
|
||||
497
configure.ac
497
configure.ac
@@ -2,138 +2,153 @@
|
||||
#
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
#
|
||||
# GNU Nano is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
# GNU nano is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by the
|
||||
# Free Software Foundation; either version 2, or (at your option) any
|
||||
# later version.
|
||||
#
|
||||
# GNU Nano is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# GNU nano is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with GNU Nano; if not, write to the Free Software
|
||||
# Foundation, Inc.
|
||||
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
# along with GNU nano; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
|
||||
# USA.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
AC_INIT([GNU Nano], [1.2.2], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([nano.c])
|
||||
AC_INIT([GNU nano], [1.3.8], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([src/nano.c])
|
||||
AC_CANONICAL_TARGET([])
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER([config.h:config.h.in])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
AC_PREREQ(2.52)
|
||||
AC_PREREQ(2.54)
|
||||
|
||||
dnl Checks for programs.
|
||||
|
||||
AC_GNU_SOURCE
|
||||
AC_PROG_CC
|
||||
AC_PROG_LN_S
|
||||
AC_ISC_POSIX
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl Internationalization macros.
|
||||
|
||||
AM_GNU_GETTEXT_VERSION(0.11.5)
|
||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
|
||||
dnl Checks for header files.
|
||||
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termio.h termios.h unistd.h)
|
||||
AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termios.h wchar.h wctype.h)
|
||||
AC_CHECK_HEADER(regex.h,
|
||||
AC_MSG_CHECKING([for broken regexec])
|
||||
AC_MSG_CHECKING([for broken regexec from glibc 2.2.3])
|
||||
AC_TRY_RUN([
|
||||
#include <sys/types.h>
|
||||
#include <regex.h>
|
||||
int main () { regex_t reg; size_t n = 1; regmatch_t r; regcomp(®, "\\<", 0); regexec(®, "", n, &r, 0); regfree(®); return 0; }],
|
||||
int main(void)
|
||||
{
|
||||
regex_t reg;
|
||||
size_t n = 1;
|
||||
regmatch_t r;
|
||||
regcomp(®, "\\<", 0);
|
||||
regexec(®, "", n, &r, 0);
|
||||
regfree(®);
|
||||
return 0;
|
||||
}],
|
||||
AC_MSG_RESULT(no),
|
||||
AC_MSG_RESULT(yes); AC_DEFINE(BROKEN_REGEXEC, 1, [Define this if your regexec() function segfaults when passed an empty string under certain conditions.])
|
||||
)
|
||||
)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BROKEN_REGEXEC, 1, [Define this if your regexec() function segfaults when passed an empty string under certain conditions, as the one from glibc 2.2.3 does.]),
|
||||
AC_MSG_RESULT([cross-compiling; assuming no])))
|
||||
|
||||
dnl Checks for options.
|
||||
|
||||
dnl options
|
||||
AC_ARG_ENABLE(debug,
|
||||
[ --enable-debug Enable debugging (disabled by default)],
|
||||
[if test x$enableval = xyes; then
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.])
|
||||
debug_support=yes
|
||||
fi])
|
||||
fi])
|
||||
|
||||
if test "$debug_support" != "yes"; then
|
||||
if test x$debug_support != xyes; then
|
||||
AC_DEFINE(NDEBUG, 1, [Shut up the assert warnings :-)])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(extra,
|
||||
[ --enable-extra Enable extra (optional) functions, including easter eggs],
|
||||
[ --enable-extra Enable extra features, currently only easter eggs],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes
|
||||
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(tiny,
|
||||
[ --enable-tiny Disable features for the sake of size],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(NANO_SMALL, 1, [Define this to make the nano executable as small as possible.]) tiny_support=yes
|
||||
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in (crappy) file browser.])
|
||||
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the ^G help menu.])
|
||||
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
|
||||
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help menu.])
|
||||
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
|
||||
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.])
|
||||
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).])
|
||||
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the use(full|less) spelling functions.])
|
||||
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(browser,
|
||||
[ --disable-browser Disable mini file browser],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in (crappy) file browser.])
|
||||
fi])
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_BROWSER, 1, [Define this to disable the built-in file browser.])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(help,
|
||||
[ --disable-help Disable help function (^G)],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the ^G help menu.])
|
||||
fi])
|
||||
[ --disable-help Disable help function],
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_HELP, 1, [Define this to disable the help menu.])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(justify,
|
||||
[ --disable-justify Disable justify/unjustify function],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_JUSTIFY, 1, [Define this to disable the justify routine.])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(mouse,
|
||||
[ --disable-mouse Disable mouse support (and -m flag)],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_MOUSE, 1, [Define this to disable the mouse functions.])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(operatingdir,
|
||||
[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_OPERATINGDIR, 1, [Define this to disable setting of the operating directory (chroot of sorts).])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(speller,
|
||||
[ --disable-speller Disable spell checker function],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_SPELLER, 1, [Define this to disable the use(full|less) spelling functions.])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(tabcomp,
|
||||
[ --disable-tabcomp Disable tab completion code for a smaller binary],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_TABCOMP, 1, [Define to disable the tab completion code Chris worked so hard on!])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(wrapping,
|
||||
[ --disable-wrapping Disable all wrapping of text (and -w flag)],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable any and all text wrapping.])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(wrapping-as-root,
|
||||
[ --disable-wrapping-as-root Disable wrapping of text as root by default],
|
||||
[if test x$enableval != xyes; then
|
||||
[if test x$enableval != xyes; then
|
||||
AC_DEFINE(DISABLE_ROOTWRAP, 1, [Define this to disable wrapping as root by default.])
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(color,
|
||||
[ --enable-color Enable color and syntax highlighting],
|
||||
@@ -141,7 +156,6 @@ AC_ARG_ENABLE(color,
|
||||
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
|
||||
AC_DEFINE(ENABLE_COLOR, 1, [Define this to have syntax highlighting, requires ENABLE_NANORC too!]) color_support=yes
|
||||
AC_MSG_WARN([
|
||||
|
||||
***********************************************************************
|
||||
*** WARNING: Color support is far from perfect, but functional. ***
|
||||
*** Be careful with syntax in your .nanorc or nano may malfunction. ***
|
||||
@@ -153,13 +167,13 @@ AC_ARG_ENABLE(multibuffer,
|
||||
[ --enable-multibuffer Enable multiple file buffers],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(nanorc,
|
||||
[ --enable-nanorc Enable use of .nanorc file],
|
||||
[if test x$enableval = xyes; then
|
||||
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
|
||||
fi])
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(all,
|
||||
[ --enable-all Enable ALL extra nano functionality (kitchen sink option)],
|
||||
@@ -169,14 +183,24 @@ AC_ARG_ENABLE(all,
|
||||
AC_DEFINE(ENABLE_MULTIBUFFER, 1, [Define this to enable multiple file buffers.]) multibuffer_support=yes
|
||||
AC_DEFINE(NANO_EXTRA, 1, [Define this to enable the extra stuff.]) extra_support=yes
|
||||
AC_MSG_WARN([
|
||||
|
||||
***********************************************************************
|
||||
*** WARNING: Color support is far from perfect, but functional. ***
|
||||
*** Be careful with syntax in your .nanorc or nano may malfunction. ***
|
||||
***********************************************************************
|
||||
])
|
||||
])
|
||||
fi])
|
||||
|
||||
AC_MSG_CHECKING([whether to enable UTF-8 support])
|
||||
AC_ARG_ENABLE(utf8,
|
||||
[ --enable-utf8 Enable UTF-8 support],
|
||||
[if test x$enableval = xyes; then
|
||||
enable_utf8=yes
|
||||
else
|
||||
enable_utf8=no
|
||||
fi],
|
||||
[enable_utf8=auto])
|
||||
AC_MSG_RESULT($enable_utf8)
|
||||
|
||||
AC_MSG_CHECKING([whether to use slang])
|
||||
CURSES_LIB_NAME=""
|
||||
AC_ARG_WITH(slang,
|
||||
@@ -188,99 +212,205 @@ AC_ARG_WITH(slang,
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
|
||||
if test "$with_slang" != "yes"; then
|
||||
if test x$with_slang != xyes; then
|
||||
# Add additional search path
|
||||
LDFLAGS="-L$with_slang/lib $LDFLAGS"
|
||||
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(slcurses.h,
|
||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
|
||||
_libs=$LIBS
|
||||
LIBS="$LIBS -lslang"
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <slcurses.h>
|
||||
int main () { SLtt_initialize (NULL); return 0; }],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
if test "$with_slang" != "yes"; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang"
|
||||
else
|
||||
CURSES_LIB="-lslang"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang], [
|
||||
AC_MSG_RESULT(no)
|
||||
# We might need the term library
|
||||
for termlib in ncurses curses termcap terminfo termlib; do
|
||||
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
|
||||
test -n "$tcap" && break
|
||||
done
|
||||
|
||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
|
||||
LIBS="$LIBS $tcap"
|
||||
if test x$enable_utf8 != xno; then
|
||||
AC_CHECK_HEADER(slcurses.h,
|
||||
AC_MSG_CHECKING([for SLutf8_enable in -lslang])
|
||||
_libs=$LIBS
|
||||
LIBS="$LIBS -lslang"
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <slcurses.h>
|
||||
int main () { SLtt_initialize (NULL); return 0; }],
|
||||
int main(void)
|
||||
{
|
||||
SLutf8_enable(TRUE);
|
||||
return 0;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
if test "$with_slang" != "yes"; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
|
||||
CURSES_LIB_WIDE=yes
|
||||
if test x$with_slang != xyes; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap"
|
||||
CURSES_LIB="-lslang"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang], [
|
||||
AC_MSG_RESULT(no)
|
||||
# We might need the math library
|
||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
|
||||
LIBS="$LIBS -lm"
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)
|
||||
|
||||
# We might need the term library
|
||||
for termlib in ncurses curses termcap terminfo termlib; do
|
||||
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
|
||||
test -n "$tcap" && break
|
||||
done
|
||||
|
||||
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap])
|
||||
LIBS="$LIBS $tcap"
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
#include <slcurses.h>
|
||||
int main () { SLtt_initialize (NULL); return 0; }],
|
||||
int main(void)
|
||||
{
|
||||
SLutf8_enable(TRUE);
|
||||
return 0;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
if test "$with_slang" != "yes"; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
|
||||
CURSES_LIB_WIDE=yes
|
||||
if test x$with_slang != xyes; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap -lm"
|
||||
CURSES_LIB="-lslang $tcap"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
|
||||
[AC_MSG_RESULT(no)
|
||||
|
||||
# We might need the math library
|
||||
AC_MSG_CHECKING([for SLutf8_enable in -lslang $tcap -lm])
|
||||
LIBS="$LIBS -lm"
|
||||
AC_TRY_RUN([
|
||||
#include <slcurses.h>
|
||||
int main(void)
|
||||
{
|
||||
SLutf8_enable(TRUE);
|
||||
return 0;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
CURSES_LIB_WIDE=yes
|
||||
if test x$with_slang != xyes; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap -lm"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
|
||||
AC_MSG_ERROR([
|
||||
*** The header file slcurses.h was not found. If you wish to use
|
||||
*** slang support this header file is required. Please either
|
||||
*** install a version of slang that includes the slcurses.h file or
|
||||
*** do not call the configure script with --with-slang
|
||||
]))
|
||||
]))
|
||||
fi
|
||||
|
||||
test "${_libs+set}" = "set" && LIBS=$_libs
|
||||
if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
# Reset libs if the above slang tests failed
|
||||
if test x$enable_utf8 != xno; then
|
||||
LIBS=$_libs
|
||||
fi
|
||||
|
||||
if test "$with_slang" != "yes"; then
|
||||
AC_CHECK_HEADER(slcurses.h,
|
||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
|
||||
_libs=$LIBS
|
||||
LIBS="$LIBS -lslang"
|
||||
AC_TRY_RUN([
|
||||
#include <slcurses.h>
|
||||
int main(void)
|
||||
{
|
||||
SLtt_initialize(NULL);
|
||||
return 0;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
if test x$with_slang != xyes; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang"
|
||||
else
|
||||
CURSES_LIB="-lslang"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)
|
||||
|
||||
# We might need the term library
|
||||
for termlib in ncurses curses termcap terminfo termlib; do
|
||||
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
|
||||
test -n "$tcap" && break
|
||||
done
|
||||
|
||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
|
||||
LIBS="$LIBS $tcap"
|
||||
AC_TRY_RUN([
|
||||
#include <slcurses.h>
|
||||
int main(void)
|
||||
{
|
||||
SLtt_initialize(NULL);
|
||||
return 0;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
if test x$with_slang != xyes; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)
|
||||
|
||||
# We might need the math library
|
||||
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
|
||||
LIBS="$LIBS -lm"
|
||||
AC_TRY_RUN([
|
||||
#include <slcurses.h>
|
||||
int main(void)
|
||||
{
|
||||
SLtt_initialize(NULL);
|
||||
return 0;
|
||||
}],
|
||||
[AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
|
||||
slang_support=yes
|
||||
if test x$with_slang != xyes; then
|
||||
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
|
||||
else
|
||||
CURSES_LIB="-lslang $tcap -lm"
|
||||
fi
|
||||
CURSES_LIB_NAME=slang],
|
||||
[AC_MSG_RESULT(no)],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
||||
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
|
||||
AC_MSG_ERROR([
|
||||
*** The header file slcurses.h was not found. If you wish to use
|
||||
*** slang support this header file is required. Please either
|
||||
*** install a version of slang that includes the slcurses.h file or
|
||||
*** do not call the configure script with --with-slang
|
||||
]))
|
||||
fi
|
||||
|
||||
if test "${_libs+set}" = "set"; then
|
||||
LIBS=$_libs
|
||||
fi
|
||||
|
||||
if test x$with_slang != xyes; then
|
||||
LDFLAGS=${_ldflags}
|
||||
fi
|
||||
;;
|
||||
esac], [AC_MSG_RESULT(no)])
|
||||
|
||||
dnl Checks for functions
|
||||
AC_CHECK_FUNCS(snprintf vsnprintf strcasecmp strncasecmp)
|
||||
if test "x$ac_cv_func_snprintf" = "xno" -o "xac_cv_func_vsnprintf" = "xno"
|
||||
then
|
||||
AM_PATH_GLIB(1.2.4,,
|
||||
[AC_MSG_ERROR([
|
||||
*** snprintf() and/or vsnprintf() not found. GLIB not found either.
|
||||
dnl Checks for functions.
|
||||
|
||||
AC_CHECK_FUNCS(getdelim getline isblank snprintf strcasecmp strcasestr strncasecmp strnlen vsnprintf)
|
||||
|
||||
if test x$enable_utf8 != xno; then
|
||||
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace mblen mbstowcs mbtowc wctomb wcwidth)
|
||||
fi
|
||||
|
||||
if test x$ac_cv_func_snprintf = xno || test x$ac_cv_func_vsnprintf = xno; then
|
||||
AM_PATH_GLIB_2_0(2.0.0,,
|
||||
AC_MSG_ERROR([
|
||||
*** snprintf() and/or vsnprintf() not found. GLIB 2.x not found either.
|
||||
*** You need both snprintf() and vsnprintf(). Alternatively you can
|
||||
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.])],
|
||||
glib)
|
||||
glib_cflags=`$GLIB_CONFIG --cflags glib`
|
||||
glib_libs=`$GLIB_CONFIG --libs glib`
|
||||
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.]),
|
||||
glib)
|
||||
fi
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
@@ -292,74 +422,93 @@ AC_CHECK_FUNCS(getopt_long)
|
||||
|
||||
dnl Checks for libraries.
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
AC_CHECK_HEADERS(ncurses.h)
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"
|
||||
then
|
||||
AC_CHECK_HEADERS(curses.h ncurses.h)
|
||||
AC_CHECK_LIB(ncurses, tgetent, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
|
||||
fi
|
||||
if test x$enable_utf8 != xno; then
|
||||
AC_CHECK_LIB(ncursesw, get_wch, [CURSES_LIB="-lncursesw" CURSES_LIB_NAME=ncursesw CURSES_LIB_WIDE=yes])
|
||||
fi
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"
|
||||
then
|
||||
AC_CHECK_LIB(curses, tgetent, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
|
||||
fi
|
||||
|
||||
# Fallback for PDCurses and less useful curses libs...
|
||||
if eval "test x$CURSES_LIB_NAME = x"
|
||||
then
|
||||
AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
|
||||
fi
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"
|
||||
then
|
||||
AC_CHECK_LIB(termcap, tgetent, [CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap])
|
||||
fi
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"
|
||||
then
|
||||
AC_MSG_WARN([
|
||||
*** No termcap lib available, consider getting the official ncurses
|
||||
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
|
||||
*** errors compiling nano.])
|
||||
else
|
||||
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the termcap library])
|
||||
fi
|
||||
|
||||
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors command.]))
|
||||
if test x$slang_support != xyes; then
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, AC_DEFINE(HAVE_WRESIZE, 1, [Define this if you have the wresize function in your ncurses-type library.]))
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, AC_DEFINE(HAVE_RESIZETERM, 1, [Define this if you have the resizeterm function in your ncurses-type library.]))
|
||||
|
||||
# Taken from aumix (can't tell from the variable name?)
|
||||
AC_CACHE_CHECK([for private member _use_keypad in WINDOW],
|
||||
aumix_cv_struct_window_usekeypad,
|
||||
[AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H
|
||||
#include <ncurses.h>
|
||||
#else
|
||||
#include <curses.h>
|
||||
#endif], [WINDOW w; w._use_keypad;],
|
||||
aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)])
|
||||
|
||||
if test $aumix_cv_struct_window_usekeypad = yes; then
|
||||
AC_DEFINE(HAVE_USEKEYPAD, 1, [Define this if your curses lib has the _use_keypad flag.])
|
||||
if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
AC_CHECK_LIB(ncurses, initscr, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl Parse any configure options
|
||||
if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
AC_CHECK_HEADERS(curses.h)
|
||||
|
||||
if test x$enable_utf8 != xno; then
|
||||
AC_CHECK_LIB(curses, get_wch, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses CURSES_LIB_WIDE=yes])
|
||||
fi
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
|
||||
fi
|
||||
fi
|
||||
|
||||
if eval "test x$CURSES_LIB_NAME = x"; then
|
||||
AC_MSG_WARN([
|
||||
*** No curses lib available. Consider getting the official ncurses
|
||||
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
|
||||
*** errors compiling nano.])
|
||||
else
|
||||
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the curses library])
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses library has the use_default_colors command.]))
|
||||
|
||||
dnl Parse any configure options.
|
||||
|
||||
LIBS="$LIBS $CURSES_LIB"
|
||||
|
||||
AC_SUBST(CURSES_LIB)
|
||||
|
||||
if test "x$glib_cflags" != "x"
|
||||
then
|
||||
CFLAGS="$CFLAGS $glib_cflags"
|
||||
if test "x$GLIB_CFLAGS" != "x"; then
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
fi
|
||||
if test "x$glib_libs" != "x"
|
||||
then
|
||||
LDFLAGS="$LDFLAGS $glib_libs"
|
||||
if test "x$GLIB_LIBS" != "x"; then
|
||||
LDFLAGS="$LDFLAGS $GLIB_LIBS"
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in nano.spec])
|
||||
if test x$enable_utf8 != xno && \
|
||||
test x$CURSES_LIB_WIDE = xyes && \
|
||||
test x$ac_cv_func_iswalnum = xyes && \
|
||||
test x$ac_cv_func_iswpunct = xyes && \
|
||||
(test x$ac_cv_func_iswblank = xyes || test x$ac_cv_func_iswspace = xyes) && \
|
||||
test x$ac_cv_func_mblen = xyes && \
|
||||
test x$ac_cv_func_mbstowcs = xyes && \
|
||||
test x$ac_cv_func_mbtowc = xyes && \
|
||||
test x$ac_cv_func_wctomb = xyes && \
|
||||
test x$ac_cv_func_wcwidth = xyes; then
|
||||
AC_DEFINE(NANO_WIDE, 1, [Define this if your system has sufficient wide character support (a wide curses library, iswalnum(), iswpunct(), iswblank() or iswspace(), mblen(), mbstowcs(), mbtowc(), wctomb(), and wcwidth()).])
|
||||
else
|
||||
if test x$enable_utf8 = xyes; then
|
||||
AC_MSG_ERROR([
|
||||
*** UTF-8 support was requested, but insufficient UTF-8 support was
|
||||
*** detected in your curses and/or C libraries. Please verify that your
|
||||
*** slang was built with UTF-8 support or your curses was built with
|
||||
*** wide character support, and that your C library was built with wide
|
||||
*** character support.])
|
||||
elif test x$enable_utf8 != xno; then
|
||||
AC_MSG_WARN([
|
||||
*** Insufficient UTF-8 support was detected in your curses and/or C
|
||||
*** libraries. If you want UTF-8 support, please verify that your slang
|
||||
*** was built with UTF-8 support or your curses was built with wide
|
||||
*** character support, and that your C library was built with wide
|
||||
*** character support.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
doc/Makefile
|
||||
doc/man/Makefile
|
||||
doc/man/fr/Makefile
|
||||
doc/texinfo/Makefile
|
||||
m4/Makefile
|
||||
po/Makefile.in
|
||||
src/Makefile
|
||||
nano.spec
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
494
cut.c
494
cut.c
@@ -1,494 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* cut.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
static int marked_cut; /* Is the cutbuffer from a mark? */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
static int concatenate_cut; /* Should we add this cut string to the
|
||||
end of the last one? */
|
||||
#endif
|
||||
|
||||
static filestruct *cutbottom = NULL;
|
||||
/* Pointer to end of cutbuffer */
|
||||
|
||||
filestruct *get_cutbottom(void)
|
||||
{
|
||||
return cutbottom;
|
||||
}
|
||||
|
||||
void add_to_cutbuffer(filestruct *inptr)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "add_to_cutbuffer() called with inptr->data = %s\n",
|
||||
inptr->data);
|
||||
#endif
|
||||
|
||||
if (cutbuffer == NULL) {
|
||||
cutbuffer = inptr;
|
||||
inptr->prev = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
} else if (concatenate_cut && !ISSET(JUSTIFY_MODE)) {
|
||||
/* Just tack the text in inptr onto the text in cutbottom,
|
||||
unless we're backing up lines while justifying text. */
|
||||
cutbottom->data = charealloc(cutbottom->data,
|
||||
strlen(cutbottom->data) + strlen(inptr->data) + 1);
|
||||
strcat(cutbottom->data, inptr->data);
|
||||
return;
|
||||
#endif
|
||||
} else {
|
||||
cutbottom->next = inptr;
|
||||
inptr->prev = cutbottom;
|
||||
}
|
||||
|
||||
inptr->next = NULL;
|
||||
cutbottom = inptr;
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Cut a marked segment instead of a whole line.
|
||||
*
|
||||
* The first cut character is top->data[top_x]. Unless top == bot, the
|
||||
* last cut line has length bot_x. That is, if bot_x > 0 then we cut to
|
||||
* bot->data[bot_x - 1].
|
||||
*
|
||||
* destructive is whether to actually modify the file structure, if not
|
||||
* then just copy the buffer into cutbuffer and don't pull it from the
|
||||
* file.
|
||||
*
|
||||
* If destructive, then we maintain totsize, totlines, filebot, the
|
||||
* magic line, and line numbers. Also, we set current and current_x so
|
||||
* the cursor will be on the first character after what was cut. We do
|
||||
* not do any screen updates. */
|
||||
void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
|
||||
size_t bot_x, int destructive)
|
||||
{
|
||||
filestruct *tmp, *next;
|
||||
size_t newsize;
|
||||
|
||||
if (top == bot && top_x == bot_x)
|
||||
return;
|
||||
assert(top != NULL && bot != NULL);
|
||||
|
||||
/* Make top be no later than bot. */
|
||||
if (top->lineno > bot->lineno) {
|
||||
filestruct *swap = top;
|
||||
int swap2 = top_x;
|
||||
|
||||
top = bot;
|
||||
bot = swap;
|
||||
|
||||
top_x = bot_x;
|
||||
bot_x = swap2;
|
||||
} else if (top == bot && top_x > bot_x) {
|
||||
/* And bot_x can't be an earlier character than top_x. */
|
||||
int swap = top_x;
|
||||
|
||||
top_x = bot_x;
|
||||
bot_x = swap;
|
||||
}
|
||||
|
||||
/* Make the first cut line manually. */
|
||||
tmp = copy_node(top);
|
||||
newsize = (top == bot ? bot_x - top_x : strlen(top->data + top_x));
|
||||
memmove(tmp->data, top->data + top_x, newsize);
|
||||
null_at(&tmp->data, newsize);
|
||||
add_to_cutbuffer(tmp);
|
||||
|
||||
/* And make the remainder line manually too. */
|
||||
if (destructive) {
|
||||
current_x = top_x;
|
||||
totsize -= newsize;
|
||||
totlines -= bot->lineno - top->lineno;
|
||||
|
||||
newsize = top_x + strlen(bot->data + bot_x) + 1;
|
||||
if (top == bot) {
|
||||
/* In this case, the remainder line is shorter, so we must
|
||||
move text from the end forward first. */
|
||||
memmove(top->data + top_x, bot->data + bot_x,
|
||||
newsize - top_x);
|
||||
top->data = charealloc(top->data, newsize);
|
||||
} else {
|
||||
totsize -= bot_x + 1;
|
||||
|
||||
/* Here, the remainder line might get longer, so we
|
||||
realloc() it first. */
|
||||
top->data = charealloc(top->data, newsize);
|
||||
memmove(top->data + top_x, bot->data + bot_x,
|
||||
newsize - top_x);
|
||||
}
|
||||
}
|
||||
|
||||
if (top == bot) {
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
tmp = top->next;
|
||||
while (tmp != bot) {
|
||||
next = tmp->next;
|
||||
if (!destructive)
|
||||
tmp = copy_node(tmp);
|
||||
else
|
||||
totsize -= strlen(tmp->data) + 1;
|
||||
add_to_cutbuffer(tmp);
|
||||
tmp = next;
|
||||
}
|
||||
|
||||
/* Make the last cut line manually. */
|
||||
tmp = copy_node(bot);
|
||||
null_at(&tmp->data, bot_x);
|
||||
add_to_cutbuffer(tmp);
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
|
||||
if (destructive) {
|
||||
top->next = bot->next;
|
||||
if (top->next != NULL)
|
||||
top->next->prev = top;
|
||||
delete_node(bot);
|
||||
renumber(top);
|
||||
current = top;
|
||||
if (bot == filebot) {
|
||||
filebot = top;
|
||||
assert(bot_x == 0);
|
||||
if (top_x > 0)
|
||||
new_magicline();
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
int do_cut_text(void)
|
||||
{
|
||||
filestruct *fileptr;
|
||||
#ifndef NANO_SMALL
|
||||
int dontupdate = 0;
|
||||
#endif
|
||||
|
||||
assert(current != NULL && current->data != NULL);
|
||||
|
||||
check_statblank();
|
||||
|
||||
if (!ISSET(KEEP_CUTBUFFER)) {
|
||||
free_filestruct(cutbuffer);
|
||||
cutbuffer = NULL;
|
||||
marked_cut = 0;
|
||||
#ifndef NANO_SMALL
|
||||
concatenate_cut = 0;
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Blew away cutbuffer =)\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* You can't cut the magic line except with the mark. But
|
||||
trying does clear the cutbuffer if KEEP_CUTBUFFER is not set. */
|
||||
if (current == filebot
|
||||
#ifndef NANO_SMALL
|
||||
&& !ISSET(MARK_ISSET)
|
||||
#endif
|
||||
)
|
||||
return 0;
|
||||
|
||||
SET(KEEP_CUTBUFFER);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(CUT_TO_END) && !ISSET(MARK_ISSET)) {
|
||||
assert(current_x >= 0 && current_x <= strlen(current->data));
|
||||
|
||||
if (current->data[current_x] == '\0') {
|
||||
/* If the line is empty and we didn't just cut a non-blank
|
||||
line, create a dummy line and add it to the cutbuffer */
|
||||
if (marked_cut != 1 && current->next != filebot) {
|
||||
filestruct *junk = make_new_node(current);
|
||||
|
||||
junk->data = charalloc(1);
|
||||
junk->data[0] = '\0';
|
||||
add_to_cutbuffer(junk);
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
do_delete();
|
||||
marked_cut = 2;
|
||||
return 1;
|
||||
} else {
|
||||
SET(MARK_ISSET);
|
||||
|
||||
mark_beginx = strlen(current->data);
|
||||
mark_beginbuf = current;
|
||||
dontupdate = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ISSET(MARK_ISSET)) {
|
||||
/* Don't do_update() and move the screen position if the marked
|
||||
area lies entirely within the screen buffer */
|
||||
dontupdate |= current->lineno >= edittop->lineno &&
|
||||
current->lineno <= editbot->lineno &&
|
||||
mark_beginbuf->lineno >= edittop->lineno &&
|
||||
mark_beginbuf->lineno <= editbot->lineno;
|
||||
cut_marked_segment(current, current_x, mark_beginbuf,
|
||||
mark_beginx, 1);
|
||||
|
||||
placewewant = xplustabs();
|
||||
UNSET(MARK_ISSET);
|
||||
|
||||
/* If we just did a marked cut of part of a line, we should add
|
||||
the first line of any cut done immediately afterward to the
|
||||
end of this cut, as Pico does. */
|
||||
if (current == mark_beginbuf && current_x < strlen(current->data))
|
||||
concatenate_cut = 1;
|
||||
marked_cut = 1;
|
||||
if (dontupdate)
|
||||
edit_refresh();
|
||||
else
|
||||
edit_update(current, CENTER);
|
||||
set_modified();
|
||||
|
||||
return 1;
|
||||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
totlines--;
|
||||
totsize -= strlen(current->data) + 1;
|
||||
fileptr = current;
|
||||
current = current->next;
|
||||
current->prev = fileptr->prev;
|
||||
add_to_cutbuffer(fileptr);
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
|
||||
if (fileptr == fileage)
|
||||
fileage = current;
|
||||
else
|
||||
current->prev->next = current;
|
||||
|
||||
if (fileptr == edittop)
|
||||
edittop = current;
|
||||
|
||||
renumber(current);
|
||||
current_x = 0;
|
||||
edit_refresh();
|
||||
set_modified();
|
||||
marked_cut = 0;
|
||||
#ifndef NANO_SMALL
|
||||
concatenate_cut = 0;
|
||||
#endif
|
||||
placewewant = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_uncut_text(void)
|
||||
{
|
||||
filestruct *tmp = current, *fileptr = current;
|
||||
filestruct *newbuf = NULL, *newend = NULL;
|
||||
char *tmpstr, *tmpstr2;
|
||||
filestruct *hold = current;
|
||||
int i;
|
||||
|
||||
wrap_reset();
|
||||
check_statblank();
|
||||
if (cutbuffer == NULL || fileptr == NULL)
|
||||
return 0; /* AIEEEEEEEEEEEE */
|
||||
|
||||
/* If we're uncutting a previously non-marked block, uncut to end if
|
||||
we're not at the beginning of the line. If we are at the
|
||||
beginning of the line, set placewewant to 0. Pico does both of
|
||||
these. */
|
||||
if (marked_cut == 0) {
|
||||
if (current_x != 0)
|
||||
marked_cut = 2;
|
||||
else
|
||||
placewewant = 0;
|
||||
}
|
||||
|
||||
/* If we're going to uncut on the magicline, always make a new
|
||||
magicline in advance. */
|
||||
if (current->next == NULL)
|
||||
new_magicline();
|
||||
|
||||
if (marked_cut == 0 || cutbuffer->next != NULL)
|
||||
{
|
||||
newbuf = copy_filestruct(cutbuffer);
|
||||
for (newend = newbuf; newend->next != NULL && newend != NULL;
|
||||
newend = newend->next)
|
||||
totlines++;
|
||||
}
|
||||
|
||||
/* Hook newbuf into fileptr */
|
||||
if (marked_cut != 0) {
|
||||
int recenter_me = 0;
|
||||
/* Should we eventually use edit_update(CENTER)? */
|
||||
|
||||
/* If there's only one line in the cutbuffer */
|
||||
if (cutbuffer->next == NULL) {
|
||||
size_t buf_len = strlen(cutbuffer->data);
|
||||
size_t cur_len = strlen(current->data);
|
||||
|
||||
current->data = charealloc(current->data, cur_len + buf_len + 1);
|
||||
memmove(current->data + current_x + buf_len,
|
||||
current->data + current_x, cur_len - current_x + 1);
|
||||
strncpy(current->data + current_x, cutbuffer->data, buf_len);
|
||||
/* Use strncpy() to not copy the terminal '\0'. */
|
||||
|
||||
current_x += buf_len;
|
||||
totsize += buf_len;
|
||||
|
||||
placewewant = xplustabs();
|
||||
update_cursor();
|
||||
} else { /* yuck -- no kidding! */
|
||||
tmp = current->next;
|
||||
/* New beginning */
|
||||
tmpstr = charalloc(current_x + strlen(newbuf->data) + 1);
|
||||
strncpy(tmpstr, current->data, current_x);
|
||||
strcpy(&tmpstr[current_x], newbuf->data);
|
||||
totsize += strlen(newbuf->data) + strlen(newend->data) + 1;
|
||||
|
||||
/* New end */
|
||||
tmpstr2 = charalloc(strlen(newend->data) +
|
||||
strlen(¤t->data[current_x]) + 1);
|
||||
strcpy(tmpstr2, newend->data);
|
||||
strcat(tmpstr2, ¤t->data[current_x]);
|
||||
|
||||
free(current->data);
|
||||
current->data = tmpstr;
|
||||
current->next = newbuf->next;
|
||||
newbuf->next->prev = current;
|
||||
delete_node(newbuf);
|
||||
|
||||
current_x = strlen(newend->data);
|
||||
placewewant = xplustabs();
|
||||
free(newend->data);
|
||||
newend->data = tmpstr2;
|
||||
|
||||
newend->next = tmp;
|
||||
|
||||
/* If tmp isn't null, we're in the middle: update the
|
||||
prev pointer. If it IS null, we're at the end; update
|
||||
the filebot pointer */
|
||||
|
||||
if (tmp != NULL)
|
||||
tmp->prev = newend;
|
||||
else {
|
||||
/* Fix the editbot pointer too */
|
||||
if (editbot == filebot)
|
||||
editbot = newend;
|
||||
filebot = newend;
|
||||
new_magicline();
|
||||
}
|
||||
|
||||
/* Now why don't we update the totsize also */
|
||||
for (tmp = current->next; tmp != newend; tmp = tmp->next)
|
||||
totsize += strlen(tmp->data) + 1;
|
||||
|
||||
current = newend;
|
||||
if (editbot->lineno < newend->lineno)
|
||||
recenter_me = 1;
|
||||
}
|
||||
|
||||
/* If marked cut == 2, that means that we're doing a cut to end
|
||||
and we don't want anything else on the line, so we have to
|
||||
screw up all the work we just did and separate the line.
|
||||
There must be a better way to do this, but not at 1AM on a
|
||||
work night. */
|
||||
|
||||
if (marked_cut == 2) {
|
||||
tmp = make_new_node(current);
|
||||
tmp->data = mallocstrcpy(NULL, current->data + current_x);
|
||||
splice_node(current, tmp, current->next);
|
||||
null_at(¤t->data, current_x);
|
||||
current = current->next;
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
|
||||
/* Extra line added, update stuff */
|
||||
totlines++;
|
||||
totsize++;
|
||||
}
|
||||
/* Renumber from BEFORE where we pasted ;) */
|
||||
renumber(hold);
|
||||
|
||||
#ifdef DEBUG
|
||||
dump_buffer(fileage);
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
set_modified();
|
||||
if (recenter_me)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
edit_refresh();
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fileptr != fileage) {
|
||||
tmp = fileptr->prev;
|
||||
tmp->next = newbuf;
|
||||
newbuf->prev = tmp;
|
||||
} else
|
||||
fileage = newbuf;
|
||||
totlines++; /* Unmarked uncuts don't split lines */
|
||||
|
||||
/* This is so uncutting at the top of the buffer will work => */
|
||||
if (current_y == 0)
|
||||
edittop = newbuf;
|
||||
|
||||
/* Connect the end of the buffer to the filestruct */
|
||||
newend->next = fileptr;
|
||||
fileptr->prev = newend;
|
||||
|
||||
/* Recalculate size *sigh* */
|
||||
for (tmp = newbuf; tmp != fileptr; tmp = tmp->next)
|
||||
totsize += strlen(tmp->data) + 1;
|
||||
|
||||
i = editbot->lineno;
|
||||
renumber(newbuf);
|
||||
/* Center the screen if we've moved beyond the line numbers of both
|
||||
the old and new editbots */
|
||||
if (i < newend->lineno && editbot->lineno < newend->lineno)
|
||||
edit_update(fileptr, CENTER);
|
||||
else
|
||||
edit_refresh();
|
||||
|
||||
#ifdef DEBUG
|
||||
dump_buffer_reverse();
|
||||
#endif
|
||||
|
||||
set_modified();
|
||||
return 1;
|
||||
}
|
||||
2
doc/.cvsignore
Normal file
2
doc/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
3
doc/Makefile.am
Normal file
3
doc/Makefile.am
Normal file
@@ -0,0 +1,3 @@
|
||||
SUBDIRS = man texinfo
|
||||
|
||||
EXTRA_DIST = faq.html nanorc.sample
|
||||
@@ -3,10 +3,9 @@
|
||||
<head>
|
||||
<title>The GNU nano editor FAQ</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="GENERATOR" content="Mozilla/4.73 [en] (X11; U; Linux 2.2.16 i586) [Netscape]">
|
||||
</head>
|
||||
<body text="#330000" bgcolor="#ffffff" link="#0000ef" vlink="#51188e" alink="#ff0000">
|
||||
<h1>The nano FAQ</h1>
|
||||
<h1>The GNU nano editor FAQ</h1>
|
||||
<h2>Table of Contents</h2>
|
||||
<h2><a href="#1">1. General</a></h2>
|
||||
<blockquote><p><a href="#1.1">1.1 About this FAQ</a><br>
|
||||
@@ -25,21 +24,24 @@
|
||||
<blockquote><p><a href="#3.1">3.1. How do I install the RPM or DEB package?</a><br>
|
||||
<a href="#3.2">3.2. Compiling from source: WHAT THE HECK DO I DO NOW?</a><br>
|
||||
<a href="#3.3">3.3. Why does everything go into /usr/local?</a><br>
|
||||
<a href="#3.4">3.4. I get errors about 'bindtextdomain','gettext' and/or 'gettextdomain'. What can I do about it?</a><br>
|
||||
<a href="#3.4">3.4. I get errors about 'bindtextdomain','gettext', and/or 'gettextdomain'. What can I do about it?</a><br>
|
||||
<a href="#3.5">3.5. Nano should automatically run strip on the binary when installing it!</a><br>
|
||||
<a href="#3.6">3.6. How can I make the executable smaller? This is too bloated!</a><br>
|
||||
<a href="#3.7">3.7. Tell me more about this multibuffer stuff!</a><br>
|
||||
<a href="#3.8">3.8. How do I make a .nanorc file that nano will read when I start it?</a></p></blockquote>
|
||||
<a href="#3.8">3.8. Tell me more about this verbatim input stuff!</a><br>
|
||||
<a href="#3.9">3.9. How do I make a .nanorc file that nano will read when I start it?</a></p></blockquote>
|
||||
<h2><a href="#4">4. Running</a></h2>
|
||||
<blockquote><p><a href="#4.1">4.1. Ack! My backspace/delete/enter/double bucky/meta key doesn't seem to work! What can I do?</a><br>
|
||||
<a href="#4.2">4.2. Nano crashes when I type <insert keystroke here>!</a><br>
|
||||
<a href="#4.3">4.3. Nano crashes when I resize my window. How can I fix that?</a><br>
|
||||
<a href="#4.4">4.4. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</a><br>
|
||||
<a href="#4.5a">4.5a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</a><br>
|
||||
<a href="#4.5b">4.5b. [version 1.2.2 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</a><br>
|
||||
<a href="#4.6">4.6. I get the message "NumLock glitch detected. Keypad will malfunction with NumLock off." What gives?</a><br>
|
||||
<a href="#4.7">4.7. How do I make nano my default editor (in Pine, mutt, etc.)?</a><br>
|
||||
<a href="#4.8">4.8. I've compiled nano with color support, but I don't see any color when I run it!</a></p></blockquote>
|
||||
<blockquote><p><a href="#4.1">4.1. How do I open a file with a name beginning with '+' from the command line?</a><br>
|
||||
<a href="#4.2">4.2. Ack! My backspace/delete/enter/double bucky/meta key doesn't seem to work! What can I do?</a><br>
|
||||
<a href="#4.3">4.3. How do I type the F13-F16 keys shown in the help browser? My keyboard only has F1-F12!</a><br>
|
||||
<a href="#4.4">4.4. Nano crashes when I type <insert keystroke here>!</a><br>
|
||||
<a href="#4.5">4.5. Nano crashes when I resize my window. How can I fix that?</a><br>
|
||||
<a href="#4.6">4.6. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</a><br>
|
||||
<a href="#4.7a">4.7a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</a><br>
|
||||
<a href="#4.7b">4.7b. [version 1.1.99pre1 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</a><br>
|
||||
<a href="#4.8">4.8. How do I make nano my default editor (in Pine, mutt, etc.)?</a><br>
|
||||
<a href="#4.9">4.9. I've compiled nano with color support, but I don't see any color when I run it!</a><br>
|
||||
<a href="#4.10">4.10. How do I select text for the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</a></p></blockquote>
|
||||
<h2><a href="#5">5. Internationalization</a></h2>
|
||||
<blockquote><p><a href="#5.1">5.1. There's no translation for my language!</a><br>
|
||||
<a href="#5.2">5.2. I don't like the translation for <x> in my language. How can I fix it?</a></p></blockquote>
|
||||
@@ -51,7 +53,7 @@
|
||||
<a href="#6.5">6.5. Why doesn't UW simply change their license?</a><br>
|
||||
<a href="#6.6">6.6. What if tomorrow UW changes the license to be truly Free Software?</a></p></blockquote>
|
||||
<h2><a href="#7">7. Miscellaneous</a></h2>
|
||||
<blockquote><p><a href="#7.1">7.1. Nano related mailing lists.</a><br>
|
||||
<blockquote><p><a href="#7.1">7.1. Nano-related mailing lists.</a><br>
|
||||
<a href="#7.2">7.2. I want to send the development team a big load of cash (or just a thank you).</a><br>
|
||||
<a href="#7.3">7.3. How do I submit a patch?</a><br>
|
||||
<a href="#7.4">7.4. How do I join the development team?</a><br>
|
||||
@@ -60,7 +62,7 @@
|
||||
<hr width="100%">
|
||||
<h1><a name="1"></a>1. General</h1>
|
||||
<h2><a name="1.1"></a>1.1 About this FAQ</h2>
|
||||
<blockquote><p>This FAQ was written and is maintained by Chris Allegretta <<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>>, who also happens to be the creator of nano. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
|
||||
<blockquote><p>This FAQ was originally written and maintained by Chris Allegretta <<a href="mailto:chrisa@asty.org">chrisa@asty.org</a>>, who also happens to be the creator of nano. It is currently maintained by David Lawrence Ramsey <<a href="mailto:pooka_regent@sluggy.net">pooka_regent@sluggy.net</a>>. Maybe someone else will volunteer to maintain this FAQ someday, who knows...</p></blockquote>
|
||||
<h2><a name="1.2"></a>1.2. How do I contribute to it?</h2>
|
||||
<blockquote><p>Your best bet is to send it to the nano email address, <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a> and if it is useful enough it will be included in future versions.</p></blockquote>
|
||||
<h2><a name="1.3"></a>1.3. What is GNU nano?</h2>
|
||||
@@ -78,9 +80,9 @@
|
||||
<h2><a name="1.5"></a>1.5. Why the name change from TIP?</h2>
|
||||
<blockquote><p>On January 10, 2000, TIP was officially renamed to nano because of a namespace conflict with another program called 'tip'. The original 'tip' program "establishes a full duplex terminal connection to a remote host", and was included with many older Unix systems (and newer ones like Solaris). The conflict was not noticed at first because there is no 'tip' utility included with most GNU/Linux distributions (where nano was developed).</p></blockquote>
|
||||
<h2><a name="1.6"></a>1.6. What is the current version of nano?</h2>
|
||||
<blockquote><p>The current version of nano *should* be 1.2.2. Of course you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
|
||||
<blockquote><p>The current version of nano *should* be 1.3.8. Of course you should always check the nano homepage to see what the latest and greatest version is.</p></blockquote>
|
||||
<h2><a name="1.7"></a>1.7. I want to read the man page without having to download the program!</h2>
|
||||
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v1.2/nano.1.html">here</a>.</p></blockquote>
|
||||
<blockquote><p>Jeez, demanding, aren't we? Okay, look <a href="http://www.nano-editor.org/dist/v1.3/nano.1.html">here</a>.</p></blockquote>
|
||||
<hr width="100%">
|
||||
<h1><a name="2"></a>2. Where to get GNU nano.</h1>
|
||||
<h2><a name="2.1"></a>2.1. FTP and WWW sites that carry nano.</h2>
|
||||
@@ -133,55 +135,65 @@
|
||||
<blockquote><p>Well, that's what the <b>configure</b> script defaults to. If you wish to change this, simply do this:</p>
|
||||
<p><b>./configure --prefix=/usr</b></p>
|
||||
<p>to put nano into /usr/bin when you run <b>make install</b>.</p></blockquote>
|
||||
<h2><a name="3.4"></a>3.4. I get errors about 'bindtextdomain', 'gettext' and/or 'gettextdomain'. What can I do about it?</h2>
|
||||
<h2><a name="3.4"></a>3.4. I get errors about 'bindtextdomain', 'gettext', and/or 'gettextdomain'. What can I do about it?</h2>
|
||||
<blockquote><p>Try doing a <b>./configure --with-included-gettext</b> and see if that solves your problem. You may need to do a <b>make clean; make</b> to get it to work fully.</p></blockquote>
|
||||
<h2><a name="3.5"></a>3.5. Nano should automatically run strip on the binary when installing it!</h2>
|
||||
<blockquote><p>Actually, it does, but you have to use <b>make install-strip</b>. The default make install does not, and will not, run strip automatically.</p></blockquote>
|
||||
<h2><a name="3.6"></a>3.6. How can I make the executable smaller? This is too bloated!</h2>
|
||||
<blockquote><p>Actually, there are several parts of the editor that can be disabled. You can pass arguments to the <b>configure</b> script that disable certain features. Here's a brief list:</p>
|
||||
<pre>
|
||||
<b>--disable-tabcomp</b> Disables tab completion code for a smaller binary
|
||||
<b>--disable-tabcomp</b> Disable tab completion code for a smaller
|
||||
binary
|
||||
<b>--disable-justify</b> Disable justify/unjustify function
|
||||
<b>--disable-speller</b> Disables spell checker function
|
||||
<b>--disable-help</b> Disables help function (^G)
|
||||
<b>--disable-browser</b> Disables mini file browser
|
||||
<b>--disable-wrapping</b> Disables all wrapping of text (and -w flag)
|
||||
<b>--disable-mouse</b> Disables mouse support (and -m flag)
|
||||
<b>--disable-speller</b> Disable spell checker function
|
||||
<b>--disable-help</b> Disable help function
|
||||
<b>--disable-browser</b> Disable mini file browser
|
||||
<b>--disable-wrapping</b> Disable all wrapping of text (and -w flag)
|
||||
<b>--disable-mouse</b> Disable mouse support (and -m flag)
|
||||
<b>--disable-operatingdir</b> Disable setting of operating directory</pre>
|
||||
<p>There's also the <b>--enable-tiny</b> option which disables everything above, as well as some larger chunks of the program (like the marker code that you use Control-^ to select with). Also, if you know you aren't going to be using other languages you can use <b>--disable-nls</b> to disable internationalization and save a few K to a few dozen K depending on if you have locale support on your system. And finally there's always good old <b>strip</b> to strip all debugging code and code that exists in libraries on your system.</p>
|
||||
<p>If, on the other hand, you can't live without bells and whistles, you could try:</p>
|
||||
<pre>
|
||||
<b>--enable-extra</b> Enable extra functions, including easter eggs
|
||||
<b>--enable-extra</b> Enable extra features, currently only easter eggs
|
||||
<b>--enable-nanorc</b> Enable use of .nanorc file
|
||||
<b>--enable-color</b> Enables color and syntax highlighting
|
||||
<b>--enable-multibuffer</b> Enables having multiple file buffers open
|
||||
<b>--enable-all</b> Enables all of the above features</pre></blockquote>
|
||||
<b>--enable-color</b> Enable color and syntax highlighting
|
||||
<b>--enable-multibuffer</b> Enable having multiple file buffers open
|
||||
<b>--enable-all</b> Enable all of the above features
|
||||
<b>--disable-wrapping-as-root</b>
|
||||
Turn off wrapping of text by default when the
|
||||
user is root</pre></blockquote>
|
||||
<h2><a name="3.7"></a>3.7. Tell me more about this multibuffer stuff!</h2>
|
||||
<blockquote><p>To use multiple file buffers, you must be using nano 1.1.12 or newer, and you must have configured nano with <b>--enable-multibuffer</b> or <b>--enable-extra</b> (use nano -V to check). Then when you want to enable inserting a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano. </p>
|
||||
<blockquote><p>To use multiple file buffers, you must be using nano 1.1.0 or newer, and you must have configured nano with <b>--enable-multibuffer</b> (use nano -V to check). Then when you want to enable inserting a file into its own buffer instead of into the current file, just hit <b>Meta-F</b>, then insert the file as normal with <b>^R</b>. If you always want files to be loaded into their own buffers, use the <b>--multibuffer</b> or <b>-F</b> flag when you invoke nano.</p>
|
||||
<p>You can move between the buffers you have open with the <b>Meta-<</b> and <b>Meta-></b> keys, or more easily with <b>Meta-,</b> and <b>Meta-.</b> (clear as mud, right? =-). When you have more than one file buffer open, the ^X shortcut will say "Close", instead of the normal "Exit" when only one buffer is open.</p></blockquote>
|
||||
<h2><a name="3.8"></a>3.8. How do I make a .nanorc file that nano will read when I start it?</h2>
|
||||
<blockquote>It's not hard at all! But, your version of nano must have been compiled with <b>--enable-nanorc</b>, and again must be version 1.1.12 or newer (use nano -V to check your version and compiled features). Then simply copy the <b>nanorc.sample</b> that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax is simple. Flags are turned on and off by using the word <b>set</b> and the getopt_long flag for the feature, for example "set pico" or "set nowrap".</blockquote>
|
||||
<h2><a name="3.8"></a>3.8. Tell me more about this verbatim input stuff!</h2>
|
||||
<blockquote><p>To use verbatim input, you must be using nano 1.3.1 or newer. When you want to insert a literal character into the file you're editing, such as a control character that nano usually treats as a command, first press <b>Meta-V</b>. (If you're not at a prompt, you'll get the message "Verbatim Input".) Then press the key(s) that generate the character you want.</p>
|
||||
<p>Alternatively, you can press <b>Meta-V</b> and then type a four-digit hexadecimal code from 0000 to ffff (case-insensitive), and the character with the corresponding value will be inserted instead.</p></blockquote>
|
||||
<h2><a name="3.9"></a>3.9. How do I make a .nanorc file that nano will read when I start it?</h2>
|
||||
<blockquote><p>It's not hard at all! But, your version of nano must have been compiled with <b>--enable-nanorc</b>, and again must be version 1.1.12 or newer (use nano -V to check your version and compiled features). Then simply copy the <b>nanorc.sample</b> that came with the nano source or your nano package (most likely in /usr/doc/nano) to .nanorc in your home directory. If you didn't get one, the syntax is simple. Flags are turned on and off by using the word <b>set</b> and the getopt_long flag for the feature, for example "set nowrap" or "set suspend".</p></blockquote>
|
||||
<hr width="100%">
|
||||
<h1><a name="4"></a>4. Running</h1>
|
||||
<h2><a name="4.1"></a>4.1. Ack! My backspace/delete/enter/double bucky/meta key doesn't seem to work! What can I do?</h2>
|
||||
<h2><a name="4.1"></a>4.1. How do I open a file with a name beginning with '+' from the command line?</h2>
|
||||
<blockquote><p>If a command line option that begins with '+' is followed by another option, the former is always treated as a starting line number and the latter is always treated as a filename. If a command line option that begins with '+' isn't followed by another option, it's always treated as a filename. Examples:</p>
|
||||
<p>To open '+filename.txt' starting on line 1: <b>nano +filename.txt</b><br>
|
||||
To open '+filename.txt' starting on line 10: <b>nano +10 +filename.txt</b><br>
|
||||
To open '+filename.txt' starting on line 1 and 'filename.txt' starting on line 10 (if nano has been compiled with multibuffer support): <b>nano +1 +filename.txt +20 filename.txt</b></p></blockquote>
|
||||
<h2><a name="4.2"></a>4.2. Ack! My backspace/delete/enter/double bucky/meta key doesn't seem to work! What can I do?</h2>
|
||||
<blockquote><p>Try setting your $TERM variable to 'vt100'. Nano doesn't yet support every term entry under the sun.</p>
|
||||
<p>Bourne shell users (like bash): <b>export TERM=vt100</b><br>
|
||||
<p>Bourne shell users (bash and sh): <b>export TERM=vt100</b><br>
|
||||
C Shell users (tcsh and csh): <b>setenv TERM vt100</b></p></blockquote>
|
||||
<h2><a name="4.2"></a>4.2. Nano crashes when I type <insert keystroke here>!</h2>
|
||||
<h2><a name="4.3"></a>4.3. How do I type the F13-F16 keys shown in the help browser? My keyboard only has F1-F12!</h2>
|
||||
<blockquote><p>It depends on the terminal type you're using. On some terminals, such as the FreeBSD console, xterm, konsole, and gnome-terminal, Shift-F1 to Shift-F4 will generate F13 to F16. On other terminals, such as the Linux console, rxvt, or Eterm, Shift-F3 to Shift-F6 will generate F13 to F16.</p></blockquote>
|
||||
<h2><a name="4.4"></a>4.4. Nano crashes when I type <insert keystroke here>!</h2>
|
||||
<blockquote><p>If you aren't trying some bizarre keystroke combination with some bizarre $TERM entry, chances are you have found a bug. You are welcome to submit it to the <a href="mailto:nano-devel@gnu.org">nano-devel</a> list or to <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</p></blockquote>
|
||||
<h2><a name="4.3"></a>4.3. Nano crashes when I resize my window. How can I fix that?</h2>
|
||||
<h2><a name="4.5"></a>4.5. Nano crashes when I resize my window. How can I fix that?</h2>
|
||||
<blockquote><p>Older versions of nano had this problem, please upgrade to a newer version (at least 0.9.9 would be great, 0.9.12 is recommended).</p></blockquote>
|
||||
<h2><a name="4.4"></a>4.4. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</h2>
|
||||
<h2><a name="4.6"></a>4.6. [version 1.1.12 and earlier] Why does nano show ^\ in the shortcut list instead of ^J?</h2>
|
||||
<blockquote><p>The help (^G) and justify (^J) function were among the last to be written. To show the improvements that nano had over Pico (go to line # and replace), ^_ and ^\ were put on the shortcut list. Later, ^G came back in place of ^_ as it proved to be very valuable for new Unix users. If you use the <b>-p</b> option to nano (or hit Meta-P) you will get the same shortcuts at the bottom as Pico.</p></blockquote>
|
||||
<a name="4.5"></a>
|
||||
<h2><a name="4.5a"></a>4.5a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</h2>
|
||||
<h2><a name="4.7a"></a>4.7a. [version 1.1.12 and earlier] When I type in a search string, the string I last searched for is already in front of my cursor! What happened?!</h2>
|
||||
<blockquote><p>In nano version 0.9.20, the default is to have a completely consistent user interface across all user input functions. This means that regardless of whether you're being asked for a filename to insert or write, or a string to search for, the previous value is already inserted before the cursor. If you prefer the old behavior, use the Pico emulation mode (-p or --pico) or just hit Meta-P while in nano (see the ^G help text for more details).</p></blockquote>
|
||||
<h2><a name="4.5b"></a>4.5b. [version 1.2.2 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</h2>
|
||||
<h2><a name="4.7b"></a>4.7b. [version 1.1.99pre1 and later] Hey, the search string behavior has reverted, it's now like Pico, what happened to the consistency?</h2>
|
||||
<blockquote><p>It was decided that consistency was nice, but people are used to Pico's inconsistent behavior. Also, in version 1.1.99pre1, search and replace history was introduced. If you wish to edit your previous search/replace entry (or any previous entry), you can do so by hitting the up arrow to cycle through your history. This method allows the best of both worlds: You don't need to erase the previous string if you want to enter a new one, but you can with one keystroke recall previous entries for editing. Therefore there is now no "Pico mode", nano is and has always been a Pico <b>clone</b>, and clones by default should be compatible.</p></blockquote>
|
||||
<h2><a name="4.6"></a>4.6. I get the message "NumLock glitch detected. Keypad will malfunction with NumLock off." What gives?</h2>
|
||||
<blockquote><p>Nano (and actually almost all console editors) has issues when cycling the NumLock key in certain X terminals (rxvt, aterm, wterm, etc...). When you switch NumLock from on to off, you put the terminal into an "application mode" that changes what sequences are sent by the keypad. These sequences vary sufficiently from terminal to terminal that it is nearly impossible to work around them from within nano.</p>
|
||||
<p>In a nutshell, if you want to be able to use the keypad with the arrow and page up/down functionality, you have to exit nano and reset your terminal (presumably with "reset" or "stty sane" or similar) and then run nano again with NumLock off. If you know an easier way to restore "normal mode", please mail <a href="mailto:nano@nano-editor.org">nano@nano-editor.org</a>.</p></blockquote>
|
||||
<h2><a name="4.7"></a>4.7. How do I make nano my default editor (in Pine, mutt, etc.)?</h2>
|
||||
<h2><a name="4.8"></a>4.8. How do I make nano my default editor (in Pine, mutt, etc.)?</h2>
|
||||
<blockquote><p>You need to make nano your $EDITOR. If you want this to be saved, you should put a line like this in your <b>.bashrc</b> if you use bash (or <b>.zshrc</b> if you believe in zsh):</p>
|
||||
<p><b>export EDITOR=/usr/local/bin/nano</b></p>
|
||||
<p>or if you use tcsh put this in your <b>.cshrc</b> file:</p>
|
||||
@@ -194,8 +206,10 @@
|
||||
<p>Mutt users should see an effect immediately the next time you log in, no further configuration is needed. However, if you want to let people know you use nano to compose your email messages, you can put a line like this in your <b>.muttrc</b>:</p>
|
||||
<p><b>my_hdr X-Composer: nano x.y.z</b></p>
|
||||
<p>Again, replace x.y.z with the version of nano you use.</p></blockquote>
|
||||
<h2><a name="4.8"></a>4.8. I've compiled nano with color support, but I don't see any color when I run it!</h2>
|
||||
<blockquote><p>If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Some example configurations are in the <b>nanorc.sample</b> that comes with the nano source or your nano package. See Section <a href="#3.8">3.8</a>.</p></blockquote>
|
||||
<h2><a name="4.9"></a>4.9. I've compiled nano with color support, but I don't see any color when I run it!</h2>
|
||||
<blockquote><p>If you want nano to actually use color, you have to specify the color configurations you want it to use in your .nanorc. Some example configurations are in the <b>nanorc.sample</b> that comes with the nano source or your nano package. See Section <a href="#3.9">3.9</a>.</p></blockquote>
|
||||
<h2><a name="4.10"></a>4.10. How do I select text for the clipboard in an X terminal when I'm running nano in one and nano's mouse support is turned on?</h2>
|
||||
<blockquote><p>Try holding down the Shift key and selecting the text as you normally would.</p></blockquote>
|
||||
<hr width="100%">
|
||||
<h1><a name="5"></a>5. Internationalization</h1>
|
||||
<h2><a name="5.1"></a>5.1. There's no translation for my language!</h2>
|
||||
@@ -220,13 +234,13 @@
|
||||
<blockquote><p>Honestly nothing would make me happier than to see that happen. Nano would continue to be developed independently until such time as Pico had all the features nano did or the projects merged. That just does not seem very likely given that there has been no sign of any changes in the past few years in a positive direction.</p></blockquote>
|
||||
<hr width="100%">
|
||||
<h1><a name="7"></a>7. Miscellaneous</h1>
|
||||
<h2><a name="7.1"></a>7.1. Nano related mailing lists.</h2>
|
||||
<h2><a name="7.1"></a>7.1. Nano-related mailing lists.</h2>
|
||||
<blockquote><p>There are three mailing lists for nano hosted at <a href="http://savannah.gnu.org/">Savannah</a>, info-nano, help-nano and nano-devel. Info-nano is a very low traffic list where new versions of nano are announced (surprise!) Help-nano is for getting help with the editor without needing to hear all of the development issues surrounding it. Nano-devel is a normally low, sometimes high traffic list for discussing the present and future development of nano. Here are links to where you can sign up for a given list:</p>
|
||||
<p>info-nano - <a href="http://mail.gnu.org/mailman/listinfo/info-nano/">http://mail.gnu.org/mailman/listinfo/info-nano/</a><br>
|
||||
help-nano - <a href="http://mail.gnu.org/mailman/listinfo/help-nano/">http://mail.gnu.org/mailman/listinfo/help-nano/</a><br>
|
||||
nano-devel - <a href="http://mail.gnu.org/mailman/listinfo/nano-devel/">http://mail.gnu.org/mailman/listinfo/nano-devel/</a></p></blockquote>
|
||||
<h2><a name="7.2"></a>7.2. I want to send the development team a big load of cash (or just a thank you).</h2>
|
||||
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="http://www.nano-editor.org/dist/v1.2/BUGS">bug</a> in the program or implement a <a href="http://www.nano-editor.org/dist/v1.2/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
|
||||
<blockquote><p>That's fine. Send it <a href="mailto:nano-devel@gnu.org">our way</a>! Better yet, fix a <a href="http://www.nano-editor.org/dist/v1.3/BUGS">bug</a> in the program or implement a <a href="http://www.nano-editor.org/dist/v1.3/TODO">cool feature</a> and send us that instead (though cash is fine too).</p></blockquote>
|
||||
<h2><a name="7.3"></a>7.3. How do I submit a patch?</h2>
|
||||
<blockquote><p>See Section <a href="#7.2">7.2</a>.</p></blockquote>
|
||||
<h2><a name="7.4"></a>7.4. How do I join the development team?</h2>
|
||||
@@ -236,8 +250,18 @@
|
||||
<h2><a name="8"></a>8. ChangeLog</h2>
|
||||
<blockquote>
|
||||
<p>
|
||||
2005/06/15 - Update description of --enable-extra, and add missing line breaks. (DLR)<br>
|
||||
2005/06/13 - Minor capitalization and wording fixes. (DLR)<br>
|
||||
2005/06/08 - Updated section 1.1 to mention the current maintainer. (DLR)<br>
|
||||
2005/03/09 - Added question about opening files with names beginning with '+'s, and added a few more miscellaneous cosmetic fixes. (DLR)<br>
|
||||
2005/01/03 - Removed now-inaccurate note about verbatim input's not working at prompts, and update its description to mention that it handles hexadecimal values now. (DLR)<br>
|
||||
2004/11/21 - Listed sh as an example of a Bourne shell. (DLR)<br>
|
||||
2004/11/05 - Fixed inaccuracy: Pico compatibility mode was made the default in nano 1.1.99pre1, not 1.2.2. Also added question about how to type F13-F16 on terminals lacking keys past F12 (suggested by Chris), question about how to select text for the clipboard in X terminals with nano's mouse support turned on (answer found by Joseph Birthisel), and misc. fixes and link updates. (DLR)<br>
|
||||
2004/04/07 - Removed NumLock glitch question, as it's no longer needed. (DLR)<br>
|
||||
2004/01/30 - Fixed inaccuracy: multibuffer mode was first in nano 1.1.0, not 1.1.12. (DLR)<br>
|
||||
2003/12/31 - Added question about the new verbatim input function, and a few minor fixes. Removed reference to "set pico" (DLR).<br>
|
||||
2003/07/02 - Added question about nano's not showing color when it's compiled with color support (DLR; suggested by Jordi).<br>
|
||||
2003/02/23 - Updated RPM links for nano 1.2.x. (DLR).<br>
|
||||
2003/02/23 - Updated RPM links for nano 1.2.x (DLR).<br>
|
||||
2003/01/16 - Split section 4.5 into 4.5a and 4.5b for search string behavior. Added --enable-all docs.<br>
|
||||
2002/12/28 - More misc. fixes (David Benbennick, DLR).<br>
|
||||
2002/10/25 - Misc. fixes and link updates (DLR).<br>
|
||||
4
doc/man/.cvsignore
Normal file
4
doc/man/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nanorc.5.html
|
||||
nano.1.html
|
||||
12
doc/man/Makefile.am
Normal file
12
doc/man/Makefile.am
Normal file
@@ -0,0 +1,12 @@
|
||||
SUBDIRS = fr
|
||||
|
||||
man_MANS = nano.1 nanorc.5
|
||||
|
||||
BUILT_SOURCES = nano.1.html nanorc.5.html
|
||||
|
||||
nano.1.html: nano.1
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)
|
||||
4
doc/man/fr/.cvsignore
Normal file
4
doc/man/fr/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nanorc.5.html
|
||||
nano.1.html
|
||||
12
doc/man/fr/Makefile.am
Normal file
12
doc/man/fr/Makefile.am
Normal file
@@ -0,0 +1,12 @@
|
||||
man_MANS = nano.1 nanorc.5
|
||||
|
||||
mandir = @mandir@/fr
|
||||
|
||||
BUILT_SOURCES = nano.1.html nanorc.5.html
|
||||
|
||||
nano.1.html: nano.1
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
nanorc.5.html: nanorc.5
|
||||
cat $< | groff -t -mandoc -Thtml > $@
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(BUILT_SOURCES)
|
||||
246
doc/man/fr/nano.1
Normal file
246
doc/man/fr/nano.1
Normal file
@@ -0,0 +1,246 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nano.1 is copyright (C) 1999, 2000, 2001, 2002, 2003 by
|
||||
.\" Chris Allegretta <chrisa@asty.org>
|
||||
.\"
|
||||
.\" (c) 2003-2004 Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>
|
||||
.\" pour l'adaptation française
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" Ce document est libre. Reportez-vous à la dernière version de la
|
||||
.\" licence publique générale GNU (GNU GPL) pour connaître ses
|
||||
.\" conditions d'utilisation. AUCUNE garantie n'est offerte.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANO 1 "version 1.3.4" "17 août 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
.\"
|
||||
|
||||
|
||||
.SH NOM
|
||||
nano \- NAno un NOuvel éditeur, un clone libre et amélioré de Pico
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nano
|
||||
.I [\+LIGNE]\ [options]\ [fichier]
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement la commande \fBnano\fR.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fR est un éditeur petit, sympathique et libre, qui vise à remplacer
|
||||
Pico, l'éditeur par défaut du paquet non libre Pine. \fBnano\fR ne se
|
||||
contentant pas de copier l'interface et l'ergonomie de Pico, il offre
|
||||
également certaines fonctions manquantes (ou désactivées par défaut)
|
||||
dans Pico. Ces fonctionnalités sont, par exemple, les fonctions de
|
||||
recherche et de remplacement, et la possibilité de sauter directement à un
|
||||
numéro de ligne.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \+\fILIGNE\fR
|
||||
Démarre avec le curseur positionné à la ligne numéro \fILIGNE\fR.
|
||||
.TP
|
||||
.B \-A (\-\-smarthome)
|
||||
Active le fonctionnement évolué de la touche «\ Début\ ». Lorsque cette
|
||||
touche est pressée à n'importe quel endroit excepté au tout début du
|
||||
texte d'une ligne (i.\ e. au premier caractère non blanc), le curseur se
|
||||
positionnera à ce début de ligne (qu'il soit en avant ou en arrière). Si
|
||||
le curseur est déjà au tout début de la ligne, il se placera au vrai
|
||||
début de la ligne.
|
||||
.TP
|
||||
.B \-B (\-\-backup)
|
||||
Lors de l'écriture d'un fichier, crée une copie de sécurité de la
|
||||
version précédente, en ajoutant un tilde (~) au nom du fichier.
|
||||
.TP
|
||||
.B \-D (\-\-dos)
|
||||
Écrit le fichier au format DOS.
|
||||
.TP
|
||||
.B \-E \fIrépertoire\fP (\-\-backupdir=\fIrépertoire\fP)
|
||||
Définit le répertoire utilisé par \fBnano\fP pour enregistrer les copies
|
||||
de sécurité si celles-ci sont activées.
|
||||
.TP
|
||||
.B \-F (\-\-multibuffer)
|
||||
Active le mode multifichier, autorisant l'édition simultanée de plusieurs
|
||||
fichiers, si ce mode est disponible.
|
||||
.TP
|
||||
.B \-H (\-\-historylog)
|
||||
Enregistre les chaînes ayant fait l'objet d'une recherche ou d'un
|
||||
remplacement dans le fichier \fI~/.nano_history\fR afin de permettre leur
|
||||
réutilisation. Ceci n'est possible que si \fBnano\fR est configuré pour
|
||||
utiliser les fichiers nanorc.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
N'utilise pas les fichiers \fISYSCONFDIR/nanorc\fR et \fI~/.nanorc\fR, même si
|
||||
\fBnano\fR est capable de les utiliser.
|
||||
.TP
|
||||
.B \-M (\-\-mac)
|
||||
Écrit le fichier au format Mac.
|
||||
.TP
|
||||
.B \-N (\-\-noconvert)
|
||||
Désactive la conversion automatique des fichiers depuis les formats Mac et
|
||||
DOS.
|
||||
.TP
|
||||
.B \-Q \fIchaîne\fP (\-\-quotestr=\fIchaîne\fP)
|
||||
Définit le préfixe par défaut des citations. Nano utilise ce préfixe
|
||||
pour réaliser une justification correcte des citations. Si nano est
|
||||
capable d'utiliser des expressions rationnelles, le préfixe par défaut
|
||||
sera "^([\ \\t]*[|>:}#])+", sinon, ce sera ">\ ".
|
||||
.TP
|
||||
.B \-R (\-\-regexp)
|
||||
Active l'utilisation d'expressions rationnelles lors des recherches, ainsi
|
||||
que la possibilité d'utiliser \\n dans les chaînes de remplacement pour
|
||||
faire référence à la n-ième sous-expression du motif de recherche, si
|
||||
cette fonction est disponible.
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Active le défilement progressif. Le texte défilera ligne-par-ligne au lieu
|
||||
de défiler morceau-par-morceau.
|
||||
.TP
|
||||
.B \-T \fInombre\fP (\-\-tabsize=\fInombre\fP)
|
||||
Définit la taille (largeur) des tabulations.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Affiche le numéro de version et l'auteur.
|
||||
.TP
|
||||
.B \-Y \fIchaîne\fP (\-\-syntax=\fIchaîne\fP)
|
||||
Indique quel mode de colorisation syntaxique adopter, parmi les modes
|
||||
définis dans le fichier \fI.nanorc\fR, si cette fonctionnalité est
|
||||
disponible.
|
||||
.TP
|
||||
.B \-Z (\-\-restricted)
|
||||
Mode restreint\ : aucune lecture ou écriture de fichiers non indiqués
|
||||
sur la ligne de commande, pas de lecture des fichiers nanorc,
|
||||
interdiction de suspendre et interdiction de sauvegarder (ou d'ajouter
|
||||
en tête ou en fin) un fichier ayant déjà un nom sous un nom différent.
|
||||
Cette option peut aussi être activée en appelant \fBnano\fP sous un nom
|
||||
commençant par «\ r\ » (par exemple «\ rnano\ »).
|
||||
.TP
|
||||
.B \-c (\-\-const)
|
||||
Affiche en permanence la position du curseur.
|
||||
.TP
|
||||
.B \-d (\-\-rebinddelete)
|
||||
Interprète différemment la touche «\ Supprimer\ », afin que les touches
|
||||
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
|
||||
Vous devriez n'avoir besoin de cette option que si la touche
|
||||
«\ Effacement arrière\ » produit l'effet de la touche «\ Supprimer\ »
|
||||
sur votre système.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Affiche un résumé des options disponibles en ligne de commande.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indentation automatique. Commence chaque nouvelle ligne au même niveau que
|
||||
la ligne précédente. Utile pour l'édition de code source.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
^K coupe le texte du curseur à la fin de la ligne, au lieu de couper la
|
||||
ligne entière.
|
||||
.TP
|
||||
.B \-l (\-\-nofollow)
|
||||
Si le fichier édité est un lien symbolique, remplace le lien par le
|
||||
nouveau fichier, sans le suivre. Ce mode ne serait-il pas utile pour éditer
|
||||
les fichiers de \fI/tmp\fR ?
|
||||
.TP
|
||||
.B \-m (\-\-mouse)
|
||||
Active l'utilisation de la souris (si elle est disponible sur votre
|
||||
système).
|
||||
.TP
|
||||
.B \-o \fIrépertoire\fP (\-\-operatingdir=\fIrépertoire\fP)
|
||||
Définit le répertoire de travail. Demande à nano de mettre en place
|
||||
quelque chose de similaire à un environnement d'exécution restreint
|
||||
(\fIchroot\fR).
|
||||
.TP
|
||||
.B \-p (\-\-preserve)
|
||||
Préserve les séquences XON et XOFF (^Q et ^S), afin qu'elle soient reçues
|
||||
par le terminal.
|
||||
.TP
|
||||
.B \-r \fIcolonne\fP (\-\-fill=\fIcolonne\fP)
|
||||
Passe automatiquement à la ligne à la colonne \fIcolonne\fR. Par défaut, le
|
||||
passage à la ligne se fait à la taille de l'écran moins huit. Si la
|
||||
valeur indiquée est négative, le point de passage à la ligne sera
|
||||
calculé relativement au bord droit de l'écran. Cela permet de faire varier
|
||||
le point de passage à la ligne lorsque l'on change la taille de l'écran.
|
||||
.TP
|
||||
.B \-s \fIprogramme\fP (\-\-speller=\fIprogramme\fP)
|
||||
Choix d'un correcteur orthographique de remplacement.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
S'il a été modifié, le fichier sera sauvegardé automatiquement sans
|
||||
demande de confirmation. Identique à l'option -t de Pico.
|
||||
.TP
|
||||
.B \-v (\-\-view)
|
||||
Mode visualisation (lecture seule).
|
||||
.TP
|
||||
.B \-w (\-\-nowrap)
|
||||
Désactive le passage automatique à la ligne.
|
||||
.TP
|
||||
.B \-x (\-\-nohelp)
|
||||
Désactive la barre d'aide affichée en bas de l'écran.
|
||||
.TP
|
||||
.B \-z (\-\-suspend)
|
||||
Autorise à suspendre l'éditeur.
|
||||
.TP
|
||||
.B \-a, \-b, \-e, \-f, \-g, \-j
|
||||
Ignoré, pour être compatible avec Pico.
|
||||
|
||||
.SH "FICHIERS D'INITIALISATION"
|
||||
\fBnano\fR lit les fichiers d'initialisation dans l'ordre suivant\ :
|
||||
\fISYSCONFDIR/nanorc\fR, puis \fI~/.nanorc\fR. Référez-vous à la page de manuel
|
||||
de \fBnanorc\fR(5) et au fichier-exemple \fInanorc.sample\fR qui devrait être
|
||||
livré avec \fBnano\fR.
|
||||
|
||||
.SH NOTES
|
||||
Si aucun correcteur orthographique de remplacement n'est indiqué dans la
|
||||
ligne de commande ou dans le fichier nanorc, \fBnano\fR prendra
|
||||
la commande indiquée par la variable d'environnement \fBSPELL\fR si
|
||||
elle est définie.
|
||||
|
||||
Dans certains cas, \fBnano\fR essaiera de sauvegarder le fichier en cours
|
||||
d'édition dans un fichier de secours. Cela arrivera principalement si
|
||||
\fBnano\fR reçoit un signal SIGHUP ou SIGTERM, ou bien se trouve à court de
|
||||
mémoire. Le nom de ce fichier de secours sera \fInano.save\fR si le fichier en
|
||||
cours n'avait pas encore de nom, ou sera composé du nom du fichier en cours
|
||||
suivi du suffixe «\ .save\ ». Si un fichier de ce nom existe déjà dans
|
||||
le répertoire, un «\ .save\ » et un nombre seront ajoutés à la fin du
|
||||
nom du fichier en cours afin de le rendre unique (par exemple,
|
||||
«\ .save.1\ »). En mode multifichier, \fBnano\fR réalisera une
|
||||
sauvegarde de tous les fichiers en cours dans leurs fichiers de secours
|
||||
respectifs.
|
||||
|
||||
.SH BOGUES
|
||||
Merci de nous faire parvenir vos commentaires et de nous signaler les
|
||||
bogues, en écrivant, en anglais, à \fBnano@nano-editor.org\fR.
|
||||
|
||||
La liste de discussion anglophone \fBnano\fR est disponible via
|
||||
\fBnano-devel@gnu.org\fR.
|
||||
|
||||
Pour vous abonner, envoyez un courrier électronique à
|
||||
\fBnano-devel-request@gnu.org\fR, ayant pour objet «\ subscribe\ ».
|
||||
|
||||
.SH "SITE INTERNET"
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH "VOIR AUSSI"
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnanorc\fR(5)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/\fR (ou son équivalent sur votre système)
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
|
||||
\fIAUTHORS\fR et \fITHANKS\fR pour plus d'information). Cette page de manuel a
|
||||
été initialement rédigée par Jordi Mallach
|
||||
<jordi@sindominio.net> pour le système GNU Debian (mais elle peut
|
||||
être utilisée par d'autres).
|
||||
|
||||
.SH TRADUCTION
|
||||
|
||||
Adaptation française du 4\ septembre\ 2004 par
|
||||
Jean-Philippe\ Guérard\ <jean-philippe.guerard@corbeaunoir.org>.
|
||||
230
doc/man/fr/nanorc.5
Normal file
230
doc/man/fr/nanorc.5
Normal file
@@ -0,0 +1,230 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nanorc.5 is Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" (c) 2003-2004 Jean-Philippe Guérard <jean-philippe.guerard@corbeaunoir.org>
|
||||
.\" pour l'adaptation française
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" Ce document est libre. Reportez-vous à la dernière version de la
|
||||
.\" licence publique générale GNU (GNU GPL) pour connaître ses
|
||||
.\" conditions d'utilisation. AUCUNE garantie n'est offerte.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANORC 5 "version 1.3.4" "17 août 2004"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\" Merci de modifier ces dates à chaque mise à jour de cette page.
|
||||
|
||||
.SH NOM
|
||||
nanorc \- fichier de configuration de l'éditeur nano du projet GNU
|
||||
|
||||
.SH DESCRIPTION
|
||||
Cette page de manuel décrit brièvement le fichier de configuration de
|
||||
l'éditeur \fBnano\fP du projet GNU.
|
||||
.PP
|
||||
\fBnano\fP est un petit éditeur sympathique et libre, qui vise à
|
||||
remplacer Pico, l'éditeur par défaut du paquet non-libre Pine.
|
||||
\fBnano\fP ne se contentant pas de copier l'interface et l'ergonomie de
|
||||
Pico, il offre également certaines fonctionnalités manquantes (ou
|
||||
désactivées par défaut) de Pico. Ces fonctionnalités sont, par exemple,
|
||||
les fonctions de recherche et de remplacement, et la possibilité de
|
||||
sauter directement à un numéro de ligne.
|
||||
.PP
|
||||
Le fichier \fInanorc\fP contient les paramètres par défaut de
|
||||
\fBnano\fP. Lors de son démarrage, nano commence par lire le fichier de
|
||||
configuration général \fISYSCONFDIR/nanorc\fP, puis lit le fichier de
|
||||
configuration personnel de l'utilisateur \fI~/.nanorc\fP.
|
||||
|
||||
.SH OPTIONS
|
||||
Le fichier de configuration accepte une série de commandes «\ set\ »
|
||||
(activer) et «\ unset\ » (désactiver), qui permettent de définir la
|
||||
configuration de nano au démarrage sans avoir à utiliser d'options sur
|
||||
la ligne de commande.
|
||||
De plus, les mots clefs «\ syntax\ » (syntaxe) et «\ color\ » (couleur)
|
||||
sont utilisés pour définir les règles de colorisation pour différents
|
||||
motifs de texte. Nano lira une commande par ligne.
|
||||
|
||||
Les options du fichier de configuration ont priorité sur les valeurs par
|
||||
défaut utilisées par nano. Les options de la ligne de commande sont
|
||||
prioritaires par rapport aux options du fichier de configuration.
|
||||
|
||||
Les options sont désactivées (unset) par défaut, sauf les options
|
||||
prenant un argument.
|
||||
|
||||
Les commandes et arguments reconnus sont\ :
|
||||
|
||||
.TP 3
|
||||
\fBset/unset autoindent\fP
|
||||
Active l'indentation automatique.
|
||||
.TP
|
||||
\fBset/unset backup\fP
|
||||
Crée des copie de sécurité nommées
|
||||
.IR nom_du_fichier~ .
|
||||
.TP
|
||||
\fBset/unset const\fP
|
||||
Affiche en permanence la position du curseur dans la ligne d'état.
|
||||
.TP
|
||||
\fBset/unset cut\fP
|
||||
Par défaut, ^K coupe le texte du curseur jusqu'à la fin de la ligne, au
|
||||
lieu de couper la ligne entière.
|
||||
.TP
|
||||
\fBset fill \fIn\fP\fP
|
||||
Passe automatiquement à la ligne à la colonne \fIn\fP. Si la valeur
|
||||
indiquée est 0 ou moins, la longueur de la ligne sera égale à la largeur
|
||||
de l'écran moins \fIn\fP. La valeur par défaut est -8.
|
||||
.TP
|
||||
\fBset/unset historylog\fP
|
||||
Active l'utilisation de
|
||||
.I ~/.nano_history
|
||||
pour enregistrer et relire les chaînes ayant fait l'objet d'une
|
||||
recherche ou d'un remplacement.
|
||||
.TP
|
||||
\fBset/unset multibuffer\fP
|
||||
Mode multifichier\ : permet de charger les fichiers dans leur propre
|
||||
espace.
|
||||
.TP
|
||||
\fBset/unset noconvert\fP
|
||||
Pas de conversion depuis les formats DOS et Mac.
|
||||
.TP
|
||||
\fBset/unset nofollow\fP
|
||||
Ne suit pas les liens symboliques lors de l'écriture des fichiers.
|
||||
.TP
|
||||
\fBset/unset nohelp\fP
|
||||
Désactive les lignes d'aide affichée en bas de l'écran.
|
||||
.TP
|
||||
\fBset/unset nowrap\fP
|
||||
Désactive le passage automatique à la ligne.
|
||||
.TP
|
||||
\fBset operatingdir "\fIrépertoire\fP"\fP
|
||||
\fBnano\fP ne lira et n'écrira des fichiers qu'à l'intérieur du
|
||||
\fIrépertoire\fP et de ses sous-répertoires. De plus, celui-ci devient
|
||||
le répertoire courant, afin que les fichiers soient lus depuis ce
|
||||
répertoire. Par défaut, cette fonction est désactivée.
|
||||
.TP
|
||||
\fBset/unset preserve\fP
|
||||
Préserve les séquences XON et XOFF (^Q et ^S).
|
||||
.TP
|
||||
\fBset punct "\fIchaîne\fP"\fP
|
||||
Définit les caractères interprétés comme des ponctuations terminales.
|
||||
Ces caractères ne peuvent inclure d'espaces ou de tabulations. Seules les
|
||||
ponctuations terminales, éventuellement suivies de crochets fermants,
|
||||
peuvent terminer une phrase.
|
||||
|
||||
(N.D.T.\ : ce réglage permet de conserver 2\ espaces au lieu d'une
|
||||
derrière les ponctuations terminales lors de la justification, ce qui
|
||||
correspond aux normes typographiques anglo-saxonnes, mais n'a pas lieu
|
||||
d'être en français. Pour le français, le plus simple est d'indiquer dans
|
||||
le fichier nanorc une chaîne vide pour ce paramètre.)
|
||||
.TP
|
||||
\fBset quotestr "\fIchaîne\fP"\fP
|
||||
Définit le préfixe par défaut utilisé pour les citations dans les
|
||||
courriers électroniques. Ce préfixe est utilisé pour réaliser une
|
||||
justification correcte de ces citations. Il s'agira, si votre système le
|
||||
permet, d'une «\ expression rationnelle étendue\ ». Dans le cas
|
||||
contraire, il s'agira d'une chaîne de texte brut. Si vous disposez des
|
||||
expressions rationnelles, la valeur par défaut sera\ :
|
||||
|
||||
set quotestr "^([\ \\t]*[|>:}#])+"
|
||||
|
||||
Sinon, ce sera ">\ ". Notez que le «\ \\t\ » ci-dessus correspond à un
|
||||
caractère de tabulation.
|
||||
.TP
|
||||
\fBset/unset rebinddelete\fP
|
||||
Interprète différemment la touche «\ Supprimer\ », afin que les touches
|
||||
«\ Effacement arrière\ » et «\ Supprimer\ » fonctionnent correctement.
|
||||
Vous devriez uniquement avoir besoin de cette option si la touche
|
||||
«\ Effacement arrière\ » produit l'effet de la touche «\ Supprimer\ »
|
||||
sur votre système.
|
||||
.TP
|
||||
\fBset/unset regexp\fP
|
||||
Utilise par défaut des expressions rationnelles pour les recherches.
|
||||
.TP
|
||||
\fBset/unset smarthome\fP
|
||||
Active le fonctionnement évolué de la touche «\ Début\ ». Lorsque cette
|
||||
touche est pressée à n'importe quel endroit excepté au tout début du
|
||||
texte d'une ligne (i.\ e. au premier caractère non-blanc), le curseur se
|
||||
positionnera à ce début de ligne (qu'il soit en avant ou en arrière). Si
|
||||
le curseur est déjà au tout début de la ligne, il se placera au vrai
|
||||
début de la ligne.
|
||||
.TP
|
||||
\fBset/unset smooth\fP
|
||||
Active le défilement ligne-par-ligne du texte.
|
||||
.TP
|
||||
\fBset speller \fIprogramme\fP\fP
|
||||
Utilise le correcteur orthographique \fIprogramme\fP au lieu du
|
||||
correcteur intégré, qui s'appuie sur \fIspell\fP.
|
||||
.TP
|
||||
\fBset/unset suspend\fP
|
||||
Autorise à suspendre nano avec ^Z.
|
||||
.TP
|
||||
\fBset tabsize \fIn\fP\fP
|
||||
Utilise une largeur de tabulation de \fIn\fP au lieu de la valeur par
|
||||
défaut (8). Cette valeur doit être supérieur à 0.
|
||||
.TP
|
||||
\fBset/unset tempfile\fP
|
||||
S'il a été modifié, le fichier sera sauvegardé automatiquement en
|
||||
quittant, sans demande de confirmation.
|
||||
.TP
|
||||
\fBset/unset view\fP
|
||||
Interdit la modification du fichier.
|
||||
.TP
|
||||
\fBset whitespace "\fIchaîne\fP"\fP
|
||||
Définit les deux caractères utilisés pour afficher les premiers
|
||||
caractères de tabulations et d'espaces. Cela ne doit pas être
|
||||
des caractère de contrôle.
|
||||
.TP
|
||||
.B syntax "\fIchaîne\fP" ["\fImotif_de_fichier\fP" ... ]
|
||||
Définit une syntaxe nommée \fIchaîne\fP qui pourra être activé via
|
||||
l'option \fB-Y\fP, ou qui sera automatiquement activé si le nom du
|
||||
fichier en cours correspond au \fImotif_de_fichier\fP. Toutes les
|
||||
instructions suivantes de colorisation \fBcolor\fP s'appliqueront à
|
||||
cette syntaxe, jusqu'à la définition d'une nouvelle syntaxe.
|
||||
.TP
|
||||
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] "\fImotif\fP" ...
|
||||
Pour la syntaxe en cours, affiche toutes les expressions correspondant à
|
||||
l'expression rationnelle \fImotif\fP en utilisant la couleur de texte
|
||||
\fIcouleur_texte\fP et éventuellement la couleur de fond
|
||||
\fIcouleur_fond\fP. Les couleurs acceptées par \fBnano\fP pour le
|
||||
texte et le fond sont\ : \fIwhite\fP (blanc), \fIblack\fP (noir),
|
||||
\fIred\fP (rouge), \fIblue\fP (bleu), \fIgreen\fP (vert), \fIyellow\fP
|
||||
(jaune), \fImagenta\fP, et \fIcyan\fP. Vous pouvez ajouter à
|
||||
ces couleurs le préfixe \fIbright\fP pour obtenir une couleur plus
|
||||
lumineuse. Si votre terminal est capable de gérer la transparence, ne
|
||||
pas spécifier de \fIcouleur_fond\fP indique à \fBnano\fP d'essayer
|
||||
d'utiliser un fond transparent.
|
||||
.TP
|
||||
.B color \fIcouleur_texte\fP[,\fIcouleur_fond\fP] start="\fImotif_début\fP" end="\fImotif_fin\fP"
|
||||
Affiche les expressions commençant par \fImotif_début\fP et se terminant
|
||||
par \fImotif_fin\fP en utilisant la couleur de texte \fIcouleur_texte\fP
|
||||
et éventuellement la couleur de fond \fIcouleur_fond\fP. Cela permet à
|
||||
la colorisation syntaxique de s'étendre sur plusieurs lignes. Notez que
|
||||
toutes les occurrences successives de \fImotif_début\fP après le
|
||||
\fImotif_début\fP initial seront surlignées jusqu'à la prochaine instance
|
||||
de \fImotif_fin\fP.
|
||||
|
||||
.SH FICHIERS
|
||||
.TP
|
||||
.I $SYSCONFDIR/nanorc
|
||||
Fichier de configuration général
|
||||
.TP
|
||||
.I ~/.nanorc
|
||||
Fichier de configuration personnel
|
||||
|
||||
.SH VOIR AUSSI
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (ou son équivalent sur
|
||||
votre système)
|
||||
|
||||
.SH AUTEUR
|
||||
Chris Allegretta <chrisa@asty.org> et d'autres (voir les fichiers
|
||||
\fIAUTHORS\fP et \fITHANKS\fP pour plus d'information). Cette page de
|
||||
manuel a été rédigée par Jordi Mallach <jordi@gnu.org>.
|
||||
|
||||
.SH TRADUCTION
|
||||
|
||||
Adaptation française du 4\ septembre\ 2004 par
|
||||
Jean-Philippe\ Guérard\ <jean-philippe.guerard@corbeaunoir.org>.
|
||||
214
doc/man/nano.1
Normal file
214
doc/man/nano.1
Normal file
@@ -0,0 +1,214 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nano.1 is copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by
|
||||
.\" Chris Allegretta <chrisa@asty.org>
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANO 1 "version 1.3.8" "June 27, 2005"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
|
||||
.SH NAME
|
||||
nano \- Nano's ANOther editor, an enhanced free Pico clone
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nano
|
||||
.I [\+LINE,COLUMN]\ [options]\ [file]
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
This manual page documents briefly the \fBnano\fP command.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \+\fILINE\fP,\fICOLUMN\fP
|
||||
Places cursor at line number \fILINE\fP and column number \fICOLUMN\fP
|
||||
on startup, instead of the default of line 1, column 1.
|
||||
.TP
|
||||
.B \-?
|
||||
Same as \fB-h (\-\-help)\fP.
|
||||
.TP
|
||||
.B \-A (\-\-smarthome)
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
.TP
|
||||
.B \-B (\-\-backup)
|
||||
When saving a file, back up the previous version of it to the current
|
||||
filename suffixed with a ~.
|
||||
.TP
|
||||
.B \-C \fIdir\fP (\-\-backupdir=\fIdir\fP)
|
||||
Set the directory where \fBnano\fP puts unique backup files if file
|
||||
backups are enabled.
|
||||
.TP
|
||||
.B \-E (\-\-tabstospaces)
|
||||
Convert typed tabs to spaces.
|
||||
.TP
|
||||
.B \-F (\-\-multibuffer)
|
||||
Enable multiple file buffers, if available.
|
||||
.TP
|
||||
.B \-H (\-\-historylog)
|
||||
Log search and replace strings to \fI~/.nano_history\fP so they can be
|
||||
stored for later editing, if nanorc support is configured.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
Don't look at \fISYSCONFDIR/nanorc\fP or \fI~/.nanorc\fP, if nanorc
|
||||
support is available.
|
||||
.TP
|
||||
.B \-N (\-\-noconvert)
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
.TP
|
||||
.B \-O (\-\-morespace)
|
||||
Use the blank line below the titlebar as extra editing space.
|
||||
.TP
|
||||
.B \-Q \fIstr\fP (\-\-quotestr=\fIstr\fP)
|
||||
Set the quoting string for justifying. The default is
|
||||
"^([\ \\t]*[|>:}#])+" if regular expression support is available, or
|
||||
">\ " otherwise.
|
||||
.TP
|
||||
.B \-R (\-\-restricted)
|
||||
Restricted mode: Don't read or write to any file not specified on the
|
||||
command line, read any nanorc files, allow suspending, or allow a file
|
||||
to be appended to, prepended to, or saved under a different name if it
|
||||
already has one. Also accessible by invoking \fBnano\fP with any name
|
||||
beginning with 'r' (e.g. "rnano").
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behavior.
|
||||
.TP
|
||||
.B \-T \fIcols\fP (\-\-tabsize=\fIcols\fP)
|
||||
Set the size (width) of a tab to \fIcols\fP columns. The value of
|
||||
\fIcols\fP must be greater than 0. The default value is 8.
|
||||
.TP
|
||||
.B \-U (\-\-quickblank)
|
||||
Do quick statusbar blanking. Statusbar messages will disappear after 1
|
||||
keystroke instead of 25. Note that \fB-c\fP cancels this out.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Show the current version number and author.
|
||||
.TP
|
||||
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
|
||||
Specify a specific syntax highlighting from the \fInanorc\fP to use, if
|
||||
available.
|
||||
.TP
|
||||
.B \-c (\-\-const)
|
||||
Constantly show the cursor position. Note that this cancels out
|
||||
\fB-U\fP.
|
||||
.TP
|
||||
.B \-d (\-\-rebinddelete)
|
||||
Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Display a summary of command line options.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indent new lines to the previous line's indentation. Useful when
|
||||
editing source code.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
Enable cut from cursor to end of line.
|
||||
.TP
|
||||
.B \-l (\-\-nofollow)
|
||||
If the file being edited is a symbolic link, replace the link with
|
||||
a new file instead of following it. Good for editing files in
|
||||
\fI/tmp\fP, perhaps?
|
||||
.TP
|
||||
.B \-m (\-\-mouse)
|
||||
Enable mouse support (if available for your system).
|
||||
.TP
|
||||
.B \-o \fIdir\fP (\-\-operatingdir=\fIdir\fP)
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
chroot.
|
||||
.TP
|
||||
.B \-p (\-\-preserve)
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be caught
|
||||
by the terminal.
|
||||
.TP
|
||||
.B \-r \fIcols\fP (\-\-fill=\fIcols\fP)
|
||||
Wrap lines at column \fIcols\fP. If this value is 0 or less, wrapping
|
||||
will occur at the width of the screen less \fIcols\fP columns, allowing
|
||||
the wrap point to vary along with the width of the screen if the screen
|
||||
is resized. The default value is -8.
|
||||
.TP
|
||||
.B \-s \fIprog\fP (\-\-speller=\fIprog\fP)
|
||||
Enable alternative spell checker command.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
Always save changed buffer without prompting. Same as Pico's \fB-t\fP
|
||||
option.
|
||||
.TP
|
||||
.B \-v (\-\-view)
|
||||
View file (read only) mode.
|
||||
.TP
|
||||
.B \-w (\-\-nowrap)
|
||||
Disable wrapping of long lines.
|
||||
.TP
|
||||
.B \-x (\-\-nohelp)
|
||||
Disable help screen at bottom of editor.
|
||||
.TP
|
||||
.B \-z (\-\-suspend)
|
||||
Enable suspend ability.
|
||||
.TP
|
||||
.B \-a, \-b, \-e, \-f, \-g, \-j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
.SH INITIALIZATION FILE
|
||||
\fBnano\fP will read initialization files in the following order:
|
||||
\fISYSCONFDIR/nanorc\fP, then \fI~/.nanorc\fP. Please see
|
||||
\fBnanorc(5)\fP and the example file \fBnanorc.sample\fP, both of which
|
||||
should be provided with \fBnano\fP.
|
||||
|
||||
.SH NOTES
|
||||
If no alternative spell checker command is specified on the command
|
||||
line or in one of the nanorc files, \fBnano\fP will check the
|
||||
\fBSPELL\fP environment variable for one.
|
||||
|
||||
\fBnano\fP will try to dump the buffer into an emergency file in some
|
||||
cases. Mainly, this will happen if \fBnano\fP receives a SIGHUP or
|
||||
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||
named \fInano.save\fP if the buffer didn't have a name already, or will
|
||||
add a ".save" suffix to the current filename. If an emergency file with
|
||||
that name already exists in the current directory, ".save" and a number
|
||||
(e.g. ".save.1") will be suffixed to the current filename in order to
|
||||
make it unique. In multibuffer mode, \fBnano\fP will write all the open
|
||||
buffers to their respective emergency files.
|
||||
|
||||
.SH BUGS
|
||||
Please send any comments or bug reports to \fBnano@nano-editor.org\fP.
|
||||
|
||||
The \fBnano\fP mailing list is available from \fBnano-devel@gnu.org\fP.
|
||||
|
||||
To subscribe, email to \fBnano-devel-request@gnu.org\fP with a subject
|
||||
of "subscribe".
|
||||
|
||||
.SH HOMEPAGE
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH SEE ALSO
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnanorc\fP(5)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
|
||||
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
|
||||
\fITHANKS\fP for details). This manual page was originally written by
|
||||
Jordi Mallach <jordi@sindominio.net>, for the Debian GNU system (but may
|
||||
be used by others).
|
||||
218
doc/man/nanorc.5
Normal file
218
doc/man/nanorc.5
Normal file
@@ -0,0 +1,218 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nanorc.5 is Copyright (C) 2003, 2004, 2005 Free Software
|
||||
.\" Foundation, Inc.
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANORC 5 "version 1.3.8" "June 27, 2005"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.SH NAME
|
||||
nanorc \- GNU nano's rcfile
|
||||
.SH DESCRIPTION
|
||||
This manual page documents GNU \fBnano\fP's rcfile.
|
||||
.PP
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
.PP
|
||||
The \fInanorc\fP file contains the default settings for \fBnano\fP.
|
||||
During startup, \fBnano\fP will first read its system-wide settings from
|
||||
\fISYSCONFDIR/nanorc\fP, and then user-specific settings from
|
||||
\fI~/.nanorc\fP.
|
||||
|
||||
.SH OPTIONS
|
||||
The configuration file accepts a series of "set" and "unset" commands,
|
||||
which can be used to configure nano on startup without using the
|
||||
command-line options. Additionally, the "syntax", "color", and "icolor"
|
||||
keywords are used to define syntax highlighting rules for different text
|
||||
patterns. GNU nano will read one command per line.
|
||||
|
||||
Options in rcfiles take precedence over nano's defaults, and command
|
||||
line options override rcfile settings.
|
||||
|
||||
Options are unset by default, except for options that take an argument.
|
||||
|
||||
The supported commands and arguments are:
|
||||
|
||||
.TP 3
|
||||
.B set/unset autoindent
|
||||
Use auto-indentation.
|
||||
.TP
|
||||
.B set/unset backup
|
||||
Create backup files in \fIfilename~\fP.
|
||||
.TP
|
||||
.B set backupdir "\fIdirectory\fP"
|
||||
Set the directory where \fBnano\fP puts unique backup files if file
|
||||
backups are enabled.
|
||||
.TP
|
||||
.B set/unset backwards
|
||||
Do backwards searches by default.
|
||||
.TP
|
||||
.B set brackets "\fIstring\fP"
|
||||
Set the characters treated as closing brackets. They cannot contain
|
||||
blank characters. Only closing punctuation, optionally followed by
|
||||
closing brackets, can end sentences.
|
||||
.TP
|
||||
.B set/unset casesensitive
|
||||
Do case sensitive searches by default.
|
||||
.TP
|
||||
.B set/unset const
|
||||
Constantly display the cursor position in the status bar.
|
||||
.TP
|
||||
.B set/unset cut
|
||||
Use cut to end of line by default.
|
||||
.TP
|
||||
.B set fill \fIn\fP
|
||||
Wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the
|
||||
maximum line length will be the screen width less \fIn\fP columns. The
|
||||
default value is -8.
|
||||
.TP
|
||||
.B set/unset historylog
|
||||
Enable \fI~/.nano_history\fP for saving and reading search/replace
|
||||
strings.
|
||||
.TP
|
||||
.B set/unset morespace
|
||||
Allow use of the blank line below the titlebar as extra editing space.
|
||||
.TP
|
||||
.B set/unset mouse
|
||||
Enable mouse support, so that mouse clicks can be used to set the mark
|
||||
and run shortcuts.
|
||||
.TP
|
||||
.B set/unset multibuffer
|
||||
Allow inserting files into their own buffers.
|
||||
.TP
|
||||
.B set/unset noconvert
|
||||
Don't convert files from DOS/Mac format.
|
||||
.TP
|
||||
.B set/unset nofollow
|
||||
Don't follow symlinks when writing files.
|
||||
.TP
|
||||
.B set/unset nohelp
|
||||
Don't display the help lists at the bottom of the screen.
|
||||
.TP
|
||||
.B set/unset nowrap
|
||||
Don't wrap text at all.
|
||||
.TP
|
||||
.B set operatingdir "\fIdirectory\fP"
|
||||
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
|
||||
subdirectories. Also, the current directory is changed to here, so
|
||||
files are inserted from this dir. By default the operating directory
|
||||
feature is turned off.
|
||||
.TP
|
||||
.B set/unset preserve
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
.TP
|
||||
.B set punct "\fIstring\fP"
|
||||
Set the characters treated as closing punctuation. They cannot contain
|
||||
blank characters. Only closing punctuation, optionally followed by
|
||||
closing brackets, can end sentences.
|
||||
.TP
|
||||
.B set quickblank
|
||||
Do quick statusbar blanking. Statusbar messages will disappear after 1
|
||||
keystroke instead of 25.
|
||||
.TP
|
||||
.B set quotestr "\fIstring\fP"
|
||||
The email-quote string, used to justify email-quoted paragraphs. This
|
||||
is an "extended regular expression" if your system supports them,
|
||||
otherwise a literal string. The default value is
|
||||
|
||||
set quotestr "^([\ \\t]*[|>:}#])+"
|
||||
|
||||
if you have regexps, otherwise set quotestr ">\ ". Note that '\\t'
|
||||
above stands for a literal Tab character.
|
||||
.TP
|
||||
.B set/unset rebinddelete
|
||||
Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
.TP
|
||||
.B set/unset regexp
|
||||
Do regular expression searches by default.
|
||||
.TP
|
||||
.B set/unset smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
.TP
|
||||
.B set/unset smooth
|
||||
Use smooth scrolling by default.
|
||||
.TP
|
||||
.B set speller \fIspellprog\fP
|
||||
Use spelling checker \fIspellprog\fP instead of the built-in one, which
|
||||
calls \fIspell\fP.
|
||||
.TP
|
||||
.B set/unset suspend
|
||||
Allow nano to be suspended.
|
||||
.TP
|
||||
.B set tabsize \fIn\fP
|
||||
Use a tab size of \fIn\fP columns. The value of \fIn\fP must be greater
|
||||
than 0. The default value is 8.
|
||||
.TP
|
||||
.B set/unset tabstospaces
|
||||
Convert typed tabs to spaces.
|
||||
.TP
|
||||
.B set/unset tempfile
|
||||
Save automatically on exit, don't prompt.
|
||||
.TP
|
||||
.B set/unset view
|
||||
Disallow file modification.
|
||||
.TP
|
||||
.B set whitespace "\fIstring\fP"
|
||||
Set the two characters used to display the first characters of tabs and
|
||||
spaces. They must be single-column characters.
|
||||
.TP
|
||||
.B syntax "\fIstr\fP" ["\fIfileregex\fP" ... ]
|
||||
Defines a syntax named \fIstr\fP which can be activated via the \fB-Y\fP
|
||||
flag, or will be automatically activated if the current filename matches
|
||||
\fIfileregex\fP. All following \fBcolor\fP and \fBicolor\fP statements
|
||||
will apply to \fIsyntax\fP until a new syntax is defined.
|
||||
.TP
|
||||
.B color \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
|
||||
For the currently defined syntax, display all expressions matching
|
||||
\fIregex\fP with foreground color \fIfgcolor\fP and background color
|
||||
\fIbgcolor\fP, at least one of which must be specified. Legal colors
|
||||
for foreground and background color are: white, black, red, blue, green,
|
||||
yellow, magenta, and cyan. You may use the prefix "bright" to force a
|
||||
stronger color highlight for the foreground. If your terminal supports
|
||||
transparency, not specifying a \fIbgcolor\fP tells \fBnano\fP to attempt
|
||||
to use a transparent background.
|
||||
.TP
|
||||
.B icolor \fIfgcolor\fP,\fIbgcolor\fP "\fIregex\fP" ...
|
||||
Same as above, except that the expression matching is case insensitive.
|
||||
.TP
|
||||
.B color \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
|
||||
Display expressions which start with \fIsr\fP and end with \fIer\fP
|
||||
with foreground color \fIfgcolor\fP and background color \fIbgcolor\fP,
|
||||
at least one of which must be specified. This allows syntax
|
||||
highlighting to span multiple lines. Note that all subsequent instances
|
||||
of \fIsr\fP after an initial \fIsr\fP is found will be highlighted until
|
||||
the first instance of \fIer\fP.
|
||||
.TP
|
||||
.B icolor \fIfgcolor\fP,\fIbgcolor\fP start="\fIsr\fP" end="\fIer\fP"
|
||||
Same as above, except that the expression matching is case insensitive.
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I SYSCONFDIR/nanorc
|
||||
System-wide configuration file
|
||||
.TP
|
||||
.I ~/.nanorc
|
||||
Per-user configuration file
|
||||
.SH SEE ALSO
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
|
||||
system)
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see \fIAUTHORS\fP and
|
||||
\fITHANKS\fP for details). This manual page was written by Jordi
|
||||
Mallach <jordi@gnu.org>.
|
||||
314
doc/nanorc.sample
Normal file
314
doc/nanorc.sample
Normal file
@@ -0,0 +1,314 @@
|
||||
## Sample initialization file for GNU nano
|
||||
## Please note that you must have configured nano with --enable-nanorc
|
||||
## for this file to be read! Also note that characters specially
|
||||
## interpreted by the shell should not be escaped here.
|
||||
##
|
||||
## To make sure a value is not enabled, use "unset <option>"
|
||||
##
|
||||
## For the options that take parameters, the default value is given.
|
||||
## Other options are unset by default.
|
||||
|
||||
## Use auto-indentation.
|
||||
# set autoindent
|
||||
|
||||
## Backup files to filename~.
|
||||
# set backup
|
||||
|
||||
## The directory to put unique backup files in.
|
||||
# set backupdir ""
|
||||
|
||||
## Do backwards searches by default.
|
||||
# set backwards
|
||||
|
||||
## The characters treated as closing brackets. They cannot contain
|
||||
## blank characters. Only closing punctuation, optionally followed by
|
||||
## closing brackets, can end sentences.
|
||||
##
|
||||
# set brackets "'")}]>"
|
||||
|
||||
## Do case sensitive searches by default.
|
||||
# set casesensitive
|
||||
|
||||
## Constantly display the cursor position in the statusbar. Note that
|
||||
## this cancels out "quickblank".
|
||||
# set const
|
||||
|
||||
## Use cut to end of line by default.
|
||||
# set cut
|
||||
|
||||
## Set the line length for wrapping text and justifying paragraphs.
|
||||
## If fill is 0 or less, the line length will be the screen width less
|
||||
## this number.
|
||||
##
|
||||
# set fill -8
|
||||
|
||||
## Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
# set historylog
|
||||
|
||||
## Use the blank line below the titlebar as extra editing space.
|
||||
# set morespace
|
||||
|
||||
## Enable mouse support, so that mouse clicks can be used to set the
|
||||
## mark and run shortcuts.
|
||||
# set mouse
|
||||
|
||||
## Allow multiple file buffers (inserting a file will put it into a
|
||||
## separate buffer). You must have configured with --enable-multibuffer
|
||||
## for this to work.
|
||||
##
|
||||
# set multibuffer
|
||||
|
||||
## Don't convert files from DOS/Mac format.
|
||||
# set noconvert
|
||||
|
||||
## Don't follow symlinks when writing files.
|
||||
# set nofollow
|
||||
|
||||
## Don't display the helpful shortcut lists at the bottom of the screen.
|
||||
# set nohelp
|
||||
|
||||
## Don't wrap text at all.
|
||||
# set nowrap
|
||||
|
||||
## Set operating directory. nano will not read or write files outside
|
||||
## this directory and its subdirectories. Also, the current directory
|
||||
## is changed to here, so files are inserted from this dir. A blank
|
||||
## string means the operating directory feature is turned off.
|
||||
##
|
||||
# set operatingdir ""
|
||||
|
||||
## Preserve the XON and XOFF keys (^Q and ^S).
|
||||
# set preserve
|
||||
|
||||
## The characters treated as closing punctuation. They cannot contain
|
||||
## blank characters. Only closing punctuation, optionally followed by
|
||||
## closing brackets, can end sentences.
|
||||
##
|
||||
# set punct ".?!"
|
||||
|
||||
## Do quick statusbar blanking. Statusbar messages will disappear after
|
||||
## 1 keystroke instead of 25. Note that "const" cancels this out.
|
||||
##
|
||||
# set quickblank
|
||||
|
||||
## The email-quote string, used to justify email-quoted paragraphs.
|
||||
## This is an extended regular expression if your system supports them,
|
||||
## otherwise a literal string. Default:
|
||||
# set quotestr "^([ ]*[\|>:}#])+"
|
||||
## if you have regexps, otherwise:
|
||||
# set quotestr "> "
|
||||
## You can get old nano quoted-justify behavior via:
|
||||
# set quotestr "(> )+"
|
||||
|
||||
## Fix Backspace/Delete confusion problem.
|
||||
# set rebinddelete
|
||||
|
||||
## Do extended regular expression searches by default.
|
||||
# set regexp
|
||||
|
||||
## Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
## very beginning of non-whitespace characters on a line, the cursor
|
||||
## will jump to that beginning (either forwards or backwards). If the
|
||||
## cursor is already at that position, it will jump to the true
|
||||
## beginning of the line.
|
||||
# set smarthome
|
||||
|
||||
## Use smooth scrolling as the default.
|
||||
# set smooth
|
||||
|
||||
## Use this spelling checker instead of the internal one. This option
|
||||
## does not properly have a default value.
|
||||
##
|
||||
# set speller "aspell -x -c"
|
||||
|
||||
## Allow nano to be suspended.
|
||||
# set suspend
|
||||
|
||||
## Use this tab size instead of the default; it must be greater than 0.
|
||||
# set tabsize 8
|
||||
|
||||
## Convert typed tabs to spaces.
|
||||
# set tabstospaces
|
||||
|
||||
## Save automatically on exit, don't prompt.
|
||||
# set tempfile
|
||||
|
||||
## Disallow file modification; why would you want this in an rcfile? ;)
|
||||
# set view
|
||||
|
||||
## The two single-column characters used to display the first characters
|
||||
## of tabs and spaces. 187 decimal (00BB hexadecimal) and 183 decimal
|
||||
## (00B7 hexadecimal) seem to be good values for these.
|
||||
# set whitespace " "
|
||||
|
||||
## Color setup
|
||||
##
|
||||
## Format:
|
||||
##
|
||||
## syntax "short description" ["filename regex" ...]
|
||||
##
|
||||
## color foreground,background "regex" ["regex"...]
|
||||
## or
|
||||
## icolor foreground,background "regex" ["regex"...]
|
||||
##
|
||||
## "color" will do case sensitive matches, while "icolor" will do case
|
||||
## insensitive matches.
|
||||
##
|
||||
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
|
||||
## You may use the prefix "bright" to mean a stronger color highlight
|
||||
## for the foreground.
|
||||
##
|
||||
## To use multi-line regexes, use the start="regex" end="regex" format.
|
||||
##
|
||||
## If your system supports transparency, not specifying a background
|
||||
## color will use a transparent color. If you don't want this, be sure
|
||||
## to set the background color to black or white.
|
||||
##
|
||||
# syntax "c-file" "\.(c|C|cc|cpp|cxx|h|H|hh|hpp|hxx)$"
|
||||
# color red "\<[A-Z_]{2,}\>"
|
||||
# color green "\<(float|double|bool|char|int|short|long|sizeof|enum|void|static|const|struct|union|typedef|extern|signed|unsigned|inline)\>"
|
||||
# color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>"
|
||||
# color brightyellow "\<(for|if|while|do|else|case|default|switch|goto|continue|break|return)\>"
|
||||
# color brightyellow "\<(try|throw|catch|operator|new|delete)\>"
|
||||
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
||||
# color brightmagenta "'([^\]|(\\['abfnrtv\\]))'" "'\\(([0-7][0-7]?)|([0-3][0-7][0-7]))'" "'\\x[0-9A-Fa-f][0-9A-Fa-f]?'"
|
||||
##
|
||||
## GCC builtins
|
||||
##
|
||||
# color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(asm|builtin|inline|restrict|typeof)__"
|
||||
##
|
||||
## You will in general want your comments and strings to come last,
|
||||
## because syntax highlighting rules will be applied in the order they
|
||||
## are read in.
|
||||
##
|
||||
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
|
||||
##
|
||||
## This string is VERY resource intensive!!!
|
||||
# color brightyellow start=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
|
||||
##
|
||||
## And we want to have some nice comment highlighting too
|
||||
# color brightblue "//.*"
|
||||
# color brightblue start="/\*" end="\*/"
|
||||
|
||||
## Here is a short example for HTML
|
||||
# syntax "HTML" "\.html$"
|
||||
# color blue start="<" end=">"
|
||||
# color red "&[^;[[:space:]]]*;"
|
||||
|
||||
## Here is a short example for TeX files
|
||||
# syntax "TeX" "\.tex$"
|
||||
# color green "\\.|\\[A-Za-z]*"
|
||||
# color magenta "[{}]"
|
||||
# color blue "%.*"
|
||||
|
||||
## Here is an example for quoted emails (under e.g. mutt)
|
||||
# syntax "mutt"
|
||||
# color green "^>.*"
|
||||
|
||||
## Here is an example for groff
|
||||
##
|
||||
# syntax "groff" "\.m[ems]$" "\.tmac$" "^tmac." ".rof"
|
||||
## The argument of .nr or .ds
|
||||
# color cyan "^\.ds [^[[:space:]]]*"
|
||||
# color cyan "^\.nr [^[[:space:]]]*"
|
||||
## Single character escapes
|
||||
# color brightmagenta "\\."
|
||||
## Highlight the argument of \f or \s in the same color
|
||||
# color brightmagenta "\\f."
|
||||
# color brightmagenta "\\f\(.."
|
||||
# color brightmagenta "\\s(\+|\-)?[0-9]"
|
||||
## \n
|
||||
# color cyan "(\\|\\\\)n."
|
||||
# color cyan "(\\|\\\\)n\(.."
|
||||
# color cyan start="(\\|\\\\)n\[" end="]"
|
||||
## Requests
|
||||
# color brightgreen "^\.[[:space:]]*[^[[:space:]]]*"
|
||||
## Comments
|
||||
# color yellow "^\.\\\".*$"
|
||||
## Strings
|
||||
# color green "(\\|\\\\)\*."
|
||||
# color green "(\\|\\\\)\*\(.."
|
||||
# color green start="(\\|\\\\)\*\[" end="]"
|
||||
## Characters
|
||||
# color brightred "\\\(.."
|
||||
# color brightred start="\\\[" end="]"
|
||||
## Macro arguments
|
||||
# color brightcyan "\\\\\$[1-9]"
|
||||
|
||||
## Here is an example for perl
|
||||
##
|
||||
# syntax "perl" "\.p[lm]$"
|
||||
# color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
||||
# color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
|
||||
# color cyan start="[$@%]" end="( |\\W|-)"
|
||||
# color yellow "".*"|qq\|.*\|"
|
||||
# color white "[sm]/.*/"
|
||||
# color white start="(^use| = new)" end=";"
|
||||
# color green "#.*"
|
||||
# color yellow start="<< 'STOP'" end="STOP"
|
||||
|
||||
## Here is an example for Java source
|
||||
##
|
||||
# syntax "Java source" "\.java$"
|
||||
# color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
|
||||
# color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
|
||||
# color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
|
||||
# color red ""[^\"]*""
|
||||
# color yellow "\<(true|false|null)\>"
|
||||
# color blue "//.*"
|
||||
# color blue start="/\*" end="\*/"
|
||||
# color brightblue start="/\*\*" end="\*/"
|
||||
# color brightgreen,green "[[:space:]]+$"
|
||||
|
||||
## Here is an example for patch files
|
||||
##
|
||||
# syntax "patch" "\.(patch|diff)$"
|
||||
# color brightgreen "^\+.*"
|
||||
# color green "^\+\+\+.*"
|
||||
# color brightblue "^ .*"
|
||||
# color brightred "^-.*"
|
||||
# color red "^---.*"
|
||||
# color brightyellow "^@@.*"
|
||||
# color magenta "^diff.*"
|
||||
|
||||
## Here is an example for manpages
|
||||
##
|
||||
# syntax "manpage" "\.[1-9]x?$"
|
||||
# color green "\.(S|T)H.*$"
|
||||
# color brightgreen "\.(S|T)H" "\.TP"
|
||||
# color brightred "\.(BR?|I[PR]?).*$"
|
||||
# color brightblue "\.(BR?|I[PR]?|PP)"
|
||||
# color brightwhite "\\f[BIPR]"
|
||||
# color yellow "\.(br|DS|RS|RE|PD)"
|
||||
|
||||
## Here is an example for assembler
|
||||
##
|
||||
# syntax "asm-file" "\.(S|s|asm)$"
|
||||
# color red "\<[A-Z_]{2,}\>"
|
||||
# color brightgreen "\.(data|subsection|text)"
|
||||
# color green "\.(align|file|globl|global|hidden|section|size|type|weak)"
|
||||
# color brightyellow "\.(ascii|asciz|byte|double|float|hword|int|long|short|single|struct|word)"
|
||||
# icolor brightred "^[[:space:]]*[._A-Z0-9]*:"
|
||||
# color brightcyan "^[[:space:]]*#[[:space:]]*(define|undef|include|ifn?def|endif|elif|else|if|warning|error)"
|
||||
## Highlight strings (note: VERY resource intensive)
|
||||
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
|
||||
# color brightyellow start=""(\\.|[^\"])*\\[[:space:]]*$" end="^(\\.|[^\"])*""
|
||||
## Highlight comments
|
||||
# color brightblue "//.*"
|
||||
# color brightblue start="/\*" end="\*/"
|
||||
|
||||
## Here is an example for your .nanorc
|
||||
##
|
||||
# syntax "nanorc" "(\.|/|)nanorc$"
|
||||
## highlight possible errors and parameters
|
||||
# icolor brightwhite "^[[:space:]]*(set|unset|syntax|i?color).*$"
|
||||
## set, unset and syntax
|
||||
# icolor cyan "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|brackets|casesensitive|const|cut|fill|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|punct|quickblank|quotestr|rebinddelete)\>" "^[[:space:]]*(set|unset)[[:space:]]+(regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace)\>"
|
||||
# icolor green "^[[:space:]]*(set|unset|syntax)\>"
|
||||
## colors
|
||||
# icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
|
||||
# icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
|
||||
## strings
|
||||
# icolor white "\"(\\.|[^\"])*\""
|
||||
## comments
|
||||
# icolor blue "^[[:space:]]*#.*$"
|
||||
4
doc/texinfo/.cvsignore
Normal file
4
doc/texinfo/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nano.info
|
||||
texinfo.tex
|
||||
5
doc/texinfo/Makefile.am
Normal file
5
doc/texinfo/Makefile.am
Normal file
@@ -0,0 +1,5 @@
|
||||
info_TEXINFOS = nano.texi
|
||||
|
||||
MAKEINFO = makeinfo --no-split
|
||||
|
||||
EXTRA_DIST = nano.info
|
||||
@@ -8,8 +8,8 @@
|
||||
@c Run `makeinfo' rather than `texinfo-format-buffer'.
|
||||
@smallbook
|
||||
@set EDITION 0.1
|
||||
@set VERSION 1.2.2
|
||||
@set UPDATED 17 Jan 2003
|
||||
@set VERSION 1.3.8
|
||||
@set UPDATED 27 Jun 2005
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -23,7 +23,7 @@
|
||||
@titlepage
|
||||
@title GNU @code{nano}
|
||||
@subtitle a small and friendly text editor.
|
||||
@subtitle version 1.2.2
|
||||
@subtitle version 1.3.8
|
||||
|
||||
@author Chris Allegretta
|
||||
@page
|
||||
@@ -33,7 +33,7 @@ editor.
|
||||
|
||||
This manual is part of the GNU @code{nano} distribution.@*
|
||||
@sp4
|
||||
Copyright (C) 1999, 2000, 2001, 2002 Chris Allegretta.
|
||||
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Chris Allegretta.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
manual provided the copyright notice and this permission notice are
|
||||
@@ -91,14 +91,14 @@ internationalization support, and filename tab completion.
|
||||
@node Overview, Command Line Options, Introduction, Introduction
|
||||
@section Overview
|
||||
|
||||
@code{nano} +LINE [GNU long option] [option] [ @var{file ...} ]
|
||||
@code{nano} +LINE,COLUMN [GNU long option] [option] [ @var{file ...} ]
|
||||
|
||||
The original goal for @code{nano} was a complete bug-for-bug compatible
|
||||
emulation of Pico, but nano's main goal is to be as compatible as
|
||||
possible while offering a superset of Pico's functionality.
|
||||
Also see @xref{Pico Compatibility}, for other differences.
|
||||
emulation of Pico, but @code{nano}'s main goal is to be as compatible as
|
||||
possible while offering a superset of Pico's functionality. Also see
|
||||
@xref{Pico Compatibility}, for other differences.
|
||||
|
||||
Email bug reports to @email{nano@@nano-editor.org}.
|
||||
Email bug reports to @email{nano@@nano-editor.org}.
|
||||
|
||||
@node Command Line Options, , Overview, Introduction
|
||||
@section Command Line Options
|
||||
@@ -106,29 +106,38 @@ Email bug reports to @email{nano@@nano-editor.org}.
|
||||
@code{nano} takes the following options from the command line:
|
||||
|
||||
@table @code
|
||||
@item +LINE,COLUMN
|
||||
Start at line number LINE and column number COLUMN instead of the
|
||||
default of line 1, column 1.
|
||||
|
||||
@item -?
|
||||
Same as @code{-h, --help}.
|
||||
|
||||
@item -A, --smarthome
|
||||
Make the Home key smarter. When Home is pressed anywhere but at the
|
||||
very beginning of non-whitespace characters on a line, the cursor will
|
||||
jump to that beginning (either forwards or backwards). If the cursor is
|
||||
already at that position, it will jump to the true beginning of the
|
||||
line.
|
||||
|
||||
@item -B, --backup
|
||||
When saving a file, back up the previous version of it to the current
|
||||
filename suffixed with a ~.
|
||||
|
||||
@item -D, --dos
|
||||
Write file in DOS format.
|
||||
@item -C, --backupdir=[dir]
|
||||
Set the directory where @code{nano} puts unique backup files if file
|
||||
backups are enabled.
|
||||
|
||||
@item -E, --tabstospaces
|
||||
Convert typed tabs to spaces.
|
||||
|
||||
@item -F, --multibuffer
|
||||
Enable multiple file buffers, if available.
|
||||
|
||||
@item -I, --ignorercfiles
|
||||
Don't look at $SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
|
||||
Don't look at SYSCONFDIR/nanorc or ~/.nanorc, if nanorc support is
|
||||
available.
|
||||
|
||||
@item -K, --keypad
|
||||
Do not use the ncurses keypad() call unless necessary. Try this flag if
|
||||
you find that the arrow keys on the numeric keypad do not work for you
|
||||
under @code{nano}.
|
||||
|
||||
@item -M, --mac
|
||||
Write file in Mac format.
|
||||
|
||||
@item -N, --noconvert
|
||||
Do not convert files from DOS/Mac format.
|
||||
|
||||
@@ -142,16 +151,25 @@ Set the quoting string for justifying. The default is
|
||||
if regular expression support is available, or ``> '' otherwise. Note
|
||||
that @code{\t} above stands for a literal Tab character.
|
||||
|
||||
@item -R, --regexp
|
||||
Turn on regular expression search and search/replace.
|
||||
@item -R, --restricted
|
||||
Restricted mode: Don't read or write to any file not specified on the
|
||||
command line, read any nanorc files, allow suspending, or allow a file
|
||||
to be appended to, prepended to, or saved under a different name if it
|
||||
already has one. Also accessible by invoking @code{nano} with any name
|
||||
beginning with 'r' (e.g. "rnano").
|
||||
|
||||
@item -S, --smooth
|
||||
Enable smooth scrolling.
|
||||
|
||||
@item -T [num], --tabsize=[num]
|
||||
Set the displayed tab length to [num] columns.
|
||||
@item -T [num], --tabsize=[#cols]
|
||||
Set the displayed tab length to #cols columns. The value of #cols must
|
||||
be greater than 0. The default value is 8.
|
||||
|
||||
@item -V, --version
|
||||
@item -U, --quickblank
|
||||
Do quick statusbar blanking. Statusbar messages will disappear after 1
|
||||
keystroke instead of 25. Note that -c cancels this out.
|
||||
|
||||
@item -V, --version
|
||||
Print the version number and copyright and quit.
|
||||
|
||||
@item -Y, --syntax=[str]
|
||||
@@ -160,6 +178,12 @@ available.
|
||||
|
||||
@item -c, --const
|
||||
Constantly display the cursor position and line number on the statusbar.
|
||||
Note that this cancels out -U.
|
||||
|
||||
@item -d, --rebinddelete
|
||||
Interpret the Delete key differently so that both Backspace and Delete
|
||||
work properly. You should only need to use this option if Backspace
|
||||
acts like Delete on your system.
|
||||
|
||||
@item -h, --help
|
||||
Print the usage and exit.
|
||||
@@ -169,35 +193,35 @@ Automatically indent new lines to the same number of spaces and tabs as
|
||||
the previous line.
|
||||
|
||||
@item -k, --cut
|
||||
Makes ^K cut from the current cursor position to the end of the current
|
||||
line.
|
||||
Cut from the current cursor position to the end of the current line.
|
||||
|
||||
@item -l, --nofollow
|
||||
When writing files, if the given file is a symbolic link it is removed
|
||||
When writing files, if the given file is a symbolic link, it is removed
|
||||
and a new file is created.
|
||||
|
||||
@item -m, --mouse
|
||||
Enables the use of the mouse to select text (currently only useful for
|
||||
running under the X window system).
|
||||
running under the X Window System).
|
||||
|
||||
@item -o [dir], --operatingdir=[dir]
|
||||
Set operating directory. Makes @code{nano} set up something similar to a
|
||||
chroot.
|
||||
Set operating directory. Makes @code{nano} set up something similar to
|
||||
a chroot.
|
||||
|
||||
@item -p, --preserve
|
||||
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the editor
|
||||
can be can be stopped and started.
|
||||
Preserve the ^Q (XON) and ^S (XOFF) sequences so data being sent to the
|
||||
editor can be can be stopped and started.
|
||||
|
||||
@item -r [#cols], --fill=[#cols].
|
||||
Wrap lines at column #cols. By default this is the width of the screen,
|
||||
less eight. If this value is negative, wrapping will occur at #cols from
|
||||
the right of the screen, allowing it to vary along with the screen width
|
||||
if the screen is resized.
|
||||
Wrap lines at column #cols. If this value is 0 or less, wrapping will
|
||||
occur at #cols less the width of the screen, allowing it to vary along
|
||||
with the width of the screen if the screen is resized. The default
|
||||
value is -8.
|
||||
|
||||
@item -s [prog], --speller=[prog]
|
||||
Invoke [prog] as the spell checker. By default, @code{nano} uses its
|
||||
own interactive spell checker that requires the @code{spell} program be
|
||||
installed on your system.
|
||||
Invoke [prog] as the spell checker. By default, @code{nano} uses the
|
||||
command specified in the SPELL environment variable, or, if SPELL is not
|
||||
set, its own interactive spell checker that requires the @code{spell}
|
||||
program to be installed on your system.
|
||||
|
||||
@item -t, --tempfile
|
||||
Do not ask whether or not to save the current contents of the file when
|
||||
@@ -206,21 +230,21 @@ composer of a mailer program.
|
||||
|
||||
@anchor{Expert Mode}
|
||||
@item -x, --nohelp
|
||||
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
|
||||
screen. This affects the location of the statusbar as well, as in Expert
|
||||
Mode it is located at the very bottom of the editor.
|
||||
In Expert Mode, the Shortcut Lists will not appear at the bottom of the
|
||||
screen. This affects the location of the statusbar as well, as in
|
||||
Expert Mode it is located at the very bottom of the editor.
|
||||
|
||||
Note: When accessing the help system, Expert Mode is temporarily disabled
|
||||
to display the help system navigation keys.
|
||||
Note: When accessing the help system, Expert Mode is temporarily
|
||||
disabled to display the help system navigation keys.
|
||||
|
||||
@item -v, --view
|
||||
Do not allow the contents of the file to be altered. Note that this
|
||||
flag should NOT be used in place of correct file permissions to implement
|
||||
a read-only file.
|
||||
flag should NOT be used in place of correct file permissions to
|
||||
implement a read-only file.
|
||||
|
||||
@item -w, --nowrap
|
||||
Do not wrap long lines at any length. This option overrides any value for
|
||||
-r.
|
||||
Do not wrap long lines at any length. This option overrides any value
|
||||
for -r.
|
||||
|
||||
@item -z, --suspend
|
||||
Enable suspend ability of @code{nano} using the system's suspend
|
||||
@@ -228,9 +252,6 @@ keystroke (usually ^Z).
|
||||
|
||||
@item -a, -b, -e, -f, -g, -j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
@item +LINE
|
||||
Start at line number LINE instead of the default of line 1.
|
||||
@end table
|
||||
|
||||
@node Editor Basics, Online Help, Introduction, Top
|
||||
@@ -249,38 +270,41 @@ Start at line number LINE instead of the default of line 1.
|
||||
All key sequences in @code{nano} are entered using the keyboard.
|
||||
@code{nano} is a ``modeless'' editor. All keys with the exception of
|
||||
Control and Meta key sequences will enter text into the file being
|
||||
edited.
|
||||
edited.
|
||||
|
||||
@node Special Functions, The Titlebar, Entering Text, Editor Basics
|
||||
@section Special Functions
|
||||
|
||||
Special functions use the Control key (displayed in the help and
|
||||
shortcut lists as ^) or the Meta key (displayed as M).
|
||||
|
||||
shortcut lists as ^), the Meta key (displayed as M), or the Esc key.
|
||||
|
||||
@itemize @bullet
|
||||
|
||||
@item
|
||||
Control key sequences are entered by holding down the Control key and
|
||||
pressing the desired letter.
|
||||
pressing the desired key, or by pressing the Esc key twice and pressing
|
||||
the desired key.
|
||||
@item
|
||||
Meta key sequences can be entered in a number of
|
||||
possible ways: Pressing the Escape key, then releasing it and pressing
|
||||
the desired key, or holding down the Alt key while pressing the desired
|
||||
key. This varies from keyboard to keyboard, and certain commercial
|
||||
operating systems ``swallow'' the Alt key so that it never reaches the
|
||||
application. If your operating system does this, you should use the
|
||||
Escape key to generate Meta key sequences.
|
||||
Pressing Esc twice and then typing a three-digit number from 000 to 255
|
||||
will enter the character with the corresponding ASCII code.
|
||||
@item
|
||||
Meta key sequences can be entered in a number of possible ways: Pressing
|
||||
the Escape key, then releasing it and pressing the desired key, or
|
||||
holding down the Alt key while pressing the desired key. This varies
|
||||
from keyboard to keyboard, and certain commercial operating systems
|
||||
``swallow'' the Alt key so that it never reaches the application. If
|
||||
your operating system does this, you should use the Escape key to
|
||||
generate Meta key sequences.
|
||||
@end itemize
|
||||
|
||||
@node The Titlebar, The Statusbar, Special Functions, Editor Basics
|
||||
@section The Titlebar
|
||||
|
||||
The titlebar is the line displayed at the top of the editor. There are
|
||||
three sections: left, center and right. The section on the left displays
|
||||
the version of @code{nano} being used. The center section displays the
|
||||
current file name, or ``New Buffer'' if the file has not yet been named.
|
||||
The section on the right will display ``Modified'' if the file has been
|
||||
modified since it was last saved or opened.
|
||||
three sections: left, center and right. The section on the left
|
||||
displays the version of @code{nano} being used. The center section
|
||||
displays the current file name, or ``New Buffer'' if the file has not
|
||||
yet been named. The section on the right will display ``Modified'' if
|
||||
the file has been modified since it was last saved or opened.
|
||||
|
||||
Special modes: When @code{nano} is in ``File browser'' mode, the center
|
||||
section will display the current directory instead of the filename.
|
||||
@@ -302,13 +326,13 @@ the statusbar.
|
||||
@section Shortcut Lists
|
||||
|
||||
The Shortcut Lists are the two lines at the bottom of the screen which
|
||||
show some of the more commonly used functions in the editor.
|
||||
show some of the more commonly used functions in the editor.
|
||||
|
||||
@node Online Help, Feature Toggles, Editor Basics, Top
|
||||
@chapter Online Help
|
||||
|
||||
The online help system in @code{nano} is available by pressing ^G.
|
||||
It is fairly self explanatory, documenting the various parts of the
|
||||
It is fairly self explanatory, documenting the various parts of the
|
||||
editor and available keystrokes. Navigation is via the ^Y (Page Up)
|
||||
and ^V (Page Down) keys. ^X exits the help system.
|
||||
|
||||
@@ -317,51 +341,62 @@ and ^V (Page Down) keys. ^X exits the help system.
|
||||
@chapter Feature Toggles
|
||||
|
||||
Toggles allow you to change certain aspects of the editor that
|
||||
would normally be done via command line flags. They are invoked via
|
||||
certain Meta key sequences. @xref{Special Functions}, for more info.
|
||||
would normally be done via command line flags. They are invoked via
|
||||
certain Meta key sequences. @xref{Special Functions}, for more info.
|
||||
The following global toggles are available:
|
||||
|
||||
@table @code
|
||||
|
||||
@item Backup File Toggle (Meta-B)
|
||||
@item Backup Files Toggle (Meta-B)
|
||||
toggles the -B (@code{--backup}) command line flag.
|
||||
|
||||
@item DOS Format Toggle (Meta-D)
|
||||
toggles the -D (@code{--dos}) command line flag.
|
||||
@item Constant Cursor Position Display Toggle (Meta-C)
|
||||
toggles the -c (@code{--const}) command line flag.
|
||||
|
||||
@item Multiple Files Toggle (Meta-F)
|
||||
@item Multiple File Buffers Toggle (Meta-F)
|
||||
toggles the -F (@code{--multibuffer}) command line flag.
|
||||
|
||||
@item AutoIndent Toggle (Meta-I)
|
||||
@item Smart Home Key Toggle (Meta-H)
|
||||
toggles the -A (@code{--smarthome}) command line flag.
|
||||
|
||||
@item Auto Indent Toggle (Meta-I)
|
||||
toggles the -i (@code{--autoindent}) command line flag.
|
||||
|
||||
@item Cut To End Toggle (Meta-K)
|
||||
toggles the -k (@code{--cut}) command line flag.
|
||||
|
||||
@item Mouse Toggle (Meta-M)
|
||||
@item Long Line Wrapping Toggle (Meta-L)
|
||||
toggles the -w (@code{--nowrap}) command line flag.
|
||||
|
||||
@item Mouse Support Toggle (Meta-M)
|
||||
toggles the -m (@code{--mouse}) command line flag.
|
||||
|
||||
@item Mac Format Toggle (Meta-O)
|
||||
toggles the -M (@code{--mac}) command line flag.
|
||||
@item No Conversion From DOS/Mac Format Toggle (Meta-N)
|
||||
toggles the -N (@code{--noconvert}) command line flag.
|
||||
|
||||
@item More Space For Editing Toggle (Meta-O)
|
||||
toggles the -O (@code{--morespace}) command line flag.
|
||||
|
||||
@item Whitespace Display Toggle (Meta-P)
|
||||
toggles whitespace display mode if you have a "whitespace" option in
|
||||
your .nanorc.
|
||||
|
||||
@item Tabs to Spaces Toggle (Meta-Q)
|
||||
toggles the -E (@code{--tabstospaces}) command line flag.
|
||||
|
||||
@item Smooth Scrolling Toggle (Meta-S)
|
||||
toggles the -S (@code{--smooth}) command line flag.
|
||||
|
||||
@item AutoWrap Toggle (Meta-W)
|
||||
toggles the -w (@code{--nowrap}) command line flag.
|
||||
|
||||
@item Expert/Nohelp Toggle (Meta-X)
|
||||
@item Expert/No Help Toggle (Meta-X)
|
||||
toggles the -x (@code{--nohelp}) command line flag.
|
||||
|
||||
@item Color Syntax Highlighting Toggle (Meta-Y)
|
||||
toggles color syntax highlighting if you have color syntaxes in your
|
||||
.nanorc.
|
||||
|
||||
@item Suspend Toggle (Meta-Z)
|
||||
toggles the -z (@code{--suspend}) command line flag.
|
||||
|
||||
@item Open Previous File Toggle (Meta-<)
|
||||
changes buffer to previously loaded file.
|
||||
|
||||
@item Open Next File Toggle (Meta->)
|
||||
changes buffer to next loaded file.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@@ -375,7 +410,7 @@ find the desired file.
|
||||
Basic movement in the file browser is accomplished with the arrow keys
|
||||
and page up/down. The behavior of the enter (or `s') key varies by what
|
||||
is currently selected. If the currently selected object is a directory,
|
||||
the file browser will enter and display the contents of the directory.
|
||||
the file browser will enter and display the contents of the directory.
|
||||
If the object is a file, this filename and path are copied to the
|
||||
statusbar and the file browser is exited.
|
||||
|
||||
@@ -387,17 +422,18 @@ are certain differences between the editors:
|
||||
|
||||
@table @code
|
||||
@item Search and Replace History
|
||||
As of version 1.2.2 of @code{nano}, text entered as search or replace
|
||||
strings will be stored and can be accessed with the up/down
|
||||
arrow keys. Previously, @code{nano} offered a more consistent, but incompatible
|
||||
with Pico, method for entering search and replace strings. In the old
|
||||
method, previous entries would be displayed by default as editable text
|
||||
in front of the cursor, as opposed to being bracketed and uneditable as
|
||||
it is in Pico. The old behavior could be made compatible with Pico via the
|
||||
@code{-p} flag, but recent versions of Pico use the @code{-p} flag
|
||||
to preserve the XON and XOFF sequences within the editor. Since with the new
|
||||
method search and replace strings can still be edited by simply
|
||||
hitting the up arrow key once, the old method was removed completely.
|
||||
As of version 1.1.99pre1 of @code{nano}, text entered as search or
|
||||
replace strings will be stored and can be accessed with the up/down
|
||||
arrow keys. Previously, @code{nano} offered a more consistent, but
|
||||
incompatible with Pico, method for entering search and replace strings.
|
||||
In the old method, previous entries would be displayed by default as
|
||||
editable text in front of the cursor, as opposed to being bracketed and
|
||||
uneditable as it is in Pico. The old behavior could be made compatible
|
||||
with Pico via the @code{-p} flag, but recent versions of Pico use the
|
||||
@code{-p} flag to preserve the XON and XOFF sequences within the editor.
|
||||
Since with the new method search and replace strings can still be edited
|
||||
by simply hitting the up arrow key once, the old method was removed
|
||||
completely.
|
||||
|
||||
|
||||
@item Writing or Appending Selected Text to Files
|
||||
@@ -405,13 +441,12 @@ Text selected using the Control-Caret (^^) key can be written out or
|
||||
appended to a new or existing file using the Writeout key (^O).
|
||||
|
||||
@item Toggles
|
||||
Many options which alter the functionality of the program can be
|
||||
"toggled" on or off using Meta key sequences, meaning the program does
|
||||
not have to be restarted to turn a particular feature of the editor
|
||||
on or off. Please see the internal help function (^G) for a list of
|
||||
what functions can be toggled for a particular version of
|
||||
@code{nano}. Also see @xref{Feature Toggles}, though this may be out
|
||||
of date.
|
||||
Many options which alter the functionality of the program can be
|
||||
"toggled" on or off using Meta key sequences, meaning the program does
|
||||
not have to be restarted to turn a particular feature of the editor on
|
||||
or off. Please see the internal help function (^G) for a list of what
|
||||
functions can be toggled for a particular version of @code{nano}. Also
|
||||
see @xref{Feature Toggles}, though this may be out of date.
|
||||
|
||||
@item Cursor Position Display
|
||||
The output of the "Display Cursor Position" in @code{nano} displays
|
||||
@@ -420,24 +455,25 @@ position of the cursor.
|
||||
|
||||
@item Interactive Replace and Spell Checker
|
||||
It is worth noting that the @code{nano} replace function is interactive,
|
||||
i.e. it does not stop after one search string is found and automatically
|
||||
i.e, it does not stop after one search string is found and automatically
|
||||
replace it. The @code{nano} implementation will stop at each search
|
||||
string found and query whether to replace this instance or not. The
|
||||
internal spell checker operates similarly. Note that these is no way
|
||||
to force these functions to behave in the Pico fashion. As of
|
||||
version 1.2.2, misspelled words are sorted and trimmed for
|
||||
uniqueness in the internal spell checker such that the words 'apple'
|
||||
and 'Apple' will be prompted for correction separately.
|
||||
string found and query whether to replace this instance or not. The
|
||||
internal spell checker operates similarly. Note that these is no way to
|
||||
force these functions to behave in the Pico fashion. As of version
|
||||
1.1.99pre1, misspelled words are sorted and trimmed for uniqueness in
|
||||
the internal spell checker such that the words 'apple' and 'Apple' will
|
||||
be prompted for correction separately.
|
||||
@end table
|
||||
|
||||
@node Building and Configure Options, , Pico Compatibility, Top
|
||||
@chapter Building and Configure Options
|
||||
|
||||
Building @code{nano} from source is fairly straightforward if you are familiar
|
||||
with compiling programs with autoconf support:
|
||||
Building @code{nano} from source is fairly straightforward if you are
|
||||
familiar with compiling programs with autoconf support:
|
||||
|
||||
@itemize @bullet
|
||||
@item tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
|
||||
@item tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of
|
||||
@code{nano})
|
||||
@item cd nano-x.y.z/
|
||||
@item ./configure
|
||||
@item make
|
||||
@@ -486,13 +522,12 @@ Disable all word wrapping in the editor. This also eliminates the -w
|
||||
command line flag, as nonwrapping is then the default behavior.
|
||||
|
||||
@item --disable-nls
|
||||
Disables Native Language support. This will make the available GNU
|
||||
Disables Native Language support. This will make the available GNU
|
||||
@code{nano} translations unusable.
|
||||
|
||||
@item --with-slang
|
||||
Compiling GNU @code{nano} with Slang is supported, and will make the
|
||||
binary notably smaller than if compiled with ncurses or other curses
|
||||
libraries.
|
||||
Compiling @code{nano} with Slang is supported, and will make the binary
|
||||
notably smaller than if compiled with ncurses or other curses libraries.
|
||||
|
||||
@end table
|
||||
|
||||
939
global.c
939
global.c
@@ -1,939 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* global.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
/* Global variables */
|
||||
|
||||
/* wrap_at might be set in rcfile.c or nano.c */
|
||||
int wrap_at = -CHARS_FROM_EOL;/* Right justified fill value, allows resize */
|
||||
char *last_search = NULL; /* Last string we searched for */
|
||||
char *last_replace = NULL; /* Last replacement string */
|
||||
int search_last_line; /* Is this the last search line? */
|
||||
int search_offscreen; /* Search lines not displayed */
|
||||
|
||||
int flags = 0; /* Our new flag containing many options */
|
||||
WINDOW *edit; /* The file portion of the editor */
|
||||
WINDOW *topwin; /* Top line of screen */
|
||||
WINDOW *bottomwin; /* Bottom buffer */
|
||||
char *filename = NULL; /* Name of the file */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
struct stat originalfilestat; /* Stat for the file as we loaded it */
|
||||
#endif
|
||||
|
||||
int editwinrows = 0; /* How many rows long is the edit
|
||||
window? */
|
||||
filestruct *current; /* Current buffer pointer */
|
||||
int current_x = 0, current_y = 0; /* Current position of X and Y in
|
||||
the editor - relative to edit
|
||||
window (0,0) */
|
||||
filestruct *fileage = NULL; /* Our file buffer */
|
||||
filestruct *edittop = NULL; /* Pointer to the top of the edit
|
||||
buffer with respect to the
|
||||
file struct */
|
||||
filestruct *editbot = NULL; /* Same for the bottom */
|
||||
filestruct *filebot = NULL; /* Last node in the file struct */
|
||||
filestruct *cutbuffer = NULL; /* A place to store cut text */
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
openfilestruct *open_files = NULL; /* The list of open files */
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
char *quotestr = NULL; /* Quote string. The default value is
|
||||
set in main(). */
|
||||
#endif
|
||||
|
||||
int resetstatuspos; /* Hack for resetting the status bar
|
||||
cursor position */
|
||||
char *answer = NULL; /* Answer str to many questions */
|
||||
int totlines = 0; /* Total number of lines in the file */
|
||||
long totsize = 0; /* Total number of bytes in the file */
|
||||
int placewewant = 0; /* The column we'd like the cursor
|
||||
to jump to when we go to the
|
||||
next or previous line */
|
||||
|
||||
int tabsize = -1; /* Our internal tabsize variable. The
|
||||
default value 8 is set in main(). */
|
||||
|
||||
char *hblank = NULL; /* A horizontal blank line */
|
||||
#ifndef DISABLE_HELP
|
||||
char *help_text; /* The text in the help window */
|
||||
#endif
|
||||
|
||||
/* More stuff for the marker select */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
filestruct *mark_beginbuf; /* the begin marker buffer */
|
||||
int mark_beginx; /* X value in the string to start */
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
char *operating_dir = NULL; /* Operating directory, which we can't */
|
||||
char *full_operating_dir = NULL;/* go higher than */
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_SPELLER
|
||||
char *alt_speller = NULL; /* Alternative spell command */
|
||||
#endif
|
||||
|
||||
shortcut *main_list = NULL;
|
||||
shortcut *whereis_list = NULL;
|
||||
shortcut *replace_list = NULL;
|
||||
shortcut *replace_list_2 = NULL; /* 2nd half of replace dialog */
|
||||
shortcut *goto_list = NULL;
|
||||
shortcut *writefile_list = NULL;
|
||||
shortcut *insertfile_list = NULL;
|
||||
#ifndef DISABLE_HELP
|
||||
shortcut *help_list = NULL;
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
shortcut *spell_list = NULL;
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
shortcut *extcmd_list = NULL;
|
||||
#endif
|
||||
#ifndef DISABLE_BROWSER
|
||||
shortcut *browser_list = NULL;
|
||||
shortcut *gotodir_list = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
const colortype *colorstrings = NULL;
|
||||
syntaxtype *syntaxes = NULL;
|
||||
char *syntaxstr = NULL;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
const shortcut *currshortcut; /* Current shortcut list we're using */
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
toggle *toggles = NULL;
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
historyheadtype search_history;
|
||||
historyheadtype replace_history;
|
||||
#endif
|
||||
|
||||
/* Regular expressions */
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
regex_t search_regexp; /* Global to store compiled search regexp */
|
||||
regmatch_t regmatches[10]; /* Match positions for parenthetical
|
||||
subexpressions, max of 10 */
|
||||
#endif
|
||||
|
||||
int curses_ended = FALSE; /* Indicates to statusbar() to simply
|
||||
* write to stderr, since endwin() has
|
||||
* ended curses mode. */
|
||||
|
||||
|
||||
int length_of_list(const shortcut *s)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
for (; s != NULL; s = s->next)
|
||||
i++;
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Initialize a struct *without* our lovely braces =( */
|
||||
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
|
||||
#ifndef DISABLE_HELP
|
||||
const char *help,
|
||||
#endif
|
||||
int alt, int misc1, int misc2, int view, int (*func) (void))
|
||||
{
|
||||
shortcut *s;
|
||||
|
||||
if (*shortcutage == NULL) {
|
||||
*shortcutage = (shortcut *)nmalloc(sizeof(shortcut));
|
||||
s = *shortcutage;
|
||||
} else {
|
||||
for (s = *shortcutage; s->next != NULL; s = s->next)
|
||||
;
|
||||
s->next = (shortcut *)nmalloc(sizeof(shortcut));
|
||||
s = s->next;
|
||||
}
|
||||
|
||||
s->val = key;
|
||||
s->desc = desc;
|
||||
#ifndef DISABLE_HELP
|
||||
s->help = help;
|
||||
#endif
|
||||
s->altval = alt;
|
||||
s->misc1 = misc1;
|
||||
s->misc2 = misc2;
|
||||
s->viewok = view;
|
||||
s->func = func;
|
||||
s->next = NULL;
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Create one new toggle structure, at the end of the toggles
|
||||
* linked list. */
|
||||
void toggle_init_one(int val, const char *desc, int flag)
|
||||
{
|
||||
toggle *u;
|
||||
|
||||
if (toggles == NULL) {
|
||||
toggles = (toggle *)nmalloc(sizeof(toggle));
|
||||
u = toggles;
|
||||
} else {
|
||||
for (u = toggles; u->next != NULL; u = u->next)
|
||||
;
|
||||
u->next = (toggle *)nmalloc(sizeof(toggle));
|
||||
u = u->next;
|
||||
}
|
||||
|
||||
u->val = val;
|
||||
u->desc = desc;
|
||||
u->flag = flag;
|
||||
u->next = NULL;
|
||||
}
|
||||
|
||||
void toggle_init(void)
|
||||
{
|
||||
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
|
||||
*toggle_nohelp_msg, *toggle_cuttoend_msg,
|
||||
*toggle_noconvert_msg, *toggle_dos_msg, *toggle_mac_msg,
|
||||
*toggle_backup_msg, *toggle_smooth_msg;
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
char *toggle_mouse_msg;
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPPING
|
||||
char *toggle_wrap_msg;
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
char *toggle_load_msg;
|
||||
#endif
|
||||
#ifdef ENABLE_COLOR
|
||||
char *toggle_syntax_msg;
|
||||
#endif
|
||||
|
||||
/* There is no need to reinitialize the toggles. They can't
|
||||
change. */
|
||||
if (toggles != NULL)
|
||||
return;
|
||||
|
||||
toggle_const_msg = _("Constant cursor position");
|
||||
toggle_autoindent_msg = _("Auto indent");
|
||||
toggle_suspend_msg = _("Suspend");
|
||||
toggle_nohelp_msg = _("Help mode");
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
toggle_mouse_msg = _("Mouse support");
|
||||
#endif
|
||||
toggle_cuttoend_msg = _("Cut to end");
|
||||
toggle_noconvert_msg = _("No conversion from DOS/Mac format");
|
||||
toggle_dos_msg = _("Writing file in DOS format");
|
||||
toggle_mac_msg = _("Writing file in Mac format");
|
||||
toggle_backup_msg = _("Backing up file");
|
||||
toggle_smooth_msg = _("Smooth scrolling");
|
||||
#ifdef ENABLE_COLOR
|
||||
toggle_syntax_msg = _("Color syntax highlighting");
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPPING
|
||||
toggle_wrap_msg = _("Auto wrap");
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
toggle_load_msg = _("Multiple file buffers");
|
||||
#endif
|
||||
|
||||
toggle_init_one(TOGGLE_CONST_KEY, toggle_const_msg, CONSTUPDATE);
|
||||
toggle_init_one(TOGGLE_AUTOINDENT_KEY, toggle_autoindent_msg, AUTOINDENT);
|
||||
toggle_init_one(TOGGLE_SUSPEND_KEY, toggle_suspend_msg, SUSPEND);
|
||||
toggle_init_one(TOGGLE_NOHELP_KEY, toggle_nohelp_msg, NO_HELP);
|
||||
#ifndef DISABLE_WRAPPING
|
||||
toggle_init_one(TOGGLE_WRAP_KEY, toggle_wrap_msg, NO_WRAP);
|
||||
#endif
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
toggle_init_one(TOGGLE_MOUSE_KEY, toggle_mouse_msg, USE_MOUSE);
|
||||
#endif
|
||||
toggle_init_one(TOGGLE_CUTTOEND_KEY, toggle_cuttoend_msg, CUT_TO_END);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
toggle_init_one(TOGGLE_LOAD_KEY, toggle_load_msg, MULTIBUFFER);
|
||||
#endif
|
||||
toggle_init_one(TOGGLE_NOCONVERT_KEY, toggle_noconvert_msg, NO_CONVERT);
|
||||
toggle_init_one(TOGGLE_DOS_KEY, toggle_dos_msg, DOS_FILE);
|
||||
toggle_init_one(TOGGLE_MAC_KEY, toggle_mac_msg, MAC_FILE);
|
||||
toggle_init_one(TOGGLE_BACKUP_KEY, toggle_backup_msg, BACKUP_FILE);
|
||||
toggle_init_one(TOGGLE_SMOOTH_KEY, toggle_smooth_msg, SMOOTHSCROLL);
|
||||
#ifdef ENABLE_COLOR
|
||||
toggle_init_one(TOGGLE_SYNTAX_KEY, toggle_syntax_msg, COLOR_SYNTAX);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/* Deallocate all of the toggles. */
|
||||
void free_toggles(void)
|
||||
{
|
||||
while (toggles != NULL) {
|
||||
toggle *pt = toggles; /* Think "previous toggle" */
|
||||
|
||||
toggles = toggles->next;
|
||||
free(pt);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* Deallocate the given shortcut. */
|
||||
void free_shortcutage(shortcut **shortcutage)
|
||||
{
|
||||
assert(shortcutage != NULL);
|
||||
while (*shortcutage != NULL) {
|
||||
shortcut *ps = *shortcutage;
|
||||
*shortcutage = (*shortcutage)->next;
|
||||
free(ps);
|
||||
}
|
||||
}
|
||||
|
||||
void shortcut_init(int unjustify)
|
||||
{
|
||||
#ifndef DISABLE_HELP
|
||||
const char *nano_help_msg = "", *nano_writeout_msg = "", *nano_exit_msg =
|
||||
"", *nano_goto_msg = "", *nano_justify_msg =
|
||||
"", *nano_replace_msg = "", *nano_insert_msg =
|
||||
"", *nano_whereis_msg = "", *nano_prevpage_msg =
|
||||
"", *nano_nextpage_msg = "", *nano_cut_msg =
|
||||
"", *nano_uncut_msg = "", *nano_cursorpos_msg =
|
||||
"", *nano_spell_msg = "", *nano_up_msg = "", *nano_down_msg =
|
||||
"", *nano_forward_msg = "", *nano_back_msg = "", *nano_home_msg =
|
||||
"", *nano_end_msg = "", *nano_firstline_msg =
|
||||
"", *nano_lastline_msg = "", *nano_refresh_msg =
|
||||
"", *nano_mark_msg = "", *nano_delete_msg =
|
||||
"", *nano_backspace_msg = "", *nano_tab_msg =
|
||||
"", *nano_enter_msg = "", *nano_cancel_msg =
|
||||
"", *nano_unjustify_msg = "", *nano_append_msg =
|
||||
"", *nano_prepend_msg = "", *nano_tofiles_msg =
|
||||
"", *nano_gotodir_msg = "", *nano_case_msg =
|
||||
"", *nano_reverse_msg = "", *nano_execute_msg =
|
||||
"", *nano_dos_msg = "", *nano_mac_msg =
|
||||
"", *nano_backup_msg = "", *nano_editstr_msg = "";
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
const char *nano_openprev_msg = "", *nano_opennext_msg =
|
||||
"", *nano_multibuffer_msg = "";
|
||||
#endif
|
||||
#ifdef HAVE_REGEX_H
|
||||
const char *nano_regexp_msg = "", *nano_bracket_msg = "";
|
||||
#endif
|
||||
|
||||
nano_help_msg = _("Invoke the help menu");
|
||||
nano_writeout_msg = _("Write the current file to disk");
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
nano_exit_msg = _("Close currently loaded file/Exit from nano");
|
||||
#else
|
||||
nano_exit_msg = _("Exit from nano");
|
||||
#endif
|
||||
nano_goto_msg = _("Go to a specific line number");
|
||||
nano_justify_msg = _("Justify the current paragraph");
|
||||
nano_unjustify_msg = _("Unjustify after a justify");
|
||||
nano_replace_msg = _("Replace text within the editor");
|
||||
nano_insert_msg = _("Insert another file into the current one");
|
||||
nano_whereis_msg = _("Search for text within the editor");
|
||||
nano_prevpage_msg = _("Move to the previous screen");
|
||||
nano_nextpage_msg = _("Move to the next screen");
|
||||
nano_cut_msg = _("Cut the current line and store it in the cutbuffer");
|
||||
nano_uncut_msg = _("Uncut from the cutbuffer into the current line");
|
||||
nano_cursorpos_msg = _("Show the position of the cursor");
|
||||
nano_spell_msg = _("Invoke the spell checker, if available");
|
||||
nano_up_msg = _("Move up one line");
|
||||
nano_down_msg = _("Move down one line");
|
||||
nano_forward_msg = _("Move forward one character");
|
||||
nano_back_msg = _("Move back one character");
|
||||
nano_home_msg = _("Move to the beginning of the current line");
|
||||
nano_end_msg = _("Move to the end of the current line");
|
||||
nano_firstline_msg = _("Go to the first line of the file");
|
||||
nano_lastline_msg = _("Go to the last line of the file");
|
||||
nano_refresh_msg = _("Refresh (redraw) the current screen");
|
||||
nano_mark_msg = _("Mark text at the current cursor location");
|
||||
nano_delete_msg = _("Delete the character under the cursor");
|
||||
nano_backspace_msg =
|
||||
_("Delete the character to the left of the cursor");
|
||||
nano_tab_msg = _("Insert a tab character");
|
||||
nano_enter_msg = _("Insert a carriage return at the cursor position");
|
||||
nano_case_msg =
|
||||
_("Make the current search or replace case (in)sensitive");
|
||||
nano_tofiles_msg = _("Go to file browser");
|
||||
nano_execute_msg = _("Execute external command");
|
||||
nano_gotodir_msg = _("Go to directory");
|
||||
nano_cancel_msg = _("Cancel the current function");
|
||||
nano_append_msg = _("Append to the current file");
|
||||
nano_prepend_msg = _("Prepend to the current file");
|
||||
nano_reverse_msg = _("Search backwards");
|
||||
nano_dos_msg = _("Write file out in DOS format");
|
||||
nano_mac_msg = _("Write file out in Mac format");
|
||||
nano_backup_msg = _("Back up original file when saving");
|
||||
nano_editstr_msg = _("Edit the previous search/replace strings");
|
||||
#ifdef HAVE_REGEX_H
|
||||
nano_regexp_msg = _("Use regular expressions");
|
||||
nano_bracket_msg = _("Find other bracket");
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
nano_openprev_msg = _("Open previously loaded file");
|
||||
nano_opennext_msg = _("Open next loaded file");
|
||||
nano_multibuffer_msg = _("Toggle insert into new buffer");
|
||||
#endif
|
||||
#endif /* !DISABLE_HELP */
|
||||
|
||||
free_shortcutage(&main_list);
|
||||
|
||||
/* The following macro is to be used in calling sc_init_one. The point is
|
||||
* that sc_init_one takes 9 arguments, unless DISABLE_HELP is defined,
|
||||
* when the fourth one should not be there. */
|
||||
#ifdef DISABLE_HELP
|
||||
# define IFHELP(help, nextvar) nextvar
|
||||
#else
|
||||
# define IFHELP(help, nextvar) help, nextvar
|
||||
#endif
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), NANO_HELP_FKEY, 0, VIEW,
|
||||
do_help);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
if (open_files != NULL && (open_files->prev != NULL || open_files->next != NULL))
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_EXIT_KEY, _("Close"),
|
||||
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
||||
do_exit);
|
||||
else
|
||||
#endif
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_EXIT_KEY, _("Exit"),
|
||||
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
||||
do_exit);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_WRITEOUT_KEY, _("WriteOut"),
|
||||
IFHELP(nano_writeout_msg, 0),
|
||||
NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
|
||||
IFHELP(nano_justify_msg, 0), NANO_JUSTIFY_FKEY, 0,
|
||||
NOVIEW, do_justify);
|
||||
|
||||
/* this is so we can view multiple files */
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
IFHELP(nano_insert_msg, 0), NANO_INSERTFILE_FKEY, 0,
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
VIEW
|
||||
#else
|
||||
NOVIEW
|
||||
#endif
|
||||
, do_insertfile_void);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_WHEREIS_KEY, _("Where Is"),
|
||||
IFHELP(nano_whereis_msg, 0),
|
||||
NANO_WHEREIS_FKEY, 0, VIEW, do_search);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_PREVPAGE_KEY, _("Prev Page"),
|
||||
IFHELP(nano_prevpage_msg, 0),
|
||||
NANO_PREVPAGE_FKEY, KEY_PPAGE, VIEW, do_page_up);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_NEXTPAGE_KEY, _("Next Page"),
|
||||
IFHELP(nano_nextpage_msg, 0),
|
||||
NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_CUT_KEY, _("Cut Text"),
|
||||
IFHELP(nano_cut_msg, 0),
|
||||
NANO_CUT_FKEY, 0, NOVIEW, do_cut_text);
|
||||
|
||||
if (unjustify)
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_UNJUSTIFY_KEY, _("UnJustify"),
|
||||
IFHELP(nano_unjustify_msg, 0),
|
||||
0, 0, NOVIEW, do_uncut_text);
|
||||
else
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_UNCUT_KEY, _("UnCut Txt"),
|
||||
IFHELP(nano_uncut_msg, 0),
|
||||
NANO_UNCUT_FKEY, 0, NOVIEW, do_uncut_text);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_CURSORPOS_KEY, _("Cur Pos"),
|
||||
IFHELP(nano_cursorpos_msg, 0),
|
||||
NANO_CURSORPOS_FKEY, 0, VIEW, do_cursorpos_void);
|
||||
|
||||
/* Translators: try to keep this string under 10 characters long */
|
||||
sc_init_one(&main_list, NANO_SPELL_KEY, _("To Spell"),
|
||||
IFHELP(nano_spell_msg, 0),
|
||||
NANO_SPELL_FKEY, 0, NOVIEW, do_spell);
|
||||
|
||||
sc_init_one(&main_list, NANO_UP_KEY, _("Up"),
|
||||
IFHELP(nano_up_msg, 0),
|
||||
KEY_UP, 0, VIEW, do_up);
|
||||
|
||||
sc_init_one(&main_list, NANO_DOWN_KEY, _("Down"),
|
||||
IFHELP(nano_down_msg, 0),
|
||||
KEY_DOWN, 0, VIEW, do_down);
|
||||
|
||||
sc_init_one(&main_list, NANO_FORWARD_KEY, _("Forward"),
|
||||
IFHELP(nano_forward_msg, 0),
|
||||
KEY_RIGHT, 0, VIEW, do_right);
|
||||
|
||||
sc_init_one(&main_list, NANO_BACK_KEY, _("Back"),
|
||||
IFHELP(nano_back_msg, 0),
|
||||
KEY_LEFT, 0, VIEW, do_left);
|
||||
|
||||
sc_init_one(&main_list, NANO_HOME_KEY, _("Home"),
|
||||
IFHELP(nano_home_msg, 0),
|
||||
KEY_HOME, 362, VIEW, do_home);
|
||||
|
||||
sc_init_one(&main_list, NANO_END_KEY, _("End"),
|
||||
IFHELP(nano_end_msg, 0),
|
||||
KEY_END, 385, VIEW, do_end);
|
||||
|
||||
sc_init_one(&main_list, NANO_REFRESH_KEY, _("Refresh"),
|
||||
IFHELP(nano_refresh_msg, 0),
|
||||
0, 0, VIEW, total_refresh);
|
||||
|
||||
sc_init_one(&main_list, NANO_MARK_KEY, _("Mark Text"),
|
||||
IFHELP(nano_mark_msg, NANO_ALT_MARK_KEY),
|
||||
0, 0, NOVIEW, do_mark);
|
||||
|
||||
sc_init_one(&main_list, NANO_DELETE_KEY, _("Delete"),
|
||||
IFHELP(nano_delete_msg, 0), KEY_DC,
|
||||
NANO_CONTROL_D, NOVIEW, do_delete);
|
||||
|
||||
sc_init_one(&main_list, NANO_BACKSPACE_KEY, _("Backspace"),
|
||||
IFHELP(nano_backspace_msg, 0),
|
||||
KEY_BACKSPACE, 127, NOVIEW, do_backspace);
|
||||
|
||||
sc_init_one(&main_list, NANO_TAB_KEY, _("Tab"),
|
||||
IFHELP(nano_tab_msg, 0), 0, 0, NOVIEW, do_tab);
|
||||
|
||||
sc_init_one(&main_list, NANO_REPLACE_KEY, _("Replace"),
|
||||
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY),
|
||||
NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
|
||||
|
||||
sc_init_one(&main_list, NANO_ENTER_KEY, _("Enter"),
|
||||
IFHELP(nano_enter_msg, 0),
|
||||
KEY_ENTER, NANO_CONTROL_M, NOVIEW, do_enter);
|
||||
|
||||
sc_init_one(&main_list, NANO_GOTO_KEY, _("Go To Line"),
|
||||
IFHELP(nano_goto_msg, NANO_ALT_GOTO_KEY),
|
||||
NANO_GOTO_FKEY, 0, VIEW, do_gotoline_void);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
sc_init_one(&main_list, NANO_NEXTWORD_KEY, _("Next Word"),
|
||||
IFHELP(_("Move forward one word"), 0),
|
||||
0, 0, VIEW, do_next_word);
|
||||
|
||||
sc_init_one(&main_list, -9, _("Prev Word"),
|
||||
IFHELP(_("Move backward one word"), NANO_PREVWORD_KEY), 0, 0,
|
||||
VIEW, do_prev_word);
|
||||
#endif
|
||||
#if !defined(NANO_SMALL) && defined(HAVE_REGEX_H)
|
||||
sc_init_one(&main_list, -9, _("Find Other Bracket"),
|
||||
IFHELP(nano_bracket_msg, NANO_BRACKET_KEY),
|
||||
0, 0, VIEW, do_find_bracket);
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
sc_init_one(&main_list, -9, _("Previous File"),
|
||||
IFHELP(nano_openprev_msg, NANO_OPENPREV_KEY),
|
||||
0, 0, VIEW, open_prevfile_void);
|
||||
sc_init_one(&main_list, -9, _("Next File"),
|
||||
IFHELP(nano_opennext_msg, NANO_OPENNEXT_KEY),
|
||||
0, 0, VIEW, open_nextfile_void);
|
||||
#endif
|
||||
|
||||
free_shortcutage(&whereis_list);
|
||||
|
||||
sc_init_one(&whereis_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
IFHELP(nano_firstline_msg, 0),
|
||||
0, 0, VIEW, do_first_line);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, NANO_LASTLINE_KEY, _("Last Line"),
|
||||
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, NANO_OTHERSEARCH_KEY, _("Replace"),
|
||||
IFHELP(nano_replace_msg, 0), 0, 0, VIEW, do_replace);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, NANO_FROMSEARCHTOGOTO_KEY, _("Go To Line"),
|
||||
IFHELP(nano_goto_msg, 0), 0, 0, VIEW, do_gotoline_void);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, TOGGLE_CASE_KEY, _("Case Sens"),
|
||||
IFHELP(nano_case_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, TOGGLE_BACKWARDS_KEY, _("Direction"),
|
||||
IFHELP(nano_reverse_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, TOGGLE_REGEXP_KEY, _("Regexp"),
|
||||
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&whereis_list, KEY_UP, _("History"),
|
||||
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
free_shortcutage(&replace_list);
|
||||
|
||||
sc_init_one(&replace_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&replace_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&replace_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
IFHELP(nano_firstline_msg, 0), 0, 0, VIEW, do_first_line);
|
||||
|
||||
sc_init_one(&replace_list, NANO_LASTLINE_KEY, _("Last Line"),
|
||||
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
||||
|
||||
/* Translators: try to keep this string under 12 characters long */
|
||||
sc_init_one(&replace_list, NANO_OTHERSEARCH_KEY, _("No Replace"),
|
||||
IFHELP(nano_whereis_msg, 0), 0, 0, VIEW, do_search);
|
||||
|
||||
sc_init_one(&replace_list, NANO_FROMSEARCHTOGOTO_KEY, _("Go To Line"),
|
||||
IFHELP(nano_goto_msg, 0), 0, 0, VIEW, do_gotoline_void);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
sc_init_one(&replace_list, TOGGLE_CASE_KEY, _("Case Sens"),
|
||||
IFHELP(nano_case_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&replace_list, TOGGLE_BACKWARDS_KEY, _("Direction"),
|
||||
IFHELP(nano_reverse_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
sc_init_one(&replace_list, TOGGLE_REGEXP_KEY, _("Regexp"),
|
||||
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
sc_init_one(&replace_list, KEY_UP, _("History"),
|
||||
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
free_shortcutage(&replace_list_2);
|
||||
|
||||
sc_init_one(&replace_list_2, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&replace_list_2, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&replace_list_2, NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
IFHELP(nano_firstline_msg, 0), 0, 0, VIEW, do_first_line);
|
||||
|
||||
sc_init_one(&replace_list_2, NANO_LASTLINE_KEY, _("Last Line"),
|
||||
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
sc_init_one(&replace_list_2, KEY_UP, _("History"),
|
||||
IFHELP(nano_editstr_msg, 0), NANO_UP_KEY, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
free_shortcutage(&goto_list);
|
||||
|
||||
sc_init_one(&goto_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&goto_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&goto_list, NANO_FIRSTLINE_KEY, _("First Line"),
|
||||
IFHELP(nano_firstline_msg, 0), 0, 0, VIEW, do_first_line);
|
||||
|
||||
sc_init_one(&goto_list, NANO_LASTLINE_KEY, _("Last Line"),
|
||||
IFHELP(nano_lastline_msg, 0), 0, 0, VIEW, do_last_line);
|
||||
|
||||
#ifndef DISABLE_HELP
|
||||
free_shortcutage(&help_list);
|
||||
|
||||
sc_init_one(&help_list, NANO_PREVPAGE_KEY, _("Prev Page"),
|
||||
IFHELP(nano_prevpage_msg, 0), NANO_PREVPAGE_FKEY,
|
||||
KEY_PPAGE, VIEW, do_page_up);
|
||||
|
||||
sc_init_one(&help_list, NANO_NEXTPAGE_KEY, _("Next Page"),
|
||||
IFHELP(nano_nextpage_msg, 0),
|
||||
NANO_NEXTPAGE_FKEY, KEY_NPAGE, VIEW, do_page_down);
|
||||
|
||||
sc_init_one(&help_list, NANO_EXIT_KEY, _("Exit"),
|
||||
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
||||
do_exit);
|
||||
#endif
|
||||
|
||||
free_shortcutage(&writefile_list);
|
||||
|
||||
sc_init_one(&writefile_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
/* Translators: try to keep this string under 16 characters long */
|
||||
sc_init_one(&writefile_list, NANO_TOFILES_KEY, _("To Files"),
|
||||
IFHELP(nano_tofiles_msg, 0), 0, 0, NOVIEW, 0);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 16 characters long */
|
||||
sc_init_one(&writefile_list, TOGGLE_DOS_KEY, _("DOS Format"),
|
||||
IFHELP(nano_dos_msg, 0), 0, 0, NOVIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 16 characters long */
|
||||
sc_init_one(&writefile_list, TOGGLE_MAC_KEY, _("Mac Format"),
|
||||
IFHELP(nano_mac_msg, 0), 0, 0, NOVIEW, 0);
|
||||
#endif
|
||||
|
||||
/* Translators: try to keep this string under 16 characters long */
|
||||
sc_init_one(&writefile_list, NANO_APPEND_KEY, _("Append"),
|
||||
IFHELP(nano_append_msg, 0), 0, 0, NOVIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 16 characters long */
|
||||
sc_init_one(&writefile_list, NANO_PREPEND_KEY, _("Prepend"),
|
||||
IFHELP(nano_prepend_msg, 0), 0, 0, NOVIEW, 0);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 16 characters long */
|
||||
sc_init_one(&writefile_list, TOGGLE_BACKUP_KEY, _("Backup File"),
|
||||
IFHELP(nano_backup_msg, 0), 0, 0, NOVIEW, 0);
|
||||
#endif
|
||||
|
||||
sc_init_one(&writefile_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
free_shortcutage(&insertfile_list);
|
||||
|
||||
sc_init_one(&insertfile_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&insertfile_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
sc_init_one(&insertfile_list, NANO_TOFILES_KEY, _("To Files"),
|
||||
IFHELP(nano_tofiles_msg, 0), 0, 0, NOVIEW, 0);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
/* Translators: try to keep this string under 22 characters long */
|
||||
sc_init_one(&insertfile_list, NANO_EXTCMD_KEY, _("Execute Command"),
|
||||
IFHELP(nano_execute_msg, 0), 0, 0, NOVIEW, 0);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
/* Translators: try to keep this string under 22 characters long */
|
||||
sc_init_one(&insertfile_list, TOGGLE_LOAD_KEY, _("New Buffer"),
|
||||
IFHELP(nano_multibuffer_msg, 0), 0, 0, NOVIEW, 0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_SPELLER
|
||||
free_shortcutage(&spell_list);
|
||||
|
||||
sc_init_one(&spell_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&spell_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
free_shortcutage(&extcmd_list);
|
||||
|
||||
sc_init_one(&extcmd_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&extcmd_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_BROWSER
|
||||
free_shortcutage(&browser_list);
|
||||
|
||||
sc_init_one(&browser_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&browser_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), NANO_EXIT_FKEY, 0, VIEW, 0);
|
||||
|
||||
sc_init_one(&browser_list, NANO_PREVPAGE_KEY, _("Prev Page"),
|
||||
IFHELP(nano_prevpage_msg, 0), NANO_PREVPAGE_FKEY,
|
||||
KEY_PPAGE, VIEW, 0);
|
||||
|
||||
sc_init_one(&browser_list, NANO_NEXTPAGE_KEY, _("Next Page"),
|
||||
IFHELP(nano_nextpage_msg, 0), NANO_NEXTPAGE_FKEY,
|
||||
KEY_NPAGE, VIEW, 0);
|
||||
|
||||
/* Translators: try to keep this string under 22 characters long */
|
||||
sc_init_one(&browser_list, NANO_GOTO_KEY, _("Go To Dir"),
|
||||
IFHELP(nano_gotodir_msg, NANO_ALT_GOTO_KEY),
|
||||
NANO_GOTO_FKEY, 0, VIEW, 0);
|
||||
|
||||
free_shortcutage(&gotodir_list);
|
||||
|
||||
sc_init_one(&gotodir_list, NANO_HELP_KEY, _("Get Help"),
|
||||
IFHELP(nano_help_msg, 0), 0, 0, VIEW, do_help);
|
||||
|
||||
sc_init_one(&gotodir_list, NANO_CANCEL_KEY, _("Cancel"),
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
currshortcut = main_list;
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
toggle_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* This function is called just before calling exit(). Practically, the
|
||||
* only effect is to cause a segmentation fault if the various data
|
||||
* structures got bolloxed earlier. Thus, we don't bother having this
|
||||
* function unless debugging is turned on. */
|
||||
#ifdef DEBUG
|
||||
/* added by SPK for memory cleanup, gracefully return our malloc()s */
|
||||
void thanks_for_all_the_fish(void)
|
||||
{
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
if (quotestr != NULL)
|
||||
free(quotestr);
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
if (operating_dir != NULL)
|
||||
free(operating_dir);
|
||||
if (full_operating_dir != NULL)
|
||||
free(full_operating_dir);
|
||||
#endif
|
||||
if (last_search != NULL)
|
||||
free(last_search);
|
||||
if (last_replace != NULL)
|
||||
free(last_replace);
|
||||
if (hblank != NULL)
|
||||
free(hblank);
|
||||
#ifndef DISABLE_SPELLER
|
||||
if (alt_speller != NULL)
|
||||
free(alt_speller);
|
||||
#endif
|
||||
#ifndef DISABLE_HELP
|
||||
if (help_text != NULL)
|
||||
free(help_text);
|
||||
#endif
|
||||
if (filename != NULL)
|
||||
free(filename);
|
||||
if (answer != NULL)
|
||||
free(answer);
|
||||
if (cutbuffer != NULL)
|
||||
free_filestruct(cutbuffer);
|
||||
|
||||
free_shortcutage(&main_list);
|
||||
free_shortcutage(&whereis_list);
|
||||
free_shortcutage(&replace_list);
|
||||
free_shortcutage(&replace_list_2);
|
||||
free_shortcutage(&goto_list);
|
||||
free_shortcutage(&writefile_list);
|
||||
free_shortcutage(&insertfile_list);
|
||||
#ifndef DISABLE_HELP
|
||||
free_shortcutage(&help_list);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
free_shortcutage(&spell_list);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
free_shortcutage(&extcmd_list);
|
||||
#endif
|
||||
#ifndef DISABLE_BROWSER
|
||||
free_shortcutage(&browser_list);
|
||||
free_shortcutage(&gotodir_list);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
free_toggles();
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
if (open_files != NULL) {
|
||||
/* We free the memory associated with each open file. */
|
||||
while (open_files->prev != NULL)
|
||||
open_files = open_files->prev;
|
||||
free_openfilestruct(open_files);
|
||||
}
|
||||
#else
|
||||
free_filestruct(fileage);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
free(syntaxstr);
|
||||
while (syntaxes != NULL) {
|
||||
syntaxtype *bill = syntaxes;
|
||||
|
||||
free(syntaxes->desc);
|
||||
while (syntaxes->extensions != NULL) {
|
||||
exttype *bob = syntaxes->extensions;
|
||||
|
||||
syntaxes->extensions = bob->next;
|
||||
regfree(&bob->val);
|
||||
free(bob);
|
||||
}
|
||||
while (syntaxes->color != NULL) {
|
||||
colortype *bob = syntaxes->color;
|
||||
|
||||
syntaxes->color = bob->next;
|
||||
regfree(&bob->start);
|
||||
if (bob->end != NULL)
|
||||
regfree(bob->end);
|
||||
free(bob->end);
|
||||
free(bob);
|
||||
}
|
||||
syntaxes = syntaxes->next;
|
||||
free(bill);
|
||||
}
|
||||
#endif /* ENABLE_COLOR */
|
||||
#ifndef NANO_SMALL
|
||||
/* free history lists */
|
||||
free_history(&search_history);
|
||||
free_history(&replace_history);
|
||||
#endif
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
@@ -1,4 +1,5 @@
|
||||
EXTRA_DIST = ulonglong.m4 intdiv0.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 \
|
||||
stdint_h.m4 uintmax_t.m4 isc-posix.m4 lib-ld.m4 lib-link.m4 \
|
||||
lib-prefix.m4 codeset.m4 glibc21.m4 progtest.m4 gettext.m4 \
|
||||
iconv.m4 lcmessage.m4
|
||||
EXTRA_DIST = codeset.m4 gettext.m4 glib-2.0.m4 glibc21.m4 iconv.m4 \
|
||||
intdiv0.m4 inttypes_h.m4 inttypes.m4 inttypes-pri.m4 \
|
||||
isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 \
|
||||
lib-prefix.m4 progtest.m4 stdint_h.m4 uintmax_t.m4 \
|
||||
ulonglong.m4
|
||||
|
||||
212
m4/glib-2.0.m4
Normal file
212
m4/glib-2.0.m4
Normal file
@@ -0,0 +1,212 @@
|
||||
# Configure paths for GLIB
|
||||
# Owen Taylor 1997-2001
|
||||
|
||||
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
|
||||
dnl gthread is specified in MODULES, pass to pkg-config
|
||||
dnl
|
||||
AC_DEFUN([AM_PATH_GLIB_2_0],
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from pkg-config
|
||||
dnl
|
||||
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
|
||||
, enable_glibtest=yes)
|
||||
|
||||
pkg_config_args=glib-2.0
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gmodule)
|
||||
pkg_config_args="$pkg_config_args gmodule-2.0"
|
||||
;;
|
||||
gobject)
|
||||
pkg_config_args="$pkg_config_args gobject-2.0"
|
||||
;;
|
||||
gthread)
|
||||
pkg_config_args="$pkg_config_args gthread-2.0"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
||||
|
||||
no_glib=""
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
|
||||
:
|
||||
else
|
||||
echo *** pkg-config too old; version 0.7 or better required.
|
||||
no_glib=yes
|
||||
PKG_CONFIG=no
|
||||
fi
|
||||
else
|
||||
no_glib=yes
|
||||
fi
|
||||
|
||||
min_glib_version=ifelse([$1], ,2.0.0,$1)
|
||||
AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
|
||||
|
||||
if test x$PKG_CONFIG != xno ; then
|
||||
## don't try to run the test against uninstalled libtool libs
|
||||
if $PKG_CONFIG --uninstalled $pkg_config_args; then
|
||||
echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
|
||||
enable_glibtest=no
|
||||
fi
|
||||
|
||||
if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
|
||||
:
|
||||
else
|
||||
no_glib=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x"$no_glib" = x ; then
|
||||
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
|
||||
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
|
||||
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
|
||||
|
||||
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
|
||||
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
|
||||
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_glibtest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$GLIB_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GLIB is sufficiently new. (Also sanity
|
||||
dnl checks the results of pkg-config to some extent)
|
||||
dnl
|
||||
rm -f conf.glibtest
|
||||
AC_TRY_RUN([
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
system ("touch conf.glibtest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_glib_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_glib_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((glib_major_version != $glib_config_major_version) ||
|
||||
(glib_minor_version != $glib_config_minor_version) ||
|
||||
(glib_micro_version != $glib_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
|
||||
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
||||
printf("*** to point to the correct configuration files\n");
|
||||
}
|
||||
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
|
||||
(glib_minor_version != GLIB_MINOR_VERSION) ||
|
||||
(glib_micro_version != GLIB_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GLIB header files (version %d.%d.%d) do not match\n",
|
||||
GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((glib_major_version > major) ||
|
||||
((glib_major_version == major) && (glib_minor_version > minor)) ||
|
||||
((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
|
||||
glib_major_version, glib_minor_version, glib_micro_version);
|
||||
printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_glib" = x ; then
|
||||
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$PKG_CONFIG" = "no" ; then
|
||||
echo "*** A new enough version of pkg-config was not found."
|
||||
echo "*** See http://www.freedesktop.org/software/pkgconfig/"
|
||||
else
|
||||
if test -f conf.glibtest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GLIB test program, checking why..."
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
LIBS="$LIBS $GLIB_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
|
||||
echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GLIB_CFLAGS=""
|
||||
GLIB_LIBS=""
|
||||
GLIB_GENMARSHAL=""
|
||||
GOBJECT_QUERY=""
|
||||
GLIB_MKENUMS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GLIB_CFLAGS)
|
||||
AC_SUBST(GLIB_LIBS)
|
||||
AC_SUBST(GLIB_GENMARSHAL)
|
||||
AC_SUBST(GOBJECT_QUERY)
|
||||
AC_SUBST(GLIB_MKENUMS)
|
||||
rm -f conf.glibtest
|
||||
])
|
||||
222
move.c
222
move.c
@@ -1,222 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
int do_home(void)
|
||||
{
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_end(void)
|
||||
{
|
||||
current_x = strlen(current->data);
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void page_up(void)
|
||||
{
|
||||
if (edittop != fileage) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMOOTHSCROLL))
|
||||
edit_update(edittop->prev, TOP);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
edit_update(edittop, CENTER);
|
||||
/* Now that we've updated the edit window, edittop might be
|
||||
at the top of the file; if so, just move the cursor up one
|
||||
line and don't center it. */
|
||||
if (edittop != fileage)
|
||||
center_cursor();
|
||||
else
|
||||
reset_cursor();
|
||||
}
|
||||
} else
|
||||
current_y = 0;
|
||||
|
||||
update_cursor();
|
||||
}
|
||||
|
||||
int do_page_up(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
wrap_reset();
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
|
||||
if (current == fileage)
|
||||
return 0;
|
||||
|
||||
current_y = 0;
|
||||
current = edittop;
|
||||
for (i = 0; i <= editwinrows - 3 && current->prev != NULL; i++)
|
||||
current = current->prev;
|
||||
|
||||
edit_update(current, TOP);
|
||||
update_cursor();
|
||||
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_page_down(void)
|
||||
{
|
||||
wrap_reset();
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
|
||||
if (current == filebot)
|
||||
return 0;
|
||||
|
||||
/* AHEM, if we only have a screen or less of text, DON'T do an
|
||||
edit_update(), just move the cursor to editbot! */
|
||||
if (edittop == fileage && editbot == filebot && totlines < editwinrows) {
|
||||
current = editbot;
|
||||
reset_cursor();
|
||||
#ifndef NANO_SMALL
|
||||
/* ...unless marking is on, in which case we need it to update
|
||||
the highlight. */
|
||||
if (ISSET(MARK_ISSET))
|
||||
edit_update(current, NONE);
|
||||
#endif
|
||||
} else if (editbot != filebot || edittop == fileage) {
|
||||
current_y = 0;
|
||||
current = editbot;
|
||||
|
||||
if (current->prev != NULL)
|
||||
current = current->prev;
|
||||
if (current->prev != NULL)
|
||||
current = current->prev;
|
||||
edit_update(current, TOP);
|
||||
} else {
|
||||
while (current != filebot) {
|
||||
current = current->next;
|
||||
current_y++;
|
||||
}
|
||||
edit_update(edittop, TOP);
|
||||
}
|
||||
|
||||
update_cursor();
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_up(void)
|
||||
{
|
||||
wrap_reset();
|
||||
if (current->prev != NULL) {
|
||||
current_x = actual_x(current->prev, placewewant);
|
||||
current = current->prev;
|
||||
if (current_y > 0) {
|
||||
update_line(current->next, 0);
|
||||
/* It is necessary to change current first, so the mark
|
||||
display will change! */
|
||||
current_y--;
|
||||
update_line(current, current_x);
|
||||
} else
|
||||
page_up();
|
||||
check_statblank();
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return value 1 means we moved down, 0 means we were already at the
|
||||
* bottom. */
|
||||
int do_down(void)
|
||||
{
|
||||
wrap_reset();
|
||||
check_statblank();
|
||||
|
||||
if (current->next == NULL)
|
||||
return 0;
|
||||
|
||||
current = current->next;
|
||||
current_x = actual_x(current, placewewant);
|
||||
|
||||
/* Note current_y is zero-based. This test checks for the cursor's
|
||||
* being on the last row of the edit window. */
|
||||
if (current_y == editwinrows - 1) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMOOTHSCROLL)) {
|
||||
/* In this case current_y does not change. The cursor
|
||||
* remains at the bottom of the edit window. */
|
||||
edittop = edittop->next;
|
||||
editbot = editbot->next;
|
||||
edit_refresh();
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
/* Set edittop so editbot->next (or else editbot) is
|
||||
* centered, and set current_y = editwinrows / 2. */
|
||||
edit_update(editbot->next != NULL ? editbot->next : editbot, CENTER);
|
||||
center_cursor();
|
||||
}
|
||||
} else {
|
||||
update_line(current->prev, 0);
|
||||
update_line(current, current_x);
|
||||
current_y++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_left(void)
|
||||
{
|
||||
if (current_x > 0)
|
||||
current_x--;
|
||||
else if (current != fileage) {
|
||||
do_up();
|
||||
current_x = strlen(current->data);
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int do_right(void)
|
||||
{
|
||||
assert(current_x <= strlen(current->data));
|
||||
|
||||
if (current->data[current_x] != '\0')
|
||||
current_x++;
|
||||
else if (current->next != NULL) {
|
||||
do_down();
|
||||
current_x = 0;
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
update_line(current, current_x);
|
||||
check_statblank();
|
||||
return 1;
|
||||
}
|
||||
205
nano.1
205
nano.1
@@ -1,205 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nano.1 is copyright (C) 1999, 2000, 2001, 2002, 2003 by
|
||||
.\" Chris Allegretta <chrisa@asty.org>
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANO 1 "June 19, 2003"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
|
||||
.SH NAME
|
||||
nano \- Nano's ANOther editor, an enhanced free Pico clone
|
||||
|
||||
.SH SYNOPSIS
|
||||
.B nano
|
||||
.I [\+LINE]\ [options]\ [file]
|
||||
.br
|
||||
|
||||
.SH DESCRIPTION
|
||||
This manual page documents briefly the \fBnano\fP command.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invoke bold face and italics,
|
||||
.\" respectively.
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \+\fILINE\fP
|
||||
Places cursor at \fILINE\fP on startup.
|
||||
.TP
|
||||
.B \-B (\-\-backup)
|
||||
When saving a file, back up the previous version of it to the current
|
||||
filename suffixed with a ~.
|
||||
.TP
|
||||
.B \-D (\-\-dos)
|
||||
Write file in DOS format.
|
||||
.TP
|
||||
.B \-F (\-\-multibuffer)
|
||||
Enable multiple file buffers, if available.
|
||||
.TP
|
||||
.B \-H (\-\-historylog)
|
||||
Log search and replace strings to
|
||||
.I ~/.nano_history
|
||||
so they may be stored for later editing, if nanorc support is
|
||||
configured.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
Don't look at
|
||||
.I $SYSCONFDIR/nanorc
|
||||
or
|
||||
.IR ~/.nanorc ,
|
||||
if nanorc support is available.
|
||||
.TP
|
||||
.B \-K (\-\-keypad)
|
||||
Do not use the ncurses keypad() call unless necessary. Try this flag if
|
||||
you find that the arrow keys on the numeric keypad do not work for you
|
||||
under nano.
|
||||
.TP
|
||||
.B \-M (\-\-mac)
|
||||
Write file in Mac format.
|
||||
.TP
|
||||
.B \-N (\-\-noconvert)
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
.TP
|
||||
.B \-Q \fIstr\fP (\-\-quotestr=\fIstr\fP)
|
||||
Set the quoting string for justifying. The default is
|
||||
"^([\ \\t]*[|>:}#])+" if regular expression support is available, or
|
||||
">\ " otherwise.
|
||||
.TP
|
||||
.B \-R (\-\-regexp)
|
||||
Enable regular expression matching for search strings, as well as
|
||||
\\n subexpression replacement for replace strings, if available.
|
||||
.TP
|
||||
.B \-S (\-\-smooth)
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behavior.
|
||||
.TP
|
||||
.B \-T \fInum\fP (\-\-tabsize=\fInum\fP)
|
||||
Set the size (width) of a tab.
|
||||
.TP
|
||||
.B \-V (\-\-version)
|
||||
Show the current version number and author.
|
||||
.TP
|
||||
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
|
||||
Specify a specific syntax highlighting from the
|
||||
.I .nanorc
|
||||
to use, if available.
|
||||
.TP
|
||||
.B \-c (\-\-const)
|
||||
Constantly show the cursor position.
|
||||
.TP
|
||||
.B \-h (\-\-help)
|
||||
Display a summary of command line options.
|
||||
.TP
|
||||
.B \-i (\-\-autoindent)
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
source code.
|
||||
.TP
|
||||
.B \-k (\-\-cut)
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
.TP
|
||||
.B \-l (\-\-nofollow)
|
||||
If the file being edited is a symbolic link, replace the link with
|
||||
a new file, do not follow it. Good for editing files in
|
||||
.IR /tmp ,
|
||||
perhaps?
|
||||
.TP
|
||||
.B \-m (\-\-mouse)
|
||||
Enable mouse support (if available for your system).
|
||||
.TP
|
||||
.B \-o \fIdir\fP (\-\-operatingdir=\fIdir\fP)
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
chroot.
|
||||
.TP
|
||||
.B \-p (\-\-preserve)
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
|
||||
caught by the terminal.
|
||||
.TP
|
||||
.B \-r \fIcols\fP (\-\-fill=\fIcols\fP)
|
||||
Wrap lines at column \fIcols\fP. By default, this is the width of the
|
||||
screen, less eight. If this value is negative, wrapping will occur at
|
||||
\fIcols\fP columns from the right of the screen, allowing the wrap point
|
||||
to vary along with the screen width if resized.
|
||||
.TP
|
||||
.B \-s \fIprog\fP (\-\-speller=\fIprog\fP)
|
||||
Enable alternative spell checker command.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
.TP
|
||||
.B \-v (\-\-view)
|
||||
View file (read only) mode.
|
||||
.TP
|
||||
.B \-w (\-\-nowrap)
|
||||
Disable wrapping of long lines.
|
||||
.TP
|
||||
.B \-x (\-\-nohelp)
|
||||
Disable help screen at bottom of editor.
|
||||
.TP
|
||||
.B \-z (\-\-suspend)
|
||||
Enable suspend ability.
|
||||
.TP
|
||||
.B \-a, \-b, \-e, \-f, \-g, \-j
|
||||
Ignored, for compatibility with Pico.
|
||||
|
||||
.SH INITIALIZATION FILE
|
||||
\fBnano\fP will read initialization files in the following
|
||||
order:
|
||||
.IR $SYSCONFDIR/nanorc ,
|
||||
then
|
||||
.IR ~/.nanorc .
|
||||
Please see
|
||||
.BR nanorc (5)
|
||||
and the example file \fBnanorc.sample\fP which should be provided with
|
||||
\fBnano\fP.
|
||||
|
||||
.SH NOTES
|
||||
\fBnano\fP will try to dump the buffer into an emergency file in some
|
||||
cases. Mainly, this will happen if \fBnano\fP receives a SIGHUP or
|
||||
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||
named
|
||||
.I nano.save
|
||||
if the buffer didn't have a name already, or will add a ".save" suffix
|
||||
to the current filename. If an emergency file with that name already
|
||||
exists in the current directory, ".save" and a number (e.g. ".save.1")
|
||||
will be suffixed to the current filename in order to make it unique. In
|
||||
multibuffer mode, \fBnano\fP will write all the open buffers to the
|
||||
respective emergency files.
|
||||
|
||||
.SH BUGS
|
||||
Please send any comments or bug reports to
|
||||
.BR nano@nano-editor.org .
|
||||
|
||||
The \fBnano\fP mailing list is available from
|
||||
.BR nano-devel@gnu.org .
|
||||
|
||||
To subscribe, email to
|
||||
.B nano-devel-request@gnu.org
|
||||
with a subject of "subscribe".
|
||||
|
||||
.SH HOMEPAGE
|
||||
http://www.nano-editor.org/
|
||||
|
||||
.SH SEE ALSO
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnanorc\fP(5)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/\fP (or equivalent on your system)
|
||||
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see
|
||||
.I AUTHORS
|
||||
and
|
||||
.I THANKS
|
||||
for details). This manual page was originally written by Jordi Mallach
|
||||
<jordi@sindominio.net>, for the Debian GNU system (but may be
|
||||
used by others).
|
||||
298
nano.1.html
298
nano.1.html
@@ -1,298 +0,0 @@
|
||||
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANO</H1>
|
||||
Section: User Commands (1)<BR>Updated: June 19, 2003<BR><A HREF="#index">Index</A>
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
||||
|
||||
|
||||
|
||||
<P>
|
||||
<A NAME="lbAB"> </A>
|
||||
<H2>NAME</H2>
|
||||
|
||||
nano - Nano's ANOther editor, an enhanced free Pico clone
|
||||
<P>
|
||||
<A NAME="lbAC"> </A>
|
||||
<H2>SYNOPSIS</H2>
|
||||
|
||||
<B>nano</B>
|
||||
|
||||
<I>[+LINE] [options] [file]</I>
|
||||
|
||||
<BR>
|
||||
|
||||
<P>
|
||||
<A NAME="lbAD"> </A>
|
||||
<H2>DESCRIPTION</H2>
|
||||
|
||||
This manual page documents briefly the <B>nano</B> command.
|
||||
<P>
|
||||
|
||||
|
||||
|
||||
|
||||
<B>nano</B> is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, <B>nano</B> also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
<P>
|
||||
<A NAME="lbAE"> </A>
|
||||
<H2>OPTIONS</H2>
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B>+</B><I>LINE</I>
|
||||
|
||||
<DD>
|
||||
Places cursor at <I>LINE</I> on startup.
|
||||
<DT><B>-B (--backup)</B>
|
||||
|
||||
<DD>
|
||||
When saving a file, back up the previous version of it to the current
|
||||
filename suffixed with a ~.
|
||||
<DT><B>-D (--dos)</B>
|
||||
|
||||
<DD>
|
||||
Write file in DOS format.
|
||||
<DT><B>-F (--multibuffer)</B>
|
||||
|
||||
<DD>
|
||||
Enable multiple file buffers, if available.
|
||||
<DT><B>-H (--historylog)</B>
|
||||
|
||||
<DD>
|
||||
Log search and replace strings to
|
||||
<I>~/.nano_history</I>
|
||||
|
||||
so they may be stored for later editing, if nanorc support is
|
||||
configured.
|
||||
<DT><B>-I (--ignorercfiles)</B>
|
||||
|
||||
<DD>
|
||||
Don't look at
|
||||
<I>$SYSCONFDIR/nanorc</I>
|
||||
|
||||
or
|
||||
<I>~/.nanorc</I>,
|
||||
|
||||
if nanorc support is available.
|
||||
<DT><B>-K (--keypad)</B>
|
||||
|
||||
<DD>
|
||||
Do not use the ncurses keypad() call unless necessary. Try this flag if
|
||||
you find that the arrow keys on the numeric keypad do not work for you
|
||||
under nano.
|
||||
<DT><B>-M (--mac)</B>
|
||||
|
||||
<DD>
|
||||
Write file in Mac format.
|
||||
<DT><B>-N (--noconvert)</B>
|
||||
|
||||
<DD>
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
<DT><B>-Q </B><I>str</I> (--quotestr=<I>str</I>)
|
||||
|
||||
<DD>
|
||||
Set the quoting string for justifying. The default is
|
||||
"^([ \t]*[|>:}#])+" if regular expression support is available, or
|
||||
"> " otherwise.
|
||||
<DT><B>-R (--regexp)</B>
|
||||
|
||||
<DD>
|
||||
Enable regular expression matching for search strings, as well as
|
||||
\n subexpression replacement for replace strings, if available.
|
||||
<DT><B>-S (--smooth)</B>
|
||||
|
||||
<DD>
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behavior.
|
||||
<DT><B>-T </B><I>num</I> (--tabsize=<I>num</I>)
|
||||
|
||||
<DD>
|
||||
Set the size (width) of a tab.
|
||||
<DT><B>-V (--version)</B>
|
||||
|
||||
<DD>
|
||||
Show the current version number and author.
|
||||
<DT><B>-Y </B><I>str</I> (--syntax=<I>str</I>)
|
||||
|
||||
<DD>
|
||||
Specify a specific syntax highlighting from the
|
||||
<I>.nanorc</I>
|
||||
|
||||
to use, if available.
|
||||
<DT><B>-c (--const)</B>
|
||||
|
||||
<DD>
|
||||
Constantly show the cursor position.
|
||||
<DT><B>-h (--help)</B>
|
||||
|
||||
<DD>
|
||||
Display a summary of command line options.
|
||||
<DT><B>-i (--autoindent)</B>
|
||||
|
||||
<DD>
|
||||
Indent new lines to the previous line's indentation. Useful when editing
|
||||
source code.
|
||||
<DT><B>-k (--cut)</B>
|
||||
|
||||
<DD>
|
||||
Enable cut from cursor to end of line with ^K.
|
||||
<DT><B>-l (--nofollow)</B>
|
||||
|
||||
<DD>
|
||||
If the file being edited is a symbolic link, replace the link with
|
||||
a new file, do not follow it. Good for editing files in
|
||||
<I>/tmp</I>,
|
||||
|
||||
perhaps?
|
||||
<DT><B>-m (--mouse)</B>
|
||||
|
||||
<DD>
|
||||
Enable mouse support (if available for your system).
|
||||
<DT><B>-o </B><I>dir</I> (--operatingdir=<I>dir</I>)
|
||||
|
||||
<DD>
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
chroot.
|
||||
<DT><B>-p (--preserve)</B>
|
||||
|
||||
<DD>
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
|
||||
caught by the terminal.
|
||||
<DT><B>-r </B><I>cols</I> (--fill=<I>cols</I>)
|
||||
|
||||
<DD>
|
||||
Wrap lines at column <I>cols</I>. By default, this is the width of the
|
||||
screen, less eight. If this value is negative, wrapping will occur at
|
||||
<I>cols</I> columns from the right of the screen, allowing the wrap point
|
||||
to vary along with the screen width if resized.
|
||||
<DT><B>-s </B><I>prog</I> (--speller=<I>prog</I>)
|
||||
|
||||
<DD>
|
||||
Enable alternative spell checker command.
|
||||
<DT><B>-t (--tempfile)</B>
|
||||
|
||||
<DD>
|
||||
Always save changed buffer without prompting. Same as Pico -t option.
|
||||
<DT><B>-v (--view)</B>
|
||||
|
||||
<DD>
|
||||
View file (read only) mode.
|
||||
<DT><B>-w (--nowrap)</B>
|
||||
|
||||
<DD>
|
||||
Disable wrapping of long lines.
|
||||
<DT><B>-x (--nohelp)</B>
|
||||
|
||||
<DD>
|
||||
Disable help screen at bottom of editor.
|
||||
<DT><B>-z (--suspend)</B>
|
||||
|
||||
<DD>
|
||||
Enable suspend ability.
|
||||
<DT><B>-a, -b, -e, -f, -g, -j</B>
|
||||
|
||||
<DD>
|
||||
Ignored, for compatibility with Pico.
|
||||
<P>
|
||||
</DL>
|
||||
<A NAME="lbAF"> </A>
|
||||
<H2>INITIALIZATION FILE</H2>
|
||||
|
||||
<B>nano</B> will read initialization files in the following
|
||||
order:
|
||||
<I>$SYSCONFDIR/nanorc</I>,
|
||||
|
||||
then
|
||||
<I>~/.nanorc</I>.
|
||||
|
||||
Please see
|
||||
<B><A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A></B>(5)
|
||||
|
||||
and the example file <B>nanorc.sample</B> which should be provided with
|
||||
<B>nano</B>.
|
||||
<P>
|
||||
<A NAME="lbAG"> </A>
|
||||
<H2>NOTES</H2>
|
||||
|
||||
<B>nano</B> will try to dump the buffer into an emergency file in some
|
||||
cases. Mainly, this will happen if <B>nano</B> receives a SIGHUP or
|
||||
SIGTERM or runs out of memory, when it will write the buffer into a file
|
||||
named
|
||||
<I>nano.save</I>
|
||||
|
||||
if the buffer didn't have a name already, or will add a ".save" suffix
|
||||
to the current filename. If an emergency file with that name already
|
||||
exists in the current directory, ".save" and a number (e.g. ".save.1")
|
||||
will be suffixed to the current filename in order to make it unique. In
|
||||
multibuffer mode, <B>nano</B> will write all the open buffers to the
|
||||
respective emergency files.
|
||||
<P>
|
||||
<A NAME="lbAH"> </A>
|
||||
<H2>BUGS</H2>
|
||||
|
||||
Please send any comments or bug reports to
|
||||
<B><A HREF="mailto:nano@nano-editor.org">nano@nano-editor.org</A></B>.
|
||||
|
||||
<P>
|
||||
The <B>nano</B> mailing list is available from
|
||||
<B><A HREF="mailto:nano-devel@gnu.org">nano-devel@gnu.org</A></B>.
|
||||
|
||||
<P>
|
||||
To subscribe, email to
|
||||
<B><A HREF="mailto:nano-devel-request@gnu.org">nano-devel-request@gnu.org</A></B>
|
||||
|
||||
with a subject of "subscribe".
|
||||
<P>
|
||||
<A NAME="lbAI"> </A>
|
||||
<H2>HOMEPAGE</H2>
|
||||
|
||||
<A HREF="http://www.nano-editor.org/">http://www.nano-editor.org/</A>
|
||||
<P>
|
||||
<A NAME="lbAJ"> </A>
|
||||
<H2>SEE ALSO</H2>
|
||||
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B><A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A></B>(5)<DD>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
<I>/usr/share/doc/nano/</I> (or equivalent on your system)
|
||||
<P>
|
||||
<A NAME="lbAK"> </A>
|
||||
<H2>AUTHOR</H2>
|
||||
|
||||
Chris Allegretta <<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>>, et al (see
|
||||
<I>AUTHORS</I>
|
||||
|
||||
and
|
||||
<I>THANKS</I>
|
||||
|
||||
for details). This manual page was originally written by Jordi Mallach
|
||||
<<A HREF="mailto:jordi@sindominio.net">jordi@sindominio.net</A>>, for the Debian GNU system (but may be
|
||||
used by others).
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
<A NAME="index"> </A><H2>Index</H2>
|
||||
<DL>
|
||||
<DT><A HREF="#lbAB">NAME</A><DD>
|
||||
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
|
||||
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
|
||||
<DT><A HREF="#lbAE">OPTIONS</A><DD>
|
||||
<DT><A HREF="#lbAF">INITIALIZATION FILE</A><DD>
|
||||
<DT><A HREF="#lbAG">NOTES</A><DD>
|
||||
<DT><A HREF="#lbAH">BUGS</A><DD>
|
||||
<DT><A HREF="#lbAI">HOMEPAGE</A><DD>
|
||||
<DT><A HREF="#lbAJ">SEE ALSO</A><DD>
|
||||
<DT><A HREF="#lbAK">AUTHOR</A><DD>
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||
using the manual pages.<BR>
|
||||
Time: 22:27:55 GMT, June 19, 2003
|
||||
</BODY>
|
||||
</HTML>
|
||||
434
nano.h
434
nano.h
@@ -1,434 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* nano.h *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifndef NANO_H
|
||||
#define NANO_H 1
|
||||
|
||||
/* Macros for the flags int... */
|
||||
#define SET(bit) flags |= bit
|
||||
#define UNSET(bit) flags &= ~bit
|
||||
#define ISSET(bit) (flags & bit)
|
||||
#define TOGGLE(bit) flags ^= bit
|
||||
|
||||
/* Define charalloc as a macro rather than duplicating code */
|
||||
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
|
||||
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
|
||||
#ifdef BROKEN_REGEXEC
|
||||
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* For the backup file copy ... */
|
||||
# define COPYFILEBLOCKSIZE 1024
|
||||
#endif
|
||||
|
||||
#ifdef USE_SLANG /* Slang support enabled */
|
||||
#include <slcurses.h>
|
||||
#define KEY_IC SL_KEY_IC
|
||||
#define KEY_DC SL_KEY_DELETE
|
||||
#elif defined(HAVE_NCURSES_H)
|
||||
#include <ncurses.h>
|
||||
#else /* Uh oh */
|
||||
#include <curses.h>
|
||||
#endif /* CURSES_H */
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# endif
|
||||
# define _(string) gettext(string)
|
||||
# define P_(singular, plural, number) ngettext(singular, plural, number)
|
||||
#else
|
||||
# define _(string) (string)
|
||||
# define P_(singular, plural, number) (number == 1 ? singular : plural)
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include "config.h"
|
||||
|
||||
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||
#include <glib.h>
|
||||
# ifndef HAVE_SNPRINTF
|
||||
# define snprintf g_snprintf
|
||||
# endif
|
||||
# ifndef HAVE_VSNPRINTF
|
||||
# define vsnprintf g_vsnprintf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#define strcasecmp nstricmp
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
#define strncasecmp nstrnicmp
|
||||
#endif
|
||||
|
||||
/* HP-UX 10 & 11 do not seem to support KEY_HOME and KEY_END */
|
||||
#ifndef KEY_HOME
|
||||
#define KEY_HOME -1
|
||||
#endif /* KEY_HOME */
|
||||
|
||||
#ifndef KEY_END
|
||||
#define KEY_END -1
|
||||
#endif /* KEY_END */
|
||||
|
||||
/* Snatch these out of the ncurses defs, so we can use them in search
|
||||
history regardless of whether we're using ncurses or not */
|
||||
#if !defined(KEY_UP) || !defined(KEY_DOWN)
|
||||
#define KEY_UP 0403
|
||||
#define KEY_DOWN 0402
|
||||
#endif /* !KEY_UP || !KEY_DOWN */
|
||||
|
||||
#define VERMSG "GNU nano " VERSION
|
||||
|
||||
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
|
||||
#define DISABLE_WRAPJUSTIFY 1
|
||||
#endif
|
||||
|
||||
/* Structure types */
|
||||
typedef struct filestruct {
|
||||
char *data;
|
||||
struct filestruct *next; /* Next node */
|
||||
struct filestruct *prev; /* Previous node */
|
||||
int lineno; /* The line number */
|
||||
} filestruct;
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
typedef struct openfilestruct {
|
||||
char *filename;
|
||||
#ifndef NANO_SMALL
|
||||
struct stat originalfilestat;
|
||||
#endif
|
||||
struct openfilestruct *next; /* Next node */
|
||||
struct openfilestruct *prev; /* Previous node */
|
||||
struct filestruct *fileage; /* Current file */
|
||||
struct filestruct *filebot; /* Current file's last line */
|
||||
#ifndef NANO_SMALL
|
||||
struct filestruct *file_mark_beginbuf;
|
||||
/* Current file's beginning marked line */
|
||||
int file_mark_beginx; /* Current file's beginning marked line's
|
||||
x-coordinate position */
|
||||
#endif
|
||||
int file_current_x; /* Current file's x-coordinate position */
|
||||
int file_current_y; /* Current file's y-coordinate position */
|
||||
int file_flags; /* Current file's flags: modification
|
||||
status (and marking status, if
|
||||
available) */
|
||||
int file_placewewant; /* Current file's place we want */
|
||||
int file_totlines; /* Current file's total number of lines */
|
||||
long file_totsize; /* Current file's total size */
|
||||
int file_lineno; /* Current file's line number */
|
||||
} openfilestruct;
|
||||
#endif
|
||||
|
||||
typedef struct shortcut {
|
||||
int val; /* Actual sequence that generates the keystroke */
|
||||
int altval; /* Alt key # for this function, or 0 for none */
|
||||
int misc1; /* Other int functions we want bound */
|
||||
int misc2;
|
||||
int viewok; /* is this function legal in view mode? */
|
||||
int (*func) (void); /* Function to call when we catch this key */
|
||||
const char *desc; /* Description, e.g. "Page Up" */
|
||||
#ifndef DISABLE_HELP
|
||||
const char *help; /* Help file entry text */
|
||||
#endif
|
||||
struct shortcut *next;
|
||||
} shortcut;
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
typedef struct toggle {
|
||||
int val; /* Sequence to toggle the key. Should only need 1 */
|
||||
const char *desc; /* Description for when toggle is, uh, toggled,
|
||||
e.g. "Pico Messages"; we'll append Enabled or
|
||||
Disabled */
|
||||
int flag; /* What flag actually gets toggled */
|
||||
struct toggle *next;
|
||||
} toggle;
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
typedef struct rcoption {
|
||||
const char *name;
|
||||
int flag;
|
||||
} rcoption;
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
|
||||
typedef struct colortype {
|
||||
int fg; /* fg color */
|
||||
int bg; /* bg color */
|
||||
int bright; /* Is this color A_BOLD? */
|
||||
int pairnum; /* Color pair number used for this fg/bg */
|
||||
regex_t start; /* Start (or all) of the regex string */
|
||||
regex_t *end; /* End of the regex string */
|
||||
struct colortype *next;
|
||||
} colortype;
|
||||
|
||||
typedef struct exttype {
|
||||
regex_t val; /* The extensions that match this syntax. */
|
||||
struct exttype *next;
|
||||
} exttype;
|
||||
|
||||
typedef struct syntaxtype {
|
||||
char *desc; /* Name of this syntax type */
|
||||
exttype *extensions; /* List of extensions that this applies to */
|
||||
colortype *color; /* color struct for this syntax */
|
||||
struct syntaxtype *next;
|
||||
} syntaxtype;
|
||||
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
typedef struct historytype {
|
||||
struct historytype *next;
|
||||
struct historytype *prev;
|
||||
char *data;
|
||||
} historytype;
|
||||
typedef struct historyheadtype {
|
||||
struct historytype *next; /* keep *next and *prev members together */
|
||||
struct historytype *prev; /* and in same order as in historytype */
|
||||
struct historytype *tail;
|
||||
struct historytype *current;
|
||||
int count;
|
||||
int len;
|
||||
} historyheadtype;
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* Bitwise flags so we can save space (or more correctly, not waste it) */
|
||||
|
||||
#define MODIFIED (1<<0)
|
||||
#define KEEP_CUTBUFFER (1<<1)
|
||||
#define CASE_SENSITIVE (1<<2)
|
||||
#define MARK_ISSET (1<<3)
|
||||
#define CONSTUPDATE (1<<4)
|
||||
#define NO_HELP (1<<5)
|
||||
#define NOFOLLOW_SYMLINKS (1<<6)
|
||||
#define SUSPEND (1<<7)
|
||||
#define NO_WRAP (1<<8)
|
||||
#define AUTOINDENT (1<<9)
|
||||
#define SAMELINEWRAP (1<<10)
|
||||
#define VIEW_MODE (1<<11)
|
||||
#define USE_MOUSE (1<<12)
|
||||
#define USE_REGEXP (1<<13)
|
||||
#define REGEXP_COMPILED (1<<14)
|
||||
#define TEMP_OPT (1<<15)
|
||||
#define CUT_TO_END (1<<16)
|
||||
#define REVERSE_SEARCH (1<<17)
|
||||
#define MULTIBUFFER (1<<18)
|
||||
#define DOS_FILE (1<<19)
|
||||
#define MAC_FILE (1<<20)
|
||||
#define SMOOTHSCROLL (1<<21)
|
||||
#define DISABLE_CURPOS (1<<22) /* Damn, we still need it */
|
||||
#define ALT_KEYPAD (1<<23)
|
||||
#define NO_CONVERT (1<<24)
|
||||
#define BACKUP_FILE (1<<25)
|
||||
#define NO_RCFILE (1<<26)
|
||||
#define COLOR_SYNTAX (1<<27)
|
||||
#define PRESERVE (1<<28)
|
||||
#define HISTORY_CHANGED (1<<29)
|
||||
#define HISTORYLOG (1<<30)
|
||||
#define JUSTIFY_MODE (1<<31)
|
||||
|
||||
/* Control key sequences, changing these would be very very bad */
|
||||
|
||||
#define NANO_CONTROL_SPACE 0
|
||||
#define NANO_CONTROL_A 1
|
||||
#define NANO_CONTROL_B 2
|
||||
#define NANO_CONTROL_C 3
|
||||
#define NANO_CONTROL_D 4
|
||||
#define NANO_CONTROL_E 5
|
||||
#define NANO_CONTROL_F 6
|
||||
#define NANO_CONTROL_G 7
|
||||
#define NANO_CONTROL_H 8
|
||||
#define NANO_CONTROL_I 9
|
||||
#define NANO_CONTROL_J 10
|
||||
#define NANO_CONTROL_K 11
|
||||
#define NANO_CONTROL_L 12
|
||||
#define NANO_CONTROL_M 13
|
||||
#define NANO_CONTROL_N 14
|
||||
#define NANO_CONTROL_O 15
|
||||
#define NANO_CONTROL_P 16
|
||||
#define NANO_CONTROL_Q 17
|
||||
#define NANO_CONTROL_R 18
|
||||
#define NANO_CONTROL_S 19
|
||||
#define NANO_CONTROL_T 20
|
||||
#define NANO_CONTROL_U 21
|
||||
#define NANO_CONTROL_V 22
|
||||
#define NANO_CONTROL_W 23
|
||||
#define NANO_CONTROL_X 24
|
||||
#define NANO_CONTROL_Y 25
|
||||
#define NANO_CONTROL_Z 26
|
||||
|
||||
#define NANO_CONTROL_4 28
|
||||
#define NANO_CONTROL_5 29
|
||||
#define NANO_CONTROL_6 30
|
||||
#define NANO_CONTROL_7 31
|
||||
|
||||
#define NANO_ALT_A 'a'
|
||||
#define NANO_ALT_B 'b'
|
||||
#define NANO_ALT_C 'c'
|
||||
#define NANO_ALT_D 'd'
|
||||
#define NANO_ALT_E 'e'
|
||||
#define NANO_ALT_F 'f'
|
||||
#define NANO_ALT_G 'g'
|
||||
#define NANO_ALT_H 'h'
|
||||
#define NANO_ALT_I 'i'
|
||||
#define NANO_ALT_J 'j'
|
||||
#define NANO_ALT_K 'k'
|
||||
#define NANO_ALT_L 'l'
|
||||
#define NANO_ALT_M 'm'
|
||||
#define NANO_ALT_N 'n'
|
||||
#define NANO_ALT_O 'o'
|
||||
#define NANO_ALT_P 'p'
|
||||
#define NANO_ALT_Q 'q'
|
||||
#define NANO_ALT_R 'r'
|
||||
#define NANO_ALT_S 's'
|
||||
#define NANO_ALT_T 't'
|
||||
#define NANO_ALT_U 'u'
|
||||
#define NANO_ALT_V 'v'
|
||||
#define NANO_ALT_W 'w'
|
||||
#define NANO_ALT_X 'x'
|
||||
#define NANO_ALT_Y 'y'
|
||||
#define NANO_ALT_Z 'z'
|
||||
#define NANO_ALT_PERIOD '.'
|
||||
#define NANO_ALT_COMMA ','
|
||||
#define NANO_ALT_LCARAT '<'
|
||||
#define NANO_ALT_RCARAT '>'
|
||||
#define NANO_ALT_BRACKET ']'
|
||||
#define NANO_ALT_SPACE ' '
|
||||
|
||||
/* Some semi-changeable keybindings; don't play with unless you're sure you
|
||||
know what you're doing */
|
||||
|
||||
#define NANO_INSERTFILE_KEY NANO_CONTROL_R
|
||||
#define NANO_INSERTFILE_FKEY KEY_F(5)
|
||||
#define NANO_EXIT_KEY NANO_CONTROL_X
|
||||
#define NANO_EXIT_FKEY KEY_F(2)
|
||||
#define NANO_WRITEOUT_KEY NANO_CONTROL_O
|
||||
#define NANO_WRITEOUT_FKEY KEY_F(3)
|
||||
#define NANO_GOTO_KEY NANO_CONTROL_7
|
||||
#define NANO_GOTO_FKEY KEY_F(13)
|
||||
#define NANO_ALT_GOTO_KEY NANO_ALT_G
|
||||
#define NANO_HELP_KEY NANO_CONTROL_G
|
||||
#define NANO_HELP_FKEY KEY_F(1)
|
||||
#define NANO_WHEREIS_KEY NANO_CONTROL_W
|
||||
#define NANO_WHEREIS_FKEY KEY_F(6)
|
||||
#define NANO_REPLACE_KEY NANO_CONTROL_4
|
||||
#define NANO_REPLACE_FKEY KEY_F(14)
|
||||
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
|
||||
#define NANO_OTHERSEARCH_KEY NANO_CONTROL_R
|
||||
#define NANO_PREVPAGE_KEY NANO_CONTROL_Y
|
||||
#define NANO_PREVPAGE_FKEY KEY_F(7)
|
||||
#define NANO_NEXTPAGE_KEY NANO_CONTROL_V
|
||||
#define NANO_NEXTPAGE_FKEY KEY_F(8)
|
||||
#define NANO_CUT_KEY NANO_CONTROL_K
|
||||
#define NANO_CUT_FKEY KEY_F(9)
|
||||
#define NANO_UNCUT_KEY NANO_CONTROL_U
|
||||
#define NANO_UNCUT_FKEY KEY_F(10)
|
||||
#define NANO_CURSORPOS_KEY NANO_CONTROL_C
|
||||
#define NANO_CURSORPOS_FKEY KEY_F(11)
|
||||
#define NANO_SPELL_KEY NANO_CONTROL_T
|
||||
#define NANO_SPELL_FKEY KEY_F(12)
|
||||
#define NANO_FIRSTLINE_KEY NANO_PREVPAGE_KEY
|
||||
#define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY
|
||||
#define NANO_CANCEL_KEY NANO_CONTROL_C
|
||||
#define NANO_REFRESH_KEY NANO_CONTROL_L
|
||||
#define NANO_JUSTIFY_KEY NANO_CONTROL_J
|
||||
#define NANO_JUSTIFY_FKEY KEY_F(4)
|
||||
#define NANO_UNJUSTIFY_KEY NANO_CONTROL_U
|
||||
#define NANO_UP_KEY NANO_CONTROL_P
|
||||
#define NANO_DOWN_KEY NANO_CONTROL_N
|
||||
#define NANO_FORWARD_KEY NANO_CONTROL_F
|
||||
#define NANO_BACK_KEY NANO_CONTROL_B
|
||||
#define NANO_MARK_KEY NANO_CONTROL_6
|
||||
#define NANO_ALT_MARK_KEY NANO_ALT_A
|
||||
#define NANO_HOME_KEY NANO_CONTROL_A
|
||||
#define NANO_END_KEY NANO_CONTROL_E
|
||||
#define NANO_DELETE_KEY NANO_CONTROL_D
|
||||
#define NANO_BACKSPACE_KEY NANO_CONTROL_H
|
||||
#define NANO_TAB_KEY NANO_CONTROL_I
|
||||
#define NANO_SUSPEND_KEY NANO_CONTROL_Z
|
||||
#define NANO_ENTER_KEY NANO_CONTROL_M
|
||||
#define NANO_FROMSEARCHTOGOTO_KEY NANO_CONTROL_T
|
||||
#define NANO_TOFILES_KEY NANO_CONTROL_T
|
||||
#define NANO_APPEND_KEY NANO_ALT_A
|
||||
#define NANO_PREPEND_KEY NANO_ALT_P
|
||||
#define NANO_OPENPREV_KEY NANO_ALT_LCARAT
|
||||
#define NANO_OPENNEXT_KEY NANO_ALT_RCARAT
|
||||
#define NANO_OPENPREV_ALTKEY NANO_ALT_COMMA
|
||||
#define NANO_OPENNEXT_ALTKEY NANO_ALT_PERIOD
|
||||
#define NANO_BRACKET_KEY NANO_ALT_BRACKET
|
||||
#define NANO_EXTCMD_KEY NANO_CONTROL_X
|
||||
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
|
||||
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Toggles do not exist with NANO_SMALL. */
|
||||
#define TOGGLE_CONST_KEY NANO_ALT_C
|
||||
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
|
||||
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
|
||||
#define TOGGLE_NOHELP_KEY NANO_ALT_X
|
||||
#define TOGGLE_MOUSE_KEY NANO_ALT_M
|
||||
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
|
||||
#define TOGGLE_REGEXP_KEY NANO_ALT_R
|
||||
#define TOGGLE_WRAP_KEY NANO_ALT_W
|
||||
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
|
||||
#define TOGGLE_CASE_KEY NANO_ALT_C
|
||||
#define TOGGLE_LOAD_KEY NANO_ALT_F
|
||||
#define TOGGLE_DOS_KEY NANO_ALT_D
|
||||
#define TOGGLE_MAC_KEY NANO_ALT_O
|
||||
#define TOGGLE_SMOOTH_KEY NANO_ALT_S
|
||||
#define TOGGLE_NOCONVERT_KEY NANO_ALT_N
|
||||
#define TOGGLE_BACKUP_KEY NANO_ALT_B
|
||||
#define TOGGLE_SYNTAX_KEY NANO_ALT_Y
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
#define MAIN_VISIBLE 12
|
||||
|
||||
#define VIEW 1
|
||||
#define NOVIEW 0
|
||||
|
||||
typedef enum {
|
||||
CENTER, TOP, NONE
|
||||
} topmidbotnone;
|
||||
|
||||
/* Minimum editor window rows required for nano to work correctly */
|
||||
#define MIN_EDITOR_ROWS 3
|
||||
|
||||
/* Minimum editor window cols required for nano to work correctly */
|
||||
#define MIN_EDITOR_COLS 10
|
||||
|
||||
/* Default number of characters from end-of-line where text wrapping
|
||||
occurs */
|
||||
#define CHARS_FROM_EOL 8
|
||||
|
||||
/* Maximum number of search history strings saved, same value used for
|
||||
replace history */
|
||||
#define MAX_SEARCH_HISTORY 100
|
||||
|
||||
#endif /* !NANO_H */
|
||||
@@ -9,7 +9,7 @@ Release : %{rel}
|
||||
Copyright : GPL
|
||||
Group : Console/Editors
|
||||
URL : http://www.nano-editor.org
|
||||
Source : http://www.nano-editor.org/dist/v1.2/%{name}-%{ver}.tar.gz
|
||||
Source : http://www.nano-editor.org/dist/v1.3/%{name}-%{ver}.tar.gz
|
||||
BuildRoot : /var/tmp/%{name}-buildroot
|
||||
Requires : ncurses
|
||||
|
||||
@@ -30,8 +30,8 @@ make DESTDIR="$RPM_BUILD_ROOT" install
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO nanorc.sample
|
||||
%{_bindir}/nano
|
||||
%doc AUTHORS BUGS COPYING ChangeLog INSTALL NEWS README THANKS TODO doc/faq.html doc/nanorc.sample
|
||||
%{_bindir}/*
|
||||
%{_mandir}/*/*
|
||||
%{_datadir}/locale/*/LC_MESSAGES/nano.mo
|
||||
%{_infodir}/nano.info*
|
||||
|
||||
169
nanorc.5
169
nanorc.5
@@ -1,169 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nanorc.5 is Copyright (C) 2003 Free Software Foundation, Inc.
|
||||
.\"
|
||||
.\" This is free documentation, see the latest version of the GNU General
|
||||
.\" Public License for copying conditions. There is NO warranty.
|
||||
.\"
|
||||
.\" $Id$
|
||||
.TH NANORC 5 "June 19, 2003"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.SH NAME
|
||||
nanorc \- GNU nano's rcfile
|
||||
.SH DESCRIPTION
|
||||
This manual page documents GNU \fBnano\fP's rcfile.
|
||||
.PP
|
||||
\fBnano\fP is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, \fBnano\fP also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
.PP
|
||||
The \fInanorc\fP file contains the default settings for \fBnano\fP.
|
||||
During startup, \fBnano\fP will first read its system-wide settings from
|
||||
.IR $SYSCONFDIR/nanorc ,
|
||||
and then user-specific settings from
|
||||
.IR ~/.nanorc .
|
||||
|
||||
.SH OPTIONS
|
||||
The configuration file accepts a series of "set" and "unset" commands,
|
||||
which can be used to configure nano on startup without using the
|
||||
command-line options. Additionally, the "syntax" and "color" keywords
|
||||
are used to define syntax highlighting rules for different text patterns.
|
||||
GNU nano will read one command per line.
|
||||
|
||||
Options in rcfiles take precedence over nano's defaults, and command line
|
||||
options override rcfile settings.
|
||||
|
||||
Options are unset by default, except for options that take an argument.
|
||||
|
||||
The supported commands and arguments are:
|
||||
|
||||
.TP 3
|
||||
\fBset/unset autoindent\fP
|
||||
Use auto-indentation.
|
||||
.TP
|
||||
\fBset/unset backup\fP
|
||||
Create backup files in
|
||||
.IR filename~ .
|
||||
.TP
|
||||
\fBset/unset const\fP
|
||||
Constantly display the cursor position in the status bar.
|
||||
.TP
|
||||
\fBset/unset cut\fP
|
||||
Use cut to end of line with ^K by default.
|
||||
.TP
|
||||
\fBset fill \fIn\fP\fP
|
||||
Wrap lines at column number \fIn\fP. If \fIn\fP is 0 or less, the line
|
||||
length will be the screen width less \fIn\fP. The default value is -8.
|
||||
.TP
|
||||
\fBset/unset historylog\fP
|
||||
Enable
|
||||
.I ~/.nano_history
|
||||
for saving and reading search/replace strings.
|
||||
.TP
|
||||
\fBset/unset keypad\fP
|
||||
Use alternate keypad routines.
|
||||
.TP
|
||||
\fBset/unset multibuffer\fP
|
||||
Allow inserting files into their own buffers.
|
||||
.TP
|
||||
\fBset/unset noconvert\fP
|
||||
Don't convert files from DOS/Mac format.
|
||||
.TP
|
||||
\fBset/unset nofollow\fP
|
||||
Don't follow symlinks when writing files.
|
||||
.TP
|
||||
\fBset/unset nohelp\fP
|
||||
Don't display the help lists at the bottom of the screen.
|
||||
.TP
|
||||
\fBset/unset nowrap\fP
|
||||
Don't wrap text at all.
|
||||
.TP
|
||||
\fBset operatingdir "\fIdirectory\fP"\fP
|
||||
\fBnano\fP will only read and write files inside \fIdirectory\fP and its
|
||||
subdirectories. Also, the current directory is changed to here, so files
|
||||
are inserted from this dir. By default the operating directory feature is
|
||||
turned off.
|
||||
.TP
|
||||
\fBset/unset preserve\fP
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
.TP
|
||||
\fBset quotestr "\fIstring\fP"\fP
|
||||
The email-quote string, used to justify email-quoted paragraphs. This is
|
||||
an "extended regular expression" if your system supports them, otherwise a
|
||||
literal string. The default value is
|
||||
|
||||
set quotestr "^([\ \\t]*[|>:}#])+"
|
||||
|
||||
if you have regexps, otherwise set quotestr ">\ ". Note that '\\t'
|
||||
above stands for a literal Tab character.
|
||||
.TP
|
||||
\fBset/unset regexp\fP
|
||||
Do regular expression searches by default.
|
||||
.TP
|
||||
\fBset/unset smooth\fP
|
||||
Use smooth scrolling by default.
|
||||
.TP
|
||||
\fBset speller \fIspellprog\fP\fP
|
||||
Use spelling checker \fIspellprog\fP instead of the built-in one, which
|
||||
calls \fIspell\fP.
|
||||
.TP
|
||||
\fBset/unset suspend\fP
|
||||
Allow nano to be suspended with ^Z.
|
||||
.TP
|
||||
\fBset tabsize \fIn\fP\fP
|
||||
Use a tab size of \fIn\fP instead of the default (8); must be greater
|
||||
than 0.
|
||||
.TP
|
||||
\fBset/unset tempfile\fP
|
||||
Save automatically on exit, don't prompt.
|
||||
.TP
|
||||
\fBset/unset view\fP
|
||||
Disallow file modification.
|
||||
.TP
|
||||
.B syntax "\fIstr\fP" ["\fIfileregex\fP" ... ]
|
||||
Defines a syntax named \fIstr\fP which can be activated via the
|
||||
\fB-Y\fP flag, or will be automatically activated if the current
|
||||
filename matches \fIfileregex\fP. All following \fBcolor\fP statements
|
||||
will apply to \fIsyntax\fP until a new syntax is defined.
|
||||
.TP
|
||||
.B color \fIfgcolor\fP[,\fIbgcolor\fP] "\fIregex\fP" ...
|
||||
For the currently defined syntax, display all expressions matching
|
||||
\fIregex\fP with foreground color \fIfgcolor\fP and optional background
|
||||
color \fIbgcolor\fP. Legal colors for foreground and background color are:
|
||||
white, black, red, blue, green, yellow, magenta, and cyan. You may use
|
||||
the prefix "bright" to force a stronger color highlight. If your
|
||||
terminal supports transparency, not specifying a \fIbgcolor\fP tells
|
||||
\fBnano\fP to attempt to use a transparent background.
|
||||
.TP
|
||||
.B color \fIfgcolor\fP[,\fIbgcolor\fP] start="\fIsr\fP" end="\fIer\fP"
|
||||
Display expressions which start with \fIsr\fP and end with \fIer\fP
|
||||
with foreground color \fIfgcolor\fP and optional
|
||||
background color \fIbgcolor\fP. This allows syntax highlighting to span
|
||||
multiple lines. Note that all subsequent instances of \fIsr\fP after
|
||||
an initial \fIsr\fP is found will be highlighted until the first
|
||||
instance of \fIer\fP.
|
||||
\fI
|
||||
|
||||
.SH FILES
|
||||
.TP
|
||||
.I $SYSCONFDIR/nanorc
|
||||
System-wide configuration file
|
||||
.TP
|
||||
.I ~/.nanorc
|
||||
Per-user configuration file
|
||||
.SH SEE ALSO
|
||||
.PD 0
|
||||
.TP
|
||||
\fBnano\fP(1)
|
||||
.PP
|
||||
\fI/usr/share/doc/nano/examples/nanorc.sample\fP (or equivalent on your
|
||||
system)
|
||||
.SH AUTHOR
|
||||
Chris Allegretta <chrisa@asty.org>, et al (see
|
||||
.I AUTHORS
|
||||
and
|
||||
.I THANKS
|
||||
for details).
|
||||
This manual page was written by Jordi Mallach <jordi@gnu.org>.
|
||||
195
nanorc.5.html
195
nanorc.5.html
@@ -1,195 +0,0 @@
|
||||
<HTML><HEAD><TITLE>Manpage of NANORC</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANORC</H1>
|
||||
Section: File Formats (5)<BR>Updated: June 19, 2003<BR><A HREF="#index">Index</A>
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
||||
|
||||
|
||||
|
||||
<A NAME="lbAB"> </A>
|
||||
<H2>NAME</H2>
|
||||
|
||||
nanorc - GNU nano's rcfile
|
||||
<A NAME="lbAC"> </A>
|
||||
<H2>DESCRIPTION</H2>
|
||||
|
||||
This manual page documents GNU <B>nano</B>'s rcfile.
|
||||
<P>
|
||||
|
||||
<B>nano</B> is a small, free and friendly editor which aims to replace
|
||||
Pico, the default editor included in the non-free Pine package. Rather
|
||||
than just copying Pico's look and feel, <B>nano</B> also implements some
|
||||
missing (or disabled by default) features in Pico, such as "search and
|
||||
replace" and "go to line number".
|
||||
<P>
|
||||
|
||||
The <I>nanorc</I> file contains the default settings for <B>nano</B>.
|
||||
During startup, <B>nano</B> will first read its system-wide settings from
|
||||
<I>$SYSCONFDIR/nanorc</I>,
|
||||
|
||||
and then user-specific settings from
|
||||
<I>~/.nanorc</I>.
|
||||
|
||||
<P>
|
||||
<A NAME="lbAD"> </A>
|
||||
<H2>OPTIONS</H2>
|
||||
|
||||
The configuration file accepts a series of "set" and "unset" commands,
|
||||
which can be used to configure nano on startup without using the
|
||||
command-line options. Additionally, the "syntax" and "color" keywords
|
||||
are used to define syntax highlighting rules for different text patterns.
|
||||
GNU nano will read one command per line.
|
||||
<P>
|
||||
Options in rcfiles take precedence over nano's defaults, and command line
|
||||
options override rcfile settings.
|
||||
<P>
|
||||
Options are unset by default, except for options that take an argument.
|
||||
<P>
|
||||
The supported commands and arguments are:
|
||||
<P>
|
||||
<DL COMPACT>
|
||||
<DT><B>set/unset autoindent</B><DD>
|
||||
Use auto-indentation.
|
||||
<DT><B>set/unset backup</B><DD>
|
||||
Create backup files in
|
||||
<I>filename~</I>.
|
||||
|
||||
<DT><B>set/unset const</B><DD>
|
||||
Constantly display the cursor position in the status bar.
|
||||
<DT><B>set/unset cut</B><DD>
|
||||
Use cut to end of line with ^K by default.
|
||||
<DT><B>set fill </B><I>n</I><DD>
|
||||
Wrap lines at column number <I>n</I>. If <I>n</I> is 0 or less, the line
|
||||
length will be the screen width less <I>n</I>. The default value is -8.
|
||||
<DT><B>set/unset historylog</B><DD>
|
||||
Enable
|
||||
<I>~/.nano_history</I>
|
||||
|
||||
for saving and reading search/replace strings.
|
||||
<DT><B>set/unset keypad</B><DD>
|
||||
Use alternate keypad routines.
|
||||
<DT><B>set/unset multibuffer</B><DD>
|
||||
Allow inserting files into their own buffers.
|
||||
<DT><B>set/unset noconvert</B><DD>
|
||||
Don't convert files from DOS/Mac format.
|
||||
<DT><B>set/unset nofollow</B><DD>
|
||||
Don't follow symlinks when writing files.
|
||||
<DT><B>set/unset nohelp</B><DD>
|
||||
Don't display the help lists at the bottom of the screen.
|
||||
<DT><B>set/unset nowrap</B><DD>
|
||||
Don't wrap text at all.
|
||||
<DT><B>set operatingdir "</B><I>directory</I>"<DD>
|
||||
<B>nano</B> will only read and write files inside <I>directory</I> and its
|
||||
subdirectories. Also, the current directory is changed to here, so files
|
||||
are inserted from this dir. By default the operating directory feature is
|
||||
turned off.
|
||||
<DT><B>set/unset preserve</B><DD>
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
<DT><B>set quotestr "</B><I>string</I>"<DD>
|
||||
The email-quote string, used to justify email-quoted paragraphs. This is
|
||||
an "extended regular expression" if your system supports them, otherwise a
|
||||
literal string. The default value is
|
||||
<P>
|
||||
<TT> </TT>set quotestr "^([ \t]*[|>:}#])+"<BR>
|
||||
<P>
|
||||
if you have regexps, otherwise set quotestr "> ". Note that '\t'
|
||||
above stands for a literal Tab character.
|
||||
<DT><B>set/unset regexp</B><DD>
|
||||
Do regular expression searches by default.
|
||||
<DT><B>set/unset smooth</B><DD>
|
||||
Use smooth scrolling by default.
|
||||
<DT><B>set speller </B><I>spellprog</I><DD>
|
||||
Use spelling checker <I>spellprog</I> instead of the built-in one, which
|
||||
calls <I>spell</I>.
|
||||
<DT><B>set/unset suspend</B><DD>
|
||||
Allow nano to be suspended with ^Z.
|
||||
<DT><B>set tabsize </B><I>n</I><DD>
|
||||
Use a tab size of <I>n</I> instead of the default (8); must be greater
|
||||
than 0.
|
||||
<DT><B>set/unset tempfile</B><DD>
|
||||
Save automatically on exit, don't prompt.
|
||||
<DT><B>set/unset view</B><DD>
|
||||
Disallow file modification.
|
||||
<DT><B>syntax </B><I>str</I> [<I>fileregex</I> ... ]
|
||||
|
||||
<DD>
|
||||
Defines a syntax named <I>str</I> which can be activated via the
|
||||
<B>-Y</B> flag, or will be automatically activated if the current
|
||||
filename matches <I>fileregex</I>. All following <B>color</B> statements
|
||||
will apply to <I>syntax</I> until a new syntax is defined.
|
||||
<DT><B>color </B><I>fgcolor</I>[,<I>bgcolor</I>] <I>regex</I> ...
|
||||
|
||||
<DD>
|
||||
For the currently defined syntax, display all expressions matching
|
||||
<I>regex</I> with foreground color <I>fgcolor</I> and optional background
|
||||
color <I>bgcolor</I>. Legal colors for foreground and background color are:
|
||||
white, black, red, blue, green, yellow, magenta, and cyan. You may use
|
||||
the prefix "bright" to force a stronger color highlight. If your
|
||||
terminal supports transparency, not specifying a <I>bgcolor</I> tells
|
||||
<B>nano</B> to attempt to use a transparent background.
|
||||
<DT><B>color </B><I>fgcolor</I>[,<I>bgcolor</I>] start=<I>sr</I> end=<I>er</I>
|
||||
|
||||
<DD>
|
||||
Display expressions which start with <I>sr</I> and end with <I>er</I>
|
||||
with foreground color <I>fgcolor</I> and optional
|
||||
background color <I>bgcolor</I>. This allows syntax highlighting to span
|
||||
multiple lines. Note that all subsequent instances of <I>sr</I> after
|
||||
an initial <I>sr</I> is found will be highlighted until the first
|
||||
instance of <I>er</I>.
|
||||
<I>
|
||||
<P>
|
||||
</DL>
|
||||
</I><A NAME="lbAE"> </A>
|
||||
<H2>FILES</H2>
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><I>$SYSCONFDIR/nanorc</I>
|
||||
|
||||
<DD>
|
||||
System-wide configuration file
|
||||
<DT><I>~/.nanorc</I>
|
||||
|
||||
<DD>
|
||||
Per-user configuration file
|
||||
</DL>
|
||||
<A NAME="lbAF"> </A>
|
||||
<H2>SEE ALSO</H2>
|
||||
|
||||
|
||||
<DL COMPACT>
|
||||
<DT><B><A HREF="http://localhost/cgi-bin/man/man2html?1+nano">nano</A></B>(1)<DD>
|
||||
</DL>
|
||||
<P>
|
||||
|
||||
<I>/usr/share/doc/nano/examples/nanorc.sample</I> (or equivalent on your
|
||||
system)
|
||||
<A NAME="lbAG"> </A>
|
||||
<H2>AUTHOR</H2>
|
||||
|
||||
Chris Allegretta <<A HREF="mailto:chrisa@asty.org">chrisa@asty.org</A>>, et al (see
|
||||
<I>AUTHORS</I>
|
||||
|
||||
and
|
||||
<I>THANKS</I>
|
||||
|
||||
for details).
|
||||
This manual page was written by Jordi Mallach <<A HREF="mailto:jordi@gnu.org">jordi@gnu.org</A>>.
|
||||
<P>
|
||||
|
||||
<HR>
|
||||
<A NAME="index"> </A><H2>Index</H2>
|
||||
<DL>
|
||||
<DT><A HREF="#lbAB">NAME</A><DD>
|
||||
<DT><A HREF="#lbAC">DESCRIPTION</A><DD>
|
||||
<DT><A HREF="#lbAD">OPTIONS</A><DD>
|
||||
<DT><A HREF="#lbAE">FILES</A><DD>
|
||||
<DT><A HREF="#lbAF">SEE ALSO</A><DD>
|
||||
<DT><A HREF="#lbAG">AUTHOR</A><DD>
|
||||
</DL>
|
||||
<HR>
|
||||
This document was created by
|
||||
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
|
||||
using the manual pages.<BR>
|
||||
Time: 22:28:00 GMT, June 19, 2003
|
||||
</BODY>
|
||||
</HTML>
|
||||
211
nanorc.sample
211
nanorc.sample
@@ -1,211 +0,0 @@
|
||||
## Sample initialization file for GNU nano
|
||||
## Please note that you must have configured nano with --enable-nanorc
|
||||
## for this file to be read! Also note that characters specially
|
||||
## interpreted by the shell should not be escaped here.
|
||||
##
|
||||
## To make sure a value is not enabled, use "unset <option>"
|
||||
##
|
||||
## For the options that take parameters, the default value is given.
|
||||
## Other options are unset by default.
|
||||
|
||||
## Use auto-indentation
|
||||
# set autoindent
|
||||
|
||||
## Backup files to filename~
|
||||
# set backup
|
||||
|
||||
## Constantly display the cursor position in the status bar.
|
||||
# set const
|
||||
|
||||
## Use cut to end of line with ^K by default
|
||||
# set cut
|
||||
|
||||
## Set the line length for wrapping text and justifying paragraphs.
|
||||
## If fill is negative, the line length will be the screen width less
|
||||
## this number.
|
||||
##
|
||||
# set fill -8
|
||||
|
||||
## Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
# set historylog
|
||||
|
||||
## Use alternate keypad routines
|
||||
# set keypad
|
||||
|
||||
## Allow multiple file buffers (using ^R inserts into separate buffer).
|
||||
## You must have configured with --enable-multibuffer or --enable-extra
|
||||
## for this to work.
|
||||
##
|
||||
## set multibuffer
|
||||
|
||||
## Don't convert files from DOS/Mac format
|
||||
# set noconvert
|
||||
|
||||
## Don't follow symlinks when writing files
|
||||
# set nofollow
|
||||
|
||||
## Don't display the help lists at the bottom of the screen
|
||||
# set nohelp
|
||||
|
||||
## Don't wrap text at all
|
||||
# set nowrap
|
||||
|
||||
## Set operating directory. nano will not read or write files outside
|
||||
## this directory and its subdirectories. Also, the current directory
|
||||
## is changed to here, so files are inserted from this dir. A blank
|
||||
## string means the operating directory feature is turned off.
|
||||
##
|
||||
# set operatingdir ""
|
||||
|
||||
## Preserve the XON and XOFF keys (^Q and ^S)
|
||||
# set preserve
|
||||
|
||||
## The email-quote string, used to justify email-quoted paragraphs.
|
||||
## This is an extended regular expression if your system supports them,
|
||||
## otherwise a literal string. Default:
|
||||
# set quotestr "^([ ]*[\|>:}#])+"
|
||||
## if you have regexps, otherwise:
|
||||
# set quotestr "> "
|
||||
## You can get old nano quoted-justify behavior via:
|
||||
# set quotestr "(> )+"
|
||||
|
||||
## Do extended regular expression searches by default
|
||||
# set regexp
|
||||
|
||||
## Use smooth scrolling as the default
|
||||
# set smooth
|
||||
|
||||
## Use this spelling checker instead of the internal one. This option
|
||||
## does not properly have a default value.
|
||||
##
|
||||
# set speller "aspell -c"
|
||||
|
||||
## Allow nano to be suspended with ^Z
|
||||
# set suspend
|
||||
|
||||
## Use this tab size instead of the default; it must be greater than 0
|
||||
# set tabsize 8
|
||||
|
||||
## Save automatically on exit, don't prompt
|
||||
# set tempfile
|
||||
|
||||
## Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
# set historylog
|
||||
|
||||
## Disallow file modification, why would you want this in an rc file? ;)
|
||||
# set view
|
||||
|
||||
## Color setup
|
||||
## Format:
|
||||
## syntax "short description" ["filename regex" ...]
|
||||
## color foreground,background "regex" ["regex"...]
|
||||
##
|
||||
## Legal colors: white, black, red, blue, green, yellow, magenta, cyan.
|
||||
## You may use the prefix "bright" to mean a stronger color highlight.
|
||||
##
|
||||
## To use multi-line regexes use the start="regex" end="regex" format.
|
||||
##
|
||||
## If your system supports transparency, not specifying a background
|
||||
## color will use a transparent color. If you don't want this, be sure
|
||||
## to set the background color to black or white.
|
||||
##
|
||||
# syntax "c-file" "\.(c|h)$"
|
||||
# color red "\<[A-Z_]{2,}\>"
|
||||
# color green "\<(float|char|int|void|static|const|struct)\>"
|
||||
# color brightyellow "\<(if|while|do|else|case|switch)\>"
|
||||
# color brightcyan "^#( )*(define|include|ifn?def|endif|elif|else|if)"
|
||||
##
|
||||
## You will in general want your comments and strings to come last,
|
||||
## because syntax highlighting rules will be applied in the order they
|
||||
## are read in.
|
||||
##
|
||||
# color brightyellow "<[^= ]*>" ""(\\.|[^\"])*""
|
||||
##
|
||||
## This string is VERY resource intensive!!!
|
||||
# color brightyellow start=""(\\.|[^\"])*\\( | )*$" end="^(\\.|[^\"])*""
|
||||
##
|
||||
## And we want to have some nice comment highlighting too
|
||||
# color brightblue "//.*"
|
||||
# color brightblue start="/\*" end="\*/"
|
||||
|
||||
## Here is a short example for HTML
|
||||
# syntax "HTML" "\.html$"
|
||||
# color blue start="<" end=">"
|
||||
# color red "&[^; ]*;"
|
||||
|
||||
## Here is a short example for TeX files
|
||||
# syntax "TeX" "\.tex$"
|
||||
# color green "\\.|\\[A-Za-z]*"
|
||||
# color magenta "[{}]"
|
||||
# color blue "%.*"
|
||||
|
||||
## Here is an example for quoted emails (under e.g. mutt)
|
||||
# syntax "mutt"
|
||||
# color green "^>.*"
|
||||
|
||||
## Here is an example for groff
|
||||
##
|
||||
# syntax "groff" "\.ms$" "\.mm$" "\.me$" "\.tmac$" "^tmac." ".rof"
|
||||
## The argument of .nr or .ds
|
||||
# color cyan "^\.ds [^ ]*"
|
||||
# color cyan "^\.nr [^ ]*"
|
||||
## Single character escapes
|
||||
# color brightmagenta "\\."
|
||||
## Highlight the argument of \f or \s in the same color
|
||||
# color brightmagenta "\\f."
|
||||
# color brightmagenta "\\f\(.."
|
||||
# color brightmagenta "\\s(\+|\-)?[0-9]"
|
||||
## \n
|
||||
# color cyan "(\\|\\\\)n."
|
||||
# color cyan "(\\|\\\\)n\(.."
|
||||
# color cyan start="(\\|\\\\)n\[" end="]"
|
||||
## Requests
|
||||
# color brightgreen "^\. *[^ ]*"
|
||||
## Comments
|
||||
# color yellow "^\.\\\".*$"
|
||||
## Strings
|
||||
# color green "(\\|\\\\)\*."
|
||||
# color green "(\\|\\\\)\*\(.."
|
||||
# color green start="(\\|\\\\)\*\[" end="]"
|
||||
## Characters
|
||||
# color brightred "\\\(.."
|
||||
# color brightred start="\\\[" end="]"
|
||||
## Macro arguments
|
||||
# color brightcyan "\\\\\$[1-9]"
|
||||
|
||||
## Here is an example for perl
|
||||
##
|
||||
# syntax "perl" "\.p[lm]$"
|
||||
# color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork)|get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join|keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek|seekdir|se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr|y|truncate|umask|un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
||||
# color magenta "\<(continue|else|elsif|do|for|foreach|if|unless|until|while|eq|ne|lt|gt|le|ge|cmp|x|my|sub|use|package|can|isa)\>"
|
||||
# color cyan start="[$@%]" end="( |\\W|-)"
|
||||
# color yellow "".*"|qq\|.*\|"
|
||||
# color white "[sm]/.*/"
|
||||
# color white start="(^use| = new)" end=";"
|
||||
# color green "#.*"
|
||||
# color yellow start="<< 'STOP'" end="STOP"
|
||||
|
||||
## Here is an example for Java source
|
||||
##
|
||||
# syntax "Java source" "\.java$"
|
||||
# color green "\<(boolean|byte|char|double|float|int|long|new|short|this|transient|void)\>"
|
||||
# color red "\<(break|case|catch|continue|default|do|else|finally|for|if|return|switch|throw|try|while)\>"
|
||||
# color cyan "\<(abstract|class|extends|final|implements|import|instanceof|interface|native|package|private|protected|public|static|strictfp|super|synchronized|throws|volatile)\>"
|
||||
# color red ""[^\"]*""
|
||||
# color yellow "\<(true|false|null)\>"
|
||||
# color blue "//.*"
|
||||
# color blue start="/\*" end="\*/"
|
||||
# color brightblue start="/\*\*" end="\*/"
|
||||
# color brightgreen,brightgreen "[ ]+$"
|
||||
|
||||
## Here is an example for your .nanorc
|
||||
##
|
||||
# syntax "nanorc" "[\.]*nanorc$"
|
||||
# color white "^ *(set|unset).*$"
|
||||
# color cyan "^ *(set|unset) (autoindent|backup|const|cut|fill|keypad|multibuffer|noconvert|nofollow|nohelp|nowrap|operatingdir|preserve|quotestr|regexp|smooth|speller|suspend|tabsize|tempfile|historylog|view)"
|
||||
# color brightwhite "^ *syntax [^ ]*"
|
||||
# color brightblue "^ *set\>" "^ *unset\>" "^ *syntax\>"
|
||||
# color white "^ *color\>.*"
|
||||
# color yellow "^ *color (bright)?(white|black|red|blue|green|yellow|magenta|cyan)\>"
|
||||
# color magenta "^ *color\>"
|
||||
# color green "^#.*$"
|
||||
271
po/ChangeLog
271
po/ChangeLog
@@ -1,14 +1,203 @@
|
||||
2003-08-05 Jordi Mallach <jordi@sindominio.net>
|
||||
2005-06-28 David Lawrence Ramsey <pooka_regent@sluggy.net>
|
||||
|
||||
* POTFILES.in: Remove source files that contain no translatable
|
||||
strings.
|
||||
|
||||
2005-06-19 David Lawrence Ramsey <pooka_regent@sluggy.net>
|
||||
|
||||
* pt_BR.po: Typo fix.
|
||||
|
||||
2005-06-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* de.po: Typo fix by Jens Seidel.
|
||||
|
||||
2005-05-23 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2005-04-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2005-04-22 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Norwegian bokmål translation by
|
||||
Geir Helland.
|
||||
|
||||
2005-04-20 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
|
||||
* zh_TW.po: Updated Traditional Chinese translation by
|
||||
CHAO Wei-Lun.
|
||||
|
||||
2005-04-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* vi.po: Updated Vietnamese translation by Phan Vinh Thinh.
|
||||
|
||||
2005-04-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
|
||||
|
||||
2005-04-14 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* es.po: Updated Spanish translation by
|
||||
Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2005-04-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* vi.po: New Vietnamese translation by Phan Vinh Thinh.
|
||||
* LINGUAS: Added "vi".
|
||||
|
||||
2005-04-09 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* zh_TW.po: Added Plural-Forms header and fix format specification
|
||||
typos.
|
||||
|
||||
2005-04-08 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* zh_TW.po: Updated Traditional Chinese translation by
|
||||
CHAO Wei-Lun.
|
||||
|
||||
2005-04-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* rw.po: New Kinyarwanda translation by Steve Murphy.
|
||||
* LINGUAS: Added "rw".
|
||||
|
||||
2005-04-05 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
* ro.po: Updated Romanian translation by
|
||||
Laurentiu Buzdugan.
|
||||
|
||||
2005-03-11 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2005-01-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pt_BR.po: Updated Brazilian Portuguese translation by
|
||||
Joao Victor Duarte Martins.
|
||||
|
||||
2004-12-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
|
||||
2004-12-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
|
||||
2004-12-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
|
||||
2004-12-07 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by
|
||||
Marco Colombo.
|
||||
* ro.po: Updated Romanian translation by
|
||||
Laurentiu Buzdugan.
|
||||
|
||||
2004-12-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* nb: Updated Norwegian bokmål translation by
|
||||
Geir Helland.
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2004-11-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2004-11-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by
|
||||
Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2004-10-07 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* eu.po: Updated Basque translation by
|
||||
Mikel Olasagasti.
|
||||
|
||||
2004-08-31 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* es.po: Updated Spanish translation by
|
||||
Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2004-08-31 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated Catalan translation by
|
||||
Jean-Philippe Guérard.
|
||||
|
||||
2004-08-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
|
||||
2004-06-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* zh_TW.po: Added Traditional Chinese translation by
|
||||
CHAO Wei-Lun <chaoweilun@pcmail.com.tw>.
|
||||
* LINGUAS: Added "zh_TW".
|
||||
|
||||
2004-02-24 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2003-11-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ro.po: Updated Romanian translation by Laurentiu Buzdugan.
|
||||
|
||||
2003-11-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* sr.po: Added Serbian translation by Danilo Segan <dsegan@gmx.net>.
|
||||
* LINGUAS: Added "sr" (Serbian), and alphabetize.
|
||||
* ChangeLog: Recoded as UTF-8.
|
||||
|
||||
2003-10-30 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fi.po: Patch from Martin-Eric Racine <q-funk@pp.fishpool.fi>
|
||||
to accept "Yy" and "Nn" as well as the Finnish letters in Yes/No
|
||||
prompts.
|
||||
|
||||
2003-10-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2003-09-12 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* POTFILES.in: Updated path to sources.
|
||||
|
||||
2003-09-01 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-08-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* tr.po: Updated Turkish translation by A. Murat EREN.
|
||||
|
||||
2003-08-05 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
|
||||
2003-06-11 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* nb.po: Updated Norwegian bokmål translation by Geir Helland.
|
||||
* nb.po: Updated Norwegian bokmål translation by Geir Helland.
|
||||
|
||||
2003-06-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-06-02 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
@@ -16,7 +205,7 @@
|
||||
|
||||
2003-05-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ms.po: Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
* ms.po: Updated Malay translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2003-04-24 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
@@ -30,7 +219,7 @@
|
||||
|
||||
2003-04-04 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-03-17 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
@@ -52,7 +241,7 @@
|
||||
2003-02-19 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fi.po: Updated Finnish translation by Kalle Olavi Niemitalo.
|
||||
* es.po: Updated Spanish translation by Ricardo Javier Cárdenes
|
||||
* es.po: Updated Spanish translation by Ricardo Javier Cárdenes
|
||||
Medina.
|
||||
|
||||
2003-02-17 Jordi Mallach <jordi@gnu.org>
|
||||
@@ -63,12 +252,12 @@
|
||||
|
||||
2003-02-16 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated Galician translation by Jacobo Tarrío.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* gl.po: Updated Galician translation by Jacobo Tarrío.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
|
||||
2003-02-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* nl.po: Updated Dutch translation by Guus Sliepen.
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
* ca.po: Updated Catalan translation.
|
||||
@@ -95,8 +284,8 @@
|
||||
2003-02-08 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* it.po: Updated Italian translation by Marco Colombo.
|
||||
* gl.po: Updated Galician translation by Jacobo Tarrío.
|
||||
* es.po: Updated Spanish translation by Ricardo Javier Cárdenes
|
||||
* gl.po: Updated Galician translation by Jacobo Tarrío.
|
||||
* es.po: Updated Spanish translation by Ricardo Javier Cárdenes
|
||||
Medina.
|
||||
|
||||
2003-02-06 Jordi Mallach <jordi@gnu.org>
|
||||
@@ -107,13 +296,13 @@
|
||||
2003-02-04 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated French translation by Jean-Philippe Guérard.
|
||||
* uk.po: Updated Ukrainian translation by Sergey A. Ribalchenko.
|
||||
* de.po: Updated German translation by Michael Piefel.
|
||||
|
||||
2003-01-27 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-01-26 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
@@ -121,7 +310,7 @@
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
|
||||
2002-01-22 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
@@ -129,13 +318,13 @@
|
||||
|
||||
2003-01-21 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
* uk.po: Updated translation by Sergey A. Ribalchenko.
|
||||
|
||||
2003-01-18 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* nl.po: Updated translation by Guus Sliepen.
|
||||
* ca.po: Updated translation.
|
||||
@@ -159,7 +348,7 @@
|
||||
|
||||
2002-12-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* tr.po: New Turkish translation by Doruk Fisek.
|
||||
|
||||
2002-11-10 Jordi Mallach <jordi@sindominio.net>
|
||||
@@ -179,22 +368,22 @@
|
||||
2002-10-29 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-10-27 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-10-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-10-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2002-10-17 Jordi Mallach <jordi@sindominio.net>
|
||||
@@ -203,11 +392,11 @@
|
||||
|
||||
2002-10-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-10-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-10-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
@@ -225,7 +414,7 @@
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-09-08 Jordi Mallach <jordi@sindominio.net>
|
||||
@@ -234,7 +423,7 @@
|
||||
|
||||
2002-09-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-08-19 Jordi Mallach <jordi@sindominio.net>
|
||||
@@ -244,15 +433,15 @@
|
||||
|
||||
2002-07-31 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
|
||||
2002-07-31 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
* es.po: Updated translation by Ricardo Javier Cárdenes Medina.
|
||||
|
||||
2002-07-31 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-07-30 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
@@ -302,13 +491,13 @@
|
||||
|
||||
2002-05-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-05-13 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* ca.po: Updated translation.
|
||||
* es.po: Updated translation.
|
||||
|
||||
@@ -345,7 +534,7 @@
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrio.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ca.po: Updated.
|
||||
* es.po: Updated.
|
||||
|
||||
@@ -363,7 +552,7 @@
|
||||
|
||||
2002-03-17 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-03-15 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
@@ -386,7 +575,7 @@
|
||||
|
||||
2002-03-11 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-03-09 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
@@ -434,7 +623,7 @@
|
||||
|
||||
2002-02-06 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* cs.po: Incomplete update by Václav Haisman.
|
||||
* cs.po: Incomplete update by Václav Haisman.
|
||||
|
||||
2002-01-27 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
@@ -442,14 +631,14 @@
|
||||
|
||||
2002-01-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* nn.po: Updated translation by Kjetil Torgrim Homme.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
@@ -480,21 +669,21 @@
|
||||
|
||||
* no.po: Removed, replaced by nn.po.
|
||||
* nn.po: Updated translation by Kjetil Torgrim Homme.
|
||||
* nb.po: New Norwegian bokmål translation by Stig E Sandoe.
|
||||
* nb.po: New Norwegian bokmål translation by Stig E Sandoe.
|
||||
|
||||
2002-01-12 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-10 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ru.po, uk.po: Updated translations by Sergey A.
|
||||
Ribalchenko.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
|
||||
2002-01-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
# List of available languages.
|
||||
es de fr it id fi hu ca cs gl uk ru sv nn nl da pl nb ms pt_BR tr eu ro
|
||||
ca cs da de es eu fi fr gl hu id it ms nb nl nn pl pt_BR ro ru rw sr sv tr uk vi zh_TW
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
# $Id$
|
||||
# List of source files containing translatable strings.
|
||||
|
||||
# Package source files
|
||||
cut.c
|
||||
files.c
|
||||
global.c
|
||||
move.c
|
||||
nano.c
|
||||
rcfile.c
|
||||
search.c
|
||||
utils.c
|
||||
winio.c
|
||||
|
||||
# Package header files
|
||||
nano.h
|
||||
proto.h
|
||||
src/files.c
|
||||
src/global.c
|
||||
src/nano.c
|
||||
src/rcfile.c
|
||||
src/search.c
|
||||
src/utils.c
|
||||
src/winio.c
|
||||
|
||||
4
po/fi.po
4
po/fi.po
@@ -1592,11 +1592,11 @@ msgstr "En hyv
|
||||
|
||||
#: winio.c:1297
|
||||
msgid "Yy"
|
||||
msgstr "Kk"
|
||||
msgstr "KkYy"
|
||||
|
||||
#: winio.c:1298
|
||||
msgid "Nn"
|
||||
msgstr "Ee"
|
||||
msgstr "EeNn"
|
||||
|
||||
#: winio.c:1299
|
||||
msgid "Aa"
|
||||
|
||||
2463
po/pt_BR.po
2463
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
15
po/update.pl
15
po/update.pl
@@ -5,19 +5,20 @@
|
||||
#
|
||||
# Copyright (C) 2000 Free Software Foundation.
|
||||
#
|
||||
# This script is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation; either version 2 of the
|
||||
# License, or (at your option) any later version.
|
||||
# This script is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or (at
|
||||
# your option) any later version.
|
||||
#
|
||||
# This script is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# This script is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this library; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
|
||||
# USA.
|
||||
#
|
||||
# Authors: Kenneth Christiansen <kenneth@gnu.org>
|
||||
#
|
||||
|
||||
1548
po/zh_TW.po
Normal file
1548
po/zh_TW.po
Normal file
File diff suppressed because it is too large
Load Diff
494
proto.h
494
proto.h
@@ -1,494 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* proto.h *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
/* Externs */
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
#include <regex.h>
|
||||
#endif
|
||||
|
||||
#include "nano.h"
|
||||
|
||||
extern int wrap_at;
|
||||
extern int editwinrows;
|
||||
extern int current_x, current_y, totlines;
|
||||
extern int placewewant;
|
||||
#ifndef NANO_SMALL
|
||||
extern int mark_beginx;
|
||||
#endif
|
||||
extern long totsize;
|
||||
extern int temp_opt;
|
||||
extern int wrap_at, flags, tabsize;
|
||||
extern int search_last_line;
|
||||
extern int search_offscreen;
|
||||
extern int currslen;
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
extern char *quotestr;
|
||||
#endif
|
||||
|
||||
extern WINDOW *edit, *topwin, *bottomwin;
|
||||
extern char *filename;
|
||||
extern struct stat originalfilestat;
|
||||
extern char *answer;
|
||||
extern char *hblank;
|
||||
#ifndef DISABLE_HELP
|
||||
extern char *help_text;
|
||||
#endif
|
||||
extern char *last_search;
|
||||
extern char *last_replace;
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
extern char *operating_dir;
|
||||
extern char *full_operating_dir;
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
extern char *alt_speller;
|
||||
#endif
|
||||
|
||||
extern int resetstatuspos;
|
||||
extern struct stat fileinfo;
|
||||
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
|
||||
extern filestruct *cutbuffer;
|
||||
#ifndef NANO_SMALL
|
||||
extern filestruct *mark_beginbuf;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
extern openfilestruct *open_files;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
extern const colortype *colorstrings;
|
||||
extern syntaxtype *syntaxes;
|
||||
extern char *syntaxstr;
|
||||
#endif
|
||||
|
||||
extern shortcut *shortcut_list;
|
||||
extern shortcut *main_list, *whereis_list;
|
||||
extern shortcut *replace_list, *goto_list;
|
||||
extern shortcut *writefile_list, *insertfile_list;
|
||||
extern shortcut *replace_list_2;
|
||||
#ifndef NANO_SMALL
|
||||
extern shortcut *extcmd_list;
|
||||
#endif
|
||||
#ifndef DISABLE_HELP
|
||||
extern shortcut *help_list;
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
extern shortcut *spell_list;
|
||||
#endif
|
||||
#ifndef DISABLE_BROWSER
|
||||
extern shortcut *browser_list, *gotodir_list;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
extern const shortcut *currshortcut;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
extern regex_t search_regexp;
|
||||
extern regmatch_t regmatches[10];
|
||||
#ifdef ENABLE_COLOR
|
||||
extern regex_t syntaxfile_regexp;
|
||||
extern regmatch_t synfilematches[1];
|
||||
#endif /* ENABLE_COLOR */
|
||||
#endif /* HAVE_REGEX_H */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
extern toggle *toggles;
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
extern historyheadtype search_history;
|
||||
extern historyheadtype replace_history;
|
||||
#endif
|
||||
|
||||
extern int curses_ended;
|
||||
|
||||
/* Functions we want available */
|
||||
|
||||
/* Public functions in color.c */
|
||||
#ifdef ENABLE_COLOR
|
||||
void set_colorpairs(void);
|
||||
void do_colorinit(void);
|
||||
void update_color(void);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
/* Public functions in cut.c */
|
||||
filestruct *get_cutbottom(void);
|
||||
void add_to_cutbuffer(filestruct *inptr);
|
||||
void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
|
||||
size_t bot_x, int destructive);
|
||||
int do_cut_text(void);
|
||||
int do_uncut_text(void);
|
||||
|
||||
/* Public functions in files.c */
|
||||
void load_file(int update);
|
||||
void new_file(void);
|
||||
filestruct *read_line(char *buf, filestruct *prev, int *line1ins, int len);
|
||||
int read_file(FILE *f, const char *filename, int quiet);
|
||||
int open_file(const char *filename, int insert, int quiet);
|
||||
char *get_next_filename(const char *name);
|
||||
int do_insertfile(int loading_file);
|
||||
int do_insertfile_void(void);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
openfilestruct *make_new_opennode(openfilestruct *prevnode);
|
||||
void splice_opennode(openfilestruct *begin, openfilestruct *newnode, openfilestruct *end);
|
||||
void unlink_opennode(const openfilestruct *fileptr);
|
||||
void delete_opennode(openfilestruct *fileptr);
|
||||
void free_openfilestruct(openfilestruct *src);
|
||||
int add_open_file(int update);
|
||||
int load_open_file(void);
|
||||
int open_prevfile(int closing_file);
|
||||
int open_prevfile_void(void);
|
||||
int open_nextfile(int closing_file);
|
||||
int open_nextfile_void(void);
|
||||
int close_open_file(void);
|
||||
#endif
|
||||
#if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR)
|
||||
char *get_full_path(const char *origpath);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
char *check_writable_directory(const char *path);
|
||||
char *safe_tempnam(const char *dirname, const char *filename_prefix);
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
void init_operating_dir(void);
|
||||
int check_operating_dir(const char *currpath, int allow_tabcomp);
|
||||
#endif
|
||||
int write_file(const char *name, int tmp, int append, int nonamechange);
|
||||
int do_writeout(const char *path, int exiting, int append);
|
||||
int do_writeout_void(void);
|
||||
char *real_dir_from_tilde(const char *buf);
|
||||
#ifndef DISABLE_TABCOMP
|
||||
int append_slash_if_dir(char *buf, int *lastwastab, int *place);
|
||||
char **username_tab_completion(char *buf, int *num_matches);
|
||||
char **cwd_tab_completion(char *buf, int *num_matches);
|
||||
char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list);
|
||||
#endif
|
||||
#ifndef DISABLE_BROWSER
|
||||
struct stat filestat(const char *path);
|
||||
int diralphasort(const void *va, const void *vb);
|
||||
void free_charptrarray(char **array, int len);
|
||||
const char *tail(const char *foo);
|
||||
void striponedir(char *foo);
|
||||
int readable_dir(const char *path);
|
||||
char **browser_init(const char *path, int *longest, int *numents);
|
||||
char *do_browser(const char *inpath);
|
||||
char *do_browse_from(const char *inpath);
|
||||
#endif
|
||||
|
||||
/* Public functions in global.c */
|
||||
int length_of_list(const shortcut *s);
|
||||
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
|
||||
#ifndef DISABLE_HELP
|
||||
const char *help,
|
||||
#endif
|
||||
int alt, int misc1, int misc2, int view, int (*func) (void));
|
||||
#ifndef NANO_SMALL
|
||||
void toggle_init_one(int val, const char *desc, int flag);
|
||||
void toggle_init(void);
|
||||
#ifdef DEBUG
|
||||
void free_toggles(void);
|
||||
#endif
|
||||
#endif
|
||||
void free_shortcutage(shortcut **shortcutage);
|
||||
void shortcut_init(int unjustify);
|
||||
#ifdef DEBUG
|
||||
void thanks_for_all_the_fish(void);
|
||||
#endif
|
||||
|
||||
/* Public functions in move.c */
|
||||
int do_home(void);
|
||||
int do_end(void);
|
||||
void page_up(void);
|
||||
int do_page_up(void);
|
||||
int do_page_down(void);
|
||||
int do_up(void);
|
||||
int do_down(void);
|
||||
int do_left(void);
|
||||
int do_right(void);
|
||||
|
||||
/* Public functions in nano.c */
|
||||
RETSIGTYPE finish(int sigage);
|
||||
void die(const char *msg, ...);
|
||||
void die_save_file(const char *die_filename);
|
||||
void die_too_small(void);
|
||||
void print_view_warning(void);
|
||||
void global_init(int save_cutbuffer);
|
||||
void window_init(void);
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
void mouse_init(void);
|
||||
#endif
|
||||
#ifndef DISABLE_HELP
|
||||
void help_init(void);
|
||||
#endif
|
||||
filestruct *make_new_node(filestruct *prevnode);
|
||||
filestruct *copy_node(const filestruct *src);
|
||||
void splice_node(filestruct *begin, filestruct *newnode, filestruct *end);
|
||||
void unlink_node(const filestruct *fileptr);
|
||||
void delete_node(filestruct *fileptr);
|
||||
filestruct *copy_filestruct(const filestruct *src);
|
||||
void free_filestruct(filestruct *src);
|
||||
void renumber_all(void);
|
||||
void renumber(filestruct *fileptr);
|
||||
void print1opt(const char *shortflag, const char *longflag,
|
||||
const char *desc);
|
||||
void usage(void);
|
||||
void version(void);
|
||||
void do_early_abort(void);
|
||||
int no_help(void);
|
||||
#if defined(DISABLE_JUSTIFY) || defined(DISABLE_SPELLER) || defined(DISABLE_HELP) || defined(NANO_SMALL)
|
||||
void nano_disabled_msg(void);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
RETSIGTYPE cancel_fork(int signal);
|
||||
int open_pipe(const char *command);
|
||||
#endif
|
||||
#ifndef DISABLE_MOUSE
|
||||
#ifdef NCURSES_MOUSE_VERSION
|
||||
void do_mouse(void);
|
||||
#endif
|
||||
#endif
|
||||
void do_char(char ch);
|
||||
int do_backspace(void);
|
||||
int do_delete(void);
|
||||
int do_tab(void);
|
||||
int do_enter(void);
|
||||
int do_next_word(void);
|
||||
int do_prev_word(void);
|
||||
int do_mark(void);
|
||||
void wrap_reset(void);
|
||||
#ifndef DISABLE_WRAPPING
|
||||
int do_wrap(filestruct *inptr);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
int do_int_spell_fix(const char *word);
|
||||
char *do_int_speller(char *tempfile_name);
|
||||
char *do_alt_speller(char *tempfile_name);
|
||||
#endif
|
||||
int do_spell(void);
|
||||
#if !defined(DISABLE_WRAPPING) && !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
|
||||
size_t indent_length(const char *line);
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
int justify_format(int changes_allowed, filestruct *line, size_t skip);
|
||||
#ifdef HAVE_REGEX_H
|
||||
size_t quote_length(const char *line, const regex_t *qreg);
|
||||
#else
|
||||
size_t quote_length(const char *line);
|
||||
#endif
|
||||
#ifdef HAVE_REGEX_H
|
||||
# define IFREG(a, b) a, b
|
||||
#else
|
||||
# define IFREG(a, b) a
|
||||
#endif
|
||||
int quotes_match(const char *a_line, size_t a_quote,
|
||||
IFREG(const char *b_line, const regex_t *qreg));
|
||||
size_t indents_match(const char *a_line, size_t a_indent,
|
||||
const char *b_line, size_t b_indent);
|
||||
filestruct *backup_lines(filestruct *first_line, size_t par_len,
|
||||
size_t quote_len);
|
||||
int breakable(const char *line, int goal);
|
||||
int break_line(const char *line, int goal, int force);
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
int do_justify(void);
|
||||
int do_exit(void);
|
||||
void signal_init(void);
|
||||
RETSIGTYPE handle_hupterm(int signal);
|
||||
RETSIGTYPE do_suspend(int signal);
|
||||
RETSIGTYPE do_cont(int signal);
|
||||
#ifndef NANO_SMALL
|
||||
void handle_sigwinch(int s);
|
||||
#endif
|
||||
void print_numlock_warning(void);
|
||||
#ifndef NANO_SMALL
|
||||
void do_toggle(const toggle *which);
|
||||
#endif
|
||||
int abcd(int input);
|
||||
|
||||
/* Public functions in rcfile.c */
|
||||
#ifdef ENABLE_NANORC
|
||||
void rcfile_error(const char *msg, ...);
|
||||
void rcfile_msg(const char *msg, ...);
|
||||
char *parse_next_word(char *ptr);
|
||||
char *parse_argument(char *ptr);
|
||||
#ifdef ENABLE_COLOR
|
||||
int colortoint(const char *colorname, int *bright);
|
||||
char *parse_next_regex(char *ptr);
|
||||
int nregcomp(regex_t *preg, const char *regex, int flags);
|
||||
void parse_syntax(char *ptr);
|
||||
void parse_colors(char *ptr);
|
||||
#endif /* ENABLE_COLOR */
|
||||
void parse_rcfile(FILE *rcstream);
|
||||
void do_rcfile(void);
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
/* Public functions in search.c */
|
||||
#ifdef HAVE_REGEX_H
|
||||
int regexp_init(const char *regexp);
|
||||
void regexp_cleanup(void);
|
||||
#endif
|
||||
void not_found_msg(const char *str);
|
||||
void search_abort(void);
|
||||
void search_init_globals(void);
|
||||
int search_init(int replacing);
|
||||
int is_whole_word(int curr_pos, const char *datastr, const char *searchword);
|
||||
filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
const filestruct *begin, int beginx,
|
||||
const char *needle);
|
||||
int do_search(void);
|
||||
void replace_abort(void);
|
||||
#ifdef HAVE_REGEX_H
|
||||
int replace_regexp(char *string, int create_flag);
|
||||
#endif
|
||||
char *replace_line(void);
|
||||
int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
int *beginx, int wholewords, int *i);
|
||||
int do_replace(void);
|
||||
int do_gotoline(int line, int save_pos);
|
||||
int do_gotoline_void(void);
|
||||
#if defined (ENABLE_MULTIBUFFER) || !defined (DISABLE_SPELLER)
|
||||
void do_gotopos(int line, int pos_x, int pos_y, int pos_placewewant);
|
||||
#endif
|
||||
int do_find_bracket(void);
|
||||
#ifndef NANO_SMALL
|
||||
void history_init(void);
|
||||
historytype *find_node(historytype *h, char *s);
|
||||
void remove_node(historytype *r);
|
||||
void insert_node(historytype *h, const char *s);
|
||||
void update_history(historyheadtype *h, char *s);
|
||||
char *get_history_older(historyheadtype *h);
|
||||
char *get_history_newer(historyheadtype *h);
|
||||
char *get_history_completion(historyheadtype *h, char *s);
|
||||
void free_history(historyheadtype *h);
|
||||
#ifdef ENABLE_NANORC
|
||||
void load_history(void);
|
||||
void save_history(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Public functions in utils.c */
|
||||
#ifdef BROKEN_REGEXEC
|
||||
int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags);
|
||||
#endif
|
||||
int is_cntrl_char(int c);
|
||||
int num_of_digits(int n);
|
||||
void align(char **strp);
|
||||
void null_at(char **data, size_t index);
|
||||
void unsunder(char *str, size_t true_len);
|
||||
void sunder(char *str);
|
||||
#ifndef HAVE_STRCASECMP
|
||||
int nstricmp(const char *s1, const char *s2);
|
||||
#endif
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int nstrnicmp(const char *s1, const char *s2, size_t n);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
const char *revstrstr(const char *haystack, const char *needle,
|
||||
const char *rev_start);
|
||||
const char *revstristr(const char *haystack, const char *needle,
|
||||
const char *rev_start);
|
||||
#endif
|
||||
const char *stristr(const char *haystack, const char *needle);
|
||||
const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *rev_start, int line_pos);
|
||||
void nperror(const char *s);
|
||||
void *nmalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
char *mallocstrcpy(char *dest, const char *src);
|
||||
void new_magicline(void);
|
||||
#ifndef DISABLE_TABCOMP
|
||||
int check_wildcard_match(const char *text, const char *pattern);
|
||||
#endif
|
||||
|
||||
/* Public functions in winio.c */
|
||||
int do_first_line(void);
|
||||
int do_last_line(void);
|
||||
int xpt(const filestruct *fileptr, int index);
|
||||
size_t xplustabs(void);
|
||||
size_t actual_x(const filestruct *fileptr, size_t xplus);
|
||||
size_t strnlenpt(const char *buf, size_t size);
|
||||
size_t strlenpt(const char *buf);
|
||||
void blank_bottombars(void);
|
||||
void blank_bottomwin(void);
|
||||
void blank_edit(void);
|
||||
void blank_statusbar(void);
|
||||
void blank_statusbar_refresh(void);
|
||||
void check_statblank(void);
|
||||
void nanoget_repaint(const char *buf, const char *inputbuf, int x);
|
||||
int nanogetstr(int allowtabs, const char *buf, const char *def,
|
||||
#ifndef NANO_SMALL
|
||||
historyheadtype *history_list,
|
||||
#endif
|
||||
const shortcut *s
|
||||
#ifndef DISABLE_TABCOMP
|
||||
, int *list
|
||||
#endif
|
||||
);
|
||||
void set_modified(void);
|
||||
void titlebar(const char *path);
|
||||
void bottombars(const shortcut *s);
|
||||
void onekey(const char *keystroke, const char *desc, int len);
|
||||
#ifndef NDEBUG
|
||||
int check_linenumbers(const filestruct *fileptr);
|
||||
#endif
|
||||
int get_page_start(int column);
|
||||
void reset_cursor(void);
|
||||
void add_marked_sameline(int begin, int end, filestruct *fileptr, int y,
|
||||
int virt_cur_x, int this_page);
|
||||
void edit_add(const filestruct *fileptr, int yval, int start
|
||||
#ifndef NANO_SMALL
|
||||
, int virt_mark_beginx, int virt_cur_x
|
||||
#endif
|
||||
);
|
||||
void update_line(filestruct *fileptr, int index);
|
||||
void update_cursor(void);
|
||||
void center_cursor(void);
|
||||
void edit_refresh(void);
|
||||
void edit_refresh_clearok(void);
|
||||
void edit_update(filestruct *fileptr, topmidbotnone location);
|
||||
int statusq(int tabs, const shortcut *s, const char *def,
|
||||
#ifndef NANO_SMALL
|
||||
historyheadtype *history_list,
|
||||
#endif
|
||||
const char *msg, ...);
|
||||
int do_yesno(int all, int leavecursor, const char *msg, ...);
|
||||
int total_refresh(void);
|
||||
void display_main_list(void);
|
||||
void statusbar(const char *msg, ...);
|
||||
int do_cursorpos(int constant);
|
||||
int do_cursorpos_void(void);
|
||||
int line_len(const char *ptr);
|
||||
int do_help(void);
|
||||
int keypad_on(WINDOW *win, int newval);
|
||||
void do_replace_highlight(int highlight_flag, const char *word);
|
||||
void fix_editbot(void);
|
||||
#ifdef DEBUG
|
||||
void dump_buffer(const filestruct *inptr);
|
||||
void dump_buffer_reverse(void);
|
||||
#endif
|
||||
#ifdef NANO_EXTRA
|
||||
void do_credits(void);
|
||||
#endif
|
||||
687
rcfile.c
687
rcfile.c
@@ -1,687 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* rcfile.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <pwd.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
|
||||
const static rcoption rcopts[] = {
|
||||
#ifndef NANO_SMALL
|
||||
{"autoindent", AUTOINDENT},
|
||||
{"backup", BACKUP_FILE},
|
||||
#endif
|
||||
{"const", CONSTUPDATE},
|
||||
#ifndef NANO_SMALL
|
||||
{"cut", CUT_TO_END},
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
{"fill", 0},
|
||||
#endif
|
||||
{"keypad", ALT_KEYPAD},
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
{"mouse", USE_MOUSE},
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
{"multibuffer", MULTIBUFFER},
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
{"noconvert", NO_CONVERT},
|
||||
#endif
|
||||
{"nofollow", NOFOLLOW_SYMLINKS},
|
||||
{"nohelp", NO_HELP},
|
||||
#ifndef DISABLE_WRAPPING
|
||||
{"nowrap", NO_WRAP},
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
{"operatingdir", 0},
|
||||
#endif
|
||||
{"preserve", PRESERVE},
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
{"quotestr", 0},
|
||||
#endif
|
||||
#ifdef HAVE_REGEX_H
|
||||
{"regexp", USE_REGEXP},
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
{"smooth", SMOOTHSCROLL},
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
{"speller", 0},
|
||||
#endif
|
||||
{"suspend", SUSPEND},
|
||||
{"tabsize", 0},
|
||||
{"tempfile", TEMP_OPT},
|
||||
{"view", VIEW_MODE},
|
||||
{"historylog", HISTORYLOG},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
static int errors = 0;
|
||||
static int lineno = 0;
|
||||
static char *nanorc;
|
||||
|
||||
/* We have an error in some part of the rcfile; put it on stderr and
|
||||
make the user hit return to continue starting up nano. */
|
||||
void rcfile_error(const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
if (lineno > 0)
|
||||
fprintf(stderr, _("Error in %s on line %d: "), nanorc, lineno);
|
||||
|
||||
va_start(ap, msg);
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, _("\nPress return to continue starting nano\n"));
|
||||
|
||||
while (getchar() != '\n');
|
||||
}
|
||||
|
||||
/* Just print the error (one of many, perhaps) but don't abort, yet. */
|
||||
void rcfile_msg(const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (!errors) {
|
||||
errors = 1;
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
va_start(ap, msg);
|
||||
vfprintf(stderr, msg, ap);
|
||||
va_end(ap);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
/* Parse the next word from the string. Returns NULL if we hit EOL. */
|
||||
char *parse_next_word(char *ptr)
|
||||
{
|
||||
while (*ptr != ' ' && *ptr != '\t' && *ptr != '\n' && *ptr != '\0')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\0')
|
||||
return NULL;
|
||||
|
||||
/* Null terminate and advance ptr */
|
||||
*ptr++ = 0;
|
||||
|
||||
while (*ptr == ' ' || *ptr == '\t')
|
||||
ptr++;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* The keywords operatingdir, fill, tabsize, speller, and quotestr take
|
||||
* an argument when set. Among these, operatingdir, speller, and
|
||||
* quotestr have to allow tabs and spaces in the argument. Thus, if the
|
||||
* next word starts with a ", we say it ends with the last " of the line.
|
||||
* Otherwise, the word is interpreted as usual. That is so the arguments
|
||||
* can contain "s too. */
|
||||
char *parse_argument(char *ptr)
|
||||
{
|
||||
const char *ptr_bak = ptr;
|
||||
char *last_quote = NULL;
|
||||
|
||||
assert(ptr != NULL);
|
||||
|
||||
if (*ptr != '"')
|
||||
return parse_next_word(ptr);
|
||||
|
||||
do {
|
||||
ptr++;
|
||||
if (*ptr == '"')
|
||||
last_quote = ptr;
|
||||
} while (*ptr != '\n' && *ptr != '\0');
|
||||
|
||||
if (last_quote == NULL) {
|
||||
if (*ptr == '\0')
|
||||
ptr = NULL;
|
||||
else
|
||||
*ptr++ = '\0';
|
||||
rcfile_error(_("argument %s has unterminated \""), ptr_bak);
|
||||
} else {
|
||||
*last_quote = '\0';
|
||||
ptr = last_quote + 1;
|
||||
}
|
||||
if (ptr != NULL)
|
||||
while (*ptr == ' ' || *ptr == '\t')
|
||||
ptr++;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
|
||||
int colortoint(const char *colorname, int *bright)
|
||||
{
|
||||
int mcolor = 0;
|
||||
|
||||
if (colorname == NULL)
|
||||
return -1;
|
||||
|
||||
if (!strncasecmp(colorname, "bright", 6)) {
|
||||
*bright = 1;
|
||||
colorname += 6;
|
||||
}
|
||||
|
||||
if (!strcasecmp(colorname, "green"))
|
||||
mcolor = COLOR_GREEN;
|
||||
else if (!strcasecmp(colorname, "red"))
|
||||
mcolor = COLOR_RED;
|
||||
else if (!strcasecmp(colorname, "blue"))
|
||||
mcolor = COLOR_BLUE;
|
||||
else if (!strcasecmp(colorname, "white"))
|
||||
mcolor = COLOR_WHITE;
|
||||
else if (!strcasecmp(colorname, "yellow"))
|
||||
mcolor = COLOR_YELLOW;
|
||||
else if (!strcasecmp(colorname, "cyan"))
|
||||
mcolor = COLOR_CYAN;
|
||||
else if (!strcasecmp(colorname, "magenta"))
|
||||
mcolor = COLOR_MAGENTA;
|
||||
else if (!strcasecmp(colorname, "black"))
|
||||
mcolor = COLOR_BLACK;
|
||||
else {
|
||||
rcfile_error(_("color %s not understood.\n"
|
||||
"Valid colors are \"green\", \"red\", \"blue\", \n"
|
||||
"\"white\", \"yellow\", \"cyan\", \"magenta\" and \n"
|
||||
"\"black\", with the optional prefix \"bright\".\n"),
|
||||
colorname);
|
||||
mcolor = -1;
|
||||
}
|
||||
return mcolor;
|
||||
}
|
||||
|
||||
char *parse_next_regex(char *ptr)
|
||||
{
|
||||
while ((*ptr != '"' || (*(ptr + 1) != ' ' && *(ptr + 1) != '\n'))
|
||||
&& *ptr != '\n' && *ptr != '\0')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\0')
|
||||
return NULL;
|
||||
|
||||
/* Null terminate and advance ptr */
|
||||
*ptr++ = '\0';
|
||||
|
||||
while (*ptr == ' ' || *ptr == '\t')
|
||||
ptr++;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* Compile the regular expression regex to preg. Returns FALSE on success,
|
||||
TRUE if the expression is invalid. */
|
||||
int nregcomp(regex_t *preg, const char *regex, int flags)
|
||||
{
|
||||
int rc = regcomp(preg, regex, REG_EXTENDED | flags);
|
||||
|
||||
if (rc != 0) {
|
||||
size_t len = regerror(rc, preg, NULL, 0);
|
||||
char *str = charalloc(len);
|
||||
|
||||
regerror(rc, preg, str, len);
|
||||
rcfile_error(_("Bad regex \"%s\": %s"), regex, str);
|
||||
free(str);
|
||||
}
|
||||
return rc != 0;
|
||||
}
|
||||
|
||||
void parse_syntax(char *ptr)
|
||||
{
|
||||
syntaxtype *tmpsyntax = NULL;
|
||||
const char *fileregptr = NULL, *nameptr = NULL;
|
||||
exttype *endext = NULL;
|
||||
/* The end of the extensions list for this syntax. */
|
||||
|
||||
while (*ptr == ' ')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\n' || *ptr == '\0')
|
||||
return;
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(_("regex strings must begin and end with a \" character\n"));
|
||||
return;
|
||||
}
|
||||
ptr++;
|
||||
|
||||
nameptr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
|
||||
if (ptr == NULL) {
|
||||
rcfile_error(_("Missing syntax name"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (syntaxes == NULL) {
|
||||
syntaxes = (syntaxtype *)nmalloc(sizeof(syntaxtype));
|
||||
tmpsyntax = syntaxes;
|
||||
SET(COLOR_SYNTAX);
|
||||
} else {
|
||||
for (tmpsyntax = syntaxes; tmpsyntax->next != NULL;
|
||||
tmpsyntax = tmpsyntax->next)
|
||||
;
|
||||
tmpsyntax->next = (syntaxtype *)nmalloc(sizeof(syntaxtype));
|
||||
tmpsyntax = tmpsyntax->next;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Adding new syntax after 1st\n");
|
||||
#endif
|
||||
}
|
||||
tmpsyntax->desc = mallocstrcpy(NULL, nameptr);
|
||||
tmpsyntax->color = NULL;
|
||||
tmpsyntax->extensions = NULL;
|
||||
tmpsyntax->next = NULL;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Starting a new syntax type\n");
|
||||
fprintf(stderr, "string val=%s\n", nameptr);
|
||||
#endif
|
||||
|
||||
/* Now load in the extensions to their part of the struct */
|
||||
while (*ptr != '\n' && *ptr != '\0') {
|
||||
exttype *newext;
|
||||
/* The new extension structure. */
|
||||
|
||||
while (*ptr != '"' && *ptr != '\n' && *ptr != '\0')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\n' || *ptr == '\0')
|
||||
return;
|
||||
ptr++;
|
||||
|
||||
fileregptr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
|
||||
newext = (exttype *)nmalloc(sizeof(exttype));
|
||||
if (nregcomp(&newext->val, fileregptr, REG_NOSUB))
|
||||
free(newext);
|
||||
else {
|
||||
if (endext == NULL)
|
||||
tmpsyntax->extensions = newext;
|
||||
else
|
||||
endext->next = newext;
|
||||
endext = newext;
|
||||
endext->next = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse the color stuff into the colorstrings array */
|
||||
void parse_colors(char *ptr)
|
||||
{
|
||||
int fg, bg, bright = 0;
|
||||
int expectend = 0; /* Do we expect an end= line? */
|
||||
char *fgstr;
|
||||
colortype *tmpcolor = NULL;
|
||||
syntaxtype *tmpsyntax = NULL;
|
||||
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
|
||||
if (ptr == NULL) {
|
||||
rcfile_error(_("Missing color name"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (strstr(fgstr, ",")) {
|
||||
strtok(fgstr, ",");
|
||||
bg = colortoint(strtok(NULL, ","), &bright);
|
||||
} else
|
||||
bg = -1;
|
||||
|
||||
fg = colortoint(fgstr, &bright);
|
||||
|
||||
/* Don't try and parse screwed up fg colors */
|
||||
if (fg == -1)
|
||||
return;
|
||||
|
||||
if (syntaxes == NULL) {
|
||||
rcfile_error(_("Cannot add a color directive without a syntax line"));
|
||||
return;
|
||||
}
|
||||
|
||||
for (tmpsyntax = syntaxes; tmpsyntax->next != NULL;
|
||||
tmpsyntax = tmpsyntax->next)
|
||||
;
|
||||
|
||||
/* Now the fun part, start adding regexps to individual strings
|
||||
in the colorstrings array, woo! */
|
||||
|
||||
while (*ptr != '\0') {
|
||||
colortype *newcolor;
|
||||
/* The new color structure. */
|
||||
int cancelled = 0;
|
||||
/* The start expression was bad. */
|
||||
|
||||
while (*ptr == ' ')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\n' || *ptr == '\0')
|
||||
break;
|
||||
|
||||
if (!strncasecmp(ptr, "start=", 6)) {
|
||||
ptr += 6;
|
||||
expectend = 1;
|
||||
}
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(_("regex strings must begin and end with a \" character\n"));
|
||||
ptr = parse_next_regex(ptr);
|
||||
continue;
|
||||
}
|
||||
ptr++;
|
||||
|
||||
newcolor = (colortype *)nmalloc(sizeof(colortype));
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
if (nregcomp(&newcolor->start, fgstr, 0)) {
|
||||
free(newcolor);
|
||||
cancelled = 1;
|
||||
} else {
|
||||
newcolor->fg = fg;
|
||||
newcolor->bg = bg;
|
||||
newcolor->bright = bright;
|
||||
newcolor->next = NULL;
|
||||
newcolor->end = NULL;
|
||||
|
||||
if (tmpsyntax->color == NULL) {
|
||||
tmpsyntax->color = newcolor;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Starting a new colorstring for fg %d bg %d\n",
|
||||
fg, bg);
|
||||
#endif
|
||||
} else {
|
||||
for (tmpcolor = tmpsyntax->color; tmpcolor->next != NULL;
|
||||
tmpcolor = tmpcolor->next)
|
||||
;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Adding new entry for fg %d bg %d\n", fg, bg);
|
||||
#endif
|
||||
tmpcolor->next = newcolor;
|
||||
}
|
||||
}
|
||||
|
||||
if (expectend) {
|
||||
if (ptr == NULL || strncasecmp(ptr, "end=", 4)) {
|
||||
rcfile_error(_
|
||||
("\"start=\" requires a corresponding \"end=\""));
|
||||
return;
|
||||
}
|
||||
|
||||
ptr += 4;
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(_
|
||||
("regex strings must begin and end with a \" character\n"));
|
||||
continue;
|
||||
}
|
||||
ptr++;
|
||||
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
|
||||
/* If the start regex was invalid, skip past the end regex to
|
||||
* stay in sync. */
|
||||
if (cancelled)
|
||||
continue;
|
||||
newcolor->end = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
if (nregcomp(newcolor->end, fgstr, 0)) {
|
||||
free(newcolor->end);
|
||||
newcolor->end = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
/* Parse the RC file, once it has been opened successfully */
|
||||
void parse_rcfile(FILE *rcstream)
|
||||
{
|
||||
char *buf, *ptr, *keyword, *option;
|
||||
int set = 0, i, j;
|
||||
|
||||
buf = charalloc(1024);
|
||||
while (fgets(buf, 1023, rcstream) != 0) {
|
||||
lineno++;
|
||||
ptr = buf;
|
||||
while (*ptr == ' ' || *ptr == '\t')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\n' || *ptr == '\0')
|
||||
continue;
|
||||
|
||||
if (*ptr == '#') {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "%s: Read a comment\n", "parse_rcfile()");
|
||||
#endif
|
||||
continue; /* Skip past commented lines */
|
||||
}
|
||||
|
||||
/* Else skip to the next space */
|
||||
keyword = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
if (ptr == NULL)
|
||||
continue;
|
||||
|
||||
/* Else try to parse the keyword */
|
||||
if (!strcasecmp(keyword, "set"))
|
||||
set = 1;
|
||||
else if (!strcasecmp(keyword, "unset"))
|
||||
set = -1;
|
||||
#ifdef ENABLE_COLOR
|
||||
else if (!strcasecmp(keyword, "syntax"))
|
||||
parse_syntax(ptr);
|
||||
else if (!strcasecmp(keyword, "color"))
|
||||
parse_colors(ptr);
|
||||
#endif /* ENABLE_COLOR */
|
||||
else {
|
||||
rcfile_msg(_("command %s not understood"), keyword);
|
||||
continue;
|
||||
}
|
||||
|
||||
option = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
/* We don't care if ptr == NULL, as it should if using proper syntax */
|
||||
|
||||
if (set != 0) {
|
||||
for (i = 0; rcopts[i].name != NULL; i++) {
|
||||
if (!strcasecmp(option, rcopts[i].name)) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "%s: Parsing option %s\n",
|
||||
"parse_rcfile()", rcopts[i].name);
|
||||
#endif
|
||||
if (set == 1) {
|
||||
if (!strcasecmp(rcopts[i].name, "tabsize")
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
|| !strcasecmp(rcopts[i].name, "operatingdir")
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
|| !strcasecmp(rcopts[i].name, "fill")
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
|| !strcasecmp(rcopts[i].name, "quotestr")
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
|| !strcasecmp(rcopts[i].name, "speller")
|
||||
#endif
|
||||
) {
|
||||
if (*ptr == '\n' || *ptr == '\0') {
|
||||
rcfile_error(_
|
||||
("option %s requires an argument"),
|
||||
rcopts[i].name);
|
||||
continue;
|
||||
}
|
||||
option = ptr;
|
||||
if (*option == '"')
|
||||
option++;
|
||||
ptr = parse_argument(ptr);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "option = %s\n", option);
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
if (!strcasecmp(rcopts[i].name, "operatingdir"))
|
||||
operating_dir = mallocstrcpy(NULL, option);
|
||||
else
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
if (!strcasecmp(rcopts[i].name, "fill")) {
|
||||
char *first_error;
|
||||
|
||||
/* Using strtol() instead of atoi() lets
|
||||
* us accept 0 while checking other
|
||||
* errors. */
|
||||
j = (int)strtol(option, &first_error, 10);
|
||||
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
|
||||
rcfile_error(_("requested fill size %d invalid"),
|
||||
j);
|
||||
else
|
||||
wrap_at = j;
|
||||
} else
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
if (!strcasecmp(rcopts[i].name, "quotestr"))
|
||||
quotestr = mallocstrcpy(NULL, option);
|
||||
else
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
if (!strcasecmp(rcopts[i].name, "speller"))
|
||||
alt_speller = mallocstrcpy(NULL, option);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
char *first_error;
|
||||
|
||||
/* Using strtol instead of atoi lets us
|
||||
* accept 0 while checking other
|
||||
* errors. */
|
||||
j = (int)strtol(option, &first_error, 10);
|
||||
if (errno == ERANGE || *option == '\0' || *first_error != '\0')
|
||||
rcfile_error(_("requested tab size %d invalid"),
|
||||
j);
|
||||
else
|
||||
tabsize = j;
|
||||
}
|
||||
} else
|
||||
SET(rcopts[i].flag);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "set flag %d!\n",
|
||||
rcopts[i].flag);
|
||||
#endif
|
||||
} else {
|
||||
UNSET(rcopts[i].flag);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "unset flag %d!\n",
|
||||
rcopts[i].flag);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
free(buf);
|
||||
if (errors)
|
||||
rcfile_error(_("Errors found in .nanorc file"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* The main rc file function, tries to open the rc file */
|
||||
void do_rcfile(void)
|
||||
{
|
||||
FILE *rcstream;
|
||||
const struct passwd *userage;
|
||||
uid_t euid = geteuid();
|
||||
char *homenv = getenv("HOME");
|
||||
|
||||
#ifdef SYSCONFDIR
|
||||
assert(sizeof(SYSCONFDIR) == strlen(SYSCONFDIR) + 1);
|
||||
nanorc = charalloc(sizeof(SYSCONFDIR) + 7);
|
||||
sprintf(nanorc, "%s/nanorc", SYSCONFDIR);
|
||||
/* Try to open system nanorc */
|
||||
if ((rcstream = fopen(nanorc, "r")) != NULL) {
|
||||
/* Parse it! */
|
||||
parse_rcfile(rcstream);
|
||||
fclose(rcstream);
|
||||
}
|
||||
#endif
|
||||
|
||||
lineno = 0;
|
||||
|
||||
/* Rely on $HOME, fall back on getpwuid() */
|
||||
if (homenv != NULL) {
|
||||
nanorc = charealloc(nanorc, strlen(homenv) + 10);
|
||||
sprintf(nanorc, "%s/.nanorc", homenv);
|
||||
} else {
|
||||
userage = getpwuid(euid);
|
||||
endpwent();
|
||||
|
||||
if (userage == NULL) {
|
||||
rcfile_error(_("I can't find my home directory! Wah!"));
|
||||
SET(NO_RCFILE);
|
||||
} else {
|
||||
nanorc = charealloc(nanorc, strlen(userage->pw_dir) + 9);
|
||||
sprintf(nanorc, "%s/.nanorc", userage->pw_dir);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!ISSET(NO_RCFILE)) {
|
||||
|
||||
#if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING)
|
||||
/* If we've already read $SYSCONFDIR/nanorc (if it's there), we're
|
||||
root, and --disable-wrapping-as-root is used, turn wrapping off */
|
||||
if (euid == 0)
|
||||
SET(NO_WRAP);
|
||||
#endif
|
||||
if ((rcstream = fopen(nanorc, "r")) == NULL) {
|
||||
/* Don't complain about the file not existing */
|
||||
if (errno != ENOENT) {
|
||||
rcfile_error(_("Unable to open ~/.nanorc file, %s"),
|
||||
strerror(errno));
|
||||
SET(NO_RCFILE);
|
||||
}
|
||||
} else {
|
||||
parse_rcfile(rcstream);
|
||||
fclose(rcstream);
|
||||
}
|
||||
}
|
||||
lineno = 0;
|
||||
|
||||
free(nanorc);
|
||||
#ifdef ENABLE_COLOR
|
||||
set_colorpairs();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NANORC */
|
||||
4
src/.cvsignore
Normal file
4
src/.cvsignore
Normal file
@@ -0,0 +1,4 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
nano
|
||||
.deps
|
||||
24
src/Makefile.am
Normal file
24
src/Makefile.am
Normal file
@@ -0,0 +1,24 @@
|
||||
localedir = $(datadir)/locale
|
||||
INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -DSYSCONFDIR=\"$(sysconfdir)\"
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
bin_PROGRAMS = nano
|
||||
nano_SOURCES = chars.c \
|
||||
color.c \
|
||||
cut.c \
|
||||
files.c \
|
||||
global.c \
|
||||
move.c \
|
||||
nano.c \
|
||||
nano.h \
|
||||
proto.h \
|
||||
rcfile.c \
|
||||
search.c \
|
||||
utils.c \
|
||||
winio.c
|
||||
|
||||
nano_LDADD = @GLIB_LIBS@ @LIBINTL@
|
||||
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir) && rm -f rnano && $(LN_S) nano rnano
|
||||
863
src/chars.c
Normal file
863
src/chars.c
Normal file
@@ -0,0 +1,863 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* chars.c *
|
||||
* *
|
||||
* Copyright (C) 2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
#ifdef HAVE_WCHAR_H
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
#ifdef HAVE_WCTYPE_H
|
||||
#include <wctype.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_ISBLANK
|
||||
/* This function is equivalent to isblank(). */
|
||||
bool nisblank(int c)
|
||||
{
|
||||
return isspace(c) && (c == '\t' || !is_cntrl_char(c));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ISWBLANK) && defined(NANO_WIDE)
|
||||
/* This function is equivalent to iswblank(). */
|
||||
bool niswblank(wchar_t wc)
|
||||
{
|
||||
return iswspace(wc) && (wc == '\t' || !is_cntrl_wchar(wc));
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Return TRUE if the value of c is in byte range, and FALSE
|
||||
* otherwise. */
|
||||
bool is_byte(int c)
|
||||
{
|
||||
return ((unsigned int)c == (unsigned char)c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to isalnum() for multibyte characters. */
|
||||
bool is_alnum_mbchar(const char *c)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
wchar_t wc;
|
||||
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
|
||||
|
||||
if (c_mb_len <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
return iswalnum(wc);
|
||||
} else
|
||||
#endif
|
||||
return isalnum((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to isblank() for multibyte characters. */
|
||||
bool is_blank_mbchar(const char *c)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
wchar_t wc;
|
||||
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
|
||||
|
||||
if (c_mb_len <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
return iswblank(wc);
|
||||
} else
|
||||
#endif
|
||||
return isblank((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to iscntrl(), except in that it also
|
||||
* handles control characters with their high bits set. */
|
||||
bool is_cntrl_char(int c)
|
||||
{
|
||||
return (-128 <= c && c < -96) || (0 <= c && c < 32) ||
|
||||
(127 <= c && c < 160);
|
||||
}
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
/* This function is equivalent to iscntrl() for wide characters, except
|
||||
* in that it also handles wide control characters with their high bits
|
||||
* set. */
|
||||
bool is_cntrl_wchar(wchar_t wc)
|
||||
{
|
||||
return (0 <= wc && wc < 32) || (127 <= wc && wc < 160);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to iscntrl() for multibyte characters,
|
||||
* except in that it also handles multibyte control characters with
|
||||
* their high bits set. */
|
||||
bool is_cntrl_mbchar(const char *c)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
wchar_t wc;
|
||||
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
|
||||
|
||||
if (c_mb_len <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
return is_cntrl_wchar(wc);
|
||||
} else
|
||||
#endif
|
||||
return is_cntrl_char((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* This function is equivalent to ispunct() for multibyte characters. */
|
||||
bool is_punct_mbchar(const char *c)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
wchar_t wc;
|
||||
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
|
||||
|
||||
if (c_mb_len <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
return iswpunct(wc);
|
||||
} else
|
||||
#endif
|
||||
return ispunct((unsigned char)*c);
|
||||
}
|
||||
|
||||
/* Return TRUE for a multibyte character found in a word (currently only
|
||||
* an alphanumeric or punctuation character, and only the latter if
|
||||
* allow_punct is TRUE) and FALSE otherwise. */
|
||||
bool is_word_mbchar(const char *c, bool allow_punct)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
return is_alnum_mbchar(c) || (allow_punct ? is_punct_mbchar(c) :
|
||||
FALSE);
|
||||
}
|
||||
|
||||
/* c is a control character. It displays as ^@, ^?, or ^[ch], where ch
|
||||
* is c + 64. We return that character. */
|
||||
char control_rep(char c)
|
||||
{
|
||||
/* Treat newlines embedded in a line as encoded nulls. */
|
||||
if (c == '\n')
|
||||
return '@';
|
||||
else if (c == NANO_CONTROL_8)
|
||||
return '?';
|
||||
else
|
||||
return c + 64;
|
||||
}
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
/* c is a wide control character. It displays as ^@, ^?, or ^[ch],
|
||||
* where ch is c + 64. We return that wide character. */
|
||||
wchar_t control_wrep(wchar_t wc)
|
||||
{
|
||||
/* Treat newlines embedded in a line as encoded nulls. */
|
||||
if (wc == '\n')
|
||||
return '@';
|
||||
else if (wc == NANO_CONTROL_8)
|
||||
return '?';
|
||||
else
|
||||
return wc + 64;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* c is a multibyte control character. It displays as ^@, ^?, or ^[ch],
|
||||
* where ch is c + 64. We return that multibyte character. */
|
||||
char *control_mbrep(const char *c, char *crep, int *crep_len)
|
||||
{
|
||||
assert(c != NULL && crep != NULL && crep_len != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
wchar_t wc;
|
||||
|
||||
if (mbtowc(&wc, c, MB_CUR_MAX) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
*crep_len = wctomb(crep, control_wrep(wc));
|
||||
|
||||
if (*crep_len <= 0) {
|
||||
wctomb(NULL, 0);
|
||||
*crep_len = 0;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
*crep_len = 1;
|
||||
*crep = control_rep(*c);
|
||||
#ifdef NANO_WIDE
|
||||
}
|
||||
#endif
|
||||
|
||||
return crep;
|
||||
}
|
||||
|
||||
/* This function is equivalent to wcwidth() for multibyte characters. */
|
||||
int mbwidth(const char *c)
|
||||
{
|
||||
assert(c != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
wchar_t wc;
|
||||
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX), width;
|
||||
|
||||
if (c_mb_len <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
width = wcwidth(wc);
|
||||
|
||||
if (width == -1)
|
||||
width++;
|
||||
|
||||
return width;
|
||||
} else
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return the maximum width in bytes of a multibyte character. */
|
||||
int mb_cur_max(void)
|
||||
{
|
||||
return
|
||||
#ifdef NANO_WIDE
|
||||
ISSET(USE_UTF8) ? MB_CUR_MAX :
|
||||
#endif
|
||||
1;
|
||||
}
|
||||
|
||||
/* Convert the value in chr to a multibyte character with the same
|
||||
* wide character value as chr, if possible. If the conversion
|
||||
* succeeds, return the (dynamically allocated) multibyte character and
|
||||
* its length. Otherwise, return an undefined (dynamically allocated)
|
||||
* multibyte character and a length of zero. */
|
||||
char *make_mbchar(int chr, int *chr_mb_len)
|
||||
{
|
||||
char *chr_mb;
|
||||
|
||||
assert(chr_mb_len != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
chr_mb = charalloc(MB_CUR_MAX);
|
||||
*chr_mb_len = wctomb(chr_mb, chr);
|
||||
|
||||
if (*chr_mb_len <= 0) {
|
||||
wctomb(NULL, 0);
|
||||
*chr_mb_len = 0;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
*chr_mb_len = 1;
|
||||
chr_mb = mallocstrncpy(NULL, (char *)&chr, 1);
|
||||
#ifdef NANO_WIDE
|
||||
}
|
||||
#endif
|
||||
|
||||
return chr_mb;
|
||||
}
|
||||
|
||||
/* Parse a multibyte character from buf. Return the number of bytes
|
||||
* used. If chr isn't NULL, store the multibyte character in it. If
|
||||
* bad_chr isn't NULL, set it to TRUE if we have a bad multibyte
|
||||
* character. If col isn't NULL, store the new display width in it. If
|
||||
* *str is '\t', we expect col to have the current display width. */
|
||||
int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
|
||||
*col)
|
||||
{
|
||||
int buf_mb_len;
|
||||
|
||||
assert(buf != NULL);
|
||||
|
||||
if (bad_chr != NULL)
|
||||
*bad_chr = FALSE;
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
/* Get the number of bytes in the multibyte character. */
|
||||
buf_mb_len = mblen(buf, MB_CUR_MAX);
|
||||
|
||||
/* If buf contains a null byte or an invalid multibyte
|
||||
* character, set bad_chr to TRUE (if it contains the latter)
|
||||
* and interpret buf's first byte. */
|
||||
if (buf_mb_len <= 0) {
|
||||
mblen(NULL, 0);
|
||||
if (buf_mb_len < 0 && bad_chr != NULL)
|
||||
*bad_chr = TRUE;
|
||||
buf_mb_len = 1;
|
||||
}
|
||||
|
||||
/* Save the multibyte character in chr. */
|
||||
if (chr != NULL) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < buf_mb_len; i++)
|
||||
chr[i] = buf[i];
|
||||
}
|
||||
|
||||
/* Save the column width of the wide character in col. */
|
||||
if (col != NULL) {
|
||||
/* If we have a tab, get its width in columns using the
|
||||
* current value of col. */
|
||||
if (*buf == '\t')
|
||||
*col += tabsize - *col % tabsize;
|
||||
/* If we have a control character, get its width using one
|
||||
* column for the "^" that will be displayed in front of it,
|
||||
* and the width in columns of its visible equivalent as
|
||||
* returned by control_mbrep(). */
|
||||
else if (is_cntrl_mbchar(buf)) {
|
||||
char *ctrl_buf_mb = charalloc(MB_CUR_MAX);
|
||||
int ctrl_buf_mb_len;
|
||||
|
||||
(*col)++;
|
||||
|
||||
ctrl_buf_mb = control_mbrep(buf, ctrl_buf_mb,
|
||||
&ctrl_buf_mb_len);
|
||||
|
||||
*col += mbwidth(ctrl_buf_mb);
|
||||
|
||||
free(ctrl_buf_mb);
|
||||
/* If we have a normal character, get its width in columns
|
||||
* normally. */
|
||||
} else
|
||||
*col += mbwidth(buf);
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
/* Get the number of bytes in the byte character. */
|
||||
buf_mb_len = 1;
|
||||
|
||||
/* Save the byte character in chr. */
|
||||
if (chr != NULL)
|
||||
*chr = *buf;
|
||||
|
||||
if (col != NULL) {
|
||||
/* If we have a tab, get its width in columns using the
|
||||
* current value of col. */
|
||||
if (*buf == '\t')
|
||||
*col += tabsize - *col % tabsize;
|
||||
/* If we have a control character, it's two columns wide:
|
||||
* one column for the "^" that will be displayed in front of
|
||||
* it, and one column for its visible equivalent as returned
|
||||
* by control_mbrep(). */
|
||||
else if (is_cntrl_char((unsigned char)*buf))
|
||||
*col += 2;
|
||||
/* If we have a normal character, it's one column wide. */
|
||||
else
|
||||
(*col)++;
|
||||
}
|
||||
#ifdef NANO_WIDE
|
||||
}
|
||||
#endif
|
||||
|
||||
return buf_mb_len;
|
||||
}
|
||||
|
||||
/* Return the index in buf of the beginning of the multibyte character
|
||||
* before the one at pos. */
|
||||
size_t move_mbleft(const char *buf, size_t pos)
|
||||
{
|
||||
size_t pos_prev = pos;
|
||||
|
||||
assert(buf != NULL && pos <= strlen(buf));
|
||||
|
||||
/* There is no library function to move backward one multibyte
|
||||
* character. Here is the naive, O(pos) way to do it. */
|
||||
while (TRUE) {
|
||||
int buf_mb_len = parse_mbchar(buf + pos - pos_prev, NULL, NULL,
|
||||
NULL);
|
||||
|
||||
if (pos_prev <= (size_t)buf_mb_len)
|
||||
break;
|
||||
|
||||
pos_prev -= buf_mb_len;
|
||||
}
|
||||
|
||||
return pos - pos_prev;
|
||||
}
|
||||
|
||||
/* Return the index in buf of the beginning of the multibyte character
|
||||
* after the one at pos. */
|
||||
size_t move_mbright(const char *buf, size_t pos)
|
||||
{
|
||||
return pos + parse_mbchar(buf + pos, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
/* This function is equivalent to strcasecmp(). */
|
||||
int nstrcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
return strncasecmp(s1, s2, (size_t)-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to strcasecmp() for multibyte strings. */
|
||||
int mbstrcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
return mbstrncasecmp(s1, s2, (size_t)-1);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
/* This function is equivalent to strncasecmp(). */
|
||||
int nstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
for (; n > 0 && *s1 != '\0' && *s2 != '\0'; n--, s1++, s2++) {
|
||||
if (tolower(*s1) != tolower(*s2))
|
||||
break;
|
||||
}
|
||||
|
||||
if (n > 0)
|
||||
return tolower(*s1) - tolower(*s2);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to strncasecmp() for multibyte
|
||||
* strings. */
|
||||
int mbstrncasecmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
char *s1_mb = charalloc(MB_CUR_MAX);
|
||||
char *s2_mb = charalloc(MB_CUR_MAX);
|
||||
wchar_t ws1, ws2;
|
||||
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
|
||||
while (n > 0 && *s1 != '\0' && *s2 != '\0') {
|
||||
bool bad_s1_mb = FALSE, bad_s2_mb = FALSE;
|
||||
int s1_mb_len, s2_mb_len;
|
||||
|
||||
s1_mb_len = parse_mbchar(s1, s1_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&ws1, s1_mb, s1_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
ws1 = (unsigned char)*s1_mb;
|
||||
bad_s1_mb = TRUE;
|
||||
}
|
||||
|
||||
s2_mb_len = parse_mbchar(s2, s2_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&ws2, s2_mb, s2_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
ws2 = (unsigned char)*s2_mb;
|
||||
bad_s2_mb = TRUE;
|
||||
}
|
||||
|
||||
if (n == 0 || bad_s1_mb != bad_s2_mb ||
|
||||
towlower(ws1) != towlower(ws2))
|
||||
break;
|
||||
|
||||
s1 += s1_mb_len;
|
||||
s2 += s2_mb_len;
|
||||
n--;
|
||||
}
|
||||
|
||||
free(s1_mb);
|
||||
free(s2_mb);
|
||||
|
||||
return towlower(ws1) - towlower(ws2);
|
||||
} else
|
||||
#endif
|
||||
return strncasecmp(s1, s2, n);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRCASESTR
|
||||
/* This function is equivalent to strcasestr(). It was adapted from
|
||||
* mutt's mutt_stristr() function. */
|
||||
const char *nstrcasestr(const char *haystack, const char *needle)
|
||||
{
|
||||
assert(haystack != NULL && needle != NULL);
|
||||
|
||||
for (; *haystack != '\0'; haystack++) {
|
||||
const char *r = haystack, *q = needle;
|
||||
|
||||
for (; tolower(*r) == tolower(*q) && *q != '\0'; r++, q++)
|
||||
;
|
||||
|
||||
if (*q == '\0')
|
||||
return haystack;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to strcasestr() for multibyte strings. */
|
||||
const char *mbstrcasestr(const char *haystack, const char *needle)
|
||||
{
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
char *r_mb = charalloc(MB_CUR_MAX);
|
||||
char *q_mb = charalloc(MB_CUR_MAX);
|
||||
wchar_t wr, wq;
|
||||
bool found_needle = FALSE;
|
||||
|
||||
assert(haystack != NULL && needle != NULL);
|
||||
|
||||
while (*haystack != '\0') {
|
||||
const char *r = haystack, *q = needle;
|
||||
int r_mb_len, q_mb_len;
|
||||
|
||||
while (*q != '\0') {
|
||||
bool bad_r_mb = FALSE, bad_q_mb = FALSE;
|
||||
|
||||
r_mb_len = parse_mbchar(r, r_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&wr, r_mb, r_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wr = (unsigned char)*r;
|
||||
bad_r_mb = TRUE;
|
||||
}
|
||||
|
||||
q_mb_len = parse_mbchar(q, q_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&wq, q_mb, q_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wq = (unsigned char)*q;
|
||||
bad_q_mb = TRUE;
|
||||
}
|
||||
|
||||
if (bad_r_mb != bad_q_mb ||
|
||||
towlower(wr) != towlower(wq))
|
||||
break;
|
||||
|
||||
r += r_mb_len;
|
||||
q += q_mb_len;
|
||||
}
|
||||
|
||||
if (*q == '\0') {
|
||||
found_needle = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
haystack += move_mbright(haystack, 0);
|
||||
}
|
||||
|
||||
free(r_mb);
|
||||
free(q_mb);
|
||||
|
||||
return found_needle ? haystack : NULL;
|
||||
} else
|
||||
#endif
|
||||
return strcasestr(haystack, needle);
|
||||
}
|
||||
|
||||
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
||||
/* This function is equivalent to strstr(), except in that it scans the
|
||||
* string in reverse, starting at rev_start. */
|
||||
const char *revstrstr(const char *haystack, const char *needle, const
|
||||
char *rev_start)
|
||||
{
|
||||
assert(haystack != NULL && needle != NULL && rev_start != NULL);
|
||||
|
||||
for (; rev_start >= haystack; rev_start--) {
|
||||
const char *r, *q;
|
||||
|
||||
for (r = rev_start, q = needle; *r == *q && *q != '\0'; r++, q++)
|
||||
;
|
||||
|
||||
if (*q == '\0')
|
||||
return rev_start;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif /* !NANO_SMALL || !DISABLE_TABCOMP */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* This function is equivalent to strcasestr(), except in that it scans
|
||||
* the string in reverse, starting at rev_start. */
|
||||
const char *revstrcasestr(const char *haystack, const char *needle,
|
||||
const char *rev_start)
|
||||
{
|
||||
assert(haystack != NULL && needle != NULL && rev_start != NULL);
|
||||
|
||||
for (; rev_start >= haystack; rev_start--) {
|
||||
const char *r = rev_start, *q = needle;
|
||||
|
||||
for (; tolower(*r) == tolower(*q) && *q != '\0'; r++, q++)
|
||||
;
|
||||
|
||||
if (*q == '\0')
|
||||
return rev_start;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* This function is equivalent to strcasestr() for multibyte strings,
|
||||
* except in that it scans the string in reverse, starting at
|
||||
* rev_start. */
|
||||
const char *mbrevstrcasestr(const char *haystack, const char *needle,
|
||||
const char *rev_start)
|
||||
{
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
char *r_mb = charalloc(MB_CUR_MAX);
|
||||
char *q_mb = charalloc(MB_CUR_MAX);
|
||||
wchar_t wr, wq;
|
||||
bool begin_line = FALSE, found_needle = FALSE;
|
||||
|
||||
assert(haystack != NULL && needle != NULL && rev_start != NULL);
|
||||
|
||||
while (!begin_line) {
|
||||
const char *r = rev_start, *q = needle;
|
||||
int r_mb_len, q_mb_len;
|
||||
|
||||
while (*q != '\0') {
|
||||
bool bad_r_mb = FALSE, bad_q_mb = FALSE;
|
||||
|
||||
r_mb_len = parse_mbchar(r, r_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&wr, r_mb, r_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wr = (unsigned char)*r;
|
||||
bad_r_mb = TRUE;
|
||||
}
|
||||
|
||||
q_mb_len = parse_mbchar(q, q_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&wq, q_mb, q_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wq = (unsigned char)*q;
|
||||
bad_q_mb = TRUE;
|
||||
}
|
||||
|
||||
if (bad_r_mb != bad_q_mb ||
|
||||
towlower(wr) != towlower(wq))
|
||||
break;
|
||||
|
||||
r += r_mb_len;
|
||||
q += q_mb_len;
|
||||
}
|
||||
|
||||
if (*q == '\0') {
|
||||
found_needle = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (rev_start == haystack)
|
||||
begin_line = TRUE;
|
||||
else
|
||||
rev_start = haystack + move_mbleft(haystack, rev_start -
|
||||
haystack);
|
||||
}
|
||||
|
||||
free(r_mb);
|
||||
free(q_mb);
|
||||
|
||||
return found_needle ? rev_start : NULL;
|
||||
} else
|
||||
#endif
|
||||
return revstrcasestr(haystack, needle, rev_start);
|
||||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* This function is equivalent to strlen() for multibyte strings. */
|
||||
size_t mbstrlen(const char *s)
|
||||
{
|
||||
return mbstrnlen(s, (size_t)-1);
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRNLEN
|
||||
/* This function is equivalent to strnlen(). */
|
||||
size_t nstrnlen(const char *s, size_t maxlen)
|
||||
{
|
||||
size_t n = 0;
|
||||
|
||||
assert(s != NULL);
|
||||
|
||||
for (; maxlen > 0 && *s != '\0'; maxlen--, n++, s++)
|
||||
;
|
||||
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This function is equivalent to strnlen() for multibyte strings. */
|
||||
size_t mbstrnlen(const char *s, size_t maxlen)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
size_t n = 0;
|
||||
int s_mb_len;
|
||||
|
||||
while (*s != '\0') {
|
||||
s_mb_len = parse_mbchar(s, NULL, NULL, NULL);
|
||||
|
||||
if (maxlen == 0)
|
||||
break;
|
||||
|
||||
maxlen--;
|
||||
s += s_mb_len;
|
||||
n++;
|
||||
}
|
||||
|
||||
return n;
|
||||
} else
|
||||
#endif
|
||||
return strnlen(s, maxlen);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
#ifdef ENABLE_NANORC
|
||||
/* Return TRUE if the string s contains one or more blank characters,
|
||||
* and FALSE otherwise. */
|
||||
bool has_blank_chars(const char *s)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
for (; *s != '\0'; s++) {
|
||||
if (isblank(*s))
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Return TRUE if the multibyte string s contains one or more blank
|
||||
* multibyte characters, and FALSE otherwise. */
|
||||
bool has_blank_mbchars(const char *s)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
char *chr_mb = charalloc(MB_CUR_MAX);
|
||||
bool retval = FALSE;
|
||||
|
||||
while (*s != '\0') {
|
||||
int chr_mb_len;
|
||||
|
||||
chr_mb_len = parse_mbchar(s, chr_mb, NULL, NULL);
|
||||
|
||||
if (is_blank_mbchar(chr_mb)) {
|
||||
retval = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
s += chr_mb_len;
|
||||
}
|
||||
|
||||
free(chr_mb);
|
||||
|
||||
return retval;
|
||||
} else
|
||||
#endif
|
||||
return has_blank_chars(s);
|
||||
}
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
/* This function is equivalent to strchr() for multibyte strings. */
|
||||
char *mbstrchr(const char *s, char *c)
|
||||
{
|
||||
assert(s != NULL && c != NULL);
|
||||
|
||||
#ifdef NANO_WIDE
|
||||
if (ISSET(USE_UTF8)) {
|
||||
char *s_mb = charalloc(MB_CUR_MAX);
|
||||
const char *q = s;
|
||||
wchar_t ws, wc;
|
||||
int c_mb_len = mbtowc(&wc, c, MB_CUR_MAX);
|
||||
|
||||
if (c_mb_len <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
wc = (unsigned char)*c;
|
||||
}
|
||||
|
||||
while (*s != '\0') {
|
||||
int s_mb_len = parse_mbchar(s, s_mb, NULL, NULL);
|
||||
|
||||
if (mbtowc(&ws, s_mb, s_mb_len) <= 0) {
|
||||
mbtowc(NULL, NULL, 0);
|
||||
ws = (unsigned char)*s;
|
||||
}
|
||||
|
||||
if (ws == wc)
|
||||
break;
|
||||
|
||||
s += s_mb_len;
|
||||
q += s_mb_len;
|
||||
}
|
||||
|
||||
free(s_mb);
|
||||
|
||||
if (ws != wc)
|
||||
q = NULL;
|
||||
|
||||
return (char *)q;
|
||||
} else
|
||||
#endif
|
||||
return strchr(s, *c);
|
||||
}
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
/* Check if the string s is a valid multibyte string. Return TRUE if it
|
||||
* is, and FALSE otherwise. */
|
||||
bool is_valid_mbstring(const char *s)
|
||||
{
|
||||
assert(s != NULL);
|
||||
|
||||
return
|
||||
#ifdef NANO_WIDE
|
||||
ISSET(USE_UTF8) ?
|
||||
(mbstowcs(NULL, s, 0) != (size_t)-1) :
|
||||
#endif
|
||||
|
||||
TRUE;
|
||||
}
|
||||
#endif /* ENABLE_NANORC */
|
||||
@@ -2,34 +2,34 @@
|
||||
/**************************************************************************
|
||||
* color.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
|
||||
@@ -39,21 +39,21 @@ void set_colorpairs(void)
|
||||
{
|
||||
const syntaxtype *this_syntax = syntaxes;
|
||||
|
||||
for(; this_syntax != NULL; this_syntax = this_syntax->next) {
|
||||
for (; this_syntax != NULL; this_syntax = this_syntax->next) {
|
||||
colortype *this_color = this_syntax->color;
|
||||
int color_pair = 1;
|
||||
|
||||
for(; this_color != NULL; this_color = this_color->next) {
|
||||
for (; this_color != NULL; this_color = this_color->next) {
|
||||
const colortype *beforenow = this_syntax->color;
|
||||
|
||||
for(; beforenow != NULL && beforenow != this_color &&
|
||||
(beforenow->fg != this_color->fg ||
|
||||
beforenow->bg != this_color->bg ||
|
||||
beforenow->bright != this_color->bright);
|
||||
beforenow = beforenow->next)
|
||||
for (; beforenow != this_color &&
|
||||
(beforenow->fg != this_color->fg ||
|
||||
beforenow->bg != this_color->bg ||
|
||||
beforenow->bright != this_color->bright);
|
||||
beforenow = beforenow->next)
|
||||
;
|
||||
|
||||
if (beforenow != NULL && beforenow != this_color)
|
||||
if (beforenow != this_color)
|
||||
this_color->pairnum = beforenow->pairnum;
|
||||
else {
|
||||
this_color->pairnum = color_pair;
|
||||
@@ -68,14 +68,14 @@ void do_colorinit(void)
|
||||
if (has_colors()) {
|
||||
const colortype *tmpcolor = NULL;
|
||||
#ifdef HAVE_USE_DEFAULT_COLORS
|
||||
int defok;
|
||||
bool defok;
|
||||
#endif
|
||||
|
||||
start_color();
|
||||
/* Add in colors, if available */
|
||||
|
||||
/* Add in colors, if available. */
|
||||
#ifdef HAVE_USE_DEFAULT_COLORS
|
||||
defok = use_default_colors() != ERR;
|
||||
defok = (use_default_colors() != ERR);
|
||||
#endif
|
||||
|
||||
for (tmpcolor = colorstrings; tmpcolor != NULL;
|
||||
@@ -91,8 +91,8 @@ void do_colorinit(void)
|
||||
init_pair(tmpcolor->pairnum, tmpcolor->fg, background);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Running %s with fg = %d and bg = %d\n",
|
||||
"init_pair()", tmpcolor->fg, tmpcolor->bg);
|
||||
fprintf(stderr, "init_pair(): fg = %d, bg = %d\n",
|
||||
tmpcolor->fg, tmpcolor->bg);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -104,12 +104,13 @@ void update_color(void)
|
||||
const syntaxtype *tmpsyntax;
|
||||
|
||||
colorstrings = NULL;
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL; tmpsyntax = tmpsyntax->next) {
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
const exttype *e;
|
||||
|
||||
for (e = tmpsyntax->extensions; e != NULL; e = e->next) {
|
||||
/* Set colorstrings if we matched the extension regex */
|
||||
if (!regexec(&e->val, filename, 0, NULL, 0))
|
||||
/* Set colorstrings if we matched the extension regex. */
|
||||
if (regexec(&e->val, filename, 0, NULL, 0) == 0)
|
||||
colorstrings = tmpsyntax->color;
|
||||
|
||||
if (colorstrings != NULL)
|
||||
@@ -117,11 +118,11 @@ void update_color(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* if we haven't found a match, use the override string */
|
||||
/* If we haven't found a match, use the override string. */
|
||||
if (colorstrings == NULL && syntaxstr != NULL) {
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
if (!strcasecmp(tmpsyntax->desc, syntaxstr))
|
||||
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
|
||||
tmpsyntax = tmpsyntax->next) {
|
||||
if (mbstrcasecmp(tmpsyntax->desc, syntaxstr) == 0)
|
||||
colorstrings = tmpsyntax->color;
|
||||
}
|
||||
}
|
||||
194
src/cut.c
Normal file
194
src/cut.c
Normal file
@@ -0,0 +1,194 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* cut.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
|
||||
static bool keep_cutbuffer = FALSE;
|
||||
/* Should we keep the contents of the cutbuffer? */
|
||||
static filestruct *cutbottom = NULL;
|
||||
/* Pointer to end of cutbuffer. */
|
||||
|
||||
void cutbuffer_reset(void)
|
||||
{
|
||||
keep_cutbuffer = FALSE;
|
||||
}
|
||||
|
||||
/* If we're not on the magicline, move all the text of the current line,
|
||||
* plus the newline at the end, to the cutbuffer, and set the current
|
||||
* place we want to where the line used to start. */
|
||||
void cut_line(void)
|
||||
{
|
||||
if (current->next != NULL) {
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, current, 0,
|
||||
current->next, 0);
|
||||
placewewant = xplustabs();
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Move all currently marked text to the cutbuffer, and set the current
|
||||
* place we want to where the text used to start. */
|
||||
void cut_marked(void)
|
||||
{
|
||||
filestruct *top, *bot;
|
||||
size_t top_x, bot_x;
|
||||
|
||||
mark_order((const filestruct **)&top, &top_x,
|
||||
(const filestruct **)&bot, &bot_x, NULL);
|
||||
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, top, top_x, bot, bot_x);
|
||||
placewewant = xplustabs();
|
||||
}
|
||||
|
||||
/* If we're not at the end of the current line, move all the text from
|
||||
* the current cursor position to the end of the current line,
|
||||
* not counting the newline at the end, to the cutbuffer. If we are,
|
||||
* and we're not on the magicline, move the newline at the end to the
|
||||
* cutbuffer, and set the current place we want to where the newline
|
||||
* used to be. */
|
||||
void cut_to_eol(void)
|
||||
{
|
||||
size_t data_len = strlen(current->data);
|
||||
|
||||
assert(current_x <= data_len);
|
||||
|
||||
if (current_x < data_len)
|
||||
/* If we're not at the end of the line, move all the text from
|
||||
* the current position up to it, not counting the newline at
|
||||
* the end, to the cutbuffer. */
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, current, current_x,
|
||||
current, data_len);
|
||||
else if (current->next != NULL) {
|
||||
/* If we're at the end of the line, and it isn't the magicline,
|
||||
* move all the text from the current position up to the
|
||||
* beginning of the next line, i.e, the newline at the end, to
|
||||
* the cutbuffer. */
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, current, current_x,
|
||||
current->next, 0);
|
||||
placewewant = xplustabs();
|
||||
}
|
||||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* Move text from the current filestruct into the cutbuffer. */
|
||||
void do_cut_text(void)
|
||||
{
|
||||
assert(current != NULL && current->data != NULL);
|
||||
|
||||
check_statusblank();
|
||||
|
||||
/* If keep_cutbuffer is FALSE and the cutbuffer isn't empty, blow
|
||||
* away the text in the cutbuffer. */
|
||||
if (!keep_cutbuffer && cutbuffer != NULL) {
|
||||
free_filestruct(cutbuffer);
|
||||
cutbuffer = NULL;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Blew away cutbuffer =)\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Set keep_cutbuffer to TRUE, so that the text we're going to move
|
||||
* into the cutbuffer will be added to the text already in the
|
||||
* cutbuffer instead of replacing it. */
|
||||
keep_cutbuffer = TRUE;
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(MARK_ISSET)) {
|
||||
/* If the mark is on, move the marked text to the cutbuffer and
|
||||
* turn the mark off. */
|
||||
cut_marked();
|
||||
UNSET(MARK_ISSET);
|
||||
} else if (ISSET(CUT_TO_END))
|
||||
/* Otherwise, if the CUT_TO_END flag is set, move all text up to
|
||||
* the end of the line into the cutbuffer. */
|
||||
cut_to_eol();
|
||||
else
|
||||
#endif
|
||||
/* Otherwise, move the entire line into the cutbuffer. */
|
||||
cut_line();
|
||||
|
||||
edit_refresh();
|
||||
set_modified();
|
||||
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Cut from the current cursor position to the end of the file. */
|
||||
void do_cut_till_end(void)
|
||||
{
|
||||
assert(current != NULL && current->data != NULL);
|
||||
|
||||
check_statusblank();
|
||||
|
||||
move_to_filestruct(&cutbuffer, &cutbottom, current, current_x,
|
||||
filebot, 0);
|
||||
|
||||
edit_refresh();
|
||||
set_modified();
|
||||
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* Copy text from the cutbuffer into the current filestruct. */
|
||||
void do_uncut_text(void)
|
||||
{
|
||||
assert(current != NULL && current->data != NULL);
|
||||
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
|
||||
check_statusblank();
|
||||
|
||||
/* If the cutbuffer is empty, get out. */
|
||||
if (cutbuffer == NULL)
|
||||
return;
|
||||
|
||||
/* Add a copy of the text in the cutbuffer to the current filestruct
|
||||
* at the current cursor position. */
|
||||
copy_from_filestruct(cutbuffer, cutbottom);
|
||||
|
||||
/* Set the current place we want to where the text from the
|
||||
* cutbuffer ends. */
|
||||
placewewant = xplustabs();
|
||||
|
||||
edit_refresh();
|
||||
set_modified();
|
||||
|
||||
#ifdef DEBUG
|
||||
dump_buffer_reverse();
|
||||
#endif
|
||||
}
|
||||
3002
src/files.c
Normal file
3002
src/files.c
Normal file
File diff suppressed because it is too large
Load Diff
1296
src/global.c
Normal file
1296
src/global.c
Normal file
File diff suppressed because it is too large
Load Diff
291
src/move.c
Normal file
291
src/move.c
Normal file
@@ -0,0 +1,291 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
|
||||
void do_first_line(void)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
current = fileage;
|
||||
placewewant = 0;
|
||||
current_x = 0;
|
||||
if (edittop != fileage || need_vertical_update(pww_save))
|
||||
edit_update(TOP);
|
||||
}
|
||||
|
||||
void do_last_line(void)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
current = filebot;
|
||||
placewewant = 0;
|
||||
current_x = 0;
|
||||
if (edittop->lineno + (editwinrows / 2) != filebot->lineno ||
|
||||
need_vertical_update(pww_save))
|
||||
edit_update(CENTER);
|
||||
}
|
||||
|
||||
void do_home(void)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(SMART_HOME)) {
|
||||
size_t current_x_save = current_x;
|
||||
|
||||
current_x = indent_length(current->data);
|
||||
|
||||
if (current_x == current_x_save ||
|
||||
current->data[current_x] == '\0')
|
||||
current_x = 0;
|
||||
|
||||
placewewant = xplustabs();
|
||||
} else {
|
||||
#endif
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
check_statusblank();
|
||||
if (need_horizontal_update(pww_save))
|
||||
update_line(current, current_x);
|
||||
}
|
||||
|
||||
void do_end(void)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
current_x = strlen(current->data);
|
||||
placewewant = xplustabs();
|
||||
check_statusblank();
|
||||
if (need_horizontal_update(pww_save))
|
||||
update_line(current, current_x);
|
||||
}
|
||||
|
||||
void do_page_up(void)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
const filestruct *current_save = current;
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
|
||||
/* If the first line of the file is onscreen, move current up there
|
||||
* and put the cursor at the beginning of the line. */
|
||||
if (edittop == fileage) {
|
||||
current = fileage;
|
||||
placewewant = 0;
|
||||
} else {
|
||||
edit_scroll(UP, editwinrows - 2);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* If we're in smooth scrolling mode and there's at least one
|
||||
* page of text left, move the current line of the edit window
|
||||
* up a page. */
|
||||
if (ISSET(SMOOTH_SCROLL) && current->lineno > editwinrows - 2) {
|
||||
int i;
|
||||
for (i = 0; i < editwinrows - 2; i++)
|
||||
current = current->prev;
|
||||
}
|
||||
/* If we're not in smooth scrolling mode or there isn't at least
|
||||
* one page of text left, put the cursor at the beginning of the
|
||||
* top line of the edit window, as Pico does. */
|
||||
else {
|
||||
#endif
|
||||
current = edittop;
|
||||
placewewant = 0;
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Get the equivalent x-coordinate of the new line. */
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
/* Update all the lines that need to be updated. */
|
||||
edit_redraw(current_save, pww_save);
|
||||
|
||||
check_statusblank();
|
||||
}
|
||||
|
||||
void do_page_down(void)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
const filestruct *current_save = current;
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
|
||||
/* If the last line of the file is onscreen, move current down
|
||||
* there and put the cursor at the beginning of the line. */
|
||||
if (edittop->lineno + editwinrows > filebot->lineno) {
|
||||
current = filebot;
|
||||
placewewant = 0;
|
||||
} else {
|
||||
edit_scroll(DOWN, editwinrows - 2);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* If we're in smooth scrolling mode and there's at least one
|
||||
* page of text left, move the current line of the edit window
|
||||
* down a page. */
|
||||
if (ISSET(SMOOTH_SCROLL) && current->lineno + editwinrows - 2 <=
|
||||
filebot->lineno) {
|
||||
int i;
|
||||
for (i = 0; i < editwinrows - 2; i++)
|
||||
current = current->next;
|
||||
}
|
||||
/* If we're not in smooth scrolling mode or there isn't at least
|
||||
* one page of text left, put the cursor at the beginning of the
|
||||
* top line of the edit window, as Pico does. */
|
||||
else {
|
||||
#endif
|
||||
current = edittop;
|
||||
placewewant = 0;
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Get the equivalent x-coordinate of the new line. */
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
/* Update all the lines that need to be updated. */
|
||||
edit_redraw(current_save, pww_save);
|
||||
|
||||
check_statusblank();
|
||||
}
|
||||
|
||||
void do_up(void)
|
||||
{
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
check_statusblank();
|
||||
|
||||
if (current->prev == NULL)
|
||||
return;
|
||||
|
||||
assert(current_y == current->lineno - edittop->lineno);
|
||||
|
||||
current = current->prev;
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
/* If we're on the first row of the edit window, scroll up one line
|
||||
* if we're in smooth scrolling mode, or up half a page if we're
|
||||
* not. */
|
||||
if (current_y == 0)
|
||||
edit_scroll(UP,
|
||||
#ifndef NANO_SMALL
|
||||
ISSET(SMOOTH_SCROLL) ? 1 :
|
||||
#endif
|
||||
editwinrows / 2);
|
||||
|
||||
/* Update the lines left alone by edit_scroll(): the line we were on
|
||||
* before and the line we're on now. The former needs to be redrawn
|
||||
* if we're not on the first page, and the latter needs to be
|
||||
* drawn. */
|
||||
if (need_vertical_update(0))
|
||||
update_line(current->next, 0);
|
||||
update_line(current, current_x);
|
||||
}
|
||||
|
||||
void do_down(void)
|
||||
{
|
||||
#ifndef DISABLE_WRAPPING
|
||||
wrap_reset();
|
||||
#endif
|
||||
check_statusblank();
|
||||
|
||||
if (current->next == NULL)
|
||||
return;
|
||||
|
||||
assert(current_y == current->lineno - edittop->lineno);
|
||||
|
||||
current = current->next;
|
||||
current_x = actual_x(current->data, placewewant);
|
||||
|
||||
/* If we're on the last row of the edit window, scroll down one line
|
||||
* if we're in smooth scrolling mode, or down half a page if we're
|
||||
* not. */
|
||||
if (current_y == editwinrows - 1)
|
||||
edit_scroll(DOWN,
|
||||
#ifndef NANO_SMALL
|
||||
ISSET(SMOOTH_SCROLL) ? 1 :
|
||||
#endif
|
||||
editwinrows / 2);
|
||||
|
||||
/* Update the lines left alone by edit_scroll(): the line we were on
|
||||
* before and the line we're on now. The former needs to be redrawn
|
||||
* if we're not on the first page, and the latter needs to be
|
||||
* drawn. */
|
||||
if (need_vertical_update(0))
|
||||
update_line(current->prev, 0);
|
||||
update_line(current, current_x);
|
||||
}
|
||||
|
||||
void do_left(bool allow_update)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
if (current_x > 0)
|
||||
current_x = move_mbleft(current->data, current_x);
|
||||
else if (current != fileage) {
|
||||
do_up();
|
||||
current_x = strlen(current->data);
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
check_statusblank();
|
||||
if (allow_update && need_horizontal_update(pww_save))
|
||||
update_line(current, current_x);
|
||||
}
|
||||
|
||||
void do_left_void(void)
|
||||
{
|
||||
do_left(TRUE);
|
||||
}
|
||||
|
||||
void do_right(bool allow_update)
|
||||
{
|
||||
size_t pww_save = placewewant;
|
||||
assert(current_x <= strlen(current->data));
|
||||
|
||||
if (current->data[current_x] != '\0')
|
||||
current_x = move_mbright(current->data, current_x);
|
||||
else if (current->next != NULL) {
|
||||
do_down();
|
||||
current_x = 0;
|
||||
}
|
||||
placewewant = xplustabs();
|
||||
check_statusblank();
|
||||
if (allow_update && need_horizontal_update(pww_save))
|
||||
update_line(current, current_x);
|
||||
}
|
||||
|
||||
void do_right_void(void)
|
||||
{
|
||||
do_right(TRUE);
|
||||
}
|
||||
4698
src/nano.c
Normal file
4698
src/nano.c
Normal file
File diff suppressed because it is too large
Load Diff
517
src/nano.h
Normal file
517
src/nano.h
Normal file
@@ -0,0 +1,517 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* nano.h *
|
||||
* *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef NANO_H
|
||||
#define NANO_H 1
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef __TANDEM
|
||||
/* Tandem NonStop Kernel. */
|
||||
#include <floss.h>
|
||||
#define NANO_ROOT_UID 65535
|
||||
#else
|
||||
#define NANO_ROOT_UID 0
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
/* Macros for flags. */
|
||||
#define SET(bit) flags |= bit
|
||||
#define UNSET(bit) flags &= ~bit
|
||||
#define ISSET(bit) ((flags & bit) != 0)
|
||||
#define TOGGLE(bit) flags ^= bit
|
||||
|
||||
/* Macros for character allocation, etc. */
|
||||
#define charalloc(howmuch) (char *)nmalloc((howmuch) * sizeof(char))
|
||||
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))
|
||||
#define charmove(dest, src, n) memmove(dest, src, (n) * sizeof(char))
|
||||
#define charset(dest, src, n) memset(dest, src, (n) * sizeof(char))
|
||||
|
||||
/* Other macros. */
|
||||
#ifdef BROKEN_REGEXEC
|
||||
#undef regexec
|
||||
#define regexec(preg, string, nmatch, pmatch, eflags) safe_regexec(preg, string, nmatch, pmatch, eflags)
|
||||
#endif
|
||||
|
||||
/* Set a default value for PATH_MAX if there isn't one. */
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
#ifdef USE_SLANG
|
||||
/* Slang support enabled. */
|
||||
#include <slcurses.h>
|
||||
/* Slang curses emulation brain damage, part 2: Slang doesn't define the
|
||||
* curses equivalents of the Insert or Delete keys. */
|
||||
#define KEY_DC SL_KEY_DELETE
|
||||
#define KEY_IC SL_KEY_IC
|
||||
#elif defined(HAVE_NCURSES_H)
|
||||
#include <ncurses.h>
|
||||
#else /* Uh oh. */
|
||||
#include <curses.h>
|
||||
#endif /* CURSES_H */
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#ifdef HAVE_LIBINTL_H
|
||||
#include <libintl.h>
|
||||
#endif
|
||||
#define _(string) gettext(string)
|
||||
#define P_(singular, plural, number) ngettext(singular, plural, number)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#define P_(singular, plural, number) (number == 1 ? singular : plural)
|
||||
#endif
|
||||
#define gettext_noop(string) (string)
|
||||
#define N_(string) gettext_noop(string)
|
||||
/* Mark a string that will be sent to gettext() later. */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* If no snprintf() or vsnprintf(), use the versions from glib 2.x. */
|
||||
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
|
||||
#include <glib.h>
|
||||
#ifndef HAVE_SNPRINTF
|
||||
#define snprintf g_snprintf
|
||||
#endif
|
||||
#ifndef HAVE_VSNPRINTF
|
||||
#define vsnprintf g_vsnprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* If no isblank(), iswblank(), strcasecmp(), strncasecmp(),
|
||||
* strcasestr(), strnlen(), getdelim(), or getline(), use the versions
|
||||
* we have. */
|
||||
#ifndef HAVE_ISBLANK
|
||||
#define isblank nisblank
|
||||
#endif
|
||||
#ifndef HAVE_ISWBLANK
|
||||
#define iswblank niswblank
|
||||
#endif
|
||||
#ifndef HAVE_STRCASECMP
|
||||
#define strcasecmp nstrcasecmp
|
||||
#endif
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
#define strncasecmp nstrncasecmp
|
||||
#endif
|
||||
#ifndef HAVE_STRCASESTR
|
||||
#define strcasestr nstrcasestr
|
||||
#endif
|
||||
#ifndef HAVE_STRNLEN
|
||||
#define strnlen nstrnlen
|
||||
#endif
|
||||
#ifndef HAVE_GETDELIM
|
||||
#define getdelim ngetdelim
|
||||
#endif
|
||||
#ifndef HAVE_GETLINE
|
||||
#define getline ngetline
|
||||
#endif
|
||||
|
||||
#define VERMSG "GNU nano " VERSION
|
||||
|
||||
/* If we aren't using ncurses, turn the mouse support off, as it's
|
||||
* ncurses-specific. */
|
||||
#ifndef NCURSES_MOUSE_VERSION
|
||||
#define DISABLE_MOUSE 1
|
||||
#endif
|
||||
|
||||
#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
|
||||
#define DISABLE_WRAPJUSTIFY 1
|
||||
#endif
|
||||
|
||||
/* Enumeration types. */
|
||||
typedef enum {
|
||||
NIX_FILE, DOS_FILE, MAC_FILE
|
||||
} file_format;
|
||||
|
||||
typedef enum {
|
||||
UP, DOWN
|
||||
} updown;
|
||||
|
||||
typedef enum {
|
||||
TOP, CENTER, NONE
|
||||
} topmidnone;
|
||||
|
||||
/* Structure types. */
|
||||
typedef struct filestruct {
|
||||
char *data;
|
||||
struct filestruct *next; /* Next node. */
|
||||
struct filestruct *prev; /* Previous node. */
|
||||
ssize_t lineno; /* The line number. */
|
||||
} filestruct;
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
typedef struct openfilestruct {
|
||||
char *filename;
|
||||
#ifndef NANO_SMALL
|
||||
struct stat originalfilestat;
|
||||
#endif
|
||||
struct openfilestruct *next;
|
||||
/* Next node. */
|
||||
struct openfilestruct *prev;
|
||||
/* Previous node. */
|
||||
filestruct *fileage; /* Current file. */
|
||||
filestruct *filebot; /* Current file's last line. */
|
||||
filestruct *edittop; /* Current top of edit window. */
|
||||
filestruct *current; /* Current file's line. */
|
||||
#ifndef NANO_SMALL
|
||||
filestruct *mark_beginbuf;
|
||||
/* Current file's beginning marked
|
||||
* line. */
|
||||
size_t mark_beginx; /* Current file's beginning marked
|
||||
* line's x-coordinate position. */
|
||||
#endif
|
||||
size_t current_x; /* Current file's x-coordinate
|
||||
* position. */
|
||||
size_t placewewant; /* Current file's place we want. */
|
||||
size_t totlines; /* Current file's total number of
|
||||
* lines. */
|
||||
size_t totsize; /* Current file's total size. */
|
||||
unsigned long flags; /* Current file's flags: modification
|
||||
* status (and marking status, if
|
||||
* available). */
|
||||
file_format fmt; /* Current file's format. */
|
||||
} openfilestruct;
|
||||
#endif
|
||||
|
||||
typedef struct partition {
|
||||
filestruct *fileage;
|
||||
filestruct *top_prev;
|
||||
char *top_data;
|
||||
filestruct *filebot;
|
||||
filestruct *bot_next;
|
||||
char *bot_data;
|
||||
} partition;
|
||||
|
||||
typedef struct shortcut {
|
||||
/* Key values that aren't used should be set to NANO_NO_KEY. */
|
||||
int ctrlval; /* Special sentinel key or control key we want
|
||||
* bound. */
|
||||
int metaval; /* Meta key we want bound. */
|
||||
int funcval; /* Function key we want bound. */
|
||||
int miscval; /* Other Meta key we want bound. */
|
||||
bool viewok; /* Is this function legal in view mode? */
|
||||
void (*func)(void); /* Function to call when we catch this key. */
|
||||
const char *desc; /* Description, e.g. "Page Up". */
|
||||
#ifndef DISABLE_HELP
|
||||
const char *help; /* Help file entry text. */
|
||||
#endif
|
||||
struct shortcut *next;
|
||||
} shortcut;
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
typedef struct toggle {
|
||||
int val; /* Sequence to toggle the key. Should only need
|
||||
* one. */
|
||||
const char *desc; /* Description for when toggle is, uh, toggled,
|
||||
* e.g. "Cut to end"; we'll append Enabled or
|
||||
* Disabled. */
|
||||
long flag; /* What flag actually gets toggled. */
|
||||
struct toggle *next;
|
||||
} toggle;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
typedef struct rcoption {
|
||||
const char *name;
|
||||
long flag;
|
||||
} rcoption;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
typedef struct colortype {
|
||||
int fg; /* Foreground color. */
|
||||
int bg; /* Background color. */
|
||||
bool bright; /* Is this color A_BOLD? */
|
||||
int pairnum; /* Color pair number used for this
|
||||
* foreground/background. */
|
||||
regex_t start; /* Start (or all) of the regex
|
||||
* string. */
|
||||
regex_t *end; /* End (if any) of the regex string. */
|
||||
struct colortype *next;
|
||||
} colortype;
|
||||
|
||||
typedef struct exttype {
|
||||
regex_t val; /* The extensions that match this
|
||||
* syntax. */
|
||||
struct exttype *next;
|
||||
} exttype;
|
||||
|
||||
typedef struct syntaxtype {
|
||||
char *desc; /* Name of this syntax type. */
|
||||
exttype *extensions; /* List of extensions that this syntax
|
||||
* applies to. */
|
||||
colortype *color; /* Color struct for this syntax. */
|
||||
struct syntaxtype *next;
|
||||
} syntaxtype;
|
||||
#endif
|
||||
|
||||
/* Bitwise flags so that we can save space (or, more correctly, not
|
||||
* waste it). */
|
||||
#define MODIFIED (1<<0)
|
||||
#define CASE_SENSITIVE (1<<1)
|
||||
#define MARK_ISSET (1<<2)
|
||||
#define CONST_UPDATE (1<<3)
|
||||
#define NO_HELP (1<<4)
|
||||
#define NOFOLLOW_SYMLINKS (1<<5)
|
||||
#define SUSPEND (1<<6)
|
||||
#define NO_WRAP (1<<7)
|
||||
#define AUTOINDENT (1<<8)
|
||||
#define VIEW_MODE (1<<9)
|
||||
#define USE_MOUSE (1<<10)
|
||||
#define USE_REGEXP (1<<11)
|
||||
#define TEMP_FILE (1<<12)
|
||||
#define CUT_TO_END (1<<13)
|
||||
#define BACKWARDS_SEARCH (1<<14)
|
||||
#define MULTIBUFFER (1<<15)
|
||||
#define SMOOTH_SCROLL (1<<16)
|
||||
#define REBIND_DELETE (1<<17)
|
||||
#define NO_CONVERT (1<<18)
|
||||
#define BACKUP_FILE (1<<19)
|
||||
#define NO_RCFILE (1<<20)
|
||||
#define NO_COLOR_SYNTAX (1<<21)
|
||||
#define PRESERVE (1<<22)
|
||||
#define HISTORYLOG (1<<23)
|
||||
#define RESTRICTED (1<<24)
|
||||
#define SMART_HOME (1<<25)
|
||||
#define WHITESPACE_DISPLAY (1<<26)
|
||||
#define MORE_SPACE (1<<27)
|
||||
#define TABS_TO_SPACES (1<<28)
|
||||
#define QUICK_BLANK (1<<29)
|
||||
#define USE_UTF8 (1<<30)
|
||||
|
||||
/* Control key sequences. Changing these would be very, very bad. */
|
||||
#define NANO_CONTROL_SPACE 0
|
||||
#define NANO_CONTROL_A 1
|
||||
#define NANO_CONTROL_B 2
|
||||
#define NANO_CONTROL_C 3
|
||||
#define NANO_CONTROL_D 4
|
||||
#define NANO_CONTROL_E 5
|
||||
#define NANO_CONTROL_F 6
|
||||
#define NANO_CONTROL_G 7
|
||||
#define NANO_CONTROL_H 8
|
||||
#define NANO_CONTROL_I 9
|
||||
#define NANO_CONTROL_J 10
|
||||
#define NANO_CONTROL_K 11
|
||||
#define NANO_CONTROL_L 12
|
||||
#define NANO_CONTROL_M 13
|
||||
#define NANO_CONTROL_N 14
|
||||
#define NANO_CONTROL_O 15
|
||||
#define NANO_CONTROL_P 16
|
||||
#define NANO_CONTROL_Q 17
|
||||
#define NANO_CONTROL_R 18
|
||||
#define NANO_CONTROL_S 19
|
||||
#define NANO_CONTROL_T 20
|
||||
#define NANO_CONTROL_U 21
|
||||
#define NANO_CONTROL_V 22
|
||||
#define NANO_CONTROL_W 23
|
||||
#define NANO_CONTROL_X 24
|
||||
#define NANO_CONTROL_Y 25
|
||||
#define NANO_CONTROL_Z 26
|
||||
#define NANO_CONTROL_3 27
|
||||
#define NANO_CONTROL_4 28
|
||||
#define NANO_CONTROL_5 29
|
||||
#define NANO_CONTROL_6 30
|
||||
#define NANO_CONTROL_7 31
|
||||
#define NANO_CONTROL_8 127
|
||||
|
||||
#define NANO_ALT_9 '9'
|
||||
#define NANO_ALT_0 '0'
|
||||
#define NANO_ALT_A 'a'
|
||||
#define NANO_ALT_B 'b'
|
||||
#define NANO_ALT_C 'c'
|
||||
#define NANO_ALT_D 'd'
|
||||
#define NANO_ALT_E 'e'
|
||||
#define NANO_ALT_F 'f'
|
||||
#define NANO_ALT_G 'g'
|
||||
#define NANO_ALT_H 'h'
|
||||
#define NANO_ALT_I 'i'
|
||||
#define NANO_ALT_J 'j'
|
||||
#define NANO_ALT_K 'k'
|
||||
#define NANO_ALT_L 'l'
|
||||
#define NANO_ALT_M 'm'
|
||||
#define NANO_ALT_N 'n'
|
||||
#define NANO_ALT_O 'o'
|
||||
#define NANO_ALT_P 'p'
|
||||
#define NANO_ALT_Q 'q'
|
||||
#define NANO_ALT_R 'r'
|
||||
#define NANO_ALT_S 's'
|
||||
#define NANO_ALT_T 't'
|
||||
#define NANO_ALT_U 'u'
|
||||
#define NANO_ALT_V 'v'
|
||||
#define NANO_ALT_W 'w'
|
||||
#define NANO_ALT_X 'x'
|
||||
#define NANO_ALT_Y 'y'
|
||||
#define NANO_ALT_Z 'z'
|
||||
#define NANO_ALT_PERIOD '.'
|
||||
#define NANO_ALT_COMMA ','
|
||||
#define NANO_ALT_LPAREN '('
|
||||
#define NANO_ALT_RPAREN ')'
|
||||
#define NANO_ALT_LCARAT '<'
|
||||
#define NANO_ALT_RCARAT '>'
|
||||
#define NANO_ALT_RBRACKET ']'
|
||||
#define NANO_ALT_SPACE ' '
|
||||
|
||||
/* Some semi-changeable keybindings; don't play with these unless you're
|
||||
* sure you know what you're doing. Assume ERR is defined as -1. */
|
||||
|
||||
/* No key at all. */
|
||||
#define NANO_NO_KEY -2
|
||||
|
||||
/* Normal keys. */
|
||||
#define NANO_XON_KEY NANO_CONTROL_Q
|
||||
#define NANO_XOFF_KEY NANO_CONTROL_S
|
||||
#define NANO_CANCEL_KEY NANO_CONTROL_C
|
||||
#define NANO_EXIT_KEY NANO_CONTROL_X
|
||||
#define NANO_EXIT_FKEY KEY_F(2)
|
||||
#define NANO_INSERTFILE_KEY NANO_CONTROL_R
|
||||
#define NANO_INSERTFILE_FKEY KEY_F(5)
|
||||
#define NANO_TOOTHERINSERT_KEY NANO_CONTROL_X
|
||||
#define NANO_WRITEOUT_KEY NANO_CONTROL_O
|
||||
#define NANO_WRITEOUT_FKEY KEY_F(3)
|
||||
#define NANO_GOTOLINE_KEY NANO_CONTROL_7
|
||||
#define NANO_GOTOLINE_FKEY KEY_F(13)
|
||||
#define NANO_GOTOLINE_ALTKEY NANO_ALT_G
|
||||
#define NANO_TOGOTOLINE_KEY NANO_CONTROL_T
|
||||
#define NANO_HELP_KEY NANO_CONTROL_G
|
||||
#define NANO_HELP_FKEY KEY_F(1)
|
||||
#define NANO_WHEREIS_KEY NANO_CONTROL_W
|
||||
#define NANO_WHEREIS_FKEY KEY_F(6)
|
||||
#define NANO_WHEREIS_NEXT_KEY NANO_ALT_W
|
||||
#define NANO_WHEREIS_NEXT_FKEY KEY_F(16)
|
||||
#define NANO_TOOTHERWHEREIS_KEY NANO_CONTROL_T
|
||||
#define NANO_REGEXP_KEY NANO_ALT_R
|
||||
#define NANO_REPLACE_KEY NANO_CONTROL_4
|
||||
#define NANO_REPLACE_FKEY KEY_F(14)
|
||||
#define NANO_ALT_REPLACE_KEY NANO_ALT_R
|
||||
#define NANO_TOOTHERSEARCH_KEY NANO_CONTROL_R
|
||||
#define NANO_PREVPAGE_KEY NANO_CONTROL_Y
|
||||
#define NANO_PREVPAGE_FKEY KEY_F(7)
|
||||
#define NANO_NEXTPAGE_KEY NANO_CONTROL_V
|
||||
#define NANO_NEXTPAGE_FKEY KEY_F(8)
|
||||
#define NANO_CUT_KEY NANO_CONTROL_K
|
||||
#define NANO_CUT_FKEY KEY_F(9)
|
||||
#define NANO_UNCUT_KEY NANO_CONTROL_U
|
||||
#define NANO_UNCUT_FKEY KEY_F(10)
|
||||
#define NANO_CURSORPOS_KEY NANO_CONTROL_C
|
||||
#define NANO_CURSORPOS_FKEY KEY_F(11)
|
||||
#define NANO_SPELL_KEY NANO_CONTROL_T
|
||||
#define NANO_SPELL_FKEY KEY_F(12)
|
||||
#define NANO_FIRSTLINE_KEY NANO_PREVPAGE_KEY
|
||||
#define NANO_FIRSTLINE_FKEY NANO_PREVPAGE_FKEY
|
||||
#define NANO_LASTLINE_KEY NANO_NEXTPAGE_KEY
|
||||
#define NANO_LASTLINE_FKEY NANO_NEXTPAGE_FKEY
|
||||
#define NANO_REFRESH_KEY NANO_CONTROL_L
|
||||
#define NANO_JUSTIFY_KEY NANO_CONTROL_J
|
||||
#define NANO_JUSTIFY_FKEY KEY_F(4)
|
||||
#define NANO_UNJUSTIFY_KEY NANO_UNCUT_KEY /* Same key as uncut. */
|
||||
#define NANO_UNJUSTIFY_FKEY NANO_UNCUT_FKEY /* Same key as uncut. */
|
||||
#define NANO_PREVLINE_KEY NANO_CONTROL_P
|
||||
#define NANO_NEXTLINE_KEY NANO_CONTROL_N
|
||||
#define NANO_FORWARD_KEY NANO_CONTROL_F
|
||||
#define NANO_BACK_KEY NANO_CONTROL_B
|
||||
#define NANO_MARK_KEY NANO_CONTROL_6
|
||||
#define NANO_MARK_ALTKEY NANO_ALT_A
|
||||
#define NANO_MARK_FKEY KEY_F(15)
|
||||
#define NANO_HOME_KEY NANO_CONTROL_A
|
||||
#define NANO_END_KEY NANO_CONTROL_E
|
||||
#define NANO_DELETE_KEY NANO_CONTROL_D
|
||||
#define NANO_BACKSPACE_KEY NANO_CONTROL_H
|
||||
#define NANO_TAB_KEY NANO_CONTROL_I
|
||||
#define NANO_SUSPEND_KEY NANO_CONTROL_Z
|
||||
#define NANO_ENTER_KEY NANO_CONTROL_M
|
||||
#define NANO_TOFILES_KEY NANO_CONTROL_T
|
||||
#define NANO_APPEND_KEY NANO_ALT_A
|
||||
#define NANO_PREPEND_KEY NANO_ALT_P
|
||||
#define NANO_OPENPREV_KEY NANO_ALT_LCARAT
|
||||
#define NANO_OPENNEXT_KEY NANO_ALT_RCARAT
|
||||
#define NANO_OPENPREV_ALTKEY NANO_ALT_COMMA
|
||||
#define NANO_OPENNEXT_ALTKEY NANO_ALT_PERIOD
|
||||
#define NANO_BRACKET_KEY NANO_ALT_RBRACKET
|
||||
#define NANO_NEXTWORD_KEY NANO_CONTROL_SPACE
|
||||
#define NANO_PREVWORD_KEY NANO_ALT_SPACE
|
||||
#define NANO_WORDCOUNT_KEY NANO_ALT_D
|
||||
#define NANO_CUTTILLEND_KEY NANO_CONTROL_X
|
||||
#define NANO_CUTTILLEND_ALTKEY NANO_ALT_T
|
||||
#define NANO_PARABEGIN_KEY NANO_CONTROL_W
|
||||
#define NANO_PARABEGIN_ALTKEY1 NANO_ALT_LPAREN
|
||||
#define NANO_PARABEGIN_ALTKEY2 NANO_ALT_9
|
||||
#define NANO_PARAEND_KEY NANO_CONTROL_O
|
||||
#define NANO_PARAEND_ALTKEY1 NANO_ALT_RPAREN
|
||||
#define NANO_PARAEND_ALTKEY2 NANO_ALT_0
|
||||
#define NANO_FULLJUSTIFY_KEY NANO_CONTROL_U
|
||||
#define NANO_FULLJUSTIFY_ALTKEY NANO_ALT_J
|
||||
#define NANO_VERBATIM_KEY NANO_ALT_V
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Toggles do not exist with NANO_SMALL. */
|
||||
#define TOGGLE_CONST_KEY NANO_ALT_C
|
||||
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
|
||||
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
|
||||
#define TOGGLE_NOHELP_KEY NANO_ALT_X
|
||||
#define TOGGLE_MOUSE_KEY NANO_ALT_M
|
||||
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
|
||||
#define TOGGLE_WRAP_KEY NANO_ALT_L
|
||||
#define TOGGLE_BACKWARDS_KEY NANO_ALT_B
|
||||
#define TOGGLE_CASE_KEY NANO_ALT_C
|
||||
#define TOGGLE_MULTIBUFFER_KEY NANO_ALT_F
|
||||
#define TOGGLE_DOS_KEY NANO_ALT_D
|
||||
#define TOGGLE_MAC_KEY NANO_ALT_M
|
||||
#define TOGGLE_SMOOTH_KEY NANO_ALT_S
|
||||
#define TOGGLE_NOCONVERT_KEY NANO_ALT_N
|
||||
#define TOGGLE_BACKUP_KEY NANO_ALT_B
|
||||
#define TOGGLE_SYNTAX_KEY NANO_ALT_Y
|
||||
#define TOGGLE_SMARTHOME_KEY NANO_ALT_H
|
||||
#define TOGGLE_WHITESPACE_KEY NANO_ALT_P
|
||||
#define TOGGLE_MORESPACE_KEY NANO_ALT_O
|
||||
#define TOGGLE_TABSTOSPACES_KEY NANO_ALT_Q
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
#define MAIN_VISIBLE 12
|
||||
|
||||
#define VIEW TRUE
|
||||
#define NOVIEW FALSE
|
||||
|
||||
/* Minimum editor window rows required for nano to work correctly. */
|
||||
#define MIN_EDITOR_ROWS 1
|
||||
|
||||
/* Default number of characters from end-of-line where text wrapping
|
||||
* occurs. */
|
||||
#define CHARS_FROM_EOL 8
|
||||
|
||||
/* Default width of a tab. */
|
||||
#define WIDTH_OF_TAB 8
|
||||
|
||||
/* Maximum number of search/replace history strings saved, not counting
|
||||
* the blank lines at their ends. */
|
||||
#define MAX_SEARCH_HISTORY 100
|
||||
|
||||
/* Maximum number of bytes we read from a file at one time. */
|
||||
#define MAX_BUF_SIZE 128
|
||||
|
||||
#endif /* !NANO_H */
|
||||
716
src/proto.h
Normal file
716
src/proto.h
Normal file
@@ -0,0 +1,716 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* proto.h *
|
||||
* *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef PROTO_H
|
||||
#define PROTO_H 1
|
||||
|
||||
/* Externs. */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#ifdef HAVE_REGEX_H
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#include "nano.h"
|
||||
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
extern ssize_t wrap_at;
|
||||
#endif
|
||||
extern int editwinrows;
|
||||
extern size_t current_x;
|
||||
extern ssize_t current_y;
|
||||
extern size_t totlines;
|
||||
extern size_t placewewant;
|
||||
#ifndef NANO_SMALL
|
||||
extern size_t mark_beginx;
|
||||
#endif
|
||||
extern size_t totsize;
|
||||
extern unsigned long flags;
|
||||
extern ssize_t tabsize;
|
||||
extern int currslen;
|
||||
|
||||
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||
extern char *whitespace;
|
||||
extern int whitespace_len[2];
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
extern char *punct;
|
||||
extern char *brackets;
|
||||
extern char *quotestr;
|
||||
#ifdef HAVE_REGEX_H
|
||||
extern regex_t quotereg;
|
||||
extern int quoterc;
|
||||
extern char *quoteerr;
|
||||
#else
|
||||
extern size_t quotelen;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
extern char *backup_dir;
|
||||
#endif
|
||||
|
||||
extern WINDOW *topwin, *edit, *bottomwin;
|
||||
extern char *filename;
|
||||
extern struct stat originalfilestat;
|
||||
extern char *answer;
|
||||
extern char *hblank;
|
||||
#ifndef DISABLE_HELP
|
||||
extern char *help_text;
|
||||
#endif
|
||||
extern char *last_search;
|
||||
extern char *last_replace;
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
extern char *operating_dir;
|
||||
extern char *full_operating_dir;
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
extern char *alt_speller;
|
||||
#endif
|
||||
|
||||
extern struct stat fileinfo;
|
||||
extern filestruct *current, *fileage, *edittop, *filebot;
|
||||
extern filestruct *cutbuffer;
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
extern filestruct *jusbuffer;
|
||||
#endif
|
||||
extern partition *filepart;
|
||||
#ifndef NANO_SMALL
|
||||
extern filestruct *mark_beginbuf;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
extern openfilestruct *open_files;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
extern const colortype *colorstrings;
|
||||
extern syntaxtype *syntaxes;
|
||||
extern char *syntaxstr;
|
||||
#endif
|
||||
|
||||
extern shortcut *shortcut_list;
|
||||
extern shortcut *main_list, *whereis_list;
|
||||
extern shortcut *replace_list, *gotoline_list;
|
||||
extern shortcut *writefile_list, *insertfile_list;
|
||||
extern shortcut *replace_list_2;
|
||||
#ifndef NANO_SMALL
|
||||
extern shortcut *extcmd_list;
|
||||
#endif
|
||||
#ifndef DISABLE_HELP
|
||||
extern shortcut *help_list;
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
extern shortcut *spell_list;
|
||||
#endif
|
||||
#ifndef DISABLE_BROWSER
|
||||
extern shortcut *browser_list, *gotodir_list;
|
||||
#endif
|
||||
|
||||
extern const shortcut *currshortcut;
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
extern regex_t search_regexp;
|
||||
extern regmatch_t regmatches[10];
|
||||
#ifdef ENABLE_COLOR
|
||||
extern regex_t syntaxfile_regexp;
|
||||
extern regmatch_t synfilematches[1];
|
||||
#endif /* ENABLE_COLOR */
|
||||
#endif /* HAVE_REGEX_H */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
extern toggle *toggles;
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
extern filestruct *search_history;
|
||||
extern filestruct *searchage;
|
||||
extern filestruct *searchbot;
|
||||
extern filestruct *replace_history;
|
||||
extern filestruct *replaceage;
|
||||
extern filestruct *replacebot;
|
||||
#endif
|
||||
|
||||
extern bool curses_ended;
|
||||
|
||||
extern char *homedir;
|
||||
|
||||
/* The functions we want available. */
|
||||
|
||||
/* Public functions in chars.c. */
|
||||
#ifndef HAVE_ISBLANK
|
||||
bool nisblank(int c);
|
||||
#endif
|
||||
#if !defined(HAVE_ISWBLANK) && defined(NANO_WIDE)
|
||||
bool niswblank(wchar_t wc);
|
||||
#endif
|
||||
bool is_byte(int c);
|
||||
bool is_alnum_mbchar(const char *c);
|
||||
bool is_blank_mbchar(const char *c);
|
||||
bool is_cntrl_char(int c);
|
||||
#ifdef NANO_WIDE
|
||||
bool is_cntrl_wchar(wchar_t wc);
|
||||
#endif
|
||||
bool is_cntrl_mbchar(const char *c);
|
||||
bool is_punct_mbchar(const char *c);
|
||||
bool is_word_mbchar(const char *c, bool allow_punct);
|
||||
char control_rep(char c);
|
||||
#ifdef NANO_WIDE
|
||||
wchar_t control_wrep(wchar_t c);
|
||||
#endif
|
||||
char *control_mbrep(const char *c, char *crep, int *crep_len);
|
||||
int mbwidth(const char *c);
|
||||
int mb_cur_max(void);
|
||||
char *make_mbchar(int chr, int *chr_mb_len);
|
||||
int parse_mbchar(const char *buf, char *chr, bool *bad_chr, size_t
|
||||
*col);
|
||||
size_t move_mbleft(const char *buf, size_t pos);
|
||||
size_t move_mbright(const char *buf, size_t pos);
|
||||
#ifndef HAVE_STRCASECMP
|
||||
int nstrcasecmp(const char *s1, const char *s2);
|
||||
#endif
|
||||
int mbstrcasecmp(const char *s1, const char *s2);
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
int nstrncasecmp(const char *s1, const char *s2, size_t n);
|
||||
#endif
|
||||
int mbstrncasecmp(const char *s1, const char *s2, size_t n);
|
||||
#ifndef HAVE_STRCASESTR
|
||||
const char *nstrcasestr(const char *haystack, const char *needle);
|
||||
#endif
|
||||
const char *mbstrcasestr(const char *haystack, const char *needle);
|
||||
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
||||
const char *revstrstr(const char *haystack, const char *needle, const
|
||||
char *rev_start);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
const char *revstrcasestr(const char *haystack, const char *needle,
|
||||
const char *rev_start);
|
||||
const char *mbrevstrcasestr(const char *haystack, const char *needle,
|
||||
const char *rev_start);
|
||||
#endif
|
||||
size_t mbstrlen(const char *s);
|
||||
#ifndef HAVE_STRNLEN
|
||||
size_t nstrnlen(const char *s, size_t maxlen);
|
||||
#endif
|
||||
size_t mbstrnlen(const char *s, size_t maxlen);
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
#ifdef ENABLE_NANORC
|
||||
bool has_blank_chars(const char *s);
|
||||
bool has_blank_mbchars(const char *s);
|
||||
#endif
|
||||
char *mbstrchr(const char *s, char *c);
|
||||
#endif
|
||||
#ifdef ENABLE_NANORC
|
||||
bool is_valid_mbstring(const char *s);
|
||||
#endif
|
||||
|
||||
/* Public functions in color.c. */
|
||||
#ifdef ENABLE_COLOR
|
||||
void set_colorpairs(void);
|
||||
void do_colorinit(void);
|
||||
void update_color(void);
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
/* Public functions in cut.c. */
|
||||
void cutbuffer_reset(void);
|
||||
void cut_line(void);
|
||||
#ifndef NANO_SMALL
|
||||
void cut_marked(void);
|
||||
void cut_to_eol(void);
|
||||
#endif
|
||||
void do_cut_text(void);
|
||||
#ifndef NANO_SMALL
|
||||
void do_cut_till_end(void);
|
||||
#endif
|
||||
void do_uncut_text(void);
|
||||
|
||||
/* Public functions in files.c. */
|
||||
void new_file(void);
|
||||
filestruct *read_line(char *buf, filestruct *prevnode, bool
|
||||
*first_line_ins, size_t buf_len);
|
||||
void load_file(void);
|
||||
void read_file(FILE *f, const char *filename);
|
||||
int open_file(const char *filename, bool newfie, FILE **f);
|
||||
char *get_next_filename(const char *name, const char *suffix);
|
||||
#ifndef NANO_SMALL
|
||||
void execute_command(const char *command);
|
||||
#endif
|
||||
void load_buffer(const char *name);
|
||||
void do_insertfile(
|
||||
#ifndef NANO_SMALL
|
||||
bool execute
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
);
|
||||
void do_insertfile_void(void);
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
openfilestruct *make_new_opennode(void);
|
||||
void splice_opennode(openfilestruct *begin, openfilestruct *newnode,
|
||||
openfilestruct *end);
|
||||
void unlink_opennode(openfilestruct *fileptr);
|
||||
void delete_opennode(openfilestruct *fileptr);
|
||||
#ifdef DEBUG
|
||||
void free_openfilestruct(openfilestruct *src);
|
||||
#endif
|
||||
void add_open_file(bool update);
|
||||
void load_open_file(void);
|
||||
void open_prevnext_file(bool next_file);
|
||||
void open_prevfile_void(void);
|
||||
void open_nextfile_void(void);
|
||||
bool close_open_file(void);
|
||||
#endif
|
||||
char *get_full_path(const char *origpath);
|
||||
char *check_writable_directory(const char *path);
|
||||
char *safe_tempfile(FILE **f);
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
void init_operating_dir(void);
|
||||
bool check_operating_dir(const char *currpath, bool allow_tabcomp);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
void init_backup_dir(void);
|
||||
#endif
|
||||
int copy_file(FILE *inn, FILE *out);
|
||||
int write_file(const char *name, FILE *f_open, bool tmp, int append,
|
||||
bool nonamechange);
|
||||
#ifndef NANO_SMALL
|
||||
int write_marked(const char *name, FILE *f_open, bool tmp, int append);
|
||||
#endif
|
||||
int do_writeout(bool exiting);
|
||||
void do_writeout_void(void);
|
||||
char *real_dir_from_tilde(const char *buf);
|
||||
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
|
||||
int diralphasort(const void *va, const void *vb);
|
||||
void free_chararray(char **array, size_t len);
|
||||
#endif
|
||||
#ifndef DISABLE_TABCOMP
|
||||
char **username_tab_completion(const char *buf, size_t *num_matches,
|
||||
size_t buflen);
|
||||
char **cwd_tab_completion(const char *buf, size_t *num_matches, size_t
|
||||
buflen);
|
||||
char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list);
|
||||
#endif
|
||||
const char *tail(const char *foo);
|
||||
#ifndef DISABLE_BROWSER
|
||||
void striponedir(char *path);
|
||||
char **browser_init(const char *path, int *longest, size_t *numents, DIR
|
||||
*dir);
|
||||
char *do_browser(char *path, DIR *dir);
|
||||
char *do_browse_from(const char *inpath);
|
||||
#endif
|
||||
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||
char *histfilename(void);
|
||||
void load_history(void);
|
||||
bool writehist(FILE *hist, filestruct *histhead);
|
||||
void save_history(void);
|
||||
#endif
|
||||
|
||||
/* Public functions in global.c. */
|
||||
size_t length_of_list(const shortcut *s);
|
||||
#ifndef NANO_SMALL
|
||||
void toggle_init_one(int val, const char *desc, long flag);
|
||||
void toggle_init(void);
|
||||
#endif
|
||||
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
|
||||
#ifndef DISABLE_HELP
|
||||
const char *help,
|
||||
#endif
|
||||
int metaval, int funcval, int miscval, bool view, void
|
||||
(*func)(void));
|
||||
void shortcut_init(bool unjustify);
|
||||
void free_shortcutage(shortcut **shortcutage);
|
||||
#ifdef DEBUG
|
||||
void thanks_for_all_the_fish(void);
|
||||
#endif
|
||||
|
||||
/* Public functions in move.c. */
|
||||
void do_first_line(void);
|
||||
void do_last_line(void);
|
||||
void do_home(void);
|
||||
void do_end(void);
|
||||
void do_page_up(void);
|
||||
void do_page_down(void);
|
||||
void do_up(void);
|
||||
void do_down(void);
|
||||
void do_left(bool allow_update);
|
||||
void do_left_void(void);
|
||||
void do_right(bool allow_update);
|
||||
void do_right_void(void);
|
||||
|
||||
/* Public functions in nano.c. */
|
||||
void print_view_warning(void);
|
||||
void finish(void);
|
||||
void die(const char *msg, ...);
|
||||
void die_save_file(const char *die_filename);
|
||||
void check_die_too_small(void);
|
||||
void resize_variables(void);
|
||||
void global_init(bool save_cutbuffer);
|
||||
void window_init(void);
|
||||
#ifndef DISABLE_MOUSE
|
||||
void mouse_init(void);
|
||||
#endif
|
||||
#ifndef DISABLE_HELP
|
||||
void help_init(void);
|
||||
#endif
|
||||
filestruct *make_new_node(filestruct *prevnode);
|
||||
filestruct *copy_node(const filestruct *src);
|
||||
void splice_node(filestruct *begin, filestruct *newnode, filestruct
|
||||
*end);
|
||||
void unlink_node(const filestruct *fileptr);
|
||||
void delete_node(filestruct *fileptr);
|
||||
filestruct *copy_filestruct(const filestruct *src);
|
||||
void free_filestruct(filestruct *src);
|
||||
partition *partition_filestruct(filestruct *top, size_t top_x,
|
||||
filestruct *bot, size_t bot_x);
|
||||
void unpartition_filestruct(partition **p);
|
||||
void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
|
||||
filestruct *top, size_t top_x, filestruct *bot, size_t bot_x);
|
||||
void copy_from_filestruct(filestruct *file_top, filestruct *file_bot);
|
||||
void renumber_all(void);
|
||||
void renumber(filestruct *fileptr);
|
||||
void print1opt_full(const char *shortflag
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
, const char *longflag
|
||||
#endif
|
||||
, const char *desc);
|
||||
void usage(void);
|
||||
void version(void);
|
||||
int no_more_space(void);
|
||||
int no_help(void);
|
||||
void nano_disabled_msg(void);
|
||||
#ifndef NANO_SMALL
|
||||
void cancel_fork(int signal);
|
||||
bool open_pipe(const char *command);
|
||||
#endif
|
||||
void do_verbatim_input(void);
|
||||
void do_backspace(void);
|
||||
void do_delete(void);
|
||||
void do_tab(void);
|
||||
void do_enter(void);
|
||||
#ifndef NANO_SMALL
|
||||
bool do_next_word(bool allow_punct, bool allow_update);
|
||||
void do_next_word_void(void);
|
||||
bool do_prev_word(bool allow_punct, bool allow_update);
|
||||
void do_prev_word_void(void);
|
||||
void do_word_count(void);
|
||||
void do_mark(void);
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPPING
|
||||
void wrap_reset(void);
|
||||
bool do_wrap(filestruct *line);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
bool do_int_spell_fix(const char *word);
|
||||
const char *do_int_speller(const char *tempfile_name);
|
||||
const char *do_alt_speller(char *tempfile_name);
|
||||
void do_spell(void);
|
||||
#endif
|
||||
#if !defined(DISABLE_HELP) || !defined(DISABLE_JUSTIFY) || !defined(DISABLE_WRAPPING)
|
||||
ssize_t break_line(const char *line, ssize_t goal, bool newline);
|
||||
#endif
|
||||
#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
|
||||
size_t indent_length(const char *line);
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
void justify_format(filestruct *paragraph, size_t skip);
|
||||
size_t quote_length(const char *line);
|
||||
bool quotes_match(const char *a_line, size_t a_quote, const char
|
||||
*b_line);
|
||||
bool indents_match(const char *a_line, size_t a_indent, const char
|
||||
*b_line, size_t b_indent);
|
||||
bool begpar(const filestruct *const foo);
|
||||
void do_para_begin(bool allow_update);
|
||||
void do_para_begin_void(void);
|
||||
bool inpar(const filestruct *const foo);
|
||||
void do_para_end(bool allow_update);
|
||||
void do_para_end_void(void);
|
||||
filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
|
||||
quote_len);
|
||||
bool find_paragraph(size_t *const quote, size_t *const par);
|
||||
void do_justify(bool full_justify);
|
||||
void do_justify_void(void);
|
||||
void do_full_justify(void);
|
||||
#endif /* !DISABLE_JUSTIFY */
|
||||
void do_exit(void);
|
||||
void signal_init(void);
|
||||
void handle_hupterm(int signal);
|
||||
void do_suspend(int signal);
|
||||
void do_cont(int signal);
|
||||
#ifndef NANO_SMALL
|
||||
void handle_sigwinch(int s);
|
||||
void allow_pending_sigwinch(bool allow);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
void do_toggle(const toggle *which);
|
||||
#endif
|
||||
void disable_extended_io(void);
|
||||
void disable_signals(void);
|
||||
#ifndef NANO_SMALL
|
||||
void enable_signals(void);
|
||||
#endif
|
||||
void disable_flow_control(void);
|
||||
void enable_flow_control(void);
|
||||
void terminal_init(void);
|
||||
int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
|
||||
*ran_func, bool *finished, bool allow_funcs);
|
||||
#ifndef DISABLE_MOUSE
|
||||
bool do_mouse(void);
|
||||
#endif
|
||||
void do_output(char *output, size_t output_len, bool allow_cntrls);
|
||||
|
||||
/* Public functions in rcfile.c. */
|
||||
#ifdef ENABLE_NANORC
|
||||
void rcfile_error(const char *msg, ...);
|
||||
char *parse_next_word(char *ptr);
|
||||
char *parse_argument(char *ptr);
|
||||
#ifdef ENABLE_COLOR
|
||||
int color_to_int(const char *colorname, bool *bright);
|
||||
char *parse_next_regex(char *ptr);
|
||||
bool nregcomp(regex_t *preg, const char *regex, int eflags);
|
||||
void parse_syntax(char *ptr);
|
||||
void parse_colors(char *ptr, bool icase);
|
||||
#endif /* ENABLE_COLOR */
|
||||
void parse_rcfile(FILE *rcstream);
|
||||
void do_rcfile(void);
|
||||
#endif /* ENABLE_NANORC */
|
||||
|
||||
/* Public functions in search.c. */
|
||||
#ifdef HAVE_REGEX_H
|
||||
int regexp_init(const char *regexp);
|
||||
void regexp_cleanup(void);
|
||||
#endif
|
||||
void not_found_msg(const char *str);
|
||||
void search_abort(void);
|
||||
void search_init_globals(void);
|
||||
int search_init(bool replacing, bool use_answer);
|
||||
bool is_whole_word(size_t pos, const char *buf, const char *word);
|
||||
bool findnextstr(bool can_display_wrap, bool wholeword, bool
|
||||
no_sameline, const filestruct *begin, size_t beginx, const char
|
||||
*needle, size_t *needle_len);
|
||||
void findnextstr_wrap_reset(void);
|
||||
void do_search(void);
|
||||
#ifndef NANO_SMALL
|
||||
void do_research(void);
|
||||
#endif
|
||||
void replace_abort(void);
|
||||
#ifdef HAVE_REGEX_H
|
||||
int replace_regexp(char *string, bool create);
|
||||
#endif
|
||||
char *replace_line(const char *needle);
|
||||
ssize_t do_replace_loop(const char *needle, const filestruct
|
||||
*real_current, size_t *real_current_x, bool wholewords, bool
|
||||
*canceled);
|
||||
void do_replace(void);
|
||||
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
||||
bool interactive, bool save_pos);
|
||||
void do_gotolinecolumn_void(void);
|
||||
#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
|
||||
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
|
||||
pos_pww);
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
#ifdef HAVE_REGEX_H
|
||||
void do_find_bracket(void);
|
||||
#endif
|
||||
#ifdef ENABLE_NANORC
|
||||
bool history_has_changed(void);
|
||||
#endif
|
||||
void history_init(void);
|
||||
filestruct *find_history(filestruct *h_start, filestruct *h_end, const
|
||||
char *s, size_t len);
|
||||
void update_history(filestruct **h, const char *s);
|
||||
char *get_history_older(filestruct **h);
|
||||
char *get_history_newer(filestruct **h);
|
||||
#ifndef DISABLE_TABCOMP
|
||||
char *get_history_completion(filestruct **h, char *s, size_t len);
|
||||
#endif
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* Public functions in utils.c. */
|
||||
#ifdef HAVE_REGEX_H
|
||||
#ifdef BROKEN_REGEXEC
|
||||
int safe_regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags);
|
||||
#endif
|
||||
int regexp_bol_or_eol(const regex_t *preg, const char *string);
|
||||
#endif
|
||||
int digits(size_t n);
|
||||
void get_homedir(void);
|
||||
bool parse_num(const char *str, ssize_t *val);
|
||||
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
|
||||
void align(char **str);
|
||||
void null_at(char **data, size_t index);
|
||||
void unsunder(char *str, size_t true_len);
|
||||
void sunder(char *str);
|
||||
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||
#ifndef HAVE_GETLINE
|
||||
ssize_t ngetline(char **lineptr, size_t *n, FILE *stream);
|
||||
#endif
|
||||
#ifndef HAVE_GETDELIM
|
||||
ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream);
|
||||
#endif
|
||||
#endif /* !NANO_SMALL && ENABLE_NANORC */
|
||||
const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *start);
|
||||
void nperror(const char *s);
|
||||
void *nmalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
char *mallocstrncpy(char *dest, const char *src, size_t n);
|
||||
char *mallocstrcpy(char *dest, const char *src);
|
||||
char *mallocstrassn(char *dest, char *src);
|
||||
void new_magicline(void);
|
||||
#ifndef NANO_SMALL
|
||||
void remove_magicline(void);
|
||||
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
||||
**bot, size_t *bot_x, bool *right_side_up);
|
||||
#endif
|
||||
void get_totals(const filestruct *begin, const filestruct *end, size_t
|
||||
*lines, size_t *size);
|
||||
|
||||
/* Public functions in winio.c. */
|
||||
#ifndef NANO_SMALL
|
||||
void reset_kbinput(void);
|
||||
#endif
|
||||
void get_buffer(WINDOW *win);
|
||||
size_t get_buffer_len(void);
|
||||
void unget_input(int *input, size_t input_len);
|
||||
void unget_kbinput(int kbinput, bool meta_key, bool func_key);
|
||||
int *get_input(WINDOW *win, size_t input_len);
|
||||
int get_kbinput(WINDOW *win, bool *meta_key, bool *func_key);
|
||||
int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
|
||||
#ifndef NANO_SMALL
|
||||
, bool reset
|
||||
#endif
|
||||
);
|
||||
int get_escape_seq_kbinput(const int *seq, size_t seq_len, bool
|
||||
*ignore_seq);
|
||||
int get_escape_seq_abcd(int kbinput);
|
||||
int get_byte_kbinput(int kbinput
|
||||
#ifndef NANO_SMALL
|
||||
, bool reset
|
||||
#endif
|
||||
);
|
||||
int get_word_kbinput(int kbinput
|
||||
#ifndef NANO_SMALL
|
||||
, bool reset
|
||||
#endif
|
||||
);
|
||||
int get_control_kbinput(int kbinput);
|
||||
void unparse_kbinput(char *output, size_t output_len);
|
||||
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
||||
int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
||||
#ifndef DISABLE_MOUSE
|
||||
bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
|
||||
#endif
|
||||
const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
|
||||
*meta_key, bool *func_key);
|
||||
#ifndef NANO_SMALL
|
||||
const toggle *get_toggle(int kbinput, bool meta_key);
|
||||
#endif
|
||||
int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
|
||||
bool *ran_func, bool *finished, bool allow_funcs);
|
||||
#ifndef DISABLE_MOUSE
|
||||
bool do_statusbar_mouse(void);
|
||||
#endif
|
||||
void do_statusbar_home(void);
|
||||
void do_statusbar_end(void);
|
||||
void do_statusbar_right(void);
|
||||
void do_statusbar_left(void);
|
||||
void do_statusbar_backspace(void);
|
||||
void do_statusbar_delete(void);
|
||||
void do_statusbar_cut_text(void);
|
||||
#ifndef NANO_SMALL
|
||||
bool do_statusbar_next_word(bool allow_punct);
|
||||
bool do_statusbar_prev_word(bool allow_punct);
|
||||
#endif
|
||||
void do_statusbar_verbatim_input(bool *got_enter);
|
||||
void do_statusbar_output(char *output, size_t output_len, bool
|
||||
*got_enter, bool allow_cntrls);
|
||||
size_t xplustabs(void);
|
||||
size_t actual_x(const char *str, size_t xplus);
|
||||
size_t strnlenpt(const char *buf, size_t size);
|
||||
size_t strlenpt(const char *buf);
|
||||
void blank_titlebar(void);
|
||||
void blank_topbar(void);
|
||||
void blank_edit(void);
|
||||
void blank_statusbar(void);
|
||||
void blank_bottombars(void);
|
||||
void check_statusblank(void);
|
||||
char *display_string(const char *buf, size_t start_col, size_t len, bool
|
||||
dollars);
|
||||
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
|
||||
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
||||
#ifndef NANO_SMALL
|
||||
filestruct **history_list,
|
||||
#endif
|
||||
const shortcut *s
|
||||
#ifndef DISABLE_TABCOMP
|
||||
, bool *list
|
||||
#endif
|
||||
);
|
||||
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
|
||||
#ifndef NANO_SMALL
|
||||
filestruct **history_list,
|
||||
#endif
|
||||
const char *msg, ...);
|
||||
void statusq_abort(void);
|
||||
void titlebar(const char *path);
|
||||
void set_modified(void);
|
||||
void statusbar(const char *msg, ...);
|
||||
void bottombars(const shortcut *s);
|
||||
void onekey(const char *keystroke, const char *desc, size_t len);
|
||||
size_t get_page_start(size_t column);
|
||||
void reset_cursor(void);
|
||||
void edit_add(const filestruct *fileptr, const char *converted, int
|
||||
yval, size_t start);
|
||||
void update_line(const filestruct *fileptr, size_t index);
|
||||
int need_horizontal_update(size_t old_pww);
|
||||
int need_vertical_update(size_t old_pww);
|
||||
void edit_scroll(updown direction, int nlines);
|
||||
void edit_redraw(const filestruct *old_current, size_t old_pww);
|
||||
void edit_refresh(void);
|
||||
void edit_update(topmidnone location);
|
||||
int do_yesno(bool all, const char *msg);
|
||||
void total_redraw(void);
|
||||
void total_refresh(void);
|
||||
void display_main_list(void);
|
||||
void do_cursorpos(bool constant);
|
||||
void do_cursorpos_void(void);
|
||||
#ifndef DISABLE_HELP
|
||||
size_t help_line_len(const char *ptr);
|
||||
void do_help(void);
|
||||
#endif
|
||||
void do_replace_highlight(bool highlight, const char *word);
|
||||
#ifndef NDEBUG
|
||||
int check_linenumbers(const filestruct *fileptr);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
void dump_buffer(const filestruct *inptr);
|
||||
void dump_buffer_reverse(void);
|
||||
#endif
|
||||
#ifdef NANO_EXTRA
|
||||
void do_credits(void);
|
||||
#endif
|
||||
|
||||
#endif /* !PROTO_H */
|
||||
747
src/rcfile.c
Normal file
747
src/rcfile.c
Normal file
@@ -0,0 +1,747 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* rcfile.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
|
||||
#ifdef ENABLE_NANORC
|
||||
|
||||
const static rcoption rcopts[] = {
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
{"brackets", 0},
|
||||
#endif
|
||||
{"const", CONST_UPDATE},
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
{"fill", 0},
|
||||
#endif
|
||||
#ifndef DISABLE_MOUSE
|
||||
{"mouse", USE_MOUSE},
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
{"multibuffer", MULTIBUFFER},
|
||||
#endif
|
||||
{"morespace", MORE_SPACE},
|
||||
{"nofollow", NOFOLLOW_SYMLINKS},
|
||||
{"nohelp", NO_HELP},
|
||||
#ifndef DISABLE_WRAPPING
|
||||
{"nowrap", NO_WRAP},
|
||||
#endif
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
{"operatingdir", 0},
|
||||
#endif
|
||||
{"preserve", PRESERVE},
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
{"punct", 0},
|
||||
{"quotestr", 0},
|
||||
#endif
|
||||
{"rebinddelete", REBIND_DELETE},
|
||||
#ifdef HAVE_REGEX_H
|
||||
{"regexp", USE_REGEXP},
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
{"speller", 0},
|
||||
#endif
|
||||
{"suspend", SUSPEND},
|
||||
{"tabsize", 0},
|
||||
{"tempfile", TEMP_FILE},
|
||||
{"view", VIEW_MODE},
|
||||
#ifndef NANO_SMALL
|
||||
{"autoindent", AUTOINDENT},
|
||||
{"backup", BACKUP_FILE},
|
||||
{"backupdir", 0},
|
||||
{"backwards", BACKWARDS_SEARCH},
|
||||
{"casesensitive", CASE_SENSITIVE},
|
||||
{"cut", CUT_TO_END},
|
||||
{"historylog", HISTORYLOG},
|
||||
{"noconvert", NO_CONVERT},
|
||||
{"quickblank", QUICK_BLANK},
|
||||
{"smarthome", SMART_HOME},
|
||||
{"smooth", SMOOTH_SCROLL},
|
||||
{"tabstospaces", TABS_TO_SPACES},
|
||||
{"whitespace", 0},
|
||||
#endif
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
static bool errors = FALSE;
|
||||
static size_t lineno = 0;
|
||||
static char *nanorc = NULL;
|
||||
#ifdef ENABLE_COLOR
|
||||
static syntaxtype *endsyntax = NULL;
|
||||
/* The end of the list of syntaxes. */
|
||||
static colortype *endcolor = NULL;
|
||||
/* The end of the color list for the current syntax. */
|
||||
#endif
|
||||
|
||||
/* We have an error in some part of the rcfile. Put it on stderr and
|
||||
* make the user hit Return to continue starting up nano. */
|
||||
void rcfile_error(const char *msg, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
if (lineno > 0) {
|
||||
errors = TRUE;
|
||||
fprintf(stderr, _("Error in %s on line %lu: "), nanorc,
|
||||
(unsigned long)lineno);
|
||||
}
|
||||
|
||||
va_start(ap, msg);
|
||||
vfprintf(stderr, _(msg), ap);
|
||||
va_end(ap);
|
||||
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
/* Parse the next word from the string. Return points to '\0' if we hit
|
||||
* the end of the line. */
|
||||
char *parse_next_word(char *ptr)
|
||||
{
|
||||
while (!isblank(*ptr) && *ptr != '\0')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\0')
|
||||
return ptr;
|
||||
|
||||
/* Null-terminate and advance ptr. */
|
||||
*ptr++ = '\0';
|
||||
|
||||
while (isblank(*ptr))
|
||||
ptr++;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* The keywords operatingdir, backupdir, fill, tabsize, speller, punct,
|
||||
* brackets, quotestr, and whitespace take an argument when set. Among
|
||||
* these, operatingdir, backupdir, speller, punct, brackets, quotestr,
|
||||
* and whitespace have to allow tabs and spaces in the argument. Thus,
|
||||
* if the next word starts with a ", we say it ends with the last " of
|
||||
* the line. Otherwise, the word is interpreted as usual. That is so
|
||||
* the arguments can contain "s too. */
|
||||
char *parse_argument(char *ptr)
|
||||
{
|
||||
const char *ptr_bak = ptr;
|
||||
char *last_quote = NULL;
|
||||
|
||||
assert(ptr != NULL);
|
||||
|
||||
if (*ptr != '"')
|
||||
return parse_next_word(ptr);
|
||||
|
||||
do {
|
||||
ptr++;
|
||||
if (*ptr == '"')
|
||||
last_quote = ptr;
|
||||
} while (*ptr != '\0');
|
||||
|
||||
if (last_quote == NULL) {
|
||||
if (*ptr == '\0')
|
||||
ptr = NULL;
|
||||
else
|
||||
*ptr++ = '\0';
|
||||
rcfile_error(N_("Argument %s has unterminated \""), ptr_bak);
|
||||
} else {
|
||||
*last_quote = '\0';
|
||||
ptr = last_quote + 1;
|
||||
}
|
||||
if (ptr != NULL)
|
||||
while (isblank(*ptr))
|
||||
ptr++;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
int color_to_int(const char *colorname, bool *bright)
|
||||
{
|
||||
int mcolor = -1;
|
||||
|
||||
assert(colorname != NULL && bright != NULL);
|
||||
|
||||
if (strncasecmp(colorname, "bright", 6) == 0) {
|
||||
*bright = TRUE;
|
||||
colorname += 6;
|
||||
}
|
||||
|
||||
if (strcasecmp(colorname, "green") == 0)
|
||||
mcolor = COLOR_GREEN;
|
||||
else if (strcasecmp(colorname, "red") == 0)
|
||||
mcolor = COLOR_RED;
|
||||
else if (strcasecmp(colorname, "blue") == 0)
|
||||
mcolor = COLOR_BLUE;
|
||||
else if (strcasecmp(colorname, "white") == 0)
|
||||
mcolor = COLOR_WHITE;
|
||||
else if (strcasecmp(colorname, "yellow") == 0)
|
||||
mcolor = COLOR_YELLOW;
|
||||
else if (strcasecmp(colorname, "cyan") == 0)
|
||||
mcolor = COLOR_CYAN;
|
||||
else if (strcasecmp(colorname, "magenta") == 0)
|
||||
mcolor = COLOR_MAGENTA;
|
||||
else if (strcasecmp(colorname, "black") == 0)
|
||||
mcolor = COLOR_BLACK;
|
||||
else
|
||||
rcfile_error(N_("Color %s not understood.\n"
|
||||
"Valid colors are \"green\", \"red\", \"blue\",\n"
|
||||
"\"white\", \"yellow\", \"cyan\", \"magenta\" and\n"
|
||||
"\"black\", with the optional prefix \"bright\"\n"
|
||||
"for foreground colors."), colorname);
|
||||
|
||||
return mcolor;
|
||||
}
|
||||
|
||||
char *parse_next_regex(char *ptr)
|
||||
{
|
||||
assert(ptr != NULL);
|
||||
|
||||
/* Continue until the end of the line, or a " followed by a space, a
|
||||
* blank character, or \0. */
|
||||
while ((*ptr != '"' || (!isblank(*(ptr + 1)) &&
|
||||
*(ptr + 1) != '\0')) && *ptr != '\0')
|
||||
ptr++;
|
||||
|
||||
assert(*ptr == '"' || *ptr == '\0');
|
||||
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(
|
||||
N_("Regex strings must begin and end with a \" character"));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Null terminate and advance ptr. */
|
||||
*ptr++ = '\0';
|
||||
|
||||
while (isblank(*ptr))
|
||||
ptr++;
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* Compile the regular expression regex to preg. Return FALSE on
|
||||
* success, or TRUE if the expression is invalid. */
|
||||
bool nregcomp(regex_t *preg, const char *regex, int eflags)
|
||||
{
|
||||
int rc = regcomp(preg, regex, REG_EXTENDED | eflags);
|
||||
|
||||
if (rc != 0) {
|
||||
size_t len = regerror(rc, preg, NULL, 0);
|
||||
char *str = charalloc(len);
|
||||
|
||||
regerror(rc, preg, str, len);
|
||||
rcfile_error(N_("Bad regex \"%s\": %s"), regex, str);
|
||||
free(str);
|
||||
}
|
||||
|
||||
return (rc != 0);
|
||||
}
|
||||
|
||||
void parse_syntax(char *ptr)
|
||||
{
|
||||
const char *fileregptr = NULL, *nameptr = NULL;
|
||||
exttype *endext = NULL;
|
||||
/* The end of the extensions list for this syntax. */
|
||||
|
||||
assert(ptr != NULL);
|
||||
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(N_("Missing syntax name"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(
|
||||
N_("Regex strings must begin and end with a \" character"));
|
||||
return;
|
||||
}
|
||||
|
||||
ptr++;
|
||||
|
||||
nameptr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
|
||||
if (ptr == NULL)
|
||||
return;
|
||||
|
||||
if (syntaxes == NULL) {
|
||||
syntaxes = (syntaxtype *)nmalloc(sizeof(syntaxtype));
|
||||
endsyntax = syntaxes;
|
||||
} else {
|
||||
endsyntax->next = (syntaxtype *)nmalloc(sizeof(syntaxtype));
|
||||
endsyntax = endsyntax->next;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Adding new syntax after first one\n");
|
||||
#endif
|
||||
}
|
||||
endsyntax->desc = mallocstrcpy(NULL, nameptr);
|
||||
endsyntax->color = NULL;
|
||||
endcolor = NULL;
|
||||
endsyntax->extensions = NULL;
|
||||
endsyntax->next = NULL;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Starting a new syntax type: \"%s\"\n", nameptr);
|
||||
#endif
|
||||
|
||||
/* Now load the extensions into their part of the struct. */
|
||||
while (*ptr != '\0') {
|
||||
exttype *newext;
|
||||
/* The new extension structure. */
|
||||
|
||||
while (*ptr != '"' && *ptr != '\0')
|
||||
ptr++;
|
||||
|
||||
if (*ptr == '\0')
|
||||
return;
|
||||
|
||||
ptr++;
|
||||
|
||||
fileregptr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
if (ptr == NULL)
|
||||
break;
|
||||
|
||||
newext = (exttype *)nmalloc(sizeof(exttype));
|
||||
if (nregcomp(&newext->val, fileregptr, REG_NOSUB))
|
||||
free(newext);
|
||||
else {
|
||||
if (endext == NULL)
|
||||
endsyntax->extensions = newext;
|
||||
else
|
||||
endext->next = newext;
|
||||
endext = newext;
|
||||
endext->next = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse the color stuff into the colorstrings array. If icase is TRUE,
|
||||
* treat the color stuff as case insensitive. */
|
||||
void parse_colors(char *ptr, bool icase)
|
||||
{
|
||||
int fg, bg;
|
||||
bool bright = FALSE, no_fgcolor = FALSE;
|
||||
char *fgstr;
|
||||
|
||||
assert(ptr != NULL);
|
||||
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(N_("Missing color name"));
|
||||
return;
|
||||
}
|
||||
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
|
||||
if (strchr(fgstr, ',') != NULL) {
|
||||
char *bgcolorname;
|
||||
|
||||
strtok(fgstr, ",");
|
||||
bgcolorname = strtok(NULL, ",");
|
||||
if (bgcolorname == NULL) {
|
||||
/* If we have a background color without a foreground color,
|
||||
* parse it properly. */
|
||||
bgcolorname = fgstr + 1;
|
||||
no_fgcolor = TRUE;
|
||||
}
|
||||
if (strncasecmp(bgcolorname, "bright", 6) == 0) {
|
||||
rcfile_error(
|
||||
N_("Background color %s cannot be bright"),
|
||||
bgcolorname);
|
||||
return;
|
||||
}
|
||||
bg = color_to_int(bgcolorname, &bright);
|
||||
} else
|
||||
bg = -1;
|
||||
|
||||
if (!no_fgcolor) {
|
||||
fg = color_to_int(fgstr, &bright);
|
||||
|
||||
/* Don't try to parse screwed-up foreground colors. */
|
||||
if (fg == -1)
|
||||
return;
|
||||
} else
|
||||
fg = -1;
|
||||
|
||||
if (syntaxes == NULL) {
|
||||
rcfile_error(
|
||||
N_("Cannot add a color directive without a syntax line"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(N_("Missing regex string"));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Now for the fun part. Start adding regexes to individual strings
|
||||
* in the colorstrings array, woo! */
|
||||
while (ptr != NULL && *ptr != '\0') {
|
||||
colortype *newcolor;
|
||||
/* The new color structure. */
|
||||
bool cancelled = FALSE;
|
||||
/* The start expression was bad. */
|
||||
bool expectend = FALSE;
|
||||
/* Do we expect an end= line? */
|
||||
|
||||
if (strncasecmp(ptr, "start=", 6) == 0) {
|
||||
ptr += 6;
|
||||
expectend = TRUE;
|
||||
}
|
||||
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(
|
||||
N_("Regex strings must begin and end with a \" character"));
|
||||
ptr = parse_next_regex(ptr);
|
||||
continue;
|
||||
}
|
||||
|
||||
ptr++;
|
||||
|
||||
newcolor = (colortype *)nmalloc(sizeof(colortype));
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
if (ptr == NULL)
|
||||
break;
|
||||
|
||||
if (nregcomp(&newcolor->start, fgstr, icase ? REG_ICASE : 0)) {
|
||||
free(newcolor);
|
||||
cancelled = TRUE;
|
||||
} else {
|
||||
newcolor->fg = fg;
|
||||
newcolor->bg = bg;
|
||||
newcolor->bright = bright;
|
||||
newcolor->next = NULL;
|
||||
newcolor->end = NULL;
|
||||
|
||||
if (endcolor == NULL) {
|
||||
endsyntax->color = newcolor;
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Starting a new colorstring for fg %d, bg %d\n", fg, bg);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "Adding new entry for fg %d, bg %d\n", fg, bg);
|
||||
#endif
|
||||
endcolor->next = newcolor;
|
||||
}
|
||||
endcolor = newcolor;
|
||||
}
|
||||
|
||||
if (expectend) {
|
||||
if (ptr == NULL || strncasecmp(ptr, "end=", 4) != 0) {
|
||||
rcfile_error(
|
||||
N_("\"start=\" requires a corresponding \"end=\""));
|
||||
return;
|
||||
}
|
||||
ptr += 4;
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(
|
||||
N_("Regex strings must begin and end with a \" character"));
|
||||
continue;
|
||||
}
|
||||
|
||||
ptr++;
|
||||
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
if (ptr == NULL)
|
||||
break;
|
||||
|
||||
/* If the start regex was invalid, skip past the end regex to
|
||||
* stay in sync. */
|
||||
if (cancelled)
|
||||
continue;
|
||||
|
||||
newcolor->end = (regex_t *)nmalloc(sizeof(regex_t));
|
||||
if (nregcomp(newcolor->end, fgstr, icase ? REG_ICASE : 0)) {
|
||||
free(newcolor->end);
|
||||
newcolor->end = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
/* Parse the rcfile, once it has been opened successfully. */
|
||||
void parse_rcfile(FILE *rcstream)
|
||||
{
|
||||
char *buf = NULL;
|
||||
ssize_t len;
|
||||
size_t n;
|
||||
|
||||
while ((len = getline(&buf, &n, rcstream)) > 0) {
|
||||
char *ptr, *keyword, *option;
|
||||
int set = 0, i;
|
||||
|
||||
/* Ignore the \n. */
|
||||
buf[len - 1] = '\0';
|
||||
|
||||
lineno++;
|
||||
ptr = buf;
|
||||
while (isblank(*ptr))
|
||||
ptr++;
|
||||
|
||||
/* If we have a blank line or a comment, skip to the next
|
||||
* line. */
|
||||
if (*ptr == '\0' || *ptr == '#')
|
||||
continue;
|
||||
|
||||
/* Otherwise, skip to the next space. */
|
||||
keyword = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
|
||||
/* Try to parse the keyword. */
|
||||
if (strcasecmp(keyword, "set") == 0)
|
||||
set = 1;
|
||||
else if (strcasecmp(keyword, "unset") == 0)
|
||||
set = -1;
|
||||
#ifdef ENABLE_COLOR
|
||||
else if (strcasecmp(keyword, "syntax") == 0)
|
||||
parse_syntax(ptr);
|
||||
else if (strcasecmp(keyword, "color") == 0)
|
||||
parse_colors(ptr, FALSE);
|
||||
else if (strcasecmp(keyword, "icolor") == 0)
|
||||
parse_colors(ptr, TRUE);
|
||||
#endif /* ENABLE_COLOR */
|
||||
else
|
||||
rcfile_error(N_("Command %s not understood"), keyword);
|
||||
|
||||
if (set == 0)
|
||||
continue;
|
||||
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(N_("Missing flag"));
|
||||
continue;
|
||||
}
|
||||
|
||||
option = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
|
||||
for (i = 0; rcopts[i].name != NULL; i++) {
|
||||
if (strcasecmp(option, rcopts[i].name) == 0) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "parse_rcfile(): name = \"%s\"\n", rcopts[i].name);
|
||||
#endif
|
||||
if (set == 1) {
|
||||
if (rcopts[i].flag != 0)
|
||||
/* This option has a flag, so it doesn't take an
|
||||
* argument. */
|
||||
SET(rcopts[i].flag);
|
||||
else {
|
||||
/* This option doesn't have a flag, so it takes
|
||||
* an argument. */
|
||||
if (*ptr == '\0') {
|
||||
rcfile_error(
|
||||
N_("Option %s requires an argument"),
|
||||
rcopts[i].name);
|
||||
break;
|
||||
}
|
||||
option = ptr;
|
||||
if (*option == '"')
|
||||
option++;
|
||||
ptr = parse_argument(ptr);
|
||||
|
||||
option = mallocstrcpy(NULL, option);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "option = \"%s\"\n", option);
|
||||
#endif
|
||||
|
||||
/* Make sure option is a valid multibyte
|
||||
* string. */
|
||||
if (!is_valid_mbstring(option)) {
|
||||
rcfile_error(
|
||||
N_("Option is not a valid multibyte string"));
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
if (strcasecmp(rcopts[i].name, "operatingdir") == 0)
|
||||
operating_dir = option;
|
||||
else
|
||||
#endif
|
||||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
if (strcasecmp(rcopts[i].name, "fill") == 0) {
|
||||
if (!parse_num(option, &wrap_at)) {
|
||||
rcfile_error(
|
||||
N_("Requested fill size %s invalid"),
|
||||
option);
|
||||
wrap_at = -CHARS_FROM_EOL;
|
||||
} else
|
||||
free(option);
|
||||
} else
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
|
||||
whitespace = option;
|
||||
if (mbstrlen(whitespace) != 2 ||
|
||||
strlenpt(whitespace) != 2) {
|
||||
rcfile_error(
|
||||
N_("Two single-column characters required"));
|
||||
free(whitespace);
|
||||
whitespace = NULL;
|
||||
} else {
|
||||
whitespace_len[0] =
|
||||
parse_mbchar(whitespace, NULL,
|
||||
NULL, NULL);
|
||||
whitespace_len[1] =
|
||||
parse_mbchar(whitespace +
|
||||
whitespace_len[0], NULL,
|
||||
NULL, NULL);
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
if (strcasecmp(rcopts[i].name, "punct") == 0) {
|
||||
punct = option;
|
||||
if (has_blank_mbchars(punct)) {
|
||||
rcfile_error(
|
||||
N_("Non-blank characters required"));
|
||||
free(punct);
|
||||
punct = NULL;
|
||||
}
|
||||
} else if (strcasecmp(rcopts[i].name,
|
||||
"brackets") == 0) {
|
||||
brackets = option;
|
||||
if (has_blank_mbchars(brackets)) {
|
||||
rcfile_error(
|
||||
N_("Non-blank characters required"));
|
||||
free(brackets);
|
||||
brackets = NULL;
|
||||
}
|
||||
} else if (strcasecmp(rcopts[i].name,
|
||||
"quotestr") == 0)
|
||||
quotestr = option;
|
||||
else
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
if (strcasecmp(rcopts[i].name,
|
||||
"backupdir") == 0)
|
||||
backup_dir = option;
|
||||
else
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
if (strcasecmp(rcopts[i].name, "speller") == 0)
|
||||
alt_speller = option;
|
||||
else
|
||||
#endif
|
||||
if (strcasecmp(rcopts[i].name,
|
||||
"tabsize") == 0) {
|
||||
if (!parse_num(option, &tabsize) ||
|
||||
tabsize <= 0) {
|
||||
rcfile_error(
|
||||
N_("Requested tab size %s invalid"),
|
||||
option);
|
||||
tabsize = -1;
|
||||
} else
|
||||
free(option);
|
||||
} else
|
||||
assert(FALSE);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "flag = %ld\n", rcopts[i].flag);
|
||||
#endif
|
||||
} else if (rcopts[i].flag != 0)
|
||||
UNSET(rcopts[i].flag);
|
||||
else
|
||||
rcfile_error(N_("Cannot unset flag %s"),
|
||||
rcopts[i].name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (rcopts[i].name == NULL)
|
||||
rcfile_error(N_("Unknown flag %s"), option);
|
||||
}
|
||||
|
||||
free(buf);
|
||||
fclose(rcstream);
|
||||
lineno = 0;
|
||||
|
||||
if (errors) {
|
||||
errors = FALSE;
|
||||
fprintf(stderr,
|
||||
_("\nPress Return to continue starting nano\n"));
|
||||
while (getchar() != '\n')
|
||||
;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* The main rc file function, tries to open the rc file */
|
||||
void do_rcfile(void)
|
||||
{
|
||||
FILE *rcstream;
|
||||
|
||||
#ifdef SYSCONFDIR
|
||||
assert(sizeof(SYSCONFDIR) == strlen(SYSCONFDIR) + 1);
|
||||
|
||||
nanorc = mallocstrcpy(nanorc, SYSCONFDIR "/nanorc");
|
||||
/* Try to open the system-wide nanorc. */
|
||||
rcstream = fopen(nanorc, "r");
|
||||
if (rcstream != NULL)
|
||||
parse_rcfile(rcstream);
|
||||
#endif
|
||||
|
||||
#if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING)
|
||||
/* We've already read SYSCONFDIR/nanorc, if it's there. If we're
|
||||
* root and --disable-wrapping-as-root is used, turn wrapping
|
||||
* off now. */
|
||||
if (geteuid() == NANO_ROOT_UID)
|
||||
SET(NO_WRAP);
|
||||
#endif
|
||||
|
||||
get_homedir();
|
||||
|
||||
if (homedir == NULL)
|
||||
rcfile_error(N_("I can't find my home directory! Wah!"));
|
||||
else {
|
||||
nanorc = charealloc(nanorc, strlen(homedir) + 9);
|
||||
sprintf(nanorc, "%s/.nanorc", homedir);
|
||||
rcstream = fopen(nanorc, "r");
|
||||
|
||||
if (rcstream == NULL) {
|
||||
/* Don't complain about the file's not existing. */
|
||||
if (errno != ENOENT)
|
||||
rcfile_error(N_("Error reading %s: %s"), nanorc,
|
||||
strerror(errno));
|
||||
} else
|
||||
parse_rcfile(rcstream);
|
||||
}
|
||||
|
||||
free(nanorc);
|
||||
nanorc = NULL;
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
set_colorpairs();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NANORC */
|
||||
1314
src/search.c
Normal file
1314
src/search.c
Normal file
File diff suppressed because it is too large
Load Diff
474
src/utils.c
Normal file
474
src/utils.c
Normal file
@@ -0,0 +1,474 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* utils.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2005 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, but *
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
||||
* General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
||||
* 02110-1301, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
#ifdef BROKEN_REGEXEC
|
||||
/* Work around a potential segfault in glibc 2.2.3's regexec(). */
|
||||
int safe_regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags)
|
||||
{
|
||||
if (string != NULL && *string != '\0')
|
||||
return regexec(preg, string, nmatch, pmatch, eflags);
|
||||
|
||||
return REG_NOMATCH;
|
||||
}
|
||||
#endif
|
||||
|
||||
int regexp_bol_or_eol(const regex_t *preg, const char *string)
|
||||
{
|
||||
return (regexec(preg, string, 0, NULL, 0) == 0 &&
|
||||
regexec(preg, string, 0, NULL, REG_NOTBOL | REG_NOTEOL) ==
|
||||
REG_NOMATCH);
|
||||
}
|
||||
#endif /* HAVE_REGEX_H */
|
||||
|
||||
int digits(size_t n)
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
while (n > 10) {
|
||||
n /= 10;
|
||||
i++;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Return the user's home directory. We use $HOME, and if that fails,
|
||||
* we fall back on getpwuid(). */
|
||||
void get_homedir(void)
|
||||
{
|
||||
if (homedir == NULL) {
|
||||
const char *homenv = getenv("HOME");
|
||||
|
||||
if (homenv == NULL) {
|
||||
const struct passwd *userage = getpwuid(geteuid());
|
||||
|
||||
if (userage != NULL)
|
||||
homenv = userage->pw_dir;
|
||||
}
|
||||
homedir = mallocstrcpy(NULL, homenv);
|
||||
}
|
||||
}
|
||||
|
||||
/* Read a ssize_t from str, and store it in *val (if val is not NULL).
|
||||
* On error, we return FALSE and don't change *val. Otherwise, we
|
||||
* return TRUE. */
|
||||
bool parse_num(const char *str, ssize_t *val)
|
||||
{
|
||||
char *first_error;
|
||||
ssize_t j;
|
||||
|
||||
assert(str != NULL);
|
||||
|
||||
j = (ssize_t)strtol(str, &first_error, 10);
|
||||
|
||||
if (errno == ERANGE || *str == '\0' || *first_error != '\0')
|
||||
return FALSE;
|
||||
|
||||
if (val != NULL)
|
||||
*val = j;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Read an int and a ssize_t, separated by a comma, from str, and store
|
||||
* them in *line and *column (if they're not both NULL). On error, we
|
||||
* return FALSE. Otherwise, we return TRUE. */
|
||||
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column)
|
||||
{
|
||||
bool retval = TRUE;
|
||||
const char *comma;
|
||||
|
||||
assert(str != NULL);
|
||||
|
||||
comma = strchr(str, ',');
|
||||
|
||||
if (comma != NULL && column != NULL) {
|
||||
if (!parse_num(str + (comma - str + 1), column))
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
if (line != NULL) {
|
||||
if (comma != NULL) {
|
||||
char *str_line = mallocstrncpy(NULL, str, comma - str + 1);
|
||||
str_line[comma - str] = '\0';
|
||||
|
||||
if (str_line[0] != '\0' && !parse_num(str_line, line))
|
||||
retval = FALSE;
|
||||
|
||||
free(str_line);
|
||||
} else if (!parse_num(str, line))
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* Fix the memory allocation for a string. */
|
||||
void align(char **str)
|
||||
{
|
||||
assert(str != NULL);
|
||||
|
||||
if (*str != NULL)
|
||||
*str = charealloc(*str, strlen(*str) + 1);
|
||||
}
|
||||
|
||||
/* Null a string at a certain index and align it. */
|
||||
void null_at(char **data, size_t index)
|
||||
{
|
||||
assert(data != NULL);
|
||||
|
||||
*data = charealloc(*data, index + 1);
|
||||
(*data)[index] = '\0';
|
||||
}
|
||||
|
||||
/* For non-null-terminated lines. A line, by definition, shouldn't
|
||||
* normally have newlines in it, so encode its nulls as newlines. */
|
||||
void unsunder(char *str, size_t true_len)
|
||||
{
|
||||
assert(str != NULL);
|
||||
|
||||
for (; true_len > 0; true_len--, str++) {
|
||||
if (*str == '\0')
|
||||
*str = '\n';
|
||||
}
|
||||
}
|
||||
|
||||
/* For non-null-terminated lines. A line, by definition, shouldn't
|
||||
* normally have newlines in it, so decode its newlines into nulls. */
|
||||
void sunder(char *str)
|
||||
{
|
||||
assert(str != NULL);
|
||||
|
||||
for (; *str != '\0'; str++) {
|
||||
if (*str == '\n')
|
||||
*str = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||
#ifndef HAVE_GETLINE
|
||||
/* This function is equivalent to getline(). It was adapted from
|
||||
* GNU mailutils' getline() function. */
|
||||
ssize_t ngetline(char **lineptr, size_t *n, FILE *stream)
|
||||
{
|
||||
return getdelim(lineptr, n, '\n', stream);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GETDELIM
|
||||
/* This function is equivalent to getdelim(). It was adapted from
|
||||
* GNU mailutils' getdelim() function. */
|
||||
ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream)
|
||||
{
|
||||
size_t indx = 0;
|
||||
int c;
|
||||
|
||||
/* Sanity checks. */
|
||||
if (lineptr == NULL || n == NULL || stream == NULL)
|
||||
return -1;
|
||||
|
||||
/* Allocate the line the first time. */
|
||||
if (*lineptr == NULL) {
|
||||
*lineptr = charalloc(MAX_BUF_SIZE);
|
||||
*n = MAX_BUF_SIZE;
|
||||
}
|
||||
|
||||
while ((c = getc(stream)) != EOF) {
|
||||
/* Check if more memory is needed. */
|
||||
if (indx >= *n) {
|
||||
*lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
|
||||
*n += MAX_BUF_SIZE;
|
||||
}
|
||||
|
||||
/* Push the result in the line. */
|
||||
(*lineptr)[indx++] = (char)c;
|
||||
|
||||
/* Bail out. */
|
||||
if (c == delim)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Make room for the null character. */
|
||||
if (indx >= *n) {
|
||||
*lineptr = charealloc(*lineptr, *n + MAX_BUF_SIZE);
|
||||
*n += MAX_BUF_SIZE;
|
||||
}
|
||||
|
||||
/* Null terminate the buffer. */
|
||||
null_at(lineptr, indx++);
|
||||
*n = indx;
|
||||
|
||||
/* The last line may not have the delimiter, we have to return what
|
||||
* we got and the error will be seen on the next iteration. */
|
||||
return (c == EOF && (indx - 1) == 0) ? -1 : indx - 1;
|
||||
}
|
||||
#endif
|
||||
#endif /* !NANO_SMALL && ENABLE_NANORC */
|
||||
|
||||
/* If we are searching backwards, we will find the last match that
|
||||
* starts no later than start. Otherwise we find the first match
|
||||
* starting no earlier than start. If we are doing a regexp search, we
|
||||
* fill in the global variable regmatches with at most 9 subexpression
|
||||
* matches. Also, all .rm_so elements are relative to the start of the
|
||||
* whole match, so regmatches[0].rm_so == 0. */
|
||||
const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *start)
|
||||
{
|
||||
/* start can be 1 character before the start or after the end of the
|
||||
* line. In either case, we just say no match was found. */
|
||||
if ((start > haystack && *(start - 1) == '\0') || start < haystack)
|
||||
return NULL;
|
||||
|
||||
assert(haystack != NULL && needle != NULL && start != NULL);
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP)) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(BACKWARDS_SEARCH)) {
|
||||
if (regexec(&search_regexp, haystack, 1, regmatches,
|
||||
0) == 0 && haystack + regmatches[0].rm_so <= start) {
|
||||
const char *retval = haystack + regmatches[0].rm_so;
|
||||
|
||||
/* Search forward until there are no more matches. */
|
||||
while (regexec(&search_regexp, retval + 1, 1,
|
||||
regmatches, REG_NOTBOL) == 0 &&
|
||||
retval + regmatches[0].rm_so + 1 <= start)
|
||||
retval += regmatches[0].rm_so + 1;
|
||||
/* Finally, put the subexpression matches in global
|
||||
* variable regmatches. The REG_NOTBOL flag doesn't
|
||||
* matter now. */
|
||||
regexec(&search_regexp, retval, 10, regmatches, 0);
|
||||
return retval;
|
||||
}
|
||||
} else
|
||||
#endif /* !NANO_SMALL */
|
||||
if (regexec(&search_regexp, start, 10, regmatches,
|
||||
(start > haystack) ? REG_NOTBOL : 0) == 0) {
|
||||
const char *retval = start + regmatches[0].rm_so;
|
||||
|
||||
regexec(&search_regexp, retval, 10, regmatches, 0);
|
||||
return retval;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* HAVE_REGEX_H */
|
||||
#if !defined(NANO_SMALL) || !defined(DISABLE_SPELLER)
|
||||
if (ISSET(CASE_SENSITIVE)) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(BACKWARDS_SEARCH))
|
||||
return revstrstr(haystack, needle, start);
|
||||
else
|
||||
#endif
|
||||
return strstr(start, needle);
|
||||
}
|
||||
#endif /* !DISABLE_SPELLER || !NANO_SMALL */
|
||||
#ifndef NANO_SMALL
|
||||
else if (ISSET(BACKWARDS_SEARCH))
|
||||
return mbrevstrcasestr(haystack, needle, start);
|
||||
#endif
|
||||
return mbstrcasestr(start, needle);
|
||||
}
|
||||
|
||||
/* This is a wrapper for the perror() function. The wrapper takes care
|
||||
* of curses, calls perror() (which writes to stderr), and then
|
||||
* refreshes the screen. Note that nperror() causes the window to
|
||||
* flicker once. */
|
||||
void nperror(const char *s)
|
||||
{
|
||||
/* Leave curses mode and go to the terminal. */
|
||||
if (endwin() != ERR) {
|
||||
perror(s); /* Print the error. */
|
||||
total_refresh(); /* Return to curses and refresh. */
|
||||
}
|
||||
}
|
||||
|
||||
/* Thanks, BG, many people have been asking for this... */
|
||||
void *nmalloc(size_t howmuch)
|
||||
{
|
||||
void *r = malloc(howmuch);
|
||||
|
||||
if (r == NULL && howmuch != 0)
|
||||
die(_("nano is out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void *nrealloc(void *ptr, size_t howmuch)
|
||||
{
|
||||
void *r = realloc(ptr, howmuch);
|
||||
|
||||
if (r == NULL && howmuch != 0)
|
||||
die(_("nano is out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Copy the first n characters of one malloc()ed string to another
|
||||
* pointer. Should be used as: "dest = mallocstrncpy(dest, src,
|
||||
* n);". */
|
||||
char *mallocstrncpy(char *dest, const char *src, size_t n)
|
||||
{
|
||||
if (src == NULL)
|
||||
src = "";
|
||||
|
||||
if (src != dest)
|
||||
free(dest);
|
||||
|
||||
dest = charalloc(n);
|
||||
strncpy(dest, src, n);
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
/* Copy one malloc()ed string to another pointer. Should be used as:
|
||||
* "dest = mallocstrcpy(dest, src);". */
|
||||
char *mallocstrcpy(char *dest, const char *src)
|
||||
{
|
||||
return mallocstrncpy(dest, src, (src == NULL) ? 1 :
|
||||
strlen(src) + 1);
|
||||
}
|
||||
|
||||
/* Free the malloc()ed string at dest and return the malloc()ed string
|
||||
* at src. Should be used as: "answer = mallocstrassn(answer,
|
||||
* real_dir_from_tilde(answer));". */
|
||||
char *mallocstrassn(char *dest, char *src)
|
||||
{
|
||||
free(dest);
|
||||
return src;
|
||||
}
|
||||
|
||||
/* Append a new magicline to filebot. */
|
||||
void new_magicline(void)
|
||||
{
|
||||
filebot->next = (filestruct *)nmalloc(sizeof(filestruct));
|
||||
filebot->next->data = mallocstrcpy(NULL, "");
|
||||
filebot->next->prev = filebot;
|
||||
filebot->next->next = NULL;
|
||||
filebot->next->lineno = filebot->lineno + 1;
|
||||
filebot = filebot->next;
|
||||
totlines++;
|
||||
totsize++;
|
||||
}
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Remove the magicline from filebot, if there is one and it isn't the
|
||||
* only line in the file. */
|
||||
void remove_magicline(void)
|
||||
{
|
||||
if (filebot->data[0] == '\0' && filebot->prev != NULL) {
|
||||
filebot = filebot->prev;
|
||||
free_filestruct(filebot->next);
|
||||
filebot->next = NULL;
|
||||
totlines--;
|
||||
totsize--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set top_x and bot_x to the top and bottom x-coordinates of the mark,
|
||||
* respectively, based on the locations of top and bot. If
|
||||
* right_side_up isn't NULL, set it to TRUE If the mark begins with
|
||||
* (mark_beginbuf, mark_beginx) and ends with (current, current_x), or
|
||||
* FALSE otherwise. */
|
||||
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
||||
**bot, size_t *bot_x, bool *right_side_up)
|
||||
{
|
||||
assert(top != NULL && top_x != NULL && bot != NULL && bot_x != NULL);
|
||||
|
||||
if ((current->lineno == mark_beginbuf->lineno && current_x >
|
||||
mark_beginx) || current->lineno > mark_beginbuf->lineno) {
|
||||
*top = mark_beginbuf;
|
||||
*top_x = mark_beginx;
|
||||
*bot = current;
|
||||
*bot_x = current_x;
|
||||
if (right_side_up != NULL)
|
||||
*right_side_up = TRUE;
|
||||
} else {
|
||||
*bot = mark_beginbuf;
|
||||
*bot_x = mark_beginx;
|
||||
*top = current;
|
||||
*top_x = current_x;
|
||||
if (right_side_up != NULL)
|
||||
*right_side_up = FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Calculate the number of lines and the number of characters between
|
||||
* begin and end, and return them in lines and size, respectively. */
|
||||
void get_totals(const filestruct *begin, const filestruct *end, size_t
|
||||
*lines, size_t *size)
|
||||
{
|
||||
const filestruct *f;
|
||||
|
||||
if (lines != NULL)
|
||||
*lines = 0;
|
||||
if (size != NULL)
|
||||
*size = 0;
|
||||
|
||||
/* Go through the lines from begin to end->prev, if we can. */
|
||||
for (f = begin; f != NULL && f != end; f = f->next) {
|
||||
/* Count this line. */
|
||||
if (lines != NULL)
|
||||
(*lines)++;
|
||||
|
||||
/* Count the number of characters on this line. */
|
||||
if (size != NULL) {
|
||||
*size += mbstrlen(f->data);
|
||||
|
||||
/* Count the newline if we have one. */
|
||||
if (f->next != NULL)
|
||||
(*size)++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Go through the line at end, if we can. */
|
||||
if (f != NULL) {
|
||||
/* Count this line. */
|
||||
if (lines != NULL)
|
||||
(*lines)++;
|
||||
|
||||
/* Count the number of characters on this line. */
|
||||
if (size != NULL) {
|
||||
*size += mbstrlen(f->data);
|
||||
|
||||
/* Count the newline if we have one. */
|
||||
if (f->next != NULL)
|
||||
(*size)++;
|
||||
}
|
||||
}
|
||||
}
|
||||
4197
src/winio.c
Normal file
4197
src/winio.c
Normal file
File diff suppressed because it is too large
Load Diff
405
utils.c
405
utils.c
@@ -1,405 +0,0 @@
|
||||
/* $Id$ */
|
||||
/**************************************************************************
|
||||
* utils.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2003 Chris Allegretta *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2, or (at your option) *
|
||||
* any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef BROKEN_REGEXEC
|
||||
#undef regexec
|
||||
int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags)
|
||||
{
|
||||
if (string != NULL && *string != '\0')
|
||||
return regexec(preg, string, nmatch, pmatch, eflags);
|
||||
return REG_NOMATCH;
|
||||
}
|
||||
#define regexec(preg, string, nmatch, pmatch, eflags) regexec_safe(preg, string, nmatch, pmatch, eflags)
|
||||
#endif
|
||||
|
||||
int is_cntrl_char(int c)
|
||||
{
|
||||
return (-128 <= c && c < -96) || (0 <= c && c < 32) ||
|
||||
(127 <= c && c < 160);
|
||||
}
|
||||
|
||||
int num_of_digits(int n)
|
||||
{
|
||||
int i = 1;
|
||||
|
||||
if (n < 0)
|
||||
n = -n;
|
||||
|
||||
while (n > 10) {
|
||||
n /= 10;
|
||||
i++;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Fix the memory allocation for a string. */
|
||||
void align(char **strp)
|
||||
{
|
||||
assert(strp != NULL);
|
||||
if (*strp != NULL)
|
||||
*strp = charealloc(*strp, strlen(*strp) + 1);
|
||||
}
|
||||
|
||||
/* Null a string at a certain index and align it. */
|
||||
void null_at(char **data, size_t index)
|
||||
{
|
||||
assert(data != NULL);
|
||||
*data = charealloc(*data, index + 1);
|
||||
(*data)[index] = '\0';
|
||||
}
|
||||
|
||||
/* For non-null-terminated lines. A line, by definition, shouldn't
|
||||
* normally have newlines in it, so encode its nulls as newlines. */
|
||||
void unsunder(char *str, size_t true_len)
|
||||
{
|
||||
assert(str != NULL);
|
||||
for(; true_len > 0; true_len--, str++)
|
||||
if (*str == '\0')
|
||||
*str = '\n';
|
||||
}
|
||||
|
||||
/* For non-null-terminated lines. A line, by definition, shouldn't
|
||||
* normally have newlines in it, so decode its newlines into nulls. */
|
||||
void sunder(char *str)
|
||||
{
|
||||
assert(str != NULL);
|
||||
for(; *str != '\0'; str++)
|
||||
if (*str == '\n')
|
||||
*str = '\0';
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRCASECMP
|
||||
/* This function is equivalent to strcasecmp(). */
|
||||
int nstricmp(const char *s1, const char *s2)
|
||||
{
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
for (; *s1 != '\0' && *s2 != '\0'; s1++, s2++) {
|
||||
if (tolower(*s1) != tolower(*s2))
|
||||
break;
|
||||
}
|
||||
return (tolower(*s1) - tolower(*s2));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_STRNCASECMP
|
||||
/* This function is equivalent to strncasecmp(). */
|
||||
int nstrnicmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
assert(s1 != NULL && s2 != NULL);
|
||||
for (; n > 0 && *s1 != '\0' && *s2 != '\0'; n--, s1++, s2++) {
|
||||
if (tolower(*s1) != tolower(*s2))
|
||||
break;
|
||||
}
|
||||
if (n > 0)
|
||||
return (tolower(*s1) - tolower(*s2));
|
||||
else if (n == 0)
|
||||
return 0;
|
||||
else if (n < 0)
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* None of this is needed if we're using NANO_SMALL! */
|
||||
#ifndef NANO_SMALL
|
||||
const char *revstrstr(const char *haystack, const char *needle,
|
||||
const char *rev_start)
|
||||
{
|
||||
for(; rev_start >= haystack ; rev_start--) {
|
||||
const char *r, *q;
|
||||
|
||||
for (r = rev_start, q = needle ; *q == *r && *q != '\0'; r++, q++)
|
||||
;
|
||||
if (*q == '\0')
|
||||
return rev_start;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *revstristr(const char *haystack, const char *needle,
|
||||
const char *rev_start)
|
||||
{
|
||||
for (; rev_start >= haystack; rev_start--) {
|
||||
const char *r = rev_start, *q = needle;
|
||||
|
||||
for (; (tolower(*q) == tolower(*r)) && (*q != '\0') ; r++, q++)
|
||||
;
|
||||
if (*q == '\0')
|
||||
return rev_start;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* This is now mutt's version (called mutt_stristr) because it doesn't
|
||||
* use memory allocation to do a simple search (yuck). */
|
||||
const char *stristr(const char *haystack, const char *needle)
|
||||
{
|
||||
const char *p, *q;
|
||||
|
||||
if (haystack == NULL)
|
||||
return NULL;
|
||||
if (needle == NULL)
|
||||
return haystack;
|
||||
|
||||
while (*(p = haystack) != '\0') {
|
||||
for (q = needle; *p != 0 && *q != 0 && tolower(*p) == tolower(*q); p++, q++)
|
||||
;
|
||||
if (*q == 0)
|
||||
return haystack;
|
||||
haystack++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If we are searching backwards, we will find the last match
|
||||
* that starts no later than rev_start. If we are doing a regexp search,
|
||||
* then line_pos should be 0 if haystack starts at the beginning of a
|
||||
* line, and positive otherwise. In the regexp case, we fill in the
|
||||
* global variable regmatches with at most 9 subexpression matches. Also,
|
||||
* all .rm_so elements are relative to the start of the whole match, so
|
||||
* regmatches[0].rm_so == 0. */
|
||||
const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
const char *rev_start, int line_pos)
|
||||
{
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP)) {
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(REVERSE_SEARCH)) {
|
||||
/* When doing a backwards search, haystack is a whole line. */
|
||||
if (!regexec(&search_regexp, haystack, 1, regmatches, 0) &&
|
||||
haystack + regmatches[0].rm_so <= rev_start) {
|
||||
const char *retval = haystack + regmatches[0].rm_so;
|
||||
|
||||
/* Search forward until there is no more match. */
|
||||
while (!regexec(&search_regexp, retval + 1, 1, regmatches,
|
||||
REG_NOTBOL) &&
|
||||
retval + 1 + regmatches[0].rm_so <= rev_start)
|
||||
retval += 1 + regmatches[0].rm_so;
|
||||
/* Finally, put the subexpression matches in global
|
||||
* variable regmatches. The REG_NOTBOL flag doesn't
|
||||
* matter now. */
|
||||
regexec(&search_regexp, retval, 10, regmatches, 0);
|
||||
return retval;
|
||||
}
|
||||
} else
|
||||
#endif /* !NANO_SMALL */
|
||||
if (!regexec(&search_regexp, haystack, 10, regmatches,
|
||||
line_pos > 0 ? REG_NOTBOL : 0)) {
|
||||
const char *retval = haystack + regmatches[0].rm_so;
|
||||
|
||||
regexec(&search_regexp, retval, 10, regmatches, 0);
|
||||
return retval;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif /* HAVE_REGEX_H */
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(CASE_SENSITIVE)) {
|
||||
if (ISSET(REVERSE_SEARCH))
|
||||
return revstrstr(haystack, needle, rev_start);
|
||||
else
|
||||
return strstr(haystack, needle);
|
||||
} else if (ISSET(REVERSE_SEARCH))
|
||||
return revstristr(haystack, needle, rev_start);
|
||||
#endif
|
||||
return stristr(haystack, needle);
|
||||
}
|
||||
|
||||
/* This is a wrapper for the perror function. The wrapper takes care of
|
||||
* ncurses, calls perror (which writes to STDERR), then refreshes the
|
||||
* screen. Note that nperror causes the window to flicker once. */
|
||||
void nperror(const char *s)
|
||||
{
|
||||
/* leave ncurses mode, go to the terminal */
|
||||
if (endwin() != ERR) {
|
||||
perror(s); /* print the error */
|
||||
total_refresh(); /* return to ncurses and repaint */
|
||||
}
|
||||
}
|
||||
|
||||
/* Thanks BG, many ppl have been asking for this... */
|
||||
void *nmalloc(size_t howmuch)
|
||||
{
|
||||
void *r = malloc(howmuch);
|
||||
|
||||
if (r == NULL && howmuch != 0)
|
||||
die(_("nano is out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void *nrealloc(void *ptr, size_t howmuch)
|
||||
{
|
||||
void *r = realloc(ptr, howmuch);
|
||||
|
||||
if (r == NULL && howmuch != 0)
|
||||
die(_("nano is out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Copy one malloc()ed string to another pointer. Should be used as:
|
||||
* dest = mallocstrcpy(dest, src); */
|
||||
char *mallocstrcpy(char *dest, const char *src)
|
||||
{
|
||||
if (src == dest)
|
||||
return dest;
|
||||
|
||||
if (dest != NULL)
|
||||
free(dest);
|
||||
|
||||
if (src == NULL)
|
||||
return NULL;
|
||||
|
||||
dest = charalloc(strlen(src) + 1);
|
||||
strcpy(dest, src);
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
/* Append a new magic-line to filebot. */
|
||||
void new_magicline(void)
|
||||
{
|
||||
filebot->next = (filestruct *)nmalloc(sizeof(filestruct));
|
||||
filebot->next->data = charalloc(1);
|
||||
filebot->next->data[0] = '\0';
|
||||
filebot->next->prev = filebot;
|
||||
filebot->next->next = NULL;
|
||||
filebot->next->lineno = filebot->lineno + 1;
|
||||
filebot = filebot->next;
|
||||
totlines++;
|
||||
totsize++;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_TABCOMP
|
||||
/*
|
||||
* Routine to see if a text string is matched by a wildcard pattern.
|
||||
* Returns TRUE if the text is matched, or FALSE if it is not matched
|
||||
* or if the pattern is invalid.
|
||||
* * matches zero or more characters
|
||||
* ? matches a single character
|
||||
* [abc] matches 'a', 'b' or 'c'
|
||||
* \c quotes character c
|
||||
* Adapted from code written by Ingo Wilken, and
|
||||
* then taken from sash, Copyright (c) 1999 by David I. Bell
|
||||
* Permission is granted to use, distribute, or modify this source,
|
||||
* provided that this copyright notice remains intact.
|
||||
* Permission to distribute this code under the GPL has been granted.
|
||||
*/
|
||||
int check_wildcard_match(const char *text, const char *pattern)
|
||||
{
|
||||
const char *retrypat;
|
||||
const char *retrytext;
|
||||
int ch;
|
||||
int found;
|
||||
int len;
|
||||
|
||||
retrypat = NULL;
|
||||
retrytext = NULL;
|
||||
|
||||
while (*text != '\0' || *pattern != '\0') {
|
||||
ch = *pattern++;
|
||||
|
||||
switch (ch) {
|
||||
case '*':
|
||||
retrypat = pattern;
|
||||
retrytext = text;
|
||||
break;
|
||||
|
||||
case '[':
|
||||
found = FALSE;
|
||||
|
||||
while ((ch = *pattern++) != ']') {
|
||||
if (ch == '\\')
|
||||
ch = *pattern++;
|
||||
|
||||
if (ch == '\0')
|
||||
return FALSE;
|
||||
|
||||
if (*text == ch)
|
||||
found = TRUE;
|
||||
}
|
||||
len = strlen(text);
|
||||
if (found == FALSE && len != 0) {
|
||||
return FALSE;
|
||||
}
|
||||
if (found == TRUE) {
|
||||
if (strlen(pattern) == 0 && len == 1) {
|
||||
return TRUE;
|
||||
}
|
||||
if (len != 0) {
|
||||
text++;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* fall into next case */
|
||||
|
||||
case '?':
|
||||
if (*text++ == '\0')
|
||||
return FALSE;
|
||||
|
||||
break;
|
||||
|
||||
case '\\':
|
||||
ch = *pattern++;
|
||||
|
||||
if (ch == '\0')
|
||||
return FALSE;
|
||||
|
||||
/* fall into next case */
|
||||
|
||||
default:
|
||||
if (*text == ch) {
|
||||
if (*text != '\0')
|
||||
text++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*text != '\0') {
|
||||
pattern = retrypat;
|
||||
text = ++retrytext;
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (pattern == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user