[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-dev
Subject:    Re: [PATCH 2 of 2] Create a separate macro/push/exec event buffer.
From:       "Kevin J. McCarthy" <kevin () 8t8 ! us>
Date:       2015-09-29 9:06:02
Message-ID: 20150929090602.GB14864 () qinghai
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Attaching a minor update to the patch.  I fixed the ticket number and
also changed mutt_flush_macro_to_endcond() to directly manipulate
MacroEvents[] instead of using mutt_ch().

--=20
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
http://www.8t8.us/configs/gpg-key-transition-statement.txt

["02-add-macro-event-buffer.patch" (text/plain)]

# HG changeset patch
# User Kevin McCarthy <kevin@8t8.us>
# Date 1443335585 -28800
#      Sun Sep 27 14:33:05 2015 +0800
# Node ID 261cc94a90816000ba016b312c17bfffd84bcf27
# Parent  c1cb2f94e0bad0442d2bfd22274a8c758f3a2951
Create a separate macro/push/exec event buffer.  (closes #3779)

Currently, the SSL and TLS certficate prompts turn on
OPTUNBUFFEREDINPUT, (to prevent macros and such from running right
through the dialog).  Unfortunately, the menu dialog processing in
menu_dialog_dokey() is using mutt_ungetch() to forward non-dialog keys
on to standard menu processing.  With OPTUNBUFFEREDINPUT set, those keys
never make it to the menu and are buffered until after the menu dialog.

This patch creates a new event buffer, separate from the standard
"unget" buffer, for use by macros, exec, and push events.  These events
can be temporarily ignored by setting OPTIGNOREMACROEVENTS (renamed
from OPTUNBUFFEREDINPUT), while continuing to allow unget events to be
processed.

Since the "push" and "unget" functions now go to different buffers,
function names were slightly renamed, to make it less easy to
unintentionally use the wrong function at the wrong time.

diff --git a/browser.c b/browser.c
--- a/browser.c
+++ b/browser.c
@@ -891,17 +891,17 @@
 	break;
 
       case OP_BROWSER_TOGGLE_LSUB:
 	if (option (OPTIMAPLSUB))
 	  unset_option (OPTIMAPLSUB);
 	else
 	  set_option (OPTIMAPLSUB);
 
-	mutt_ungetch (0, OP_CHECK_NEW);
+	mutt_unget_event (0, OP_CHECK_NEW);
 	break;
 
       case OP_CREATE_MAILBOX:
 	if (!state.imap_browse)
 	{
 	  mutt_error (_("Create is only supported for IMAP mailboxes"));
 	  break;
 	}
diff --git a/commands.c b/commands.c
--- a/commands.c
+++ b/commands.c
@@ -223,17 +223,17 @@
       mutt_error (_("Error running \"%s\"!"), buf);
     unlink (tempfile);
     if (!option (OPTNOCURSES))
       keypad (stdscr, TRUE);
     if (r != -1)
       mutt_set_flag (Context, cur, M_READ, 1);
     if (r != -1 && option (OPTPROMPTAFTER))
     {
-      mutt_ungetch (mutt_any_key_to_continue _("Command: "), 0);
+      mutt_unget_event (mutt_any_key_to_continue _("Command: "), 0);
       rc = km_dokey (MENU_PAGER);
     }
     else
       rc = 0;
   }
 
   return rc;
 }
diff --git a/curs_lib.c b/curs_lib.c
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -43,19 +43,30 @@
 #ifdef HAVE_LANGINFO_YESEXPR
 #include <langinfo.h>
 #endif
 
 /* not possible to unget more than one char under some curses libs, and it
  * is impossible to unget function keys in SLang, so roll our own input
  * buffering routines.
  */
