Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.599
diff -u -p -r1.599 theme.inc
--- includes/theme.inc	7 Jun 2010 06:38:09 -0000	1.599
+++ includes/theme.inc	6 Jul 2010 10:41:39 -0000
@@ -1548,7 +1548,11 @@ function theme_breadcrumb($variables) {
  *     - "data": The localized title of the table column.
  *     - "field": The database field represented in the table column (required
  *       if user is to be able to sort on this column).
- *     - "sort": A default sort order for this column ("asc" or "desc").
+ *     - "first sort": The default sort order for this column, by which the
+ *       column will be sorted after the first click ("asc" or "desc"). Defaults
+ *       to "asc".
+ *     - "sort": For one column, the order by which the table will be sorted by
+ *       default (i.e., before the user explicitly sorts the table).
  *     - Any HTML attributes, such as "colspan", to apply to the column header
  *       cell.
  *   - rows: An array of table rows. Every row is an array of cells, or an
Index: includes/tablesort.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/tablesort.inc,v
retrieving revision 1.58
diff -u -p -r1.58 tablesort.inc
--- includes/tablesort.inc	5 Dec 2009 20:17:02 -0000	1.58
+++ includes/tablesort.inc	6 Jul 2010 10:41:39 -0000
@@ -174,13 +174,15 @@ function tablesort_header($cell, $header
       $image = theme('tablesort_indicator', array('style' => $ts['sort']));
     }
     else {
-      // If the user clicks a different header, we want to sort ascending initially.
-      $ts['sort'] = 'asc';
+      // If the user clicks a different header, we want to sort according to
+      // $cell['first sort'] initially (or ascending, by default).
+      $ts['sort'] = isset($cell['first sort']) && $cell['first sort'] == 'desc'
+          ? 'desc' : 'asc';
       $image = '';
     }
     $cell['data'] = l($cell['data'] . $image, $_GET['q'], array('attributes' => array('title' => $title), 'query' => array_merge($ts['query'], array('sort' => $ts['sort'], 'order' => $cell['data'])), 'html' => TRUE));
 
-    unset($cell['field'], $cell['sort']);
+    unset($cell['field'], $cell['sort'], $cell['first sort']);
   }
   return $cell;
 }
