Index: Makefile.in
===================================================================
--- Makefile.in	(revision f4d0975bed0618ba963347663b4b5de5825c0a22)
+++ Makefile.in	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -23,5 +23,5 @@
      regex.c history.c view.c dict.c variable.c filterelement.c pair.c \
      keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c \
-     aim.c buddy.c buddylist.c timer.c style.c stylefunc.c 
+     aim.c buddy.c buddylist.c timer.c style.c stylefunc.c errqueue.c
 OWL_SRC = owl.c
 TESTER_SRC = tester.c
Index: aim.c
===================================================================
--- aim.c	(revision 257a22f9949fe230526eb336a3d6c236f702da66)
+++ aim.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -26,5 +26,4 @@
 };
 
-/*
 static char *msgerrreasons[] = {
 	"Invalid error",
@@ -55,5 +54,4 @@
 };
 static int msgerrreasonslen = 25;
-*/
 
 static void faimtest_debugcb(aim_session_t *sess, int level, const char *format, va_list va);
@@ -245,5 +243,5 @@
 
   /* I don't know how to check for an error yet */
-  return(0);
+  return(ret);
 }
 
@@ -1598,4 +1596,5 @@
   
   /* printf("snac threw error (reason 0x%04x: %s)\n", reason, (reason<msgerrreasonslen)?msgerrreasons[reason]:"unknown"); */
+  owl_function_makemsg(msgerrreasons[reason]);
   
   return 1;
Index: commands.c
===================================================================
--- commands.c	(revision 2404c3a6cd47618aa1b8cbad3359b00b24d00262)
+++ commands.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -585,5 +585,6 @@
 	      "show version\n"
 	      "show view [<view>]\n"
-	      "show status\n",
+	      "show status\n"
+	      "show errors\n",
 
 	      "Show colors will display a list of valid colors for the\n"
@@ -600,4 +601,5 @@
 	      "for formatting messages.\n\n"
 	      "Show variables will list the names of all variables.\n\n"
+	      "Show errors will show a list of errors ecountered by Owl.\n\n"
 	      "SEE ALSO: filter, view, alias, bindkey, help\n"),
   
