diff --git a/ChangeLog b/ChangeLog
index 9dcf7706319aed77401a16c270fb482e8679b2fc..8ff0656d715c628aa7114a76bae0c7dcf04ac960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,15 @@ CVS code -
 	  still work the same way with them.  This also fixes
 	  compilation on Mac OS X 10.4.1, which doesn't seem to define a
 	  wint_t type. (DLR, problem found by Emily Jackson)
+	- Add the ability to convert typed tabs to spaces using
+	  the -E/--tabstospaces command line options, the "tabstospaces"
+	  rcfile option, and the toggle Meta-E.  Note that this doesn't
+	  affect tabs entered using verbatim input, and that it's
+	  disabled when NANO_SMALL is defined.  Also, change the short
+	  command line option for --backupdir from -E to -C.  Changes to
+	  toggle_init(), help_init(), usage(), do_tab(), main(),
+	  nanorc.sample, nano.1, nanorc.5, and nano.texi. (DLR,
+	  suggested by many people)
 - chars.c:
   make_mbstring()
 	- Change erroneous ENABLE_EXTRA #ifdef to NANO_EXTRA to fix a
diff --git a/doc/man/nano.1 b/doc/man/nano.1
index 7e808f3842350ce88d1cea3bea20782370b5d5f6..8cbcd9c9b6054ce7eb475716694d81a7b39bf336 100644
--- a/doc/man/nano.1
+++ b/doc/man/nano.1
@@ -6,7 +6,7 @@
 .\" Public License for copying conditions.  There is NO warranty.
 .\"
 .\" $Id$
-.TH NANO 1 "version 1.3.8" "June 3, 2005"
+.TH NANO 1 "version 1.3.8" "June 15, 2005"
 .\" Please adjust this date whenever revising the manpage.
 .\"
 
@@ -50,10 +50,13 @@ line.
 When saving a file, back up the previous version of it to the current
 filename suffixed with a ~.
 .TP
-.B \-E \fIdir\fP (\-\-backupdir=\fIdir\fP)
+.B \-C \fIdir\fP (\-\-backupdir=\fIdir\fP)
 Set the directory where \fBnano\fP puts unique backup files if file
 backups are enabled.
 .TP
+.B \-E (\-\-tabstospaces)
+Convert typed tabs to spaces.
+.TP
 .B \-F (\-\-multibuffer)
 Enable multiple file buffers, if available.
 .TP
diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5
index db9cde9ff3a529cde03fae0c96a6692046b90f83..517a22e16f0269a966fa699ab2215744348c26ac 100644
--- a/doc/man/nanorc.5
+++ b/doc/man/nanorc.5
@@ -6,7 +6,7 @@
 .\" Public License for copying conditions.  There is NO warranty.
 .\"
 .\" $Id$
-.TH NANORC 5 "version 1.3.8" "June 8, 2005"
+.TH NANORC 5 "version 1.3.8" "June 15, 2005"
 .\" Please adjust this date whenever revising the manpage.
 .\"
 .SH NAME
@@ -143,6 +143,9 @@ Allow nano to be suspended.
 Use a tab size of \fIn\fP columns instead of the default (8); must be
 greater than 0.
 .TP
+\fBset/unset tabstospaces\fP
+Convert typed tabs to spaces.
+.TP
 \fBset/unset tempfile\fP
 Save automatically on exit, don't prompt.
 .TP
diff --git a/doc/nanorc.sample b/doc/nanorc.sample
index d81eaf426b5c08bf6873f79c756c9ecbf033a57c..ecfc38a5de083debc80201db00d933efbde3e53c 100644
--- a/doc/nanorc.sample
+++ b/doc/nanorc.sample
@@ -29,6 +29,9 @@
 ## Use cut to end of line by default.
 # set cut
 
+## Convert typed tabs to spaces.
+# set tabstospaces
+
 ## Set the line length for wrapping text and justifying paragraphs.
 ## If fill is negative, the line length will be the screen width less
 ## this number.
diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi
index c552a5c839e0fa4f11e29510edabbd6a0558a017..e9ee6d64e6e895b3fc49efb65515c9d32f4aa8b1 100644
--- a/doc/texinfo/nano.texi
+++ b/doc/texinfo/nano.texi
@@ -9,7 +9,7 @@
 @smallbook
 @set EDITION 0.1
 @set VERSION 1.3.8
-@set UPDATED 03 Jun 2005
+@set UPDATED 15 Jun 2005
 
 @dircategory Editors
 @direntry
@@ -124,10 +124,13 @@ line.
 When saving a file, back up the previous version of it to the current
 filename suffixed with a ~.
 
-@item -E, --backupdir=[dir]
+@item -C, --backupdir=[dir]
 Set the directory where @code{nano} puts unique backup files if file
 backups are enabled.
 
+@item -E, --tabstospaces
+Convert typed tabs to spaces.
+
 @item -F, --multibuffer
 Enable multiple file buffers, if available.
 
diff --git a/src/global.c b/src/global.c
index d1fede031a0e8c30d86490082931734417ffb529..74b8cee927f645df3636e53bac3065d783d4768f 100644
--- a/src/global.c
+++ b/src/global.c
@@ -1151,6 +1151,8 @@ void toggle_init(void)
 #endif
     toggle_init_one(TOGGLE_MORESPACE_KEY,
 	N_("Use of more space for editing"), MORE_SPACE);
+    toggle_init_one(TOGGLE_TABSTOSPACES_KEY,
+	N_("Conversion of typed tabs to spaces"), TABS_TO_SPACES);
 }
 #endif /* !NANO_SMALL */
 
diff --git a/src/nano.c b/src/nano.c
index 52a2390797efadf0e1f1282b2ed2b62d72e7f780..d8b6f691898b624700885d07838435b4841c8ea8 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -519,15 +519,20 @@ void help_init(void)
 	    }
 	    /* If the primary meta key sequence is the first entry,
 	     * don't put parentheses around it. */
