Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.837
diff -u -p -r1.837 node.module
--- modules/node/node.module	24 Jun 2007 00:38:40 -0000	1.837
+++ modules/node/node.module	24 Jun 2007 02:42:20 -0000
@@ -9,6 +9,12 @@
 
 define('NODE_NEW_LIMIT', time() - 30 * 24 * 60 * 60);
 
+define('NODE_BUILD_NORMAL', 0);
+define('NODE_BUILD_PREVIEW', 1);
+define('NODE_BUILD_SEARCH_INDEX', 2);
+define('NODE_BUILD_SEARCH_RESULT', 3);
+define('NODE_BUILD_RSS', 4);
+
 /**
  * Implementation of hook_help().
  */
@@ -805,6 +811,10 @@ function node_prepare($node, $teaser = F
  *   of the node's body.
  */
 function node_build_content($node, $teaser = FALSE, $page = FALSE) {
+  
+  if (!isset($node->build_mode)) {
+    $node->build_mode = NODE_BUILD_NORMAL;
+  }
   // Remove the delimiter (if any) that separates the teaser from the body.
   $node->body = isset($node->body) ? str_replace('<!--break-->', '', $node->body) : '';
 
@@ -981,6 +991,7 @@ function node_search($op = 'search', $ke
       foreach ($find as $item) {
         // Build the node body.
         $node = node_load($item->sid);
+        $node->build_mode = NODE_BUILD_SEARCH_RESULT;
         $node = node_build_content($node, FALSE, FALSE);
         $node->body = drupal_render($node->content);
 
@@ -1932,6 +1943,7 @@ function node_feed($nodes = 0, $channel 
   while ($node = db_fetch_object($nodes)) {
     // Load the specified node:
     $item = node_load($node->nid);
+    $node->build_mode = NODE_BUILD_RSS;
     $link = url("node/$node->nid", array('absolute' => TRUE));
 
     if ($item_length != 'title') {
@@ -2350,7 +2362,7 @@ function node_preview($node) {
     // Previewing alters $node so it needs to be cloned.
     if (!form_get_errors()) {
       $cloned_node = drupal_clone($node);
-      $cloned_node->in_preview = TRUE;
+      $cloned_node->build_mode = NODE_BUILD_PREVIEW;
       $output = theme('node_preview', $cloned_node);
     }
     drupal_set_title(t('Preview'));
@@ -2613,6 +2625,7 @@ function node_update_index() {
     $node = node_load($node->nid);
 
     // Build the node body.
+    $node->build_mode = NODE_BUILD_SEARCH_INDEX;
     $node = node_build_content($node, FALSE, FALSE);
     $node->body = drupal_render($node->content);
 
