Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1162
diff -u -p -r1.1162 common.inc
--- includes/common.inc	12 May 2010 08:26:14 -0000	1.1162
+++ includes/common.inc	13 May 2010 05:31:15 -0000
@@ -4902,8 +4902,21 @@ function drupal_render_page($page) {
     $function($page);
   }
   // Modules alter the $page as needed. Blocks are populated into regions like
-  // 'sidebar_first', 'footer', etc.
-  drupal_alter('page', $page);
+  // 'sidebar_first', 'footer', etc. To maximize convenience for site builders
+  // implementing a site-specific custom module or theme that needs to customize
+  // the rendering of a specific page or set of pages, we execute page-specific
+  // hooks in addition to the generic hook_page_alter(). For example, on the
+  // node/1/edit page, all of these hooks run:
+  // - hook_page_alter()
+  // - hook_page_node_alter()
+  // - hook_page_node_%_alter()
+  // - hook_page_node_1_alter()
+  // - hook_page_node_1_edit_alter()
+  // Additionally, hook_page_front_alter() runs for the front page. These follow
+  // the same pattern as template file selection for a page.tpl.php override.
+  // The hooks run in the order listed, and all of the ones for one module run
+  // before all of the ones for the next module.
+  drupal_alter(array_merge(array('page'), theme_get_suggestions(arg(), 'page', '_')), $page);
 
   // If no module has taken care of the main content, add it to the page now.
   // This allows the site to still be usable even if no modules that