-size_t UngetCount = 0;
-static size_t UngetBufLen = 0;
-static event_t *KeyEvent;
+
+/* These are used for macros and exec/push commands.
+ * They can be temporarily ignored by setting OPTIGNOREMACROEVENTS
+ */
+static size_t MacroBufferCount = 0;
+static size_t MacroBufferLen = 0;
+static event_t *MacroEvents;
+
+/* These are used in all other "normal" situations, and are not
+ * ignored when setting OPTIGNOREMACROEVENTS
+ */
+static size_t UngetCount = 0;
+static size_t UngetLen = 0;
+static event_t *UngetKeyEvents;
 
 void mutt_refresh (void)
 {
   /* don't refresh when we are waiting for a child. */
   if (option (OPTKEEPQUIET))
     return;
 
   /* don't refresh in the middle of macros unless necessary */
@@ -78,18 +89,21 @@
 }
 
 event_t mutt_getch (void)
 {
   int ch;
   event_t err = {-1, OP_NULL }, ret;
   event_t timeout = {-2, OP_NULL};
 
-  if (!option(OPTUNBUFFEREDINPUT) && UngetCount)
-    return (KeyEvent[--UngetCount]);
+  if (UngetCount)
+    return (UngetKeyEvents[--UngetCount]);
+
+  if (!option(OPTIGNOREMACROEVENTS) && MacroBufferCount)
+    return (MacroEvents[--MacroBufferCount]);
 
   SigInt = 0;
 
   mutt_allow_interrupt (1);
 #ifdef KEY_RESIZE
   /* ncurses 4.2 sends this when the screen is resized */
   ch = KEY_RESIZE;
   while (ch == KEY_RESIZE)
@@ -113,17 +127,17 @@
     }
     return timeout;
   }
 
   if ((ch & 0x80) && option (OPTMETAKEY))
   {
     /* send ALT-x as ESC-x */
     ch &= ~0x80;
-    mutt_ungetch (ch, 0);
+    mutt_unget_event (ch, 0);
     ret.ch = '\033';
     ret.op = 0;
     return ret;
   }
 
   ret.ch = ch;
   ret.op = 0;
   return (ch == ctrl ('G') ? err : ret);
@@ -152,19 +166,19 @@
   
   return (ret);
 }
 
 int mutt_get_field_unbuffered (char *msg, char *buf, size_t buflen, int flags)
 {
   int rc;
 
-  set_option (OPTUNBUFFEREDINPUT);
+  set_option (OPTIGNOREMACROEVENTS);
   rc = mutt_get_field (msg, buf, buflen, flags);
-  unset_option (OPTUNBUFFEREDINPUT);
+  unset_option (OPTIGNOREMACROEVENTS);
 
   return (rc);
 }
 
 void mutt_clear_error (void)
 {
   Errorbuf[0] = 0;
   if (!option(OPTNOCURSES))
@@ -590,43 +604,81 @@
 		       files, numfiles);
     *redraw = REDRAW_FULL;
   }
   else
   {
     char *pc = safe_malloc (mutt_strlen (prompt) + 3);
 
     sprintf (pc, "%s: ", prompt);	/* __SPRINTF_CHECKED__ */
-    mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
+    mutt_unget_event (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
     if (_mutt_get_field (pc, buf, blen, (buffy ? M_EFILE : M_FILE) | M_CLEAR, multiple, files, numfiles)
 	!= 0)
       buf[0] = 0;
     MAYBE_REDRAW (*redraw);
     FREE (&pc);
   }
 
   return 0;
 }
 