@@ -1922,4 +1924,6 @@
   } else if (!strcmp(argv[1], "status")) {
     owl_function_status();
+  } else if (!strcmp(argv[1], "errors")) {
+    owl_function_showerrs();
   } else {
     owl_function_makemsg("Unknown subcommand for 'show' command (see 'help show' for allowed args)");
Index: errqueue.c
===================================================================
--- errqueue.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
+++ errqueue.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -0,0 +1,23 @@
+#include "owl.h"
+
+void owl_errqueue_init(owl_errqueue *eq)
+{
+  owl_list_create(&(eq->errlist));
+}
+
+void owl_errqueue_append_err(owl_errqueue *eq, char *msg)
+{
+  owl_list_append_element(&(eq->errlist), owl_strdup(msg));
+}
+
+/* fmtext should already be initialized */
+void owl_errqueue_to_fmtext(owl_errqueue *eq, owl_fmtext *fm)
+{
+  int i, j;
+
+  j=owl_list_get_size(&(eq->errlist));
+  for (i=0; i<j; i++) {
+    owl_fmtext_append_normal(fm, owl_list_get_element(&(eq->errlist), i));
+    owl_fmtext_append_normal(fm, "\n");
+  }
+}
Index: functions.c
===================================================================
--- functions.c	(revision 8a54409ec514fc5044b26a52cd6ea9f60b347480)
+++ functions.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -67,5 +67,5 @@
   v=owl_global_get_current_view(&g);
   if (viewname && strcmp(viewname, owl_view_get_name(v))) {
-    owl_function_makemsg("No view named '%s'", viewname);
+    owl_function_error("No view named '%s'", viewname);
     return;
   }
@@ -218,5 +218,5 @@
   ret=owl_zwrite_create_from_line(&z, line);
   if (ret) {
-    owl_function_makemsg("Error in zwrite arugments");
+    owl_function_error("Error in zwrite arugments");
     owl_zwrite_free(&z);
     return;
@@ -343,5 +343,5 @@
   ret=owl_zcrypt_encrypt(cryptmsg, mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z));
   if (ret) {
-    owl_function_makemsg("Error in zcrypt, possibly no key found.  Message not sent.");
+    owl_function_error("Error in zcrypt, possibly no key found.  Message not sent.");
     owl_function_beep();
     owl_free(cryptmsg);
@@ -379,7 +379,13 @@
 void owl_function_aimwrite(char *to)
 {
+  int ret;
+  
   /*  send the message */
-  owl_aim_send_im(to, owl_editwin_get_text(owl_global_get_typwin(&g)));
-  owl_function_makemsg("AIM message sent.");
+  ret=owl_aim_send_im(to, owl_editwin_get_text(owl_global_get_typwin(&g)));
+  if (!ret) {
+    owl_function_makemsg("AIM message sent.");
+  } else {
+    owl_function_error("Could not send AIM message.");
+  }
 
   /* display the message as an outgoing message in the receive window */
@@ -410,5 +416,5 @@
     f=owl_global_get_filter(&g, filter);
     if (!f) {
-      owl_function_makemsg("No %s filter defined", filter);
+      owl_function_error("No %s filter defined", filter);
       return;
     }
@@ -434,5 +440,5 @@
 
   if (!found) {
-    owl_function_makemsg("already at last%s message%s%s",
+    owl_function_error("already at last%s message%s%s",
 			 skip_deleted?" non-deleted":"",
 			 filter?" in ":"", filter?filter:"");
@@ -460,5 +466,5 @@
     f=owl_global_get_filter(&g, filter);
     if (!f) {
-      owl_function_makemsg("No %s filter defined", filter);
+      owl_function_error("No %s filter defined", filter);
       return;
     }
@@ -483,5 +489,5 @@
 
   if (!found) {
-    owl_function_makemsg("already at first%s message%s%s",
+    owl_function_error("already at first%s message%s%s",
 			 skip_deleted?" non-deleted":"",
 			 filter?" in ":"", filter?filter:"");
@@ -538,5 +544,5 @@
   /* bail if there's no current message */
   if (owl_view_get_size(v) < 1) {
-    owl_function_makemsg("No current message to delete");
+    owl_function_error("No current message to delete");
     return;
   }
@@ -565,5 +571,5 @@
   
   if (owl_view_get_size(v) < 1) {
-    owl_function_makemsg("No current message to undelete");
+    owl_function_error("No current message to undelete");
     return;
   }
@@ -677,5 +683,5 @@
   } else {
     owl_function_beep();
-    owl_function_makemsg("Already full left");
+    owl_function_error("Already full left");
   }
 }
@@ -697,7 +703,7 @@
     owl_function_makemsg("Subscribed to messages from file.");
   } else if (ret==-1) {
-    owl_function_makemsg("Could not open file.");
+    owl_function_error("Could not open file.");
   } else {
-    owl_function_makemsg("Error subscribing to messages from file.");
+    owl_function_error("Error subscribing to messages from file.");
   }
 }
@@ -713,7 +719,7 @@
     owl_function_makemsg("Subscribed to login messages from file.");
   } else if (ret==-1) {
-    owl_function_makemsg("Could not open file for login subscriptions.");
+    owl_function_error("Could not open file for login subscriptions.");
   } else {
-    owl_function_makemsg("Error subscribing to login messages from file.");
+    owl_function_error("Error subscribing to login messages from file.");
   }
 }
@@ -776,41 +782,4 @@
 }
 
-void owl_function_makemsg(char *fmt, ...)
-{
-  va_list ap;
-  char buff[2048];
-
-  if (!owl_global_get_curs_msgwin(&g)) return;
-
-  va_start(ap, fmt);
-  werase(owl_global_get_curs_msgwin(&g));
-  
-  vsnprintf(buff, 2048, fmt, ap);
-  owl_function_debugmsg("makemsg: %s", buff);
-  waddstr(owl_global_get_curs_msgwin(&g), buff);  
-  wnoutrefresh(owl_global_get_curs_msgwin(&g));
-  owl_global_set_needrefresh(&g);
-  va_end(ap);
-}
-
-void owl_function_errormsg(char *fmt, ...)
-{
-  va_list ap;
-  char buff[2048];
-
-  if (!owl_global_get_curs_msgwin(&g)) return;
-
-  va_start(ap, fmt);
-  werase(owl_global_get_curs_msgwin(&g));
-  
-  vsnprintf(buff, 2048, fmt, ap);
-  owl_function_debugmsg("ERROR: %s", buff);
-  waddstr(owl_global_get_curs_msgwin(&g), buff);  
-  waddstr(owl_global_get_curs_msgwin(&g), "ERROR: ");  
-  wnoutrefresh(owl_global_get_curs_msgwin(&g));
-  owl_global_set_needrefresh(&g);
-  va_end(ap);
-}
-
 void owl_function_openurl()
 {
@@ -824,5 +793,5 @@
 
   if (webbrowser < 0 || webbrowser == OWL_WEBBROWSER_NONE) {
-    owl_function_makemsg("No browser selected");
+    owl_function_error("No browser selected");
     return;
   }
@@ -833,5 +802,5 @@
 
   if (!m || owl_view_get_size(v)==0) {
-    owl_function_makemsg("No current message selected");
+    owl_function_error("No current message selected");
     return;
   }
@@ -882,5 +851,5 @@
   } else {
     owl_function_beep();
-    owl_function_makemsg("Could not find URL to open.");
+    owl_function_error("Could not find URL to open.");
     return;
   }
