From 9c23a44907f2bb878b10aef17040d271c55ded8e Mon Sep 17 00:00:00 2001
From: Chris Allegretta <chrisa@asty.org>
Date: Wed, 12 Dec 2001 01:45:01 +0000
Subject: [PATCH] Remove some debug code and update to mutt's gettext.m4

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@922 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog     |  2 ++
 color.c       |  2 ++
 m4/gettext.m4 | 27 ++++++++++-----------------
 nano.c        |  1 -
 4 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d8884d6a..6a29190b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,8 @@ CVS Code -
 	- Spanish translation updates (Jordi).
 - po/fr.po:
 	- French translation updates (Michel Robitaille).
+- m4/gettext.m4:
+	- diff against mutt 1.2.5's gettext.m4.
 
 nano-1.1.3 - 10/26/2001
 - General
diff --git a/color.c b/color.c
index 1ebc1e51..30eb7de6 100644
--- a/color.c
+++ b/color.c
@@ -134,7 +134,9 @@ int do_colorinit(void)
 	    else /* They picked a fg and bg color */
 		init_pair(i, tmpcolor->fg, tmpcolor->bg);
 
+#ifdef DEBUG
 	    fprintf(stderr, "Running init_pair with fg = %d and bg = %d\n", tmpcolor->fg, tmpcolor->bg);
+#endif
 
 	    tmpcolor->pairnum = i;
 	    i++;
diff --git a/m4/gettext.m4 b/m4/gettext.m4
index 890dd49a..b6d037ff 100644
--- a/m4/gettext.m4
+++ b/m4/gettext.m4
@@ -21,21 +21,9 @@ AC_DEFUN(NANO_AM_WITH_NLS,
 
     USE_INCLUDED_LIBINTL=no
 
-    AC_ARG_WITH(locale-dir,
-      [  --with-locale-dir=DIR   specify locale directory],
-      LOCALE_DIR=$withval)
-    test -z "$LOCALE_DIR" && LOCALE_DIR='$(datadir)/locale'
-    AC_SUBST(LOCALE_DIR)
-
-    AC_ARG_WITH(gnu-locale-dir,
-      [  --with-gnu-locale-dir=DIR specify GNU locale directory],
-      GNU_LOCALE_DIR=$withval)
-    test -z "$GNU_LOCALE_DIR" && GNU_LOCALE_DIR='$(prefix)/share/locale'
-    AC_SUBST(GNU_LOCALE_DIR)
-
     dnl If we use NLS figure out what method
     if test "$USE_NLS" = "yes"; then
-      AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested.])
+      AC_DEFINE(ENABLE_NLS)
       AC_MSG_CHECKING([whether included gettext is requested])
       AC_ARG_WITH(included-gettext,
         [  --with-included-gettext use the GNU gettext library included here],
@@ -60,13 +48,18 @@ AC_DEFUN(NANO_AM_WITH_NLS,
 
 	   if test "$gt_cv_func_gettext_libc" != "yes"; then
 	     AC_CHECK_LIB(intl, bindtextdomain,
-	       [AC_CHECK_LIB(intl, gettext)])
+	       [AC_CHECK_LIB(intl, gettext,
+	         gt_cv_func_gettext_libintl=yes,
+		 gt_cv_func_gettext_libintl=no)])
+	   fi
+	   
+	   if test "$gt_cv_func_gettext_libintl" = yes; then
+	     LIBS="$LIBS -lintl"
 	   fi
 
 	   if test "$gt_cv_func_gettext_libc" = "yes" \
-	      || test "$ac_cv_lib_intl_gettext" = "yes"; then
-	      AC_DEFINE(HAVE_GETTEXT, 1,
-	  [Define to 1 if you have gettext and don't want to use GNU gettext.])
+	      || test "$gt_cv_func_gettext_libintl" = "yes"; then
+	      AC_DEFINE(HAVE_GETTEXT)
 	      NANO_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
 		[test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
 	      if test "$MSGFMT" != "no"; then
diff --git a/nano.c b/nano.c
index 6bd1e2c8..3c403dba 100644
--- a/nano.c
+++ b/nano.c
@@ -2906,7 +2906,6 @@ int main(int argc, char *argv[])
 #ifdef ENABLE_COLOR
     do_colorinit();
 
-    fprintf(stderr, "COLORS = %d, COLOR_PAIRS = %d\n", COLORS, COLOR_PAIRS);
 #endif /* ENABLE_COLOR */
 
 #ifdef DEBUG
-- 
GitLab