-void mutt_ungetch (int ch, int op)
+void mutt_unget_event (int ch, int op)
 {
   event_t tmp;
 
   tmp.ch = ch;
   tmp.op = op;
 
-  if (UngetCount >= UngetBufLen)
-    safe_realloc (&KeyEvent, (UngetBufLen += 128) * sizeof(event_t));
+  if (UngetCount >= UngetLen)
+    safe_realloc (&UngetKeyEvents, (UngetLen += 16) * sizeof(event_t));
 
-  KeyEvent[UngetCount++] = tmp;
+  UngetKeyEvents[UngetCount++] = tmp;
+}
+
+void mutt_unget_string (char *s)
+{
+  char *p = s + mutt_strlen (s) - 1;
+
+  while (p >= s)
+  {
+    mutt_unget_event ((unsigned char)*p--, 0);
+  }
+}
+
+/*
+ * Adds the ch/op to the macro buffer.
+ * This should be used for macros, push, and exec commands only.
+ */
+void mutt_push_macro_event (int ch, int op)
+{
+  event_t tmp;
+
+  tmp.ch = ch;
+  tmp.op = op;
+
+  if (MacroBufferCount >= MacroBufferLen)
+    safe_realloc (&MacroEvents, (MacroBufferLen += 128) * sizeof(event_t));
+
+  MacroEvents[MacroBufferCount++] = tmp;
+}
+
+void mutt_flush_macro_to_endcond (void)
+{
+  UngetCount = 0;
+  while (MacroBufferCount > 0)
+  {
+    if (MacroEvents[--MacroBufferCount].op == OP_END_COND)
+      return;
+  }
 }
 
 void mutt_flushinp (void)
 {
   UngetCount = 0;
+  MacroBufferCount = 0;
   flushinp ();
 }
 
 #if (defined(USE_SLANG_CURSES) || defined(HAVE_CURS_SET))
 /* The argument can take 3 values:
  * -1: restore the value of the last call
  *  0: make the cursor invisible
  *  1: make the cursor visible
diff --git a/curs_main.c b/curs_main.c
--- a/curs_main.c
+++ b/curs_main.c
@@ -104,18 +104,16 @@
 			mutt_error _(Function_not_permitted_in_attach_message_mode); \
 			break; \
 		     }
 
 #define CURHDR Context->hdrs[Context->v2r[menu->current]]
 #define OLDHDR Context->hdrs[Context->v2r[menu->oldcurrent]]
 #define UNREAD(h) mutt_thread_contains_unread (Context, h)
 
-extern size_t UngetCount;
-
 /* de facto standard escapes for tsl/fsl */
 static char *tsl = "\033]0;";
 static char *fsl = "\007";
 
 /* terminal status capability check. terminfo must have been initialized. */
 short mutt_ts_capability(void)
 {
   char *term = getenv("TERM");
@@ -724,22 +722,17 @@
 	if (!Context)
 	{
 	  mutt_error _("No mailbox is open.");
 	  continue;
 	}
 
 	if (!Context->tagged)
 	{
-	  event_t tmp;
-	  while(UngetCount>0)
-	  {
-	    tmp=mutt_getch();
-	    if(tmp.op==OP_END_COND)break;
-	  }
+	  mutt_flush_macro_to_endcond ();
 	  mutt_message  _("Nothing to do.");
 	  continue;
 	}
 	tag = 1;
 
 	/* give visual indication that the next command is a tag- command */
 	mvaddstr (LINES - 1, 0, "tag-");
 	clrtoeol ();
@@ -814,17 +807,17 @@
       case OP_CURRENT_BOTTOM:
 	menu_current_bottom (menu);
 	break;
 
       case OP_JUMP:
 
 	CHECK_MSGCOUNT;
         CHECK_VISIBLE;
-        if (isdigit (LastKey)) mutt_ungetch (LastKey, 0);
+        if (isdigit (LastKey)) mutt_unget_event (LastKey, 0);
 	buf[0] = 0;
 	if (mutt_get_field (_("Jump to message: "), buf, sizeof (buf), 0) != 0
 	    || !buf[0])
 	  break;
 
 	if (mutt_atoi (buf, &i) < 0)
 	{
 	  mutt_error _("Argument must be a message number.");
diff --git a/keymap.c b/keymap.c
--- a/keymap.c
+++ b/keymap.c
@@ -320,17 +320,22 @@
   {
     if (bindings[i].op == op)
       return bindings[i].name;
   }
 
   return NULL;
 }
 
-static void push_string (char *s)
+/* Parses s for <function> syntax and adds the whole sequence to
+ * the macro buffer.
+ *
+ * This should be used for macros, push, and exec commands only.
+ */
+static void tokenize_push_macro_string (char *s)
 {
   char *pp, *p = s + mutt_strlen (s) - 1;
   size_t l;
   int i, op = OP_NULL;
 
   while (p >= s)
   {
     /* if we see something like "<PageUp>", look to see if it is a real
@@ -338,31 +343,31 @@
     if (*p == '>')
     {
       for (pp = p - 1; pp >= s && *pp != '<'; pp--)
 	;
       if (pp >= s)
       {
 	if ((i = parse_fkey (pp)) > 0)
 	{
-	  mutt_ungetch (KEY_F (i), 0);
+	  mutt_push_macro_event (KEY_F (i), 0);
 	  p = pp - 1;
 	  continue;
 	}
 
 	l = p - pp + 1;
 	for (i = 0; KeyNames[i].name; i++)
 	{
 	  if (!ascii_strncasecmp (pp, KeyNames[i].name, l))
 	    break;
 	}
 	if (KeyNames[i].name)
 	{
 	  /* found a match */
-	  mutt_ungetch (KeyNames[i].value, 0);
+	  mutt_push_macro_event (KeyNames[i].value, 0);
 	  p = pp - 1;
 	  continue;
 	}
 
 	/* See if it is a valid command
 	 * skip the '<' and the '>' when comparing */
 	for (i = 0; Menus[i].name; i++)
 	{
@@ -372,34 +377,34 @@
 	    op = get_op (binding, pp + 1, l - 2);
 	    if (op != OP_NULL)
 	      break;
 	  }
 	}
 
 	if (op != OP_NULL)
 	{
-	  mutt_ungetch (0, op);
+	  mutt_push_macro_event (0, op);
 	  p = pp - 1;
 	  continue;
 	}
       }
     }
