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-d3aeb78583b8
master
Chris Allegretta 2000-12-01 18:46:01 +00:00
parent 09a8084943
commit ff269f8873
7 changed files with 306 additions and 226 deletions

View File

@ -1,17 +1,25 @@
CVS code -
- 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
code. New functions real_dir_from_tide(), append_slash_if_dir(),
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
windows. Affects main() and winio.c:nanogetstr().
- Took out help from spell_list and changed SPELL_LIST_LEN to 1.
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:
write_file()
- Unsetting modified on temp files bug fixed (Rocco Corsi).
@ -39,6 +47,9 @@ CVS code -
replacement" question, and not caring about 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).
version()
- Took out huge check for the various --disabled macros,
eventually there will be too many to reasonably check for.
- search.c:
do_replace_hilight()
- New function, displays the currently selected word as hilighted

View File

@ -29,3 +29,11 @@
/* Define to disable the tab completion code Chris worked so hard on! */
#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

View File

@ -82,6 +82,12 @@
/* Define to disable the tab completion code Chris worked so hard on! */
#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. */
#undef HAVE___ARGZ_COUNT

384
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -33,6 +33,18 @@ AC_ARG_ENABLE(tabcomp,
AC_DEFINE(DISABLE_TABCOMP)
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)
CURSES_LIB_NAME=""
AC_ARG_WITH(slang,

39
nano.c
View File

@ -418,10 +418,8 @@ void version(void)
VERSION, __TIME__, __DATE__);
printf(_
(" 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:"));
#endif
#ifdef NANO_SMALL
printf(" --enable-tiny");
#endif
@ -431,6 +429,12 @@ void version(void)
#ifdef DISABLE_TABCOMP
printf(" --disable-tabcomp");
#endif
#ifdef DISABLE_JUSTIFY
printf(" --disable-justify");
#endif
#ifdef DISABLE_SPELL
printf(" --disable-spell");
#endif
#ifdef USE_SLANG
printf(" --with-slang");
#endif
@ -500,6 +504,11 @@ void nano_small_msg(void)
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 */
void do_char(char ch)
{
@ -1069,7 +1078,7 @@ void wrap_reset(void)
UNSET(SAMELINEWRAP);
}
#ifndef NANO_SMALL
#if !defined(NANO_SMALL) && !defined(DISABLE_SPELL)
int do_int_spell_fix(char *word)
{
@ -1137,7 +1146,7 @@ int do_int_spell_fix(char *word)
}
#endif
#ifndef NANO_SMALL
#if !defined(NANO_SMALL) && !defined(DISABLE_SPELL)
/* Integrated spell checking using 'spell' program */
int do_int_speller(char *tempfile_name)
@ -1267,7 +1276,7 @@ int do_int_speller(char *tempfile_name)
}
#endif
#ifndef NANO_SMALL
#if !defined(NANO_SMALL) && !defined(DISABLE_SPELL)
/* External spell checking */
int do_alt_speller(char *file_name)
@ -1319,9 +1328,12 @@ int do_alt_speller(char *file_name)
int do_spell(void)
{
#ifdef NANO_SMALL
#if defined(NANO_SMALL)
nano_small_msg();
return (TRUE);
#elif defined(DISABLE_SPELL)
nano_disabled_msg();
return (TRUE);
#else
char *temp;
int spell_res;
@ -1623,7 +1635,7 @@ int do_tab(void)
return 1;
}
#ifndef NANO_SMALL
#if !defined(NANO_SMALL) && !defined(DISABLE_JUSTIFY)
int empty_line(const char *data)
{
while (*data) {
@ -1675,7 +1687,13 @@ void justify_format(char *data)
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 initial_y, kbinput;
filestruct *initial = NULL, *tmpjust = NULL, *cutbak, *tmptop, *tmpbot;
@ -1851,9 +1869,6 @@ int do_justify(void)
free_filestruct(cutbuffer);
cutbuffer = cutbak;
return 1;
#else
nano_small_msg();
return 1;
#endif
}

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"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"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -55,7 +55,7 @@ msgstr ""
msgid "File to insert [from ./] "
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"
msgstr ""
@ -613,130 +613,130 @@ msgstr ""
msgid " Email: nano@nano-editor.org\tWeb: http://www.nano-editor.org"
msgstr ""
#: nano.c:423
#: nano.c:421
msgid ""
"\n"
" Compiled options:"
msgstr ""
#: nano.c:473
#: nano.c:477
msgid "Mark Set"
msgstr ""
#: nano.c:478
#: nano.c:482
msgid "Mark UNset"
msgstr ""
#: nano.c:905
#: nano.c:914
#, c-format
msgid "check_wrap called with inptr->data=\"%s\"\n"
msgstr ""
#: nano.c:956
#: nano.c:965
#, c-format
msgid "current->data now = \"%s\"\n"
msgstr ""
#: nano.c:1009
#: nano.c:1018
#, c-format
msgid "After, data = \"%s\"\n"
msgstr ""
#: nano.c:1109
#: nano.c:1118
msgid "Edit a replacement"
msgstr ""
#: nano.c:1330
#: nano.c:1342
#, c-format
msgid "Could not create a temporary filename: %s"
msgstr ""
#: nano.c:1346
#: nano.c:1358
msgid "Finished checking spelling"
msgstr ""
#: nano.c:1348
#: nano.c:1360
msgid "Spell checking failed"
msgstr ""
#: nano.c:1368
#: nano.c:1380
msgid "Save modified buffer (ANSWERING \"No\" WILL DESTROY CHANGES) ? "
msgstr ""
#: nano.c:1531
#: nano.c:1543
msgid "Cannot resize top win"
msgstr ""
#: nano.c:1533
#: nano.c:1545
msgid "Cannot move top win"
msgstr ""
#: nano.c:1535
#: nano.c:1547
msgid "Cannot resize edit win"
msgstr ""
#: nano.c:1537
#: nano.c:1549
msgid "Cannot move edit win"
msgstr ""
#: nano.c:1539
#: nano.c:1551
msgid "Cannot resize bottom win"
msgstr ""
#: nano.c:1541
#: nano.c:1553
msgid "Cannot move bottom win"
msgstr ""
#: nano.c:1823
#: nano.c:1841
msgid "Can now UnJustify!"
msgstr ""
#: nano.c:1921
#: nano.c:1936
#, c-format
msgid "%s enable/disable"
msgstr ""
#: nano.c:1933
#: nano.c:1948
msgid "enabled"
msgstr ""
#: nano.c:1934
#: nano.c:1949
msgid "disabled"
msgstr ""
#: nano.c:2164
#: nano.c:2179
msgid "Main: set up windows\n"
msgstr ""
#: nano.c:2177
#: nano.c:2192
msgid "Main: bottom win\n"
msgstr ""
#: nano.c:2183
#: nano.c:2198
msgid "Main: open file\n"
msgstr ""
#: nano.c:2220
#: nano.c:2235
#, c-format
msgid "I got Alt-O-%c! (%d)\n"
msgstr ""
#: nano.c:2242
#: nano.c:2257
#, c-format
msgid "I got Alt-[-1-%c! (%d)\n"
msgstr ""
#: nano.c:2275
#: nano.c:2290
#, c-format
msgid "I got Alt-[-2-%c! (%d)\n"
msgstr ""
#: nano.c:2323
#: nano.c:2338
#, c-format
msgid "I got Alt-[-%c! (%d)\n"
msgstr ""
#: nano.c:2349
#: nano.c:2364
#, c-format
msgid "I got Alt-%c! (%d)\n"
msgstr ""