lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev Patch for mailcap viewer order


From: pg
Subject: Re: lynx-dev Patch for mailcap viewer order
Date: Fri, 15 Jan 1999 00:21:28 -0700 (MST)

In a recent note, Klaus Weide said:

> Date: Thu, 14 Jan 1999 07:55:32 -0600 (CST)
> 
> * Lynx was using the wrong precedence for entries within a mailcap
>   (relative to other entries from the same file): RFC 1524 says

Thanks.  I've whined about this on this list a couple times;
merely because it was inconsistent with metamail -- I didn't
know it contravened a RFC.

>   Maybe it should be made configurable whether Lynx's traditional
>   precedence or the new one is used; currently there is just a #define
>   in HTInit.c which could be changed to revert to traditional behavior.
> 
I'd vote "no".  It's merely instituting a perpetual enticement to
users to create mailcap files which may work with Lynx, but will
fail with other MIME lients.

>   PRIVATE int HTLoadTypesConfigFile ARGS1(
>       char *,         fn)
>   {
> !     int result = 0;
> !     HTList * saved = HTPresentations;
> ! 
> !     if (reverse_mailcap) {          /* temporarily hide existing list */
> !     HTPresentations = NULL;
> !     }
> ! 
> !     result = ProcessMailcapFile(fn);
> ! 
> !     if (reverse_mailcap) {
> !     if (result && HTPresentations) {
> !         HTList_reverse(HTPresentations);
> !         HTList_appendList(HTPresentations, saved);
> !         FREE(saved);
> !     } else {
> !         HTPresentations = saved;
> !     }
> !     }
> !     return result;
>   }
>   
But bear with my reviewer's comments:

I'd urge that the utilities HTList_reverse and HTList_appendList
be made tolerant of empty lists, so the caller may be freed of the
burden of treating them as special cases.  If this is done, the
code above simplifies to the more intuitive:

>   PRIVATE int HTLoadTypesConfigFile ARGS1(
>       char *,         fn)
>   {
> !     int result = 0;
> !     HTList * saved = HTPresentations;
> ! 
> !     HTPresentations = NULL;         /* temporarily hide existing list */
> ! 
> !     result = ProcessMailcapFile(fn);
> ! 
> !     if (reverse_mailcap) 
> !         HTList_reverse(HTPresentations);
> !     
> !     HTList_appendList(HTPresentations, saved);
> !     FREE(saved);
> !     return result;
>   }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]