@@ -890,5 +859,5 @@
     if (*ptr1 == '"' || *ptr1 == '\\') {
       owl_function_beep();
-      owl_function_makemsg("URL contains invalid characters.");
+      owl_function_error("URL contains invalid characters.");
       return;
     }
@@ -1162,5 +1131,5 @@
   ret=owl_zephyr_sub(class, inst, recip);
   if (ret) {
-    owl_function_makemsg("Error subscribing.");
+    owl_function_error("Error subscribing.");
   } else {
     owl_function_makemsg("Subscribed.");
@@ -1174,5 +1143,5 @@
   ret=owl_zephyr_unsub(class, inst, recip);
   if (ret) {
-    owl_function_makemsg("Error subscribing.");
+    owl_function_error("Error subscribing.");
   } else {
     owl_function_makemsg("Unsubscribed.");
@@ -1278,5 +1247,5 @@
   m=owl_view_get_element(v, owl_global_get_curmsg(&g));
   if (!m || owl_view_get_size(v)==0) {
-    owl_function_makemsg("No message selected\n");
+    owl_function_error("No message selected\n");
     return;
   }
@@ -1443,5 +1412,5 @@
 
   if (!m || owl_view_get_size(v)==0) {
-    owl_function_makemsg("No current message");
+    owl_function_error("No current message");
     return;
   }
@@ -1472,5 +1441,5 @@
     /* Bail if the curmsg isn't the last one displayed */
     if (curmsg != owl_mainwin_get_last_msg(owl_global_get_mainwin(&g))) {
-      owl_function_makemsg("The entire message is already displayed");
+      owl_function_error("The entire message is already displayed");
       return;
     }
@@ -1478,5 +1447,5 @@
     /* Bail if we're not truncated */
     if (!owl_mainwin_is_curmsg_truncated(owl_global_get_mainwin(&g))) {
-      owl_function_makemsg("The entire message is already displayed");
+      owl_function_error("The entire message is already displayed");
       return;
     }
@@ -1647,5 +1616,5 @@
     owl_global_set_needrefresh(&g);
   } else {
-    owl_function_makemsg("No message with id %d: unable to mark for (un)delete",id);
+    owl_function_error("No message with id %d: unable to mark for (un)delete",id);
   }
 }
@@ -1664,5 +1633,5 @@
   f=owl_global_get_filter(&g, "trash");
   if (!f) {
-    owl_function_makemsg("No trash filter defined");
+    owl_function_error("No trash filter defined");
     return;
   }
