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

Re: toggle button



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.

It can be done. Consider the following two files, one named sortthread,
the other name sortdate (I am assuming we are binding to X as the
keystroke, but that can be changed):

#sortdate
set sort = 'date'
macro index X ":source ~/.mutt/sortthread"

#sortthread
set sort = 'thread'
macro index X ":source ~/.mutt/sortdate"

Now, in your .mutt/muttrc (or .muttrc) you source whichever one you want
to start with.

} Laas
--Greg