Index: widgets.php
===================================================================
--- widgets.php	(revision 14)
+++ widgets.php	(working copy)
@@ -324,8 +324,13 @@
 	extract($args);
 	$options = get_option('widget_pages');
 	$title = empty($options['title']) ? __('Pages') : $options['title'];
+	$exclude = "";
+	foreach ( (array) $options['exclude'] as $val )
+	{
+		$exclude .= ( $exclude ? ',' : '' ) . $val;
+	}
 	echo $before_widget . $before_title . $title . $after_title . "<ul>\n";
-	wp_list_pages("title_li=");
+	wp_list_pages('sort_column=menu_order,post_title&title_li=' . ( $exclude ? ('&exclude=' . $exclude ) : ''));
 	echo "</ul>\n" . $after_widget;
 }
 
@@ -333,14 +338,22 @@
 	$options = $newoptions = get_option('widget_pages');
 	if ( $_POST["pages-submit"] ) {
 		$newoptions['title'] = strip_tags(stripslashes($_POST["pages-title"]));
+		preg_match_all("/\d+/", $_POST["pages-exclude"], $exclude);
+		$newoptions['exclude'] = end($exclude);
 	}
 	if ( $options != $newoptions ) {
 		$options = $newoptions;
 		update_option('widget_pages', $options);
 	}
 	$title = attribute_escape($options['title']);
+	$exclude = "";
+	foreach ( (array) $options['exclude'] as $val )
+	{
+		$exclude .= ( $exclude ? ', ' : '' ) . $val;
+	}
 ?>
 			<p><label for="pages-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="pages-title" name="pages-title" type="text" value="<?php echo $title; ?>" /></label></p>
+			<p><label for="pages-exclude"><?php _e('Exclude (Page ID list):'); ?> <input style="width: 250px;" id="pages-exclude" name="pages-exclude" type="text" value="<?php echo $exclude; ?>" /></label></p>
 			<input type="hidden" id="pages-submit" name="pages-submit" value="1" />
 <?php
 }
@@ -487,13 +500,12 @@
 	extract($args);
 	$options = get_option('widget_text');
 	$title = $options[$number]['title'];
-	if ( empty($title) )
-		$title = '&nbsp;';
+	$filter = (bool) $options[$number]['filter'];
 	$text = $options[$number]['text'];
 ?>
 		<?php echo $before_widget; ?>
 			<?php $title ? print($before_title . $title . $after_title) : null; ?>
-			<div class="textwidget"><?php echo $text; ?></div>
+			<div class="textwidget"><?php echo $filter ? wpautop($text) : $text; ?></div>
 		<?php echo $after_widget; ?>
 <?php
 }
@@ -507,6 +519,7 @@
 		$newoptions[$number]['text'] = stripslashes($_POST["text-text-$number"]);
 		if ( !current_user_can('unfiltered_html') )
 			$newoptions[$number]['text'] = stripslashes(wp_filter_post_kses($newoptions[$number]['text']));
+		$newoptions[$number]['filter'] = isset($_POST["text-filter-$number"]);
 	}
 	if ( $options != $newoptions ) {
 		$options = $newoptions;
@@ -514,9 +527,11 @@
 	}
 	$title = attribute_escape($options[$number]['title']);
 	$text = attribute_escape($options[$number]['text']);
+	$filter = (bool) $options[$number]['filter'];
 ?>
 			<input style="width: 450px;" id="text-title-<?php echo "$number"; ?>" name="text-title-<?php echo "$number"; ?>" type="text" value="<?php echo $title; ?>" />
 			<textarea style="width: 450px; height: 280px;" id="text-text-<?php echo "$number"; ?>" name="text-text-<?php echo "$number"; ?>"><?php echo $text; ?></textarea>
+			<label for="text-filter-<?php echo "$number"; ?>"><input type="checkbox" id="text-filter-<?php echo "$number"; ?>" name="text-filter-<?php echo "$number"; ?>" id="text-filter-<?php echo "$number"; ?>" <?php echo $filter ? "checked" : ""; ?> />&nbsp;<?php _e('Automatically insert paragraphs'); ?>
 			<input type="hidden" id="text-submit-<?php echo "$number"; ?>" name="text-submit-<?php echo "$number"; ?>" value="1" />
 <?php
 }