@@ -1787,5 +1756,5 @@
   
   if (owl_view_get_size(owl_global_get_current_view(&g))==0) {
-    owl_function_makemsg("No message selected");
+    owl_function_error("No message selected");
   } else {
     char *class, *inst, *to, *cc=NULL;
@@ -1793,5 +1762,5 @@
     m=owl_view_get_element(owl_global_get_current_view(&g), owl_global_get_curmsg(&g));
     if (!m) {
-      owl_function_makemsg("No message selected");
+      owl_function_error("No message selected");
       return;
     }
@@ -1801,5 +1770,5 @@
     if (f) {
       if (owl_filter_message_match(f, m)) {
-	owl_function_makemsg("Sorry, replies to this message have been disabled by the reply-lockout filter");
+	owl_function_error("Sorry, replies to this message have been disabled by the reply-lockout filter");
 	return;
       }
@@ -1808,5 +1777,5 @@
     /* admin */
     if (owl_message_is_type_admin(m)) {
-      owl_function_makemsg("You cannot reply to an admin message");
+      owl_function_error("You cannot reply to an admin message");
       return;
     }
@@ -2004,5 +1973,5 @@
 
   if (argc<2) {
-    owl_function_makemsg("Wrong number of arguments to the exec command");
+    owl_function_error("Wrong number of arguments to the exec command");
     return NULL;
   }
@@ -2047,5 +2016,5 @@
 
   if (argc<2) {
-    owl_function_makemsg("Wrong number of arguments to perl command");
+    owl_function_error("Wrong number of arguments to perl command");
     return NULL;
   }
@@ -2093,5 +2062,5 @@
   f=owl_global_get_filter(&g, filtname);
   if (!f) {
-    owl_function_makemsg("Unknown filter");
+    owl_function_error("Unknown filter %s", filtname);
     return;
   }
@@ -2142,5 +2111,5 @@
   f=owl_global_get_filter(&g, filtname);
   if (!f) {
-    owl_function_makemsg("Unknown filter");
+    owl_function_error("Unknown filter %s", filtname);
     return;
   }
@@ -2172,5 +2141,5 @@
 
   if (argc < 2) {
-    owl_function_makemsg("Wrong number of arguments to filter command");
+    owl_function_error("Wrong number of arguments to filter command");
     return;
   }
@@ -2180,5 +2149,5 @@
   /* don't touch the all filter */
   if (!strcmp(argv[1], "all")) {
-    owl_function_makemsg("You may not change the 'all' filter.");
+    owl_function_error("You may not change the 'all' filter.");
     return;
   }
@@ -2188,5 +2157,5 @@
     f=owl_global_get_filter(&g, argv[1]);
     if (!f) {
-      owl_function_makemsg("The filter '%s' does not exist.", argv[1]);
+      owl_function_error("The filter '%s' does not exist.", argv[1]);
       return;
     }
@@ -2202,5 +2171,5 @@
   if (ret==-1) {
     owl_free(f);
-    owl_function_makemsg("Invalid filter syntax");
+    owl_function_error("Invalid filter syntax");
     return;
   }
@@ -2262,5 +2231,5 @@
   f=owl_global_get_filter(&g, name);
   if (!f) {
-    owl_function_makemsg("There is no filter with that name");
+    owl_function_error("There is no filter named %s", name);
     return;
   }
@@ -2510,5 +2479,5 @@
 
   if (!m || owl_view_get_size(v)==0) {
-    owl_function_makemsg("No message selected\n");
+    owl_function_error("No message selected\n");
     return(NULL);
   }
@@ -2571,5 +2540,5 @@
 
   if (!m || owl_view_get_size(v)==0) {
-    owl_function_makemsg("No message selected\n");
+    owl_function_error("No message selected\n");
     return;
   }
@@ -2579,5 +2548,5 @@
       || owl_message_is_loginout(m)
       || !owl_message_is_type_zephyr(m)) {
-    owl_function_makemsg("smartzpunt doesn't support this message type.");
+    owl_function_error("smartzpunt doesn't support this message type.");
     return;
   }
@@ -2588,5 +2557,5 @@
       || (!strcasecmp(mclass, "message") && !strcasecmp(minst, "personal"))
       || (type && (!minst || !*minst|| *minst==' '))) {
-    owl_function_makemsg("smartzpunt can't safely do this for <%s,%s>",
+    owl_function_error("smartzpunt can't safely do this for <%s,%s>",
 			 mclass, minst);
   } else {
@@ -2614,5 +2583,5 @@
   f=owl_global_get_filter(&g, name);
   if (!f) {
-    owl_function_makemsg("Unknown filter");
+    owl_function_error("Unknown filter");
     return;
   }
@@ -2620,5 +2589,5 @@
   /* don't touch the all filter */
   if (!strcmp(name, "all")) {
-    owl_function_makemsg("You may not change the 'all' filter.");
+    owl_function_error("You may not change the 'all' filter.");
     return;
   }
@@ -2683,5 +2652,5 @@
   owl_free(buff);
   if (ret) {
-    owl_function_makemsg("Error creating filter for zpunt");
+    owl_function_error("Error creating filter for zpunt");
     owl_filter_free(f);
     return;
@@ -2716,5 +2685,5 @@
 {
   if (!owl_keyhandler_activate(owl_global_get_keyhandler(&g), keymap)) {
-    owl_function_makemsg("Unable to activate keymap '%s'", keymap);
+    owl_function_error("Unable to activate keymap '%s'", keymap);
   }
 }
@@ -2818,5 +2787,5 @@
   
   if (viewsize==0) {
-    owl_function_makemsg("No messages present");
+    owl_function_error("No messages present");
     return;
   }
@@ -2832,5 +2801,5 @@
   /* bounds check */
   if (start>=viewsize || start<0) {
-    owl_function_makemsg("No further matches found");
+    owl_function_error("No further matches found");
     return;
   }
@@ -2856,5 +2825,5 @@
   }
   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
-  owl_function_makemsg("No matches found");
+  owl_function_error("No matches found");
 }
 
@@ -2918,5 +2887,5 @@
       tmp=owl_global_get_homedir(&g);
       if (!tmp) {
-	owl_function_makemsg("Could not determine home directory");
+	owl_function_error("Could not determine home directory");
 	return;
       }
@@ -2929,5 +2898,5 @@
     f=fopen(ourfile, "r");
     if (!f) {
-      owl_function_makemsg("Error opening file %s: %s",
+      owl_function_error("Error opening file %s: %s",
 			   ourfile,
 			   strerror(errno) ? strerror(errno) : "");
@@ -2962,5 +2931,5 @@
       ret=ZLocateUser(buff, &numlocs, ZAUTH);
       if (ret!=ZERR_NONE) {
-	owl_function_makemsg("Error getting location for %s", buff);
+	owl_function_error("Error getting location for %s", buff);
 	continue;
       }
@@ -3015,5 +2984,5 @@
   file=fopen(filename, "w");
   if (!file) {
-    owl_function_makemsg("Error opening file");
+    owl_function_error("Error opening file");
     return;
   }
@@ -3107,5 +3076,5 @@
   file=fopen(filename, "a");
   if (!file) {
-    owl_function_makemsg("Error opening startupfile for new command");
+    owl_function_error("Error opening startupfile for new command");
     owl_free(filename);
     return;
@@ -3163,5 +3132,5 @@
   s=owl_global_get_style_by_name(&g, stylename);
   if (!s) {
-    owl_function_makemsg("No style named %s", stylename);
+    owl_function_error("No style named %s", stylename);
     return;
   }
@@ -3170,5 +3139,4 @@
   owl_function_calculate_topmsg(OWL_DIRECTION_DOWNWARDS);
   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
-  
 }
 
@@ -3191,2 +3159,57 @@
   owl_mainwin_redisplay(owl_global_get_mainwin(&g));
 }
+
+void owl_function_error(char *fmt, ...)
+{
+  va_list ap;
+  char buff[2048], buff2[2048];
+  char *date;
+  time_t now;
+
+  now=time(NULL);
+  date=owl_strdup(ctime(&now));
+  date[strlen(date)-1]='\0';
+
+  va_start(ap, fmt);
+
+  vsnprintf(buff, 2048, fmt, ap);
+  sprintf(buff2, "%s %s", date, buff);
+  owl_function_debugmsg("ERROR: %s", buff);
+  if (owl_global_get_curs_msgwin(&g)) {
+    werase(owl_global_get_curs_msgwin(&g));
+    waddstr(owl_global_get_curs_msgwin(&g), buff);  
+    wnoutrefresh(owl_global_get_curs_msgwin(&g));
+    owl_global_set_needrefresh(&g);
+  }
+  owl_errqueue_append_err(owl_global_get_errqueue(&g), buff2);
+  va_end(ap);
+  owl_free(date);
+}
+
+void owl_function_showerrs()
+{
+  owl_fmtext fm;
+
+  owl_fmtext_init_null(&fm);
+  owl_fmtext_append_normal(&fm, "Errors:\n\n");
+  owl_errqueue_to_fmtext(owl_global_get_errqueue(&g), &fm);
+  owl_function_popless_fmtext(&fm);
+}
+
+void owl_function_makemsg(char *fmt, ...)
+{
+  va_list ap;
+  char buff[2048];
+
+  if (!owl_global_get_curs_msgwin(&g)) return;
+
+  va_start(ap, fmt);
+  werase(owl_global_get_curs_msgwin(&g));
+  
+  vsnprintf(buff, 2048, fmt, ap);
+  owl_function_debugmsg("makemsg: %s", buff);
+  waddstr(owl_global_get_curs_msgwin(&g), buff);  
+  wnoutrefresh(owl_global_get_curs_msgwin(&g));
+  owl_global_set_needrefresh(&g);
+  va_end(ap);
+}
Index: global.c
===================================================================
--- global.c	(revision 2404c3a6cd47618aa1b8cbad3359b00b24d00262)
+++ global.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -102,4 +102,6 @@
   g->haveaim=0;
   owl_global_set_no_doaimevents(g);
+
+  owl_errqueue_init(&(g->errqueue));
 }
 
@@ -832,2 +834,7 @@
   return(&(g->aim_buddyinfo_timer));
 }
