Add option 'escdelay'
This option overrides the environment variable.
The autoconf check for ESCDELAY was borrowed from the
Midnight Commander project.
--- a/mcabber/configure.ac Sun Dec 02 17:16:09 2007 +0100
+++ b/mcabber/configure.ac Sun Dec 02 17:56:51 2007 +0100
@@ -102,6 +102,20 @@
AC_MSG_WARN([Your ncurses installation does not support unicode])
fi
+AC_CACHE_CHECK([for ESCDELAY variable],
+ [mc_cv_ncurses_escdelay],
+ [AC_TRY_LINK([], [
+ extern int ESCDELAY;
+ ESCDELAY = 0;
+ ],
+ [mc_cv_ncurses_escdelay=yes],
+ [mc_cv_ncurses_escdelay=no])
+ ])
+if test "$mc_cv_ncurses_escdelay" = yes; then
+ AC_DEFINE(HAVE_ESCDELAY, 1,
+ [Define if ncurses has ESCDELAY variable])
+fi
+
# Check for glib
AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR([glib is required]),[g_list_append])
--- a/mcabber/mcabberrc.example Sun Dec 02 17:16:09 2007 +0100
+++ b/mcabber/mcabberrc.example Sun Dec 02 17:56:51 2007 +0100
@@ -273,6 +273,15 @@
# isn't defined, the status message will stay unchanged.
set message_autoaway = Auto-away (idle)
+# Escape timeout delay (ESCDELAY)
+# The ESCDELAY variable specifies the time, in milliseconds, for which
+# the ncurses interface will await a character sequence.
+# The default is 1000 (1 second).
+# If you want mcabber to react faster after hitting Escape, you can lower
+# this value by setting the ESCDELAY environment variable or setting the
+# 'escdelay' option.
+set escdelay = 50
+
# Colors
# Colors are: black, red, green, yellow, blue, magenta, cyan, white
# For text colors (i.e. not background and bg* colors) you can also use
--- a/mcabber/src/screen.c Sun Dec 02 17:16:09 2007 +0100
+++ b/mcabber/src/screen.c Sun Dec 02 17:56:51 2007 +0100
@@ -761,6 +761,14 @@
start_color();
use_default_colors();
+ if (settings_opt_get("escdelay")) {
+#ifdef HAVE_ESCDELAY
+ ESCDELAY = (unsigned) settings_opt_get_int("escdelay");
+#else
+ scr_LogPrint(LPRINT_LOGNORM, "ERROR: no ESCDELAY support.");
+#endif
+ }
+
ParseColors();
getmaxyx(stdscr, maxY, maxX);