Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.69
diff -u -p -r1.69 filter.admin.inc
--- modules/filter/filter.admin.inc	22 Oct 2010 16:36:14 -0000	1.69
+++ modules/filter/filter.admin.inc	29 Nov 2010 03:27:28 -0000
@@ -104,6 +104,8 @@ function filter_admin_format_page($forma
     $format = (object) array(
       'format' => NULL,
       'name' => '',
+      'status' => 1,
+      'weight' => 0,
     );
   }
   return drupal_get_form('filter_admin_format_form', $format);
@@ -140,6 +142,14 @@ function filter_admin_format_form($form,
     ),
     '#disabled' => !empty($format->format),
   );
+  $form['status'] = array(
+    '#type' => 'value',
+    '#value' => $format->status,
+  );
+  $form['weight'] = array(
+    '#type' => 'value',
+    '#value' => $format->weight,
+  );
 
   // Add user role access selection.
   $form['roles'] = array(
@@ -328,6 +338,8 @@ function filter_admin_format_form_submit
       drupal_set_message(t('The text format %format has been updated.', array('%format' => $format->name)));
       break;
   }
+
+  $form_state['redirect'] = 'admin/config/content/formats';
 }
 
 /**
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.359
diff -u -p -r1.359 filter.module
--- modules/filter/filter.module	21 Nov 2010 09:16:54 -0000	1.359
+++ modules/filter/filter.module	29 Nov 2010 03:25:41 -0000
@@ -173,6 +173,8 @@ function filter_format_load($format_id) 
  *     to save. If this corresponds to an existing text format, that format
  *     will be updated; otherwise, a new format will be created.
  *   - 'name': The title of the text format.
+ *   - 'status': (optional) A Boolean indicating whether the text format is
+ *     enabled. Defaults to TRUE.
  *   - 'weight': (optional) The weight of the text format, which controls its
  *     placement in text format lists. If omitted, the weight is set to 0.
  *   - 'filters': (optional) An associative, multi-dimensional array of filters
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.80
diff -u -p -r1.80 filter.test
--- modules/filter/filter.test	23 Oct 2010 02:26:11 -0000	1.80
+++ modules/filter/filter.test	29 Nov 2010 02:36:04 -0000
@@ -190,21 +190,45 @@ class FilterAdminTestCase extends Drupal
       'name' => $this->randomName(),
     );
     $this->drupalPost(NULL, $edit, t('Save configuration'));
+    $this->assertUrl('admin/config/content/formats');
+    $format_id = $edit['format'];
+    $name = $edit['name'];
+
+    // Verify default weight of the text format.
+    $this->assertFieldByName("formats[$format_id][weight]", 0, t('Text format weight was saved.'));
+
+    // Change the weight of the text format.
+    $edit = array(
+      "formats[$format_id][weight]" => 5,
+    );
+    $this->drupalPost('admin/config/content/formats', $edit, t('Save changes'));
+    $this->assertUrl('admin/config/content/formats');
+    $this->assertFieldByName("formats[$format_id][weight]", 5, t('Text format weight was saved.'));
 
     // Edit text format.
-    $format = $this->getFormat($edit['name']);
-    $this->drupalGet('admin/config/content/formats');
+    $format = $this->getFormat($name);
     $this->assertRaw('admin/config/content/formats/' . $format->format);
     $this->drupalGet('admin/config/content/formats/' . $format->format);
     $this->drupalPost(NULL, array(), t('Save configuration'));
+    $this->assertUrl('admin/config/content/formats');
+
+    // Verify that custom weight of the text format has been retained.
+    $this->assertFieldByName("formats[$format_id}][weight]", 5, t('Text format weight was retained.'));
 
     // Disable text format.
-    $this->drupalGet('admin/config/content/formats');
+    $this->assertText($name);
+    $this->assertLinkByHref('admin/config/content/formats/' . $format->format);
     $this->assertRaw('admin/config/content/formats/' . $format->format . '/disable');
     $this->drupalGet('admin/config/content/formats/' . $format->format . '/disable');
     $this->drupalPost(NULL, array(), t('Disable'));
+    $this->assertUrl('admin/config/content/formats');
 
     // Verify that disabled text format no longer exists.
+    // Disabling a text format shows the format's name in a message, so reload
+    // the page.
+    $this->drupalGet('admin/config/content/formats');
+    $this->assertNoText($name);
+    $this->assertNoLinkByHref('admin/config/content/formats/' . $format->format);
     $this->drupalGet('admin/config/content/formats/' . $format->format);
     $this->assertResponse(404, t('Disabled text format no longer exists.'));
 
