summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2017-03-26 18:31:39 -0700
committerKevin McCarthy <kevin@8t8.us>2017-03-26 18:31:39 -0700
commite0634939199b13b97d321697a8307df710c2fe4f (patch)
treebac86e7678474dcf57a61a17e4c88bdf97488f50
parent26331cb7d71444f2a870dfa0dc3a6f33f946b5e8 (diff)
Add a menu stack to track current and past menus.
Change the pager to use a MENU, right now just to hold the refresh state.
-rw-r--r--addrbook.c2
-rw-r--r--browser.c16
-rw-r--r--compose.c2
-rw-r--r--crypt-gpgme.c2
-rw-r--r--curs_main.c2
-rw-r--r--menu.c30
-rw-r--r--mutt_menu.h2
-rw-r--r--mutt_ssl.c3
-rw-r--r--mutt_ssl_gnutls.c2
-rw-r--r--pager.c101
-rw-r--r--pgpkey.c2
-rw-r--r--postpone.c2
-rw-r--r--query.c4
-rw-r--r--recvattach.c2
-rw-r--r--remailer.c2
-rw-r--r--smime.c2
16 files changed, 121 insertions, 55 deletions
diff --git a/addrbook.c b/addrbook.c
index a3088188..9228a8df 100644
--- a/addrbook.c
+++ b/addrbook.c
@@ -154,6 +154,7 @@ void mutt_alias_menu (char *buf, size_t buflen, ALIAS *aliases)
menu->tag = alias_tag;
menu->title = _("Aliases");
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_ALIAS, AliasHelp);
+ mutt_push_current_menu (menu);
new_aliases:
@@ -237,6 +238,7 @@ new_aliases:
rfc822_write_address (buf, buflen, AliasTable[t]->addr, 1);
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&AliasTable);
diff --git a/browser.c b/browser.c
index 1fca7d9a..83edc5f3 100644
--- a/browser.c
+++ b/browser.c
@@ -611,7 +611,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
char helpstr[LONG_STRING];
char title[STRING];
struct browser_state state;
- MUTTMENU *menu;
+ MUTTMENU *menu = NULL;
struct stat st;
int i, killPrefix = 0;
int multiple = (flags & MUTT_SEL_MULTI) ? 1 : 0;
@@ -722,6 +722,7 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER,
FolderHelp);
+ mutt_push_current_menu (menu);
init_menu (&state, menu, title, sizeof (title), buffy);
@@ -908,7 +909,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
}
destroy_state (&state);
- mutt_menuDestroy (&menu);
goto bail;
case OP_BROWSER_TELL:
@@ -1080,7 +1080,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
mutt_error _("Error scanning directory.");
if (examine_directory (menu, &state, LastDir, prefix) == -1)
{
- mutt_menuDestroy (&menu);
goto bail;
}
}
@@ -1151,7 +1150,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
else
{
mutt_error _("Error scanning directory.");
- mutt_menuDestroy (&menu);
goto bail;
}
killPrefix = 0;
@@ -1246,7 +1244,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
{
strfcpy (f, buf, flen);
destroy_state (&state);
- mutt_menuDestroy (&menu);
goto bail;
}
MAYBE_REDRAW (menu->redraw);
@@ -1264,7 +1261,6 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
{
strfcpy (f, state.entry[menu->current].name, flen);
destroy_state (&state);
- mutt_menuDestroy (&menu);
goto bail;
}
else
@@ -1296,7 +1292,13 @@ void _mutt_select_file (char *f, size_t flen, int flags, char ***files, int *num
}
bail:
-
+
+ if (menu)
+ {
+ mutt_pop_current_menu (menu);
+ mutt_menuDestroy (&menu);
+ }
+
if (!folder)
strfcpy (LastDir, LastDirBackup, sizeof (LastDir));
diff --git a/compose.c b/compose.c
index aa59506e..7230936b 100644
--- a/compose.c
+++ b/compose.c
@@ -516,6 +516,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
menu->tag = mutt_tag_attach;
menu->data = idx;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_COMPOSE, ComposeHelp);
+ mutt_push_current_menu (menu);
while (loop)
{
@@ -1348,6 +1349,7 @@ int mutt_compose_menu (HEADER *msg, /* structure for new message */
}
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
if (idxlen)
diff --git a/crypt-gpgme.c b/crypt-gpgme.c
index 26974b99..1a311796 100644
--- a/crypt-gpgme.c
+++ b/crypt-gpgme.c
@@ -4031,6 +4031,7 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys,
menu->make_entry = crypt_entry;
menu->help = helpstr;
menu->data = key_table;
+ mutt_push_current_menu (menu);
{
const char *ts;
@@ -4139,6 +4140,7 @@ static crypt_key_t *crypt_select_key (crypt_key_t *keys,
}
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&key_table);
diff --git a/curs_main.c b/curs_main.c
index 43417188..b92ab6ed 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -519,6 +519,7 @@ int mutt_index_menu (void)
menu->color = index_color;
menu->current = ci_first_message ();
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MAIN, IndexHelp);
+ mutt_push_current_menu (menu);
if (!attach_msg)
mutt_buffy_check(1); /* force the buffy check after we enter the folder */
@@ -2454,6 +2455,7 @@ int mutt_index_menu (void)
if (done) break;
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
return (close);
}
diff --git a/menu.c b/menu.c
index 3c45656b..46debdb8 100644
--- a/menu.c
+++ b/menu.c
@@ -30,6 +30,11 @@
char* SearchBuffers[MENU_MAX];
+/* These are used to track the active menus, for redraw operations. */
+static size_t MenuStackCount = 0;
+static size_t MenuStackLen = 0;
+static MUTTMENU **MenuStack = NULL;
+
static void print_enriched_string (int attr, unsigned char *s, int do_color)
{
wchar_t wc;
@@ -709,6 +714,7 @@ MUTTMENU *mutt_new_menu (int menu)
p->messagewin = MuttMessageWindow;
p->color = default_color;
p->search = menu_search_generic;
+
return (p);
}
@@ -727,6 +733,30 @@ void mutt_menuDestroy (MUTTMENU **p)
FREE (p); /* __FREE_CHECKED__ */
}
+void mutt_push_current_menu (MUTTMENU *menu)
+{
+ if (MenuStackCount >= MenuStackLen)
+ {
+ MenuStackLen += 5;
+ safe_realloc (&MenuStack, MenuStackLen * sizeof(MUTTMENU *));
+ }
+
+ MenuStack[MenuStackCount++] = menu;
+}
+
+void mutt_pop_current_menu (MUTTMENU *menu)
+{
+ if (!MenuStackCount ||
+ (MenuStack[MenuStackCount - 1] != menu))
+ {
+ dprint (1, (debugfile, "mutt_pop_current_menu() called with inactive menu\n"));
+ return;
+ }
+
+ MenuStackCount--;
+}
+
+
#define MUTT_SEARCH_UP 1
#define MUTT_SEARCH_DOWN 2
diff --git a/mutt_menu.h b/mutt_menu.h
index b229fd45..3d0b6f81 100644
--- a/mutt_menu.h
+++ b/mutt_menu.h
@@ -120,6 +120,8 @@ void mutt_ts_icon (char *);
MUTTMENU *mutt_new_menu (int);
void mutt_menuDestroy (MUTTMENU **);
+void mutt_push_current_menu (MUTTMENU *);
+void mutt_pop_current_menu (MUTTMENU *);
int mutt_menuLoop (MUTTMENU *);
/* used in both the index and pager index to make an entry. */
diff --git a/mutt_ssl.c b/mutt_ssl.c
index 86c8fb50..0ce0150f 100644
--- a/mutt_ssl.c
+++ b/mutt_ssl.c
@@ -1170,6 +1170,8 @@ static int interactive_check_cert (X509 *cert, int idx, int len, SSL *ssl, int a
FILE *fp;
int allow_skip = 0;
+ mutt_push_current_menu (menu);
+
menu->max = mutt_array_size (part) * 2 + 10;
menu->dialog = (char **) safe_calloc (1, menu->max * sizeof (char *));
for (i = 0; i < menu->max; i++)
@@ -1302,6 +1304,7 @@ static int interactive_check_cert (X509 *cert, int idx, int len, SSL *ssl, int a
}
}
unset_option(OPTIGNOREMACROEVENTS);
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
set_option (OPTNEEDREDRAW);
dprint (2, (debugfile, "ssl interactive_check_cert: done=%d\n", done));
diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c
index 121f2df5..5a799574 100644
--- a/mutt_ssl_gnutls.c
+++ b/mutt_ssl_gnutls.c
@@ -862,6 +862,7 @@ static int tls_check_one_certificate (const gnutls_datum_t *certdata,
menu->dialog = (char **) safe_calloc (1, menu->max * sizeof (char *));
for (i = 0; i < menu->max; i++)
menu->dialog[i] = (char *) safe_calloc (1, SHORT_STRING * sizeof (char));
+ mutt_push_current_menu (menu);
row = 0;
strfcpy (menu->dialog[row], _("This certificate belongs to:"), SHORT_STRING);
@@ -1065,6 +1066,7 @@ static int tls_check_one_certificate (const gnutls_datum_t *certdata,
}
}
unset_option (OPTIGNOREMACROEVENTS);
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
gnutls_x509_crt_deinit (cert);
diff --git a/pager.c b/pager.c
index 8a0e36d6..0f434c0f 100644
--- a/pager.c
+++ b/pager.c
@@ -1595,7 +1595,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
int i, j, ch = 0, rc = -1, hideQuoted = 0, q_level = 0, force_redraw = 0;
int lines = 0, curline = 0, topline = 0, oldtopline = 0, err, first = 1;
int r = -1, wrapped = 0, searchctx = 0;
- int redraw = REDRAW_FULL;
FILE *fp = NULL;
LOFF_T last_pos = 0, last_offset = 0;
int old_smart_wrap, old_markers;
@@ -1609,6 +1608,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
mutt_window_t *pager_status_window = NULL;
mutt_window_t *pager_window = NULL;
+ MUTTMENU *pager_menu = NULL;
MUTTMENU *index = NULL; /* the Pager Index (PI) */
int indexlen = PagerIndexLines; /* indexlen not always == PIL */
int indicator = indexlen / 3; /* the indicator line of the PI */
@@ -1669,11 +1669,14 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
pager_status_window = safe_calloc (sizeof (mutt_window_t), 1);
pager_window = safe_calloc (sizeof (mutt_window_t), 1);
+ pager_menu = mutt_new_menu (MENU_PAGER);
+ mutt_push_current_menu (pager_menu);
+
while (ch != -1)
{
mutt_curs_set (0);
- if (redraw & REDRAW_FULL)
+ if (pager_menu->redraw & REDRAW_FULL)
{
#if ! (defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM))
mutt_reflow_windows ();
@@ -1740,7 +1743,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
SearchBack = Resize->SearchBack;
}
lines = Resize->line;
- redraw |= REDRAW_SIGWINCH;
+ pager_menu->redraw |= REDRAW_SIGWINCH;
FREE (&Resize);
}
@@ -1775,14 +1778,14 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
menu_redraw_index(index);
}
- redraw |= REDRAW_BODY | REDRAW_INDEX | REDRAW_STATUS;
+ pager_menu->redraw |= REDRAW_BODY | REDRAW_INDEX | REDRAW_STATUS;
#ifdef USE_SIDEBAR
- redraw |= REDRAW_SIDEBAR;
+ pager_menu->redraw |= REDRAW_SIDEBAR;
#endif
mutt_show_error ();
}
- if (redraw & REDRAW_SIGWINCH)
+ if (pager_menu->redraw & REDRAW_SIGWINCH)
{
i = -1;
j = -1;
@@ -1798,14 +1801,14 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
}
#ifdef USE_SIDEBAR
- if ((redraw & REDRAW_SIDEBAR) || SidebarNeedsRedraw)
+ if ((pager_menu->redraw & REDRAW_SIDEBAR) || SidebarNeedsRedraw)
{
SidebarNeedsRedraw = 0;
mutt_sb_draw ();
}
#endif
- if ((redraw & REDRAW_BODY) || topline != oldtopline)
+ if ((pager_menu->redraw & REDRAW_BODY) || topline != oldtopline)
{
do {
mutt_window_move (pager_window, 0, 0);
@@ -1841,10 +1844,10 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
/* We are going to update the pager status bar, so it isn't
* necessary to reset to normal color now. */
- redraw |= REDRAW_STATUS; /* need to update the % seen */
+ pager_menu->redraw |= REDRAW_STATUS; /* need to update the % seen */
}
- if (redraw & REDRAW_STATUS)
+ if (pager_menu->redraw & REDRAW_STATUS)
{
struct hdr_format_info hfi;
char pager_progress_str[4];
@@ -1885,7 +1888,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
}
}
- if ((redraw & REDRAW_INDEX) && index)
+ if ((pager_menu->redraw & REDRAW_INDEX) && index)
{
/* redraw the pager_index indicator, because the
* flags for this message might have changed. */
@@ -1901,7 +1904,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
NORMAL_COLOR;
}
- redraw = 0;
+ pager_menu->redraw = 0;
if (option(OPTBRAILLEFRIENDLY)) {
if (brailleLine!=-1) {
@@ -1976,7 +1979,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
lastLine = 0;
topline = 0;
- redraw = REDRAW_FULL | REDRAW_SIGWINCH;
+ pager_menu->redraw = REDRAW_FULL | REDRAW_SIGWINCH;
ch = 0;
}
@@ -2273,14 +2276,14 @@ search_next:
}
}
- redraw = REDRAW_BODY;
+ pager_menu->redraw = REDRAW_BODY;
break;
case OP_SEARCH_TOGGLE:
if (SearchCompiled)
{
SearchFlag ^= MUTT_SEARCH;
- redraw = REDRAW_BODY;
+ pager_menu->redraw = REDRAW_BODY;
}
break;
@@ -2290,7 +2293,7 @@ search_next:
{
InHelp = 1;
mutt_help (MENU_PAGER);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
InHelp = 0;
}
else
@@ -2304,7 +2307,7 @@ search_next:
if (hideQuoted && lineInfo[topline].type == MT_COLOR_QUOTED)
topline = upNLines (1, lineInfo, topline, hideQuoted);
else
- redraw = REDRAW_BODY;
+ pager_menu->redraw = REDRAW_BODY;
}
break;
@@ -2361,7 +2364,7 @@ search_next:
case OP_REDRAW:
clearok (stdscr, TRUE);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_NULL:
@@ -2381,7 +2384,7 @@ search_next:
extra->idx, extra->idxlen,
extra->bdy);
else
- ci_bounce_message (extra->hdr, &redraw);
+ ci_bounce_message (extra->hdr, &pager_menu->redraw);
break;
case OP_RESEND:
@@ -2393,7 +2396,7 @@ search_next:
extra->bdy);
else
mutt_resend_message (NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_CHECK_TRADITIONAL:
@@ -2413,7 +2416,7 @@ search_next:
mutt_create_alias (extra->bdy->hdr->env, NULL);
else
mutt_create_alias (extra->hdr->env, NULL);
- MAYBE_REDRAW (redraw);
+ MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_PURGE_MESSAGE:
@@ -2427,7 +2430,7 @@ search_next:
mutt_set_flag (Context, extra->hdr, MUTT_PURGE, (ch == OP_PURGE_MESSAGE));
if (option (OPTDELETEUNTAG))
mutt_set_flag (Context, extra->hdr, MUTT_TAG, 0);
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
ch = -1;
@@ -2441,7 +2444,7 @@ search_next:
CHECK_READONLY;
if (mutt_change_flag (extra->hdr, (ch == OP_MAIN_SET_FLAG)) == 0)
- redraw |= REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
if (extra->hdr->deleted && option (OPTRESOLVE))
{
ch = -1;
@@ -2471,9 +2474,9 @@ search_next:
}
if (!option (OPTRESOLVE) && PagerIndexLines)
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
else
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
}
break;
@@ -2566,7 +2569,7 @@ search_next:
}
if (option (OPTFORCEREDRAWPAGER))
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
unset_option (OPTFORCEREDRAWINDEX);
unset_option (OPTFORCEREDRAWPAGER);
break;
@@ -2578,7 +2581,7 @@ search_next:
CHECK_ACL(MUTT_ACL_WRITE, "Cannot flag message");
mutt_set_flag (Context, extra->hdr, MUTT_FLAG, !extra->hdr->flagged);
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
ch = -1;
@@ -2592,7 +2595,7 @@ search_next:
mutt_pipe_attachment_list (extra->fp, 0, extra->bdy, 0);
else
mutt_pipe_message (extra->hdr);
- MAYBE_REDRAW (redraw);
+ MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_PRINT:
@@ -2607,7 +2610,7 @@ search_next:
CHECK_MODE(IsHeader (extra) && !IsAttach (extra));
CHECK_ATTACH;
ci_send_message (0, NULL, NULL, extra->ctx, NULL);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_REPLY:
@@ -2619,14 +2622,14 @@ search_next:
SENDREPLY);
else
ci_send_message (SENDREPLY, NULL, NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_RECALL_MESSAGE:
CHECK_MODE(IsHeader (extra) && !IsAttach(extra));
CHECK_ATTACH;
ci_send_message (SENDPOSTPONED, NULL, NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_GROUP_REPLY:
@@ -2637,7 +2640,7 @@ search_next:
extra->idxlen, extra->bdy, SENDREPLY|SENDGROUPREPLY);
else
ci_send_message (SENDREPLY | SENDGROUPREPLY, NULL, NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_LIST_REPLY:
@@ -2648,7 +2651,7 @@ search_next:
extra->idxlen, extra->bdy, SENDREPLY|SENDLISTREPLY);
else
ci_send_message (SENDREPLY | SENDLISTREPLY, NULL, NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_FORWARD_MESSAGE:
@@ -2659,7 +2662,7 @@ search_next:
extra->idxlen, extra->bdy);
else
ci_send_message (SENDFORWARD, NULL, NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_DECRYPT_SAVE:
@@ -2692,7 +2695,7 @@ search_next:
(ch == OP_DECODE_SAVE) || (ch == OP_DECODE_COPY),
(ch == OP_DECRYPT_SAVE) || (ch == OP_DECRYPT_COPY) ||
0,
- &redraw) == 0 && (ch == OP_SAVE || ch == OP_DECODE_SAVE
+ &pager_menu->redraw) == 0 && (ch == OP_SAVE || ch == OP_DECODE_SAVE
|| ch == OP_DECRYPT_SAVE
))
{
@@ -2702,14 +2705,14 @@ search_next:
rc = OP_MAIN_NEXT_UNDELETED;
}
else
- redraw |= REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
}
- MAYBE_REDRAW (redraw);
+ MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_SHELL_ESCAPE:
mutt_shell_escape ();
- MAYBE_REDRAW (redraw);
+ MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_TAG:
@@ -2720,7 +2723,7 @@ search_next:
((Context->last_tag == extra->hdr && !extra->hdr->tagged)
? NULL : Context->last_tag);
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
ch = -1;
@@ -2740,7 +2743,7 @@ search_next:
mutt_set_flag (Context, extra->hdr, MUTT_READ, 1);
first = 0;
Context->msgnotreadyet = -1;
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
ch = -1;
@@ -2756,7 +2759,7 @@ search_next:
mutt_set_flag (Context, extra->hdr, MUTT_DELETE, 0);
mutt_set_flag (Context, extra->hdr, MUTT_PURGE, 0);
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
ch = -1;
@@ -2786,9 +2789,9 @@ search_next:
}
if (!option (OPTRESOLVE) && PagerIndexLines)
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
else
- redraw = REDRAW_STATUS | REDRAW_INDEX;
+ pager_menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
}
break;
@@ -2811,7 +2814,7 @@ search_next:
mutt_view_attachments (extra->hdr);
if (extra->hdr->attach_del)
Context->changed = 1;
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_EDIT_LABEL:
@@ -2819,7 +2822,7 @@ search_next:
rc = mutt_label_message(extra->hdr);
if (rc > 0) {
Context->changed = 1;
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
mutt_message (_("%d labels changed."), rc);
}
else {
@@ -2836,7 +2839,7 @@ search_next:
CHECK_MODE(IsHeader(extra));
CHECK_ATTACH;
ci_send_message (SENDKEY, NULL, NULL, extra->ctx, extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
@@ -2852,7 +2855,7 @@ search_next:
}
CHECK_MODE(IsHeader(extra));
crypt_extract_keys_from_messages(extra->hdr);
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
case OP_WHAT_KEY:
@@ -2872,7 +2875,7 @@ search_next:
case OP_SIDEBAR_TOGGLE_VISIBLE:
toggle_option (OPTSIDEBAR);
mutt_reflow_windows();
- redraw = REDRAW_FULL;
+ pager_menu->redraw = REDRAW_FULL;
break;
#endif
@@ -2913,6 +2916,8 @@ search_next:
SearchCompiled = 0;
}
FREE (&lineInfo);
+ mutt_pop_current_menu (pager_menu);
+ mutt_menuDestroy (&pager_menu);
if (index)
mutt_menuDestroy(&index);
diff --git a/pgpkey.c b/pgpkey.c
index 36a92ae2..c39f25ea 100644
--- a/pgpkey.c
+++ b/pgpkey.c
@@ -527,6 +527,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys,
menu->make_entry = pgp_entry;
menu->help = helpstr;
menu->data = KeyTable;
+ mutt_push_current_menu (menu);
if (p)
snprintf (buf, sizeof (buf), _("PGP keys matching <%s>."), p->mailbox);
@@ -650,6 +651,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys,
}
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&KeyTable);
diff --git a/postpone.c b/postpone.c
index 4fe1543d..7dcf30a1 100644
--- a/postpone.c
+++ b/postpone.c
@@ -165,6 +165,7 @@ static HEADER *select_msg (void)
menu->title = _("Postponed Messages");
menu->data = PostContext;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_POST, PostponeHelp);
+ mutt_push_current_menu (menu);
/* The postponed mailbox is setup to have sorting disabled, but the global
* Sort variable may indicate something different. Sorting has to be
@@ -209,6 +210,7 @@ static HEADER *select_msg (void)
}
Sort = orig_sort;
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
return (r > -1 ? PostContext->hdrs[r] : NULL);
}
diff --git a/query.c b/query.c
index a229a71a..aedc8326 100644
--- a/query.c
+++ b/query.c
@@ -326,6 +326,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf)
menu->tag = query_tag;
menu->title = title;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_QUERY, QueryHelp);
+ mutt_push_current_menu (menu);
if (results == NULL)
{
@@ -382,6 +383,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf)
menu->current = 0;
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
menu = mutt_new_menu (MENU_QUERY);
menu->make_entry = query_entry;
@@ -389,6 +391,7 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf)
menu->tag = query_tag;
menu->title = title;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_QUERY, QueryHelp);
+ mutt_push_current_menu (menu);
/* count the number of results */
for (queryp = results; queryp; queryp = queryp->next)
@@ -538,5 +541,6 @@ static void query_menu (char *buf, size_t buflen, QUERY *results, int retbuf)
set_option (OPTNEEDREDRAW);
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
}
diff --git a/recvattach.c b/recvattach.c
index 562c6b55..0f079b12 100644
--- a/recvattach.c
+++ b/recvattach.c
@@ -1041,6 +1041,7 @@ void mutt_view_attachments (HEADER *hdr)
menu->make_entry = attach_entry;
menu->tag = mutt_tag_attach;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_ATTACH, AttachHelp);
+ mutt_push_current_menu (menu);
mutt_attach_init (cur);
attach_collapse (cur, 0, 1, 0);
@@ -1281,6 +1282,7 @@ void mutt_view_attachments (HEADER *hdr)
mutt_free_body (&cur);
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
return;
}
diff --git a/remailer.c b/remailer.c
index 8f4e8595..8e0434a3 100644
--- a/remailer.c
+++ b/remailer.c
@@ -538,6 +538,7 @@ void mix_make_chain (LIST **chainp, int *redraw)
menu->data = type2_list;
menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_MIX, RemailerHelp);
menu->pagelen = MIX_VOFFSET - 1;
+ mutt_push_current_menu (menu);
while (loop)
{
@@ -673,6 +674,7 @@ void mix_make_chain (LIST **chainp, int *redraw)
}
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
/* construct the remailer list */
diff --git a/smime.c b/smime.c
index 2fcb82c8..b12119ee 100644
--- a/smime.c
+++ b/smime.c
@@ -447,6 +447,7 @@ static smime_key_t *smime_select_key (smime_key_t *keys, char *query)
menu->help = helpstr;
menu->data = table;
menu->title = title;
+ mutt_push_current_menu (menu);
/* sorting keys might be done later - TODO */
mutt_clear_error();
@@ -493,6 +494,7 @@ static smime_key_t *smime_select_key (smime_key_t *keys, char *query)
}
}
+ mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&table);
set_option (OPTNEEDREDRAW);