Compare commits
175 Commits
v1.1.11
...
v1.1.99pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ba3279073 | ||
|
|
f717f98d07 | ||
|
|
d3c8f09d17 | ||
|
|
1debce2865 | ||
|
|
5acbc8bb0d | ||
|
|
aebfac8567 | ||
|
|
fee360a06f | ||
|
|
4f989faa6e | ||
|
|
2e39c1c283 | ||
|
|
65f075d3a1 | ||
|
|
bcc8688a3b | ||
|
|
d0845df735 | ||
|
|
fe1d0722d4 | ||
|
|
a0449d92a0 | ||
|
|
7641708cb6 | ||
|
|
e9b5c6fe90 | ||
|
|
d127c71ab3 | ||
|
|
b2cd248d1c | ||
|
|
428f620370 | ||
|
|
fdcb9e92d6 | ||
|
|
a4a9d1759f | ||
|
|
d16f9f66a1 | ||
|
|
65f998e429 | ||
|
|
f16ca28efb | ||
|
|
4640fe3f57 | ||
|
|
a90d0cf214 | ||
|
|
f8f2d586dc | ||
|
|
3a78406d56 | ||
|
|
2ddd75e705 | ||
|
|
e61be2dd6d | ||
|
|
992a25a69c | ||
|
|
a66a8f72a4 | ||
|
|
ab5fec61a8 | ||
|
|
97e10b5d0d | ||
|
|
588df68a8c | ||
|
|
bfc8b2ac4d | ||
|
|
bcaeeb4411 | ||
|
|
3cdf6ff1de | ||
|
|
17ec14b9a5 | ||
|
|
a3daf3a256 | ||
|
|
d6e84363d7 | ||
|
|
3083ff908c | ||
|
|
201f1d976a | ||
|
|
5ec68628ce | ||
|
|
5ea694ebd1 | ||
|
|
a577d5a8b8 | ||
|
|
cddbfd0988 | ||
|
|
5c8c276622 | ||
|
|
7dace110b0 | ||
|
|
d89eb91e77 | ||
|
|
c45335782a | ||
|
|
434d686ee4 | ||
|
|
0eab236580 | ||
|
|
dbfc56cb8e | ||
|
|
a0d89977b7 | ||
|
|
cff6e6f60f | ||
|
|
ce452fb880 | ||
|
|
5c63f27721 | ||
|
|
f80a59c7cc | ||
|
|
858d9d90cb | ||
|
|
2a7b8b24bb | ||
|
|
5d71514f21 | ||
|
|
e92a7bcb78 | ||
|
|
db28e96f2c | ||
|
|
d26ab913f1 | ||
|
|
416896efcd | ||
|
|
b698c35f4b | ||
|
|
a340766790 | ||
|
|
47fcfe5d78 | ||
|
|
8a85aa0baa | ||
|
|
64fc78c0f1 | ||
|
|
63d0b48d5b | ||
|
|
77e726d518 | ||
|
|
fa1588608e | ||
|
|
9090f2e44b | ||
|
|
1939c3590b | ||
|
|
1a128afdb2 | ||
|
|
54c1f7932c | ||
|
|
149781d827 | ||
|
|
beca0eb699 | ||
|
|
0e86e60653 | ||
|
|
f22e8bf775 | ||
|
|
3bbc416a73 | ||
|
|
d66349963c | ||
|
|
36fec72f6a | ||
|
|
3d459ad83d | ||
|
|
73a7e7f450 | ||
|
|
eeb500428d | ||
|
|
8495c71dd0 | ||
|
|
f89d698293 | ||
|
|
f426c9edbf | ||
|
|
d46f544758 | ||
|
|
5af5889448 | ||
|
|
b32ccd9257 | ||
|
|
327abdab4a | ||
|
|
d6c8d1a06d | ||
|
|
e6600379c9 | ||
|
|
f9ab3f79e5 | ||
|
|
3f8a63cadb | ||
|
|
d957f5903e | ||
|
|
f3de8b552e | ||
|
|
09fc4300ec | ||
|
|
2ad0f6c0ad | ||
|
|
2d5fc3adac | ||
|
|
d757e25817 | ||
|
|
9b0d18d284 | ||
|
|
b9475525d8 | ||
|
|
73dcc43267 | ||
|
|
a0e829cd8c | ||
|
|
7fc0ddfe38 | ||
|
|
38c563d1e0 | ||
|
|
631ee1faa6 | ||
|
|
48053784e2 | ||
|
|
cb850cee36 | ||
|
|
908f770f7d | ||
|
|
0e7a3f5e2d | ||
|
|
688c8eb112 | ||
|
|
ca7113afee | ||
|
|
497b5040a7 | ||
|
|
54380cf56b | ||
|
|
9fa5fbd3af | ||
|
|
7662c86dbf | ||
|
|
3f1b6851cb | ||
|
|
ed4fb2cf0f | ||
|
|
54abd94d48 | ||
|
|
8031f83422 | ||
|
|
6cd143db7a | ||
|
|
37d594c1bd | ||
|
|
916a8ec69c | ||
|
|
15c28f8b86 | ||
|
|
a65ba51b9e | ||
|
|
63287926cb | ||
|
|
5beed509a6 | ||
|
|
95e0cf584c | ||
|
|
5a9e25ae33 | ||
|
|
9b13ff31bb | ||
|
|
334a94049f | ||
|
|
3e5ad6397c | ||
|
|
bfd2f5613d | ||
|
|
35908f829c | ||
|
|
1d8fa1fa90 | ||
|
|
2a7a9a242f | ||
|
|
848f5be64f | ||
|
|
5ad92ac4f8 | ||
|
|
fd1cf80da1 | ||
|
|
af7a09ddec | ||
|
|
2e938bf6db | ||
|
|
9e050ad51a | ||
|
|
99519ae375 | ||
|
|
0084eaa9e0 | ||
|
|
749def4e1a | ||
|
|
9e2de25eb1 | ||
|
|
76d1ffd673 | ||
|
|
d42abe4484 | ||
|
|
5e4b8cfebb | ||
|
|
dc60b72e96 | ||
|
|
e8ad5ed2f4 | ||
|
|
2257893ac2 | ||
|
|
2a15c584f1 | ||
|
|
d45c5992d3 | ||
|
|
573b61f2af | ||
|
|
1536d4bb0b | ||
|
|
2ab03f6896 | ||
|
|
e42df73644 | ||
|
|
492f8e62f0 | ||
|
|
1dd0bc98a2 | ||
|
|
1801c176d9 | ||
|
|
f4420f8842 | ||
|
|
dc54e12d94 | ||
|
|
4da47eab9e | ||
|
|
dab0299d88 | ||
|
|
1fc9da6597 | ||
|
|
0b761fa277 | ||
|
|
ec6388e255 | ||
|
|
71fb1f5bd1 |
@@ -1,3 +1,6 @@
|
||||
ABOUT-NLS
|
||||
COPYING
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
@@ -21,3 +24,4 @@ nano.spec
|
||||
stamp-h
|
||||
stamp-h.in
|
||||
stamp-h1
|
||||
texinfo.tex
|
||||
|
||||
435
ABOUT-NLS
435
ABOUT-NLS
@@ -1,435 +0,0 @@
|
||||
Notes on the Free Translation Project
|
||||
*************************************
|
||||
|
||||
Free software is going international! The Free Translation Project
|
||||
is a way to get maintainers of free software, translators, and users all
|
||||
together, so that will gradually become able to speak many languages.
|
||||
A few packages already provide translations for their messages.
|
||||
|
||||
If you found this `ABOUT-NLS' file inside a distribution, you may
|
||||
assume that the distributed package does use GNU `gettext' internally,
|
||||
itself available at your nearest GNU archive site. But you do _not_
|
||||
need to install GNU `gettext' prior to configuring, installing or using
|
||||
this package with messages translated.
|
||||
|
||||
Installers will find here some useful hints. These notes also
|
||||
explain how users should proceed for getting the programs to use the
|
||||
available translations. They tell how people wanting to contribute and
|
||||
work at translations should contact the appropriate team.
|
||||
|
||||
When reporting bugs in the `intl/' directory or bugs which may be
|
||||
related to internationalization, you should tell about the version of
|
||||
`gettext' which is used. The information can be found in the
|
||||
`intl/VERSION' file, in internationalized packages.
|
||||
|
||||
Quick configuration advice
|
||||
==========================
|
||||
|
||||
If you want to exploit the full power of internationalization, you
|
||||
should configure it using
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to force usage of internationalizing routines provided within this
|
||||
package, despite the existence of internationalizing capabilities in the
|
||||
operating system where this package is being installed. So far, only
|
||||
the `gettext' implementation in the GNU C library version 2 provides as
|
||||
many features (such as locale alias, message inheritance, automatic
|
||||
charset conversion or plural form handling) as the implementation here.
|
||||
It is also not possible to offer this additional functionality on top
|
||||
of a `catgets' implementation. Future versions of GNU `gettext' will
|
||||
very likely convey even more functionality. So it might be a good idea
|
||||
to change to GNU `gettext' as soon as possible.
|
||||
|
||||
So you need _not_ provide this option if you are using GNU libc 2 or
|
||||
you have installed a recent copy of the GNU gettext package with the
|
||||
included `libintl'.
|
||||
|
||||
INSTALL Matters
|
||||
===============
|
||||
|
||||
Some packages are "localizable" when properly installed; the
|
||||
programs they contain can be made to speak your own native language.
|
||||
Most such packages use GNU `gettext'. Other packages have their own
|
||||
ways to internationalization, predating GNU `gettext'.
|
||||
|
||||
By default, this package will be installed to allow translation of
|
||||
messages. It will automatically detect whether the system already
|
||||
provides the GNU `gettext' functions. If not, the GNU `gettext' own
|
||||
library will be used. This library is wholly contained within this
|
||||
package, usually in the `intl/' subdirectory, so prior installation of
|
||||
the GNU `gettext' package is _not_ required. Installers may use
|
||||
special options at configuration time for changing the default
|
||||
behaviour. The commands:
|
||||
|
||||
./configure --with-included-gettext
|
||||
./configure --disable-nls
|
||||
|
||||
will respectively bypass any pre-existing `gettext' to use the
|
||||
internationalizing routines provided within this package, or else,
|
||||
_totally_ disable translation of messages.
|
||||
|
||||
When you already have GNU `gettext' installed on your system and run
|
||||
configure without an option for your new package, `configure' will
|
||||
probably detect the previously built and installed `libintl.a' file and
|
||||
will decide to use this. This might be not what is desirable. You
|
||||
should use the more recent version of the GNU `gettext' library. I.e.
|
||||
if the file `intl/VERSION' shows that the library which comes with this
|
||||
package is more recent, you should use
|
||||
|
||||
./configure --with-included-gettext
|
||||
|
||||
to prevent auto-detection.
|
||||
|
||||
The configuration process will not test for the `catgets' function
|
||||
and therefore it will not be used. The reason is that even an
|
||||
emulation of `gettext' on top of `catgets' could not provide all the
|
||||
extensions of the GNU `gettext' library.
|
||||
|
||||
Internationalized packages have usually many `po/LL.po' files, where
|
||||
LL gives an ISO 639 two-letter code identifying the language. Unless
|
||||
translations have been forbidden at `configure' time by using the
|
||||
`--disable-nls' switch, all available translations are installed
|
||||
together with the package. However, the environment variable `LINGUAS'
|
||||
may be set, prior to configuration, to limit the installed set.
|
||||
`LINGUAS' should then contain a space separated list of two-letter
|
||||
codes, stating which languages are allowed.
|
||||
|
||||
Using This Package
|
||||
==================
|
||||
|
||||
As a user, if your language has been installed for this package, you
|
||||
only have to set the `LANG' environment variable to the appropriate
|
||||
`LL_CC' combination. Here `LL' is an ISO 639 two-letter language code,
|
||||
and `CC' is an ISO 3166 two-letter country code. For example, let's
|
||||
suppose that you speak German and live in Germany. At the shell
|
||||
prompt, merely execute `setenv LANG de_DE' (in `csh'),
|
||||
`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
|
||||
This can be done from your `.login' or `.profile' file, once and for
|
||||
all.
|
||||
|
||||
You might think that the country code specification is redundant.
|
||||
But in fact, some languages have dialects in different countries. For
|
||||
example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The
|
||||
country code serves to distinguish the dialects.
|
||||
|
||||
The locale naming convention of `LL_CC', with `LL' denoting the
|
||||
language and `CC' denoting the country, is the one use on systems based
|
||||
on GNU libc. On other systems, some variations of this scheme are
|
||||
used, such as `LL' or `LL_CC.ENCODING'. You can get the list of
|
||||
locales supported by your system for your country by running the command
|
||||
`locale -a | grep '^LL''.
|
||||
|
||||
Not all programs have translations for all languages. By default, an
|
||||
English message is shown in place of a nonexistent translation. If you
|
||||
understand other languages, you can set up a priority list of languages.
|
||||
This is done through a different environment variable, called
|
||||
`LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG'
|
||||
for the purpose of message handling, but you still need to have `LANG'
|
||||
set to the primary language; this is required by other parts of the
|
||||
system libraries. For example, some Swedish users who would rather
|
||||
read translations in German than English for when Swedish is not
|
||||
available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
|
||||
|
||||
In the `LANGUAGE' environment variable, but not in the `LANG'
|
||||
environment variable, `LL_CC' combinations can be abbreviated as `LL'
|
||||
to denote the language's main dialect. For example, `de' is equivalent
|
||||
to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
|
||||
(Portuguese as spoken in Portugal) in this context.
|
||||
|
||||
Translating Teams
|
||||
=================
|
||||
|
||||
For the Free Translation Project to be a success, we need interested
|
||||
people who like their own language and write it well, and who are also
|
||||
able to synergize with other translators speaking the same language.
|
||||
Each translation team has its own mailing list. The up-to-date list of
|
||||
teams can be found at the Free Translation Project's homepage,
|
||||
`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
|
||||
area.
|
||||
|
||||
If you'd like to volunteer to _work_ at translating messages, you
|
||||
should become a member of the translating team for your own language.
|
||||
The subscribing address is _not_ the same as the list itself, it has
|
||||
`-request' appended. For example, speakers of Swedish can send a
|
||||
message to `sv-request@li.org', having this message body:
|
||||
|
||||
subscribe
|
||||
|
||||
Keep in mind that team members are expected to participate
|
||||
_actively_ in translations, or at solving translational difficulties,
|
||||
rather than merely lurking around. If your team does not exist yet and
|
||||
you want to start one, or if you are unsure about what to do or how to
|
||||
get started, please write to `translation@iro.umontreal.ca' to reach the
|
||||
coordinator for all translator teams.
|
||||
|
||||
The English team is special. It works at improving and uniformizing
|
||||
the terminology in use. Proven linguistic skill are praised more than
|
||||
programming skill, here.
|
||||
|
||||
Available Packages
|
||||
==================
|
||||
|
||||
Languages are not equally supported in all packages. The following
|
||||
matrix shows the current state of internationalization, as of August
|
||||
2002. The matrix shows, in regard of each package, for which languages
|
||||
PO files have been submitted to translation coordination, with a
|
||||
translation percentage of at least 50%.
|
||||
|
||||
Ready PO files be bg ca cs da de el en eo es et fi fr
|
||||
+----------------------------------------+
|
||||
a2ps | [] [] [] [] |
|
||||
ap-utils | |
|
||||
bash | [] [] [] [] |
|
||||
bfd | [] [] |
|
||||
binutils | [] [] |
|
||||
bison | [] [] [] [] |
|
||||
clisp | |
|
||||
clisp | [] [] [] [] |
|
||||
clisplow | |
|
||||
cpio | [] [] [] [] |
|
||||
darkstat | () |
|
||||
diffutils | [] [] [] [] [] [] |
|
||||
enscript | [] [] |
|
||||
error | [] [] [] |
|
||||
fetchmail | [] () [] [] [] () |
|
||||
fileutils | [] [] [] [] [] |
|
||||
findutils | [] [] [] [] [] [] |
|
||||
flex | [] [] [] [] [] |
|
||||
gas | [] [] |
|
||||
gawk | [] [] [] |
|
||||
gcal | [] [] |
|
||||
gcc | [] [] |
|
||||
gettext | [] [] [] [] [] |
|
||||
gnupg | [] [] [] [] [] [] [] |
|
||||
gprof | [] [] |
|
||||
gpsdrive | () () () () () |
|
||||
grep | [] [] [] [] [] [] [] [] |
|
||||
gretl | [] |
|
||||
gthumb | () () () |
|
||||
hello | [] [] [] [] [] [] [] [] [] |
|
||||
id-utils | [] [] [] |
|
||||
indent | [] [] [] [] [] |
|
||||
jpilot | () [] [] [] |
|
||||
jwhois | [] [] |
|
||||
kbd | [] [] [] |
|
||||
ld | [] [] |
|
||||
libc | [] [] [] [] [] [] [] [] |
|
||||
libiconv | [] [] [] [] |
|
||||
lifelines | () () |
|
||||
lilypond | [] [] |
|
||||
lingoteach | [] [] |
|
||||
lingoteach_lessons| () () |
|
||||
lynx | [] [] [] [] [] |
|
||||
m4 | [] [] [] [] [] |
|
||||
make | [] [] [] [] |
|
||||
man-db | [] () () [] () () |
|
||||
mysecretdiary | [] [] [] |
|
||||
nano | [] () [] [] [] [] |
|
||||
nano_1_0 | [] () [] [] [] [] |
|
||||
opcodes | [] [] [] |
|
||||
parted | [] [] [] [] [] |
|
||||
ptx | [] [] [] [] [] [] [] |
|
||||
python | |
|
||||
recode | [] [] [] [] [] [] |
|
||||
sed | [] [] [] [] [] [] [] [] [] [] |
|
||||
sh-utils | [] [] [] [] |
|
||||
sharutils | [] [] [] [] [] [] [] |
|
||||
sketch | () [] () |
|
||||
soundtracker | [] [] [] |
|
||||
sp | [] |
|
||||
tar | [] [] [] [] [] [] |
|
||||
texinfo | [] [] [] [] [] |
|
||||
textutils | [] [] [] [] [] |
|
||||
util-linux | [] [] [] [] [] [] |
|
||||
vorbis-tools | [] |
|
||||
wastesedge | |
|
||||
wdiff | [] [] [] [] [] [] |
|
||||
wget | [] [] [] [] [] [] [] [] [] [] |
|
||||
+----------------------------------------+
|
||||
be bg ca cs da de el en eo es et fi fr
|
||||
0 2 19 10 30 44 9 1 12 44 17 6 53
|
||||
|
||||
gl he hr hu id it ja ko lv nb nl nn
|
||||
+-------------------------------------+
|
||||
a2ps | () () [] |
|
||||
ap-utils | |
|
||||
bash | [] |
|
||||
bfd | [] |
|
||||
binutils | [] |
|
||||
bison | [] [] [] [] |
|
||||
clisp | |
|
||||
clisp | [] |
|
||||
clisplow | |
|
||||
cpio | [] [] [] [] |
|
||||
darkstat | |
|
||||
diffutils | [] [] [] [] [] |
|
||||
enscript | [] [] |
|
||||
error | [] |
|
||||
fetchmail | [] |
|
||||
fileutils | [] [] [] |
|
||||
findutils | [] [] [] [] [] [] [] [] |
|
||||
flex | [] |
|
||||
gas | |
|
||||
gawk | [] |
|
||||
gcal | |
|
||||
gcc | [] |
|
||||
gettext | [] [] |
|
||||
gnupg | [] [] [] [] |
|
||||
gprof | [] |
|
||||
gpsdrive | [] () () |
|
||||
grep | [] [] [] [] [] [] [] |
|
||||
gretl | |
|
||||
gthumb | () () |
|
||||
hello | [] [] [] [] [] [] [] [] [] [] [] [] |
|
||||
id-utils | [] [] |
|
||||
indent | [] [] [] [] |
|
||||
jpilot | () () |
|
||||
jwhois | [] [] |
|
||||
kbd | |
|
||||
ld | |
|
||||
libc | [] [] [] [] |
|
||||
libiconv | [] [] [] |
|
||||
lifelines | |
|
||||
lilypond | [] |
|
||||
lingoteach | [] |
|
||||
lingoteach_lessons| |
|
||||
lynx | [] [] [] [] |
|
||||
m4 | [] [] [] [] |
|
||||
make | [] [] [] [] [] [] |
|
||||
man-db | () () |
|
||||
mysecretdiary | [] |
|
||||
nano | [] [] [] [] |
|
||||
nano_1_0 | [] [] [] [] [] |
|
||||
opcodes | [] [] |
|
||||
parted | [] [] [] |
|
||||
ptx | [] [] [] [] [] |
|
||||
python | |
|
||||
recode | [] [] [] |
|
||||
sed | [] [] [] [] [] [] [] [] |
|
||||
sh-utils | [] [] [] |
|
||||
sharutils | [] [] [] |
|
||||
sketch | () |
|
||||
soundtracker | [] [] |
|
||||
sp | |
|
||||
tar | [] [] [] [] [] [] |
|
||||
texinfo | [] [] [] |
|
||||
textutils | [] [] [] [] |
|
||||
util-linux | () [] |
|
||||
vorbis-tools | [] |
|
||||
wastesedge | |
|
||||
wdiff | [] [] [] |
|
||||
wget | [] [] [] [] [] [] |
|
||||
+-------------------------------------+
|
||||
gl he hr hu id it ja ko lv nb nl nn
|
||||
23 9 12 19 16 13 26 9 1 7 19 3
|
||||
|
||||
no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
|
||||
+----------------------------------------------+
|
||||
a2ps | () () () [] [] [] [] [] | 10
|
||||
ap-utils | () | 0
|
||||
bash | [] | 6
|
||||
bfd | [] [] | 5
|
||||
binutils | [] [] | 5
|
||||
bison | [] [] [] [] | 12
|
||||
clisp | | 0
|
||||
clisp | | 5
|
||||
clisplow | | 0
|
||||
cpio | [] [] [] [] | 12
|
||||
darkstat | [] [] () () | 2
|
||||
diffutils | [] [] [] [] [] [] | 17
|
||||
enscript | [] [] [] [] | 8
|
||||
error | [] [] [] | 7
|
||||
fetchmail | () () [] | 6
|
||||
fileutils | [] [] [] [] [] [] | 14
|
||||
findutils | [] [] [] [] [] [] [] | 21
|
||||
flex | [] [] [] | 9
|
||||
gas | [] | 3
|
||||
gawk | [] [] | 6
|
||||
gcal | [] [] | 4
|
||||
gcc | [] | 4
|
||||
gettext | [] [] [] [] [] [] | 13
|
||||
gnupg | [] [] [] | 14
|
||||
gprof | [] [] | 5
|
||||
gpsdrive | [] [] | 3
|
||||
grep | [] [] [] [] [] | 20
|
||||
gretl | | 1
|
||||
gthumb | () () [] | 1
|
||||
hello | [] [] [] [] [] [] [] | 28
|
||||
id-utils | [] [] [] [] | 9
|
||||
indent | [] [] [] [] [] | 14
|
||||
jpilot | () () [] [] | 5
|
||||
jwhois | [] () () [] [] | 7
|
||||
kbd | [] [] | 5
|
||||
ld | [] [] | 4
|
||||
libc | [] [] [] [] [] [] | 18
|
||||
libiconv | [] [] [] [] [] | 12
|
||||
lifelines | [] | 1
|
||||
lilypond | [] | 4
|
||||
lingoteach | [] [] | 5
|
||||
lingoteach_lessons| () | 0
|
||||
lynx | [] [] [] [] | 13
|
||||
m4 | [] [] [] [] | 13
|
||||
make | [] [] [] [] [] | 15
|
||||
man-db | | 3
|
||||
mysecretdiary | [] [] [] | 7
|
||||
nano | [] [] [] [] | 13
|
||||
nano_1_0 | [] [] [] [] | 14
|
||||
opcodes | [] [] [] | 8
|
||||
parted | [] [] [] [] | 12
|
||||
ptx | [] [] [] [] [] [] [] | 19
|
||||
python | | 0
|
||||
recode | [] [] [] [] [] [] | 15
|
||||
sed | [] [] [] [] [] [] | 24
|
||||
sh-utils | [] [] | 9
|
||||
sharutils | [] [] [] [] | 14
|
||||
sketch | [] () [] | 4
|
||||
soundtracker | [] | 6
|
||||
sp | | 1
|
||||
tar | [] [] [] [] [] [] [] | 19
|
||||
texinfo | [] [] | 10
|
||||
textutils | [] [] [] [] [] | 14
|
||||
util-linux | [] [] [] | 10
|
||||
vorbis-tools | [] | 3
|
||||
wastesedge | | 0
|
||||
wdiff | [] [] [] [] [] | 14
|
||||
wget | [] [] [] [] [] [] [] [] | 24
|
||||
+----------------------------------------------+
|
||||
37 teams no pl pt pt_BR ru sk sl sv tr uk zh_CN zh_TW
|
||||
68 domains 4 15 2 28 28 12 10 49 43 4 1 9 609
|
||||
|
||||
Some counters in the preceding matrix are higher than the number of
|
||||
visible blocks let us expect. This is because a few extra PO files are
|
||||
used for implementing regional variants of languages, or language
|
||||
dialects.
|
||||
|
||||
For a PO file in the matrix above to be effective, the package to
|
||||
which it applies should also have been internationalized and
|
||||
distributed as such by its maintainer. There might be an observable
|
||||
lag between the mere existence a PO file and its wide availability in a
|
||||
distribution.
|
||||
|
||||
If August 2002 seems to be old, you may fetch a more recent copy of
|
||||
this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date
|
||||
matrix with full percentage details can be found at
|
||||
`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
|
||||
|
||||
Using `gettext' in new packages
|
||||
===============================
|
||||
|
||||
If you are writing a freely available program and want to
|
||||
internationalize it you are welcome to use GNU `gettext' in your
|
||||
package. Of course you have to respect the GNU Library General Public
|
||||
License which covers the use of the GNU `gettext' library. This means
|
||||
in particular that even non-free programs can use `libintl' as a shared
|
||||
library, whereas only free software can use `libintl' as a static
|
||||
library or use modified versions of `libintl'.
|
||||
|
||||
Once the sources are changed appropriately and the setup can handle
|
||||
to use of `gettext' the only thing missing are the translations. The
|
||||
Free Translation Project is also available for packages which are not
|
||||
developed inside the GNU project. Therefore the information given above
|
||||
applies also for every other Free Software Project. Contact
|
||||
`translation@iro.umontreal.ca' to make the `.pot' files available to
|
||||
the translation teams.
|
||||
|
||||
2
AUTHORS
2
AUTHORS
@@ -8,7 +8,7 @@ Chris Allegretta <chrisa@asty.org>
|
||||
|
||||
Jordi Mallach <jordi@sindominio.net>
|
||||
* Debian package maintainer, fellow bug squasher.
|
||||
* Internationalization support head, es.po maintainer.
|
||||
* Internationalization support head, ca.po maintainer.
|
||||
|
||||
Adam Rogoyski <rogoyski@cs.utexas.edu>
|
||||
* New write_file() function, read_file() optimization, mouse
|
||||
|
||||
340
COPYING
340
COPYING
@@ -1,340 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
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
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
546
ChangeLog
546
ChangeLog
@@ -1,3 +1,541 @@
|
||||
GNU nano 1.1.99pre3 - 2003.02.13
|
||||
- General:
|
||||
- Translation updates (see po/ChangeLog for details).
|
||||
- Fix globals and externs such that nano will compile with
|
||||
DISABLE_SPELLER (David Benbennick).
|
||||
- Fix unreasonable fill values by wrapping at length 0 instead
|
||||
of erroring out, and don't start up if the window size is too
|
||||
small but fill is set reasonably. Changes to
|
||||
nano.c:global_init(), window_init(), and handle_sigwinch().
|
||||
New macro MIN_EDITOR_COLS replaces MIN_FILL_LENGTH
|
||||
(David Benbennick).
|
||||
- Change ngettext macro to P_(), to avoid a clash with the reserved C
|
||||
__ identifier (Jordi).
|
||||
- Memory leak fixes for files.c:do_insertfile(),do_browser(),
|
||||
nano.c:do_spell(), and search.c:do_replace() (David Benbennick).
|
||||
- Remove do_preserve_msg, as using -p still gives Pico-style
|
||||
string behavior, so an annoying message every invocation is
|
||||
probably unneeded (all cheer).
|
||||
- Change resetpos function to be global (now called
|
||||
resetstatuspos. Fixes annoying but small odd problem with
|
||||
cursor placement when inserting a file. This needs to be done
|
||||
better in 1.3 (originally by David Lawrence Ramsey).
|
||||
Added this issue to TODO.
|
||||
- files.c:
|
||||
cwd_tab_completion()
|
||||
- Memory leak fix (David Benbennick).
|
||||
intput_tab()
|
||||
- Fix assumption that matches is null terminated (David
|
||||
Benbennick).
|
||||
load_history()
|
||||
- Fix segfault on loading huge strings from history file
|
||||
(David Benbennick).
|
||||
load_history(), save_history()
|
||||
- Changed to look at $HOME before getpwuid(geteuid()), see
|
||||
details in comment for rcfile.c:do_rcfile().
|
||||
real_dir_from_tidle()
|
||||
- Change check for the running user's home dir to use
|
||||
getpwuid(geteuid()) rather than a getpwent() loop
|
||||
(suggested by Jordi).
|
||||
- nano.c:
|
||||
breakable()
|
||||
- Fix incorrect return value on short lines (David Benbennick).
|
||||
do_help()
|
||||
- Fix line lengths not being computed properly, causes display
|
||||
glitches most noticeable with < 20 rows. New function
|
||||
nano.c:line_len(). (David Benbennick).
|
||||
do_justify()
|
||||
- Add regfree() to quote regex (David Benbennick).
|
||||
- Only copy previous indent if AUTOINDENT is set (David
|
||||
Benbennick).
|
||||
do_suspend()
|
||||
- Fix untranslated message (David Benbennick).
|
||||
do_wrap()
|
||||
- Fix isspace() call to operate on int.
|
||||
help_init()
|
||||
- Fix crashing in do_help when COLS < 23 (David Benbennick).
|
||||
main()
|
||||
- Fix nano not compiling with ENABLE_RCFILE and DISABLE_TABCOMP
|
||||
(David Benbennick).
|
||||
- Silence annoying compiler messages about clobbering and
|
||||
uninitialized variables by moving variable inits to the top
|
||||
of main() and re-initializing them after the sigsetjmp().
|
||||
- rcfile.c:
|
||||
colortoint()
|
||||
- Don't bomb after invalid color and print bad color name
|
||||
(David Benbennick).
|
||||
colortoint, parse_colors()
|
||||
- Don't add strings with invalid fg colors at all.
|
||||
do_rcfile()
|
||||
- Revert (somewhat) previous behavior of looking at
|
||||
$HOME, and only run getpw* if it is NULL. Most *nix programs
|
||||
seem to only care about $HOME, and at the user-level
|
||||
getpw* may not be reliable (and its slower).
|
||||
- search.c:
|
||||
do_gotoline()
|
||||
- Only goto_abort() if we *didnt* abort the command, making
|
||||
the function seem horribly misnamed ;-) (David Benbennick).
|
||||
- winio.c:
|
||||
browser_init(), striponedir(), do_browse_from()
|
||||
- Various memory leak fixes (David Benbennick).
|
||||
do_yesno(), do_help()
|
||||
- Add defined(NCURSES_MOUSE_VERSION) to macro so systems that
|
||||
don't understand MEVENT will compile.
|
||||
nanogetstr()
|
||||
- Remove unnecessary reset of x since it is now handled
|
||||
elsewhere (David Lawrence Ramsey).
|
||||
statusq()
|
||||
- Always blank the statusbar on exit (David Benbennick).
|
||||
- nano.1, nano.1.html:
|
||||
- Add initialization file comments, change some options from
|
||||
bracketed to underlined to emphasize that they are not
|
||||
optional.
|
||||
- Add SEE ALSO section (Jordi).
|
||||
- Moved nano.1 color and syntax sections to nanorc, pointed
|
||||
nano.1 to nanorc.5 for initialization file. Changed
|
||||
nanorc.5 variables to be italics to match nano.1. Added
|
||||
nanorc.5.html to CVS tree.
|
||||
- nanorc.5:
|
||||
- Add nanorc manpage, with descriptions of all available commands
|
||||
(Jordi).
|
||||
- nanorc.sample:
|
||||
- Make nanorc entry less tolerant of invalid colors.
|
||||
- nano.spec.in:
|
||||
- Change default flags to --enable-all.
|
||||
- THANKS:
|
||||
- Add Kalle Kivimaa and Kalle Olavi Niemitalo, for Finnish (Jordi).
|
||||
- UPGRADE:
|
||||
- Add upgrading information document for 1.0 users (Jordi).
|
||||
|
||||
GNU nano 1.1.99pre2 - 2003.02.03
|
||||
- General:
|
||||
- Changed some translatable debug messages to use %s
|
||||
instead of the function name, and removed gettext from
|
||||
two strings that had no actual words in them that
|
||||
should be translated. Suggested originally by
|
||||
Christian Rose.
|
||||
- Fix subexpression replacement to work consistently.
|
||||
Affects search.c:replace_regexp() and
|
||||
utils.c:strstrwrapper() (David Benbennick).
|
||||
- Fix cursor position being saved when escaping out
|
||||
of nanogetstr with keys like ^Y and ^V. New arg
|
||||
resetpos to nanogetstr(), added static int
|
||||
resetpos in statusq() (bug found by DLR).
|
||||
- Fix constant curos updates from obliterating other
|
||||
system messages, and fix statusbar message length.
|
||||
Affects files.c:load_open_file(), nano.c:main(),
|
||||
search.c:findnextstr(), winio.c:statusbar() and
|
||||
do_cursorpos() (David Benbennick).
|
||||
- Fix nano crashing when searching/replacing an invalid
|
||||
regex (try "^*"). Changed regexp_init() to return
|
||||
1 or 0 based on regcomp()'s return value and search_init
|
||||
to exit with an error message (sorry Jordi!). Added
|
||||
another check when using last_search instead of answer.
|
||||
- Move regcomp into rcfile.c rather than each display refresh
|
||||
of winio.c. New function rcfile.c:nregcomp().
|
||||
This fixes much of nano's resource hogging behavior
|
||||
in syntax higlighting. (David Benbennick).
|
||||
- Fix justify failing for certain lines, new function
|
||||
nano.c:breakable() (David Benbennick).
|
||||
- Fix screen getting trashed on signals nano can catch
|
||||
(TERM and HUP). New global variable curses_ended,
|
||||
changes to winio.c:statubar() and nano.c:die()
|
||||
(David Benbennick).
|
||||
- cut.c:
|
||||
do_cut_text()
|
||||
- Fix incorrect cursor location when cutting long lines
|
||||
(David Benbennick).
|
||||
- files.c:
|
||||
- Set a default PATH_MAX for getcwd() etc calls (David
|
||||
Benbennick).
|
||||
do_browse_from()
|
||||
- Fix path checking to fix bad paths, escaping
|
||||
the operating directory, new function readable_dir() (David
|
||||
Benbennick).
|
||||
do_browser()
|
||||
- Fix incorrect path check for check_operating_dir()
|
||||
(David Benbennick).
|
||||
- Fix goto directory operating dir check and tilde expansion
|
||||
(David Benbennick).
|
||||
- Even more checks and operating dir fixes (David Benbennick).
|
||||
do_insertfile()
|
||||
- Add some more checks and fix recursion when toggling
|
||||
multibuffer (David Benbennick).
|
||||
open_file()
|
||||
- Fix FD leak with file load error (David Benbennick).
|
||||
add_open_file()
|
||||
- Revert the fix for the supposed minor logic error from before;
|
||||
it was keeping some updates from happening when they should,
|
||||
which was leading to segfaults with both multibuffer and view
|
||||
mode on. (DLR; found by David Benbennick)
|
||||
save_history()
|
||||
- Fix nrealloc return value being ignored (David Benbennick).
|
||||
- Fix off-by-one bug causing write to unallocated memory
|
||||
(David Benbennick).
|
||||
- global.c:
|
||||
thanks_for_all_the_fish()
|
||||
- Fix compiling with DEBUG and multibuffer (David Benbennick).
|
||||
- nano.c:
|
||||
do_char()
|
||||
- Remove unneeded check_statblank() (David Benbennick).
|
||||
do_int_spell_fix(), do_int_speller()
|
||||
- Fix crashes with mark position, current_x position,
|
||||
and edit_update args (David Benbennick).
|
||||
do_justify()
|
||||
- Unset KEEP_CUTBUFFER so nano won't crash with subsequent
|
||||
^K cuts and justifies (David Benbennick).
|
||||
do_mouse()
|
||||
- Fix the mouse code to work with lines longer than COLS and
|
||||
with the proper positioning, including special characters
|
||||
(David Benbennick).
|
||||
do_preserve_msg():
|
||||
- Unsplit error message into a single fprintf call (Jordi).
|
||||
main()
|
||||
- Call load_file with arg 0 for insert, as we aren't really
|
||||
doing an insert, allows new_file() to run if we open a
|
||||
non-file at startup.
|
||||
usage()
|
||||
- Remove gettext markings from -p/--preserve (Jordi).
|
||||
- Revamp -H option message to fit in 80 column terminal.
|
||||
window_init()
|
||||
- Fix leaking *WINDOWs (no pun intended) (David Benbennick).
|
||||
- search.c:
|
||||
do_search(), do_replace_loop()
|
||||
- Fix edit_update call to use CENTER instead of current_x
|
||||
(related to David Benbennick's fixes for spelling).
|
||||
do_replace_loop()
|
||||
- Fix various bugs having to do with replace string length
|
||||
and positioning (David Benbennick).
|
||||
edit_refresh()
|
||||
- Fix cursor being above as well as below the current screen
|
||||
(David Benbennick).
|
||||
- winio.c:
|
||||
bottombars()
|
||||
- Change strcpy of gettext() "Up" string to strncpy of max
|
||||
width 8, to stop stupid strcpy crash.
|
||||
do_yesno()
|
||||
- Fix mouse interaction bugs with yes/no prompt (David Benbennick).
|
||||
- nanorc.sample:
|
||||
- Change comment to say magenta instead of purple.
|
||||
|
||||
GNU nano 1.1.99pre1 - 2003.01.17
|
||||
- General:
|
||||
- New date format for NEWS and ChangeLog.
|
||||
- Completely removed PICO_MODE, as with the search/replace
|
||||
history patch we should have the extended functionality we can
|
||||
without being incompatible with Pico. Removed all code for
|
||||
different search/replace string editing and alternate shortcut
|
||||
list. I'm sure I won't even have to ask for feedback on this
|
||||
one :-)
|
||||
- Add in Pico's -p flag, (-p, --preserve). To preserve the XON
|
||||
and XOFF keys (^Q and ^S). Add warning if we invoke -p and
|
||||
add checks for using --preserve (to skip warning) and --pico
|
||||
(to force showing it). New flag PRESERVE, function
|
||||
do_preserve_msg(), changes to main(), signal_init().
|
||||
- Search history and replace history up/down cursor arrows,
|
||||
w/history tab completion, not available w/NANO_SMALL. Changes
|
||||
to statusq(), others (Ken Tyler). Added shortcut to
|
||||
search/replace shortcuts so people will know it's there,
|
||||
forced KEY_UP and KEY_DOWN defs in nano.h (Chris, in case
|
||||
blame needs to be placed later). Minor fixes by DLR: allow ^P
|
||||
and ^N as alternatives to the up and down arrows, make sure
|
||||
the "Up" shortcut is displayed properly in the help menu,
|
||||
remove a few bits of unneeded and/or warning-generating code,
|
||||
and fix some missing statusq() prompts with --enable-tiny.
|
||||
- Added search/replace history log. Flag -H, --historylog.
|
||||
Flags HISTORY_CHANGED and HISTORYLOG (only room for one more
|
||||
flag!), added entries in nanorc.sample, new functions
|
||||
log_history and save_history (Ken Tyler).
|
||||
- Translation updates (see po/ChangeLog for details).
|
||||
- Forward-ported Chris' --disable-wrapping-as-root option from
|
||||
1.0.9. Per Jordi's suggestions, have it override
|
||||
$SYSCONFDIR/nanorc but not ~/.nanorc. (DLR)
|
||||
- Change all references to /etc/nanorc in the documentation to
|
||||
$SYSCONFDIR/nanorc. (DLR)
|
||||
- Minor cosmetic tweaks to the ngettext() macro, and fix to
|
||||
properly detect systems lacking ngettext() and correctly
|
||||
compile on them; the previous fix didn't work. (DLR)
|
||||
- Fix problems with some code sections' not being #ifdef'ed out
|
||||
when they should be, or being #ifdef'ed out improperly. (David
|
||||
Benbennick and DLR)
|
||||
- Change FOLLOW_SYMLINKS to NOFOLLOW_SYMLINKS, and rework the
|
||||
associated logic accordingly, throughout the code. (David
|
||||
Benbennick)
|
||||
- Rework #ifdefs to not include mouse_init() at all if
|
||||
DISABLE_MOUSE is defined or NCURSES_MOUSE_VERSION isn't. (DLR)
|
||||
- For consistency, change many references of (!x) to (x == NULL)
|
||||
and (x) to (x != NULL). (DLR)
|
||||
- Define KEY_IC properly (and KEY_DC more portably) when slang
|
||||
support is enabled, and remove the hack to work around the
|
||||
former's not being defined. (David Benbennick and DLR)
|
||||
- Miscellaneous tweaks to update_color() calls, to make sure
|
||||
they're called at the right times and that refreshes are done
|
||||
afterwards only when needed. (David Benbennick)
|
||||
- Renamed [have_]past_editbuff [have_]search_offscreen. (DLR)
|
||||
- Add the "preserve" option to the nanorc file, to match
|
||||
nanorc.sample. (DLR)
|
||||
- Fixed awful scrolling in do_int_speller. Problem was
|
||||
findnextstr() calling edit_update(), though screen updating
|
||||
is not its business. Added checks in do_search() and
|
||||
do_replace_loop() to do the checks. It really should not be
|
||||
done here, as some function in winio.c should handle this,
|
||||
but I can't seem to find a good place to put this check.
|
||||
- Updated all copyright notices to say 2003 rather than 2002, as
|
||||
nearly all the source files have been worked on this year
|
||||
(DLR).
|
||||
- configure.ac:
|
||||
- Added tr and eu to ALL_LINGUAS (Jordi).
|
||||
- Fix now inaccurate description of --enable-tiny's effects; it
|
||||
no longer disables NLS support. (DLR)
|
||||
- Fix typo. (David Benbennick)
|
||||
- Check for strcasecmp() and strncasecmp(), since they are
|
||||
apparently only standard under BSD. (DLR)
|
||||
- Small cleanups. Add copyright header, add autopoint support and
|
||||
define bug report address and full package name in AC_INIT. Move
|
||||
ALL_LINGUAS to po/LINGUAS, recommended place for gettext 0.11.
|
||||
- Added --enable-all option to compile in all the extra stuff
|
||||
we'd normally need extra flags for.
|
||||
- color.c:
|
||||
update_color():
|
||||
- Remove an unneeded edit_refresh() call after do_colorinit().
|
||||
(David Benbennick)
|
||||
- cut.c:
|
||||
do_cut_text()
|
||||
- Fix a memory corruption problem caused by accessing edittop
|
||||
after it was freed but before it was reset to a sane value
|
||||
from current. (David Benbennick)
|
||||
do_uncut_text()
|
||||
- If uncutting more than one line of unmarked text at editbot,
|
||||
don't center the screen, since Pico doesn't. (DLR)
|
||||
- If uncutting previously unmarked text, uncut to end if we're
|
||||
not at the beginning of the line, and set placewewant to 0 if
|
||||
we are. This matches Pico's behavior. (DLR)
|
||||
- files.c:
|
||||
load_file()
|
||||
- Remove unneeded wmove() call. (David Benbennick)
|
||||
read_line()
|
||||
- Miscellaneous cleanups. (David Benbennick)
|
||||
open_file()
|
||||
- If we're in multibuffer mode and there's an error opening the
|
||||
file in read-only mode, display the error message on the
|
||||
statusbar regardless of the value of quiet. (DLR)
|
||||
read_file()
|
||||
- Miscellaneous cleanups. (David Benbennick)
|
||||
- Fix len's being off by one when reading in Mac-format files,
|
||||
exposed by one of David Benbennick's cleanups. (DLR)
|
||||
- If NO_CONVERT isn't set when we first enter, and it gets set
|
||||
while reading in the file, unset it again afterwards. (DLR)
|
||||
do_insertfile()
|
||||
- If we're in multibuffer mode and there's an error opening the
|
||||
file that we're trying to insert, close the new buffer that we
|
||||
made to hold it and reload the buffer we had open before.
|
||||
(DLR)
|
||||
add_open_file()
|
||||
- Fix minor logic error when determining when to resave fileage
|
||||
and filebot. (DLR)
|
||||
load_open_file()
|
||||
- If switching between files when CONSTUPDATE is set, only force
|
||||
a cursor position display update if DISABLE_CURPOS isn't set.
|
||||
This will ensure that the "Switching to [file]" messages are
|
||||
shown. (DLR)
|
||||
write_file()
|
||||
- Change lineswritten from a long to an int, to match
|
||||
filestruct->lineno. (DLR; mismatch found by David Benbennick)
|
||||
real_dir_from_tilde()
|
||||
- Since this is needed for proper interpretation of paths
|
||||
containing tildes and not just for tab completion, include and
|
||||
use it regardless of whether tab completion is disabled.
|
||||
(David Benbennick and DLR)
|
||||
input_tab()
|
||||
- Variable name change: matchBuf -> matchbuf. (DLR)
|
||||
diralphasort()
|
||||
- Remove the HAVE_STRCASECMP #ifdef block; see the changes to
|
||||
configure.ac and nano.h for why. (DLR)
|
||||
- global.c:
|
||||
thanks_for_all_the_fish()
|
||||
- Miscellaneous cleanups. (David Benbennick)
|
||||
- move.c:
|
||||
do_page_down()
|
||||
- If there's a page or less of text, do an edit_update() if the
|
||||
mark is on; otherwise, the highlight won't be displayed. (DLR)
|
||||
- nano.c:
|
||||
- Added free_history() list calls clean up, added init of list
|
||||
headers, and modified statusq() calls (Ken Tyler).
|
||||
do_prev_word()
|
||||
- Make the assert match that in do_next_word(). (DLR)
|
||||
do_enter()
|
||||
- If smooth scrolling is on, and Enter is pressed on the
|
||||
magicline, don't center the screen. (DLR)
|
||||
do_justify()
|
||||
- Fix memory corruption problem triggered when edittop and
|
||||
current->next pointed to the same value and current->next was
|
||||
destroyed during justification. (DLR)
|
||||
- Center the screen when justification moves the cursor entirely
|
||||
off the bottom of the screen, instead of when it moves the
|
||||
cursor near the bottom of the screen, to more closely match
|
||||
Pico's behavior. (DLR)
|
||||
version()
|
||||
- Remove obsolete reference to --enable-undo. (David Benbennick)
|
||||
- Move up check for --disable-nls as it's independent of
|
||||
--enable-tiny now (DLR).
|
||||
do_int_speller()
|
||||
- Make internal spell program use sort -f and uniq to create a
|
||||
less redundant word list. [The only reason this is going in
|
||||
during feature freeze is because the int speller is useless as
|
||||
is and should either be improved or removed. I chose
|
||||
improved].
|
||||
- Change all child error checks to use one goto (gasp!) called
|
||||
close_pipes_and_exit, so we don't leak FDs.
|
||||
- Fix FD leaks which occur outside of errors (David Benbennick).
|
||||
do_int_speller(), do_alt_speller()
|
||||
- Programs now return char *, NULL for successful completion,
|
||||
otherwise the error string to display. This allows us to give
|
||||
more useful feedback to the user when spell checking fails.
|
||||
ABCD()
|
||||
- Renamed abcd(). (DLR)
|
||||
main()
|
||||
- Remove an unneeded do_colorinit() call, do major cleanups, and
|
||||
allow loading of multiple files on the command line when
|
||||
multibuffers are used. (David Benbennick)
|
||||
- nano.h:
|
||||
- Make sure NO_RCFILE and COLOR_SYNTAX aren't set to the same
|
||||
value. (DLR; discovered by Ken Tyler)
|
||||
- If strcasecmp() and/or strncasecmp() aren't available, use
|
||||
strcmp() and/or strncmp() instead. (DLR)
|
||||
- proto.h:
|
||||
- Fix the #ifdef block for DISABLE_TABCOMP's being undefined
|
||||
so that functions only used with tab completion are properly
|
||||
#ifdef'ed out. (DLR)
|
||||
- search.c:
|
||||
do_gotoline()
|
||||
- Don't call blank_statusbar_refresh() so if there's an error
|
||||
returned in multibuffer mode, we can actually see it.
|
||||
do_search()
|
||||
- Remove erroneously introduced near-duplicate call to
|
||||
update_history(). (DLR)
|
||||
print_replaced()
|
||||
- Remove and replace with an equivalent ngettext() call. (DLR)
|
||||
do_replace_loop()
|
||||
- Fix bug where if text on the magicline was replaced (which can
|
||||
be done via a regexp replace of "^$" with something other than
|
||||
""), a new magicline wouldn't be created. (DLR)
|
||||
- Remove check for answer being a blank string, presumed to be
|
||||
a PICO_MODE holdover, but it stops us from doing a blank
|
||||
spelling replacement.
|
||||
do_replace()
|
||||
- For greater Pico compatibility, when an attempt to replace a
|
||||
string results in 0 replacements due to the string's not being
|
||||
found, display "[string] not found" instead of "Replaced 0
|
||||
occurrences". (DLR)
|
||||
- utils.c:
|
||||
is_cntrl_char()
|
||||
- Rework to fix a problem with displaying certain high-bit
|
||||
characters. (David Benbennick; reported by Andrzej Marecki)
|
||||
align()
|
||||
- Don't just assert that the string passed in isn't NULL; check
|
||||
that it isn't and only do the alignment when it isn't. (David
|
||||
Benbennick)
|
||||
nmalloc(), nrealloc()
|
||||
- If the size passed to nmalloc() or nrealloc() is zero, don't
|
||||
die with an erroneous out-of-memory error. Also, change
|
||||
their dying messages to "nano is out of memory!". (David
|
||||
Benbennick)
|
||||
charalloc()
|
||||
- Removed and redefined as a macro that calls nmalloc(). (David
|
||||
Benbennick)
|
||||
- winio.c:
|
||||
nanogetstr()
|
||||
- Tweak to make the cursor stay in the same place if we hit a
|
||||
prompt-changing toggle while it's in the middle of the string.
|
||||
Reset it to -1 (so next time we come here, it'll be set to the
|
||||
end of the string) if we leave the prompt via Enter or Cancel.
|
||||
Also fix minor problem with search history where the current
|
||||
search item could be at the bottom of the history twice in a
|
||||
row under certain conditions. (DLR)
|
||||
- Remove parens in NANO_CONTROL_I check so nano won't complain if
|
||||
just NANO_SMALL is defined (David Benbennick).
|
||||
edit_refresh()
|
||||
- Miscellaneous cleanups that fix a bug where the screen
|
||||
isn't updated after uncutting chunks of upwardly marked cut
|
||||
text that are over a page in length. (David Benbennick)
|
||||
do_credits()
|
||||
- Add David Benbennick to credits. (DLR)
|
||||
- nanorc.sample:
|
||||
- Added comment to explain the non-escaping of quotes in
|
||||
color regexes, based on info provided by David Benbennick.
|
||||
(DLR)
|
||||
- Added some examples for groff and the nanorc courtesy of
|
||||
Robert D. Goulding.
|
||||
- Added double hash marks to comment lines, so people who
|
||||
uncomment the beginning of every line won't get syntax errors.
|
||||
- faq.html:
|
||||
- Miscellaneous fixes and updates for typos, broken links, and
|
||||
slashes at the end of directories. It is now fully compliant
|
||||
with HTML 4.01 Transitional. (DLR and David Benbennick)
|
||||
- Added docs about the new unified search string interface and
|
||||
search histories, and added --enable-all into configure docs.
|
||||
- nano.texi:
|
||||
- Typo fixes and updates. (David Benbennick)
|
||||
- Updates for the most recent and not so recent changes.
|
||||
- nano.1, nano.1.html
|
||||
- Updated for the --preserve and --historylog options.
|
||||
- TODO
|
||||
- Added some wishlist stuff.
|
||||
- THANKS:
|
||||
- Added Doruk Fisek and Peio Ziarsolo (Jordi).
|
||||
|
||||
GNU nano 1.1.12 - 10/24/2002
|
||||
- General:
|
||||
- Translation updates (see po/ChangeLog for details).
|
||||
- Remove malloc.h, as it's unneeded and just causes annoyances on
|
||||
*BSD systems. Added stdlib.h to global.c.
|
||||
- Added Meta-Y toggle to disable/enable color syntax highlighting
|
||||
completely. This may eventually be per-buffer, but that's too
|
||||
complicated for a feature freeze.
|
||||
- Disable VSTOP keystroke. Stops people accidentally locking up
|
||||
nano (suggested by David Benbennick).
|
||||
- Pluralize messages with ngettext() where needed. (David
|
||||
Benbennick) Tweaked to compile on systems lacking ngettext()
|
||||
by DLR (problem found by Ken Tyler).
|
||||
- Update nano.1 and nano.1.html to show that nano now does an
|
||||
emergency save on receiving SIGHUP or SIGTERM. (DLR)
|
||||
- Don't include "nowrap" in the long options if
|
||||
DISABLE_WRAPPING is defined. (DLR)
|
||||
- files.c:
|
||||
read_file()
|
||||
- Minor efficiency fixes, some of which fit in with the change
|
||||
to ngettext() usage mentioned above. (David Benbennick)
|
||||
do_browser()
|
||||
- Make sure the value of path is mallocstrcpy()ed into retval
|
||||
and not just assigned to it, to avoid memory corruption
|
||||
problems. (DLR)
|
||||
- nano.c:
|
||||
version()
|
||||
- If ENABLE_NLS isn't defined, display "--disable-nls"
|
||||
(suggested by Ken Tyler). (DLR)
|
||||
justify_format()
|
||||
- Make sure the double space maintained after sentence-ending
|
||||
punctuation is done when that punctuation is immediately
|
||||
followed by a bracket-type character, so justifying e.g.
|
||||
sentences in parentheses works properly. (David Benbennick)
|
||||
handle_hup()
|
||||
- Renamed handle_hupterm() to show that it now handles SIGTERM
|
||||
as well as SIGHUP. (DLR)
|
||||
signal_init()
|
||||
- Do an emergency save on receiving either SIGHUP or SIGTERM,
|
||||
not just SIGHUP. (David Benbennick)
|
||||
main()
|
||||
- Fix a problem where control key commands were printed
|
||||
literally instead of interpreted after a failed search of a
|
||||
one-line file. (David Benbennick)
|
||||
- proto.h:
|
||||
handle_hup()
|
||||
- Renamed handle_hupterm(); see above for why. (DLR)
|
||||
- winio.c:
|
||||
edit_add()
|
||||
- Fix a potential infinite loop occurring with certain
|
||||
zero-length regexes. (David Benbennick)
|
||||
|
||||
GNU nano 1.1.11 - 10/01/2002
|
||||
- General:
|
||||
- Translation updates (see po/ChangeLog for details).
|
||||
@@ -138,6 +676,8 @@ GNU nano 1.1.11 - 10/01/2002
|
||||
Benbennick)
|
||||
- faq.html:
|
||||
- Typo fix. (DLR)
|
||||
- AUTHORS:
|
||||
- Add David Benbennick. (Jordi and Chris)
|
||||
- TODO:
|
||||
- Add entry in the 1.4 section for Pico's paragraph searching
|
||||
ability (at the search prompt, ^W goes to the paragraph's
|
||||
@@ -228,8 +768,8 @@ GNU nano 1.1.10 - 07/25/2002
|
||||
printed as-is and be interpreted as commands by xterm, which
|
||||
will corrupt the display.) (DLR)
|
||||
- Add command line option -I/--ignorercfiles to ignore
|
||||
/etc/nanorc and ~/.nanorc. (Carl Drinkwater). Fix to parsing
|
||||
getopt args (DLR).
|
||||
$SYSCONFDIR/nanorc and ~/.nanorc. (Carl Drinkwater). Fix to
|
||||
parsing getopt args (DLR).
|
||||
- Fix minor bugs with importing certain text files in Mac
|
||||
format. (DLR)
|
||||
- files.c:
|
||||
@@ -690,7 +1230,7 @@ GNU nano 1.1.7 - 03/05/2002
|
||||
- Preliminary quoting support for justify. New arg -Q, --quotestr,
|
||||
changes to do_justify(), global variable quotestr().
|
||||
- Makefile.am:
|
||||
- Add SYSCONFDIR to DEFS, so we can have an /etc/nanorc.
|
||||
- Add SYSCONFDIR to DEFS, so we can have an $SYSCONFDIR/nanorc.
|
||||
- Change localedir line to 1.0's version.
|
||||
- Moved m4/ stuff to its own m4/Makefile.am.
|
||||
- m4/aclocal_inc.m4:
|
||||
|
||||
184
INSTALL
184
INSTALL
@@ -1,184 +0,0 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
||||
$Id$
|
||||
@@ -17,16 +17,16 @@ nano_SOURCES = color.c \
|
||||
utils.c \
|
||||
winio.c
|
||||
|
||||
man_MANS = nano.1
|
||||
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 config.rpath install-sh missing \
|
||||
mkinstalldirs nano.1 nano.1.html faq.html nanorc.sample \
|
||||
nano.spec
|
||||
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
|
||||
|
||||
|
||||
88
NEWS
88
NEWS
@@ -1,3 +1,81 @@
|
||||
2003.02.13 - GNU nano 1.1.99pre3 "The last testing version, no
|
||||
really!" is released. This release includes fixes for
|
||||
wrapping (again), resizing, color syntax highlighting,
|
||||
rcfile parsing, the mouse code, more memory leaks, and
|
||||
some reversion of the code to get the user's home
|
||||
directory (nano will now again rely on $HOME). There
|
||||
are also translation updates, a new manual page for the
|
||||
nanorc file, and an UPGRADE file detailing the changes
|
||||
since version 1.0. Please submit reports for any bugs
|
||||
you might find to the development team
|
||||
(nano-devel@gnu.org), and enjoy nano almost-1.2.0 ;-)
|
||||
|
||||
2003.02.03 - GNU nano 1.1.99pre2 "bugs in my pockets, bugs in my
|
||||
shoes" is released. There are, not suprisingly,
|
||||
only bugfixes in this release as we move toward the
|
||||
stable 1.2.0 release. Fixes are included for
|
||||
translable string format, subexpression replacement,
|
||||
constant cursor position, invalid search regexes,
|
||||
justify, screen state on SIGHUP and SIGTERM, cutting
|
||||
to end cuts with long lines, many file browser and
|
||||
operating directory bugs, memory and file descriptor
|
||||
leaks, marker code, spell checker, the mouse code
|
||||
with long lines, multiple buffers and non-file
|
||||
open errors, replacement string length, and a
|
||||
silly but serious history message crash. There is
|
||||
also a drastic improvement in CPU utliization for
|
||||
the color regex code.
|
||||
Depending on the number of bugs found in this
|
||||
release, there may be a 1.1.99pre3 or RC1, or just
|
||||
a 1.2.0 release. Most of the major bugs seem to have
|
||||
been worked out, so if you are waiting for a good time
|
||||
to test nano before the official 1.2.0 release, this
|
||||
would be the one to use. Happy bug hunting!
|
||||
|
||||
2003.01.17 - GNU nano 1.1.99pre1 "enough already" has been released.
|
||||
This release is, barring bug fixes and documentation
|
||||
updates, what version 1.2.0 has looked like, feature
|
||||
wise. There will very likely be bugs, just due the
|
||||
volume of changes made in this release. Search
|
||||
and replace string history has been added, including an
|
||||
option to log history to ~/.nano_history (-H,
|
||||
--historylog). Because of this, the pico incompatible
|
||||
search/replace string behavior that used to be the
|
||||
default has been deleted. The old "pico" flag (-p)
|
||||
is now compatible with Pico's "preserve" mode for
|
||||
allowing flow control characters; by default this
|
||||
version ignores both ^Q and ^S. The
|
||||
--disable-wrapping-as-root configure option has been
|
||||
forward ported from version 1.0.x, and a new flag to
|
||||
enable all extra options (--enable-all) has been added.
|
||||
The internal spell checker has been improved, meaning
|
||||
you will now be prompted only once for each unique
|
||||
capitalization of a given word.
|
||||
There have also been lots of bug fixes,
|
||||
including the "trying to insert a directory name in
|
||||
multibuffer mode bug", the ugly spell checker scrolling,
|
||||
the color code, cutting text crashes, justification,
|
||||
deleting the "magic line" via replace, and cursor
|
||||
positioning on the statusbar. There have also been
|
||||
the usual helping of translation and documentation
|
||||
updates.
|
||||
Please send all new feedback on this release
|
||||
direct to the development list (nano-devel@gnu.org).
|
||||
|
||||
10/24/2002 - GNU nano 1.1.12 "Make Jordi happy" is released. This
|
||||
release demonstrated that nano is starting to freeze for
|
||||
version 1.2. New features include a Meta-Y toggle
|
||||
for syntax highlighting, pluralized i18n, and a handler
|
||||
for SIGTERM. Nano now ignores XOFF (^S) to stop
|
||||
accidental lock-ups, and no longer references malloc.h.
|
||||
Also included are fixes for zero-length regex
|
||||
matches, segfaults with --disable-mouse, justification,
|
||||
memory corruption with the browser, version and help
|
||||
cmdline output, and translation updates. Aside from
|
||||
the (currently up in the air) search history behavior,
|
||||
the next version of nano should be 1.1.99pre1. Have
|
||||
fun!
|
||||
|
||||
10/01/2002 - GNU nano 1.1.11 "Oddball" is released. This release
|
||||
features a new version of gettext, a new and improved syntax
|
||||
highlighting engine, and some updates for the nanorc.sample
|
||||
@@ -99,9 +177,9 @@
|
||||
release. Other changes include more Hurd fixes, fixes
|
||||
parsing the .nanorc, display fixes for the color syntax
|
||||
highlighting, gettext stabilization and many translation
|
||||
updates. This is amost like a stable release, much like
|
||||
updates. This is almost like a stable release, much like
|
||||
in the 0.9.x series when every other release was the
|
||||
mosts stable one :) Have fun!
|
||||
most stable one :) Have fun!
|
||||
|
||||
12/11/2001 - GNU nano 1.1.4 is released. This release contains
|
||||
rudimentary color syntax support (but it's still
|
||||
@@ -130,7 +208,7 @@
|
||||
that nano was distributed under version 1 of the GPL when
|
||||
the accompanying license was the GPLv2.
|
||||
If you're using nano-1.1, it is highly
|
||||
recommeneded you upgrade to this release. If using 1.0,
|
||||
recommended you upgrade to this release. If using 1.0,
|
||||
wait for version 1.0.6 which should be available early
|
||||
next week. Enjoy!
|
||||
|
||||
@@ -150,7 +228,7 @@
|
||||
|
||||
07/28/2001 - GNU nano 1.1.1 is released. Our second 1.1 unstable release
|
||||
features many bugfixes from the initial release, in
|
||||
particular fixs for the multibuffer code, and various
|
||||
particular fixes for the multibuffer code, and various
|
||||
compiler macro fixes. The shortcut lists for
|
||||
the search and replace prompts are a little more logical
|
||||
(with cancel the last option again), and the included
|
||||
@@ -346,7 +424,7 @@
|
||||
-k option from Pico (cut to end of line). The majority
|
||||
of changes in this release are bugfixes, however, including
|
||||
the usual display fixes and fixes for writing to symbolic
|
||||
links and un-writeable files. Barring any other major
|
||||
links and un-writable files. Barring any other major
|
||||
changes, this should be the feature set for nano 1.0,
|
||||
whenever it might be released =-)
|
||||
|
||||
|
||||
14
README.CVS
14
README.CVS
@@ -4,12 +4,12 @@ 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.
|
||||
|
||||
To succesfully compile GNU nano from CVS, you'll need the
|
||||
To successfully compile GNU nano from CVS, you'll need the
|
||||
following packages:
|
||||
|
||||
- autoconf (version >= 2.52)
|
||||
- automake (version >= 1.5-pl5, 1.6.x recommended)
|
||||
- gettext (version 0.10.40, >= 0.11 recommended)
|
||||
- automake (version >= 1.6, 1.7.x recommended)
|
||||
- gettext (version >= 0.11.5)
|
||||
- texinfo
|
||||
- cvs
|
||||
- glib (if your system doesn't have snprintf() and/or vsnprintf())
|
||||
@@ -26,13 +26,13 @@ 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
|
||||
|
||||
One 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
|
||||
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
|
||||
$ ./configure [--add-options-here] && make
|
||||
Once it's done compiling,
|
||||
$ make install
|
||||
should put the required files in their respective directories.
|
||||
(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
@@ -6,17 +6,20 @@ Sharuzzaman Ahmat Raslan <sharuzzaman@excite.com>
|
||||
Ricardo Cárdenes Medina <ricardo@conisys.com> Spanish translator
|
||||
Marco Colombo <magicdice@inwind.it> Italian translator
|
||||
Karl Eichwalder <keichwa@gmx.net> German translator
|
||||
Doruk Fisek <dfisek@fisek.com.tr> Turkish translator
|
||||
Jean-Philippe Guérard <jean-philippe.guerard@laposte.net>
|
||||
French translator
|
||||
Tedi Heriyanto <tedi_h@gmx.net> Indonesian translator
|
||||
Václav Haisman <V.Haisman@sh.cvut.cz> Czech translator
|
||||
Szabolcs Horvath <horvaths@janus.gimsz.sulinet.hu>
|
||||
Hungarian translator
|
||||
Kalle Kivimaa <kalle.kivimaa@iki.fi> Finnish Translator
|
||||
Eivind Kjørstad <ekj@vestdata.no> Norwegian nynorsk translator
|
||||
Florian König <floki@bigfoot.com> German translator
|
||||
Wojciech Kotwica <wkotwica@post.pl> Polish translator
|
||||
Clement Laforet <clem_laf@wanadoo.fr> French translator
|
||||
Gergely Nagy <algernon@debian.org> Hungarian translator
|
||||
Kalle Olavi Niemitalo <kon@iki.fi> Finnish Translator
|
||||
Claudio Neves <cneves@nextis.com> Brazilian Portuguese translator
|
||||
Michael Piefel <piefel@informatik.hu-berlin.de> German translator
|
||||
Sergey A. Ribalchenko <fisher@obu.ck.ua> Russian, Ukrainian translator
|
||||
@@ -31,6 +34,7 @@ Jacobo Tarr
|
||||
Kjetil Torgrim Homme <kjetilho@linpro.no> Norwegian nynorsk translator
|
||||
Miquel Vidal <miquel@sindominio.net> Catalan translator
|
||||
Pauli Virtanen <pauli.virtanen@saunalahti.fi> Finnish translator
|
||||
Peio Ziarsolo <peio@sindominio.net> Basque translator
|
||||
|
||||
Ben Armstrong <synrg@sanctuary.nslug.ns.ca> Negative -r value idea, code
|
||||
Thomas Dickey <dickey@herndon4.his.com> Curses help and advice
|
||||
|
||||
9
TODO
9
TODO
@@ -6,7 +6,7 @@ For version 1.2:
|
||||
- Color syntax highlighting? (certainly seems like there's a demand for it.)
|
||||
- .nanorc [DONE]
|
||||
- Backup making (filename~)? [DONE]
|
||||
- Search (etc) string history [1.2]
|
||||
- Search (etc.) string history [DONE]
|
||||
- Implement Pico's -j and -g flags, as they are pretty easy to do. [DONE]
|
||||
- Make mouse support work with clicking on the shortcuts (-m). Must
|
||||
make global variable pointing to current shortcut list to determine what
|
||||
@@ -19,6 +19,13 @@ For version 1.4:
|
||||
- UTF-8 support.
|
||||
- Support for Pico's paragraph searching ability.
|
||||
- Undo/Redo key?
|
||||
- Remindable 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
|
||||
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.
|
||||
|
||||
Old requests:
|
||||
|
||||
|
||||
28
UPGRADE
Normal file
28
UPGRADE
Normal file
@@ -0,0 +1,28 @@
|
||||
GNU nano upgrading information
|
||||
==============================
|
||||
|
||||
Visible changes since 1.0
|
||||
-------------------------
|
||||
* Editor Features
|
||||
- Complete Pico compatibility (--pico has been removed, and -p means
|
||||
something else, see below).
|
||||
- nanorc support.
|
||||
- Smooth scrolling (-S).
|
||||
- Searching of matching brace/bracket/etc.
|
||||
- Help for all editor features.
|
||||
- Color syntax highlighting support.
|
||||
- Quote string support, useful for mail agents, etc (-Q).
|
||||
- Insertion of output of external commands.
|
||||
- Optional enabling of XON and XOFF control characters (-p).
|
||||
- Tons of bugfixes/enhancements for already existing features.
|
||||
|
||||
* File Handling
|
||||
- Overwriting and appending or prepending to files.
|
||||
- Writing marked text to separate files.
|
||||
- Multiple file buffers (-F).
|
||||
- Converting from and to DOS/Mac file format (-D/-M, -N to disable).
|
||||
- Better control character handling.
|
||||
- Creation of backup files (-B).
|
||||
- Search/replace history (-H).
|
||||
|
||||
See the GNU nano manual for detailed information on each feature.
|
||||
@@ -1,7 +1,4 @@
|
||||
#!/bin/sh
|
||||
# Generate configure & friends for CVS users.
|
||||
|
||||
aclocal -I ./m4
|
||||
autoheader
|
||||
automake --add-missing
|
||||
autoconf
|
||||
autoreconf -f -i -s
|
||||
|
||||
24
color.c
24
color.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* color.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -33,13 +33,6 @@
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
/* For each syntax list entry, we go through the list of colors and
|
||||
* assign color pairs. */
|
||||
void set_colorpairs(void)
|
||||
@@ -85,7 +78,7 @@ void do_colorinit(void)
|
||||
defok = use_default_colors() != ERR;
|
||||
#endif
|
||||
|
||||
for (tmpcolor = colorstrings; tmpcolor != NULL;
|
||||
for (tmpcolor = colorstrings; tmpcolor != NULL;
|
||||
tmpcolor = tmpcolor->next) {
|
||||
short background = tmpcolor->bg;
|
||||
|
||||
@@ -98,13 +91,14 @@ void do_colorinit(void)
|
||||
init_pair(tmpcolor->pairnum, tmpcolor->fg, background);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("Running init_pair with fg = %d and bg = %d\n"), tmpcolor->fg, tmpcolor->bg);
|
||||
fprintf(stderr, _("Running %s with fg = %d and bg = %d\n"),
|
||||
"init_pair()", tmpcolor->fg, tmpcolor->bg);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Update the color information based on the current filename */
|
||||
/* Update the color information based on the current filename. */
|
||||
void update_color(void)
|
||||
{
|
||||
const syntaxtype *tmpsyntax;
|
||||
@@ -114,15 +108,10 @@ void update_color(void)
|
||||
const exttype *e;
|
||||
|
||||
for (e = tmpsyntax->extensions; e != NULL; e = e->next) {
|
||||
regex_t syntaxfile_regexp;
|
||||
|
||||
regcomp(&syntaxfile_regexp, e->val, REG_EXTENDED | REG_NOSUB);
|
||||
|
||||
/* Set colorstrings if we matched the extension regex */
|
||||
if (!regexec(&syntaxfile_regexp, filename, 0, NULL, 0))
|
||||
if (!regexec(&e->val, filename, 0, NULL, 0))
|
||||
colorstrings = tmpsyntax->color;
|
||||
|
||||
regfree(&syntaxfile_regexp);
|
||||
if (colorstrings != NULL)
|
||||
break;
|
||||
}
|
||||
@@ -137,7 +126,6 @@ void update_color(void)
|
||||
}
|
||||
}
|
||||
do_colorinit();
|
||||
edit_refresh();
|
||||
}
|
||||
|
||||
#endif /* ENABLE_COLOR */
|
||||
|
||||
71
configure.ac
71
configure.ac
@@ -1,21 +1,43 @@
|
||||
# Configuration for GNU nano - a small and user-friendly text editor
|
||||
#
|
||||
# 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 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
|
||||
#
|
||||
# $Id$
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT
|
||||
|
||||
AC_INIT([GNU Nano], [1.1.99pre3], [nano-devel@gnu.org], [nano])
|
||||
AC_CONFIG_SRCDIR([nano.c])
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER([config.h:config.h.in])
|
||||
|
||||
AC_PREREQ(2.52)
|
||||
AM_INIT_AUTOMAKE(nano, 1.1.11)
|
||||
AM_CONFIG_HEADER(config.h:config.h.in)
|
||||
dnl AM_ACLOCAL_INCLUDE(m4)
|
||||
ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv nn nl da pl nb ms pt_BR"
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
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 unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h)
|
||||
AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termio.h termios.h unistd.h)
|
||||
|
||||
dnl options
|
||||
AC_ARG_ENABLE(debug,
|
||||
@@ -26,7 +48,7 @@ AC_ARG_ENABLE(debug,
|
||||
fi])
|
||||
|
||||
if test "$debug_support" != "yes"; then
|
||||
AC_DEFINE(NDEBUG, 1, [Shut up the assert warnings :-)])
|
||||
AC_DEFINE(NDEBUG, 1, [Shut up the assert warnings :-)])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(extra,
|
||||
@@ -37,8 +59,7 @@ AC_ARG_ENABLE(extra,
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(tiny,
|
||||
[ --enable-tiny Disable features for the sake of size
|
||||
(currently disables detailed help and i18n)],
|
||||
[ --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.])
|
||||
@@ -98,6 +119,13 @@ AC_ARG_ENABLE(wrapping,
|
||||
AC_DEFINE(DISABLE_WRAPPING, 1, [Define this to disable any and all text wrapping.])
|
||||
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
|
||||
AC_DEFINE(DISABLE_ROOTWRAP, 1, [Define this to disable wrapping as root by default.])
|
||||
fi])
|
||||
|
||||
|
||||
AC_ARG_ENABLE(color,
|
||||
[ --enable-color Enable color and syntax highlighting],
|
||||
[if test x$enableval = xyes; then
|
||||
@@ -124,6 +152,22 @@ AC_ARG_ENABLE(nanorc,
|
||||
AC_DEFINE(ENABLE_NANORC, 1, [Define this to use the .nanorc file.]) nanorc_support=yes
|
||||
fi])
|
||||
|
||||
AC_ARG_ENABLE(all,
|
||||
[ --enable-all Enable ALL extra nano functionality (kitchen sink option)],
|
||||
[if test x$enableval = xyes; then
|
||||
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_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 use slang])
|
||||
CURSES_LIB_NAME=""
|
||||
AC_ARG_WITH(slang,
|
||||
@@ -217,7 +261,7 @@ AC_MSG_WARN([*** Can not use slang when cross-compiling])),
|
||||
esac], [AC_MSG_RESULT(no)])
|
||||
|
||||
dnl Checks for functions
|
||||
AC_CHECK_FUNCS(snprintf vsnprintf)
|
||||
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,,
|
||||
@@ -278,7 +322,7 @@ 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 form the variable name?)
|
||||
# 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
|
||||
@@ -308,8 +352,5 @@ then
|
||||
LDFLAGS="$LDFLAGS $glib_libs"
|
||||
fi
|
||||
|
||||
dnl i18n stuff - pretty incomplete for now
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
AC_CONFIG_FILES([Makefile m4/Makefile po/Makefile.in nano.spec])
|
||||
AC_OUTPUT
|
||||
|
||||
64
cut.c
64
cut.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* cut.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -28,15 +28,9 @@
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
static int marked_cut; /* Is the cutbuffer from a mark? */
|
||||
static filestruct *cutbottom = NULL; /* Pointer to end of cutbuffer */
|
||||
static filestruct *cutbottom = NULL;
|
||||
/* Pointer to end of cutbuffer */
|
||||
|
||||
filestruct *get_cutbottom(void)
|
||||
{
|
||||
@@ -46,7 +40,7 @@ filestruct *get_cutbottom(void)
|
||||
void add_to_cutbuffer(filestruct *inptr)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("add_to_cutbuffer called with inptr->data = %s\n"),
|
||||
fprintf(stderr, _("add_to_cutbuffer() called with inptr->data = %s\n"),
|
||||
inptr->data);
|
||||
#endif
|
||||
|
||||
@@ -64,6 +58,7 @@ void add_to_cutbuffer(filestruct *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].
|
||||
@@ -128,8 +123,8 @@ void cut_marked_segment(filestruct *top, size_t top_x, filestruct *bot,
|
||||
} else {
|
||||
totsize -= bot_x + 1;
|
||||
|
||||
/* Here, the remainder line might get longer, so we realloc
|
||||
it first. */
|
||||
/* Here, the remainder line might get longer, so we
|
||||
realloc() it first. */
|
||||
top->data = (char *)nrealloc(top->data,
|
||||
sizeof(char) * newsize);
|
||||
memmove(top->data + top_x, bot->data + bot_x,
|
||||
@@ -255,12 +250,11 @@ int do_cut_text(void)
|
||||
UNSET(MARK_ISSET);
|
||||
|
||||
marked_cut = 1;
|
||||
set_modified();
|
||||
if (dontupdate) {
|
||||
fix_editbot();
|
||||
if (dontupdate)
|
||||
edit_refresh();
|
||||
} else
|
||||
else
|
||||
edit_update(current, CENTER);
|
||||
set_modified();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -275,7 +269,7 @@ int do_cut_text(void)
|
||||
#ifdef DEBUG
|
||||
dump_buffer(cutbuffer);
|
||||
#endif
|
||||
|
||||
|
||||
if (fileptr == fileage)
|
||||
fileage = current;
|
||||
else
|
||||
@@ -285,12 +279,11 @@ int do_cut_text(void)
|
||||
edittop = current;
|
||||
|
||||
renumber(current);
|
||||
current_x = 0;
|
||||
edit_refresh();
|
||||
set_modified();
|
||||
marked_cut = 0;
|
||||
current_x = 0;
|
||||
placewewant = 0;
|
||||
reset_cursor();
|
||||
SET(KEEP_CUTBUFFER);
|
||||
return 1;
|
||||
}
|
||||
@@ -298,12 +291,9 @@ int do_cut_text(void)
|
||||
int do_uncut_text(void)
|
||||
{
|
||||
filestruct *tmp = current, *fileptr = current;
|
||||
filestruct *newbuf = NULL;
|
||||
filestruct *newend = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
filestruct *newbuf = NULL, *newend = NULL;
|
||||
char *tmpstr, *tmpstr2;
|
||||
filestruct *hold = current;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
wrap_reset();
|
||||
@@ -311,9 +301,18 @@ int do_uncut_text(void)
|
||||
if (cutbuffer == NULL || fileptr == NULL)
|
||||
return 0; /* AIEEEEEEEEEEEE */
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (!marked_cut || cutbuffer->next != NULL)
|
||||
#endif
|
||||
/* 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 (marked_cut == 0 || cutbuffer->next != NULL)
|
||||
{
|
||||
newbuf = copy_filestruct(cutbuffer);
|
||||
for (newend = newbuf; newend->next != NULL && newend != NULL;
|
||||
@@ -322,8 +321,7 @@ int do_uncut_text(void)
|
||||
}
|
||||
|
||||
/* Hook newbuf into fileptr */
|
||||
#ifndef NANO_SMALL
|
||||
if (marked_cut) {
|
||||
if (marked_cut != 0) {
|
||||
int recenter_me = 0;
|
||||
/* Should we eventually use edit_update(CENTER)? */
|
||||
|
||||
@@ -336,7 +334,7 @@ int do_uncut_text(void)
|
||||
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'. */
|
||||
/* Use strncpy() to not copy the terminal '\0'. */
|
||||
|
||||
current_x += buf_len;
|
||||
totsize += buf_len;
|
||||
@@ -405,8 +403,7 @@ int do_uncut_text(void)
|
||||
|
||||
if (marked_cut == 2) {
|
||||
tmp = make_new_node(current);
|
||||
tmp->data = charalloc(strlen(¤t->data[current_x]) + 1);
|
||||
strcpy(tmp->data, ¤t->data[current_x]);
|
||||
tmp->data = mallocstrcpy(NULL, current->data + current_x);
|
||||
splice_node(current, tmp, current->next);
|
||||
null_at(¤t->data, current_x);
|
||||
current = current->next;
|
||||
@@ -432,7 +429,6 @@ int do_uncut_text(void)
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (fileptr != fileage) {
|
||||
tmp = fileptr->prev;
|
||||
@@ -456,7 +452,9 @@ int do_uncut_text(void)
|
||||
|
||||
i = editbot->lineno;
|
||||
renumber(newbuf);
|
||||
if (i < newend->lineno)
|
||||
/* 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();
|
||||
|
||||
965
faq.html
965
faq.html
@@ -1,721 +1,262 @@
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<title>The GNU nano editor FAQ</title>
|
||||
<head>
|
||||
<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]">
|
||||
<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="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000">
|
||||
|
||||
<h1>
|
||||
<font color="#CC0000">The nano FAQ</font></h1>
|
||||
<h2>
|
||||
<font color="#330000">Table of Contents</font></h2>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#1">1. General</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><a href="#1.1">1.1 About this FAQ.</a></font>
|
||||
<br><font color="#330000"><a href="#1.2">1.2. How do I contribute to it?</a></font>
|
||||
<br><font color="#330000"><a href="#1.3">1.3. What is GNU nano?</a></font>
|
||||
<br><font color="#330000"><a href="#1.4">1.4. What is the history behind
|
||||
nano?</a></font>
|
||||
<br><font color="#330000"><a href="#1.5">1.5. Why the name change from
|
||||
TIP?</a></font>
|
||||
<br><font color="#330000"><a href="#1.6">1.6. What is the current version
|
||||
of nano?</a></font>
|
||||
<br><font color="#330000"><a href="#1.7">1.7. I want to read the manpage
|
||||
without having to download the program!</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#2">2. Where to get GNU
|
||||
nano</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><a href="#2.1">2.1. FTP and WWW sites
|
||||
that carry nano.</a></font>
|
||||
<br><font color="#330000"><a href="#2.2">2.2. Redhat and derivatives (.rpm)
|
||||
packages.</a></font>
|
||||
<br><font color="#330000"><a href="#2.3">2.3. Debian (.deb) packages.</a></font>
|
||||
<br><font color="#330000"><a href="#2.4">2.4. By CVS (for the brave).</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#3">3. Installation and Configuration</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><a href="#3.1">3.1. How do install the
|
||||
RPM or DEB package?</a></font>
|
||||
<br><font color="#330000"><a href="#3.2">3.2. Compiling from source: WHAT
|
||||
THE HECK DO I DO NOW?</a></font>
|
||||
<br><font color="#330000"><a href="#3.3">3.3. Why does everything go into
|
||||
/usr/local?</a></font>
|
||||
<br><font color="#330000"><a href="#3.4">3.4. I get errors about 'bindtextdomain',
|
||||
'gettext' and/or 'gettextdomain'. What can I do about it?</a></font>
|
||||
<br><font color="#330000"><a href="#3.5">3.5. Nano should automatically
|
||||
run strip on the binary when installing it!</a></font>
|
||||
<br><font color="#330000"><a href="#3.6">3.6. How can I make the
|
||||
executable smaller? This is too bloated!</a></font>
|
||||
<br><font color="#330000"><a href="#3.7">3.7. Tell me more about this
|
||||
multibuffer stuff!</a></font>
|
||||
<br><font color="#330000"><a href="#3.8">3.8. How do I make a .nanorc file
|
||||
that nano will read when I start it?</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#4">4. Running</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><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></font>
|
||||
<br><font color="#330000"><a href="#4.2">4.2. Nano crashes when I type
|
||||
<insert keystroke here>!</a></font>
|
||||
<br><font color="#330000"><a href="#4.3">4.3. Nano crashes when I resize
|
||||
my window. How can I fix that?</a></font>
|
||||
<br><font color="#330000"><a href="#4.4">4.4. Why does nano show ^\
|
||||
in the shortcut list instead of ^J?</a></font>
|
||||
<br><font color="#330000"><a href="#4.5">4.5. When I type in a
|
||||
search string, the string I last searched for is already in front of
|
||||
my cursor! What happened?!</a></font>
|
||||
<br><font color="#330000"><a href="#4.6">4.6. I get the message "NumLock
|
||||
glitch detected. Keypad will malfunction with NumLock off." What
|
||||
gives?</a></font>
|
||||
<br><font color="#330000"><a href="#4.7">4.7. How do I make nano my
|
||||
default editor (in Pine, mutt, etc.)?</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#5">5. Internationalization</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><a href="#5.1">5.1. There's no translation
|
||||
for my language!</a></font>
|
||||
<br><font color="#330000"><a href="#5.2">5.2. I don't like the translation
|
||||
for <x> in my language. How can I fix it?</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#6">6. Advocacy and Licensing</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><a href="#6.1">6.1. Why should I use
|
||||
nano instead of Pico?</a></font>
|
||||
<br><font color="#330000"><a href="#6.2">6.2. Why should I use Pico instead
|
||||
of nano?</a></font>
|
||||
<br><font color="#330000"><a href="#6.3">6.3. What is so bad about the
|
||||
Pine license?</a></font>
|
||||
<br><font color="#330000"><a href="#6.4">6.4. Okay, well what mail program
|
||||
should I use then?</a></font>
|
||||
<br><font color="#330000"><a href="#6.5">6.5. Why doesn't UW simply change
|
||||
their license?</a></font>
|
||||
<br><font color="#330000"><a href="#6.6">6.6. What if tomorrow UW changes
|
||||
the license to be truly Free Software?</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<font color="#330000"><a href="#7">7. Miscellaneous</a></font></h2>
|
||||
|
||||
<blockquote><font color="#330000"><a href="#7.1">7.1. Nano related mailing
|
||||
lists.</a></font>
|
||||
<br><font color="#330000"><a href="#7.2">7.2. I want to send the development
|
||||
team a big load of cash (or just a thank you).</a></font>
|
||||
<br><font color="#330000"><a href="#7.3">7.3. How do I submit a patch?</a></font>
|
||||
<br><font color="#330000"><a href="#7.4">7.4. How do I join the development
|
||||
team?</a></font>
|
||||
<br><font color="#330000"><a href="#7.5">7.5. Can I have CVS write access?</a></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a href="#8">8. ChangeLog</a></h2>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<br>
|
||||
<h1>
|
||||
<a NAME="1"></a><font color="#330000">1. General</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.1"></a><font color="#330000">1.1 About this FAQ.</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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...</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.2"></a><font color="#330000">1.2. How do I contribute to it?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.3"></a><font color="#330000">1.3. What is GNU nano?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">GNU Nano is designed to be a free
|
||||
replacement for the Pico text editor, part of the Pine email suite from <a
|
||||
href="http://www.washington.edu/pine">The University of
|
||||
Washington</a>. It aims to "emulate Pico as closely as possible and
|
||||
perhaps include extra functionality.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.4"></a><font color="#330000">1.4. What is the history behind
|
||||
nano?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">Funny you should ask!</font>
|
||||
<p><b><font color="#330000">In the beginning...</font></b>
|
||||
<p><font color="#330000">For years Pine was THE program used to read email
|
||||
on a Unix system. The Pico text editor is the portion of the program
|
||||
one would use to compose his or her mail messages. Many beginners
|
||||
to Unix flocked to Pico and Pine because of their well organized, easy
|
||||
to use interfaces. With the proliferation of GNU/Linux in the mid to
|
||||
late 90's, many University students became intimately familiar with the
|
||||
strengths (and weaknesses) of Pine and Pico.</font>
|
||||
<p><b><font color="#330000">Then came Debian...</font></b>
|
||||
<p><font color="#330000">The <a href="http://www.debian.org">Debian GNU/Linux</a>
|
||||
distribution, known for its strict standards in distributing truly "free"
|
||||
software (i.e. had no restrictions on redistribution), would not include
|
||||
a binary package for Pine or Pico. Many people had a serious dilemma:
|
||||
they loved these programs, but they were not truly free software in the
|
||||
<a href="http://www.gnu.org/philosophy/free-sw.html">GNU</a>
|
||||
sense of the word.</font>
|
||||
<p><b><font color="#330000">The event...</font></b>
|
||||
<p><font color="#330000">It was in late 1999 when Chris Allegretta (our
|
||||
hero) was yet again complaining to himself about the less-than-perfect
|
||||
license Pico was distributed under, the 1000 makefiles that came with
|
||||
it and how just a few small improvements could make it the Best Editor
|
||||
in the World (TM). Having been a convert from Slackware to Debian,
|
||||
he missed having a simple binary package that included Pine and Pico, and
|
||||
had grown tired of downloading them himself.</font>
|
||||
<p><font color="#330000">Finally something snapped inside and Chris coded
|
||||
and hacked like a madman for many hours straight one weekend to make a
|
||||
(barely usable) Pico clone, at the time called TIP (Tip Isn't Pico).
|
||||
The program could not be invoked without a filename, could not save files,
|
||||
had no help menu, spell checker, and so forth. But over time it improved,
|
||||
and with the help of a few great coders it matured to the (hopefully) stable
|
||||
state it is today.
|
||||
<p><font color="#330000">In February 2001, nano has been declared an
|
||||
official GNU program by Richard Stallman. Nano also reached its first
|
||||
production release on March 22, 2001.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.5"></a><font color="#330000">1.5. Why the name change from TIP?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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).</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.6"></a><font color="#330000">1.6 What is the current version
|
||||
of nano?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The current version of nano *should*
|
||||
be 1.1.11. Of course you should always check the nano homepage to
|
||||
see what the latest and greatest version is.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="1.7"></a><font color="#330000">1.7. I want to read the man page
|
||||
without having to download the program!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">Jeez, demanding, aren't we?
|
||||
Okay, look <a href="http://www.nano-editor.org/dist/nano.1.html">here</a>.</font></blockquote>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h1>
|
||||
<a NAME="2"></a><font color="#330000">2. Where to get GNU nano</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="2.1"></a><font color="#330000">2.1. FTP and WWW sites that carry
|
||||
nano.</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The nano distribution can be downloaded
|
||||
at the following fine web and ftp sites:</font>
|
||||
<ul>
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.nano-editor.org/dist">http://www.nano-editor.org/dist</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.ewtoo.org/~astyanax/nano/dist">http://www.ewtoo.org/~astyanax/nano/dist</a></font></li>
|
||||
<li>
|
||||
<font color="#330000"><a href="ftp://ftp.gnu.org/pub/gnu/nano">ftp://ftp.gnu.org/pub/gnu/nano</a></font></li>
|
||||
|
||||
</ul>
|
||||
<body text="#330000" bgcolor="#ffffff" link="#0000ef" vlink="#51188e" alink="#ff0000">
|
||||
<h1>The nano 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>
|
||||
<a href="#1.2">1.2. How do I contribute to it?</a><br>
|
||||
<a href="#1.3">1.3. What is GNU nano?</a><br>
|
||||
<a href="#1.4">1.4. What is the history behind nano?</a><br>
|
||||
<a href="#1.5">1.5. Why the name change from TIP?</a><br>
|
||||
<a href="#1.6">1.6. What is the current version of nano?</a><br>
|
||||
<a href="#1.7">1.7. I want to read the manpage without having to download the program!</a></p></blockquote>
|
||||
<h2><a href="#2">2. Where to get GNU nano.</a></h2>
|
||||
<blockquote><p><a href="#2.1">2.1. FTP and WWW sites that carry nano.</a><br>
|
||||
<a href="#2.2">2.2. RedHat and derivatives (.rpm) packages.</a><br>
|
||||
<a href="#2.3">2.3. Debian (.deb) packages.</a><br>
|
||||
<a href="#2.4">2.4. By CVS (for the brave).</a></p></blockquote>
|
||||
<h2><a href="#3">3. Installation and Configuration</a></h2>
|
||||
<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.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>
|
||||
<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.0 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></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>
|
||||
<h2><a href="#6">6. Advocacy and Licensing</a></h2>
|
||||
<blockquote><p><a href="#6.1">6.1. Why should I use nano instead of Pico?</a><br>
|
||||
<a href="#6.2">6.2. Why should I use Pico instead of nano?</a><br>
|
||||
<a href="#6.3">6.3. What is so bad about the Pine license?</a><br>
|
||||
<a href="#6.4">6.4. Okay, well what mail program should I use then?</a><br>
|
||||
<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>
|
||||
<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>
|
||||
<a href="#7.5">7.5. Can I have CVS write access?</a></p></blockquote>
|
||||
<h2><a href="#8">8. ChangeLog</a></h2>
|
||||
<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>
|
||||
<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>
|
||||
<blockquote><p>GNU nano is designed to be a free replacement for the Pico text editor, part of the Pine email suite from <a href="http://www.washington.edu/pine/">The University of Washington</a>. It aims to "emulate Pico as closely as possible and perhaps include extra functionality".</p></blockquote>
|
||||
<h2><a name="1.4"></a>1.4. What is the history behind nano?</h2>
|
||||
<blockquote><p>Funny you should ask!</p>
|
||||
<p><b>In the beginning...</b></p>
|
||||
<p>For years Pine was THE program used to read email on a Unix system. The Pico text editor is the portion of the program one would use to compose his or her mail messages. Many beginners to Unix flocked to Pico and Pine because of their well organized, easy to use interfaces. With the proliferation of GNU/Linux in the mid to late 90's, many University students became intimately familiar with the strengths (and weaknesses) of Pine and Pico.</p>
|
||||
<p><b>Then came Debian...</b></p>
|
||||
<p>The <a href="http://www.debian.org/">Debian GNU/Linux</a> distribution, known for its strict standards in distributing truly "free" software (i.e. software with no restrictions on redistribution), would not include a binary package for Pine or Pico. Many people had a serious dilemma: they loved these programs, but they were not truly free software in the <a href="http://www.gnu.org/philosophy/free-sw.html">GNU</a> sense of the word.</p>
|
||||
<p><b>The event...</b></p>
|
||||
<p>It was in late 1999 when Chris Allegretta (our hero) was yet again complaining to himself about the less-than-perfect license Pico was distributed under, the 1000 makefiles that came with it and how just a few small improvements could make it the Best Editor in the World (TM). Having been a convert from Slackware to Debian, he missed having a simple binary package that included Pine and Pico, and had grown tired of downloading them himself.</p>
|
||||
<p>Finally something snapped inside and Chris coded and hacked like a madman for many hours straight one weekend to make a (barely usable) Pico clone, at the time called TIP (Tip Isn't Pico). The program could not be invoked without a filename, could not save files, had no help menu, spell checker, and so forth. But over time it improved, and with the help of a few great coders it matured to the (hopefully) stable state it is today.</p>
|
||||
<p>In February 2001, nano was declared an official GNU program by Richard Stallman. Nano also reached its first production release on March 22, 2001.</p></blockquote>
|
||||
<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.1.99pre3. 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.1/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>
|
||||
<blockquote><p>The nano distribution can be downloaded at the following fine web and ftp sites:</p>
|
||||
<ul>
|
||||
<li><a href="http://www.nano-editor.org/dist/">http://www.nano-editor.org/dist/</a></li>
|
||||
<li><a href="http://www.ewtoo.org/~astyanax/nano/dist/">http://www.ewtoo.org/~astyanax/nano/dist/</a></li>
|
||||
<li><a href="ftp://ftp.gnu.org/pub/gnu/nano/">ftp://ftp.gnu.org/pub/gnu/nano/</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="2.2"></a><font color="#330000">2.2. Redhat and derivatives (.rpm)
|
||||
packages.</font></h2>
|
||||
|
||||
<h2><a name="2.2"></a>2.2. RedHat and derivatives (.rpm) packages.</h2>
|
||||
<blockquote>
|
||||
<ul>
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.nano-editor.org/dist/RPMS">http://www.nano-editor.org/dist/RPMS</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.ewtoo.org/~astyanax/nano/dist/RPMS">http://www.ewtoo.org/~astyanax/nano/dist/RPMS</a></font></li>
|
||||
|
||||
</ul>
|
||||
<font color="#330000">Additionally, check out the Redhat contribs section
|
||||
at:</font>
|
||||
<ul>
|
||||
<li>
|
||||
<font color="#330000"><a href="http://distro.ibiblio.org/pub/Linux/distributions/redhat/contrib/libc6/i386">http://metalab.unc.edu/pub/Linux/distributions/redhat/contrib/libc6/i386</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="ftp://distro.ibiblio.org/pub/Linux/distributions/redhat/contrib/libc6/i386">ftp://metalab.unc.edu/pub/Linux/distributions/redhat/contrib/libc6/i386</a></font></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><a href="http://www.nano-editor.org/dist/v1.0/RPMS/">http://www.nano-editor.org/dist/v1.0/RPMS/</a></li>
|
||||
<li><a href="http://www.ewtoo.org/~astyanax/nano/dist/v1.0/RPMS/">http://www.ewtoo.org/~astyanax/nano/dist/v1.0/RPMS/</a></li>
|
||||
</ul>
|
||||
<p>Additionally, check out the RedHat contribs section at:</p>
|
||||
<ul>
|
||||
<li><a href="http://distro.ibiblio.org/pub/Linux/distributions/redhat/contrib/libc6/i386/">http://distro.ibiblio.org/pub/Linux/distributions/redhat/contrib/libc6/i386/</a></li>
|
||||
<li><a href="ftp://distro.ibiblio.org/pub/Linux/distributions/redhat/contrib/libc6/i386/">ftp://distro.ibiblio.org/pub/Linux/distributions/redhat/contrib/libc6/i386/</a></li>
|
||||
</ul>
|
||||
</blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="2.3"></a><font color="#330000">2.3. Debian (.deb) packages.</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">For Debian users, you can check out the
|
||||
current nano packages for:</font>
|
||||
<ul>
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.debian.org/Packages/stable/editors/nano.html">stable</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.debian.org/Packages/testing/editors/nano.html">testing</a></font></li>
|
||||
|
||||
<li>
|
||||
<font color="#330000"><a href="http://www.debian.org/Packages/unstable/editors/nano.html">unstable</a></font></li>
|
||||
</ul>
|
||||
<p><font color="#330000">You can also have a look at the</font>
|
||||
<font color="#330000"><a href="ftp://ftp.debian.org/debian/pool/main/n/nano/">Package Pool</a> to see all the available binary and source packages.</font></p>
|
||||
|
||||
<font color="#330000">Note that versions < 0.9.10 are probably not for
|
||||
those wanting to get serious work done, so if you are using Debian 2.2, check
|
||||
that you have updated to 2.2r3, which comes with nano 0.9.23. If you're
|
||||
tracking unstable, you probably have the newest version already.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="2.4"></a><font color="#330000">2.4. By CVS (for the brave).</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">For the 'bleeding edge' current version
|
||||
of nano, you can use CVS to download the current source code. <b>Note:</b>
|
||||
believe it or not, by downloading code that has not yet stabilized into
|
||||
an official release, there could quite possibly be bugs, in fact the code
|
||||
may not even compile! Anyway, see <a href="http://savannah.gnu.org/cvs/?group_id=1025">the
|
||||
nano CVS page</a> for info on anonymous CVS access to the nano source.</font></blockquote>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h1>
|
||||
<a NAME="3"></a><font color="#330000">3. Installation and Configuration</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.1"></a><font color="#330000">3.1. How do install the RPM or
|
||||
DEB package?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">It's simple really! As root, type
|
||||
<b>rpm
|
||||
-Uvh nano-x.y.z-1.i386.rpm</b> if you have a Redhat-ish system or
|
||||
<b>dpkg
|
||||
-i nano_x.y.z-1.deb</b> if you have a Debian-ish system, where
|
||||
<b>x.y.z</b>
|
||||
is the release of nano. There are other programs to install packages,
|
||||
and if you wish to use those, knock yourself out.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.2"></a><font color="#330000">3.2. Compiling from source: WHAT
|
||||
THE HECK DO I DO NOW?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">Okay, take a deep breath, this really
|
||||
isn't hard. Unpack the nano source with a command like:</font>
|
||||
<p><b><font color="#330000">tar -zxvf nano-x.y.z.tar.gz</font></b>
|
||||
<p><font color="#330000">If you get error messages about the -z option,
|
||||
try this:</font>
|
||||
<p><b><font color="#330000">gzip -dc nano-x.y.z.tar.gz | tar xvf -</font></b>
|
||||
<p><font color="#330000">(again, where x.y.z is the version number in question).
|
||||
Then you need to run configure with any options you might want (if any).</font>
|
||||
<p><font color="#330000">The average case is this:</font>
|
||||
<p><b><font color="#330000">cd nano-x.y.z/</font></b>
|
||||
<br><b><font color="#330000">./configure</font></b>
|
||||
<br><b><font color="#330000">make</font></b>
|
||||
<br><font color="#330000"><b>make install </b>(as root, of course)</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.3"></a><font color="#330000">3.3. Why does everything go into
|
||||
/usr/local?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">Well, that's what the <b>configure</b>
|
||||
script defaults to. If you wish to change this, simply do this:</font>
|
||||
<p><b><font color="#330000">./configure --prefix=/usr</font></b>
|
||||
<p><font color="#330000">to put nano into /usr/bin when you run <b>make
|
||||
install</b>.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.4"></a><font color="#330000">3.4. I get errors about 'bindtextdomain',
|
||||
'gettext' and/or 'gettextdomain'. What can I do about it?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.5"></a><font color="#330000">3.5. Nano should automatically
|
||||
run strip on the binary when installing it!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.6"></a><font color="#330000">
|
||||
3.6. How can I make the executable smaller? This is too
|
||||
bloated!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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:
|
||||
<pre>
|
||||
<b>--disable-tabcomp</b> Disables 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-operatingdir</b> Disable setting of operating directory
|
||||
</pre><br>
|
||||
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>If, in the other hand, you can't live without bells and whistles, you could
|
||||
try:
|
||||
<pre>
|
||||
<b>--enable-extra</b> Enable extra functions, including 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
|
||||
</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.7"></a><font color="#330000">
|
||||
3.7. Tell me more about this multibuffer stuff!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000"> To use multiple file buffers, you must
|
||||
be using nano 1.1.11 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>
|
||||
|
||||
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.
|
||||
</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="3.8"></a><font color="#330000">
|
||||
3.8. How do I make a .nanorc file that nano will read when I start it?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000"> 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.11 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". </font></blockquote> <hr WIDTH="100%">
|
||||
|
||||
<h1><a NAME="4"></a><font color="#330000">4. Running</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.1"></a><font color="#330000">4.1. Ack! My backspace/delete/enter/double
|
||||
bucky/meta key doesn't seem to work! What can I do?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">Try setting your $TERM variable to 'vt100'.
|
||||
Nano doesn't yet support every term entry under the sun.</font>
|
||||
<p><font color="#330000">Bourne shell users (like bash): <b>export TERM=vt100</b></font>
|
||||
<br><font color="#330000">C Shell users (tcsh and csh): <b>setenv TERM
|
||||
vt100</b></font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.2"></a><font color="#330000">4.2. Nano crashes when I type <insert
|
||||
keystroke here>!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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>.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.3"></a><font color="#330000">4.3. Nano crashes when I resize
|
||||
my window. How can I fix that?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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).</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.4"></a><font color="#330000">4.4. Why does nano show ^\ in the
|
||||
shortcut list instead of ^J?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The help (^G) and justify (^J) function
|
||||
were among the last to be written. To show the improvements that
|
||||
nano had over Pico (goto 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.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a name="4.5"><font color="#330000">4.5. When I type in a search
|
||||
string, the string I last searched for is already in front of my
|
||||
cursor! What happened?!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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).</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.6"></a>I get the message "NumLock glitch detected. Keypad
|
||||
will malfunction with NumLock off." What gives?</h2>
|
||||
|
||||
<h2><a name="2.3"></a>2.3. Debian (.deb) packages.</h2>
|
||||
<blockquote><p>Debian users can check out the current nano packages for:</p>
|
||||
<ul>
|
||||
<li><a href="http://packages.debian.org/stable/editors/nano.html">stable</a></li>
|
||||
<li><a href="http://packages.debian.org/testing/editors/nano.html">testing</a></li>
|
||||
<li><a href="http://packages.debian.org/unstable/editors/nano.html">unstable</a></li>
|
||||
</ul>
|
||||
<p>You can also have a look at the <a href="ftp://ftp.debian.org/debian/pool/main/n/nano/">Package Pool</a> to see all the available binary and source packages.</p>
|
||||
<p>Note that versions < 0.9.10 are probably not for those wanting to get serious work done, so if you are using Debian 2.2, check that you have updated to 2.2r3, which comes with nano 0.9.23. If you're tracking unstable, you probably have the newest version already.</p></blockquote>
|
||||
<h2><a name="2.4"></a>2.4. By CVS (for the brave).</h2>
|
||||
<blockquote><p>For the 'bleeding edge' current version of nano, you can use CVS to download the current source code. <b>Note:</b> believe it or not, by downloading code that has not yet stabilized into an official release, there could quite possibly be bugs, in fact the code may not even compile! Anyway, see <a href="http://savannah.gnu.org/cvs/?group_id=1025">the nano CVS page</a> for info on anonymous CVS access to the nano source.</p></blockquote>
|
||||
<hr width="100%">
|
||||
<h1><a name="3"></a>3. Installation and Configuration</h1>
|
||||
<h2><a name="3.1"></a>3.1. How do install the RPM or DEB package?</h2>
|
||||
<blockquote><p>It's simple really! As root, type <b>rpm -Uvh nano-x.y.z-1.i386.rpm</b> if you have a RedHat-ish system or <b>dpkg -i nano_x.y.z-1.deb</b> if you have a Debian-ish system, where <b>x.y.z</b> is the release of nano. There are other programs to install packages, and if you wish to use those, knock yourself out.</p></blockquote>
|
||||
<h2><a name="3.2"></a>3.2. Compiling from source: WHAT THE HECK DO I DO NOW?</h2>
|
||||
<blockquote><p>Okay, take a deep breath, this really isn't hard. Unpack the nano source with a command like:</p>
|
||||
<p><b>tar -zxvf nano-x.y.z.tar.gz</b></p>
|
||||
<p>If you get error messages about the -z option, try this:</p>
|
||||
<p><b>gzip -dc nano-x.y.z.tar.gz | tar xvf -</b></p>
|
||||
<p>(again, where x.y.z is the version number in question). Then you need to run configure with any options you might want (if any).</p>
|
||||
<p>The average case is this:</p>
|
||||
<p><b>cd nano-x.y.z/</b><br>
|
||||
<b>./configure</b><br>
|
||||
<b>make</b><br>
|
||||
<b>make install</b> (as root, of course)</p></blockquote>
|
||||
<h2><a name="3.3"></a>3.3. Why does everything go into /usr/local?</h2>
|
||||
<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>
|
||||
<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-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-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-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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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.0 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>
|
||||
<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>
|
||||
<p><b>setenv EDITOR /usr/local/bin/nano</b></p>
|
||||
<p>Change /usr/local/bin/nano to wherever nano is installed on your system. Type "which nano" to find out. This will not take effect until the next time you login. So log out and back in again.</p>
|
||||
<p>Then on top that if you use Pine you must go into setup (type <b>S</b> at the main menu), then configure (type <b>C</b>). Hit enter on the lines that say:</p>
|
||||
<p><b>[ ] enable-alternate-editor-cmd</b><br>
|
||||
<b>[ ] enable-alternate-editor-implicitly</b></p>
|
||||
<p>Then exit (<b>E</b>) and select Yes (<b>Y</b>).</p>
|
||||
<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>
|
||||
<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>
|
||||
<blockquote><p>On June of 2001, GNU nano entered the <a href="http://www.iro.umontreal.ca/contrib/po/HTML/">Free Translation Project</a> and since then, translations should be managed from there.</p>
|
||||
<p>If there isn't a translation for your language, you could ask <a href="http://www.iro.umontreal.ca/contrib/po/HTML/teams.html">your language team</a> to translate nano, or better still, join your team and do it yourself. Joining a team is easy. You just need to ask the <a href="mailto:translation@iro.umontreal.ca">TP coordinator</a> to add you to your team, and send a <a href="http://www.iro.umontreal.ca/contrib/po/HTML/disclaim.html">translation disclaimer to the FSF</a> (this is necessary as nano is an official GNU package, but it does <b>not</b> mean that you transfer the rights of your work to the FSF, it's just so the FSF can legally manage them).</p>
|
||||
<p>In any case, translating nano is very easy. Just grab the <b>nano.pot</b> file from the latest and greatest nano distribution (it's in the <b>po/</b> directory) and translate each line into your native language on the <b>msgstr</b> line. When you're done, you should send it to the TP's central po repository.</p></blockquote>
|
||||
<h2><a name="5.2"></a>5.2. I don't like the translation for <x> in my language. How can I fix it?</h2>
|
||||
<blockquote><p>The best way would probably be to e-mail the person listed in the <code>Last-Translator:</code> field in the <b><your_language>.po</b> file with your suggested corrections and they can make the changes reach the nano-devel list.</p></blockquote>
|
||||
<hr width="100%">
|
||||
<h1><a name="6"></a>6. Advocacy and Licensing</h1>
|
||||
<h2><a name="6.1"></a>6.1. Why should I use nano instead of Pico?</h2>
|
||||
<blockquote><p>There are many reasons to use nano instead of Pico, a more complete list can be found at the <a href="http://www.nano-editor.org/">nano homepage</a>.</p></blockquote>
|
||||
<h2><a name="6.2"></a>6.2. Why should I use Pico instead of nano?</h2>
|
||||
<blockquote><p>Again, check out the <a href="http://www.nano-editor.org/">nano homepage</a> for a good summary of reasons. It really is a matter of personal preference as to which editor you should use. If you're the type of person who likes using the original version of a program, then Pico is the editor for you. If you're looking for a few more features and a 'better' license as far as adding your own changes (sacrificing mailer integration with Pine), nano is the way to go.</p></blockquote>
|
||||
<h2><a name="6.3"></a>6.3. What is so bad about the Pine license?</h2>
|
||||
<blockquote><p>The U of W license for Pine and Pico is not considered truly Free Software according to both the Free Software Foundation and the <a href="http://www.debian.org/social_contract#guidelines">Debian Free Software Guidelines</a>. The main problem regards the limitations on distributing derived works: according to UW, you can distribute their software, and you can modify it, but you can not do both, i.e. distribute modified binaries.</p></blockquote>
|
||||
<h2><a name="6.4"></a>6.4. Okay, well what mail program should I use then?</h2>
|
||||
<blockquote><p>If you are looking to use a Free Software program similar to Pine and emacs is not your thing, you should definitely take a look at <a href="http://www.mutt.org/">mutt</a>. It is a full-screen, console based mail program that actually has a lot more flexibility than Pine, but has a keymap included in the distribution that allows you to use the same keystrokes as Pine would to send and receive mail. It's also licensed under the GPL.</p></blockquote>
|
||||
<h2><a name="6.5"></a>6.5. Why doesn't UW simply change their license?</h2>
|
||||
<blockquote><p>You're really not asking the right person here. I (Chris) waited a long time to see if UW would change their license because of the amount of high quality software being released and developed under the GPL without being taken advantage of by malicious corporate entities or other baddies, but no such luck so far.</p></blockquote>
|
||||
<h2><a name="6.6"></a>6.6. What if tomorrow UW changes the license to be truly Free Software?</h2>
|
||||
<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>
|
||||
<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.1/BUGS">bug</a> in the program or implement a <a href="http://www.nano-editor.org/dist/v1.1/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>
|
||||
<blockquote><p>The easiest way is to consistently send in good patches that add some needed functionality, fix a bug or two and/or make the program more optimized/efficient. Then ask nicely and you will probably be added to the Savannah development list and be given CVS write access after awhile. There is a lot of responsibility that goes along with being a team member, so don't think it's just something to add to your resume.</p></blockquote>
|
||||
<h2><a name="7.5"></a>7.5. Can I have CVS write access?</h2>
|
||||
<blockquote><p>Re-read Section <a href="#7.4">7.4</a> and you should know the answer.</p></blockquote>
|
||||
<h2><a name="8"></a>8. ChangeLog</h2>
|
||||
<blockquote>
|
||||
Nano (actually almost all console editors do) has issues when cycling
|
||||
the NumLock key in certain X terminals (rxvt, aterm, wterm, etc...). When
|
||||
you switch NumLock 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.
|
||||
<br><br>
|
||||
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>.
|
||||
<br> </blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="4.7"></a>4.7. How do I make nano my default editor (in Pine,
|
||||
mutt, etc)?</h2>
|
||||
|
||||
<blockquote>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><b>export EDITOR=/usr/local/bin/nano</b>
|
||||
<p>or if you use tcsh put this in your <b>.cshrc</b> file:
|
||||
<p><b>setenv EDITOR /usr/local/bin/nano</b>
|
||||
<p>Change /usr/local/bin/nano to wherever nano is installed in your system.
|
||||
Type which nano to find out. This will not take effect until the next time
|
||||
you login. So log out and back in again.
|
||||
<p>Then on top that if you use Pine you must go into setup (type <b>S</b>
|
||||
at the main menu), then configure (type <b>C</b>). Hit enter on the
|
||||
lines that say:
|
||||
<p><b>[ ] enable-alternate-editor-cmd</b>
|
||||
<br><b>[ ] enable-alternate-editor-implicitly</b>
|
||||
<p>Then exit (<b>E</b>) and select Yes (<b>Y</b>).
|
||||
<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><b>my_hdr X-Composer: nano x.y.z</b>
|
||||
<p>Again, replace x.y.z with the version of nano you use.
|
||||
<br> </blockquote>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h1>
|
||||
<a NAME="5"></a><font color="#330000">5. Internationalization</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="5.1"></a><font color="#330000">5.1. There's no translation for
|
||||
my language!</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">On June of 2001, GNU nano entered the
|
||||
<a href="www.iro.umontreal.ca/contrib/po/HTML">Free Translation Project</a>
|
||||
and since then, translations should be managed from there.
|
||||
<p>If there isn't a translation for your language, you could ask
|
||||
<a href="http://www.iro.umontreal.ca/contrib/po/HTML/teams.html">your language
|
||||
team</a> to tranlate nano, or better still, join your team and do it yourself.
|
||||
Joining a team is easy. You just need to ask the
|
||||
<a href="mailto:translation@iro.umontreal.ca">TP coordinator</a> to add you
|
||||
to your team, and send a <a href="http://www.iro.umontreal.ca/contrib/po/HTML/disclaim.html">translation disclaimer to the FSF</a> (this is necessary as
|
||||
nano is an official GNU package, but it does <strong>not</strong> mean that
|
||||
you transfer the rights of your work to the FSF, it's just so the FSF can
|
||||
legaly manage them).</p>
|
||||
<p>In any case, translating nano is very easy. Just grab the
|
||||
<b>nano.pot</b> file from the latest and greatest nano distribution
|
||||
(it's in the <b>po/</b> directory) and translate each line into your native
|
||||
language on the <b>msgstr</b> line. When you're done, you should
|
||||
send it to the TP's central po repository.
|
||||
|
||||
<h2>
|
||||
<a NAME="5.2"></a><font color="#330000">5.2. I don't like the translation
|
||||
for <x> in my language. How can I fix it?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The best way would probably be to e-mail
|
||||
the person listed in the <code>Last-Translator:</code> field in
|
||||
<b><your_language>.po</b> file with your suggested corrections and
|
||||
they can make the changes reach the nano devel list.</font></blockquote>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h1>
|
||||
<a NAME="6"></a><font color="#330000">6. Advocacy and Licensing</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="6.1"></a><font color="#330000">6.1. Why should I use nano instead
|
||||
of Pico?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">There are many reasons to use nano instead
|
||||
of Pico, a more complete list can be found at the <a href="http://www.nano-editor.org">nano
|
||||
homepage</a>.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="6.2"></a><font color="#330000">6.2. Why should I use Pico instead
|
||||
of nano?</font></h2>
|
||||
|
||||
<blockquote>Again, check out the <a href="http://www.nano-editor.org">nano
|
||||
homepage</a> for a good summary of reasons. It really is a matter
|
||||
of personal preference as to which editor you should use. If you're
|
||||
the type of person who likes using the original version of a program, then
|
||||
Pico is the editor for you. If you're looking for a few more
|
||||
features and a 'better' license as far as adding your own changes (sacrificing
|
||||
mailer integration with Pine), nano is the way to go.
|
||||
</blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="6.3"></a><font color="#330000">6.3. What is so bad about the Pine
|
||||
license?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The U of W license for Pine and
|
||||
Pico is not considered truly Free Software according to both the Free
|
||||
Software Foundation and the the <a
|
||||
href="http://www.debian.org/social_contract#guidelines">Debian
|
||||
Free Software Guidelines</a>. The main problem regards the
|
||||
limitations on distributing derived works: according to UW, you can
|
||||
distribute their software, and you can modify it, but you can not do
|
||||
both, i.e. distribute modified binaries.</blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="6.4"></a><font color="#330000">6.4. Okay, well what mail program
|
||||
should I use then?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000"> If you are looking to use a Free
|
||||
Software program similar to Pine and emacs is not your thing, you should
|
||||
definitely take a look at <a href="http://www.mutt.org">mutt</a>. It
|
||||
is a full-screen, console based mail program that actually has a lot more
|
||||
flexibility than Pine, but has a keymap included in the distribution that
|
||||
allows you to use the same keystrokes as Pine would to send and receive
|
||||
mail. It's also licensed under the GPL.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="6.5"></a><font color="#330000">6.5. Why doesn't UW simply change
|
||||
their license?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">You're really not asking the right person
|
||||
here. I (Chris) waited a long time to see if UW would change their
|
||||
license because of the amount of high quality software being released and
|
||||
developed under the GPL without being taken advantage of by malicious corporate
|
||||
entities or other baddies, but no such luck so far.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="6.6"></a><font color="#330000">6.6. What if tomorrow UW changes
|
||||
the license to be truly Free Software?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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.</font></blockquote>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h1>
|
||||
<a NAME="7"></a><font color="#330000">7. Miscellaneous</font></h1>
|
||||
|
||||
<h2>
|
||||
<a NAME="7.1"></a><font color="#330000">7.1. Nano related mailing lists.</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">There are three mailing lists for nano
|
||||
hosted at <a href="http://savannah.gnu.org">Savannah</a>, info-nano, help-nano
|
||||
and nano-devel. Nano-announce is a very low traffic list where new
|
||||
versions of nano are announced (surprise!) Nano-devel is a normally
|
||||
low, sometimes high traffic list for discussing the present and future
|
||||
development of nano. Help-nano is for getting help with the editor
|
||||
without needing to hear all of the development issues surrunding it.
|
||||
Here are links to where you can sign up for
|
||||
a given list:</font><font color="#330000"></font>
|
||||
<p><font color="#330000">info-nano - <a href="
|
||||
http://mail.gnu.org/mailman/listinfo/info-nano">
|
||||
http://mail.gnu.org/mailman/listinfo/info-nano</a></font>
|
||||
<br>
|
||||
<font color="#330000">help-nano -
|
||||
<a href="http://mail.gnu.org/mailman/listinfo/help-nano">
|
||||
http://mail.gnu.org/mailman/listinfo/help-nano</a></font>
|
||||
<br>
|
||||
<font color="#330000">nano-devel -
|
||||
<a href="http://mail.gnu.org/mailman/listinfo/nano-devel">
|
||||
http://mail.gnu.org/mailman/listinfo/nano-devel</a></font>
|
||||
</blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="7.2"></a><font color="#330000">7.2. I want to send the development
|
||||
team a big load of cash (or just a thank you).</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">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/BUGS">bug</a>
|
||||
in the program or implement a <a href="http://www.nano-editor.org/dist/TODO">cool
|
||||
feature</a> and send us that instead (though cash is fine too).</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="7.3"></a><font color="#330000">7.3. How do I submit a patch?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">See Section <a href="#7.2">7.2</a>.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="7.4"></a><font color="#330000">7.4. How do I join the development
|
||||
team?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">The easiest way is to consistently send
|
||||
in good patches that add some needed functionality, fix a bug or two and/or
|
||||
make the program more optimized/efficient. Then ask nicely and you
|
||||
will probably be added to the Savannah development list and be given
|
||||
CVS write after awhile. There is a lot of responsibility that goes
|
||||
along with being a team member, so don't think it's just something to add
|
||||
to your resume.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="7.5"></a><font color="#330000">7.5. Can I have CVS write access?</font></h2>
|
||||
|
||||
<blockquote><font color="#330000">Re-read Section </font><a href="#7.4">7.4</a><font color="#330000">
|
||||
and you should know the answer.</font></blockquote>
|
||||
|
||||
<h2>
|
||||
<a NAME="8"></a><font color="#330000">8. ChangeLog</font>
|
||||
</h2>
|
||||
|
||||
<blockquote>2002/09/10 - Another typo fix (DLR).</blockquote>
|
||||
<blockquote>2002/05/15 - Typo fix (DLR).</blockquote>
|
||||
<blockquote>2001/12/26 - Misc. fixes (Aaron S. Hawley, DLR).</blockquote>
|
||||
<blockquote>2001/10/02 - Update for Free Translation Project.</blockquote>
|
||||
<blockquote>2001/10/02 - Assorted fixes, Debian additions.</blockquote>
|
||||
<blockquote>2001/06/30 - Silly typo fix.</blockquote>
|
||||
<blockquote>2001/05/05 - Spelling fixes by David Lawrence Ramsey.</blockquote>
|
||||
<blockquote>2001/05/02 - Misc fixes.</blockquote>
|
||||
<blockquote>2001/03/26 - Typo fix in an URL.</blockquote>
|
||||
<blockquote>2001/02/17 - Advocacy updates.</blockquote>
|
||||
<blockquote>2001/02/15 - Added GNU notes for 0.9.99pre3.</blockquote>
|
||||
<blockquote>2001/02/06 - Typo fixes.</blockquote>
|
||||
<blockquote>2001/01/14 - Added note about numlock glitch.</blockquote>
|
||||
<blockquote>2001/01/10 - Linux --> GNU/Linux.</blockquote>
|
||||
<blockquote>2001/01/09 - Added "making exe smaller section.</blockquote>
|
||||
<blockquote>2000/12/19 - Typo and assorted error fixes.</blockquote>
|
||||
<blockquote>2000/11/28 - Added blurb about make install-strip.</blockquote>
|
||||
<blockquote>2000/11/19 - Changed Debian frozen to stable.</blockquote>
|
||||
<blockquote>2000/11/18 - Previous string display (4.5).</blockquote>
|
||||
<blockquote>2000/09/27 - Moved addresses to nano-editor.org.</blockquote>
|
||||
<blockquote>2000/06/31 - Initial framework.</blockquote>
|
||||
<P>
|
||||
$Id$
|
||||
<p>
|
||||
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>
|
||||
2002/09/10 - Another typo fix (DLR).<br>
|
||||
2002/05/15 - Typo fix (DLR).<br>
|
||||
2001/12/26 - Misc. fixes (Aaron S. Hawley, DLR).<br>
|
||||
2001/10/02 - Update for Free Translation Project.<br>
|
||||
2001/10/02 - Assorted fixes, Debian additions.<br>
|
||||
2001/06/30 - Silly typo fix.<br>
|
||||
2001/05/05 - Spelling fixes by David Lawrence Ramsey.<br>
|
||||
2001/05/02 - Misc fixes.<br>
|
||||
2001/03/26 - Typo fix in an URL.<br>
|
||||
2001/02/17 - Advocacy updates.<br>
|
||||
2001/02/15 - Added GNU notes for 0.9.99pre3.<br>
|
||||
2001/02/06 - Typo fixes.<br>
|
||||
2001/01/14 - Added note about NumLock glitch.<br>
|
||||
2001/01/10 - Linux -> GNU/Linux.<br>
|
||||
2001/01/09 - Added "making exe smaller" section.<br>
|
||||
2000/12/19 - Typo and assorted error fixes.<br>
|
||||
2000/11/28 - Added blurb about make install-strip.<br>
|
||||
2000/11/19 - Changed Debian frozen to stable.<br>
|
||||
2000/11/18 - Previous string display (4.5).<br>
|
||||
2000/09/27 - Moved addresses to nano-editor.org.<br>
|
||||
2000/06/31 - Initial framework.</p></blockquote>
|
||||
<p>$Id$</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
165
global.c
165
global.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* global.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -21,27 +21,20 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <sys/stat.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Global variables
|
||||
*/
|
||||
/* 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 */
|
||||
@@ -72,13 +65,12 @@ openfilestruct *open_files = NULL; /* The list of open files */
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
#ifdef HAVE_REGEX_H
|
||||
char *quotestr = "^([ \t]*[|>:}#])+";
|
||||
#else
|
||||
char *quotestr = "> "; /* Quote string */
|
||||
#endif
|
||||
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 */
|
||||
@@ -86,17 +78,20 @@ int placewewant = 0; /* The column we'd like the cursor
|
||||
to jump to when we go to the
|
||||
next or previous line */
|
||||
|
||||
int tabsize = 8; /* Our internal tabsize variable */
|
||||
int tabsize = -1; /* Our internal tabsize variable. The
|
||||
default value 8 is set in main(). */
|
||||
|
||||
char *hblank; /* A horizontal blank line */
|
||||
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 */
|
||||
@@ -112,25 +107,29 @@ shortcut *whereis_list = NULL;
|
||||
shortcut *replace_list = NULL;
|
||||
shortcut *replace_list_2 = NULL; /* 2nd half of replace dialog */
|
||||
shortcut *goto_list = NULL;
|
||||
shortcut *gotodir_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;
|
||||
const colortype *colorstrings = NULL;
|
||||
syntaxtype *syntaxes = NULL;
|
||||
char *syntaxstr = NULL;
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE) || !defined(DISABLE_HELP)
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
const shortcut *currshortcut; /* Current shortcut list we're using */
|
||||
#endif
|
||||
|
||||
@@ -138,6 +137,11 @@ const shortcut *currshortcut; /* Current shortcut list we're using */
|
||||
toggle *toggles = NULL;
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
historyheadtype search_history;
|
||||
historyheadtype replace_history;
|
||||
#endif
|
||||
|
||||
/* Regular expressions */
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
@@ -146,6 +150,11 @@ 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;
|
||||
@@ -213,20 +222,24 @@ void toggle_init_one(int val, const char *desc, int flag)
|
||||
void toggle_init(void)
|
||||
{
|
||||
char *toggle_const_msg, *toggle_autoindent_msg, *toggle_suspend_msg,
|
||||
*toggle_nohelp_msg, *toggle_picomode_msg, *toggle_mouse_msg,
|
||||
*toggle_cuttoend_msg, *toggle_noconvert_msg, *toggle_dos_msg,
|
||||
*toggle_mac_msg, *toggle_backup_msg, *toggle_smooth_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. In fact, reinitializing them causes a segfault in
|
||||
nano.c:do_toggle() when it is called with the Pico-mode
|
||||
toggle. */
|
||||
change. */
|
||||
if (toggles != NULL)
|
||||
return;
|
||||
|
||||
@@ -234,14 +247,18 @@ void toggle_init(void)
|
||||
toggle_autoindent_msg = _("Auto indent");
|
||||
toggle_suspend_msg = _("Suspend");
|
||||
toggle_nohelp_msg = _("Help mode");
|
||||
toggle_picomode_msg = _("Pico 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
|
||||
@@ -253,11 +270,12 @@ void toggle_init(void)
|
||||
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);
|
||||
toggle_init_one(TOGGLE_PICOMODE_KEY, toggle_picomode_msg, PICO_MODE);
|
||||
#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);
|
||||
@@ -267,6 +285,9 @@ void toggle_init(void)
|
||||
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
|
||||
@@ -315,7 +336,7 @@ void shortcut_init(int unjustify)
|
||||
"", *nano_gotodir_msg = "", *nano_case_msg =
|
||||
"", *nano_reverse_msg = "", *nano_execute_msg =
|
||||
"", *nano_dos_msg = "", *nano_mac_msg =
|
||||
"", *nano_backup_msg = "";
|
||||
"", *nano_backup_msg = "", *nano_editstr_msg = "";
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
const char *nano_openprev_msg = "", *nano_opennext_msg =
|
||||
@@ -371,6 +392,7 @@ void shortcut_init(int unjustify)
|
||||
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");
|
||||
@@ -398,7 +420,7 @@ void shortcut_init(int unjustify)
|
||||
do_help);
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
if (open_files != NULL && (open_files->prev || open_files->next))
|
||||
if (open_files != NULL && (open_files->prev != NULL || open_files->next != NULL))
|
||||
sc_init_one(&main_list, NANO_EXIT_KEY, _("Close"),
|
||||
IFHELP(nano_exit_msg, 0), NANO_EXIT_FKEY, 0, VIEW,
|
||||
do_exit);
|
||||
@@ -413,39 +435,21 @@ void shortcut_init(int unjustify)
|
||||
IFHELP(nano_writeout_msg, 0),
|
||||
NANO_WRITEOUT_FKEY, 0, NOVIEW, do_writeout_void);
|
||||
|
||||
if (ISSET(PICO_MODE))
|
||||
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
|
||||
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
|
||||
IFHELP(nano_justify_msg, 0), NANO_JUSTIFY_FKEY, 0,
|
||||
NOVIEW, do_justify);
|
||||
else
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
/* this is so we can view multiple files */
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
IFHELP(nano_insert_msg, 0),
|
||||
NANO_INSERTFILE_FKEY, 0, VIEW, do_insertfile_void);
|
||||
#else
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
IFHELP(nano_insert_msg, 0),
|
||||
NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile_void);
|
||||
#endif
|
||||
|
||||
if (ISSET(PICO_MODE))
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
/* this is so we can view multiple files */
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
IFHELP(nano_insert_msg, 0),
|
||||
NANO_INSERTFILE_FKEY, 0, VIEW, do_insertfile_void);
|
||||
#else
|
||||
sc_init_one(&main_list, NANO_INSERTFILE_KEY, _("Read File"),
|
||||
IFHELP(nano_insert_msg, 0),
|
||||
NANO_INSERTFILE_FKEY, 0, NOVIEW, do_insertfile_void);
|
||||
#endif
|
||||
else
|
||||
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_WHEREIS_KEY, _("Where Is"),
|
||||
IFHELP(nano_whereis_msg, 0),
|
||||
NANO_WHEREIS_FKEY, 0, VIEW, do_search);
|
||||
@@ -522,14 +526,9 @@ void shortcut_init(int unjustify)
|
||||
sc_init_one(&main_list, NANO_TAB_KEY, _("Tab"),
|
||||
IFHELP(nano_tab_msg, 0), 0, 0, NOVIEW, do_tab);
|
||||
|
||||
if (ISSET(PICO_MODE))
|
||||
sc_init_one(&main_list, NANO_REPLACE_KEY, _("Replace"),
|
||||
sc_init_one(&main_list, NANO_REPLACE_KEY, _("Replace"),
|
||||
IFHELP(nano_replace_msg, NANO_ALT_REPLACE_KEY),
|
||||
NANO_REPLACE_FKEY, 0, NOVIEW, do_replace);
|
||||
else
|
||||
sc_init_one(&main_list, NANO_JUSTIFY_KEY, _("Justify"),
|
||||
IFHELP(nano_justify_msg, 0),
|
||||
NANO_JUSTIFY_FKEY, 0, NOVIEW, do_justify);
|
||||
|
||||
sc_init_one(&main_list, NANO_ENTER_KEY, _("Enter"),
|
||||
IFHELP(nano_enter_msg, 0),
|
||||
@@ -594,6 +593,12 @@ void shortcut_init(int unjustify)
|
||||
sc_init_one(&whereis_list, TOGGLE_REGEXP_KEY, _("Regexp"),
|
||||
IFHELP(nano_regexp_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
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);
|
||||
@@ -627,6 +632,9 @@ void shortcut_init(int unjustify)
|
||||
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);
|
||||
@@ -643,6 +651,11 @@ void shortcut_init(int unjustify)
|
||||
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"),
|
||||
@@ -657,6 +670,7 @@ void shortcut_init(int unjustify)
|
||||
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"),
|
||||
@@ -670,6 +684,7 @@ void shortcut_init(int unjustify)
|
||||
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);
|
||||
|
||||
@@ -724,6 +739,7 @@ void shortcut_init(int unjustify)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_SPELLER
|
||||
free_shortcutage(&spell_list);
|
||||
|
||||
sc_init_one(&spell_list, NANO_HELP_KEY, _("Get Help"),
|
||||
@@ -731,6 +747,7 @@ void shortcut_init(int unjustify)
|
||||
|
||||
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);
|
||||
@@ -772,7 +789,7 @@ void shortcut_init(int unjustify)
|
||||
IFHELP(nano_cancel_msg, 0), 0, 0, VIEW, 0);
|
||||
#endif
|
||||
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_MOUSE) || !defined (DISABLE_HELP)
|
||||
#if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || (!defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION))
|
||||
currshortcut = main_list;
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
@@ -788,6 +805,10 @@ void shortcut_init(int unjustify)
|
||||
/* 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);
|
||||
@@ -813,23 +834,27 @@ void thanks_for_all_the_fish(void)
|
||||
if (answer != NULL)
|
||||
free(answer);
|
||||
if (cutbuffer != NULL)
|
||||
free_filestruct(cutbuffer);
|
||||
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(&gotodir_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
|
||||
@@ -844,8 +869,7 @@ void thanks_for_all_the_fish(void)
|
||||
free_openfilestruct(open_files);
|
||||
}
|
||||
#else
|
||||
if (fileage != NULL)
|
||||
free_filestruct(fileage);
|
||||
free_filestruct(fileage);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
@@ -858,14 +882,16 @@ void thanks_for_all_the_fish(void)
|
||||
exttype *bob = syntaxes->extensions;
|
||||
|
||||
syntaxes->extensions = bob->next;
|
||||
free(bob->val);
|
||||
regfree(&bob->val);
|
||||
free(bob);
|
||||
}
|
||||
while (syntaxes->color != NULL) {
|
||||
colortype *bob = syntaxes->color;
|
||||
|
||||
syntaxes->color = bob->next;
|
||||
free(bob->start);
|
||||
regfree(&bob->start);
|
||||
if (bob->end != NULL)
|
||||
regfree(bob->end);
|
||||
free(bob->end);
|
||||
free(bob);
|
||||
}
|
||||
@@ -873,5 +899,10 @@ void thanks_for_all_the_fish(void)
|
||||
free(bill);
|
||||
}
|
||||
#endif /* ENABLE_COLOR */
|
||||
#ifndef NANO_SMALL
|
||||
/* free history lists */
|
||||
free_history(&search_history);
|
||||
free_history(&replace_history);
|
||||
#endif
|
||||
}
|
||||
#endif /* DEBUG */
|
||||
|
||||
24
move.c
24
move.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* move.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -28,13 +28,6 @@
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
int do_home(void)
|
||||
{
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
@@ -111,10 +104,16 @@ int do_page_down(void)
|
||||
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! */
|
||||
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;
|
||||
@@ -160,7 +159,8 @@ int do_up(void)
|
||||
|
||||
/* Return value 1 means we moved down, 0 means we were already at the
|
||||
* bottom. */
|
||||
int do_down(void) {
|
||||
int do_down(void)
|
||||
{
|
||||
wrap_reset();
|
||||
UNSET(KEEP_CUTBUFFER);
|
||||
check_statblank();
|
||||
@@ -171,7 +171,7 @@ int do_down(void) {
|
||||
current = current->next;
|
||||
current_x = actual_x(current, placewewant);
|
||||
|
||||
/* Note current_y is zero-based. This test checks for the cursor
|
||||
/* 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
|
||||
@@ -218,7 +218,7 @@ int do_right(void)
|
||||
|
||||
if (current->data[current_x] != '\0')
|
||||
current_x++;
|
||||
else if (current->next) {
|
||||
else if (current->next != NULL) {
|
||||
do_down();
|
||||
current_x = 0;
|
||||
}
|
||||
|
||||
73
nano.1
73
nano.1
@@ -1,20 +1,23 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nano.1 is copyright 1999-2002 by
|
||||
.\" 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 "July 30, 2002"
|
||||
.TH NANO 1 "February 9, 2003"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
|
||||
.SH NAME
|
||||
nano \- Nano's ANOther editor, an enhanced free Pico Clone
|
||||
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
|
||||
@@ -26,6 +29,7 @@ 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
|
||||
@@ -41,12 +45,17 @@ Write file in DOS format.
|
||||
.B \-F (\-\-multibuffer)
|
||||
Enable multiple file buffers, if available.
|
||||
.TP
|
||||
.B \-H (\-\-historylog)
|
||||
Log search and replace strings to ~/.nano_history so they may be
|
||||
stored for later editing, if nanorc support is configured.
|
||||
.TP
|
||||
.B \-I (\-\-ignorercfiles)
|
||||
Don't look at /etc/nanorc or ~/.nanorc, if nanorc support is available.
|
||||
Don't look at $SYSCONFDIR/nanorc or ~/.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
|
||||
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)
|
||||
@@ -55,7 +64,7 @@ Write file in Mac format.
|
||||
.B \-N (\-\-noconvert)
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
.TP
|
||||
.B \-Q \fI[str]\fP (\-\-quotestr=\fI[str]\fP)
|
||||
.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.
|
||||
@@ -68,13 +77,13 @@ Enable regular expression matching for search strings, as well as
|
||||
Enable smooth scrolling. Text will scroll line-by-line, instead of the
|
||||
usual chunk-by-chunk behavior.
|
||||
.TP
|
||||
.B \-T \fI[num]\fP (\-\-tabsize=\fI[num]\fP)
|
||||
.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 \fI[str]\fP (\-\-syntax=\fI[str]\fP)
|
||||
.B \-Y \fIstr\fP (\-\-syntax=\fIstr\fP)
|
||||
Specify a specific syntax highlighting from the .nanorc to use, if
|
||||
available.
|
||||
.TP
|
||||
@@ -98,22 +107,21 @@ a new file, do not follow it. Good for editing files in /tmp, perhaps?
|
||||
.B \-m (\-\-mouse)
|
||||
Enable mouse support (if available for your system).
|
||||
.TP
|
||||
.B \-o \fI[dir]\fP (\-\-operatingdir=\fI[dir]\fP)
|
||||
.B \-o \fIdir\fP (\-\-operatingdir=\fIdir\fP)
|
||||
Set operating directory. Makes nano set up something similar to a
|
||||
chroot.
|
||||
.TP
|
||||
.B \-p (\-\-pico)
|
||||
Emulate Pico as closely as possible. This affects both the "shortcut
|
||||
list" at the bottom of the screen, as well as the display and entry of
|
||||
previous search and replace strings.
|
||||
.B \-p (\-\-preserve)
|
||||
Preserve the XON and XOFF sequences (^Q and ^S) so they will be
|
||||
caught by the terminal.
|
||||
.TP
|
||||
.B \-r \fI[#cols]\fP (\-\-fill=\fI[#cols]\fP)
|
||||
Wrap lines at column #cols. By default, this is the width of the
|
||||
.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
|
||||
#cols from the right of the screen, allowing it to vary along with the
|
||||
screen width if the screen is resized.
|
||||
\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 \fI[prog]\fP (\-\-speller=\fI[prog]\fP)
|
||||
.B \-s \fIprog\fP (\-\-speller=\fIprog\fP)
|
||||
Enable alternative spell checker command.
|
||||
.TP
|
||||
.B \-t (\-\-tempfile)
|
||||
@@ -133,16 +141,24 @@ 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: $SYSCONFDIR/nanorc, then ~/.nanorc. Please see 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 runs
|
||||
out of memory, when it will write the buffer into a file named
|
||||
"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
|
||||
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 "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
|
||||
@@ -153,8 +169,17 @@ The \fBnano\fP mailing list is available from
|
||||
.B nano-devel@gnu.org.
|
||||
To subscribe, email to nano-devel-request@gnu.org with a
|
||||
subject of "subscribe".
|
||||
|
||||
.SH HOMEPAGE
|
||||
http://www.nano-editor.org
|
||||
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 AUTHORS and THANKS for
|
||||
details).
|
||||
|
||||
98
nano.1.html
98
nano.1.html
@@ -1,17 +1,17 @@
|
||||
Content-type: text/html
|
||||
|
||||
<HTML><HEAD><TITLE>Manpage of NANO</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANO</H1>
|
||||
Section: User Commands (1)<BR>Updated: July 30, 2002<BR><A HREF="#index">Index</A>
|
||||
Section: User Commands (1)<BR>Updated: February 9, 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
|
||||
nano - Nano's ANOther editor, an enhanced free Pico clone
|
||||
<P>
|
||||
<A NAME="lbAC"> </A>
|
||||
<H2>SYNOPSIS</H2>
|
||||
|
||||
@@ -21,6 +21,7 @@ nano - Nano's ANOther editor, an enhanced free Pico Clone
|
||||
|
||||
<BR>
|
||||
|
||||
<P>
|
||||
<A NAME="lbAD"> </A>
|
||||
<H2>DESCRIPTION</H2>
|
||||
|
||||
@@ -35,6 +36,7 @@ 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>
|
||||
|
||||
@@ -56,15 +58,21 @@ Write file in DOS format.
|
||||
|
||||
<DD>
|
||||
Enable multiple file buffers, if available.
|
||||
<DT><B>-H (--historylog)</B>
|
||||
|
||||
<DD>
|
||||
Log search and replace strings to ~/.nano_history so they may be
|
||||
stored for later editing, if nanorc support is configured.
|
||||
<DT><B>-I (--ignorercfiles)</B>
|
||||
|
||||
<DD>
|
||||
Don't look at /etc/nanorc or ~/.nanorc, if nanorc support is available.
|
||||
Don't look at $SYSCONFDIR/nanorc or ~/.nanorc, 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
|
||||
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>
|
||||
|
||||
@@ -74,7 +82,7 @@ Write file in Mac format.
|
||||
|
||||
<DD>
|
||||
Disable automatic conversion of files from DOS/Mac format.
|
||||
<DT><B>-Q </B><I>[str]</I> (--quotestr=<I>[str]</I>)
|
||||
<DT><B>-Q </B><I>str</I> (--quotestr=<I>str</I>)
|
||||
|
||||
<DD>
|
||||
Set the quoting string for justifying. The default is
|
||||
@@ -90,7 +98,7 @@ Enable regular expression matching for search strings, as well as
|
||||
<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>)
|
||||
<DT><B>-T </B><I>num</I> (--tabsize=<I>num</I>)
|
||||
|
||||
<DD>
|
||||
Set the size (width) of a tab.
|
||||
@@ -98,7 +106,7 @@ Set the size (width) of a tab.
|
||||
|
||||
<DD>
|
||||
Show the current version number and author.
|
||||
<DT><B>-Y </B><I>[str]</I> (--syntax=<I>[str]</I>)
|
||||
<DT><B>-Y </B><I>str</I> (--syntax=<I>str</I>)
|
||||
|
||||
<DD>
|
||||
Specify a specific syntax highlighting from the .nanorc to use, if
|
||||
@@ -129,25 +137,24 @@ a new file, do not follow it. Good for editing files in /tmp, perhaps?
|
||||
|
||||
<DD>
|
||||
Enable mouse support (if available for your system).
|
||||
<DT><B>-o </B><I>[dir]</I> (--operatingdir=<I>[dir]</I>)
|
||||
<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 (--pico)</B>
|
||||
<DT><B>-p (--preserve)</B>
|
||||
|
||||
<DD>
|
||||
Emulate Pico as closely as possible. This affects both the "shortcut
|
||||
list" at the bottom of the screen, as well as the display and entry of
|
||||
previous search and replace strings.
|
||||
<DT><B>-r </B><I>[#cols]</I> (--fill=<I>[#cols]</I>)
|
||||
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 #cols. By default, this is the width of the
|
||||
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
|
||||
#cols from the right of the screen, allowing it to vary along with the
|
||||
screen width if the screen is resized.
|
||||
<DT><B>-s </B><I>[prog]</I> (--speller=<I>[prog]</I>)
|
||||
<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.
|
||||
@@ -175,20 +182,30 @@ Enable suspend ability.
|
||||
|
||||
<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: $SYSCONFDIR/nanorc, then ~/.nanorc. Please see <A HREF="http://localhost/cgi-bin/man/man2html?5+nanorc">nanorc</A>(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 runs
|
||||
out of memory, when it will write the buffer into a file named
|
||||
"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
|
||||
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 "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, <B>nano</B> will write all the open buffers
|
||||
to the respective emergency files.
|
||||
<A NAME="lbAG"> </A>
|
||||
<P>
|
||||
<A NAME="lbAH"> </A>
|
||||
<H2>BUGS</H2>
|
||||
|
||||
Please send any comments or bug reports to
|
||||
@@ -205,11 +222,24 @@ The <B>nano</B> mailing list is available from
|
||||
|
||||
To subscribe, email to <A HREF="mailto:nano-devel-request@gnu.org">nano-devel-request@gnu.org</A> with a
|
||||
subject of "subscribe".
|
||||
<A NAME="lbAH"> </A>
|
||||
<P>
|
||||
<A NAME="lbAI"> </A>
|
||||
<H2>HOMEPAGE</H2>
|
||||
|
||||
<A HREF="http://www.nano-editor.org">http://www.nano-editor.org</A>
|
||||
<A NAME="lbAI"> </A>
|
||||
<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 AUTHORS and THANKS for
|
||||
@@ -226,15 +256,17 @@ used by others).
|
||||
<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">NOTES</A><DD>
|
||||
<DT><A HREF="#lbAG">BUGS</A><DD>
|
||||
<DT><A HREF="#lbAH">HOMEPAGE</A><DD>
|
||||
<DT><A HREF="#lbAI">AUTHOR</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: 21:12:05 GMT, July 30, 2002
|
||||
Time: 04:08:28 GMT, February 13, 2003
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
122
nano.h
122
nano.h
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* nano.h *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -19,10 +19,6 @@
|
||||
* *
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
@@ -36,6 +32,10 @@
|
||||
#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))
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* For the backup file copy ... */
|
||||
# define COPYFILEBLOCKSIZE 1024
|
||||
@@ -43,15 +43,23 @@
|
||||
|
||||
#ifdef USE_SLANG /* Slang support enabled */
|
||||
#include <slcurses.h>
|
||||
#define KEY_DC 0x113
|
||||
#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 HAVE_LIBINTL_H
|
||||
#include <libintl.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>
|
||||
@@ -68,6 +76,15 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRCASECMP) || !defined(HAVE_STRNCASECMP)
|
||||
# ifndef HAVE_STRCASECMP
|
||||
# define strcasecmp strcmp
|
||||
# endif
|
||||
# ifndef HAVE_STRNCASECMP
|
||||
# define strncasecmp strncmp
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* HP-UX 10 & 11 do not seem to support KEY_HOME and KEY_END */
|
||||
#ifndef KEY_HOME
|
||||
#define KEY_HOME -1
|
||||
@@ -77,6 +94,12 @@
|
||||
#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
|
||||
|
||||
@@ -159,13 +182,13 @@ typedef struct colortype {
|
||||
int bg; /* bg color */
|
||||
int bright; /* Is this color A_BOLD? */
|
||||
int pairnum; /* Color pair number used for this fg/bg */
|
||||
char *start; /* Start (or all) of the regex string */
|
||||
char *end; /* End of the regex string */
|
||||
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 {
|
||||
char *val;
|
||||
regex_t val; /* The extensions that match this syntax. */
|
||||
struct exttype *next;
|
||||
} exttype;
|
||||
|
||||
@@ -174,11 +197,25 @@ typedef struct syntaxtype {
|
||||
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) */
|
||||
|
||||
@@ -188,29 +225,31 @@ typedef struct syntaxtype {
|
||||
#define MARK_ISSET (1<<3)
|
||||
#define CONSTUPDATE (1<<4)
|
||||
#define NO_HELP (1<<5)
|
||||
#define PICO_MODE (1<<6)
|
||||
#define FOLLOW_SYMLINKS (1<<7)
|
||||
#define SUSPEND (1<<8)
|
||||
#define NO_WRAP (1<<9)
|
||||
#define AUTOINDENT (1<<10)
|
||||
#define SAMELINEWRAP (1<<11)
|
||||
#define VIEW_MODE (1<<12)
|
||||
#define USE_MOUSE (1<<13)
|
||||
#define USE_REGEXP (1<<14)
|
||||
#define REGEXP_COMPILED (1<<15)
|
||||
#define TEMP_OPT (1<<16)
|
||||
#define CUT_TO_END (1<<17)
|
||||
#define REVERSE_SEARCH (1<<18)
|
||||
#define MULTIBUFFER (1<<19)
|
||||
#define CLEAR_BACKUPSTRING (1<<20)
|
||||
#define DOS_FILE (1<<21)
|
||||
#define MAC_FILE (1<<22)
|
||||
#define SMOOTHSCROLL (1<<23)
|
||||
#define DISABLE_CURPOS (1<<24) /* Damn, we still need it */
|
||||
#define ALT_KEYPAD (1<<25)
|
||||
#define NO_CONVERT (1<<26)
|
||||
#define BACKUP_FILE (1<<27)
|
||||
#define NO_RCFILE (1<<28)
|
||||
#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)
|
||||
|
||||
/* Control key sequences, changing these would be very very bad */
|
||||
|
||||
@@ -351,7 +390,6 @@ know what you're doing */
|
||||
#define TOGGLE_AUTOINDENT_KEY NANO_ALT_I
|
||||
#define TOGGLE_SUSPEND_KEY NANO_ALT_Z
|
||||
#define TOGGLE_NOHELP_KEY NANO_ALT_X
|
||||
#define TOGGLE_PICOMODE_KEY NANO_ALT_P
|
||||
#define TOGGLE_MOUSE_KEY NANO_ALT_M
|
||||
#define TOGGLE_CUTTOEND_KEY NANO_ALT_K
|
||||
#define TOGGLE_REGEXP_KEY NANO_ALT_R
|
||||
@@ -364,6 +402,7 @@ know what you're doing */
|
||||
#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
|
||||
@@ -378,10 +417,15 @@ typedef enum {
|
||||
/* Minimum editor window rows required for nano to work correctly */
|
||||
#define MIN_EDITOR_ROWS 3
|
||||
|
||||
/* Default number of characters from end-of-line where text wrapping occurs */
|
||||
/* 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
|
||||
|
||||
/* Minimum fill length (space available for text before wrapping occurs) */
|
||||
#define MIN_FILL_LENGTH 10
|
||||
/* Maximum number of search history strings saved, same value used for
|
||||
replace history */
|
||||
#define MAX_SEARCH_HISTORY 100
|
||||
|
||||
#endif /* !NANO_H */
|
||||
|
||||
@@ -21,7 +21,7 @@ text editor while also offering a few enhancements.
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure --enable-extra
|
||||
%configure --enable-all
|
||||
make RPM_OPT_FLAGS="$RPM_OPT_FLAGS"
|
||||
|
||||
%install
|
||||
|
||||
196
nano.texi
196
nano.texi
@@ -8,8 +8,8 @@
|
||||
@c Run `makeinfo' rather than `texinfo-format-buffer'.
|
||||
@smallbook
|
||||
@set EDITION 0.1
|
||||
@set VERSION 1.1.11
|
||||
@set UPDATED 30 Jul 2002
|
||||
@set VERSION 1.1.99pre3
|
||||
@set UPDATED 17 Jan 2003
|
||||
|
||||
@dircategory Editors
|
||||
@direntry
|
||||
@@ -23,7 +23,7 @@
|
||||
@titlepage
|
||||
@title GNU @code{nano}
|
||||
@subtitle a small and friendly text editor.
|
||||
@subtitle version 1.1.11
|
||||
@subtitle version 1.1.99pre3
|
||||
|
||||
@author Chris Allegretta
|
||||
@page
|
||||
@@ -40,7 +40,7 @@ manual provided the copyright notice and this permission notice are
|
||||
preserved on all copies.
|
||||
|
||||
@iftex
|
||||
Permission is granted to process this file through TeX and print the
|
||||
Permission is granted to process this file through @TeX{} and print the
|
||||
results, provided the printed document carries copying permission notice
|
||||
identical to this one except for the removal of this paragraph (this
|
||||
paragraph not being relevant to the printed manual).
|
||||
@@ -56,7 +56,7 @@ into another language, under the above conditions for modified versions,
|
||||
except that this permission notice may be stated in a translation
|
||||
approved by the Foundation.
|
||||
|
||||
You may contact the author by:
|
||||
You may contact the author by
|
||||
e-mail: @email{chrisa@@asty.org}@*
|
||||
@end titlepage
|
||||
|
||||
@@ -91,14 +91,12 @@ internationalization support, and filename tab completion.
|
||||
@node Overview, Command Line Options, Introduction, Introduction
|
||||
@section Overview
|
||||
|
||||
@code{nano} [GNU long option] [option] +LINE [ @var{ file ...} ]
|
||||
@code{nano} +LINE [GNU long option] [option] [ @var{file ...} ]
|
||||
|
||||
The original goal for @code{nano} was a complete bug-for-bug compatible
|
||||
emulation of Pico, but consistency is now a slightly higher priority.
|
||||
There is a flag to implement (nearly) complete Pico emulation, (option -p
|
||||
or GNU long option --pico). This can also be toggled from within
|
||||
@code{nano} by typing Meta-P. @xref{Pico Compatibility}, for more
|
||||
info.
|
||||
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.
|
||||
|
||||
Email bug reports to @email{nano@@nano-editor.org}.
|
||||
|
||||
@@ -120,7 +118,8 @@ Write file in DOS format.
|
||||
Enable multiple file buffers, if available.
|
||||
|
||||
@item -I, --ignorercfiles
|
||||
Don't look at /etc/nanorc or ~/.nanorc, if nanorc support is available.
|
||||
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
|
||||
@@ -135,16 +134,19 @@ Do not convert files from DOS/Mac format.
|
||||
|
||||
@item -Q [str], --quotestr [str]
|
||||
Set the quoting string for justifying. The default is
|
||||
"^([ \t]*[|>:@}#])+" if regular expression support is available, or
|
||||
"> " otherwise.
|
||||
|
||||
Set the quoting string for justifying. The default is "> ".
|
||||
@quotation
|
||||
@code{^([ \t]*[|>:@}#])+}
|
||||
@end quotation
|
||||
|
||||
if regular expression support is available, or ``> '' otherwise. Note
|
||||
that @code{\t} above stands for a literal Tab character.
|
||||
|
||||
@item -R, --regexp
|
||||
Turns on regular expression search and search/replace.
|
||||
Turn on regular expression search and search/replace.
|
||||
|
||||
@item -S, --smooth
|
||||
Enables smooth scrolling.
|
||||
Enable smooth scrolling.
|
||||
|
||||
@item -T [num], --tabsize=[num]
|
||||
Set the displayed tab length to [num] columns.
|
||||
@@ -182,9 +184,9 @@ running under the X window system).
|
||||
Set operating directory. Makes @code{nano} set up something similar to a
|
||||
chroot.
|
||||
|
||||
@item -p, --pico
|
||||
Emulate Pico as closely as possible, sacrificing consistency for correct
|
||||
emulation. @xref{Pico Compatibility}, for more info.
|
||||
@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.
|
||||
|
||||
@item -r [#cols], --fill=[#cols].
|
||||
Wrap lines at column #cols. By default this is the width of the screen,
|
||||
@@ -245,7 +247,7 @@ Start at line number LINE instead of the default of line 1.
|
||||
@section Entering Text
|
||||
|
||||
All key sequences in @code{nano} are entered using the keyboard.
|
||||
@code{nano} is a "modeless" editor, all keys with the exception of
|
||||
@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.
|
||||
|
||||
@@ -265,7 +267,7 @@ 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
|
||||
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
|
||||
@@ -276,11 +278,11 @@ Escape key to generate Meta key sequences.
|
||||
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
|
||||
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
|
||||
Special modes: When @code{nano} is in ``File browser'' mode, the center
|
||||
section will display the current directory instead of the filename.
|
||||
@xref{The File Browser}.
|
||||
|
||||
@@ -288,7 +290,7 @@ section will display the current directory instead of the filename.
|
||||
@section The Statusbar
|
||||
|
||||
The statusbar is located three lines from the bottom of the screen (or
|
||||
the bottom line in Expert Mode. @xref{Expert Mode}, for more info.
|
||||
the bottom line in Expert Mode. @xref{Expert Mode}, for more info).
|
||||
|
||||
The Statusbar shows important and informational messages. Any error
|
||||
messages that occur from using the editor will appear on the statusbar.
|
||||
@@ -300,9 +302,7 @@ 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. The exact
|
||||
functions which are displayed depend on whether Pico Compatibility Mode
|
||||
mode is enabled. @xref{Pico Compatibility}, for more info.
|
||||
show some of the more commonly used functions in the editor.
|
||||
|
||||
@node Online Help, Feature Toggles, Editor Basics, Top
|
||||
@chapter Online Help
|
||||
@@ -318,47 +318,43 @@ and ^V (Page Down) keys. ^X exits the help system.
|
||||
|
||||
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 sequenced. @xref{Special Functions}, for more info.
|
||||
certain Meta key sequences. @xref{Special Functions}, for more info.
|
||||
The following global toggles are available:
|
||||
|
||||
@table @code
|
||||
|
||||
@item Backup File Toggle (Meta-B)
|
||||
toggles the -B (--backup) command line flag.
|
||||
toggles the -B (@code{--backup}) command line flag.
|
||||
|
||||
@item DOS Format Toggle (Meta-D)
|
||||
toggles the -D (--dos) command line flag.
|
||||
toggles the -D (@code{--dos}) command line flag.
|
||||
|
||||
@item Multiple Files Toggle (Meta-F)
|
||||
toggles the -F (--multibuffer) command line flag.
|
||||
toggles the -F (@code{--multibuffer}) command line flag.
|
||||
|
||||
@item AutoIndent Toggle (Meta-I)
|
||||
toggles the -i (--autoindent) command line flag.
|
||||
toggles the -i (@code{--autoindent}) command line flag.
|
||||
|
||||
@item Cut To End Toggle (Meta-K)
|
||||
toggles the -k (--cut) command line flag.
|
||||
toggles the -k (@code{--cut}) command line flag.
|
||||
|
||||
@item Mouse Toggle (Meta-M)
|
||||
toggles the -m (--mouse) command line flag.
|
||||
toggles the -m (@code{--mouse}) command line flag.
|
||||
|
||||
@item Mac Format Toggle (Meta-O)
|
||||
toggles the -M (--mac) command line flag.
|
||||
|
||||
@item Pico Mode Toggle (Meta-P)
|
||||
toggles the -p (--pico) command line flag.
|
||||
@xref{Pico Compatibility}, for more info.
|
||||
toggles the -M (@code{--mac}) command line flag.
|
||||
|
||||
@item Smooth Scrolling Toggle (Meta-S)
|
||||
toggles the -s (--smooth) command line flag.
|
||||
toggles the -S (@code{--smooth}) command line flag.
|
||||
|
||||
@item AutoWrap Toggle (Meta-W)
|
||||
toggles the -w (--nowrap) command line flag.
|
||||
toggles the -w (@code{--nowrap}) command line flag.
|
||||
|
||||
@item Expert/Nohelp Toggle (Meta-X)
|
||||
toggles the -x (--nohelp) command line flag.
|
||||
toggles the -x (@code{--nohelp}) command line flag.
|
||||
|
||||
@item Suspend Toggle (Meta-Z)
|
||||
toggles the -z (--suspend) command line flag.
|
||||
toggles the -z (@code{--suspend}) command line flag.
|
||||
|
||||
@item Open Previous File Toggle (Meta-<)
|
||||
changes buffer to previously loaded file.
|
||||
@@ -366,9 +362,9 @@ changes buffer to previously loaded file.
|
||||
@item Open Next File Toggle (Meta->)
|
||||
changes buffer to next loaded file.
|
||||
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node The File Browser, Pico Compatibility, Feature Toggles, Top
|
||||
@chapter The File Browser
|
||||
|
||||
@@ -376,8 +372,8 @@ When reading or writing files, pressing ^T will invoke the file browser.
|
||||
Here, one can navigate directories in a graphical manner in order to
|
||||
find the desired file.
|
||||
|
||||
Basic movement in the file browser is accomplished with he arrow keys
|
||||
and page up/down. The behavior of the enter (or 's') key varies by what
|
||||
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.
|
||||
If the object is a file, this filename and path are copied to the
|
||||
@@ -386,38 +382,41 @@ statusbar and the file browser is exited.
|
||||
@node Pico Compatibility, Building and Configure Options, The File Browser, Top
|
||||
@chapter Pico Compatibility
|
||||
|
||||
nano does not completely emulate Pico by default. The following
|
||||
differences apply to the default mode and Pico Compatibility mode:
|
||||
@code{nano} attempts to emulate Pico as closely as possible, but there
|
||||
are certain differences between the editors:
|
||||
|
||||
@table @code
|
||||
@item Displayed Shortcuts
|
||||
By default, the following shortcuts are displayed in the Shortcut Lists:
|
||||
@item Search and Replace History
|
||||
As of version 1.1.99pre3 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.
|
||||
|
||||
^G ^O ^\ ^Y ^K ^C@*
|
||||
^X ^R ^W ^V ^U ^T
|
||||
|
||||
Related functions are listed above or below each other by default. The
|
||||
Justify function is not listed, instead the "Replace" function is
|
||||
displayed. Also, he "Read File" and "WriteOut" functions are aligned for
|
||||
consistency.
|
||||
@item Writing or Appending Selected Text to Files
|
||||
Text selected using the Control-Caret (^^) key can be written out or
|
||||
appended to a new or existing file using the Writeout key (^O).
|
||||
|
||||
In Pico Compatibility mode, the default Pico shortcuts are displayed:
|
||||
@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.
|
||||
|
||||
^G ^O ^R ^Y ^K ^C@*
|
||||
^X ^J ^W ^V ^U ^T
|
||||
|
||||
@item Previous String Text
|
||||
By default, previously entered string for a function (search string,
|
||||
file name) will be placed on the statusbar, and is editable. This is
|
||||
done so there is consistency across all functions. For example: even if
|
||||
there is a previous replace string, it can always be deleted if one
|
||||
wishes to perform an empty string replace.
|
||||
|
||||
In Pico Compatibility Mode, the previously entered text in a search or
|
||||
replace will appear in brackets, and is not editable. It is not a
|
||||
simple matter to do an empty string replace when a previous replace
|
||||
string exists, for example. When writing a file, the previous filename
|
||||
will be displayed in the editable text portion of the editor.
|
||||
@item Cursor Position Display
|
||||
The output of the "Display Cursor Position" in @code{nano} displays
|
||||
the given column position, as well as the row and total character
|
||||
position of the cursor.
|
||||
|
||||
@item Interactive Replace and Spell Checker
|
||||
It is worth noting that the @code{nano} replace function is interactive,
|
||||
@@ -425,7 +424,10 @@ 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.
|
||||
to force these functions to behave in the Pico fashion. As of
|
||||
version 1.1.99pre3, 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
|
||||
@@ -434,11 +436,13 @@ to force these functions to behave in the Pico fashion.
|
||||
Building @code{nano} from source is fairly straightforward if you are familiar
|
||||
with compiling programs with autoconf support:
|
||||
|
||||
tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of @code{nano})
|
||||
cd nano-x.y.z/
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
@itemize @bullet
|
||||
@item tar xvfz nano-x.y.z.tar.gz (where x.y.z is the version of nano)
|
||||
@item cd nano-x.y.z/
|
||||
@item ./configure
|
||||
@item make
|
||||
@item make install
|
||||
@end itemize
|
||||
|
||||
if you are looking to optimize @code{nano} for size, you may want to
|
||||
consider the following command line options:
|
||||
@@ -453,34 +457,34 @@ Disable the tab completion code when reading or writing files.
|
||||
Disable the justify (^J)/unjustify (^U) functions in the editor.
|
||||
|
||||
@item --disable-speller
|
||||
Disables spell checker ability.
|
||||
Disable spell checker ability.
|
||||
|
||||
@item --disable-help
|
||||
Disables the help function (^G). Disabling this option makes the binary
|
||||
Disable the help function (^G). Disabling this option makes the binary
|
||||
much smaller, but makes it difficult for new users to learn more than
|
||||
very basic things about using the editor.
|
||||
|
||||
@item --disable-browser
|
||||
Disables the mini file browser (^O) when reading or writing files.
|
||||
|
||||
@item --enable-tiny
|
||||
This options disables all the above. It also disables some of the larger
|
||||
internals of the editor, like the marker code (^^) and the cut to line
|
||||
(-k) option which it depends on to work properly. It also disables the
|
||||
function toggles and mouse support.
|
||||
|
||||
@item --disable-wrapping
|
||||
Disables all word wrapping in the editor. This also eliminates the -w
|
||||
command line flag, as nonwrapping is then the default behavior.
|
||||
Disable the mini file browser (^T) when reading or writing files.
|
||||
|
||||
@item --disable-mouse
|
||||
Disables all mouse functionality. This also disables the -m command
|
||||
line flag which enables the mouse functions.
|
||||
Disable all mouse functionality. This also disables the -m command line
|
||||
flag, which enables the mouse functions.
|
||||
|
||||
@item --disable-operatingdir
|
||||
Disables setting of operating directory. This also disables the -o
|
||||
Disable setting the operating directory. This also disables the -o
|
||||
command line flag.
|
||||
|
||||
@item --enable-tiny
|
||||
This option disables all the above. It also disables some of the larger
|
||||
internals of the editor, like the marker code (^^) and the cut to line
|
||||
(-k) option, which depends on the marker code to work properly. It also
|
||||
disables the function toggles.
|
||||
|
||||
@item --disable-wrapping
|
||||
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
|
||||
@code{nano} translations unusable.
|
||||
|
||||
143
nanorc.5
Normal file
143
nanorc.5
Normal file
@@ -0,0 +1,143 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" nanorc.5 is Copyright (C) 1999, 2000, 2001, 2002, 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 "February 9, 2003"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.SH NAME
|
||||
nanorc \- GNU nano's rcfile
|
||||
.SH SYNOPSIS
|
||||
.B /etc/nanorc
|
||||
.B $HOME/.nanorc
|
||||
.br
|
||||
.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".
|
||||
|
||||
.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.
|
||||
|
||||
The supported commands and arguments are:
|
||||
|
||||
.TP 3
|
||||
\fBset/unset autoindent\fP
|
||||
Use auto-indentation.
|
||||
.TP
|
||||
\fBset/unset backup\fP
|
||||
Create backup files in filename~.
|
||||
.TP
|
||||
\fBset/unset const\fP
|
||||
Constantly update the cursor position.
|
||||
.TP
|
||||
\fBset/unset cut\fP
|
||||
Use cut to end of line with ^K by default.
|
||||
.TP
|
||||
\fBset fill \fIn\fP\fP
|
||||
Set the column where lines will be wrapped at to \fIn\fP.
|
||||
.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
|
||||
Set operating directory (chroots the user to \fIdirectory\fP and below).
|
||||
.TP
|
||||
\fBset/unset preserve\fP
|
||||
Preserve the XON and XOFF keys (^Q and ^S).
|
||||
.TP
|
||||
\fBset quotestr "\fIstring\fP"\fP
|
||||
The email-quote string. This is a "regular expression" if your
|
||||
system supports them, otherwise a literal string.
|
||||
Default value is set quotestr "^([ \t]*[|>:}#])+" if you have regexps,
|
||||
otherwise set quotestr "> ".
|
||||
.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 default (spell).
|
||||
.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 historylog\fP
|
||||
Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
.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 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 AUTHORS and THANKS for
|
||||
details).
|
||||
This manual page was written by Jordi Mallach <jordi@gnu.org>.
|
||||
160
nanorc.5.html
Normal file
160
nanorc.5.html
Normal file
@@ -0,0 +1,160 @@
|
||||
<HTML><HEAD><TITLE>Manpage of NANORC</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>NANORC</H1>
|
||||
Section: File Formats (5)<BR>Updated: February 9, 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>SYNOPSIS</H2>
|
||||
|
||||
<B>/etc/nanorc</B>
|
||||
|
||||
<B>$HOME/.nanorc</B>
|
||||
|
||||
<BR>
|
||||
|
||||
<A NAME="lbAD"> </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>
|
||||
<A NAME="lbAE"> </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>
|
||||
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 filename~.
|
||||
<DT><B>set/unset const</B><DD>
|
||||
Constantly update the cursor position.
|
||||
<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>
|
||||
Set the column where lines will be wrapped at to <I>n</I>.
|
||||
<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>
|
||||
Set operating directory (chroots the user to <I>directory</I> and below).
|
||||
<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. This is a "regular expression" if your
|
||||
system supports them, otherwise a literal string.
|
||||
Default value is set quotestr "^([ ]*[|>:}#])+" if you have regexps,
|
||||
otherwise set quotestr "> ".
|
||||
<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 default (spell).
|
||||
<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 historylog</B><DD>
|
||||
Enable ~/.nano_history for saving and reading search/replace strings.
|
||||
<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="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 AUTHORS and THANKS 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">SYNOPSIS</A><DD>
|
||||
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
|
||||
<DT><A HREF="#lbAE">OPTIONS</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: 04:08:33 GMT, February 13, 2003
|
||||
</BODY>
|
||||
</HTML>
|
||||
159
nanorc.sample
159
nanorc.sample
@@ -1,94 +1,98 @@
|
||||
# Sample initialization file for GNU nano
|
||||
# Please note that you must have configured nano with
|
||||
# --enable-nanorc for this file to be read!
|
||||
#
|
||||
# To make sure a value is not enabled, use "unset <option>"
|
||||
## Sample initialization file for GNU nano
|
||||
## Please note that you must have configured nano with
|
||||
## --enable-nanorc for this file to be read!
|
||||
##
|
||||
## To make sure a value is not enabled, use "unset <option>"
|
||||
|
||||
# Use auto-indentation
|
||||
## Use auto-indentation
|
||||
# set autoindent
|
||||
|
||||
# Backup files to filename~
|
||||
## Backup files to filename~
|
||||
# set backup
|
||||
|
||||
# Constantly update the cursor position
|
||||
## Constantly update the cursor position
|
||||
# set const
|
||||
|
||||
# Use cut to end of line with ^K by default
|
||||
## Use cut to end of line with ^K by default
|
||||
# set cut
|
||||
|
||||
# Use this value instead of the default
|
||||
# An out-of-range negative value can make nano die complaining that the
|
||||
# screen is too small
|
||||
# set fill -8
|
||||
## Use this value instead of the default
|
||||
## An out-of-range negative value can make nano die complaining that the
|
||||
## screen is too small
|
||||
## set fill -8
|
||||
|
||||
# Use alternate keypad routines
|
||||
## 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
|
||||
## 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
|
||||
## Don't convert files from DOS/Mac format
|
||||
# set noconvert
|
||||
|
||||
# Don't follow symlinks when writing files
|
||||
## Don't follow symlinks when writing files
|
||||
# set nofollow
|
||||
|
||||
# Don't display the help lists at the bottom of the screen
|
||||
## Don't display the help lists at the bottom of the screen
|
||||
# set nohelp
|
||||
|
||||
# Don't wrap text at all
|
||||
## Don't wrap text at all
|
||||
# set nowrap
|
||||
|
||||
# Set operating directory (chroot of sorts)
|
||||
## Set operating directory (chroot of sorts)
|
||||
# set operatingdir "~"
|
||||
|
||||
# Use Pico Compatibility mode for the shortcut lists and search text
|
||||
# set pico
|
||||
## Preserve the XON and XOFF keys (^Q and ^S)
|
||||
# set preserve
|
||||
|
||||
# The email-quote string. This is a "regular expression" if your
|
||||
# system supports them, otherwise a literal string. Default
|
||||
## The email-quote string. This is a "regular expression" if your
|
||||
## system supports them, otherwise a literal string. Default
|
||||
# set quotestr "^([ \t]*[|>:}#])+" if you have regexps, otherwise
|
||||
# set quotestr "> ".
|
||||
# You can get old nano quoted-justify behavior via:
|
||||
## You can get old nano quoted-justify behavior via:
|
||||
# set quotestr "(> )+"
|
||||
|
||||
# Do regular expression searches by default
|
||||
## Do regular expression searches by default
|
||||
# set regexp
|
||||
|
||||
# Use smooth scrolling as the default
|
||||
## Use smooth scrolling as the default
|
||||
# set smooth
|
||||
|
||||
# Use this spelling checker instead of the default one
|
||||
## Use this spelling checker instead of the default one
|
||||
# set speller aspell
|
||||
|
||||
# Allow nano to be suspended with ^Z
|
||||
## Allow nano to be suspended with ^Z
|
||||
# set suspend
|
||||
|
||||
# Use this tab size instead of the default; it must be greater than 0
|
||||
## Use this tab size instead of the default; it must be greater than 0
|
||||
# set tabsize 4
|
||||
|
||||
# Save automatically on exit, don't prompt
|
||||
## Save automatically on exit, don't prompt
|
||||
# set tempfile
|
||||
|
||||
# Disallow file modification, why would you want this in an rc file? ;)
|
||||
## 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 are: white, black, red, blue, green, yellow, purple, 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.
|
||||
## Color setup
|
||||
## Format:
|
||||
## syntax "short description" ["filename regex" ...]
|
||||
## color foreground,background "regex" ["regex"...]
|
||||
##
|
||||
## Legal colors are: 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,}\>"
|
||||
@@ -98,16 +102,22 @@
|
||||
# color brightcyan "#define" "#include" "#ifn*def" "#endif"
|
||||
# color brightcyan "#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
|
||||
## 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. Note that quotes in regexes should not be escaped (use "
|
||||
## instead of \").
|
||||
|
||||
# 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 are some short examples for TeX files and HTML
|
||||
|
||||
## Here are some short examples for TeX files and HTML
|
||||
# syntax "HTML" "\.html$"
|
||||
#
|
||||
# color blue start="<" end=">"
|
||||
@@ -119,8 +129,49 @@
|
||||
# color magenta "\{" "\}"
|
||||
# color blue "%.*"
|
||||
|
||||
# For this you will probably want to set your editor to "nano -Y mutt"
|
||||
|
||||
## For this you will probably want to set your editor to "nano -Y mutt"
|
||||
# syntax "mutt"
|
||||
# color green "^>.*"
|
||||
|
||||
|
||||
## Here is are examples for groff and for your .nanorc
|
||||
|
||||
#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 colour
|
||||
#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]"
|
||||
|
||||
|
||||
#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 "^#.*$"
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
Makefile.in.in
|
||||
POTFILES
|
||||
*.gmo
|
||||
*.pot
|
||||
Rules-quot
|
||||
boldquot.sed
|
||||
cat-id*
|
||||
en@boldquot.header
|
||||
en@quot.header
|
||||
insert-header.sin
|
||||
messages
|
||||
messages.mo
|
||||
nano.pot
|
||||
remove-potcdate.sed
|
||||
remove-potcdate.sin
|
||||
stamp-cat*
|
||||
quot.sed
|
||||
*.gmo
|
||||
|
||||
155
po/ChangeLog
155
po/ChangeLog
@@ -1,3 +1,158 @@
|
||||
2003-02-13 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ru.po: Updated Russian translation from Sergey A. Ribalchenko.
|
||||
|
||||
2003-02-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* Makevars (XGETTEXT_OPTIONS): Added --keyword=P_:1,2.
|
||||
* update.pl: likewise.
|
||||
* fi.po: Added Plural-Forms: header.
|
||||
|
||||
2003-02-10 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* fi.po: Updated Finnish translation by Kalle Kivimaa and
|
||||
Kalle Olavi Niemitalo.
|
||||
|
||||
2003-02-08 Chris Allegretta <chrisa@asty.org>
|
||||
|
||||
* it.po: Fix broken format string in translation.
|
||||
|
||||
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
|
||||
Medina.
|
||||
|
||||
2003-02-06 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pl.po: Updated Polish translation by Wojciech Kotwica.
|
||||
* sv.po: Updated Swedish translation by Christian Rose.
|
||||
|
||||
2003-02-04 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* ca.po: Updated Catalan translation.
|
||||
* 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.
|
||||
|
||||
2002-01-26 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-01-25 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
|
||||
2002-01-22 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
|
||||
2003-01-21 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* 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.
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* nl.po: Updated translation by Guus Sliepen.
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2003-01-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* Makefile.in.in: Removed, generated by autopoint.
|
||||
* Rules-quot: Likewise.
|
||||
* boldquot.sed: Likewise.
|
||||
* en@boldquot.header: Likewise.
|
||||
* en@quot.header: Likewise.
|
||||
* insert-header.sin: Likewise.
|
||||
* quot.sed: Likewise.
|
||||
* remove-potcdate.sin: Likewise.
|
||||
|
||||
2003-01-15 Jordi Mallach <jordi@gnu.org>
|
||||
|
||||
* LINGUAS: New file, exported values from configure.ac's ALL_LINGUAS.
|
||||
* it.po: Updated translation by Marco Colombo.
|
||||
* eu.po: New Basque translation by Peio Ziarsolo.
|
||||
|
||||
2002-12-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* 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>
|
||||
|
||||
* uk.po: Updated translation by Sergey A. Ribalchenko.
|
||||
* da.po: Updated translation by Keld Simonsen.
|
||||
|
||||
2002-11-05 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-11-03 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-10-29 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
* 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.
|
||||
|
||||
2002-10-26 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* 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.
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* de.po: Updated translation by Michael Piefel.
|
||||
* fr.po: Updated translation by Jean-Philippe Guérard.
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2002-10-17 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michel Piefel.
|
||||
|
||||
2002-10-14 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* 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.
|
||||
|
||||
2002-10-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* id.po: Updated translation by Tedi Heriyanto.
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* de.po: Updated translation by Michel Piefel.
|
||||
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ca.po: Updated translation.
|
||||
|
||||
2002-10-07 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* sv.po: Updated translation by Christian Rose.
|
||||
* gl.po: Updated translation by Jacobo Tarrío.
|
||||
* pl.po: Updated translation by Wojciech Kotwica.
|
||||
|
||||
2002-09-08 Jordi Mallach <jordi@sindominio.net>
|
||||
|
||||
* ms.po: Updated translation by Sharuzzaman Ahmat Raslan.
|
||||
|
||||
2
po/LINGUAS
Normal file
2
po/LINGUAS
Normal file
@@ -0,0 +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
|
||||
@@ -1,317 +0,0 @@
|
||||
# Makefile for PO directory in any package using GNU gettext.
|
||||
# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU General Public
|
||||
# License but which still want to provide support for the GNU gettext
|
||||
# functionality.
|
||||
# Please note that the actual code of GNU gettext is covered by the GNU
|
||||
# General Public License and is *not* in the public domain.
|
||||
|
||||
PACKAGE = @PACKAGE@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SHELL = /bin/sh
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
datadir = @datadir@
|
||||
localedir = $(datadir)/locale
|
||||
gettextsrcdir = $(datadir)/gettext/po
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
||||
|
||||
GMSGFMT = @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
MSGMERGE = msgmerge
|
||||
MSGMERGE_UPDATE = @MSGMERGE@ --update
|
||||
MSGINIT = msginit
|
||||
MSGCONV = msgconv
|
||||
MSGFILTER = msgfilter
|
||||
|
||||
POFILES = @POFILES@
|
||||
GMOFILES = @GMOFILES@
|
||||
UPDATEPOFILES = @UPDATEPOFILES@
|
||||
DUMMYPOFILES = @DUMMYPOFILES@
|
||||
DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \
|
||||
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
|
||||
DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
|
||||
$(POFILES) $(GMOFILES) \
|
||||
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
|
||||
|
||||
POTFILES = \
|
||||
|
||||
CATALOGS = @CATALOGS@
|
||||
|
||||
# Makevars gets inserted here. (Don't remove this line!)
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update
|
||||
|
||||
.po.mo:
|
||||
@echo "$(MSGFMT) -c -o $@ $<"; \
|
||||
$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
|
||||
|
||||
.po.gmo:
|
||||
@lang=`echo $* | sed -e 's,.*/,,'`; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
|
||||
cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
|
||||
|
||||
.sin.sed:
|
||||
sed -e '/^#/d' $< > t-$@
|
||||
mv t-$@ $@
|
||||
|
||||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: $(CATALOGS)
|
||||
all-no:
|
||||
|
||||
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
|
||||
# otherwise packages like GCC can not be built if only parts of the source
|
||||
# have been downloaded.
|
||||
|
||||
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
||||
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
|
||||
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)'
|
||||
test ! -f $(DOMAIN).po || { \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
|
||||
sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
|
||||
if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
|
||||
rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
|
||||
else \
|
||||
rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
|
||||
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
|
||||
fi; \
|
||||
else \
|
||||
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
|
||||
fi; \
|
||||
}
|
||||
|
||||
$(srcdir)/$(DOMAIN).pot:
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
|
||||
$(POFILES): $(srcdir)/$(DOMAIN).pot
|
||||
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
|
||||
cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
|
||||
|
||||
|
||||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
||||
for file in $(DISTFILES.common); do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file \
|
||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
install-data-no: all
|
||||
install-data-yes: all
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
||||
if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
|
||||
$(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
|
||||
echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
|
||||
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
if test -n "$$lc"; then \
|
||||
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
|
||||
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
|
||||
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
|
||||
for file in *; do \
|
||||
if test -f $$file; then \
|
||||
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
|
||||
fi; \
|
||||
done); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
else \
|
||||
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
fi; \
|
||||
fi; \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
|
||||
ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
|
||||
cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
|
||||
fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
install-strip: install
|
||||
|
||||
installdirs: installdirs-exec installdirs-data
|
||||
installdirs-exec:
|
||||
installdirs-data: installdirs-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
installdirs-data-no:
|
||||
installdirs-data-yes:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
||||
@catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
||||
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
||||
for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
if test -n "$$lc"; then \
|
||||
if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
|
||||
link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
|
||||
mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
(cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
|
||||
for file in *; do \
|
||||
if test -f $$file; then \
|
||||
ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
|
||||
fi; \
|
||||
done); \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
|
||||
else \
|
||||
if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
|
||||
:; \
|
||||
else \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi; \
|
||||
done; \
|
||||
done
|
||||
|
||||
# Define this as empty until I found a useful application.
|
||||
installcheck:
|
||||
|
||||
uninstall: uninstall-exec uninstall-data
|
||||
uninstall-exec:
|
||||
uninstall-data: uninstall-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
for file in $(DISTFILES.common); do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
uninstall-data-no:
|
||||
uninstall-data-yes:
|
||||
catalogs='$(CATALOGS)'; \
|
||||
for cat in $$catalogs; do \
|
||||
cat=`basename $$cat`; \
|
||||
lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
|
||||
for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
|
||||
rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
|
||||
done; \
|
||||
done
|
||||
|
||||
check: all
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f remove-potcdate.sed
|
||||
rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
|
||||
rm -fr *.o
|
||||
|
||||
clean: mostlyclean
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile Makefile.in POTFILES *.mo
|
||||
|
||||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES)
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir:
|
||||
$(MAKE) update-po
|
||||
@$(MAKE) dist2
|
||||
# This is a separate target because 'update-po' must be executed before.
|
||||
dist2: $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
|
||||
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
|
||||
for file in $$dists; do \
|
||||
if test -f $$file; then \
|
||||
cp -p $$file $(distdir); \
|
||||
else \
|
||||
cp -p $(srcdir)/$$file $(distdir); \
|
||||
fi; \
|
||||
done
|
||||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
$(MAKE) $(UPDATEPOFILES)
|
||||
$(MAKE) update-gmo
|
||||
|
||||
# General rule for updating PO files.
|
||||
|
||||
.nop.po-update:
|
||||
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
|
||||
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
||||
tmpdir=`pwd`; \
|
||||
echo "$$lang:"; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
|
||||
cd $(srcdir); \
|
||||
if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
|
||||
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
else \
|
||||
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
|
||||
:; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
else \
|
||||
echo "msgmerge for $$lang.po failed!" 1>&2; \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
fi
|
||||
|
||||
$(DUMMYPOFILES):
|
||||
|
||||
update-gmo: Makefile $(GMOFILES)
|
||||
@:
|
||||
|
||||
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
||||
$(SHELL) ./config.status
|
||||
|
||||
force:
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make not to export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
@@ -8,7 +8,7 @@ subdir = po
|
||||
top_builddir = ..
|
||||
|
||||
# These options get passed to xgettext.
|
||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
|
||||
XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=P_:1,2
|
||||
|
||||
# This is the copyright holder that gets inserted into the header of the
|
||||
# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
# Special Makefile rules for English message catalogs with quotation marks.
|
||||
|
||||
DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
|
||||
|
||||
.SUFFIXES: .insert-header .po-update-en
|
||||
|
||||
en@quot.po-update: en@quot.po-update-en
|
||||
en@boldquot.po-update: en@boldquot.po-update-en
|
||||
|
||||
.insert-header.po-update-en:
|
||||
@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
|
||||
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
|
||||
tmpdir=`pwd`; \
|
||||
echo "$$lang:"; \
|
||||
ll=`echo $$lang | sed -e 's/@.*//'`; \
|
||||
LC_ALL=C; export LC_ALL; \
|
||||
cd $(srcdir); \
|
||||
if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
|
||||
if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
else \
|
||||
if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
|
||||
:; \
|
||||
else \
|
||||
echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
fi; \
|
||||
else \
|
||||
echo "creation of $$lang.po failed!" 1>&2; \
|
||||
rm -f $$tmpdir/$$lang.new.po; \
|
||||
fi
|
||||
|
||||
en@quot.insert-header: insert-header.sin
|
||||
sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
|
||||
|
||||
en@boldquot.insert-header: insert-header.sin
|
||||
sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
|
||||
|
||||
mostlyclean: mostlyclean-quot
|
||||
mostlyclean-quot:
|
||||
rm -f *.insert-header
|
||||
@@ -1,10 +0,0 @@
|
||||
s/"\([^"]*\)"/“\1”/g
|
||||
s/`\([^`']*\)'/‘\1’/g
|
||||
s/ '\([^`']*\)' / ‘\1’ /g
|
||||
s/ '\([^`']*\)'$/ ‘\1’/g
|
||||
s/^'\([^`']*\)' /‘\1’ /g
|
||||
s/“”/""/g
|
||||
s/“/“[1m/g
|
||||
s/”/[0m”/g
|
||||
s/‘/‘[1m/g
|
||||
s/’/[0m’/g
|
||||
@@ -1,25 +0,0 @@
|
||||
# All this catalog "translates" are quotation characters.
|
||||
# The msgids must be ASCII and therefore cannot contain real quotation
|
||||
# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
|
||||
# and double quote (0x22). These substitutes look strange; see
|
||||
# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
|
||||
#
|
||||
# This catalog translates grave accent (0x60) and apostrophe (0x27) to
|
||||
# left single quotation mark (U+2018) and right single quotation mark (U+2019).
|
||||
# It also translates pairs of apostrophe (0x27) to
|
||||
# left single quotation mark (U+2018) and right single quotation mark (U+2019)
|
||||
# and pairs of quotation mark (0x22) to
|
||||
# left double quotation mark (U+201C) and right double quotation mark (U+201D).
|
||||
#
|
||||
# When output to an UTF-8 terminal, the quotation characters appear perfectly.
|
||||
# When output to an ISO-8859-1 terminal, the single quotation marks are
|
||||
# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
|
||||
# grave/acute accent (by libiconv), and the double quotation marks are
|
||||
# transliterated to 0x22.
|
||||
# When output to an ASCII terminal, the single quotation marks are
|
||||
# transliterated to apostrophes, and the double quotation marks are
|
||||
# transliterated to 0x22.
|
||||
#
|
||||
# This catalog furthermore displays the text between the quotation marks in
|
||||
# bold face, assuming the VT100/XTerm escape sequences.
|
||||
#
|
||||
@@ -1,22 +0,0 @@
|
||||
# All this catalog "translates" are quotation characters.
|
||||
# The msgids must be ASCII and therefore cannot contain real quotation
|
||||
# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
|
||||
# and double quote (0x22). These substitutes look strange; see
|
||||
# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
|
||||
#
|
||||
# This catalog translates grave accent (0x60) and apostrophe (0x27) to
|
||||
# left single quotation mark (U+2018) and right single quotation mark (U+2019).
|
||||
# It also translates pairs of apostrophe (0x27) to
|
||||
# left single quotation mark (U+2018) and right single quotation mark (U+2019)
|
||||
# and pairs of quotation mark (0x22) to
|
||||
# left double quotation mark (U+201C) and right double quotation mark (U+201D).
|
||||
#
|
||||
# When output to an UTF-8 terminal, the quotation characters appear perfectly.
|
||||
# When output to an ISO-8859-1 terminal, the single quotation marks are
|
||||
# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
|
||||
# grave/acute accent (by libiconv), and the double quotation marks are
|
||||
# transliterated to 0x22.
|
||||
# When output to an ASCII terminal, the single quotation marks are
|
||||
# transliterated to apostrophes, and the double quotation marks are
|
||||
# transliterated to 0x22.
|
||||
#
|
||||
@@ -1,23 +0,0 @@
|
||||
# Sed script that inserts the file called HEADER before the header entry.
|
||||
#
|
||||
# At each occurrence of a line starting with "msgid ", we execute the following
|
||||
# commands. At the first occurrence, insert the file. At the following
|
||||
# occurrences, do nothing. The distinction between the first and the following
|
||||
# occurrences is achieved by looking at the hold space.
|
||||
/^msgid /{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/m/m/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Read the file.
|
||||
r HEADER
|
||||
# Output the file's contents by reading the next line. But don't lose the
|
||||
# current line while doing this.
|
||||
g
|
||||
N
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
||||
1785
po/nano.pot
1785
po/nano.pot
File diff suppressed because it is too large
Load Diff
1787
po/pt_BR.po
1787
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
s/"\([^"]*\)"/“\1”/g
|
||||
s/`\([^`']*\)'/‘\1’/g
|
||||
s/ '\([^`']*\)' / ‘\1’ /g
|
||||
s/ '\([^`']*\)'$/ ‘\1’/g
|
||||
s/^'\([^`']*\)' /‘\1’ /g
|
||||
s/“”/""/g
|
||||
@@ -1,19 +0,0 @@
|
||||
# Sed script that remove the POT-Creation-Date line in the header entry
|
||||
# from a POT file.
|
||||
#
|
||||
# The distinction between the first and the following occurrences of the
|
||||
# pattern is achieved by looking at the hold space.
|
||||
/^"POT-Creation-Date: .*"$/{
|
||||
x
|
||||
# Test if the hold space is empty.
|
||||
s/P/P/
|
||||
ta
|
||||
# Yes it was empty. First occurrence. Remove the line.
|
||||
g
|
||||
d
|
||||
bb
|
||||
:a
|
||||
# The hold space was nonempty. Following occurrences. Do nothing.
|
||||
x
|
||||
:b
|
||||
}
|
||||
@@ -293,7 +293,7 @@ sub GeneratePot{
|
||||
close INFILE;
|
||||
|
||||
$GETTEXT ="xgettext --default-domain\=$PACKAGE --directory\=\.\."
|
||||
." --add-comments --keyword\=\_ --keyword\=N\_"
|
||||
." --add-comments --keyword\=\_ --keyword\=N\_ --keyword\=P_\:1,2"
|
||||
." --files-from\=\.\/POTFILES\.in ";
|
||||
$GTEST ="test \! -f $PACKAGE\.po \|\| \( rm -f \.\/$PACKAGE\.pot "
|
||||
."&& mv $PACKAGE\.po \.\/$PACKAGE\.pot \)";
|
||||
|
||||
71
proto.h
71
proto.h
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* proto.h *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -33,11 +33,14 @@ 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
|
||||
@@ -62,9 +65,13 @@ extern char *full_operating_dir;
|
||||
extern char *alt_speller;
|
||||
#endif
|
||||
|
||||
extern int resetstatuspos;
|
||||
extern struct stat fileinfo;
|
||||
extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
|
||||
extern filestruct *cutbuffer, *mark_beginbuf;
|
||||
extern filestruct *cutbuffer;
|
||||
#ifndef NANO_SMALL
|
||||
extern filestruct *mark_beginbuf;
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
extern openfilestruct *open_files;
|
||||
@@ -80,15 +87,23 @@ extern shortcut *shortcut_list;
|
||||
extern shortcut *main_list, *whereis_list;
|
||||
extern shortcut *replace_list, *goto_list;
|
||||
extern shortcut *writefile_list, *insertfile_list;
|
||||
extern shortcut *spell_list, *replace_list_2;
|
||||
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 int use_regexp, regexp_compiled;
|
||||
@@ -104,6 +119,13 @@ extern regmatch_t synfilematches[1];
|
||||
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 */
|
||||
@@ -158,19 +180,20 @@ int check_operating_dir(const char *currpath, int allow_tabcomp);
|
||||
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);
|
||||
#ifndef DISABLE_TABCOMP
|
||||
char *real_dir_from_tilde(const char *buf);
|
||||
#endif
|
||||
#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);
|
||||
@@ -215,7 +238,9 @@ 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
|
||||
@@ -260,8 +285,8 @@ int do_wrap(filestruct *inptr);
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
int do_int_spell_fix(const char *word);
|
||||
int do_int_speller(char *tempfile_name);
|
||||
int do_alt_speller(char *tempfile_name);
|
||||
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)
|
||||
@@ -285,12 +310,13 @@ 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_hup(int signal);
|
||||
RETSIGTYPE handle_hupterm(int signal);
|
||||
RETSIGTYPE do_suspend(int signal);
|
||||
RETSIGTYPE do_cont(int signal);
|
||||
#ifndef NANO_SMALL
|
||||
@@ -300,7 +326,7 @@ void print_numlock_warning(void);
|
||||
#ifndef NANO_SMALL
|
||||
void do_toggle(const toggle *which);
|
||||
#endif
|
||||
int ABCD(int input);
|
||||
int abcd(int input);
|
||||
|
||||
/* Public functions in rcfile.c */
|
||||
#ifdef ENABLE_NANORC
|
||||
@@ -311,6 +337,7 @@ 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 */
|
||||
@@ -320,7 +347,7 @@ void do_rcfile(void);
|
||||
|
||||
/* Public functions in search.c */
|
||||
#ifdef HAVE_REGEX_H
|
||||
void regexp_init(const char *regexp);
|
||||
int regexp_init(const char *regexp);
|
||||
void regexp_cleanup(void);
|
||||
#endif
|
||||
void not_found_msg(const char *str);
|
||||
@@ -337,7 +364,6 @@ void replace_abort(void);
|
||||
int replace_regexp(char *string, int create_flag);
|
||||
#endif
|
||||
char *replace_line(void);
|
||||
void print_replaced(int num);
|
||||
int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
int *beginx, int wholewords, int *i);
|
||||
int do_replace(void);
|
||||
@@ -348,6 +374,21 @@ int do_gotoline_void(void);
|
||||
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 */
|
||||
int is_cntrl_char(int c);
|
||||
@@ -367,7 +408,6 @@ 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);
|
||||
char *charalloc(size_t howmuch);
|
||||
void *nrealloc(void *ptr, size_t howmuch);
|
||||
char *mallocstrcpy(char *dest, const char *src);
|
||||
void new_magicline(void);
|
||||
@@ -391,6 +431,9 @@ 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
|
||||
@@ -419,6 +462,9 @@ 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);
|
||||
@@ -426,6 +472,7 @@ 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);
|
||||
|
||||
211
rcfile.c
211
rcfile.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* rcfile.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -27,23 +27,16 @@
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <pwd.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
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
const static rcoption rcopts[] = {
|
||||
#ifndef NANO_SMALL
|
||||
{"autoindent", AUTOINDENT},
|
||||
@@ -57,7 +50,7 @@ const static rcoption rcopts[] = {
|
||||
{"fill", 0},
|
||||
#endif
|
||||
{"keypad", ALT_KEYPAD},
|
||||
#ifndef DISABLE_MOUSE
|
||||
#if !defined(DISABLE_MOUSE) && defined(NCURSES_MOUSE_VERSION)
|
||||
{"mouse", USE_MOUSE},
|
||||
#endif
|
||||
#ifdef ENABLE_MULTIBUFFER
|
||||
@@ -66,7 +59,7 @@ const static rcoption rcopts[] = {
|
||||
#ifndef NANO_SMALL
|
||||
{"noconvert", NO_CONVERT},
|
||||
#endif
|
||||
{"nofollow", FOLLOW_SYMLINKS},
|
||||
{"nofollow", NOFOLLOW_SYMLINKS},
|
||||
{"nohelp", NO_HELP},
|
||||
#ifndef DISABLE_WRAPPING
|
||||
{"nowrap", NO_WRAP},
|
||||
@@ -74,8 +67,8 @@ const static rcoption rcopts[] = {
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
{"operatingdir", 0},
|
||||
#endif
|
||||
{"pico", PICO_MODE},
|
||||
#ifndef NANO_SMALL
|
||||
{"preserve", PRESERVE},
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
{"quotestr", 0},
|
||||
#endif
|
||||
#ifdef HAVE_REGEX_H
|
||||
@@ -91,6 +84,7 @@ const static rcoption rcopts[] = {
|
||||
{"tabsize", 0},
|
||||
{"tempfile", TEMP_OPT},
|
||||
{"view", VIEW_MODE},
|
||||
{"historylog", HISTORYLOG},
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
@@ -221,10 +215,10 @@ int colortoint(const char *colorname, int *bright)
|
||||
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"));
|
||||
exit(1);
|
||||
"\"black\", with the optional prefix \"bright\".\n"),
|
||||
colorname);
|
||||
mcolor = -1;
|
||||
}
|
||||
|
||||
return mcolor;
|
||||
}
|
||||
|
||||
@@ -246,11 +240,29 @@ char *parse_next_regex(char *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 *exttmp = NULL;
|
||||
exttype *endext = NULL;
|
||||
/* The end of the extensions list for this syntax. */
|
||||
|
||||
while (*ptr == ' ')
|
||||
ptr++;
|
||||
@@ -275,6 +287,7 @@ void parse_syntax(char *ptr)
|
||||
if (syntaxes == NULL) {
|
||||
syntaxes = (syntaxtype *)nmalloc(sizeof(syntaxtype));
|
||||
tmpsyntax = syntaxes;
|
||||
SET(COLOR_SYNTAX);
|
||||
} else {
|
||||
for (tmpsyntax = syntaxes; tmpsyntax->next != NULL;
|
||||
tmpsyntax = tmpsyntax->next)
|
||||
@@ -296,6 +309,9 @@ void parse_syntax(char *ptr)
|
||||
|
||||
/* 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++;
|
||||
|
||||
@@ -306,17 +322,17 @@ void parse_syntax(char *ptr)
|
||||
fileregptr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
|
||||
if (tmpsyntax->extensions == NULL) {
|
||||
tmpsyntax->extensions = (exttype *)nmalloc(sizeof(exttype));
|
||||
exttmp = tmpsyntax->extensions;
|
||||
} else {
|
||||
for (exttmp = tmpsyntax->extensions; exttmp->next != NULL;
|
||||
exttmp = exttmp->next);
|
||||
exttmp->next = (exttype *)nmalloc(sizeof(exttype));
|
||||
exttmp = exttmp->next;
|
||||
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;
|
||||
}
|
||||
exttmp->val = mallocstrcpy(NULL, fileregptr);
|
||||
exttmp->next = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,6 +361,10 @@ void parse_colors(char *ptr)
|
||||
|
||||
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;
|
||||
@@ -358,6 +378,11 @@ void parse_colors(char *ptr)
|
||||
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++;
|
||||
|
||||
@@ -376,40 +401,40 @@ void parse_colors(char *ptr)
|
||||
}
|
||||
ptr++;
|
||||
|
||||
if (tmpsyntax->color == NULL) {
|
||||
tmpsyntax->color = nmalloc(sizeof(colortype));
|
||||
tmpcolor = tmpsyntax->color;
|
||||
#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 = nmalloc(sizeof(colortype));
|
||||
tmpcolor = tmpcolor->next;
|
||||
}
|
||||
tmpcolor->fg = fg;
|
||||
tmpcolor->bg = bg;
|
||||
tmpcolor->bright = bright;
|
||||
tmpcolor->next = NULL;
|
||||
|
||||
tmpcolor->start = ptr;
|
||||
newcolor = (colortype *)nmalloc(sizeof(colortype));
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
tmpcolor->start = mallocstrcpy(NULL, tmpcolor->start);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("string val=%s\n"), tmpcolor->start);
|
||||
#endif
|
||||
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 (!expectend)
|
||||
tmpcolor->end = NULL;
|
||||
else {
|
||||
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(_
|
||||
("\n\t\"start=\" requires a corresponding \"end=\""));
|
||||
("\"start=\" requires a corresponding \"end=\""));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -422,13 +447,18 @@ void parse_colors(char *ptr)
|
||||
}
|
||||
ptr++;
|
||||
|
||||
tmpcolor->end = ptr;
|
||||
fgstr = ptr;
|
||||
ptr = parse_next_regex(ptr);
|
||||
tmpcolor->end = mallocstrcpy(NULL, tmpcolor->end);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("For end part, beginning = \"%s\"\n"),
|
||||
tmpcolor->end);
|
||||
#endif
|
||||
|
||||
/* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -453,7 +483,7 @@ void parse_rcfile(FILE *rcstream)
|
||||
|
||||
if (*ptr == '#') {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("parse_rcfile: Read a comment\n"));
|
||||
fprintf(stderr, _("%s: Read a comment\n"), "parse_rcfile()");
|
||||
#endif
|
||||
continue; /* Skip past commented lines */
|
||||
}
|
||||
@@ -461,7 +491,7 @@ void parse_rcfile(FILE *rcstream)
|
||||
/* Else skip to the next space */
|
||||
keyword = ptr;
|
||||
ptr = parse_next_word(ptr);
|
||||
if (!ptr)
|
||||
if (ptr == NULL)
|
||||
continue;
|
||||
|
||||
/* Else try to parse the keyword */
|
||||
@@ -488,10 +518,10 @@ void parse_rcfile(FILE *rcstream)
|
||||
for (i = 0; rcopts[i].name != NULL; i++) {
|
||||
if (!strcasecmp(option, rcopts[i].name)) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("parse_rcfile: Parsing option %s\n"),
|
||||
rcopts[i].name);
|
||||
fprintf(stderr, _("%s: Parsing option %s\n"),
|
||||
"parse_rcfile()", rcopts[i].name);
|
||||
#endif
|
||||
if (set == 1 || rcopts[i].flag == FOLLOW_SYMLINKS) {
|
||||
if (set == 1) {
|
||||
if (!strcasecmp(rcopts[i].name, "tabsize")
|
||||
#ifndef DISABLE_OPERATINGDIR
|
||||
|| !strcasecmp(rcopts[i].name, "operatingdir")
|
||||
@@ -528,8 +558,8 @@ void parse_rcfile(FILE *rcstream)
|
||||
if (!strcasecmp(rcopts[i].name, "fill")) {
|
||||
char *first_error;
|
||||
|
||||
/* Using strtol instead of atoi lets us
|
||||
* accept 0 while checking other
|
||||
/* 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')
|
||||
@@ -592,6 +622,7 @@ 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);
|
||||
@@ -605,25 +636,41 @@ void do_rcfile(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Determine home directory using getpwent(), don't rely on $HOME */
|
||||
do {
|
||||
userage = getpwent();
|
||||
} while (userage != NULL && userage->pw_uid != euid);
|
||||
endpwent();
|
||||
|
||||
lineno = 0;
|
||||
|
||||
if (userage == NULL)
|
||||
rcfile_error(_("I can't find my home directory! Wah!"));
|
||||
else {
|
||||
nanorc = nrealloc(nanorc, strlen(userage->pw_dir) + 9);
|
||||
sprintf(nanorc, "%s/.nanorc", userage->pw_dir);
|
||||
/* Rely on $HOME, fall back on getpwuid() */
|
||||
if (homenv != NULL) {
|
||||
nanorc = nrealloc(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 = nrealloc(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)
|
||||
if (errno != ENOENT) {
|
||||
rcfile_error(_("Unable to open ~/.nanorc file, %s"),
|
||||
strerror(errno));
|
||||
SET(NO_RCFILE);
|
||||
}
|
||||
} else {
|
||||
parse_rcfile(rcstream);
|
||||
fclose(rcstream);
|
||||
|
||||
512
search.c
512
search.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* search.c *
|
||||
* *
|
||||
* Copyright (C) 2000-2002 Chris Allegretta *
|
||||
* Copyright (C) 2000-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) *
|
||||
@@ -26,24 +26,23 @@
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
/* Regular expression helper functions */
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
void regexp_init(const char *regexp)
|
||||
int regexp_init(const char *regexp)
|
||||
{
|
||||
regcomp(&search_regexp, regexp, (ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE) | REG_EXTENDED);
|
||||
/* Hmm, perhaps we should check for whether regcomp returns successfully */
|
||||
if (regcomp(&search_regexp, regexp, (ISSET(CASE_SENSITIVE) ? 0 : REG_ICASE)
|
||||
| REG_EXTENDED) != 0)
|
||||
return 0;
|
||||
|
||||
SET(REGEXP_COMPILED);
|
||||
return 1;
|
||||
}
|
||||
|
||||
void regexp_cleanup(void)
|
||||
@@ -92,46 +91,31 @@ void search_init_globals(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* Set up the system variables for a search or replace. Returns -1 on
|
||||
abort, 0 on success, and 1 on rerun calling program
|
||||
Return -2 to run opposite program (search -> replace, replace ->
|
||||
search).
|
||||
|
||||
replacing = 1 if we call from do_replace, 0 if called from do_search
|
||||
func. */
|
||||
/* Set up the system variables for a search or replace. Return -1 on
|
||||
* abort, 0 on success, and 1 on rerun calling program. Return -2 to
|
||||
* run opposite program (search -> replace, replace -> search).
|
||||
*
|
||||
* replacing = 1 if we call from do_replace(), 0 if called from
|
||||
* do_search(). */
|
||||
int search_init(int replacing)
|
||||
{
|
||||
int i = 0;
|
||||
char *buf;
|
||||
static char *backupstring = NULL;
|
||||
#ifdef HAVE_REGEX_H
|
||||
const char *regex_error = _("Invalid regex \"%s\"");
|
||||
#endif /* HAVE_REGEX_H */
|
||||
|
||||
search_init_globals();
|
||||
|
||||
/* Clear the backupstring if we've changed from Pico mode to regular
|
||||
mode */
|
||||
if (ISSET(CLEAR_BACKUPSTRING)) {
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
UNSET(CLEAR_BACKUPSTRING);
|
||||
}
|
||||
|
||||
/* Okay, fun time. backupstring is our holder for what is being
|
||||
returned from the statusq call. Using answer for this would be tricky.
|
||||
Here, if we're using PICO_MODE, we only want nano to put the
|
||||
old string back up as editable if it's not the same as last_search.
|
||||
if (backupstring == NULL)
|
||||
backupstring = mallocstrcpy(backupstring, "");
|
||||
|
||||
Otherwise, if we don't already have a backupstring, set it to
|
||||
last_search. */
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = (historytype *)&search_history.next;
|
||||
#endif
|
||||
|
||||
if (ISSET(PICO_MODE)) {
|
||||
if (backupstring == NULL || !strcmp(backupstring, last_search))
|
||||
backupstring = mallocstrcpy(backupstring, "");
|
||||
}
|
||||
else if (backupstring == NULL)
|
||||
backupstring = mallocstrcpy(backupstring, last_search);
|
||||
|
||||
/* If using Pico messages, we do things the old fashioned way... */
|
||||
if (ISSET(PICO_MODE) && last_search[0]) {
|
||||
if (last_search[0] != '\0') {
|
||||
buf = charalloc(COLS / 3 + 7);
|
||||
/* We use COLS / 3 here because we need to see more on the line */
|
||||
sprintf(buf, " [%.*s%s]", COLS / 3, last_search,
|
||||
@@ -143,7 +127,10 @@ int search_init(int replacing)
|
||||
|
||||
/* This is now one simple call. It just does a lot */
|
||||
i = statusq(0, replacing ? replace_list : whereis_list, backupstring,
|
||||
"%s%s%s%s%s%s",
|
||||
#ifndef NANO_SMALL
|
||||
&search_history,
|
||||
#endif
|
||||
"%s%s%s%s%s%s",
|
||||
_("Search"),
|
||||
|
||||
/* This string is just a modifier for the search prompt,
|
||||
@@ -170,21 +157,38 @@ int search_init(int replacing)
|
||||
reset_cursor();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = search_history.next;
|
||||
#endif
|
||||
return -1;
|
||||
} else {
|
||||
switch (i) {
|
||||
case -2: /* Same string */
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
/* If we're in Pico mode, and answer is "", use
|
||||
last_search! */
|
||||
regexp_init(ISSET(PICO_MODE) ? last_search : answer);
|
||||
/* If answer is "", use last_search! */
|
||||
if (regexp_init(last_search) == 0) {
|
||||
statusbar(regex_error, last_search);
|
||||
reset_cursor();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
return -3;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case 0: /* They entered something new */
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
regexp_init(answer);
|
||||
if (regexp_init(answer) == 0) {
|
||||
statusbar(regex_error, answer);
|
||||
reset_cursor();
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = search_history.next;
|
||||
#endif
|
||||
return -3;
|
||||
}
|
||||
#endif
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
@@ -212,7 +216,14 @@ int search_init(int replacing)
|
||||
case NANO_FROMSEARCHTOGOTO_KEY:
|
||||
free(backupstring);
|
||||
backupstring = NULL;
|
||||
do_gotoline_void();
|
||||
#ifndef NANO_SMALL
|
||||
search_history.current = search_history.next;
|
||||
#endif
|
||||
i = (int)strtol(answer, &buf, 10); /* Just testing answer here */
|
||||
if (!(errno == ERANGE || *answer == '\0' || *buf != '\0'))
|
||||
do_gotoline(-1, 0);
|
||||
else
|
||||
do_gotoline_void();
|
||||
return -3;
|
||||
default:
|
||||
do_early_abort();
|
||||
@@ -229,14 +240,11 @@ int is_whole_word(int curr_pos, const char *datastr, const char *searchword)
|
||||
size_t sln = curr_pos + strlen(searchword);
|
||||
|
||||
/* start of line or previous character not a letter and end of line
|
||||
* or next character not a letter */
|
||||
return (curr_pos < 1 || !isalpha((int) datastr[curr_pos - 1])) &&
|
||||
(sln == strlen(datastr) || !isalpha((int) datastr[sln]));
|
||||
or next character not a letter */
|
||||
return (curr_pos < 1 || !isalpha((int)datastr[curr_pos - 1])) &&
|
||||
(sln == strlen(datastr) || !isalpha((int)datastr[sln]));
|
||||
}
|
||||
|
||||
static int past_editbuff;
|
||||
/* findnextstr() is now searching lines not displayed */
|
||||
|
||||
filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
const filestruct *begin, int beginx,
|
||||
const char *needle)
|
||||
@@ -245,7 +253,7 @@ filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
const char *searchstr, *rev_start = NULL, *found = NULL;
|
||||
int current_x_find = 0;
|
||||
|
||||
past_editbuff = 0;
|
||||
search_offscreen = 0;
|
||||
|
||||
if (!ISSET(REVERSE_SEARCH)) { /* forward search */
|
||||
/* Argh, current_x is set to -1 by nano.c:do_int_spell_fix(), and
|
||||
@@ -276,19 +284,17 @@ filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
fileptr = fileptr->next;
|
||||
|
||||
if (fileptr == editbot)
|
||||
past_editbuff = 1;
|
||||
search_offscreen = 1;
|
||||
|
||||
/* EOF reached ?, wrap around once */
|
||||
/* EOF reached?, wrap around once */
|
||||
if (fileptr == NULL) {
|
||||
/* don't wrap if looking for bracket match */
|
||||
if (bracket_mode)
|
||||
return NULL;
|
||||
fileptr = fileage;
|
||||
past_editbuff = 1;
|
||||
if (!quiet) {
|
||||
search_offscreen = 1;
|
||||
if (!quiet)
|
||||
statusbar(_("Search Wrapped"));
|
||||
SET(DISABLE_CURPOS);
|
||||
}
|
||||
}
|
||||
|
||||
/* Original start line reached */
|
||||
@@ -301,16 +307,16 @@ filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
/* We found an instance */
|
||||
current_x_find = found - fileptr->data;
|
||||
/* Ensure we haven't wrapped around again! */
|
||||
if ((search_last_line) && (current_x_find > beginx)) {
|
||||
if (search_last_line && current_x_find > beginx) {
|
||||
if (!quiet)
|
||||
not_found_msg(needle);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifndef NANO_SMALL
|
||||
else { /* reverse search */
|
||||
current_x_find = current_x - 1;
|
||||
/* Make sure we haven't passed the begining of the string */
|
||||
/* Make sure we haven't passed the beginning of the string */
|
||||
rev_start = &fileptr->data[current_x_find];
|
||||
searchstr = fileptr->data;
|
||||
|
||||
@@ -331,18 +337,16 @@ filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
fileptr = fileptr->prev;
|
||||
|
||||
if (fileptr == edittop->prev)
|
||||
past_editbuff = 1;
|
||||
search_offscreen = 1;
|
||||
|
||||
/* SOF reached ?, wrap around once */
|
||||
/* SOF reached?, wrap around once */
|
||||
/* ? */ if (fileptr == NULL) {
|
||||
if (bracket_mode)
|
||||
return NULL;
|
||||
fileptr = filebot;
|
||||
past_editbuff = 1;
|
||||
if (!quiet) {
|
||||
search_offscreen = 1;
|
||||
if (!quiet)
|
||||
statusbar(_("Search Wrapped"));
|
||||
SET(DISABLE_CURPOS);
|
||||
}
|
||||
}
|
||||
/* Original start line reached */
|
||||
if (fileptr == begin)
|
||||
@@ -368,11 +372,7 @@ filestruct *findnextstr(int quiet, int bracket_mode,
|
||||
current_x = current_x_find;
|
||||
|
||||
if (!bracket_mode) {
|
||||
if (past_editbuff)
|
||||
edit_update(fileptr, CENTER);
|
||||
else
|
||||
update_line(current, current_x);
|
||||
|
||||
update_line(current, current_x);
|
||||
placewewant = xplustabs();
|
||||
reset_cursor();
|
||||
}
|
||||
@@ -405,27 +405,26 @@ int do_search(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The sneaky user deleted the previous search string */
|
||||
if (!ISSET(PICO_MODE) && answer[0] == '\0') {
|
||||
statusbar(_("Search Cancelled"));
|
||||
search_abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If answer is now == "", then PICO_MODE is set. So, copy
|
||||
last_search into answer... */
|
||||
|
||||
/* If answer is now "", copy last_search into answer... */
|
||||
if (answer[0] == '\0')
|
||||
answer = mallocstrcpy(answer, last_search);
|
||||
else
|
||||
last_search = mallocstrcpy(last_search, answer);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* add this search string to the search history list */
|
||||
if (answer[0] != '\0')
|
||||
update_history(&search_history, answer);
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
search_last_line = 0;
|
||||
didfind = findnextstr(FALSE, FALSE, current, current_x, answer);
|
||||
|
||||
if ((fileptr == current) && (fileptr_x == current_x) &&
|
||||
didfind != NULL)
|
||||
if (fileptr == current && fileptr_x == current_x && didfind != NULL)
|
||||
statusbar(_("This is the only occurrence"));
|
||||
else if (current->lineno <= edittop->lineno
|
||||
|| current->lineno >= editbot->lineno)
|
||||
edit_update(current, CENTER);
|
||||
|
||||
search_abort();
|
||||
|
||||
@@ -444,9 +443,9 @@ void replace_abort(void)
|
||||
#ifdef HAVE_REGEX_H
|
||||
int replace_regexp(char *string, int create_flag)
|
||||
{
|
||||
/* split personality here - if create_flag is null, just calculate
|
||||
/* Split personality here - if create_flag is NULL, just calculate
|
||||
* the size of the replacement line (necessary because of
|
||||
* subexpressions like \1 \2 \3 in the replaced text) */
|
||||
* subexpressions like \1 \2 \3 in the replaced text). */
|
||||
|
||||
char *c;
|
||||
int new_size = strlen(current->data) + 1;
|
||||
@@ -458,7 +457,7 @@ int replace_regexp(char *string, int create_flag)
|
||||
* replacement using \1, \2, \3, etc. */
|
||||
|
||||
c = last_replace;
|
||||
while (*c) {
|
||||
while (*c != '\0') {
|
||||
if (*c != '\\') {
|
||||
if (create_flag)
|
||||
*string++ = *c;
|
||||
@@ -468,11 +467,11 @@ int replace_regexp(char *string, int create_flag)
|
||||
int num = (int) *(c + 1) - (int) '0';
|
||||
if (num >= 1 && num <= 9) {
|
||||
|
||||
int i = regmatches[num].rm_so;
|
||||
int i = regmatches[num].rm_eo - regmatches[num].rm_so;
|
||||
|
||||
if (num > search_regexp.re_nsub) {
|
||||
/* Ugh, they specified a subexpression that doesn't
|
||||
exist. */
|
||||
* exist. */
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -480,12 +479,15 @@ int replace_regexp(char *string, int create_flag)
|
||||
c += 2;
|
||||
|
||||
/* But add the length of the subexpression to new_size */
|
||||
new_size += regmatches[num].rm_eo - regmatches[num].rm_so;
|
||||
new_size += i;
|
||||
|
||||
/* And if create_flag is set, append the result of the
|
||||
* subexpression match to the new line */
|
||||
while (create_flag && i < regmatches[num].rm_eo)
|
||||
*string++ = *(current->data + i++);
|
||||
if (create_flag) {
|
||||
strncpy(string, current->data + current_x +
|
||||
regmatches[num].rm_so, i);
|
||||
string += i;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (create_flag)
|
||||
@@ -497,7 +499,7 @@ int replace_regexp(char *string, int create_flag)
|
||||
}
|
||||
|
||||
if (create_flag)
|
||||
*string = 0;
|
||||
*string = '\0';
|
||||
|
||||
return new_size;
|
||||
}
|
||||
@@ -539,7 +541,7 @@ char *replace_line(void)
|
||||
strcat(copy, last_replace);
|
||||
#ifdef HAVE_REGEX_H
|
||||
else
|
||||
(void) replace_regexp(copy + current_x, 1);
|
||||
replace_regexp(copy + current_x, 1);
|
||||
#endif
|
||||
|
||||
/* The tail of the original line */
|
||||
@@ -555,19 +557,13 @@ char *replace_line(void)
|
||||
return copy;
|
||||
}
|
||||
|
||||
void print_replaced(int num)
|
||||
{
|
||||
if (num > 1)
|
||||
statusbar(_("Replaced %d occurrences"), num);
|
||||
else if (num == 1)
|
||||
statusbar(_("Replaced 1 occurrence"));
|
||||
}
|
||||
|
||||
/* step through each replace word and prompt user before replacing word */
|
||||
/* Step through each replace word and prompt user before replacing
|
||||
* word. Return -1 if the string to replace isn't found at all.
|
||||
* Otherwise, return the number of replacements made. */
|
||||
int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
int *beginx, int wholewords, int *i)
|
||||
{
|
||||
int replaceall = 0, numreplaced = 0;
|
||||
int replaceall = 0, numreplaced = -1;
|
||||
|
||||
filestruct *fileptr = NULL;
|
||||
char *copy;
|
||||
@@ -590,17 +586,18 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
}
|
||||
}
|
||||
|
||||
if (ISSET(PICO_MODE) && answer[0] == '\0')
|
||||
answer = mallocstrcpy(answer, last_replace);
|
||||
|
||||
last_replace = mallocstrcpy(last_replace, answer);
|
||||
while (1) {
|
||||
/* Sweet optimization by Rocco here */
|
||||
fileptr = findnextstr(fileptr || replaceall || search_last_line,
|
||||
FALSE, begin, *beginx, prevanswer);
|
||||
|
||||
if (current->lineno <= edittop->lineno
|
||||
|| current->lineno >= editbot->lineno)
|
||||
edit_update(current, CENTER);
|
||||
|
||||
/* No more matches. Done! */
|
||||
if (!fileptr)
|
||||
if (fileptr == NULL)
|
||||
break;
|
||||
|
||||
/* Make sure only whole words are found */
|
||||
@@ -608,6 +605,9 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
continue;
|
||||
|
||||
/* If we're here, we've found the search string */
|
||||
if (numreplaced == -1)
|
||||
numreplaced = 0;
|
||||
|
||||
if (!replaceall) {
|
||||
curs_set(0);
|
||||
do_replace_highlight(TRUE, prevanswer);
|
||||
@@ -619,48 +619,56 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
}
|
||||
|
||||
if (*i > 0 || replaceall) { /* Yes, replace it!!!! */
|
||||
long length_change;
|
||||
size_t match_len;
|
||||
|
||||
if (*i == 2)
|
||||
replaceall = 1;
|
||||
|
||||
copy = replace_line();
|
||||
if (!copy) {
|
||||
if (copy == NULL) {
|
||||
statusbar(_("Replace failed: unknown subexpression!"));
|
||||
replace_abort();
|
||||
return 0;
|
||||
}
|
||||
|
||||
length_change = strlen(copy) - strlen(current->data);
|
||||
|
||||
#ifdef HAVE_REGEX_H
|
||||
if (ISSET(USE_REGEXP))
|
||||
match_len = regmatches[0].rm_eo - regmatches[0].rm_so;
|
||||
else
|
||||
#endif
|
||||
match_len = strlen(prevanswer);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (current == mark_beginbuf && mark_beginx > current_x) {
|
||||
if (mark_beginx < current_x + match_len)
|
||||
mark_beginx = current_x;
|
||||
else
|
||||
mark_beginx += length_change;
|
||||
}
|
||||
#endif
|
||||
|
||||
assert(0 <= match_len + length_change);
|
||||
if (current == begin && current_x <= *beginx) {
|
||||
if (*beginx < current_x + match_len)
|
||||
*beginx = current_x + match_len;
|
||||
*beginx += length_change;
|
||||
}
|
||||
|
||||
/* Set the cursor at the last character of the replacement
|
||||
* text, so searching will resume after the replacement text.
|
||||
* Note that current_x might be set to -1 here. */
|
||||
#ifndef NANO_SMALL
|
||||
if (!ISSET(REVERSE_SEARCH))
|
||||
#endif
|
||||
current_x += match_len + length_change - 1;
|
||||
|
||||
/* Cleanup */
|
||||
totsize -= strlen(current->data);
|
||||
totsize += length_change;
|
||||
free(current->data);
|
||||
current->data = copy;
|
||||
totsize += strlen(current->data);
|
||||
|
||||
if (!ISSET(REVERSE_SEARCH)) {
|
||||
/* Stop bug where we replace a substring of the
|
||||
replacement text */
|
||||
current_x += strlen(last_replace) - 1;
|
||||
|
||||
/* Adjust the original cursor position - COULD BE IMPROVED */
|
||||
if (search_last_line) {
|
||||
*beginx += strlen(last_replace) - strlen(last_search);
|
||||
|
||||
/* For strings that cross the search start/end boundary */
|
||||
|
||||
/* Don't go outside of allocated memory */
|
||||
if (*beginx < 1)
|
||||
*beginx = 1;
|
||||
}
|
||||
} else {
|
||||
if (current_x > 1)
|
||||
current_x--;
|
||||
|
||||
if (search_last_line) {
|
||||
*beginx += strlen(last_replace) - strlen(last_search);
|
||||
|
||||
if (*beginx > strlen(current->data))
|
||||
*beginx = strlen(current->data);
|
||||
}
|
||||
}
|
||||
|
||||
edit_refresh();
|
||||
set_modified();
|
||||
@@ -670,10 +678,14 @@ int do_replace_loop(const char *prevanswer, const filestruct *begin,
|
||||
break;
|
||||
}
|
||||
|
||||
/* If text has been added to the magicline, make a new magicline. */
|
||||
if (filebot->data[0] != '\0')
|
||||
new_magicline();
|
||||
|
||||
return numreplaced;
|
||||
}
|
||||
|
||||
/* Replace a string */
|
||||
/* Replace a string. */
|
||||
int do_replace(void)
|
||||
{
|
||||
int i, numreplaced, beginx;
|
||||
@@ -703,37 +715,36 @@ int do_replace(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Again, there was a previous string, but they deleted it and hit enter */
|
||||
if (!ISSET(PICO_MODE) && answer[0] == '\0') {
|
||||
statusbar(_("Replace Cancelled"));
|
||||
replace_abort();
|
||||
return 0;
|
||||
}
|
||||
#ifndef NANO_SMALL
|
||||
if (answer[0] != '\0')
|
||||
update_history(&search_history, answer);
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* If answer is now == "", then PICO_MODE is set. So, copy
|
||||
last_search into answer (and prevanswer)... */
|
||||
/* If answer is now == "", copy last_search into answer
|
||||
(and prevanswer)... */
|
||||
if (answer[0] == '\0')
|
||||
answer = mallocstrcpy(answer, last_search);
|
||||
else
|
||||
last_search = mallocstrcpy(last_search, answer);
|
||||
|
||||
prevanswer = mallocstrcpy(prevanswer, last_search);
|
||||
|
||||
if (ISSET(PICO_MODE) && last_replace[0] != '\0') {
|
||||
if (strlen(last_replace) > COLS / 3) {
|
||||
char *buf = charalloc(COLS / 3 + 3);
|
||||
#ifndef NANO_SMALL
|
||||
replace_history.current = (historytype *)&replace_history.next;
|
||||
last_replace = mallocstrcpy(last_replace, "");
|
||||
#endif
|
||||
|
||||
strncpy(buf, last_replace, COLS / 3 - 1);
|
||||
strcpy(buf + COLS / 3 - 1, "...");
|
||||
i = statusq(0, replace_list_2, "", _("Replace with [%s]"),
|
||||
buf);
|
||||
free(buf);
|
||||
} else
|
||||
i = statusq(0, replace_list_2, "", _("Replace with [%s]"),
|
||||
last_replace);
|
||||
} else
|
||||
i = statusq(0, replace_list_2, last_replace, _("Replace with"));
|
||||
i = statusq(0, replace_list_2, last_replace,
|
||||
#ifndef NANO_SMALL
|
||||
&replace_history,
|
||||
#endif
|
||||
_("Replace with"));
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (i == 0 && answer[0] != '\0')
|
||||
update_history(&replace_history, answer);
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
/* save where we are */
|
||||
begin = current;
|
||||
beginx = current_x;
|
||||
search_last_line = 0;
|
||||
@@ -745,7 +756,14 @@ int do_replace(void)
|
||||
current_x = beginx;
|
||||
renumber_all();
|
||||
edit_update(current, CENTER);
|
||||
print_replaced(numreplaced);
|
||||
|
||||
if (numreplaced >= 0)
|
||||
statusbar(P_("Replaced %d occurrence", "Replaced %d occurrences",
|
||||
numreplaced), numreplaced);
|
||||
else
|
||||
not_found_msg(prevanswer);
|
||||
|
||||
free(prevanswer);
|
||||
replace_abort();
|
||||
return 1;
|
||||
}
|
||||
@@ -759,8 +777,16 @@ void goto_abort(void)
|
||||
int do_gotoline(int line, int save_pos)
|
||||
{
|
||||
if (line <= 0) { /* Ask for it */
|
||||
if (statusq(0, goto_list, "", _("Enter line number"))) {
|
||||
int st = statusq(FALSE, goto_list, line != 0 ? answer : "",
|
||||
#ifndef NANO_SMALL
|
||||
NULL,
|
||||
#endif
|
||||
_("Enter line number"));
|
||||
|
||||
/* Cancel, or Enter with blank string. */
|
||||
if (st == -1 || st == -2)
|
||||
statusbar(_("Aborted"));
|
||||
if (st != 0) {
|
||||
goto_abort();
|
||||
return 0;
|
||||
}
|
||||
@@ -780,13 +806,12 @@ int do_gotoline(int line, int save_pos)
|
||||
|
||||
current_x = 0;
|
||||
|
||||
/* if save_pos is non-zero, don't change the cursor position when
|
||||
/* if save_pos is nonzero, don't change the cursor position when
|
||||
updating the edit window */
|
||||
if (save_pos)
|
||||
edit_update(current, NONE);
|
||||
else
|
||||
edit_update(current, CENTER);
|
||||
|
||||
placewewant = 0;
|
||||
goto_abort();
|
||||
return 1;
|
||||
@@ -822,12 +847,14 @@ int do_find_bracket(void)
|
||||
char ch_under_cursor, wanted_ch;
|
||||
const char *pos, *brackets = "([{<>}])";
|
||||
char regexp_pat[] = "[ ]";
|
||||
int offset, have_past_editbuff = 0, flagsave, current_x_save, count = 1;
|
||||
int offset, have_search_offscreen = 0, flagsave, current_x_save, count = 1;
|
||||
filestruct *current_save;
|
||||
|
||||
ch_under_cursor = current->data[current_x];
|
||||
|
||||
if ((!(pos = strchr(brackets, ch_under_cursor))) || (!((offset = pos - brackets) < 8))) {
|
||||
|
||||
/* if ((!(pos = strchr(brackets, ch_under_cursor))) || (!((offset = pos - brackets) < 8))) { */
|
||||
|
||||
if (((pos = strchr(brackets, ch_under_cursor)) == NULL) || (((offset = pos - brackets) < 8) == 0)) {
|
||||
statusbar(_("Not a bracket"));
|
||||
return 1;
|
||||
}
|
||||
@@ -841,7 +868,7 @@ int do_find_bracket(void)
|
||||
flagsave = flags;
|
||||
SET(USE_REGEXP);
|
||||
|
||||
/* apparent near redundancy with regexp_pat[] here is needed, [][] works, [[]] doesn't */
|
||||
/* apparent near redundancy with regexp_pat[] here is needed, [][] works, [[]] doesn't */
|
||||
|
||||
if (offset < (strlen(brackets) / 2)) { /* on a left bracket */
|
||||
regexp_pat[1] = wanted_ch;
|
||||
@@ -857,22 +884,28 @@ int do_find_bracket(void)
|
||||
|
||||
while (1) {
|
||||
search_last_line = 0;
|
||||
if (findnextstr(1, 1, current, current_x, regexp_pat)) {
|
||||
have_past_editbuff |= past_editbuff;
|
||||
if (current->data[current_x] == ch_under_cursor) /* found identical bracket */
|
||||
if (findnextstr(1, 1, current, current_x, regexp_pat) != NULL) {
|
||||
have_search_offscreen |= search_offscreen;
|
||||
|
||||
/* found identical bracket */
|
||||
if (current->data[current_x] == ch_under_cursor)
|
||||
count++;
|
||||
else { /* found complementary bracket */
|
||||
else {
|
||||
|
||||
/* found complementary bracket */
|
||||
if (!(--count)) {
|
||||
if (have_past_editbuff)
|
||||
if (have_search_offscreen)
|
||||
edit_update(current, CENTER);
|
||||
else
|
||||
update_line(current, current_x);
|
||||
placewewant = xplustabs();
|
||||
reset_cursor();
|
||||
break ;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else { /* didn't find either left or right bracket */
|
||||
} else {
|
||||
|
||||
/* didn't find either left or right bracket */
|
||||
statusbar(_("No matching bracket"));
|
||||
current_x = current_x_save;
|
||||
current = current_save;
|
||||
@@ -886,3 +919,128 @@ int do_find_bracket(void)
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/*
|
||||
* search and replace history list support functions
|
||||
*/
|
||||
|
||||
/* initialize search and replace history lists */
|
||||
void history_init(void)
|
||||
{
|
||||
search_history.next = (historytype *)&search_history.prev;
|
||||
search_history.prev = NULL;
|
||||
search_history.tail = (historytype *)&search_history.next;
|
||||
search_history.current = search_history.next;
|
||||
search_history.count = 0;
|
||||
search_history.len = 0;
|
||||
|
||||
replace_history.next = (historytype *)&replace_history.prev;
|
||||
replace_history.prev = NULL;
|
||||
replace_history.tail = (historytype *)&replace_history.next;
|
||||
replace_history.current = replace_history.next;
|
||||
replace_history.count = 0;
|
||||
replace_history.len = 0;
|
||||
}
|
||||
|
||||
/* find first node containing string *s in history list *h */
|
||||
historytype *find_node(historytype *h, char *s)
|
||||
{
|
||||
for (; h->next != NULL; h = h->next)
|
||||
if (strcmp(s, h->data) == 0)
|
||||
return h;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* remove node *r */
|
||||
void remove_node(historytype *r)
|
||||
{
|
||||
r->prev->next = r->next;
|
||||
r->next->prev = r->prev;
|
||||
free(r->data);
|
||||
free(r);
|
||||
}
|
||||
|
||||
/* add a node after node *h */
|
||||
void insert_node(historytype *h, const char *s)
|
||||
{
|
||||
historytype *a;
|
||||
|
||||
a = nmalloc(sizeof(historytype));
|
||||
a->next = h->next;
|
||||
a->prev = h->next->prev;
|
||||
h->next->prev = a;
|
||||
h->next = a;
|
||||
a->data = mallocstrcpy(NULL, s);
|
||||
}
|
||||
|
||||
/* update history list */
|
||||
void update_history(historyheadtype *h, char *s)
|
||||
{
|
||||
historytype *p;
|
||||
|
||||
if ((p = find_node(h->next, s)) != NULL) {
|
||||
if (p == h->next) /* catch delete and re-insert of
|
||||
same string in 1st node */
|
||||
goto up_hs;
|
||||
remove_node(p); /* delete identical older string */
|
||||
h->count--;
|
||||
}
|
||||
if (h->count == MAX_SEARCH_HISTORY) { /* list 'full', delete oldest */
|
||||
remove_node(h->tail);
|
||||
h->count--;
|
||||
}
|
||||
insert_node((historytype *)h, s);
|
||||
h->count++;
|
||||
SET(HISTORY_CHANGED);
|
||||
up_hs:
|
||||
h->current = h->next;
|
||||
}
|
||||
|
||||
/* return a pointer to either the next older history or NULL if no more */
|
||||
char *get_history_older(historyheadtype *h)
|
||||
{
|
||||
if (h->current->next != NULL) { /* any older entries? */
|
||||
h->current = h->current->next; /* yes */
|
||||
return h->current->data; /* return it */
|
||||
}
|
||||
return NULL; /* end of list */
|
||||
}
|
||||
|
||||
char *get_history_newer(historyheadtype *h)
|
||||
{
|
||||
if (h->current->prev != NULL) {
|
||||
h->current = h->current->prev;
|
||||
if (h->current->prev != NULL)
|
||||
return h->current->data;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get a completion */
|
||||
char *get_history_completion(historyheadtype *h, char *s)
|
||||
{
|
||||
historytype *p;
|
||||
|
||||
for (p = h->current->next; p->next != NULL; p = p->next) {
|
||||
if (strncmp(s, p->data, h->len) == 0 && strlen(p->data) != h->len) {
|
||||
h->current = p;
|
||||
return p->data;
|
||||
}
|
||||
}
|
||||
h->current = (historytype*)h;
|
||||
null_at(&s, h->len);
|
||||
return s;
|
||||
}
|
||||
|
||||
/* free a history list */
|
||||
void free_history(historyheadtype *h)
|
||||
{
|
||||
historytype *p, *n;
|
||||
|
||||
for (p = h->next; (n = p->next); p = n)
|
||||
remove_node(p);
|
||||
}
|
||||
|
||||
/* end of history support functions */
|
||||
#endif /* !NANO_SMALL */
|
||||
|
||||
5992
texinfo.tex
5992
texinfo.tex
File diff suppressed because it is too large
Load Diff
137
utils.c
137
utils.c
@@ -2,7 +2,7 @@
|
||||
/**************************************************************************
|
||||
* utils.c *
|
||||
* *
|
||||
* Copyright (C) 1999-2002 Chris Allegretta *
|
||||
* 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) *
|
||||
@@ -30,19 +30,10 @@
|
||||
#include "proto.h"
|
||||
#include "nano.h"
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
#include <libintl.h>
|
||||
#define _(string) gettext(string)
|
||||
#else
|
||||
#define _(string) (string)
|
||||
#endif
|
||||
|
||||
int is_cntrl_char(int c)
|
||||
{
|
||||
if (iscntrl(c) || ((c & 127) != 127 && iscntrl(c & 127)))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
return (-128 <= c && c < -96) || (0 <= c && c < 32) ||
|
||||
(127 <= c && c < 160);
|
||||
}
|
||||
|
||||
int num_of_digits(int n)
|
||||
@@ -63,8 +54,8 @@ int num_of_digits(int n)
|
||||
/* Fix the memory allocation for a string. */
|
||||
void align(char **strp)
|
||||
{
|
||||
assert(strp != NULL);
|
||||
*strp = nrealloc(*strp, strlen(*strp) + 1);
|
||||
if (strp != NULL)
|
||||
*strp = nrealloc(*strp, strlen(*strp) + 1);
|
||||
}
|
||||
|
||||
/* Null a string at a certain index and align it. */
|
||||
@@ -127,70 +118,78 @@ const char *revstristr(const char *haystack, const char *needle,
|
||||
#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). */
|
||||
* use memory allocation to do a simple search (yuck). */
|
||||
const char *stristr(const char *haystack, const char *needle)
|
||||
{
|
||||
const char *p, *q;
|
||||
|
||||
if (!haystack)
|
||||
if (haystack == NULL)
|
||||
return NULL;
|
||||
if (!needle)
|
||||
return (haystack);
|
||||
if (needle == NULL)
|
||||
return haystack;
|
||||
|
||||
while (*(p = haystack)) {
|
||||
for (q = needle; *p && *q && tolower(*p) == tolower(*q); p++, q++)
|
||||
while (*(p = haystack) != '\0') {
|
||||
for (q = needle; *p != 0 && *q != 0 && tolower(*p) == tolower(*q); p++, q++)
|
||||
;
|
||||
if (!*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)) {
|
||||
if (!ISSET(REVERSE_SEARCH)) {
|
||||
if (!regexec(&search_regexp, haystack, 10, regmatches, (line_pos > 0) ? REG_NOTBOL : 0))
|
||||
return haystack + regmatches[0].rm_so;
|
||||
}
|
||||
#ifndef NANO_SMALL
|
||||
else {
|
||||
const char *i, *j;
|
||||
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;
|
||||
|
||||
/* do a quick search forward first */
|
||||
if (!regexec(&search_regexp, haystack, 10, regmatches, 0)) {
|
||||
/* there's a match somewhere in the line - now search for it backwards, much slower */
|
||||
for (i = rev_start; i >= haystack; --i) {
|
||||
if (!regexec(&search_regexp, i, 10, regmatches, (i > haystack) ? REG_NOTBOL : 0)) {
|
||||
j = i + regmatches[0].rm_so;
|
||||
if (j <= rev_start)
|
||||
return j;
|
||||
}
|
||||
}
|
||||
/* 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;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
#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);
|
||||
else
|
||||
return strstr(haystack, needle);
|
||||
} else if (ISSET(REVERSE_SEARCH))
|
||||
return revstristr(haystack, needle, rev_start);
|
||||
#endif
|
||||
return stristr(haystack, needle);
|
||||
#ifndef NANO_SMALL
|
||||
}
|
||||
#endif
|
||||
return stristr(haystack, needle);
|
||||
}
|
||||
|
||||
/* This is a wrapper for the perror function. The wrapper takes care of
|
||||
@@ -198,7 +197,7 @@ const char *strstrwrapper(const char *haystack, const char *needle,
|
||||
* screen. Note that nperror causes the window to flicker once. */
|
||||
void nperror(const char *s)
|
||||
{
|
||||
/* leave ncurses mode, go to the terminal */
|
||||
/* leave ncurses mode, go to the terminal */
|
||||
if (endwin() != ERR) {
|
||||
perror(s); /* print the error */
|
||||
total_refresh(); /* return to ncurses and repaint */
|
||||
@@ -208,34 +207,20 @@ void nperror(const char *s)
|
||||
/* Thanks BG, many ppl have been asking for this... */
|
||||
void *nmalloc(size_t howmuch)
|
||||
{
|
||||
void *r;
|
||||
void *r = malloc(howmuch);
|
||||
|
||||
/* Panic save? */
|
||||
|
||||
if (!(r = malloc(howmuch)))
|
||||
die(_("nano: malloc: out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/* We're going to need this too - Hopefully this will minimize
|
||||
the transition cost of moving to the appropriate function. */
|
||||
char *charalloc(size_t howmuch)
|
||||
{
|
||||
char *r = (char *)malloc(howmuch * sizeof(char));
|
||||
|
||||
if (r == NULL)
|
||||
die(_("nano: malloc: out of memory!"));
|
||||
if (r == NULL && howmuch != 0)
|
||||
die(_("nano is out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void *nrealloc(void *ptr, size_t howmuch)
|
||||
{
|
||||
void *r;
|
||||
void *r = realloc(ptr, howmuch);
|
||||
|
||||
if (!(r = realloc(ptr, howmuch)))
|
||||
die(_("nano: realloc: out of memory!"));
|
||||
if (r == NULL && howmuch != 0)
|
||||
die(_("nano is out of memory!"));
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -247,10 +232,10 @@ char *mallocstrcpy(char *dest, const char *src)
|
||||
if (src == dest)
|
||||
return dest;
|
||||
|
||||
if (dest)
|
||||
if (dest != NULL)
|
||||
free(dest);
|
||||
|
||||
if (!src)
|
||||
if (src == NULL)
|
||||
return NULL;
|
||||
|
||||
dest = charalloc(strlen(src) + 1);
|
||||
@@ -299,7 +284,7 @@ int check_wildcard_match(const char *text, const char *pattern)
|
||||
retrypat = NULL;
|
||||
retrytext = NULL;
|
||||
|
||||
while (*text || *pattern) {
|
||||
while (*text != '\0' || *pattern != '\0') {
|
||||
ch = *pattern++;
|
||||
|
||||
switch (ch) {
|
||||
@@ -353,12 +338,12 @@ int check_wildcard_match(const char *text, const char *pattern)
|
||||
|
||||
default:
|
||||
if (*text == ch) {
|
||||
if (*text)
|
||||
if (*text != '\0')
|
||||
text++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*text) {
|
||||
if (*text != '\0') {
|
||||
pattern = retrypat;
|
||||
text = ++retrytext;
|
||||
break;
|
||||
@@ -367,7 +352,7 @@ int check_wildcard_match(const char *text, const char *pattern)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!pattern)
|
||||
if (pattern == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user