+
+owl_errqueue *owl_global_get_errqueue(owl_global *g)
+{
+  return(&(g->errqueue));
+}
Index: owl.c
===================================================================
--- owl.c	(revision f4d0975bed0618ba963347663b4b5de5825c0a22)
+++ owl.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -159,5 +159,10 @@
 			    "Basic message formatting.");
   owl_global_add_style(&g, s);
-
+#if 0
+  s=owl_malloc(sizeof(owl_style));
+  owl_style_create_internal(s, "vt", &owl_stylefunc_vt,
+			    "VT message formatting.");
+  owl_global_add_style(&g, s);
+#endif
   s=owl_malloc(sizeof(owl_style));
   owl_style_create_internal(s, "oneline", &owl_stylefunc_oneline,
@@ -544,4 +549,3 @@
   fprintf(stderr, "  -c      specify an alternate config file\n");
   fprintf(stderr, "  -t      set the tty name\n");
-  
 }
Index: owl.h
===================================================================
--- owl.h	(revision c5f3b461489c70bb84c7575cd4338048a8f9baf1)
+++ owl.h	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -21,6 +21,6 @@
 static const char owl_h_fileIdent[] = "$Id$";
 
-#define OWL_VERSION         2.0.8
-#define OWL_VERSION_STRING "2.0.8"
+#define OWL_VERSION         2.0.9-pre-1
+#define OWL_VERSION_STRING "2.0.9-pre-1"
 
 #define OWL_DEBUG 0
