summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorNicolas Rachinsky <nr@rachinsky.de>2003-07-04 17:07:22 +0000
committerNicolas Rachinsky <nr@rachinsky.de>2003-07-04 17:07:22 +0000
commitbbcf9f0a71ea7dbc835e1abff85fed1d44f3f24c (patch)
tree70e183054d559b0b51e5285425d4b7881975334a /menu.c
parent6e9a7885b6de6d567c2b3b68421877dd731f81f3 (diff)
Introduce tag-prefix-cond and end-cond. This makes simple
conditional execution of parts of macros possible.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/menu.c b/menu.c
index d9212b8a..97636362 100644
--- a/menu.c
+++ b/menu.c
@@ -30,6 +30,8 @@
extern int Charset_is_utf8; /* FIXME: bad modularisation */
+extern size_t UngetCount;
+
static void print_enriched_string (int attr, unsigned char *s, int do_color)
{
wchar_t wc;
@@ -870,6 +872,28 @@ int mutt_menuLoop (MUTTMENU *menu)
i = -1;
}
}
+ if (i == OP_TAG_PREFIX_COND)
+ {
+ if (menu->tagged)
+ {
+ mvaddstr (LINES - 1, 0, "Tag-");
+ clrtoeol ();
+ i = km_dokey (menu->menu);
+ menu->tagprefix = 1;
+ CLEARLINE (LINES - 1);
+ }
+ else
+ {
+ event_t tmp;
+ while(UngetCount>0)
+ {
+ tmp=mutt_getch();
+ if(tmp.op==OP_END_COND)break;
+ }
+ mutt_message _("Nothing to do.");
+ i = -1;
+ }
+ }
else if (menu->tagged && option (OPTAUTOTAG))
menu->tagprefix = 1;
else
@@ -1032,6 +1056,9 @@ int mutt_menuLoop (MUTTMENU *menu)
km_error_key (menu->menu);
break;
+ case OP_END_COND:
+ break;
+
default:
return (i);
}