diff --git a/ChangeLog b/ChangeLog
index 25048dcf81d1d9380f62378acffaf439dad32fb8..7d81033028ab2b6c365d0ec9751f6cde3bff3885 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -104,6 +104,11 @@ CVS code -
 - 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)
@@ -125,6 +130,9 @@ CVS code -
 	  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)
diff --git a/configure.ac b/configure.ac
index 40f13b090dde12bbc3b6abb19a324bb892d829d2..a692f797b5055fb7e99ec464148056b4f8292b8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,7 @@ dnl Internationalization macros.
 
 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.
 
@@ -56,8 +56,7 @@ dnl Checks for options.
 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
@@ -215,8 +214,7 @@ int main(void)
     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"
@@ -242,8 +240,7 @@ int main(void)
     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"
@@ -264,8 +261,7 @@ int main(void)
     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"
@@ -302,8 +298,7 @@ int main(void)
     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
@@ -328,8 +323,7 @@ int main(void)
     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
@@ -349,8 +343,7 @@ int main(void)
     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
@@ -378,7 +371,7 @@ int main(void)
 	;;
     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.
 
diff --git a/src/nano.c b/src/nano.c
index 985261ca025d3aab8286bd60f60b4235000b9ab9..1061719df97d5f857887f82e72a04dacff41e189 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -872,7 +872,7 @@ void version(void)
 #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
@@ -1743,9 +1743,9 @@ int main(int argc, char **argv)
     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
@@ -2008,7 +2008,9 @@ int main(int argc, char **argv)
 	    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
diff --git a/src/nano.h b/src/nano.h
index 8770e04deda753250839ecc5331816d6c6793c6c..ee50a48afa363bda33730402707fa180f5c54623 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -143,10 +143,24 @@
 #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 {
diff --git a/src/rcfile.c b/src/rcfile.c
index 9a730c2ef3cdd456f98fb855dc81a06ec2c1960d..9ede47f11a3d8827d1c4787cd34c0859723f0730 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -880,10 +880,10 @@ void do_rcfile(void)
 #endif
 		);
 
-#if defined(DISABLE_ROOTWRAP) && !defined(DISABLE_WRAPPING)
+#ifdef DISABLE_ROOTWRAP
     /* We've already read SYSCONFDIR/nanorc, if it's there.  If we're
-     * root and --disable-wrapping-as-root is used, turn wrapping
-     * off now. */
+     * root, and --disable-wrapping-as-root is used, turn wrapping off
+     * now. */
     if (geteuid() == NANO_ROOT_UID)
 	SET(NO_WRAP);
 #endif