mutt_error _("You have no aliases!");
return;
}
-
- /* tell whoever called me to redraw the screen when I return */
- set_option (OPTNEEDREDRAW);
-
+
menu = mutt_new_menu (MENU_ALIAS);
menu->make_entry = alias_entry;
menu->tag = alias_tag;
menu->current = 0;
menu->top = 0;
init_menu (&state, menu, title, sizeof (title), buffy);
- MAYBE_REDRAW (menu->redraw);
}
/* else leave error on screen */
break;
menu->current = 0;
menu->top = 0;
init_menu (&state, menu, title, sizeof (title), buffy);
- MAYBE_REDRAW (menu->redraw);
}
}
break;
state.entrylen--;
mutt_message _("Mailbox deleted.");
init_menu (&state, menu, title, sizeof (title), buffy);
- MAYBE_REDRAW (menu->redraw);
}
}
else
mutt_perror (buf);
}
}
- MAYBE_REDRAW (menu->redraw);
break;
case OP_ENTER_MASK:
}
}
}
- MAYBE_REDRAW (menu->redraw);
break;
case OP_SORT:
destroy_state (&state);
goto bail;
}
- MAYBE_REDRAW (menu->redraw);
break;
case OP_BROWSER_VIEW_FILE:
return rc;
}
-void ci_bounce_message (HEADER *h, int *redraw)
+void ci_bounce_message (HEADER *h)
{
char prompt[SHORT_STRING];
char scratch[SHORT_STRING];
strfcpy(prompt, _("Bounce tagged messages to: "), sizeof(prompt));
rc = mutt_get_field (prompt, buf, sizeof (buf), MUTT_ALIAS);
-
- if (option (OPTNEEDREDRAW))
- {
- unset_option (OPTNEEDREDRAW);
- *redraw = REDRAW_FULL;
- }
-
if (rc || !buf[0])
return;
NORMAL_COLOR;
}
-static int edit_address_list (int line, ADDRESS **addr)
+static void edit_address_list (int line, ADDRESS **addr)
{
char buf[HUGE_STRING] = ""; /* needs to be large for alias expansion */
char *err = NULL;
*addr = mutt_expand_aliases (*addr);
}
- if (option (OPTNEEDREDRAW))
- {
- unset_option (OPTNEEDREDRAW);
- return (REDRAW_FULL);
- }
-
if (mutt_addrlist_to_intl (*addr, &err) != 0)
{
mutt_error (_("Warning: '%s' is a bad IDN."), err);
rfc822_write_address (buf, sizeof (buf), *addr, 1);
mutt_window_move (MuttIndexWindow, line, HDR_XOFFSET);
mutt_paddstr (W, buf);
-
- return 0;
}
static int delete_attachment (MUTTMENU *menu, short *idxlen, int x)
menu->pagelen = MuttIndexWindow->rows - HDR_ATTACH;
break;
case OP_COMPOSE_EDIT_FROM:
- menu->redraw = edit_address_list (HDR_FROM, &msg->env->from);
+ edit_address_list (HDR_FROM, &msg->env->from);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_TO:
- menu->redraw = edit_address_list (HDR_TO, &msg->env->to);
+ edit_address_list (HDR_TO, &msg->env->to);
if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
{
crypt_opportunistic_encrypt (msg);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_BCC:
- menu->redraw = edit_address_list (HDR_BCC, &msg->env->bcc);
+ edit_address_list (HDR_BCC, &msg->env->bcc);
if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
{
crypt_opportunistic_encrypt (msg);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_CC:
- menu->redraw = edit_address_list (HDR_CC, &msg->env->cc);
+ edit_address_list (HDR_CC, &msg->env->cc);
if (option (OPTCRYPTOPPORTUNISTICENCRYPT))
{
crypt_opportunistic_encrypt (msg);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_REPLY_TO:
- menu->redraw = edit_address_list (HDR_REPLYTO, &msg->env->reply_to);
+ edit_address_list (HDR_REPLYTO, &msg->env->reply_to);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_FCC:
mutt_paddstr (W, fcc);
fccSet = 1;
}
- MAYBE_REDRAW (menu->redraw);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_MESSAGE:
FREE (&idx[idxlen]);
menu->redraw |= REDRAW_STATUS;
-
- if (option(OPTNEEDREDRAW))
- {
- menu->redraw = REDRAW_FULL;
- unset_option(OPTNEEDREDRAW);
- }
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
case OP_SAVE:
CHECK_COUNT;
mutt_save_attachment_list (NULL, menu->tagprefix, menu->tagprefix ? msg->content : idx[menu->current]->content, NULL, menu);
- MAYBE_REDRAW (menu->redraw);
/* no send2hook, since this doesn't modify the message */
break;
#ifdef MIXMASTER
case OP_COMPOSE_MIX:
- mix_make_chain (&msg->chain, &menu->redraw);
+ mix_make_chain (&msg->chain);
mutt_message_hook (NULL, msg, MUTT_SEND2HOOK);
break;
#endif
mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&key_table);
-
- set_option (OPTNEEDREDRAW);
return k;
}
{
keypad (stdscr, TRUE);
clearok (stdscr, TRUE);
- set_option (OPTNEEDREDRAW);
+ mutt_set_current_menu_redraw ();
}
event_t mutt_getch (void)
if (_mutt_get_field (pc, buf, blen, (buffy ? MUTT_EFILE : MUTT_FILE) | MUTT_CLEAR, multiple, files, numfiles)
!= 0)
buf[0] = 0;
- MAYBE_REDRAW (*redraw);
FREE (&pc);
}
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- ci_bounce_message (tag ? NULL : CURHDR, &menu->redraw);
+ ci_bounce_message (tag ? NULL : CURHDR);
break;
case OP_CREATE_ALIAS:
mutt_create_alias (Context && Context->vcount ? CURHDR->env : NULL, NULL);
- MAYBE_REDRAW (menu->redraw);
menu->redraw |= REDRAW_CURRENT;
break;
case OP_QUERY:
CHECK_ATTACH;
mutt_query_menu (NULL, 0);
- MAYBE_REDRAW (menu->redraw);
break;
case OP_PURGE_MESSAGE:
}
#endif
- MAYBE_REDRAW (menu->redraw);
break;
case OP_PRINT:
case OP_SHELL_ESCAPE:
mutt_shell_escape ();
- MAYBE_REDRAW (menu->redraw);
break;
case OP_TAG_THREAD:
!memcmp (tempbuf, state->wbuf + i, (state->lastchar - i) * sizeof (wchar_t)))
{
mutt_select_file (buf, buflen, (flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0);
- set_option (OPTNEEDREDRAW);
if (*buf)
replace_part (state, i, buf);
rv = 1;
_mutt_select_file (buf, buflen,
((flags & MUTT_EFILE) ? MUTT_SEL_FOLDER : 0) | (multiple ? MUTT_SEL_MULTI : 0),
files, numfiles);
- set_option (OPTNEEDREDRAW);
if (*buf)
{
mutt_pretty_mailbox (buf, buflen);
if (menu->top != 0)
{
menu->top = 0;
- set_option (OPTNEEDREDRAW);
+ menu->redraw |= REDRAW_INDEX;
}
}
else
FREE (p); /* __FREE_CHECKED__ */
}
+static MUTTMENU *get_current_menu (void)
+{
+ return MenuStackCount ? MenuStack[MenuStackCount - 1] : NULL;
+}
+
void mutt_push_current_menu (MUTTMENU *menu)
{
if (MenuStackCount >= MenuStackLen)
void mutt_pop_current_menu (MUTTMENU *menu)
{
+ MUTTMENU *prev_menu;
+
if (!MenuStackCount ||
(MenuStack[MenuStackCount - 1] != menu))
{
}
MenuStackCount--;
- if (MenuStackCount)
+ prev_menu = get_current_menu ();
+ if (prev_menu)
{
- CurrentMenu = MenuStack[MenuStackCount - 1]->menu;
+ CurrentMenu = prev_menu->menu;
+ prev_menu->redraw = REDRAW_FULL;
}
else
{
}
}
+void mutt_set_current_menu_redraw (void)
+{
+ MUTTMENU *current_menu;
+
+ current_menu = get_current_menu ();
+ if (current_menu)
+ current_menu->redraw = REDRAW_FULL;
+}
+
#define MUTT_SEARCH_UP 1
#define MUTT_SEARCH_DOWN 2
case OP_SHELL_ESCAPE:
mutt_shell_escape ();
- MAYBE_REDRAW (menu->redraw);
break;
case OP_WHAT_KEY:
OPTFORCEREFRESH, /* (pseudo) refresh even during macros */
OPTLOCALES, /* (pseudo) set if user has valid locale definition */
OPTNOCURSES, /* (pseudo) when sending in batch mode */
- OPTNEEDREDRAW, /* (pseudo) to notify caller of a submenu */
OPTSEARCHREVERSE, /* (pseudo) used by ci_search_command */
OPTMSGERR, /* (pseudo) used by mutt_error/mutt_message */
OPTSEARCHINVALID, /* (pseudo) used to invalidate the search pat */
/* reset the color to the normal terminal color as defined by 'color normal ...' */
#define NORMAL_COLOR SETCOLOR(MT_COLOR_NORMAL)
-#define MAYBE_REDRAW(x) if (option (OPTNEEDREDRAW)) { unset_option (OPTNEEDREDRAW); x = REDRAW_FULL; }
-
/* ----------------------------------------------------------------------------
* These are here to avoid compiler warnings with -Wall under SunOS 4.1.x
*/
void mutt_menuDestroy (MUTTMENU **);
void mutt_push_current_menu (MUTTMENU *);
void mutt_pop_current_menu (MUTTMENU *);
+void mutt_set_current_menu_redraw ();
int mutt_menuLoop (MUTTMENU *);
/* used in both the index and pager index to make an entry. */
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));
return (done == 2);
}
extra->idx, extra->idxlen,
extra->bdy);
else
- ci_bounce_message (extra->hdr, &pager_menu->redraw);
+ ci_bounce_message (extra->hdr);
break;
case OP_RESEND:
mutt_create_alias (extra->bdy->hdr->env, NULL);
else
mutt_create_alias (extra->hdr->env, NULL);
- MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_PURGE_MESSAGE:
mutt_pipe_attachment_list (extra->fp, 0, extra->bdy, 0);
else
mutt_pipe_message (extra->hdr);
- MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_PRINT:
else
pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX;
}
- MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_SHELL_ESCAPE:
mutt_shell_escape ();
- MAYBE_REDRAW (pager_menu->redraw);
break;
case OP_TAG:
mutt_menuDestroy (&menu);
FREE (&KeyTable);
- set_option (OPTNEEDREDRAW);
-
return (kp);
}
#endif
/* unsorted */
-void ci_bounce_message (HEADER *, int *);
+void ci_bounce_message (HEADER *);
int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *);
/* prototypes for compatibility functions */
free_query (&results);
FREE (&QueryTable);
-
- /* tell whoever called me to redraw the screen when I return */
- set_option (OPTNEEDREDRAW);
}
mutt_pop_current_menu (menu);
};
-void mix_make_chain (LIST **chainp, int *redraw)
+void mix_make_chain (LIST **chainp)
{
LIST *p;
MIXCHAIN *chain;
return;
}
- *redraw = REDRAW_FULL;
-
chain = safe_calloc (sizeof (MIXCHAIN), 1);
for (p = *chainp; p; p = p->next)
mix_chain_add (chain, (char *) p->data, type2_list);
int mix_send_message (LIST *, const char *);
int mix_check_message (HEADER *msg);
-void mix_make_chain (LIST **, int *);
+void mix_make_chain (LIST **);
#endif /* MIXMASTER */
mutt_pop_current_menu (menu);
mutt_menuDestroy (&menu);
FREE (&table);
- set_option (OPTNEEDREDRAW);
return selected_key;
}