Index: views.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/views/views.module,v
retrieving revision 1.300
diff -u -r1.300 views.module
--- views.module	25 Jun 2008 21:10:10 -0000	1.300
+++ views.module	12 Aug 2008 23:48:58 -0000
@@ -90,6 +90,26 @@
   return $hooks;
 }
 
+/**
+ * A theme preprocess function to automatically allow view-based node
+ * templates if called from a view.
+ *
+ * The 'modules/node.views.inc' file is a better place for this, but
+ * we haven't got a chance to load that file before Drupal builds the
+ * node portion of the theme registry.
+ *
+ * @todo Remove this in Drupal 7, as it has a code registry.
+ */
+function views_preprocess_node(&$vars) {
+  // The 'view' attribute of the node is added in template_preprocess_views_view_row_node()
+  if (!empty($vars['node']->view) && !empty($vars['node']->view->name)) {
+    $vars['template_files'][] = 'node-view-' . $vars['node']->view->name;
+    if(!empty($vars['node']->view->current_display)) {
+      $vars['template_files'][] = 'node-view-' . $vars['node']->view->name . '-'. $vars['node']->view->current_display;
+    }
+  }
+}
+
 /*
  * Implementation of hook_perm()
  */

