[Top][All Lists]

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

Re: texinfo-5.9.90 pretest available

From: Eli Zaretskii
Subject: Re: texinfo-5.9.90 pretest available
Date: Tue, 24 Feb 2015 18:39:09 +0200

> Date: Mon, 23 Feb 2015 22:46:23 GMT
> From: address@hidden (Karl Berry)
> Here's the first pretest for the next Texinfo release (which will be
> 6.0, due to the substantial overhaul of standalone Info and completely
> new implementation of texindex), for your testing pleasure:
>   ftp://alpha.gnu.org/gnu/texinfo/texinfo-5.9.90.tar.xz
>  http://alpha.gnu.org/gnu/texinfo/texinfo-5.9.90.tar.xz
> The NEWS below.  Please send feedback here, to address@hidden


I think NEWS should also mention support in the Info reader for
displaying characters that the terminal cannot show, this is important
in some locales given the increasing proliferation of Info manuals
that are encoded in UTF-8 and use Unicode punctuation characters.

Anyway, I've built this pretest with MinGW on MS-Windows.  It builods
cleanly, but I found a few minor issues, described below.

First, if the system where Texinfo is built has ncurses installed, the
configure script picks that up, and the Info reader is built with a
run-time dependency on the ncurses DLL, although only a couple of
global variables, which are unused on MS-Windows, are actually pulled
from the library.  I attach below a simple patch to avoid this
annoying dependency.

Next, "make check" fails because info/pseudotty.c cannot be possibly
compiled on Windows (and I'm not sure how portable it is to Posix
platforms, either).  This is bad news for the MinGW port, because most
of the Info brand-new test suite will not run.  I found and ran all
the non-interactive tests by hand, but it would be nice if (1) there
were a way to at least run those non-interactive tests automatically
where pseudotty cannot be used; and (2) how about including in the
scripts that implement interactive tests instructions for running them
manually?  I think being able to run the tests on any supported
platform is important.

Running the non-interactive Info tests revealed a problem in the
reader: it would abort when invoked with redirected stdin/stdout,
because the MinGW-specific terminal initialization bails out in that
case.  A patch to fix that is attached below.

2 tests in tp/tests fail:

     FAIL: t/stdout.sh
     FAIL: t/stdout_split.sh

This is because texi2any.pl uses "#! /usr/bin/env perl", which the
version of Bash I use doesn't grok.  Is this really needed? other
scripts that are installed by "make install" use just "/bin/perl".

Finally, dir-file-sloppily.sh fails:

     info: No menu item 'File-M' in node '(dir)Top'.

Does this test work on other systems?  It looks like the command line
of the test is incorrect, because running the test with --debug=-1
shows this:

     $ ./t/dir-file-sloppily.sh && echo OK
     info: adding ./t/infodir to INFOPATH
     info: looking for file "FiLe-M"
     info: looking for file FiLe-M in ./t/infodir
     info: falling back to manpage node
     info: No menu item 'FiLe-M' in node '(dir)Top'.
     info: writing node (*manpages*)FiLe-M...
     info: closing -

IOW, it interprets "FiLe-M" as a file name, and then falls back to man
pages.  To solve this, I needed to change the command line to this:

     $GINFO --output - -f ${srcdir}/t/infodir/dir FiLe-M | grep "^File: 

Here's the patch to avoid the ncurses dependency:

2015-02-24  Eli Zaretskii  <address@hidden>

        * info/terminal.c [HAVE_NCURSES_TERMCAP_H && __MINGW32__]: Don't
        include ncurses/termcap.h on MinGW, even if it's available, to
        avoid a useless run-time dependency on the ncurses shared library.

--- info/terminal.c~0   2014-12-25 18:52:44 +0200
+++ info/terminal.c     2015-02-24 11:14:04 +0200
@@ -30,12 +30,15 @@
 #include <signal.h>
 /* The Unix termcap interface code. */
+/* With MinGW, if the user has ncurses installed, including
+   ncurses/termcap.h will cause the Info binary depend on the ncurses
+   DLL, just because BC and PC are declared there, although they are
+   never used in the MinGW build.  Avoid that useless dependency.  */
+#if defined (HAVE_NCURSES_TERMCAP_H) && !defined (__MINGW32__)
 #include <ncurses/termcap.h>
+#elif defined (HAVE_TERMCAP_H)
 #include <termcap.h>
+#else  /* (!HAVE_NCURSES_TERMCAP_H || __MINGW32__) && !HAVE_TERMCAP_H */
 /* On Solaris2, sys/types.h #includes sys/reg.h, which #defines PC.
    Unfortunately, PC is a global variable used by the termcap library. */
 #undef PC
@@ -47,7 +50,6 @@
 extern int tgetnum (), tgetflag (), tgetent ();
 extern char *tgetstr (), *tgoto ();
 extern int tputs ();
-#endif /* not HAVE_TERMCAP_H */
 #endif /* not HAVE_NCURSES_TERMCAP_H */
 /* Function "hooks".  If you make one of these point to a function, that

Here's the patch to avoid terminal initialization in non-interactive
sessions.  (If you think this should be confined to the MinGW port, I
can move this to pcterm.c instead.)  I think using isatty here
requires to import a Gnulib module, since the stock Windows version of
isatty returns non-zero for any character device, including the null
device, which is undesirable.

2015-02-24  Eli Zaretskii  <address@hidden>

        * info/info.c (main): Don't call initialize_terminal_and_keymaps
        if stdout is not a terminal device.

--- info/session.c~     2015-02-21 14:04:07 +0200
+++ info/session.c      2015-02-24 12:49:36 +0200
@@ -260,7 +260,8 @@ void
 initialize_terminal_and_keymaps (char *init_file)
   char *term_name = getenv ("TERM");
-  terminal_initialize_terminal (term_name);
+  if (isatty (fileno (stdout)))
+    terminal_initialize_terminal (term_name);
   read_init_file (init_file);

reply via email to

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