File mutt-newopts-1.5.diff of Package mutt

Index: mutt-1.5.21/curs_lib.c
===================================================================
--- mutt-1.5.21.orig/curs_lib.c
+++ mutt-1.5.21/curs_lib.c
@@ -170,17 +170,22 @@ void mutt_clear_error (void)
 }
 
 void mutt_edit_file (const char *editor, const char *data)
 {
-  char cmd[LONG_STRING];
+  char cmd[LONG_STRING], bkup[LONG_STRING];
   
   mutt_endwin (NULL);
   mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data);
   if (mutt_system (cmd))
   {
     mutt_error (_("Error running \"%s\"!"), cmd);
     mutt_sleep (2);
   }
+  if (option (OPTDELTILDE))
+  {
+    strcpy (bkup, data); strcat (bkup, "~");
+    mutt_unlink (bkup);
+  }
 #if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
   /* the terminal may have been resized while the editor owned it */
   mutt_resize_screen ();
 #endif
Index: mutt-1.5.21/curs_main.c
===================================================================
--- mutt-1.5.21.orig/curs_main.c
+++ mutt-1.5.21/curs_main.c
@@ -2292,8 +2292,16 @@ void mutt_set_header_color (CONTEXT *ctx
   for (color = ColorIndexList; color; color = color->next)
    if (mutt_pattern_exec (color->color_pattern, M_MATCH_FULL_ADDRESS, ctx, curhdr))
    {
       curhdr->pair = color->pair;
+      if (option (OPTHILIGHTUNREAD) && !curhdr->read)
+      {
+	curhdr->pair |= A_REVERSE; curhdr->pair ^= A_BOLD;
+      }
       return;
    }
   curhdr->pair = ColorDefs[MT_COLOR_NORMAL];
+  if (option (OPTHILIGHTUNREAD) && !curhdr->read)
+  {
+    curhdr->pair |= A_REVERSE; curhdr->pair ^= A_BOLD;
+  }
 }
Index: mutt-1.5.21/init.h
===================================================================
--- mutt-1.5.21.orig/init.h
+++ mutt-1.5.21/init.h
@@ -593,8 +593,16 @@ struct option_t MuttVars[] = {
   ** synchronizing a mailbox.  If set to \fIyes\fP, messages marked for
   ** deleting will automatically be purged without prompting.  If set to
   ** \fIno\fP, messages marked for deletion will be kept in the mailbox.
   */
+  { "delete_tilde",	DT_BOOL, R_NONE, OPTDELTILDE, 0 },
+  /*
+  ** .pp
+  ** When set, mutt cleans up the backup file, many editors leave behind.
+  ** The name of the deleted file will be the name of the edited file with
+  ** a tilde appended.
+  **
+  */
   { "delete_untag",	DT_BOOL, R_NONE, OPTDELETEUNTAG, 1 },
   /*
   ** .pp
   ** If this option is \fIset\fP, mutt will untag messages when marking them
@@ -953,8 +961,14 @@ struct option_t MuttVars[] = {
   ** when adding the domain part to addresses.  This variable does not
   ** affect the generation of Message-IDs, and it will not lead to the
   ** cut-off of first-level domains.
   */
+  { "highlight_unread",	DT_BOOL, R_NONE, OPTHILIGHTUNREAD, 0 },
+  /*
+  ** .pp
+  ** When set, unread messages will be highlighted by inverting the colors
+  ** of the respective line in the message index.
+  */
   { "hide_limited",	DT_BOOL, R_TREE|R_INDEX, OPTHIDELIMITED, 0 },
   /*
   ** .pp
   ** When \fIset\fP, mutt will not show the presence of messages that are hidden
Index: mutt-1.5.21/mutt.h
===================================================================
--- mutt-1.5.21.orig/mutt.h
+++ mutt-1.5.21/mutt.h
@@ -519,8 +519,12 @@ enum
   OPTPGPCHECKTRUST,	/* (pseudo) used by pgp_select_key () */
   OPTDONTHANDLEPGPKEYS,	/* (pseudo) used to extract PGP keys */
   OPTUNBUFFEREDINPUT,   /* (pseudo) don't use key buffer */
 
+  /* added garloff@suse.de, 99/10/13 */
+  OPTDELTILDE,		/* delete editor backup files ~ */
+  OPTHILIGHTUNREAD,	/* highlight unread messages by inverting them */
+
   OPTMAX
 };
 
 #define mutt_bit_alloc(n) calloc ((n + 7) / 8, sizeof (char))
openSUSE Build Service is sponsored by