- nano.h:
- Remove the manual disabling of color support if regex.h isn't
found, as configure.ac now handles that. (DLR)
+ - If DISABLE_WRAPPING is defined, undefine DISABLE_ROOTWRAP, as
+ the latter makes no sense when the former is set, and adjust
+ all #ifdefs that check for both being enabled. (DLR)
+ - If HAVE_REGEX_H isn't defined, undefine ENABLE_COLOR, as the
+ latter is useless without regex support. (DLR)
- search.c:
replace_regexp()
- Remove unnecessary casting of c to int. (DLR)
enable color support. (DLR)
- Fix the spacing of the error message displayed when slcurses.h
isn't found. (DLR)
+ - If we use the --disable-wrapping option, ignore the
+ --disable-wrapping-as-root option. (DLR)
+ - Add minor cosmetic tweaks. (DLR)
- doc/syntax/c.nanorc:
- Since .i and .ii are preprocessed C and C++ output, colorize
them here. (Mike Frysinger)
AM_GNU_GETTEXT_VERSION(0.11.5)
AM_GNU_GETTEXT([external], [need-ngettext])
-AM_CONDITIONAL(USE_NLS, test "x$USE_NLS" = "xyes")
+AM_CONDITIONAL(USE_NLS, test x$USE_NLS = xyes)
dnl Data location.
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debugging (disabled by default)],
[if test x$enableval = xyes; then
- AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.])
- debug_support=yes
+ AC_DEFINE(DEBUG, 1, [Define this to enable nano debug messages and assert warnings.]) debug_support=yes
fi])
if test x$debug_support != xyes; then
return 0;
}],
[AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
- slang_support=yes
+ AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang"
return 0;
}],
[AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
- slang_support=yes
+ AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
return 0;
}],
[AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
- slang_support=yes
+ AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
CURSES_LIB_WIDE=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
return 0;
}],
[AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
- slang_support=yes
+ AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang"
else
return 0;
}],
[AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
- slang_support=yes
+ AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
else
return 0;
}],
[AC_MSG_RESULT(yes)
- AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.])
- slang_support=yes
+ AC_DEFINE(USE_SLANG, 1, [Define to use the slang wrappers for curses instead of native curses.]) slang_support=yes
if test x$with_slang != xyes; then
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
else
;;
esac], [AC_MSG_RESULT(no)])
-AM_CONDITIONAL(USE_COLOR, test "x$color_support" = "xyes")
+AM_CONDITIONAL(USE_COLOR, test x$color_support = xyes)
dnl Checks for functions.
#ifdef DISABLE_WRAPPING
printf(" --disable-wrapping");
#endif
-#if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING)
+#ifdef DISABLE_ROOTWRAP
printf(" --disable-wrapping-as-root");
#endif
#ifdef ENABLE_COLOR
textdomain(PACKAGE);
#endif
-#if !defined(ENABLE_NANORC) && defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING)
- /* If we don't have rcfile support, we're root, and
- * --disable-wrapping-as-root is used, turn wrapping off. */
+#if !defined(ENABLE_NANORC) && defined(DISABLE_ROOTWRAP)
+ /* If we don't have rcfile support, --disable-wrapping-as-root is
+ * used, and we're root, turn wrapping off. */
if (geteuid() == NANO_ROOT_UID)
SET(NO_WRAP);
#endif
tabsize = tabsize_cpy;
flags |= flags_cpy;
}
-#if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING)
+#ifdef DISABLE_ROOTWRAP
+ /* If we don't have any rcfiles, --disable-wrapping-as-root is used,
+ * and we're root, turn wrapping off. */
else if (geteuid() == NANO_ROOT_UID)
SET(NO_WRAP);
#endif
#ifndef NCURSES_MOUSE_VERSION
#define DISABLE_MOUSE 1
#endif
-
-#if defined(DISABLE_WRAPPING) && defined(DISABLE_JUSTIFY)
+#ifdef DISABLE_WRAPPING
+/* If both wrapping and justifying are disabled, disable all the code
+ * used by either of the two. */
+#ifdef DISABLE_JUSTIFY
#define DISABLE_WRAPJUSTIFY 1
#endif
+/* If wrapping is disabled, turn the --disable-wrapping-as-root option
+ * off, as it's useless then. */
+#ifdef DISABLE_ROOTWRAP
+#undef DISABLE_ROOTWRAP
+#endif
+#endif
+
+/* If regex support is disabled, turn color support off, as it's useless
+ * then. */
+#ifndef HAVE_REGEX_H
+#undef ENABLE_COLOR
+#endif
/* Enumeration types. */
typedef enum {