@@ -408,4 +408,8 @@
 } owl_timer;
 
+typedef struct _owl_errqueue {
+  owl_list errlist;
+} owl_errqueue;
+
 typedef struct _owl_global {
   owl_mainwin mw;
@@ -419,4 +423,5 @@
   owl_cmddict cmds;
   owl_context ctx;
+  owl_errqueue errqueue;
   int lines, cols;
   int curmsg, topmsg;
Index: stylefunc.c
===================================================================
--- stylefunc.c	(revision 03955f3be6650ea300bfb8cee96ec755421edbc6)
+++ stylefunc.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -529,2 +529,211 @@
 
 }
+
+void owl_stylefunc_vt(owl_fmtext *fm, owl_message *m)
+{
+#ifdef HAVE_LIBZEPHYR
+  char *body, *indent, *ptr, *zsigbuff, frombuff[LINE];
+  owl_fmtext fm_first, fm_other, fm_tmp;
+  ZNotice_t *n;
+#endif
+  char *sender, *hostname, *timestr, *classinst1, *classinst2;
+
+  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
+#ifdef HAVE_LIBZEPHYR
+    n=owl_message_get_notice(m);
+
+    /* get the body */
+    body=owl_malloc(strlen(owl_message_get_body(m))+30);
+    strcpy(body, owl_message_get_body(m));
+    
+    /* add a newline if we need to */
+    if (body[0]!='\0' && body[strlen(body)-1]!='\n') {
+      strcat(body, "\n");
+    }
+
+    owl_fmtext_init_null(&fm_tmp);
+    owl_fmtext_append_ztext(&fm_tmp, body);
+    owl_fmtext_init_null(&fm_first);
+    owl_fmtext_truncate_lines(&fm_tmp, 0, 1, &fm_first);
+
+    /* do the indenting into indent */
+    indent=owl_malloc(strlen(body)+owl_text_num_lines(body)*OWL_MSGTAB+10);
+    owl_text_indent(indent, body, 31);
+
+    owl_fmtext_free(&fm_tmp);
+    owl_fmtext_init_null(&fm_tmp);
+    owl_fmtext_append_ztext(&fm_tmp, indent);
+    owl_fmtext_init_null(&fm_other);
+    owl_fmtext_truncate_lines(&fm_tmp, 1, owl_fmtext_num_lines(&fm_tmp)-1, &fm_other);
+    owl_fmtext_free(&fm_tmp);
+    
+    /* edit the from addr for printing */
+    strcpy(frombuff, owl_message_get_sender(m));
+    ptr=strchr(frombuff, '@');
+    if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) {
+      *ptr='\0';
+    }
+    sender=owl_sprintf("%-9.9s", frombuff);
+
+    hostname=owl_sprintf("%-9.9s", owl_message_get_hostname(m));
+    timestr=owl_strdup("00:00");
+    classinst1=owl_sprintf("<%s>[%s]", owl_message_get_class(m), owl_message_get_instance(m));
+    classinst2=owl_sprintf("%-9.9s", classinst1);
+    
+    /* set the message for printing */
+    owl_fmtext_append_normal(fm, OWL_TABSTR);
+    
+    if (owl_message_is_ping(m) && owl_message_is_private(m)) {
+      owl_fmtext_append_bold(fm, "PING");
+      owl_fmtext_append_normal(fm, " from ");
+      owl_fmtext_append_bold(fm, frombuff);
+      owl_fmtext_append_normal(fm, "\n");
+    } else if (owl_message_is_loginout(m)) {
+      char *ptr, *host, *tty;
+      int len;
+
+      ptr=owl_zephyr_get_field(n, 1, &len);
+      host=owl_malloc(len+10);
+      strncpy(host, ptr, len);
+      host[len]='\0';
+
+      ptr=owl_zephyr_get_field(n, 3, &len);
+      tty=owl_malloc(len+10);
+      strncpy(tty, ptr, len);
+      tty[len]='\0';
+      
+      if (owl_message_is_login(m)) {
+	owl_fmtext_append_bold(fm, "LOGIN");
+      } else if (owl_message_is_logout(m)) {
+	owl_fmtext_append_bold(fm, "LOGOUT");
+      }
+      owl_fmtext_append_normal(fm, " for ");
+      ptr=short_zuser(owl_message_get_instance(m));
+      owl_fmtext_append_bold(fm, ptr);
+      owl_free(ptr);
+      owl_fmtext_append_normal(fm, " at ");
+      owl_fmtext_append_normal(fm, host);
+      owl_fmtext_append_normal(fm, " ");
+      owl_fmtext_append_normal(fm, tty);
+      owl_fmtext_append_normal(fm, "\n");
+
+      owl_free(host);
+      owl_free(tty);
+    } else {
+      owl_fmtext_append_normal(fm, sender);
+      owl_fmtext_append_normal(fm, "|");
+      owl_fmtext_append_normal(fm, hostname);
+      owl_fmtext_append_normal(fm, " ");
+      owl_fmtext_append_normal(fm, timestr);
+      owl_fmtext_append_normal(fm, " ");
+      owl_fmtext_append_normal(fm, classinst2);
+
+      owl_fmtext_append_normal(fm, "   ");
+      owl_fmtext_append_fmtext(fm, &fm_first);
+      owl_fmtext_append_fmtext(fm, &fm_other);
+
+      owl_fmtext_free(&fm_other);
+      owl_fmtext_free(&fm_first);
+      
+      /* make private messages bold for smaat users */
+      if (owl_global_is_userclue(&g, OWL_USERCLUE_CLASSES)) {
+	if (owl_message_is_personal(m)) {
+	  owl_fmtext_addattr((&m->fmtext), OWL_FMTEXT_ATTR_BOLD);
+	}
+      }
+    }
+
+    owl_free(sender);
+    owl_free(hostname);
+    owl_free(timestr);
+    owl_free(classinst1);
+    owl_free(classinst2);
+    
+    owl_free(body);
+    owl_free(indent);
+#endif
+  } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) {
+    char *indent, *text, *zsigbuff, *foo;
+    
+    text=owl_message_get_body(m);
+    
+    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
+    owl_text_indent(indent, text, OWL_MSGTAB);
+    owl_fmtext_append_normal(fm, OWL_TABSTR);
+    owl_fmtext_append_normal(fm, "Zephyr sent to ");
+    foo=short_zuser(owl_message_get_recipient(m));
+    owl_fmtext_append_normal(fm, foo);
+    owl_free(foo);
+    owl_fmtext_append_normal(fm, "  (Zsig: ");
+    
+    zsigbuff=owl_malloc(strlen(owl_message_get_zsig(m))+30);
+    owl_message_pretty_zsig(m, zsigbuff);
+    owl_fmtext_append_ztext(fm, zsigbuff);
+    owl_free(zsigbuff);
+    
+    owl_fmtext_append_normal(fm, ")");
+    owl_fmtext_append_normal(fm, "\n");
+    owl_fmtext_append_ztext(fm, indent);
+    if (text[strlen(text)-1]!='\n') {
+      owl_fmtext_append_normal(fm, "\n");
+    }
+    
+    owl_free(indent);
+  } else if (owl_message_is_type_aim(m)) {
+    char *indent;
+    
+    if (owl_message_is_loginout(m)) {
+      owl_fmtext_append_normal(fm, OWL_TABSTR);
+      if (owl_message_is_login(m)) {
+	owl_fmtext_append_bold(fm, "AIM LOGIN");
+      } else {
+	owl_fmtext_append_bold(fm, "AIM LOGOUT");
+      }
+      owl_fmtext_append_normal(fm, " for ");
+      owl_fmtext_append_normal(fm, owl_message_get_sender(m));
+      owl_fmtext_append_normal(fm, "\n");
+    } else if (owl_message_is_direction_in(m)) {
+      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
+      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
+      owl_fmtext_append_bold(fm, OWL_TABSTR);
+      owl_fmtext_append_bold(fm, "AIM from ");
+      owl_fmtext_append_bold(fm, owl_message_get_sender(m));
+      owl_fmtext_append_bold(fm, "\n");
+      owl_fmtext_append_bold(fm, indent);
+      if (indent[strlen(indent)-1]!='\n') {
+	owl_fmtext_append_normal(fm, "\n");
+      }
+      owl_free(indent);
+    } else if (owl_message_is_direction_out(m)) {
+      indent=owl_malloc(strlen(owl_message_get_body(m))+owl_text_num_lines(owl_message_get_body(m))*OWL_MSGTAB+10);
+      owl_text_indent(indent, owl_message_get_body(m), OWL_MSGTAB);
+      owl_fmtext_append_normal(fm, OWL_TABSTR);
+      owl_fmtext_append_normal(fm, "AIM sent to ");
+      owl_fmtext_append_normal(fm, owl_message_get_recipient(m));
+      owl_fmtext_append_normal(fm, "\n");
+      owl_fmtext_append_ztext(fm, indent);
+      if (indent[strlen(indent)-1]!='\n') {
+	owl_fmtext_append_normal(fm, "\n");
+      }
+      owl_free(indent);
+    }
+  } else if (owl_message_is_type_admin(m)) {
+    char *text, *header, *indent;
+    
+    text=owl_message_get_body(m);
+    header=owl_message_get_attribute_value(m, "adminheader");
+    
+    indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10);
+    owl_text_indent(indent, text, OWL_MSGTAB);
+    owl_fmtext_append_normal(fm, OWL_TABSTR);
+    owl_fmtext_append_bold(fm, "OWL ADMIN ");
+    owl_fmtext_append_ztext(fm, header);
+    owl_fmtext_append_normal(fm, "\n");
+    owl_fmtext_append_ztext(fm, indent);
+    if (text[strlen(text)-1]!='\n') {
+      owl_fmtext_append_normal(fm, "\n");
+    }
+    
+    owl_free(indent);
+  }
+}
Index: zephyr.c
===================================================================
--- zephyr.c	(revision f1e629de3f6889c21f5f9dd7225e11c4fe9408b4)
+++ zephyr.c	(revision ec6ff526f80f4544b68f01e84ccd88c783e54326)
@@ -381,5 +381,5 @@
   ZFreeNotice(&notice);
   if (ret!=ZERR_NONE) {
-    owl_function_makemsg("Error sending zephyr");
+    owl_function_error("Error sending zephyr");
     return(ret);
   }
