CVS code -
+- files.c:
+ - Added status messages for converted DOS and Mac files.
+ People should know that their file wasnt normally formatted.
+- nano.c:
+ - New function do_prev_word, similar to do_next_word. Hard coded as
+ Alt-space, as next word is hard coded as control-space.
- po/sv.po:
- Updated Swedish translation (Christian Rose).
- po/sv.po:
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
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;
# 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])
;;
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)
/* 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
#define _(string) (string)
#endif
+/* statics for here */
+#ifndef NANO_SMALL
+static int fileformat = 0; /* 0 = *nix, 1 = DOS, 2 = Mac */
+#endif
+
/* Load file into edit buffer - takes data from file struct */
void load_file(int quiet)
{
if (buf[strlen(buf) - 1] == '\r') {
fileptr->data[strlen(buf) - 1] = 0;
totsize--;
+
+ if (!fileformat)
+ fileformat = 1;
}
#endif
#ifndef NANO_SMALL
/* If it's a Mac file (no LF just a CR), handle it! */
} else if (i > 0 && buf[i-1] == '\r') {
+ fileformat = 2;
fileptr = read_line(buf, fileptr, &line1ins);
num_lines++;
buf[0] = input[0];
/* Update the edit buffer */
load_file(quiet);
}
- statusbar(_("Read %d lines"), num_lines);
+
+#ifndef NANO_SMALL
+ if (fileformat == 2)
+ statusbar(_("Read %d lines (Converted Mac format)"), num_lines);
+ else if (fileformat == 1)
+ statusbar(_("Read %d lines (Converted DOS format)"), num_lines);
+ else
+#endif
+ statusbar(_("Read %d lines"), num_lines);
+
totlines += num_lines;
free(buf);
hblank = charalloc(COLS + 1);
memset(hblank, ' ', COLS);
hblank[COLS] = 0;
+
}
#ifndef DISABLE_HELP
update_line(current, current_x);
}
+}
+
+/* the same thing for backwards */
+void do_prev_word(void)
+{
+ filestruct *fileptr, *old;
+ int i;
+
+ if (current == NULL)
+ return;
+
+ old = current;
+ i = current_x;
+ for (fileptr = current; fileptr != NULL; fileptr = fileptr->prev) {
+ if (fileptr == current) {
+ while (isalnum((int) fileptr->data[i])
+ && i != 0)
+ i--;
+
+ if (i == 0) {
+ if (fileptr->prev != NULL)
+ i = strlen(fileptr->prev->data) - 1;
+ else if (fileptr == fileage && filebot != NULL)
+ i = strlen(filebot->data) - 1;
+
+ continue;
+ }
+ }
+
+ while (!isalnum((int) fileptr->data[i]) && i != 0)
+ i--;
+
+ if (i > 0) {
+ i--;
+
+ while (isalnum((int) fileptr->data[i]) && i != 0)
+ i--;
+
+ i++;
+ if (i != 0)
+ break;
+
+ }
+ if (fileptr->prev != NULL)
+ i = strlen(fileptr->prev->data) - 1;
+ else if (fileptr == fileage && filebot != NULL)
+ i = strlen(filebot->data) - 1;
+ }
+ if (fileptr == NULL)
+ current = fileage;
+ else
+ current = fileptr;
+
+ current_x = i;
+ placewewant = xplustabs();
+
+ if (current->lineno <= edittop->lineno)
+ edit_update(current, CENTER);
+ else {
+ /* If we've jumped lines, refresh the old line. We can't just use
+ * current->prev here, because we may have skipped over some blank
+ * lines, in which case the previous line is the wrong one.
+ */
+ if (current != old)
+ update_line(old, 0);
+
+ update_line(current, current_x);
+ }
}
#endif /* NANO_SMALL */
modify_control_seq = 1;
keyhandled = 1;
break;
+ case ' ':
+ /* If control-space is next word, Alt-space should be previous word */
+ do_prev_word();
+ keyhandled = 1;
+ break;
case '[':
switch (kbinput = wgetch(edit)) {
case '1': /* Alt-[-1-[0-5,7-9] = F1-F8 in X at least */