Bruno Haible [Mon, 8 Apr 2019 01:07:08 +0000 (03:07 +0200)]
autopoint: Don't risk failing because of user or system git configurations.
Reported by Jamie Kirkpatrick <jkp@kirkconsulting.co.uk>
in <https://savannah.gnu.org/support/?107689>.
* gettext-tools/misc/autopoint.in: Set/unset environment variables, so that git
does not read the user's git configuration nor the system's git configuration.
* gettext-tools/misc/convert-archive.in: Likewise.
Reported by Philip Chimento <philip.chimento@gmail.com>
in <https://savannah.gnu.org/bugs/index.php?50920>.
* gettext-tools/src/x-javascript.c (P7_TEMPLATE_START_OF_EXPRESSION): New macro.
(enum token_type_ty): Add token_type_template, token_type_ltemplate,
token_type_mtemplate, token_type_rtemplate.
(free_token): Treat token_type_template like token_type_string.
(phase7_getuc): Add support for backquote quote_char.
(brace_depth, template_literal_depth): New variables.
(phase5_get): Parse template literals.
(x_javascript_lex): Treat token_type_template like token_type_string. Handle the
combination of symbol followed by template.
(extract_balanced): Treat token_type_template like token_type_string, and
token_type_ltemplate, token_type_mtemplate, token_type_rtemplate like
token_type_other.
(extract_javascript): Initialize brace_depth, template_literal_depth.
* gettext-tools/tests/xgettext-javascript-7: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* gettext-tools/doc/gettext.texi (JavaScript): Mention the template literal
syntax for strings.
* NEWS: Mention the improvement.
Bruno Haible [Sun, 7 Apr 2019 13:38:54 +0000 (15:38 +0200)]
doc: Use a version of texi2html which is under a good license.
Reported by <ineiev@gnu.org> in <https://savannah.gnu.org/bugs/?54809>.
* gettext-tools/doc/texi2html: Copied from texi2html-1.78, with changes made in
libunistring/build-aux/texi2html and then in libtextstyle/build-aux/texi2html.
* gettext-tools/doc/gettext.texi: Enable the Top node during texi2html
processing.
* gettext-tools/doc/Makefile.am (gettext.html): Use texi2html options
-no-sec-nav -no-menu -toc-links.
(gettext_toc.html): Likewise. Pull out generated files out of subdirectory.
Bruno Haible [Sun, 7 Apr 2019 13:33:24 +0000 (15:33 +0200)]
libasprintf: Use a version of texi2html which is under a good license.
Reported by <ineiev@gnu.org> in <https://savannah.gnu.org/bugs/?54809>.
* gettext-runtime/libasprintf/texi2html: Copied from texi2html-1.78, with
changes made in libunistring/build-aux/texi2html and then in
libtextstyle/build-aux/texi2html.
* gettext-runtime/libasprintf/fdl.texi: New file, copied from
gettext-tools/doc/fdl.texi.
* gettext-runtime/libasprintf/gpl.texi: New file, copied from
gnulib/doc/gpl-2.0.texi.
* gettext-runtime/libasprintf/lgpl.texi: New file, copied from
gnulib/doc/lgpl-2.1.texi.
* gettext-runtime/libasprintf/autosprintf.texi: Invoke @contents. Enable the
Top node during texi2html processing.
(Licenses): New appendix.
* gettext-runtime/libasprintf/Makefile.am (TEXINCLUDES): New variable.
(MAKEINFOFLAGS): Use it.
(autosprintf_TEXINFOS): New variable.
(autosprintf_all.html): Depend on it. Use texi2html options -no-sec-nav -no-menu
-toc-links.
Bruno Haible [Thu, 4 Apr 2019 02:20:32 +0000 (04:20 +0200)]
Reduce ABOUT-NLS to just a hyperlink.
The common way to distribute information, nowadays, is through the web,
not by including files in tarballs of packages. Also, the current
contents of ABOUT-NLS is outdated.
Reported by Samuel Thibault in <https://savannah.gnu.org/bugs/?54809>.
* gettext-runtime/ABOUT-NLS: Replace text with a reference to the online
documentation.
* gettext-runtime/Makefile.am (MAKEINFO): Remove variable.
(all-local, ABOUT-NLS): Remove rules.
* gettext-tools/src/msginit.c (main): Point the user to the online documentation
instead of the ABOUT-NLS file.
* gettext-tools/doc/gettext.texi (Installing Localizations, Prerequisites,
Makefile): Don't mention ABOUT-NLS any more.
* gettext-tools/doc/gettextize.texi: Update description of ABOUT-NLS.
* gettext-tools/doc/FAQ.html: Refer to the online documentation instead of the
ABOUT-NLS file.
* README: Don't mention ABOUT-NLS any more.
Bruno Haible [Wed, 3 Apr 2019 23:52:58 +0000 (01:52 +0200)]
doc: Include the contents of ABOUT-NLS in the documentation.
* gettext-runtime/doc/nls.texi (The original ABOUT-NLS): Renamed from
'Translation Intro'. Turn into a section. Mark section as historical.
* gettext-tools/doc/gettext.texi: Include nls.texi.
* gettext-tools/doc/Makefile.am (gettext_TEXINFOS): Add nls.texi and
matrix.texi.
Bruno Haible [Tue, 2 Apr 2019 15:52:29 +0000 (17:52 +0200)]
libtextstyle: Generalize fd-styled-ostream to noop-styled-ostream.
* gnulib-local/lib/noop-styled-ostream.oo.h: New file, based on
gnulib-local/lib/fd-styled-ostream.oo.h.
* gnulib-local/lib/noop-styled-ostream.oo.c: New file, based on
gnulib-local/lib/fd-styled-ostream.oo.c.
* gnulib-local/modules/noop-styled-ostream: New file, based on
gnulib-local/modules/fd-styled-ostream.
* gnulib-local/Makefile.am (EXTRA_DIST): Remove lib/fd-styled-ostream.oo.[hc]
and modules/fd-styled-ostream. Add lib/noop-styled-ostream.oo.[hc] and
modules/noop-styled-ostream.
* libtextstyle/woe32dll/c++noop-styled-ostream.cc: New file, based on
libtextstyle/woe32dll/c++fd-styled-ostream.cc.
* libtextstyle/gnulib-local/modules/noop-styled-ostream.diff: New file, based
on libtextstyle/gnulib-local/modules/fd-styled-ostream.diff.
* gnulib-local/lib/fd-styled-ostream.oo.h: Remove file.
* gnulib-local/lib/fd-styled-ostream.oo.c: Remove file.
* gnulib-local/modules/fd-styled-ostream: Remove file.
* libtextstyle/woe32dll/c++fd-styled-ostream.cc: Remove file.
* libtextstyle/gnulib-local/modules/fd-styled-ostream.diff: Remove file.
* libtextstyle/autogen.sh (GNULIB_MODULES): Add noop-styled-ostream. Remove
fd-styled-ostream.
* libtextstyle/lib/misc.c: Include noop-styled-ostream.h, fd-ostream.h.
(styled_ostream_create): Call fd_ostream_create and noop_styled_ostream_create
instead of fd_styled_ostream_create.
* libtextstyle/lib/textstyle.h (noop_styled_ostream_t): New type.
(noop_styled_ostream_*): New declarations.
* libtextstyle/doc/libtextstyle.texi (The noop_styled_ostream class): New
subsection.
Bruno Haible [Tue, 2 Apr 2019 15:52:20 +0000 (17:52 +0200)]
build: Build and install libtextstyle.
* autogen.sh: Recurse into libtextstyle directory.
* configure.ac: Likewise.
* Makefile.am (SUBDIRS): Add libtextstyle.
* DEPENDENCIES: Mention that libiconv and ncurses are also used by libtextstyle.
* PACKAGING: Recommend to ship libtextstyle as a third binary package.
* NEWS: Mention that libtextstyle is installed.
Bruno Haible [Tue, 2 Apr 2019 15:51:13 +0000 (17:51 +0200)]
build: Separate git operations from build operations.
* gitsub.sh: New file, from gnulib.
* autogen.sh: Remove all git operations and the --no-git option. Look at the
GNULIB_SRCDIR environment variable. Ignore the GNULIB_TOOL environment variable.
* HACKING: Explain when to use gitsub.sh.
While the spec only allows spaces before and after '=',
xgettext/msgfmt previously accepted all whitespaces including '\n'.
That was causing unwanted concatenation of desktop lines.
Reported by Bastien Nocera in:
https://lists.gnu.org/archive/html/bug-gettext/2019-03/msg00017.html
* gettext-tools/src/read-desktop.c (desktop_lex): Properly handle
space characters before and after '='.
* gettext-tools/tests/msgfmt-desktop-1: Add a test case.
Bruno Haible [Sun, 31 Mar 2019 20:05:16 +0000 (22:05 +0200)]
libtextstyle: Add support for true-color terminals.
* gnulib-local/lib/term-ostream.oo.c (colormodel_t): Add cm_xtermrgb.
(rgb_to_color_xtermrgb): New function.
(attributes_t): Extend the color fields to 25 bits.
(struct term_ostream): New fields active_attr_color, active_attr_bgcolor.
(out_color_change, out_bgcolor_change, term_ostream::rgb_to_color): Handle
cm_xtermrgb.
(out_attr_change): Set also active_attr_color, active_attr_bgcolor.
(async_set_attributes_from_default): Fetch also active_attr_color,
active_attr_bgcolor.
(term_ostream_create): Accept all $TERM values that end in -direct.
* libtextstyle/doc/libtextstyle.texi (Terminal emulators): Document the
prerequisites for true-color support.
* libtextstyle/NEWS: Mention the change.
Bruno Haible [Sun, 31 Mar 2019 14:50:40 +0000 (16:50 +0200)]
libtextstyle: Support for terminal types with 256 colors.
* gnulib-local/lib/term-ostream.oo.c (term_ostream_create): Accept all $TERM
values that end in -16color or -256 color (such as Eterm-256color,
mlterm-256color, or putty-256color).
* libtextstyle/NEWS: Mention the change.
Bruno Haible [Sat, 30 Mar 2019 10:45:00 +0000 (11:45 +0100)]
build: Move the Emacs package sources to subdirectory gettext-tools/emacs/.
* gettext-tools/emacs/*.el: Moved here from gettext-tools/misc/.
* gettext-tools/emacs/Makefile.am: New file, based on
gettext-tools/misc/Makefile.am.
* gettext-tools/misc/Makefile.am (lisp_LISP): Remove variable.
* gettext-tools/configure.ac (AC_CONFIG_FILES): Add emacs/Makefile.
* gettext-tools/Makefile.am (SUBDIRS): Add 'emacs'.
Bruno Haible [Wed, 27 Mar 2019 20:38:20 +0000 (21:38 +0100)]
libtextstyle: Add support for Windows consoles.
* gnulib-local/lib/term-ostream.oo.c: Include <windows.h>, msvc-nothrow.h,
<io.h>.
(struct term_ostream): Add fields handle, is_windows_console,
default_console_attributes, current_console_attributes.
(out_color_change, out_bgcolor_change, out_underline_change, out_attr_change,
restore, async_restore, async_set_attributes_from_default, term_ostream::flush):
Add separate code path for Windows consoles.
(term_ostream_create): On Windows, test whether the handle refers to a console,
and initialize the new fields.
* gnulib-local/modules/term-ostream (Depends-on): Add msvc-nothrow.
* libtextstyle/NEWS: Mention it.
Bruno Haible [Wed, 27 Mar 2019 20:38:14 +0000 (21:38 +0100)]
libtextstyle: Make the SIGCONT handler work more reliably.
* gnulib-local/lib/term-ostream.oo.c (out_attr_change): Modify active_attr
before emitting the escape sequences, not afterwards.
* libtextstyle/NEWS: Mention the fix.
Bruno Haible [Tue, 26 Mar 2019 22:05:09 +0000 (23:05 +0100)]
its: Fix test failure.
* gettext-tools/src/its.c (normalize_whitespace): Fix detection of paragraph
boundary. Get rid of initial trim() call.
* gettext-tools/tests/xgettext-its-1: Fix typo. Verify removal of whitespace
at the end of the last paragraph.
* autogen.sh (GNULIB_MODULES_TOOLS_FOR_SRC): Add memchr.
Bruno Haible [Sun, 24 Mar 2019 21:14:21 +0000 (22:14 +0100)]
moopp: Allow forward references to the <class>_representation type.
* gnulib-local/build-aux/moopp (func_version): Bump copyright year.
(func_emit_source_c): Move the <class>_representation type alias to the top
of the file.
Bruno Haible [Wed, 20 Mar 2019 21:20:13 +0000 (22:20 +0100)]
Use _GL_ASYNC_SAFE from gnulib.
* gettext-tools/src/plural-eval.h (sigfpe_code): Mark as volatile.
* gettext-tools/src/plural-eval.c (sigfpe_code): Likewise.
(sigfpe_handler): Mark as _GL_ASYNC_SAFE.
* gnulib-local/lib/term-ostream.oo.c (ASYNC_SAFE): Remove macro.
Use _GL_ASYNC_SAFE instead.
Bruno Haible [Sun, 17 Mar 2019 15:20:15 +0000 (16:20 +0100)]
libtextstyle: Fix build failure on Cygwin (regression from 2019-03-15).
* libtextstyle/lib/Makefile.am ($(srcdir)/libtextstyle.sym.in): Renamed
from $(srcdir)/libtextstyle.sym.
(libtextstyle.sym): New rule.
(MOSTLYCLEANFILES, MAINTAINERCLEANFILES, EXTRA_DIST): Update accordingly.
(config.h): Depend on libtextstyle.sym in the build directory.
(libtextstyle_la_LDFLAGS: Use libtextstyle.sym in the build directory.
Bruno Haible [Sat, 16 Mar 2019 22:17:39 +0000 (23:17 +0100)]
libtextstyle: Protect better against EINTR.
* gnulib-local/lib/fd-ostream.oo.c (nonintr_tcdrain): New function.
(fd_ostream::flush): Use it instead of tcdrain.
* gnulib-local/lib/file-ostream.oo.c: Include <errno.h>.
(nonintr_tcdrain): New function.
(file_ostream::flush): Use it instead of tcdrain.
* gnulib-local/lib/term-ostream.oo.c (nonintr_tcdrain): New function.
(term_ostream::flush): Use it instead of tcdrain.
Bruno Haible [Thu, 14 Mar 2019 23:02:55 +0000 (00:02 +0100)]
libtextstyle: Reexport isatty() override from gnulib.
This is necessary for programs that are compiled for native Windows and
run in a Cygwin console.
* libtextstyle/autogen.sh (GNULIB_MODULES): Add 'isatty'.
* libtextstyle/configure.ac: Set GNULIB_ISATTY to 0.
* libtextstyle/lib/textstyle.h (libtextstyle_isatty): New declaration.
(isatty): Redirect to libtextstyle_isatty.
Bruno Haible [Thu, 14 Mar 2019 18:03:38 +0000 (19:03 +0100)]
libtextstyle: Use less code from libxml.
* libtextstyle/gnulib-local/lib/libxml/xmlversion.in.h.diff: New file.
* gnulib-local/lib/libxml/save.h (xmlEncodeAttributeEntities): Declare also when
LIBXML_OUTPUT_ENABLED is 0.
Bruno Haible [Wed, 13 Mar 2019 23:01:04 +0000 (00:01 +0100)]
libtextstyle: Add metainformation for Windows.
* libtextstyle/lib/libtextstyle.rc: New file.
* libtextstyle/lib/Makefile.am (EXTRA_DIST): Add it.
(WOE32_LIBADD): New variable.
(libtextstyle.res.lo): New rule.
(libtextstyle_la_LIBADD, libtextstyle_la_DEPENDENCIES): Augment.
Bruno Haible [Wed, 13 Mar 2019 22:43:38 +0000 (23:43 +0100)]
libtextstyle: Don't use a C++ compiler.
* libtextstyle/gnulib-local/modules/fd-styled-ostream.diff: New file.
* libtextstyle/gnulib-local/modules/html-styled-ostream.diff: New file.
* libtextstyle/gnulib-local/modules/term-styled-ostream.diff: New file.
* libtextstyle/lib/Makefile.am (libtextstyle_la_LINK): Use the C compiler
always.
* libtextstyle/configure.ac: Remove LT_LANG([C++]), AC_PROG_CXX, and related
invocations.
Bruno Haible [Wed, 13 Mar 2019 22:24:09 +0000 (23:24 +0100)]
libasprintf: Add metainformation for Windows.
* gettext-runtime/libasprintf/configure.ac: Set RC and WOE32 variables.
* gettext-runtime/libasprintf/libasprintf.rc: New file.
* gettext-runtime/libasprintf/Makefile.am (EXTRA_DIST): Add it.
(WOE32_LIBADD): New variable.
(libasprintf.res.lo): New rule.
(libasprintf_la_LIBADD, libasprintf_la_DEPENDENCIES): New variables.
Bruno Haible [Mon, 11 Mar 2019 20:19:57 +0000 (21:19 +0100)]
libtextstyle: Add a program for ad-hoc testing.
* libtextstyle/adhoc-tests/README: New file.
* libtextstyle/adhoc-tests/hello.c: New file, based on
libtextstyle/examples/color-hello/hello.c.
* libtextstyle/adhoc-tests/hello-default.css: New file, copied from
libtextstyle/examples/color-hello/hello-default.css.
* libtextstyle/adhoc-tests/Makefile.am: New file.
* libtextstyle/configure.ac (AC_CONFIG_FILES): Add adhoc-tests/Makefile.
* libtextstyle/Makefile.am (SUBDIRS): Add adhoc-tests.
Bruno Haible [Sun, 10 Mar 2019 23:13:47 +0000 (00:13 +0100)]
doc: Clarify locale name syntax.
* gettext-tools/doc/gettext.texi (Locale Names): Fix typo in locale name syntax.
* gettext-tools/doc/msginit.texi: Clarify that the '-l' argument optionally
contains an encoding.
* gettext-tools/src/msginit.c (usage): Likewise.
Bruno Haible [Fri, 15 Feb 2019 23:23:10 +0000 (00:23 +0100)]
libtextstyle: Improve the way the library is built.
* libtextstyle/lib/Makefile.am (libtextstyle_la_LDFLAGS): Add '-no-undefined',
needed for building on older versions of AIX and useful to verify no undefined
symbols are used by mistake. Add '-export-symbols', to reduce the loading time
of the shared library.
Bruno Haible [Fri, 15 Feb 2019 20:40:36 +0000 (21:40 +0100)]
libtextstyle: Don't use an external libcroco.
* gnulib-local/m4/libcroco.m4 (gl_LIBCROCO): Accept an optional FORCE-INCLUDED
argument.
* libtextstyle/gnulib-local/modules/libcroco.diff: New file.
* libtextstyle/autogen.sh: Pass another --local-dir option to gnulib-tool.
Bruno Haible [Fri, 15 Feb 2019 20:39:56 +0000 (21:39 +0100)]
libtextstyle: Document when and how to turn off styling.
* libtextstyle/doc/libtextstyle.texi (Basic use): Document when and how to turn
off styling.
* gnulib-local/lib/term-styled-ostream.oo.c (term_styled_ostream_create): Handle
a NULL css_filename explicitly.
Bruno Haible [Thu, 14 Feb 2019 21:53:27 +0000 (22:53 +0100)]
libtextstyle: In the examples, actually respect the --color option.
Reported by Akim Demaille <akim.demaille@gmail.com>.
* libtextstyle/examples/color-filter/filter.c (main): Set style_file_name to
NULL when styling should be disabled.
* libtextstyle/examples/color-hello/hello.c (main): Likewise.