nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH 13/17] add an explicit test for set_escdelay


From: Mike Frysinger
Subject: [Nano-devel] [PATCH 13/17] add an explicit test for set_escdelay
Date: Tue, 21 Feb 2017 17:04:45 -0500

Not all curses implementations provide this function, so drop it
from depending on slang (and assuming ncurses) to a general build
time test.
---
 configure.ac | 3 +++
 src/nano.c   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index fe1141f55a32..432de4242baf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -546,6 +546,9 @@ fi
 AC_CHECK_LIB([$CURSES_LIB_NAME], [use_default_colors],
             [AC_DEFINE(HAVE_USE_DEFAULT_COLORS, 1, [Define this if your curses 
library has the use_default_colors() command.])],
             [], [$CURSES_LIB])
+AC_CHECK_LIB([$CURSES_LIB_NAME], [set_escdelay],
+            [AC_DEFINE(HAVE_SET_ESCDELAY, 1, [Define this if your curses 
library has the set_escdelay() function.])],
+            [], [$CURSES_LIB])
 AC_CHECK_LIB([$CURSES_LIB_NAME], [key_defined],
             [AC_DEFINE(HAVE_KEY_DEFINED, 1, [Define this if your curses 
library has the key_defined() command.])],
             [], [$CURSES_LIB])
diff --git a/src/nano.c b/src/nano.c
index 184f0adcdff3..72abd7d43004 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2509,7 +2509,7 @@ int main(int argc, char **argv)
     shiftaltdown = get_keycode("kDN4", SHIFT_ALT_DOWN);
 #endif
 
-#ifndef USE_SLANG
+#ifdef HAVE_SET_ESCDELAY
     /* Tell ncurses to pass the Esc key quickly. */
     set_escdelay(50);
 #endif
-- 
2.11.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]