Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 8801)
+++ wp-admin/includes/template.php	(working copy)
@@ -1602,4 +1602,67 @@
 		}
 	}
 }
+
+function add_settings_section($id, $title, $callback, $page) {
+	global $wp_settings_sections;
+
+	if  ( !isset($wp_settings_sections) )
+		$wp_settings_sections = array();
+	if ( !isset($wp_settings_sections[$page]) )
+		$wp_settings_sections[$page] = array();
+	if ( !isset($wp_settings_sections[$page][$id]) )
+		$wp_settings_sections[$page][$id] = array();
+
+	$wp_settings_sections[$page][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback);
+}
+
+function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {
+	global $wp_settings_fields;
+
+	if  ( !isset($wp_settings_fields) )
+		$wp_settings_fields = array();
+	if ( !isset($wp_settings_fields[$page]) )
+		$wp_settings_fields[$page] = array();
+	if ( !isset($wp_settings_fields[$page][$section]) )
+		$wp_settings_fields[$page][$section] = array();
+
+	$wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args);
+}
+
+function do_settings_sections($page) {
+	global $wp_settings_sections, $wp_settings_fields;
+
+	if ( !isset($wp_settings_sections) || !isset($wp_settings_sections[$page]) )
+		return;
+
+	foreach ( (array) $wp_settings_sections[$page] as $section ) {
+		echo "<h3>{$section['title']}</h3>\n";
+		call_user_func($section['callback'], $section);
+		if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section['id']]) )
+			continue;
+		echo '<table class="form-table">';
+		do_settings_fields($page, $section['id']);
+		echo '</table>';
+	}
+}
+
+function do_settings_fields($page, $section) {
+	global $wp_settings_fields;
+
+	if ( !isset($wp_settings_fields) || !isset($wp_settings_fields[$page]) || !isset($wp_settings_fields[$page][$section]) )
+		return;
+
+	foreach ( (array) $wp_settings_fields[$page][$section] as $field ) {
+		echo '<tr valign="top">';
+		if ( !empty($field['args']['label_for']) )
+			echo '<th scope="row"><label for="' . $field['args']['label_for'] . '">' . $field['title'] . '</label></th>';
+		else
+			echo '<th scope="row">' . $field['title'] . '</th>';
+		echo '<td>';
+		call_user_func($field['callback']);
+		echo '</td>';
+		echo '</tr>';
+	}	
+}
+
 ?>
Index: wp-admin/options-writing.php
===================================================================
--- wp-admin/options-writing.php	(revision 8802)
+++ wp-admin/options-writing.php	(working copy)
@@ -63,6 +63,7 @@
 ?>
 </select></td>
 </tr>
+<?php do_settings_fields('writing', 'default'); ?>
 </table>
 
 <h3><?php _e('Remote Publishing') ?></h3>
@@ -83,7 +84,9 @@
 <input name="enable_xmlrpc" type="checkbox" id="enable_xmlrpc" value="1" <?php checked('1', get_option('enable_xmlrpc')); ?> />
 <?php _e('Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.') ?></label><br />
 </fieldset></td>
-</tr></table>
+</tr>
+<?php do_settings_fields('writing', 'remote_publishing'); ?>
+</table>
 
 <h3><?php _e('Post via e-mail') ?></h3>
 <p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <code>%s</code>, <code>%s</code>, <code>%s</code>.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?></p>
@@ -120,6 +123,7 @@
 ?>
 </select></td>
 </tr>
+<?php do_settings_fields('writing', 'post_via_email'); ?>
 </table>
 
 <h3><?php _e('Update Services') ?></h3>
@@ -136,6 +140,8 @@
 
 <?php endif; ?>
 
+<?php do_settings_sections('writing'); ?>
+
 <p class="submit">
 <input type="hidden" name="action" value="update" />
 <input type="submit" name="Submit" value="<?php _e('Save Changes') ?>" />
