Added --disable-justify and --disable-spell options, code cleanups
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@355 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
09a8084943
commit
ff269f8873
21
ChangeLog
21
ChangeLog
|
@ -1,17 +1,25 @@
|
||||||
CVS code -
|
CVS code -
|
||||||
- General
|
- General
|
||||||
- Added configure argument --disable-tabcomp. Affects
|
|
||||||
configure.in, configure, bottom of files.c and write_file,
|
|
||||||
utils.c:check_wildcard_match() and winio.c:nanogettsr().
|
|
||||||
- Username tab completion code, and cleaned up existing tabcomp
|
- Username tab completion code, and cleaned up existing tabcomp
|
||||||
code. New functions real_dir_from_tide(), append_slash_if_dir(),
|
code. New functions real_dir_from_tide(), append_slash_if_dir(),
|
||||||
username_tab_completion is more than a stub now =-).
|
username_tab_completion is more than a stub now =-).
|
||||||
- New options --enable-extra. New code in nano.c:version() to
|
|
||||||
print out various options from ./configure, function do_credits().
|
|
||||||
- Ignore key sequence 543 & 545, right control and alt keys in
|
- Ignore key sequence 543 & 545, right control and alt keys in
|
||||||
windows. Affects main() and winio.c:nanogetstr().
|
windows. Affects main() and winio.c:nanogetstr().
|
||||||
- Took out help from spell_list and changed SPELL_LIST_LEN to 1.
|
- Took out help from spell_list and changed SPELL_LIST_LEN to 1.
|
||||||
Is using a spell checker THAT difficult? =-)
|
Is using a spell checker THAT difficult? =-)
|
||||||
|
- New function nano_disabled_msg(), to alert that certain
|
||||||
|
functions have been disabled, similaer to nano_tiny feature.
|
||||||
|
- New configure options:
|
||||||
|
- Added configure argument --disable-tabcomp. Affects
|
||||||
|
bottom of files.c and write_file, utils.c:check_wildcard_match()
|
||||||
|
and winio.c:nanogettsr().
|
||||||
|
- New options --enable-extra. New code in nano.c:version() to
|
||||||
|
print out various options from ./configure, function do_credits().
|
||||||
|
- Added --disable-spell option for those who want to just disable
|
||||||
|
the spell check feature. Affects the spellinf fucntions
|
||||||
|
do_spell, do_int_speller and do_alt_speller.
|
||||||
|
- Added --disable-justify to get rid of the justify function.
|
||||||
|
Affects do_justify() (not surprisingly).
|
||||||
- files.c:
|
- files.c:
|
||||||
write_file()
|
write_file()
|
||||||
- Unsetting modified on temp files bug fixed (Rocco Corsi).
|
- Unsetting modified on temp files bug fixed (Rocco Corsi).
|
||||||
|
@ -39,6 +47,9 @@ CVS code -
|
||||||
replacement" question, and not caring about the replace loop
|
replacement" question, and not caring about the replace loop
|
||||||
return value. That way the user can get out of the replace loop
|
return value. That way the user can get out of the replace loop
|
||||||
and continue spell checking (very important to me anyway).
|
and continue spell checking (very important to me anyway).
|
||||||
|
version()
|
||||||
|
- Took out huge check for the various --disabled macros,
|
||||||
|
eventually there will be too many to reasonably check for.
|
||||||
- search.c:
|
- search.c:
|
||||||
do_replace_hilight()
|
do_replace_hilight()
|
||||||
- New function, displays the currently selected word as hilighted
|
- New function, displays the currently selected word as hilighted
|
||||||
|
|
|
@ -29,3 +29,11 @@
|
||||||
|
|
||||||
/* Define to disable the tab completion code Chris worked so hard on! */
|
/* Define to disable the tab completion code Chris worked so hard on! */
|
||||||
#undef DISABLE_TABCOMP
|
#undef DISABLE_TABCOMP
|
||||||
|
|
||||||
|
/* Define this to disable the justify routine */
|
||||||
|
#undef DISABLE_JUSTIFY
|
||||||
|
|
||||||
|
/* Define this to disable the use(full|less) spelling functions */
|
||||||
|
#undef DISABLE_SPELL
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,12 @@
|
||||||
/* Define to disable the tab completion code Chris worked so hard on! */
|
/* Define to disable the tab completion code Chris worked so hard on! */
|
||||||
#undef DISABLE_TABCOMP
|
#undef DISABLE_TABCOMP
|
||||||
|
|
||||||
|
/* Define this to disable the justify routine */
|
||||||
|
#undef DISABLE_JUSTIFY
|
||||||
|
|
||||||
|
/* Define this to disable the use(full|less) spelling functions */
|
||||||
|
#undef DISABLE_SPELL
|
||||||
|
|
||||||
/* Define if you have the __argz_count function. */
|
/* Define if you have the __argz_count function. */
|
||||||
#undef HAVE___ARGZ_COUNT
|
#undef HAVE___ARGZ_COUNT
|
||||||
|
|
||||||
|
|
12
configure.in
12
configure.in
|
@ -33,6 +33,18 @@ AC_ARG_ENABLE(tabcomp,
|
||||||
AC_DEFINE(DISABLE_TABCOMP)
|
AC_DEFINE(DISABLE_TABCOMP)
|
||||||
fi])
|
fi])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(justify,
|
||||||
|
[ --disable-justify Disable justify/unjustify function],
|
||||||
|
[if test x$enableval != xyes; then
|
||||||
|
AC_DEFINE(DISABLE_JUSTIFY)
|
||||||
|
fi])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(spell,
|
||||||
|
[ --disable-speller Disables spell checker function],
|
||||||
|
[if test x$enableval != xyes; then
|
||||||
|
AC_DEFINE(DISABLE_SPELL)
|
||||||
|
fi])
|
||||||
|
|
||||||
AC_MSG_CHECKING(whether to use slang)
|
AC_MSG_CHECKING(whether to use slang)
|
||||||
CURSES_LIB_NAME=""
|
CURSES_LIB_NAME=""
|
||||||
AC_ARG_WITH(slang,
|
AC_ARG_WITH(slang,
|
||||||
|
|
39
nano.c
39
nano.c
|
@ -418,10 +418,8 @@ void version(void)
|
||||||
VERSION, __TIME__, __DATE__);
|
VERSION, __TIME__, __DATE__);
|
||||||
printf(_
|
printf(_
|
||||||
(" Email: nano@nano-editor.org Web: http://www.nano-editor.org"));
|
(" Email: nano@nano-editor.org Web: http://www.nano-editor.org"));
|
||||||
|
|
||||||
#if defined(NANO_SMALL) || defined(NANO_EXTRA) || defined(DISABLE_TABCOMP) || defined(USE_SLANG)
|
|
||||||
printf(_("\n Compiled options:"));
|
printf(_("\n Compiled options:"));
|
||||||
#endif
|
|
||||||
#ifdef NANO_SMALL
|
#ifdef NANO_SMALL
|
||||||
printf(" --enable-tiny");
|
printf(" --enable-tiny");
|
||||||
#endif
|
#endif
|
||||||
|
@ -431,6 +429,12 @@ void version(void)
|
||||||
#ifdef DISABLE_TABCOMP
|
#ifdef DISABLE_TABCOMP
|
||||||
printf(" --disable-tabcomp");
|
printf(" --disable-tabcomp");
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef DISABLE_JUSTIFY
|
||||||
|
printf(" --disable-justify");
|
||||||
|
#endif
|
||||||
|
#ifdef DISABLE_SPELL
|
||||||
|
printf(" --disable-spell");
|
||||||
|
#endif
|
||||||
#ifdef USE_SLANG
|
#ifdef USE_SLANG
|
||||||
printf(" --with-slang");
|
printf(" --with-slang");
|
||||||
#endif
|
#endif
|
||||||
|
@ -500,6 +504,11 @@ void nano_small_msg(void)
|
||||||
statusbar("Sorry, this function not available with nano-tiny option");
|
statusbar("Sorry, this function not available with nano-tiny option");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nano_disabled_msg(void)
|
||||||
|
{
|
||||||
|
statusbar("Sorry, support for this function has been disabled");
|
||||||
|
}
|
||||||
|
|
||||||
/* The user typed a printable character; add it to the edit buffer */
|
/* The user typed a printable character; add it to the edit buffer */
|
||||||
void do_char(char ch)
|
void do_char(char ch)
|
||||||
{
|
{
|
||||||
|
@ -1069,7 +1078,7 @@ void wrap_reset(void)
|
||||||
UNSET(SAMELINEWRAP);
|
UNSET(SAMELINEWRAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && !defined(DISABLE_SPELL)
|
||||||
|
|
||||||
int do_int_spell_fix(char *word)
|
int do_int_spell_fix(char *word)
|
||||||
{
|
{
|
||||||
|
@ -1137,7 +1146,7 @@ int do_int_spell_fix(char *word)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && !defined(DISABLE_SPELL)
|
||||||
|
|
||||||
/* Integrated spell checking using 'spell' program */
|
/* Integrated spell checking using 'spell' program */
|
||||||
int do_int_speller(char *tempfile_name)
|
int do_int_speller(char *tempfile_name)
|
||||||
|
@ -1267,7 +1276,7 @@ int do_int_speller(char *tempfile_name)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && !defined(DISABLE_SPELL)
|
||||||
|
|
||||||
/* External spell checking */
|
/* External spell checking */
|
||||||
int do_alt_speller(char *file_name)
|
int do_alt_speller(char *file_name)
|
||||||
|
@ -1319,9 +1328,12 @@ int do_alt_speller(char *file_name)
|
||||||
int do_spell(void)
|
int do_spell(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef NANO_SMALL
|
#if defined(NANO_SMALL)
|
||||||
nano_small_msg();
|
nano_small_msg();
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
|
#elif defined(DISABLE_SPELL)
|
||||||
|
nano_disabled_msg();
|
||||||
|
return (TRUE);
|
||||||
#else
|
#else
|
||||||
char *temp;
|
char *temp;
|
||||||
int spell_res;
|
int spell_res;
|
||||||
|
@ -1623,7 +1635,7 @@ int do_tab(void)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#if !defined(NANO_SMALL) && !defined(DISABLE_JUSTIFY)
|
||||||
int empty_line(const char *data)
|
int empty_line(const char *data)
|
||||||
{
|
{
|
||||||
while (*data) {
|
while (*data) {
|
||||||
|
@ -1675,7 +1687,13 @@ void justify_format(char *data)
|
||||||
|
|
||||||
int do_justify(void)
|
int do_justify(void)
|
||||||
{
|
{
|
||||||
#ifndef NANO_SMALL
|
#ifdef NANO_SMALL
|
||||||
|
nano_small_msg();
|
||||||
|
return 1;
|
||||||
|
#elif defined(DISABLE_JUSTIFY)
|
||||||
|
nano_disabled_msg();
|
||||||
|
return 1;
|
||||||
|
#else
|
||||||
int slen = 0; /* length of combined lines on one line. */
|
int slen = 0; /* length of combined lines on one line. */
|
||||||
int initial_y, kbinput;
|
int initial_y, kbinput;
|
||||||
filestruct *initial = NULL, *tmpjust = NULL, *cutbak, *tmptop, *tmpbot;
|
filestruct *initial = NULL, *tmpjust = NULL, *cutbak, *tmptop, *tmpbot;
|
||||||
|
@ -1851,9 +1869,6 @@ int do_justify(void)
|
||||||
free_filestruct(cutbuffer);
|
free_filestruct(cutbuffer);
|
||||||
cutbuffer = cutbak;
|
cutbuffer = cutbak;
|
||||||
|
|
||||||
return 1;
|
|
||||||
#else
|
|
||||||
nano_small_msg();
|
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
62
po/nano.pot
62
po/nano.pot
|
@ -6,7 +6,7 @@
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: PACKAGE VERSION\n"
|
"Project-Id-Version: PACKAGE VERSION\n"
|
||||||
"POT-Creation-Date: 2000-11-29 21:22-0500\n"
|
"POT-Creation-Date: 2000-12-01 13:36-0500\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||||
|
@ -55,7 +55,7 @@ msgstr ""
|
||||||
msgid "File to insert [from ./] "
|
msgid "File to insert [from ./] "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: files.c:284 files.c:309 files.c:517 nano.c:1381
|
#: files.c:284 files.c:309 files.c:517 nano.c:1393
|
||||||
msgid "Cancelled"
|
msgid "Cancelled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
@ -613,130 +613,130 @@ msgstr ""
|
||||||
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org"
|
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:423
|
#: nano.c:421
|
||||||
msgid ""
|
msgid ""
|
||||||
"\n"
|
"\n"
|
||||||
" Compiled options:"
|
" Compiled options:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:473
|
#: nano.c:477
|
||||||
msgid "Mark Set"
|
msgid "Mark Set"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:478
|
#: nano.c:482
|
||||||
msgid "Mark UNset"
|
msgid "Mark UNset"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:905
|
#: nano.c:914
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "check_wrap called with inptr->data=\"%s\"\n"
|
msgid "check_wrap called with inptr->data=\"%s\"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:956
|
#: nano.c:965
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "current->data now = \"%s\"\n"
|
msgid "current->data now = \"%s\"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1009
|
#: nano.c:1018
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "After, data = \"%s\"\n"
|
msgid "After, data = \"%s\"\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1109
|
#: nano.c:1118
|
||||||
msgid "Edit a replacement"
|
msgid "Edit a replacement"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1330
|
#: nano.c:1342
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "Could not create a temporary filename: %s"
|
msgid "Could not create a temporary filename: %s"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1346
|
#: nano.c:1358
|
||||||
msgid "Finished checking spelling"
|
msgid "Finished checking spelling"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1348
|
#: nano.c:1360
|
||||||
msgid "Spell checking failed"
|
msgid "Spell checking failed"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1368
|
#: nano.c:1380
|
||||||
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
|
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1531
|
#: nano.c:1543
|
||||||
msgid "Cannot resize top win"
|
msgid "Cannot resize top win"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1533
|
#: nano.c:1545
|
||||||
msgid "Cannot move top win"
|
msgid "Cannot move top win"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1535
|
#: nano.c:1547
|
||||||
msgid "Cannot resize edit win"
|
msgid "Cannot resize edit win"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1537
|
#: nano.c:1549
|
||||||
msgid "Cannot move edit win"
|
msgid "Cannot move edit win"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1539
|
#: nano.c:1551
|
||||||
msgid "Cannot resize bottom win"
|
msgid "Cannot resize bottom win"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1541
|
#: nano.c:1553
|
||||||
msgid "Cannot move bottom win"
|
msgid "Cannot move bottom win"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1823
|
#: nano.c:1841
|
||||||
msgid "Can now UnJustify!"
|
msgid "Can now UnJustify!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1921
|
#: nano.c:1936
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "%s enable/disable"
|
msgid "%s enable/disable"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1933
|
#: nano.c:1948
|
||||||
msgid "enabled"
|
msgid "enabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:1934
|
#: nano.c:1949
|
||||||
msgid "disabled"
|
msgid "disabled"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2164
|
#: nano.c:2179
|
||||||
msgid "Main: set up windows\n"
|
msgid "Main: set up windows\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2177
|
#: nano.c:2192
|
||||||
msgid "Main: bottom win\n"
|
msgid "Main: bottom win\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2183
|
#: nano.c:2198
|
||||||
msgid "Main: open file\n"
|
msgid "Main: open file\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2220
|
#: nano.c:2235
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "I got Alt-O-%c! (%d)\n"
|
msgid "I got Alt-O-%c! (%d)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2242
|
#: nano.c:2257
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "I got Alt-[-1-%c! (%d)\n"
|
msgid "I got Alt-[-1-%c! (%d)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2275
|
#: nano.c:2290
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "I got Alt-[-2-%c! (%d)\n"
|
msgid "I got Alt-[-2-%c! (%d)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2323
|
#: nano.c:2338
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "I got Alt-[-%c! (%d)\n"
|
msgid "I got Alt-[-%c! (%d)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: nano.c:2349
|
#: nano.c:2364
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "I got Alt-%c! (%d)\n"
|
msgid "I got Alt-%c! (%d)\n"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
Loading…
Reference in New Issue