mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
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-d3aeb78583b8
This commit is contained in:
parent
6c49b3f32c
commit
ff98983602
@ -4,6 +4,8 @@ CVS code -
|
||||
new flag CLEAR_BACKUPSTRING because there's no easy way to
|
||||
clear the backupstring without making it global (messy), so we
|
||||
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:
|
||||
- corrected the Mouse Toggle section, noticed by Daniel Bonniot.
|
||||
- winio.c:
|
||||
|
@ -66,3 +66,5 @@
|
||||
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
||||
#undef ENABLE_COLOR
|
||||
|
||||
/* Define this to enable undoing....something */
|
||||
#undef ENABLE_UNDO
|
||||
|
32
aclocal.m4
vendored
32
aclocal.m4
vendored
@ -125,6 +125,24 @@ for am_file in <<$1>>; do
|
||||
done<<>>dnl>>)
|
||||
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
|
||||
|
||||
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.
|
||||
#
|
||||
# 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
|
||||
# but which still want to provide support for the GNU gettext functionality.
|
||||
# Please note that the actual code is *not* freely available.
|
||||
# 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.
|
||||
|
||||
# serial 1
|
||||
# serial 2
|
||||
|
||||
dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
|
||||
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.
|
||||
set dummy $2; ac_word=[$]2
|
||||
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
|
||||
$1="$ac_cv_path_$1"
|
||||
if test -n "[$]$1"; then
|
||||
if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
|
||||
AC_MSG_RESULT([$]$1)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
|
@ -31,9 +31,6 @@
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#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). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
@ -103,6 +100,9 @@
|
||||
/* Define this to have syntax hilighting, requires ENABLE_NANORC too! */
|
||||
#undef ENABLE_COLOR
|
||||
|
||||
/* Define this to enable undoing....something */
|
||||
#undef ENABLE_UNDO
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
#undef HAVE___ARGZ_COUNT
|
||||
|
||||
|
25
nano.c
25
nano.c
@ -421,9 +421,9 @@ void usage(void)
|
||||
(" -c --const Constantly show cursor position\n"));
|
||||
printf(_
|
||||
(" -h --help Show this message\n"));
|
||||
#ifndef NANO_SMALL
|
||||
printf(_
|
||||
(" -i --autoindent Automatically indent new lines\n"));
|
||||
#ifndef NANO_SMALL
|
||||
printf(_
|
||||
(" -k --cut Let ^K cut from cursor to end of line\n"));
|
||||
#endif
|
||||
@ -471,8 +471,8 @@ void usage(void)
|
||||
printf(_(" -V Print version information and exit\n"));
|
||||
printf(_(" -c Constantly show cursor position\n"));
|
||||
printf(_(" -h Show this message\n"));
|
||||
printf(_(" -i Automatically indent new lines\n"));
|
||||
#ifndef NANO_SMALL
|
||||
printf(_(" -i Automatically indent new lines\n"));
|
||||
printf(_(" -k Let ^K cut from cursor to end of line\n"));
|
||||
#endif
|
||||
printf(_
|
||||
@ -669,6 +669,7 @@ int do_enter(filestruct * inptr)
|
||||
tmp = ¤t->data[current_x];
|
||||
current_x = 0;
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
/* Do auto-indenting, like the neolithic Turbo Pascal editor */
|
||||
if (ISSET(AUTOINDENT)) {
|
||||
spc = current->data;
|
||||
@ -683,7 +684,9 @@ int do_enter(filestruct * inptr)
|
||||
strncpy(newnode->data, current->data, extra);
|
||||
strcpy(&newnode->data[extra], tmp);
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
newnode->data = charalloc(strlen(tmp) + 1);
|
||||
strcpy(newnode->data, tmp);
|
||||
}
|
||||
@ -897,6 +900,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
if (current_x >= current_word_start) {
|
||||
right = current_x - current_word_start;
|
||||
current_x = 0;
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(AUTOINDENT)) {
|
||||
int i = 0;
|
||||
while ((inptr->next->data[i] == ' '
|
||||
@ -905,6 +909,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
right++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
down = 1;
|
||||
}
|
||||
|
||||
@ -950,6 +955,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
down = 1;
|
||||
|
||||
right = current_x - current_word_start;
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(AUTOINDENT)) {
|
||||
int i = 0;
|
||||
while ((inptr->next->data[i] == ' '
|
||||
@ -958,7 +964,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
right++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
i = current_word_start - 1;
|
||||
if (isspace((int) input_char)
|
||||
&& (current_x == current_word_start)) {
|
||||
@ -1006,6 +1012,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
char *p =
|
||||
charalloc((strlen(temp->data) + strlen(inptr->next->data) + 2));
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(AUTOINDENT)) {
|
||||
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
|
||||
tabs */
|
||||
strcat(p, &inptr->next->data[non]);
|
||||
} else {
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
strcpy(p, temp->data);
|
||||
strcat(p, " ");
|
||||
strcat(p, inptr->next->data);
|
||||
@ -1054,6 +1063,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
|
||||
SET(SAMELINEWRAP);
|
||||
|
||||
#ifndef NANO_SMALL
|
||||
if (ISSET(AUTOINDENT)) {
|
||||
char *spc = inptr->data;
|
||||
char *t = NULL;
|
||||
@ -1071,6 +1081,7 @@ void do_wrap(filestruct * inptr, char input_char)
|
||||
temp->data = t;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -2375,8 +2386,8 @@ int main(int argc, char *argv[])
|
||||
{"view", 0, 0, 'v'},
|
||||
#ifndef NANO_SMALL
|
||||
{"cut", 0, 0, 'k'},
|
||||
#endif
|
||||
{"autoindent", 0, 0, 'i'},
|
||||
#endif
|
||||
{"tempfile", 0, 0, 't'},
|
||||
#ifndef DISABLE_SPELLER
|
||||
{"speller", 1, 0, 's'},
|
||||
@ -2458,10 +2469,10 @@ int main(int argc, char *argv[])
|
||||
case '?':
|
||||
usage();
|
||||
exit(0);
|
||||
#ifndef NANO_SMALL
|
||||
case 'i':
|
||||
SET(AUTOINDENT);
|
||||
break;
|
||||
#ifndef NANO_SMALL
|
||||
case 'k':
|
||||
SET(CUT_TO_END);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user