nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c08f50d9de1a70ccf33cb16e2322e5fc1e662a10
parent 816a165b4b8b0d8545c4950542bcdeb25c097ec9
Author: Chris Allegretta <chrisa@asty.org>
Date:   Sat,  6 Jan 2001 18:12:43 +0000

Back to the drawing board, old keypad code, dont slightly better


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@452 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 12++++++------
Macconfig.h | 3+++
Mconfig.h.in | 3+++
Mconfigure | 213+++++++++++++++++++++++++++++++++++++++++++++++--------------------------------
Mconfigure.in | 14++++++++++++++
Mfiles.c | 4+++-
Mnano.c | 31+++++++++----------------------
Mproto.h | 2++
Mwinio.c | 28+++++++++++++++++++++++++---
9 files changed, 191 insertions(+), 119 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -4,12 +4,12 @@ General - helper functions browser_init(), tail(), striponedir(), filestat(). New shortcut list browser_list. Some new strings to translate. Added function do_browse_from(). - - We only call keypad() once now for each window, at the beginning. - FINALLY! No more keypad_on(), no more individual calls in - main(), do_help(), do_browser(), etc etc etc. Removed call to - timeout(0) in main() (which caused the whole mess), fixes BUG #49. - Added workarounds for gnome-terminal in main() (Alt-O-key and - 348-352). + - Keypad code has been changed slightly. Now checks for + _use_keypad flag in window to see whether or not to turn + the keypad() back off when finished (taken from aumix). Moved + to winio.c where it should probably be anyway. New confgure + check for _use_keypad in window sstruct. This will have to do + for now. - faq.html: - Fix typos and small mistakes (Jordi). - files.c: diff --git a/acconfig.h b/acconfig.h @@ -3,6 +3,9 @@ /* Define this if you have the wresize function in your ncurses-type library */ #undef HAVE_WRESIZE +/* Define this if your curses lib has the _use_keypad flag */ +#undef HAVE_USEKEYPAD + /* Define this if you have NLS */ #undef ENABLE_NLS diff --git a/config.h.in b/config.h.in @@ -55,6 +55,9 @@ /* Define this if you have the wresize function in your ncurses-type library */ #undef HAVE_WRESIZE +/* Define this if your curses lib has the _use_keypad flag */ +#undef HAVE_USEKEYPAD + /* Define this if you have NLS */ #undef ENABLE_NLS diff --git a/configure b/configure @@ -2402,6 +2402,45 @@ else fi +# Taken from aumix (can't tell form the variable name?) +echo $ac_n "checking for private member _use_keypad in WINDOW""... $ac_c" 1>&6 +echo "configure:2408: checking for private member _use_keypad in WINDOW" >&5 +if eval "test \"`echo '$''{'aumix_cv_struct_window_usekeypad'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2413 "configure" +#include "confdefs.h" +#ifdef HAVE_NCURSES_H +#include <ncurses.h> +#else +#include <curses.h> +#endif +int main() { +WINDOW w; w._use_keypad; +; return 0; } +EOF +if { (eval echo configure:2424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + aumix_cv_struct_window_usekeypad=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + aumix_cv_struct_window_usekeypad=no +fi +rm -f conftest* +fi + +echo "$ac_t""$aumix_cv_struct_window_usekeypad" 1>&6 + +if test $aumix_cv_struct_window_usekeypad = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_USEKEYPAD 1 +EOF + +fi + LIBS="$LIBS $CURSES_LIB" @@ -2426,7 +2465,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2430: checking for $ac_word" >&5 +echo "configure:2469: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2454,12 +2493,12 @@ else fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2458: checking for working const" >&5 +echo "configure:2497: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2463 "configure" +#line 2502 "configure" #include "confdefs.h" int main() { @@ -2508,7 +2547,7 @@ ccp = (char const *const *) p; ; return 0; } EOF -if { (eval echo configure:2512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2529,21 +2568,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2533: checking for inline" >&5 +echo "configure:2572: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <<EOF -#line 2540 "configure" +#line 2579 "configure" #include "confdefs.h" int main() { } int $ac_kw foo() { ; return 0; } EOF -if { (eval echo configure:2547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2569,12 +2608,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2573: checking for off_t" >&5 +echo "configure:2612: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2578 "configure" +#line 2617 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2602,12 +2641,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2606: checking for size_t" >&5 +echo "configure:2645: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2611 "configure" +#line 2650 "configure" #include "confdefs.h" #include <sys/types.h> #if STDC_HEADERS @@ -2637,19 +2676,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2641: checking for working alloca.h" >&5 +echo "configure:2680: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2646 "configure" +#line 2685 "configure" #include "confdefs.h" #include <alloca.h> int main() { void *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2670,12 +2709,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2674: checking for alloca" >&5 +echo "configure:2713: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2679 "configure" +#line 2718 "configure" #include "confdefs.h" #ifdef __GNUC__ @@ -2703,7 +2742,7 @@ int main() { char *p = (char *) alloca(1); ; return 0; } EOF -if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2735,12 +2774,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2739: checking whether alloca needs Cray hooks" >&5 +echo "configure:2778: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2744 "configure" +#line 2783 "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray @@ -2765,12 +2804,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2769: checking for $ac_func" >&5 +echo "configure:2808: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2774 "configure" +#line 2813 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2793,7 +2832,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2820,7 +2859,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2824: checking stack direction for C alloca" >&5 +echo "configure:2863: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2828,7 +2867,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <<EOF -#line 2832 "configure" +#line 2871 "configure" #include "confdefs.h" find_stack_direction () { @@ -2847,7 +2886,7 @@ main () exit (find_stack_direction() < 0); } EOF -if { (eval echo configure:2851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2872,17 +2911,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2876: checking for $ac_hdr" >&5 +echo "configure:2915: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2881 "configure" +#line 2920 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2911,12 +2950,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2915: checking for $ac_func" >&5 +echo "configure:2954: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2920 "configure" +#line 2959 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -2939,7 +2978,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:2943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2964,7 +3003,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2968: checking for working mmap" >&5 +echo "configure:3007: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2972,7 +3011,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <<EOF -#line 2976 "configure" +#line 3015 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. @@ -3115,7 +3154,7 @@ main() } EOF -if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3143,17 +3182,17 @@ unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3147: checking for $ac_hdr" >&5 +echo "configure:3186: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3152 "configure" +#line 3191 "configure" #include "confdefs.h" #include <$ac_hdr> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3196: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3183,12 +3222,12 @@ done strdup __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3187: checking for $ac_func" >&5 +echo "configure:3226: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3192 "configure" +#line 3231 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3211,7 +3250,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3240,12 +3279,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3244: checking for $ac_func" >&5 +echo "configure:3283: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3249 "configure" +#line 3288 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3268,7 +3307,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3302,19 +3341,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3306: checking for LC_MESSAGES" >&5 +echo "configure:3345: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3311 "configure" +#line 3350 "configure" #include "confdefs.h" #include <locale.h> int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3335,7 +3374,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3339: checking whether NLS is requested" >&5 +echo "configure:3378: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3355,7 +3394,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3359: checking whether included gettext is requested" >&5 +echo "configure:3398: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3374,17 +3413,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3378: checking for libintl.h" >&5 +echo "configure:3417: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3383 "configure" +#line 3422 "configure" #include "confdefs.h" #include <libintl.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3401,19 +3440,19 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3405: checking for gettext in libc" >&5 +echo "configure:3444: checking for gettext in libc" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3410 "configure" +#line 3449 "configure" #include "confdefs.h" #include <libintl.h> int main() { return (int) gettext ("") ; return 0; } EOF -if { (eval echo configure:3417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3429,7 +3468,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 if test "$gt_cv_func_gettext_libc" != "yes"; then echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3433: checking for bindtextdomain in -lintl" >&5 +echo "configure:3472: checking for bindtextdomain in -lintl" >&5 ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3437,7 +3476,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3441 "configure" +#line 3480 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3448,7 +3487,7 @@ int main() { bindtextdomain() ; return 0; } EOF -if { (eval echo configure:3452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3464,12 +3503,12 @@ fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3468: checking for gettext in libintl" >&5 +echo "configure:3507: checking for gettext in libintl" >&5 if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:3473: checking for gettext in -lintl" >&5 +echo "configure:3512: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3477,7 +3516,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <<EOF -#line 3481 "configure" +#line 3520 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3488,7 +3527,7 @@ int main() { gettext() ; return 0; } EOF -if { (eval echo configure:3492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3527,7 +3566,7 @@ EOF # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3531: checking for $ac_word" >&5 +echo "configure:3570: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3561,12 +3600,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3565: checking for $ac_func" >&5 +echo "configure:3604: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3570 "configure" +#line 3609 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3589,7 +3628,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3616,7 +3655,7 @@ done # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3620: checking for $ac_word" >&5 +echo "configure:3659: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3652,7 +3691,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3656: checking for $ac_word" >&5 +echo "configure:3695: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3684,7 +3723,7 @@ else fi cat > conftest.$ac_ext <<EOF -#line 3688 "configure" +#line 3727 "configure" #include "confdefs.h" int main() { @@ -3692,7 +3731,7 @@ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3715,7 +3754,7 @@ fi if test "$CATOBJEXT" = "NONE"; then echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:3719: checking whether catgets can be used" >&5 +echo "configure:3758: checking whether catgets can be used" >&5 # Check whether --with-catgets or --without-catgets was given. if test "${with_catgets+set}" = set; then withval="$with_catgets" @@ -3728,7 +3767,7 @@ fi if test "$nls_cv_use_catgets" = "yes"; then echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:3732: checking for main in -li" >&5 +echo "configure:3771: checking for main in -li" >&5 ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3736,14 +3775,14 @@ else ac_save_LIBS="$LIBS" LIBS="-li $LIBS" cat > conftest.$ac_ext <<EOF -#line 3740 "configure" +#line 3779 "configure" #include "confdefs.h" int main() { main() ; return 0; } EOF -if { (eval echo configure:3747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3771,12 +3810,12 @@ else fi echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:3775: checking for catgets" >&5 +echo "configure:3814: checking for catgets" >&5 if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3780 "configure" +#line 3819 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char catgets(); below. */ @@ -3799,7 +3838,7 @@ catgets(); ; return 0; } EOF -if { (eval echo configure:3803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_catgets=yes" else @@ -3821,7 +3860,7 @@ EOF # Extract the first word of "gencat", so it can be a program name with args. set dummy gencat; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3825: checking for $ac_word" >&5 +echo "configure:3864: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3857,7 +3896,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3861: checking for $ac_word" >&5 +echo "configure:3900: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3894,7 +3933,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3898: checking for $ac_word" >&5 +echo "configure:3937: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3929,7 +3968,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3933: checking for $ac_word" >&5 +echo "configure:3972: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3987,7 +4026,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3991: checking for $ac_word" >&5 +echo "configure:4030: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4021,7 +4060,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4025: checking for $ac_word" >&5 +echo "configure:4064: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4057,7 +4096,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4061: checking for $ac_word" >&5 +echo "configure:4100: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4150,7 +4189,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4154: checking for catalogs to be installed" >&5 +echo "configure:4193: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4178,17 +4217,17 @@ echo "configure:4154: checking for catalogs to be installed" >&5 if test "$CATOBJEXT" = ".cat"; then ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4182: checking for linux/version.h" >&5 +echo "configure:4221: checking for linux/version.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 4187 "configure" +#line 4226 "configure" #include "confdefs.h" #include <linux/version.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* diff --git a/configure.in b/configure.in @@ -208,6 +208,20 @@ fi AC_CHECK_LIB($CURSES_LIB_NAME, wresize, AC_DEFINE(HAVE_WRESIZE)) +# Taken from aumix (can't tell form the variable name?) +AC_CACHE_CHECK(for private member _use_keypad in WINDOW, +aumix_cv_struct_window_usekeypad, +[AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H +#include <ncurses.h> +#else +#include <curses.h> +#endif], [WINDOW w; w._use_keypad;], +aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)]) + +if test $aumix_cv_struct_window_usekeypad = yes; then + AC_DEFINE(HAVE_USEKEYPAD) +fi + dnl Parse any configure options LIBS="$LIBS $CURSES_LIB" diff --git a/files.c b/files.c @@ -1194,7 +1194,7 @@ char *do_browser(char *inpath) static char *path = NULL; int numents = 0, i = 0, j = 0, kbinput = 0, longest = 0, abort = 0; int col = 0, selected = 0, editline = 0, width = 0, filecols = 0; - int lineno = 0; + int lineno = 0, kb; char **filelist = (char **) NULL; /* If path isn't the same as inpath, we are being passed a new @@ -1215,6 +1215,7 @@ char *do_browser(char *inpath) /* Sort the list by directory first then alphabetically */ qsort(filelist, numents, sizeof(char *), diralphasort); + kb = keypad_on(edit, 1); titlebar(path); bottombars(browser_list, BROWSER_LIST_LEN); curs_set(0); @@ -1395,6 +1396,7 @@ char *do_browser(char *inpath) blank_edit(); titlebar(NULL); edit_refresh(); + kb = keypad_on(edit, kb); /* cleanup */ free_charptrarray(filelist, numents); diff --git a/nano.c b/nano.c @@ -77,6 +77,10 @@ int search_last_line; /* Is this the last search line? */ /* What we do when we're all set to exit */ RETSIGTYPE finish(int sigage) { + + keypad(edit, TRUE); + keypad(bottomwin, TRUE); + if (!ISSET(NO_HELP)) { mvwaddstr(bottomwin, 1, 0, hblank); mvwaddstr(bottomwin, 2, 0, hblank); @@ -1640,9 +1644,6 @@ void window_init(void) topwin = newwin(2, COLS, 0, 0); bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0); - /* HAHA! Only do this once! */ - keypad(edit, TRUE); - keypad(bottomwin, TRUE); } void mouse_init(void) @@ -1650,6 +1651,8 @@ void mouse_init(void) #ifndef NANO_SMALL #ifdef NCURSES_MOUSE_VERSION if (ISSET(USE_MOUSE)) { + keypad_on(edit, 1); + mousemask(BUTTON1_RELEASED, NULL); mouseinterval(50); @@ -2258,6 +2261,9 @@ int main(int argc, char *argv[]) #endif kbinput = wgetch(edit); +#ifdef DEBUG + fprintf(stderr, "AHA! %c (%d)\n", kbinput, kbinput); +#endif if (kbinput == 27) { /* Grab Alt-key stuff first */ switch (kbinput = wgetch(edit)) { /* Alt-O, suddenly very important ;) */ @@ -2265,8 +2271,6 @@ int main(int argc, char *argv[]) kbinput = wgetch(edit); if (kbinput <= 'S' && kbinput >= 'P') kbinput = KEY_F(kbinput - 79); - else if (kbinput >= 'j' && kbinput <= 'y') - kbinput = kbinput - 64; #ifdef DEBUG else { fprintf(stderr, _("I got Alt-O-%c! (%d)\n"), @@ -2461,23 +2465,6 @@ int main(int argc, char *argv[]) do_next_word(); break; - /* Stupid gnome-terminal keypad */ - case 349: - ungetch('5'); - break; - case 348: - ungetch('7'); - break; - case 350: - ungetch('9'); - break; - case 351: - ungetch('1'); - break; - case 352: - ungetch('3'); - break; - case 331: /* Stuff that we don't want to do squat */ case -1: case 410: /* Must ignore this, it gets sent when we resize */ diff --git a/proto.h b/proto.h @@ -151,6 +151,7 @@ int do_home(void), do_end(void), total_refresh(void), do_mark(void); int do_delete(void), do_backspace(void), do_tab(void), do_justify(void); int do_first_line(void), do_last_line(void); int do_replace(void), do_help(void), do_enter_void(void); +int keypad_on(WINDOW * win, int new); #if !defined(DISABLE_BROWSER) && !defined(NANO_SMALL) char *do_browser(char *path); @@ -158,6 +159,7 @@ struct stat filestat(const char *path); char *do_browse_from(char *inpath); #endif + filestruct *copy_node(filestruct * src); filestruct *copy_filestruct(filestruct * src); filestruct *make_new_node(filestruct * prevnode); diff --git a/winio.c b/winio.c @@ -1180,19 +1180,20 @@ int do_help(void) { #if !defined(NANO_SMALL) && !defined(DISABLE_HELP) char *ptr = help_text, *end; - int i, j, row = 0, page = 1, kbinput = 0, no_more = 0; + int i, j, row = 0, page = 1, kbinput = 0, no_more = 0, kp; int no_help_flag = 0; blank_edit(); curs_set(0); blank_statusbar(); + kp = keypad_on(edit, 1); + if (ISSET(NO_HELP)) { no_help_flag = 1; delwin(bottomwin); bottomwin = newwin(3, COLS, LINES - 3, 0); - keypad(bottomwin, TRUE); editwinrows -= no_help(); UNSET(NO_HELP); @@ -1277,13 +1278,14 @@ int do_help(void) delwin(bottomwin); SET(NO_HELP); bottomwin = newwin(3 - no_help(), COLS, LINES - 3 + no_help(), 0); - keypad(bottomwin, TRUE); editwinrows += no_help(); } else display_main_list(); curs_set(1); edit_refresh(); + kp = keypad_on(edit, kp); + #elif defined(NANO_SMALL) nano_small_msg(); #elif defined(DISABLE_HELP) @@ -1470,3 +1472,23 @@ void do_credits(void) total_refresh(); } #endif + +int keypad_on(WINDOW * win, int new) +{ + +/* This is taken right from aumix. Don't sue me */ +#ifdef HAVE_USEKEYPAD + int old; + + old = win->_use_keypad; + keypad(win, new); + return old; +#else + keypad(win, new); + return 1; +#endif /* HAVE_USEKEYPAD */ + +} + + +