Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.68
diff -u -p -r1.68 filter.admin.inc
--- modules/filter/filter.admin.inc	20 Oct 2010 01:31:07 -0000	1.68
+++ modules/filter/filter.admin.inc	20 Oct 2010 21:55:22 -0000
@@ -136,7 +136,7 @@ function filter_admin_format_form($form,
     '#default_value' => $format->format,
     '#maxlength' => 255,
     '#machine_name' => array(
-      'exists' => 'filter_format_load',
+      'exists' => 'filter_format_exists',
     ),
     '#disabled' => !empty($format->format),
   );
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.354
diff -u -p -r1.354 filter.module
--- modules/filter/filter.module	20 Oct 2010 01:15:58 -0000	1.354
+++ modules/filter/filter.module	20 Oct 2010 21:55:22 -0000
@@ -153,7 +153,11 @@ function _filter_disable_format_access($
  *   The format ID.
  *
  * @return
- *   A fully-populated text format object.
+ *   A fully-populated text format object, if the requested format exists and
+ *   is enabled. If the format does not exist, or exists in the database but
+ *   has been marked as disabled, FALSE is returned.
+ *
+ * @see filter_format_exists()
  */
 function filter_format_load($format_id) {
   $formats = filter_formats();
@@ -165,9 +169,10 @@ function filter_format_load($format_id) 
  *
  * @param $format
  *   A format object using the properties:
+ *   - 'format': A machine-readable name representing the ID of the text format
+ *     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.
- *   - 'format': (optional) The internal ID of the text format. If omitted, a
- *     new text format is created.
  *   - '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
@@ -266,9 +271,9 @@ function filter_format_save($format) {
  * Disable a text format.
  *
  * There is no core facility to re-enable a disabled format. It is not deleted
- * to keep information for contrib and to make sure the format auto increment
- * id is never reused. As there might be content using the disabled format,
- * this would lead to data corruption.
+ * to keep information for contrib and to make sure the format ID is never
+ * reused. As there might be content using the disabled format, this would lead
+ * to data corruption.
  *
  * @param $format
  *   The text format object to be disabled.
@@ -288,6 +293,23 @@ function filter_format_disable($format) 
 }
 
 /**
+ * Determines if a text format exists.
+ *
+ * @param $format_id
+ *   The ID of the text format to check.
+ *
+ * @return
+ *   TRUE if the text format exists, or FALSE if it does not. Note that for a
+ *   format which has been disabled (and therefore is no longer available for
+ *   use) but still exists in the database, TRUE will be returned.
+ *
+ * @see filter_format_load()
+ */
+function filter_format_exists($format_id) {
+  return (bool) db_query_range('SELECT 1 FROM {filter_format} WHERE format = :format', 0, 1, array(':format' => $format_id))->fetchField();
+}
+
+/**
  * Display a text format form title.
  */
 function filter_admin_format_title($format) {
