[darcs-devel] darcs patch: Add support to make_email for optional h... (and 1 more)

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Mon Jan 16 09:04:31 PST 2006


> I suppose I'll change the option name to --references as well.

Oh, I didn't notice that.  Yuck.  What about
  
    darcs send \
        --mail-header "References: <id at gmail.com> <id at microsoft.com>" \
        --mail-header "In-reply-to: <id at microsoft.com>" \
        --mail-header "Precedence: bulk"

In other words, the --mail-header flag is allowed multiple times, and
each instance adds a new header to the message.  Order should be
preserved, so we can add order-sensitive headers too (yes, there are
some).

There should also be a --discard-mail-header flag, that discards all
previously accumulated instances of a given header.  So you can say

    darcs send \
        --discard-mail-header "From:" \
        --mail-header "From: <bill at microsoft.com>"

and get only one From header.  (Recall that header names are not
case-sensitive, by the way.)

>> > If people prefer that we give in-reply-to its own parameter, I won't
>> > fight it, but I worry about huge parameter lists and a bunch of
>> > if-thens.

>> Quite the opposite.  An alternative implementation would be to pass
>> the extra headers to sendEmail and sendEmailDoc, and consolidate all
>> the header arguments (From, To, Subject, Cc) into a single argument.
>> (I'm quite willing to commit the current patch if you're happier with
>> that.)

> I do think it may be a good idea to consolidate the header arguments. 
> And that does help keep the parameter list from getting too big.  But
> then we still have the potential problem of having a bunch of Maybe
> arguments that have to be checked.  So I think that perhaps
> consolidating the header arguments but keeping the optional parameters
> as a list is the best solution.

I'm not following.  I'm thinking of

  sendEmailDoc ::
    [(String, String)] -> String -> String -> Doc -> Doc -> Doc -> IO ()

where the first value is an ordered list of (header, value) strings.

> [1] http://www.jwz.org/doc/threading.html

JWZ is always right.

                                        Juliusz




More information about the darcs-devel mailing list