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

Re: toggle button



Hi,

On Tue, May 04, 2004 at 05:56:08PM +0300, Laas Toom wrote:
> 
> I was thinking whether it is possible to implement the following with
> mutt's macros:
> 
>       if (sort == 'threads') then set sort = 'date'
>       else set sort='threads
> 
> That is get a single button to act different based on the current
> value of the sort variable (or any other variable).
> 
> I want this, because in some folders i need the date-order, but
> otherwise i prefer threaded view. So for now i just type in :set
> sort=<date|threads> when i need to switch, but i would like to make it
> more comfortable.

I don't think you can, but you can have buttons that redefine 
themselves. I use these to "zoom/unzoom" a message, and switch between 
two mail accounts. It should be possible to use a similar trick to 
alternate between date and threads.

My usual trick is to create an extra muttrc, that sets the required
paramater one way round, and defines a macro that when run sets the
second state and redefines the same key to source the file on the next
press. I then source this out of my .muttrc on startup.

Regards,

Luke