On Sat, Jul 15, 2000 at 01:16:39 +0100, Tommy Wareing wrote:
> I'm trying to work out whether I can create a single macro to toggle
> index format between two values.
> 
> Currently, I've got two keys bound:
> 
> macro index "\Cw" ':set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"^M' "View 
>Lists"
> macro index "\Ca" ':set index_format="%4C %Z %{%b %d} %-15.15F (%4l) %s"^M' "View 
>Sender"
> 
> 
> But is it possible to do this in one?

Yes. For instance like this:

macro index "\Cw" \
    ':set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"; \
      macro index "\Co" "\Ca" "View Sender"<enter>' \
    "View Lists"

macro index "\Ca" \
    ':set index_format="%4C %Z %{%b %d} %-15.15F (%4l) %s"; \
      macro index "\Co" "\Cw" "Viev Lists"<enter>' \
    "View Sender"
    
set index_format="%4C %Z %{%b %d} %-15.15F (%4l) %s"
macro index "\Co" "\Cw" "View Lists"

# ^W will change ^O to call ^A, and
# ^A will change ^O to call ^W, 
# so ^O will act like a toggle.

-- 
Byrial
http://home.worldonline.dk/~byrial/

Reply via email to