-    mutt_ungetch ((unsigned char)*p--, 0);	/* independent 8 bits chars */
+    mutt_push_macro_event ((unsigned char)*p--, 0);	/* independent 8 bits chars */
   }
 }
 
 static int retry_generic (int menu, keycode_t *keys, int keyslen, int lastkey)
 {
   if (menu != MENU_EDITOR && menu != MENU_GENERIC && menu != MENU_PAGER)
   {
     if (lastkey)
-      mutt_ungetch (lastkey, 0);
+      mutt_unget_event (lastkey, 0);
     for (; keyslen; keyslen--)
-      mutt_ungetch (keys[keyslen - 1], 0);
+      mutt_unget_event (keys[keyslen - 1], 0);
     return (km_dokey (MENU_GENERIC));
   }
   if (menu != MENU_EDITOR)
   {
     /* probably a good idea to flush input here so we can abort macros */
     mutt_flushinp ();
   }
   return OP_NULL;
@@ -490,21 +495,19 @@
       for (i = 0; Menus[i].name; i++)
       {
 	bindings = km_get_table (Menus[i].value);
 	if (bindings)
 	{
 	  func = get_func (bindings, tmp.op);
 	  if (func)
 	  {
-	    /* careful not to feed the <..> as one token. otherwise 
-	    * push_string() will push the bogus op right back! */
-	    mutt_ungetch ('>', 0);
-	    push_string (func);
-	    mutt_ungetch ('<', 0);
+	    mutt_unget_event ('>', 0);
+	    mutt_unget_string (func);
+	    mutt_unget_event ('<', 0);
 	    break;
 	  }
 	}
       }
       /* continue to chew */
       if (func)
 	continue;
     }
@@ -521,24 +524,30 @@
       return (retry_generic (menu, map->keys, pos, LastKey));
 
     if (++pos == map->len)
     {
 
       if (map->op != OP_MACRO)
 	return map->op;
 
+      if (option (OPTIGNOREMACROEVENTS))
+      {
+	mutt_error _("Macros are currently disabled.");
+	return -1;
+      }
+
       if (n++ == 10)
       {
 	mutt_flushinp ();
 	mutt_error _("Macro loop detected.");
 	return -1;
       }
 
-      push_string (map->macro);
+      tokenize_push_macro_string (map->macro);
       map = Keymaps[menu];
       pos = 0;
     }
   }
 
   /* not reached */
 }
 
@@ -830,17 +839,17 @@
   
   if(!(km_expand_key(buf, sizeof(buf), key)))
   {
     mutt_error _("Key is not bound.");
     return;
   }
 
   /* make sure the key is really the help key in this menu */
-  push_string (buf);
+  mutt_unget_string (buf);
   if (km_dokey (menu) != OP_HELP)
   {
     mutt_error _("Key is not bound.");
     return;
   }
 
   mutt_error (_("Key is not bound.  Press '%s' for help."), buf);
   return;
@@ -852,17 +861,17 @@
 
   mutt_extract_token (buf, s, M_TOKEN_CONDENSE);
   if (MoreArgs (s))
   {
     strfcpy (err->data, _("push: too many arguments"), err->dsize);
     r = -1;
   }
   else
-    push_string (buf->data);
+    tokenize_push_macro_string (buf->data);
   return (r);
 }
 
 /* expects to see: <menu-string>,<menu-string>,... <key-string> */
 static char *parse_keymap (int *menu, BUFFER *s, int maxmenus, int *nummenus, BUFFER *err)
 {
   BUFFER buf;
   int i=0;
@@ -1102,17 +1111,17 @@
       mutt_error (_("%s: no such function"), function);
       return (-1);
     }
     nops++;
   }
   while(MoreArgs(s) && nops < sizeof(ops)/sizeof(ops[0]));
 
   while(nops)
-    mutt_ungetch(0, ops[--nops]);
+    mutt_push_macro_event (0, ops[--nops]);
 
   return 0;
 }
 
 /*
  * prompts the user to enter a keystroke, and displays the octal value back
  * to the user.
  */
