On Tue, Jun 01, 1999 at 15:34:46 +0200, Gerrit Holl wrote:
> On Mon, May 31, 1999 at 11:39:10AM +0200, Byrial Jensen wrote 19 lines To 
>[EMAIL PROTECTED]:
> > If you like, I could make a patch for you with a new $reply_weed
> > configuration variable -- it would only take a few minutes.

I've had some very busy days, but here it comes. I only had a
version 0.95.4 at hand to make the patch against, but I think that
it can be used unchanged with all newer versions too. If not, I will
update it to 0.95.6 when it is officially released (soon AFAIK).

To really make it fun, I also wrote a couple of macros to define
"smart" weeding, i.e. weeding in all cases but if you are viewing
the article full headers.

-- 
Byrial
diff -X excludes -udpr mutt-0.95.4-org/doc/manual.sgml.in 
mutt-0.95.4/doc/manual.sgml.in
--- mutt-0.95.4-org/doc/manual.sgml.in  Thu Feb 11 13:41:53 1999
+++ mutt-0.95.4/doc/manual.sgml.in      Wed Jun  2 22:39:55 1999
@@ -2886,8 +2886,10 @@ set, the user defined header fields are 
 Type: boolean<newline>
 Default: unset
 
-When set, this variable causes Mutt to include the <em/full/ header of
+When set, this variable causes Mutt to include the header of
 the message you are replying to into the edit buffer.
+The setting of <ref id="reply_weed" name="reply_weed"> decides whether
+a full or weeded header is included.
 
 <sect2>help<label id="help">
 <p>
@@ -3785,6 +3787,14 @@ Reply-To: header field when replying to 
 use the address in the From: header field instead.  This option is useful for
 reading a mailing list that sets the Reply-To: header field to the list address
 and you want to send a private message to the author of a message.
+
+<sect2>reply&lowbar;weed<label id="reply_weed">
+<p>
+Type: boolean<newline>
+Default: unset
+
+When <em/set/, the quoted message headers will be weeded when replying
+with <ref id="header" name="header"> set.
 
 <sect2>resolve<label id="resolve">
 <p>
diff -X excludes -udpr mutt-0.95.4-org/init.h mutt-0.95.4/init.h
--- mutt-0.95.4-org/init.h      Wed Feb 10 17:20:11 1999
+++ mutt-0.95.4/init.h  Wed Jun  2 22:46:32 1999
@@ -237,6 +237,7 @@ struct option_t MuttVars[] = {
   { "record",          DT_PATH, R_NONE, UL &Outbox, UL "" },
   { "reply_self",      DT_BOOL, R_NONE, OPTREPLYSELF, 0 },
   { "reply_to",                DT_QUAD, R_NONE, OPT_REPLYTO, M_ASKYES },
+  { "reply_weed",      DT_BOOL, R_NONE, OPTREPLYWEEDHEADER, 0 },
   { "resolve",         DT_BOOL, R_NONE, OPTRESOLVE, 1 },
   { "reverse_alias",   DT_BOOL, R_BOTH, OPTREVALIAS, 0 },
   { "reverse_name",    DT_BOOL, R_BOTH, OPTREVNAME, 0 },
diff -X excludes -udpr mutt-0.95.4-org/mutt.h mutt-0.95.4/mutt.h
--- mutt-0.95.4-org/mutt.h      Thu Mar  4 08:16:49 1999
+++ mutt-0.95.4/mutt.h  Wed Jun  2 20:08:33 1999
@@ -320,6 +320,7 @@ enum
   OPTPROMPTAFTER,
   OPTREADONLY,
   OPTREPLYSELF,
+  OPTREPLYWEEDHEADER,
   OPTRESOLVE,
   OPTREVALIAS,
   OPTREVNAME,
diff -X excludes -udpr mutt-0.95.4-org/send.c mutt-0.95.4/send.c
--- mutt-0.95.4-org/send.c      Thu Jan 14 00:55:59 1999
+++ mutt-0.95.4/send.c  Wed Jun  2 22:46:02 1999
@@ -352,7 +352,8 @@ static int include_forward (CONTEXT *ctx
 static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out)
 {
   char buffer[STRING];
-  int flags = M_CM_PREFIX | M_CM_DECODE;
+  int cmflags = M_CM_PREFIX | M_CM_DECODE;
+  int chflags = CH_DECODE;
 
 
 
@@ -376,9 +377,15 @@ static int include_reply (CONTEXT *ctx, 
     fputc ('\n', out);
   }
   if (!option (OPTHEADER))
-    flags |= M_CM_NOHEADER;
+    cmflags |= M_CM_NOHEADER;
+  else if (option (OPTREPLYWEEDHEADER))
+  {
+    chflags |= CH_WEED;
+    cmflags |= M_CM_WEED;
+  }
+
   mutt_parse_mime_message (ctx, cur);
-  mutt_copy_message (out, ctx, cur, flags, CH_DECODE);
+  mutt_copy_message (out, ctx, cur, cmflags, chflags);
   if (PostIndentString)
   {
     mutt_make_string (buffer, sizeof (buffer), PostIndentString, ctx, cur);
# smart-weed.muttrc
# by Byrial Jensen <[EMAIL PROTECTED]> 1999-06-03
#
# Defines or redefines these key sequences in appropiate menus:
#
#   f        forward with smart header weeding (i.e. the headers
#            are weeded if and only if displaying full headers)
#
#   r        Reply without headers
#   g        Group reply without headers
#   L        List reply without headers
#
#   <ESC>hr  Reply with smart header weeding
#   <ESC>hg  Group reply with smart header weeding
#   <ESC>hL  List reply with smart header weeding
#
#   <ESC>hs  Set $header
#   <ESC>hu  Unset $header
#
# (Which key sequences would have been better to use?)

# index macros:

macro index <ESC>hs "<enter-command>set header<enter>"   "set \$header"
macro index <ESC>hu "<enter-command>unset header<enter>" "unset \$header"

macro index h \
        "<display-headers><enter-command>unset forward_weed reply_weed<enter>"\
        "display message with full headers"
macro index <space> \
        "<display-message><enter-command>set forward_weed reply_weed<enter>" \
        "display a message"
macro index <enter> \
        "<space>" \
        "display a message"

macro index  f \
        "<enter-command>set forward_weed<enter><forward-message>" \
        "forward a message with comments"

macro index <ESC>hr \
        "<enter-command>set reply_weed header<enter><reply>" \
        "reply to a message with weeded headers"
macro index <ESC>hg \
        "<enter-command>set reply_weed header<enter><group-reply>" \
        "reply to all recipients with weeded headers"
macro index <ESC>hL \
        "<enter-command>set reply_weed header<enter><list-reply>" \
        "reply to specified mailing list with weeded headers"

macro index r "<ESC>hu<reply>"       "reply to a message"
macro index g "<ESC>hu<group-reply>" "reply to all recipients"
macro index L "<ESC>hu<list-reply>"  "reply to specified mailing list"

# pager macros:

macro pager <ESC>hs "<enter-command>set header<enter>"   "set \$header"
macro pager <ESC>hu "<enter-command>unset header<enter>" "unset \$header"

macro pager  h \
        "<display-headers><enter-command>toggle forward_weed reply_weed<enter>"\
        "toggle displaying message with full headers"

macro pager <ESC>hr \
        "<ESC>hs<reply>" \
        "reply to a message with smart header wedding"
macro pager <ESC>hg \
        "<ESC>hs<group-reply>" \
        "reply to all recipients with smart header weeding"
macro pager <ESC>hL \
        "<ESC>hs<list-reply>" \
        "reply to specified mailing list with smart header weeding"

macro pager r "<ESC>hu<reply>"       "reply to a message"
macro pager g "<ESC>hu<group-reply>" "reply to all recipients"
macro pager L "<ESC>hu<list-reply>"  "reply to specified mailing list"

# attach macros:

macro attach <ESC>hs "<enter-command>set header<enter>"   "set \$header"
macro attach <ESC>hu "<enter-command>unset header<enter>" "unset \$header"

macro attach f \
        "<enter-command>set forward_weed<enter><forward-message>" \
        "forward a message with comments"

macro attach <ESC>hr \
        "<ESC>hs<reply>" \
        "reply to a message with smart header wedding"
macro attach <ESC>hg \
        "<ESC>hs<group-reply>" \
        "reply to all recipients with smart header weeding"
macro attach <ESC>hL \
        "<ESC>hs<list-reply>" \
        "reply to specified mailing list with smart header weeding"

macro attach r "<ESC>hu<reply>"       "reply to a message"
macro attach g "<ESC>hu<group-reply>" "reply to all recipients"
macro attach L "<ESC>hu<list-reply>"  "reply to specified mailing list"

Reply via email to