<<< Date Index >>>     <<< Thread Index >>>

Re: Can I use an if clause in .muttrc?



* On 2004.01.19, in <20040120012433.GA15838@xxxxxxxxxxxxxxx>,
*       "prosolutions@xxxxxxx" <prosolutions@xxxxxxx> wrote:
> Is it possible to have an if clause in .muttrc?
> 
> 
> I got this idea because recently I was looking at the conf file for the Exim 
> mail agent and noticed that it supports if clauses such as:
> 
> .ifdef DC_minimaldns
> primary_hostname = saturn.realtour.biz
> .else
> .endif

Sure, but you need a preprocessor.

.muttrc:
        source "gcc -E -I~/.mutt ~/.mutt/muttrc.cpp |"

~/.mutt/muttrc.cpp:
        #include "definitions.h"
        #ifdef foo
        ....
        #else
        ....
        #endif

~/.mutt/definitions.h:
        #define foo     /* or not */

How to set your cpp macros sensibly is left as an exercise.

-- 
 -D.    dgc@xxxxxxxxxxxx   **   Enterprise Network Servers and Such
                           **   University of Chicago
 We are the robots.        **   North America's southernmost seasonal glacier