diff --git a/menu.c b/menu.c
--- a/menu.c
+++ b/menu.c
@@ -20,18 +20,16 @@
 # include "config.h"
 #endif
 
 #include "mutt.h"
 #include "mutt_curses.h"
 #include "mutt_menu.h"
 #include "mbyte.h"
 
-extern size_t UngetCount;
-
 char* SearchBuffers[MENU_MAX];
 
 static void print_enriched_string (int attr, unsigned char *s, int do_color)
 {
   wchar_t wc;
   size_t k;
   size_t n = mutt_strlen ((char *)s);
   mbstate_t mbstate;
@@ -410,17 +408,17 @@
 
 void menu_jump (MUTTMENU *menu)
 {
   int n;
   char buf[SHORT_STRING];
 
   if (menu->max)
   {
-    mutt_ungetch (LastKey, 0);
+    mutt_unget_event (LastKey, 0);
     buf[0] = 0;
     if (mutt_get_field (_("Jump to: "), buf, sizeof (buf), 0) == 0 && buf[0])
     {
       if (mutt_atoi (buf, &n) == 0 && n > 0 && n < menu->max + 1)
       {
 	n--;	/* msg numbers are 0-based */
 	menu->current = n;
 	menu->redraw = REDRAW_MOTION;
@@ -812,17 +810,17 @@
 
   if (ch.ch && (p = strchr (menu->keys, ch.ch)))
   {
     *ip = OP_MAX + (p - menu->keys + 1);
     return 0;
   }
   else
   {
-    mutt_ungetch (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
+    mutt_unget_event (ch.op ? 0 : ch.ch, ch.op ? ch.op : 0);
     return -1;
   }
 }
 
 int menu_redraw (MUTTMENU *menu)
 {
   /* See if all or part of the screen needs to be updated.  */
   if (menu->redraw & REDRAW_FULL)
@@ -900,22 +898,17 @@
       }
       else if (i == OP_TAG_PREFIX)
       {
 	mutt_error _("No tagged entries.");
 	i = -1;
       }
       else /* None tagged, OP_TAG_PREFIX_COND */
       {
-	event_t tmp;
-	while(UngetCount>0)
-	{
-	  tmp=mutt_getch();
-	  if(tmp.op==OP_END_COND)break;
-	}
+	mutt_flush_macro_to_endcond ();
 	mutt_message _("Nothing to do.");
 	i = -1;
       }
     }
     else if (menu->tagged && option (OPTAUTOTAG))
       menu->tagprefix = 1;
     else
       menu->tagprefix = 0;
diff --git a/mutt.h b/mutt.h
--- a/mutt.h
+++ b/mutt.h
@@ -93,19 +93,16 @@
 #define M_TOKEN_EQUAL		1	/* treat '=' as a special */
 #define M_TOKEN_CONDENSE	(1<<1)	/* ^(char) to control chars (macros) */
 #define M_TOKEN_SPACE		(1<<2)  /* don't treat whitespace as a term */
 #define M_TOKEN_QUOTE		(1<<3)	/* don't interpret quotes */
 #define M_TOKEN_PATTERN		(1<<4)	/* !)|~ are terms (for patterns) */
 #define M_TOKEN_COMMENT		(1<<5)	/* don't reap comments */
 #define M_TOKEN_SEMICOLON	(1<<6)	/* don't treat ; as special */
 
-/* flags for km_dokey() */
-#define M_KM_UNBUFFERED 1 /* don't read from the key buffer */
-
 typedef struct
 {
   char *data;	/* pointer to data */
   char *dptr;	/* current read/write position */
   size_t dsize;	/* length of data */
   int destroy;	/* destroy `data' when done? */
 } BUFFER;
 
@@ -508,17 +505,17 @@
   OPTKEEPQUIET,		/* (pseudo) shut up the message and refresh
 			 * 	    functions while we are executing an
 			 * 	    external program.
 			 */
   OPTMENUCALLER,	/* (pseudo) tell menu to give caller a take */
   OPTREDRAWTREE,	/* (pseudo) redraw the thread tree */
   OPTPGPCHECKTRUST,	/* (pseudo) used by pgp_select_key () */
   OPTDONTHANDLEPGPKEYS,	/* (pseudo) used to extract PGP keys */
-  OPTUNBUFFEREDINPUT,   /* (pseudo) don't use key buffer */
+  OPTIGNOREMACROEVENTS, /* (pseudo) don't process macro/push/exec events while set */
 
   OPTMAX
 };
 
 #define mutt_bit_alloc(n) calloc ((n + 7) / 8, sizeof (char))
 #define mutt_bit_set(v,n) v[n/8] |= (1 << (n % 8))
 #define mutt_bit_unset(v,n) v[n/8] &= ~(1 << (n % 8))
 #define mutt_bit_toggle(v,n) v[n/8] ^= (1 << (n % 8))
diff --git a/mutt_curses.h b/mutt_curses.h
--- a/mutt_curses.h
+++ b/mutt_curses.h
@@ -88,17 +88,20 @@
 #endif
 
 event_t mutt_getch (void);
 
 void mutt_endwin (const char *);
 void mutt_flushinp (void);
 void mutt_refresh (void);
 void mutt_resize_screen (void);
-void mutt_ungetch (int, int);
+void mutt_unget_event (int, int);
+void mutt_unget_string (char *);
+void mutt_push_macro_event (int, int);
+void mutt_flush_macro_to_endcond (void);
 void mutt_need_hard_redraw (void);
 
 /* ----------------------------------------------------------------------------
  * Support for color
  */
 
 enum
 {
diff --git a/mutt_ssl.c b/mutt_ssl.c
--- a/mutt_ssl.c
+++ b/mutt_ssl.c
@@ -1046,17 +1046,17 @@
   helpstr[0] = '\0';
   mutt_make_help (buf, sizeof (buf), _("Exit  "), MENU_GENERIC, OP_EXIT);
   safe_strcat (helpstr, sizeof (helpstr), buf);
   mutt_make_help (buf, sizeof (buf), _("Help"), MENU_GENERIC, OP_HELP);
   safe_strcat (helpstr, sizeof (helpstr), buf);
   menu->help = helpstr;
 
   done = 0;
-  set_option(OPTUNBUFFEREDINPUT);
+  set_option(OPTIGNOREMACROEVENTS);
   while (!done)
   {
     switch (mutt_menuLoop (menu))
     {
       case -1:			/* abort */
       case OP_MAX + 1:		/* reject */
       case OP_EXIT:
         done = 1;
@@ -1081,17 +1081,17 @@
 	}
         /* fall through */
       case OP_MAX + 2:		/* accept once */
         done = 2;
 	ssl_cache_trusted_cert (cert);
         break;
     }
   }
-  unset_option(OPTUNBUFFEREDINPUT);
+  unset_option(OPTIGNOREMACROEVENTS);
   mutt_menuDestroy (&menu);
   dprint (2, (debugfile, "ssl interactive_check_cert: done=%d\n", done));
   return (done == 2);
 }
 
 static void ssl_get_client_cert(sslsockdata *ssldata, CONNECTION *conn)
 {
   if (SslClientCert)
diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c
--- a/mutt_ssl_gnutls.c
+++ b/mutt_ssl_gnutls.c
@@ -1000,17 +1000,17 @@
   helpstr[0] = '\0';
   mutt_make_help (buf, sizeof (buf), _("Exit  "), MENU_GENERIC, OP_EXIT);
   safe_strcat (helpstr, sizeof (helpstr), buf);
   mutt_make_help (buf, sizeof (buf), _("Help"), MENU_GENERIC, OP_HELP);
   safe_strcat (helpstr, sizeof (helpstr), buf);
   menu->help = helpstr;
 
   done = 0;
-  set_option (OPTUNBUFFEREDINPUT);
+  set_option (OPTIGNOREMACROEVENTS);
   while (!done)
   {
     switch (mutt_menuLoop (menu))
     {
       case -1:			/* abort */
       case OP_MAX + 1:		/* reject */
       case OP_EXIT:
         done = 1;
@@ -1052,17 +1052,17 @@
 	  mutt_sleep (0);
 	}
         /* fall through */
       case OP_MAX + 2:		/* accept once */
         done = 2;
         break;
     }
   }
-  unset_option (OPTUNBUFFEREDINPUT);
+  unset_option (OPTIGNOREMACROEVENTS);
   mutt_menuDestroy (&menu);
   gnutls_x509_crt_deinit (cert);
 
   return (done == 2);
 }
 
 /* sanity-checking wrapper for gnutls_certificate_verify_peers */
 static gnutls_certificate_status_t tls_verify_peers (gnutls_session_t tlsstate)

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic