Hi,

I created two new options for mutt, which I believe are useful for a lot of 
people.

* delete_tilde: Some editors don't behave: They leave backup files with 
  a tilde laaying around. If set, mutt takes care of those ...
* highlight_unread: As the color index option does not parse the flags,
  it is not possible to highlight unread messages with color index.
  highlight_unread will do it ...
  
For both problems, more general approaches could have been taken.
But those are still nice options ...

Patch is against 1.0pre3

PS: Please Cc: answers, as I'm not subscribed.
-- 
Kurt Garloff  <[EMAIL PROTECTED]>                             Wuppertal, FRG
PGP2 key: See mail header, key servers            Linux kernel development
SuSE GmbH, Nürnberg, FRG               SCSI drivers: tmscsim(DC390), DC395
diff -uNr mutt-1.0pre3/ChangeLog mutt-1.0pre3.new/ChangeLog
--- mutt-1.0pre3/ChangeLog      Sat Sep 25 09:06:06 1999
+++ mutt-1.0pre3.new/ChangeLog  Wed Oct 13 22:38:39 1999
@@ -1,0 +1,6 @@
+Wed Oct 13 22:37:12 1999  Kurt Garloff  <[EMAIL PROTECTED]>
+
+       * Added two new options: "delete_tilde" to clean up editor
+       left backup files and "highlight_unread" to display unread
+       messages in inverse colours in the message index.
+       
diff -uNr mutt-1.0pre3/curs_lib.c mutt-1.0pre3.new/curs_lib.c
--- mutt-1.0pre3/curs_lib.c     Wed Sep  1 17:39:20 1999
+++ mutt-1.0pre3.new/curs_lib.c Wed Oct 13 22:22:34 1999
@@ -120,12 +120,17 @@
 
 void mutt_edit_file (const char *editor, const char *data)
 {
-  char cmd[LONG_STRING];
+  char cmd[LONG_STRING], bkup[LONG_STRING];
   
   endwin ();
   mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data);
   if (mutt_system (cmd) == -1)
     mutt_error (_("Error running \"%s\"!"), cmd);
+  if (option (OPTDELTILDE)) 
+  {
+    strcpy (bkup, data); strcat (bkup, "~");
+    mutt_unlink (bkup);
+  }
   keypad (stdscr, TRUE);
   clearok (stdscr, TRUE);
 }
diff -uNr mutt-1.0pre3/curs_main.c mutt-1.0pre3.new/curs_main.c
--- mutt-1.0pre3/curs_main.c    Thu Aug 26 09:10:01 1999
+++ mutt-1.0pre3.new/curs_main.c        Wed Oct 13 22:27:04 1999
@@ -1730,11 +1730,15 @@
   if (!curhdr)
     return;
   
+  curhdr->pair = ColorDefs[MT_COLOR_NORMAL];
   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];
 }
diff -uNr mutt-1.0pre3/doc/manual.sgml.in mutt-1.0pre3.new/doc/manual.sgml.in
--- mutt-1.0pre3/doc/manual.sgml.in     Sat Sep 11 15:11:10 1999
+++ mutt-1.0pre3.new/doc/manual.sgml.in Wed Oct 13 22:34:36 1999
@@ -2729,6 +2729,14 @@
 will automatically be purged without prompting.  If set to <em/no/, messages
 marked for deletion will be kept in the mailbox.
 
+<sect2>delete&lowbar;tilde<label id="delete_tilde">
+<p>
+Type: boolean<newline>
+Default: unset
+
+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.
+
 <sect2>dsn&lowbar;notify<label id="dsn_notify">
 <p>
 Type: string<newline>
@@ -2954,6 +2962,14 @@
 domain part to addresses.  This variable does not affect
 the generation, and it will not lead to the cut-off of
 first-level domains.
+
+<sect2>highlight&lowbar;unread<label id="highlight_unread">
+<p>
+Type: boolean<newline>
+Default: unset
+
+When set, unread messages will be highlighted by inverting the colors
+of the respective line in the message index.
 
 <sect2>history<label id="history">
 <p>
diff -uNr mutt-1.0pre3/init.h mutt-1.0pre3.new/init.h
--- mutt-1.0pre3/init.h Thu Sep  2 18:28:42 1999
+++ mutt-1.0pre3.new/init.h     Wed Oct 13 22:19:23 1999
@@ -96,6 +96,7 @@
   { "date_format",     DT_STR,  R_BOTH, UL &DateFmt, UL "!%a, %b %d, %Y at %I:%M:%S%p 
%Z" },
   { "default_hook",    DT_STR,  R_NONE, UL &DefaultHook, UL "~f %s !~P | (~P ~~C %s)" 
},
   { "delete",          DT_QUAD, R_NONE, OPT_DELETE, M_ASKYES },
+  { "delete_tilde",    DT_BOOL, R_NONE, OPTDELTILDE, 0 },
   { "dsn_notify",      DT_STR,  R_NONE, UL &DsnNotify, UL "" },
   { "dsn_return",      DT_STR,  R_NONE, UL &DsnReturn, UL "" },
   { "edit_headers",    DT_BOOL, R_NONE, OPTEDITHDRS, 0 },
@@ -121,6 +122,7 @@
   { "header",          DT_BOOL, R_NONE, OPTHEADER, 0 },
   { "help",            DT_BOOL, R_BOTH, OPTHELP, 1 },
   { "hidden_host",     DT_BOOL, R_NONE, OPTHIDDENHOST, 0 },
+  { "highlight_unread",        DT_BOOL, R_NONE, OPTHILIGHTUNREAD, 0 },
   { "history",         DT_NUM,  R_NONE, UL &HistSize, 10 },
   { "hostname",                DT_STR,  R_NONE, UL &Fqdn, 0 },
 #ifdef USE_IMAP
diff -uNr mutt-1.0pre3/mutt.h mutt-1.0pre3.new/mutt.h
--- mutt-1.0pre3/mutt.h Wed Sep  1 22:18:46 1999
+++ mutt-1.0pre3.new/mutt.h     Wed Oct 13 22:18:54 1999
@@ -388,7 +388,9 @@
   OPTDONTHANDLEPGPKEYS,        /* (pseudo) used to extract PGP keys */
 #endif
 
-
+  /* added [EMAIL PROTECTED], 99/10/13 */
+  OPTDELTILDE,         /* delete editor backup files ~ */
+  OPTHILIGHTUNREAD,    /* highlight unread messages by inverting them */
 
 
   OPTMAX

PGP signature

Reply via email to