-	    if (entries == 1 && s->metaval == NANO_ALT_SPACE) {
-		char *space_ptr = display_string(_("Space"), 0, 5,
+	    if (entries == 1) {
+		/* Yucky sentinel values we can't handle a better
+		 * way. */
+		if (s->metaval == NANO_ALT_SPACE) {
+		    char *space_ptr = display_string(_("Space"), 0, 5,
 			FALSE);
 
-		ptr += sprintf(ptr, "M-%s", space_ptr);
+		    ptr += sprintf(ptr, "M-%s", space_ptr);
 
-		free(space_ptr);
+		    free(space_ptr);
+		}
 	    } else
-		ptr += sprintf(ptr, entries == 1 ? "M-%c" : "(M-%c)",
+		/* Normal values. */
+		ptr += sprintf(ptr, (entries == 1) ? "M-%c" : "(M-%c)",
 			toupper(s->metaval));
 	    *(ptr++) = '\t';
 	}
@@ -1024,8 +1029,10 @@ void usage(void)
 #ifndef NANO_SMALL
     print1opt("-A", "--smarthome", N_("Enable smart home key"));
     print1opt("-B", "--backup", N_("Save backups of existing files"));
-    print1opt(_("-E [dir]"), _("--backupdir=[dir]"),
+    print1opt(_("-C [dir]"), _("--backupdir=[dir]"),
 	N_("Directory for saving unique backup files"));
+    print1opt("-E", "--tabstospaces",
+	N_("Convert typed tabs to spaces"));
 #endif
 #ifdef ENABLE_MULTIBUFFER
     print1opt("-F", "--multibuffer", N_("Enable multiple file buffers"));
@@ -1381,7 +1388,28 @@ void do_delete(void)
 
 void do_tab(void)
 {
-    do_output("\t", 1, TRUE);
+#ifndef NANO_SMALL
+    if (ISSET(TABS_TO_SPACES)) {
+	char *output;
+	size_t output_len = 0, new_pww = placewewant;
+
+	do {
+	    new_pww++;
+	    output_len++;
+	} while (new_pww % tabsize != 0);
+
+	output = charalloc(output_len + 1);
+
+	charset(output, ' ', output_len);
+	output[output_len] = '\0';
+
+	do_output(output, output_len, TRUE);
+    } else {
+#endif
+	do_output("\t", 1, TRUE);
+#ifndef NANO_SMALL
+    }
+#endif
 }
 
 /* Someone hits Return *gasp!* */
@@ -4122,7 +4150,8 @@ int main(int argc, char **argv)
 #ifndef NANO_SMALL
 	{"smarthome", 0, NULL, 'A'},
 	{"backup", 0, NULL, 'B'},
-	{"backupdir", 1, NULL, 'E'},
+	{"backupdir", 1, NULL, 'C'},
+	{"tabstospaces", 0, NULL, 'E'},
 	{"noconvert", 0, NULL, 'N'},
 	{"smooth", 0, NULL, 'S'},
 	{"restricted", 0, NULL, 'Z'},
@@ -4169,11 +4198,11 @@ int main(int argc, char **argv)
     while ((optchr =
 #ifdef HAVE_GETOPT_LONG
 	getopt_long(argc, argv,
-		"h?ABDE:FHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz",
+		"h?ABC:EFHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz",
 		long_options, NULL)
 #else
 	getopt(argc, argv,
-		"h?ABDE:FHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz")
+		"h?ABC:EFHINOQ:ST:VY:Zabcdefgijklmo:pr:s:tvwxz")
 #endif
 		) != -1) {
 
@@ -4193,9 +4222,12 @@ int main(int argc, char **argv)
 	    case 'B':
 		SET(BACKUP_FILE);
 		break;
-	    case 'E':
+	    case 'C':
 		backup_dir = mallocstrcpy(backup_dir, optarg);
 		break;
+	    case 'E':
+		SET(TABS_TO_SPACES);
+		break;
 #endif
 #ifdef ENABLE_MULTIBUFFER
 	    case 'F':
diff --git a/src/nano.h b/src/nano.h
index 0be8df4d754de3dbd0569e139aacbf222ce27194..4f445c5d72b64cbd195e91437d663e80ef11460c 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -303,7 +303,8 @@ typedef struct syntaxtype {
 #define SMART_HOME		(1<<26)
 #define WHITESPACE_DISPLAY	(1<<27)
 #define MORE_SPACE		(1<<28)
-#define NO_UTF8			(1<<29)
+#define TABS_TO_SPACES		(1<<29)
+#define NO_UTF8			(1<<30)
 
 /* Control key sequences.  Changing these would be very, very bad. */
 #define NANO_CONTROL_SPACE 0
@@ -489,6 +490,7 @@ typedef struct syntaxtype {
 #define TOGGLE_SMARTHOME_KEY	NANO_ALT_H
 #define TOGGLE_WHITESPACE_KEY	NANO_ALT_P
 #define TOGGLE_MORESPACE_KEY	NANO_ALT_O
+#define TOGGLE_TABSTOSPACES_KEY	NANO_ALT_E
 #endif /* !NANO_SMALL */
 
 #define MAIN_VISIBLE 12
diff --git a/src/rcfile.c b/src/rcfile.c
index da74fc80d6af3b436b23f35c3462486742ee3ceb..779a8446c6b435a56ec73929757717bc0991ebac 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -88,6 +88,9 @@ const static rcoption rcopts[] = {
 #endif
     {"suspend", SUSPEND},
     {"tabsize", 0},
+#ifndef NANO_SMALL
+    {"tabstospaces", TABS_TO_SPACES},
+#endif
     {"tempfile", TEMP_FILE},
     {"view", VIEW_MODE},
 #ifndef NANO_SMALL