Added --disable-wrapping configure flag

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@583 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2001-04-02 05:36:08 +00:00
parent a0238ed022
commit cef7fbb41a
9 changed files with 250 additions and 187 deletions

View File

@ -1,4 +1,10 @@
CVS - CVS -
- General:
- added configure option --disable-wrapping. Does what it says,
no wrapping or checks are done. Separate from --enable-tiny,
some may want a barebones Pico clone that does wrap text.
Affects configure, nano.c:do_char() and check_wrap() obviously,
version(), and do_char().
- aclocal.m4: - aclocal.m4:
- Minor patch for intl check (really this time) (Albert Chin) - Minor patch for intl check (really this time) (Albert Chin)
- faq.html: - faq.html:

View File

@ -47,3 +47,7 @@
/* Define this to disable the built-in (crappy) file browser */ /* Define this to disable the built-in (crappy) file browser */
#undef DISABLE_BROWSER #undef DISABLE_BROWSER
/* Define this to disable any and all text wrapping */
#undef DISABLE_WRAPPING

5
aclocal.m4 vendored
View File

@ -370,9 +370,10 @@ AC_DEFUN(AM_WITH_NLS,
if test "$gt_cv_func_gettext_libc" != "yes"; then if test "$gt_cv_func_gettext_libc" != "yes"; then
AC_CHECK_LIB(intl, bindtextdomain, AC_CHECK_LIB(intl, bindtextdomain,
[AC_CACHE_VAL(gt_cv_func_gettext_libintl, [AC_CACHE_CHECK([for gettext in libintl],
gt_cv_func_gettext_libintl,
[AC_CHECK_LIB(intl, gettext, [AC_CHECK_LIB(intl, gettext,
[gt_cv_func_gettext_libintl=yes; LIBS="$LIBS -lintl"], gt_cv_func_gettext_libintl=yes,
gt_cv_func_gettext_libintl=no)], gt_cv_func_gettext_libintl=no)],
gt_cv_func_gettext_libintl=no)]) gt_cv_func_gettext_libintl=no)])
fi fi

View File

@ -100,6 +100,9 @@
/* Define this to disable the built-in (crappy) file browser */ /* Define this to disable the built-in (crappy) file browser */
#undef DISABLE_BROWSER #undef DISABLE_BROWSER
/* Define this to disable any and all text wrapping */
#undef DISABLE_WRAPPING
/* Define if you have the __argz_count function. */ /* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT #undef HAVE___ARGZ_COUNT

387
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -62,6 +62,12 @@ AC_ARG_ENABLE(browser,
AC_DEFINE(DISABLE_BROWSER) AC_DEFINE(DISABLE_BROWSER)
fi]) fi])
AC_ARG_ENABLE(wrapping,
[ --disable-wrapping Disables all wrapping of text (and -w flag)],
[if test x$enableval != xyes; then
AC_DEFINE(DISABLE_WRAPPING)
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,

17
nano.c
View File

@ -395,8 +395,10 @@ void usage(void)
(" -t --tempfile Auto save on exit, don't prompt\n")); (" -t --tempfile Auto save on exit, don't prompt\n"));
printf(_ printf(_
(" -v --view View (read only) mode\n")); (" -v --view View (read only) mode\n"));
#ifndef DISABLE_WRAPPING
printf(_ printf(_
(" -w --nowrap Don't wrap long lines\n")); (" -w --nowrap Don't wrap long lines\n"));
#endif
printf(_ printf(_
(" -x --nohelp Don't show help window\n")); (" -x --nohelp Don't show help window\n"));
printf(_ printf(_
@ -429,7 +431,9 @@ void usage(void)
#endif #endif
printf(_(" -t Auto save on exit, don't prompt\n")); printf(_(" -t Auto save on exit, don't prompt\n"));
printf(_(" -v View (read only) mode\n")); printf(_(" -v View (read only) mode\n"));
#ifndef DISABLE_WRAPPING
printf(_(" -w Don't wrap long lines\n")); printf(_(" -w Don't wrap long lines\n"));
#endif
printf(_(" -x Don't show help window\n")); printf(_(" -x Don't show help window\n"));
printf(_(" -z Enable suspend\n")); printf(_(" -z Enable suspend\n"));
printf(_(" +LINE Start at line number LINE\n")); printf(_(" +LINE Start at line number LINE\n"));
@ -469,6 +473,9 @@ void version(void)
#endif #endif
#endif #endif
#ifdef DISABLE_WRAPPING
printf(" --disable-wrapping");
#endif
#ifdef USE_SLANG #ifdef USE_SLANG
printf(" --with-slang"); printf(" --with-slang");
#endif #endif
@ -558,8 +565,11 @@ void do_char(char ch)
current->data[current_x] = ch; current->data[current_x] = ch;
do_right(); do_right();
#ifndef DISABLE_WRAPPING
if (!ISSET(NO_WRAP) && (ch != '\t')) if (!ISSET(NO_WRAP) && (ch != '\t'))
check_wrap(current, ch); check_wrap(current, ch);
#endif
set_modified(); set_modified();
check_statblank(); check_statblank();
UNSET(KEEP_CUTBUFFER); UNSET(KEEP_CUTBUFFER);
@ -688,6 +698,7 @@ void do_next_word(void)
} }
#ifndef DISABLE_WRAPPING
void do_wrap(filestruct * inptr, char input_char) void do_wrap(filestruct * inptr, char input_char)
{ {
int i = 0; /* Index into ->data for line. */ int i = 0; /* Index into ->data for line. */
@ -1043,6 +1054,7 @@ void check_wrap(filestruct * inptr, char ch)
do_wrap(inptr, ch); do_wrap(inptr, ch);
} }
} }
#endif /* DISABLE_WRAPPING */
/* Stuff we do when we abort from programs and want to clean up the /* Stuff we do when we abort from programs and want to clean up the
* screen. This doesnt do much right now. * screen. This doesnt do much right now.
@ -2279,8 +2291,13 @@ int main(int argc, char *argv[])
SET(VIEW_MODE); SET(VIEW_MODE);
break; break;
case 'w': case 'w':
#ifdef DISABLE_WRAPPING
usage();
exit(0);
#else
SET(NO_WRAP); SET(NO_WRAP);
break; break;
#endif /* DISABLE_WRAPPING */
case 'x': case 'x':
SET(NO_HELP); SET(NO_HELP);
break; break;

View File

@ -378,6 +378,10 @@ consider the following command line options:
cut to line (-k) option which it depends on to work properly. It cut to line (-k) option which it depends on to work properly. It
also disables the function toggles and mouse support. also disables the function toggles and mouse support.
`--disable-wrapping'
Disables all word wrapping in the editor. This also eliminates the
-w command line flag, as nonwrapping is then the default behavior.
 
Tag Table: Tag Table:

View File

@ -404,6 +404,11 @@ This options disables all the above. It also disables some of
the larger internals of the editor, like the marker code (^^) and the larger internals of the editor, like the marker code (^^) and
the cut to line (-k) option which it depends on to work properly. the cut to line (-k) option which it depends on to work properly.
It also disables the function toggles and mouse support. 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.
@end table @end table
@contents @contents