@@ -413,7 +413,7 @@
 
   if (retnotice->z_kind == SERVNAK) {
-    owl_function_makemsg("Authorization failure sending zephyr");
+    owl_function_error("Authorization failure sending zephyr");
   } else if ((retnotice->z_kind != SERVACK) || !retnotice->z_message_len) {
-    owl_function_makemsg("Detected server failure while receiving acknowledgement");
+    owl_function_error("Detected server failure while receiving acknowledgement");
   } else if (!strcmp(retnotice->z_message, ZSRVACK_SENT)) {
     if (!strcasecmp(retnotice->z_opcode, "ping")) {
@@ -422,21 +422,21 @@
 	       !strcasecmp(retnotice->z_class_inst, "personal")) {
       tmp=short_zuser(retnotice->z_recipient);
-      owl_function_makemsg("Message sent to %s.", tmp);
+      owl_function_error("Message sent to %s.", tmp);
       free(tmp);
     } else {
-      owl_function_makemsg("Message sent to -c %s -i %s\n", retnotice->z_class, retnotice->z_class_inst);
+      owl_function_error("Message sent to -c %s -i %s\n", retnotice->z_class, retnotice->z_class_inst);
     }
   } else if (!strcmp(retnotice->z_message, ZSRVACK_NOTSENT)) {
     if (strcasecmp(retnotice->z_class, "message")) {
-      owl_function_makemsg("Not logged in or not subscribing to class %s, instance %s",
+      owl_function_error("Not logged in or not subscribing to class %s, instance %s",
 			   retnotice->z_class, retnotice->z_class_inst);
     } else {
       tmp = short_zuser(retnotice->z_recipient);
-      owl_function_makemsg("%s: Not logged in or subscribing to messages.", 
+      owl_function_error("%s: Not logged in or subscribing to messages.", 
 			   tmp);
       owl_free(tmp);
     }
   } else {
-    owl_function_makemsg("Internal error on ack (%s)", retnotice->z_message);
+    owl_function_error("Internal error on ack (%s)", retnotice->z_message);
   }
 }
@@ -532,5 +532,5 @@
   ret=ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH);
   if (ret != ZERR_NONE) {
-    owl_function_makemsg("Error locating user");
+    owl_function_error("Error locating user %s", user);
   }
 
@@ -568,5 +568,5 @@
   file=fopen(subsfile, "r");
   if (!file) {
-    owl_function_makemsg("Error opening file %s", subsfile);
+    owl_function_error("Error opening file %s", subsfile);
     owl_free(line);
     return;
@@ -574,5 +574,5 @@
   while (fgets(buff, LINE, file)!=NULL) {
     if (!strcasecmp(buff, line)) {
-      owl_function_makemsg("Subscription already present in %s", subsfile);
+      owl_function_error("Subscription already present in %s", subsfile);
       owl_free(line);
       return;
@@ -584,5 +584,5 @@
   file=fopen(subsfile, "a");
   if (!file) {
-    owl_function_makemsg("Error opening file %s for writing", subsfile);
+    owl_function_error("Error opening file %s for writing", subsfile);
     owl_free(line);
     return;
@@ -691,5 +691,5 @@
   owl_free(filename);
   if (!file) {
-    owl_function_makemsg("Error opening zephyr buddy file for append");
+    owl_function_error("Error opening zephyr buddy file for append");
     return;
   }
