Fix acconfig.h, NANO_SMALL leaves out Auto Indent
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@763 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
6c49b3f32c
commit
ff98983602
|
@ -4,6 +4,8 @@ CVS code -
|
||||||
new flag CLEAR_BACKUPSTRING because there's no easy way to
|
new flag CLEAR_BACKUPSTRING because there's no easy way to
|
||||||
clear the backupstring without making it global (messy), so we
|
clear the backupstring without making it global (messy), so we
|
||||||
use a flag instead (just as messy?)
|
use a flag instead (just as messy?)
|
||||||
|
- --enable-tiny now leaves out the Auto Indent code, do you really
|
||||||
|
need that on a bootdisk? =-)
|
||||||
- nano.texi:
|
- nano.texi:
|
||||||
- corrected the Mouse Toggle section, noticed by Daniel Bonniot.
|
- corrected the Mouse Toggle section, noticed by Daniel Bonniot.
|
||||||
- winio.c:
|
- winio.c:
|
||||||
|
|
|
@ -66,3 +66,5 @@
|
||||||
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
||||||
#undef ENABLE_COLOR
|
#undef ENABLE_COLOR
|
||||||
|
|
||||||
|
/* Define this to enable undoing....something */
|
||||||
|
#undef ENABLE_UNDO
|
||||||
|
|
|
@ -125,6 +125,24 @@ for am_file in <<$1>>; do
|
||||||
done<<>>dnl>>)
|
done<<>>dnl>>)
|
||||||
changequote([,]))])
|
changequote([,]))])
|
||||||
|
|
||||||
|
#serial 1
|
||||||
|
# This test replaces the one in autoconf.
|
||||||
|
# Currently this macro should have the same name as the autoconf macro
|
||||||
|
# because gettext's gettext.m4 (distributed in the automake package)
|
||||||
|
# still uses it. Otherwise, the use in gettext.m4 makes autoheader
|
||||||
|
# give these diagnostics:
|
||||||
|
# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
|
||||||
|
# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
|
||||||
|
|
||||||
|
undefine([AC_ISC_POSIX])
|
||||||
|
|
||||||
|
AC_DEFUN([AC_ISC_POSIX],
|
||||||
|
[
|
||||||
|
dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
|
||||||
|
AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
#serial 19
|
#serial 19
|
||||||
|
|
||||||
dnl By default, many hosts won't let programs access large files;
|
dnl By default, many hosts won't let programs access large files;
|
||||||
|
@ -797,15 +815,17 @@ AC_SUBST($1)dnl
|
||||||
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
# Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||||
#
|
#
|
||||||
# This file can be copied and used freely without restrictions. It can
|
# This file can be copied and used freely without restrictions. It can
|
||||||
# be used in projects which are not available under the GNU Public License
|
# be used in projects which are not available under the GNU General Public
|
||||||
# but which still want to provide support for the GNU gettext functionality.
|
# License but which still want to provide support for the GNU gettext
|
||||||
# Please note that the actual code is *not* freely available.
|
# 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.
|
||||||
|
|
||||||
# serial 1
|
# serial 2
|
||||||
|
|
||||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||||
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
|
||||||
AC_DEFUN(AM_PATH_PROG_WITH_TEST,
|
AC_DEFUN([AM_PATH_PROG_WITH_TEST],
|
||||||
[# Extract the first word of "$2", so it can be a program name with args.
|
[# Extract the first word of "$2", so it can be a program name with args.
|
||||||
set dummy $2; ac_word=[$]2
|
set dummy $2; ac_word=[$]2
|
||||||
AC_MSG_CHECKING([for $ac_word])
|
AC_MSG_CHECKING([for $ac_word])
|
||||||
|
@ -833,7 +853,7 @@ ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
|
||||||
;;
|
;;
|
||||||
esac])dnl
|
esac])dnl
|
||||||
$1="$ac_cv_path_$1"
|
$1="$ac_cv_path_$1"
|
||||||
if test -n "[$]$1"; then
|
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
|
||||||
AC_MSG_RESULT([$]$1)
|
AC_MSG_RESULT([$]$1)
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
|
|
|
@ -31,9 +31,6 @@
|
||||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||||
#undef off_t
|
#undef off_t
|
||||||
|
|
||||||
/* Define if you need to in order for stat and other things to work. */
|
|
||||||
#undef _POSIX_SOURCE
|
|
||||||
|
|
||||||
/* Define as the return type of signal handlers (int or void). */
|
/* Define as the return type of signal handlers (int or void). */
|
||||||
#undef RETSIGTYPE
|
#undef RETSIGTYPE
|
||||||
|
|
||||||
|
@ -103,6 +100,9 @@
|
||||||
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
||||||
#undef ENABLE_COLOR
|
#undef ENABLE_COLOR
|
||||||
|
|
||||||
|
/* Define this to enable undoing....something */
|
||||||
|
#undef ENABLE_UNDO
|
||||||
|
|
||||||
/* Define if you have the __argz_count function. */
|
/* Define if you have the __argz_count function. */
|
||||||
#undef HAVE___ARGZ_COUNT
|
#undef HAVE___ARGZ_COUNT
|
||||||
|
|
||||||
|
|
25
nano.c
25
nano.c
|
@ -421,9 +421,9 @@ void usage(void)
|
||||||
(" -c --const Constantly show cursor position\n"));
|
(" -c --const Constantly show cursor position\n"));
|
||||||
printf(_
|
printf(_
|
||||||
(" -h --help Show this message\n"));
|
(" -h --help Show this message\n"));
|
||||||
|
#ifndef NANO_SMALL
|
||||||
printf(_
|
printf(_
|
||||||
(" -i --autoindent Automatically indent new lines\n"));
|
(" -i --autoindent Automatically indent new lines\n"));
|
||||||
#ifndef NANO_SMALL
|
|
||||||
printf(_
|
printf(_
|
||||||
(" -k --cut Let ^K cut from cursor to end of line\n"));
|
(" -k --cut Let ^K cut from cursor to end of line\n"));
|
||||||
#endif
|
#endif
|
||||||
|
@ -471,8 +471,8 @@ void usage(void)
|
||||||
printf(_(" -V Print version information and exit\n"));
|
printf(_(" -V Print version information and exit\n"));
|
||||||
printf(_(" -c Constantly show cursor position\n"));
|
printf(_(" -c Constantly show cursor position\n"));
|
||||||
printf(_(" -h Show this message\n"));
|
printf(_(" -h Show this message\n"));
|
||||||
printf(_(" -i Automatically indent new lines\n"));
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
|
printf(_(" -i Automatically indent new lines\n"));
|
||||||
printf(_(" -k Let ^K cut from cursor to end of line\n"));
|
printf(_(" -k Let ^K cut from cursor to end of line\n"));
|
||||||
#endif
|
#endif
|
||||||
printf(_
|
printf(_
|
||||||
|
@ -669,6 +669,7 @@ int do_enter(filestruct * inptr)
|
||||||
tmp = ¤t->data[current_x];
|
tmp = ¤t->data[current_x];
|
||||||
current_x = 0;
|
current_x = 0;
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
/* Do auto-indenting, like the neolithic Turbo Pascal editor */
|
/* Do auto-indenting, like the neolithic Turbo Pascal editor */
|
||||||
if (ISSET(AUTOINDENT)) {
|
if (ISSET(AUTOINDENT)) {
|
||||||
spc = current->data;
|
spc = current->data;
|
||||||
|
@ -683,7 +684,9 @@ int do_enter(filestruct * inptr)
|
||||||
strncpy(newnode->data, current->data, extra);
|
strncpy(newnode->data, current->data, extra);
|
||||||
strcpy(&newnode->data[extra], tmp);
|
strcpy(&newnode->data[extra], tmp);
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
newnode->data = charalloc(strlen(tmp) + 1);
|
newnode->data = charalloc(strlen(tmp) + 1);
|
||||||
strcpy(newnode->data, tmp);
|
strcpy(newnode->data, tmp);
|
||||||
}
|
}
|
||||||
|
@ -897,6 +900,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
if (current_x >= current_word_start) {
|
if (current_x >= current_word_start) {
|
||||||
right = current_x - current_word_start;
|
right = current_x - current_word_start;
|
||||||
current_x = 0;
|
current_x = 0;
|
||||||
|
#ifndef NANO_SMALL
|
||||||
if (ISSET(AUTOINDENT)) {
|
if (ISSET(AUTOINDENT)) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((inptr->next->data[i] == ' '
|
while ((inptr->next->data[i] == ' '
|
||||||
|
@ -905,6 +909,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
right++;
|
right++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
down = 1;
|
down = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -950,6 +955,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
down = 1;
|
down = 1;
|
||||||
|
|
||||||
right = current_x - current_word_start;
|
right = current_x - current_word_start;
|
||||||
|
#ifndef NANO_SMALL
|
||||||
if (ISSET(AUTOINDENT)) {
|
if (ISSET(AUTOINDENT)) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while ((inptr->next->data[i] == ' '
|
while ((inptr->next->data[i] == ' '
|
||||||
|
@ -958,7 +964,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
right++;
|
right++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
i = current_word_start - 1;
|
i = current_word_start - 1;
|
||||||
if (isspace((int) input_char)
|
if (isspace((int) input_char)
|
||||||
&& (current_x == current_word_start)) {
|
&& (current_x == current_word_start)) {
|
||||||
|
@ -1006,6 +1012,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
char *p =
|
char *p =
|
||||||
charalloc((strlen(temp->data) + strlen(inptr->next->data) + 2));
|
charalloc((strlen(temp->data) + strlen(inptr->next->data) + 2));
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
if (ISSET(AUTOINDENT)) {
|
if (ISSET(AUTOINDENT)) {
|
||||||
int non = 0;
|
int non = 0;
|
||||||
|
|
||||||
|
@ -1024,7 +1031,9 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
/* Now tack on the rest of the next line after the spaces and
|
/* Now tack on the rest of the next line after the spaces and
|
||||||
tabs */
|
tabs */
|
||||||
strcat(p, &inptr->next->data[non]);
|
strcat(p, &inptr->next->data[non]);
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
strcpy(p, temp->data);
|
strcpy(p, temp->data);
|
||||||
strcat(p, " ");
|
strcat(p, " ");
|
||||||
strcat(p, inptr->next->data);
|
strcat(p, inptr->next->data);
|
||||||
|
@ -1054,6 +1063,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
|
|
||||||
SET(SAMELINEWRAP);
|
SET(SAMELINEWRAP);
|
||||||
|
|
||||||
|
#ifndef NANO_SMALL
|
||||||
if (ISSET(AUTOINDENT)) {
|
if (ISSET(AUTOINDENT)) {
|
||||||
char *spc = inptr->data;
|
char *spc = inptr->data;
|
||||||
char *t = NULL;
|
char *t = NULL;
|
||||||
|
@ -1071,6 +1081,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||||
temp->data = t;
|
temp->data = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2375,8 +2386,8 @@ int main(int argc, char *argv[])
|
||||||
{"view", 0, 0, 'v'},
|
{"view", 0, 0, 'v'},
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
{"cut", 0, 0, 'k'},
|
{"cut", 0, 0, 'k'},
|
||||||
#endif
|
|
||||||
{"autoindent", 0, 0, 'i'},
|
{"autoindent", 0, 0, 'i'},
|
||||||
|
#endif
|
||||||
{"tempfile", 0, 0, 't'},
|
{"tempfile", 0, 0, 't'},
|
||||||
#ifndef DISABLE_SPELLER
|
#ifndef DISABLE_SPELLER
|
||||||
{"speller", 1, 0, 's'},
|
{"speller", 1, 0, 's'},
|
||||||
|
@ -2458,10 +2469,10 @@ int main(int argc, char *argv[])
|
||||||
case '?':
|
case '?':
|
||||||
usage();
|
usage();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
#ifndef NANO_SMALL
|
||||||
case 'i':
|
case 'i':
|
||||||
SET(AUTOINDENT);
|
SET(AUTOINDENT);
|
||||||
break;
|
break;
|
||||||
#ifndef NANO_SMALL
|
|
||||||
case 'k':
|
case 'k':
|
||||||
SET(CUT_TO_END);
|
SET(CUT_TO_END);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue