Index: ChangeLog
===================================================================
--- ChangeLog	(revision b97fce82bdcea3eb78885aef9f000c7cacb653d8)
+++ ChangeLog	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -8,4 +8,9 @@
 	   format_msg() function is found in .owlconf
 	Added the 'oneline' style
+	Added the 'default_style' variable
+	Added the 'toggle-oneline' command
+	the 'o' key is bound to 'toggle-oneline'
+	Really use just one view now, named 'main' and recalculate
+	  messages when its filter is changed
 	
 2.0.3
Index: commands.c
===================================================================
--- commands.c	(revision aac889a55d28c6586a8ad7d7dbd397a6870a211e)
+++ commands.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -270,4 +270,9 @@
 	      "alist",
 	      "Print a listing of buddies logged in, regardless of protocol."),
+
+  OWLCMD_ARGS("toggle-oneline", owl_command_toggleoneline, OWL_CTX_INTERACTIVE,
+	      "Toggle the style between oneline and the default style",
+	      "toggle-oneline",
+	      ""),
 
   OWLCMD_VOID("recv:shiftleft", owl_command_shift_left, OWL_CTX_INTERACTIVE,
@@ -866,4 +871,9 @@
 char *owl_command_blist() {
   owl_function_buddylist(1, 1, NULL);
+  return(NULL);
+}
+
+char *owl_command_toggleoneline() {
+  owl_function_toggleoneline();
   return(NULL);
 }
Index: functions.c
===================================================================
--- functions.c	(revision d559df97bd8fe22559fdadb8b64e5166521fa4b2)
+++ functions.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -1955,6 +1955,6 @@
 }
 
-
-void owl_function_change_view(char *filtname)
+#if 0
+void owl_function_change_view_old(char *filtname)
 {
   owl_view *v;
@@ -1999,4 +1999,50 @@
   owl_global_set_curmsg(&g, newpos);
 
+  owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
+  owl_mainwin_redisplay(owl_global_get_mainwin(&g));
+  owl_global_set_direction_downwards(&g);
+}
+#endif
+
+void owl_function_change_view(char *filtname)
+{
+  owl_view *v;
+  owl_filter *f;
+  int curid=-1, newpos, curmsg;
+  owl_message *curm=NULL;
+
+  v=owl_global_get_current_view(&g);
+
+  curmsg=owl_global_get_curmsg(&g);
+  if (curmsg==-1) {
+    owl_function_debugmsg("Hit the curmsg==-1 case in change_view");
+  } else {
+    curm=owl_view_get_element(v, curmsg);
+    if (curm) {
+      curid=owl_message_get_id(curm);
+      owl_view_save_curmsgid(v, curid);
+    }
+  }
+
+  f=owl_global_get_filter(&g, filtname);
+  if (!f) {
+    owl_function_makemsg("Unknown filter");
+    return;
+  }
+
+  owl_view_new_filter(v, f);
+
+  /* Figure out what to set the current message to.
+   * - If the view we're leaving has messages in it, go to the closest message
+   *   to the last message pointed to in that view. 
+   * - If the view we're leaving is empty, try to restore the position
+   *   from the last time we were in the new view.  */
+  if (curm) {
+    newpos = owl_view_get_nearest_to_msgid(v, curid);
+  } else {
+    newpos = owl_view_get_nearest_to_saved(v);
+  }
+
+  owl_global_set_curmsg(&g, newpos);
   owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
@@ -2966,2 +3012,15 @@
   fclose(file);
 }
+
+void owl_function_toggleoneline()
+{
+  char *style;
+
+  style=owl_global_get_style(&g);
+
+  if (strcmp(style, "oneline")) {
+    owl_global_set_style(&g, "oneline");
+  } else {
+    owl_global_set_style(&g, owl_global_get_default_style(&g));
+  }
+}
Index: keys.c
===================================================================
--- keys.c	(revision 38cf544c320814f53070c768b4974c2786a024f4)
+++ keys.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -246,4 +246,6 @@
   BIND_CMD("T",   "delete trash",     "mark all 'trash' messages for deletion");
 
+  BIND_CMD("o",   "toggle-oneline", "");
+
   BIND_CMD("A",   "zaway toggle",     "toggles zaway on and off");
 
Index: owl.c
===================================================================
--- owl.c	(revision 8b3259378ae437404d1c3744ae5ced5fa0ac4ecb)
+++ owl.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -211,5 +211,5 @@
 
   /* set the current view */
-  owl_view_create(owl_global_get_current_view(&g), f);
+  owl_view_create(owl_global_get_current_view(&g), "main", f, owl_global_get_style_by_name(&g, "default"));
 
   /* AIM init */
Index: owl.h
===================================================================
--- owl.h	(revision bd3f2322e69e72e9760505782651c29325f28b4b)
+++ owl.h	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -314,6 +314,8 @@
 
 typedef struct _owl_view {
+  char *name;
   owl_filter *filter;
   owl_messagelist ml;
+  owl_style *style;
 } owl_view;
 
Index: stylefunc.c
===================================================================
--- stylefunc.c	(revision 65e39012b09e59f7fdb4366b5112ef957dbfe8e2)
+++ stylefunc.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -430,5 +430,7 @@
       
     /* make personal messages bold for smaat users */
-    if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES) && owl_message_is_personal(m)) {
+    if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES) &&
+	owl_message_is_personal(m) &&
+	owl_message_is_direction_in(m)) {
       owl_fmtext_addattr(fm, OWL_FMTEXT_ATTR_BOLD);
     }
Index: variable.c
===================================================================
--- variable.c	(revision 8b3259378ae437404d1c3744ae5ced5fa0ac4ecb)
+++ variable.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -204,4 +204,10 @@
 		      "available, 'perl'\n",
 		      NULL, owl_variable_style_set, NULL),
+
+  OWLVAR_STRING( "default_style" /* %OwlVarStub */, "default",
+		 "name of the default formatting style",
+		 "This sets the default message formatting style. Possbile\n"
+		 "values include 'default' 'basic' 'oneline' and if\n"
+		 "available, 'perl'\n" ),
 
   OWLVAR_INT(    "edit:maxfillcols" /* %OwlVarStub:edit_maxfillcols */, 70,
Index: view.c
===================================================================
--- view.c	(revision 3a2daac2dddd32e805373d81642d45a0943dd05c)
+++ view.c	(revision c3ab15523776ccb541f069f3baf038b15e3627bc)
@@ -4,12 +4,17 @@
 static const char fileIdent[] = "$Id$";
 
-void owl_view_create(owl_view *v, owl_filter *f) {
+void owl_view_create(owl_view *v, char *name, owl_filter *f, owl_style *s)
+{
+  v->name=owl_strdup(name);
   v->filter=f;
+  v->style=s;
   owl_messagelist_create(&(v->ml));
   owl_view_recalculate(v);
 }
 
-void owl_view_consider_message(owl_view *v, owl_message *m) {
-  /* if the message matches the filter then add to view */
+
+/* if the message matches the filter then add to view */
+void owl_view_consider_message(owl_view *v, owl_message *m)
+{
   if (owl_filter_message_match(v->filter, m)) {
     owl_messagelist_append_element(&(v->ml), m);
@@ -17,6 +22,9 @@
 }
 
-void owl_view_recalculate(owl_view *v) {
-  /* add all the global messages that match the filter */
+/* remove all messages, add all the global messages that match the
+ * filter.
+ */
+void owl_view_recalculate(owl_view *v)
+{
   int i, j;
   owl_messagelist *gml;
@@ -41,17 +49,32 @@
 }
 
-owl_message *owl_view_get_element(owl_view *v, int index) {
+void owl_view_new_filter(owl_view *v, owl_filter *f)
+{
+  v->filter=f;
+  owl_view_recalculate(v);
+}
+
+void owl_view_set_style(owl_view *v, owl_style *s)
+{
+  v->style=s;
+}
+
+owl_message *owl_view_get_element(owl_view *v, int index)
+{
   return(owl_messagelist_get_element(&(v->ml), index));
 }
 
-void owl_view_delete_element(owl_view *v, int index) {
+void owl_view_delete_element(owl_view *v, int index)
+{
   owl_messagelist_delete_element(&(v->ml), index);
 }
 
-void owl_view_undelete_element(owl_view *v, int index) {
+void owl_view_undelete_element(owl_view *v, int index)
+{
   owl_messagelist_undelete_element(&(v->ml), index);
 }
 
-int owl_view_get_size(owl_view *v) {
+int owl_view_get_size(owl_view *v)
+{
   return(owl_messagelist_get_size(&(v->ml)));
 }
@@ -59,5 +82,6 @@
 /* Returns the position in the view with a message closest 
  * to the passed msgid. */
-int owl_view_get_nearest_to_msgid(owl_view *v, int targetid) {
+int owl_view_get_nearest_to_msgid(owl_view *v, int targetid)
+{
   int i, bestdist=-1, bestpos=0, curid, curdist;
 
@@ -73,5 +97,6 @@
 }
 
-int owl_view_get_nearest_to_saved(owl_view *v) {
+int owl_view_get_nearest_to_saved(owl_view *v)
+{
   int cachedid;
 
@@ -83,13 +108,17 @@
 /* saves the current message position in the filter so it can 
  * be restored later if we switch back to this filter. */
-void owl_view_save_curmsgid(owl_view *v, int curid) {
+void owl_view_save_curmsgid(owl_view *v, int curid)
+{
   owl_filter_set_cachedmsgid(v->filter, curid);
 }
 
-char *owl_view_get_filtname(owl_view *v) {
+char *owl_view_get_filtname(owl_view *v)
+{
   return(owl_filter_get_name(v->filter));
 }
 
-void owl_view_free(owl_view *v) {
+void owl_view_free(owl_view *v)
+{
   owl_list_free_simple((owl_list *) &(v->ml));
+  if (v->name) owl_free(v->name);
 }
