Bruno Haible [Sun, 28 Apr 2019 17:24:37 +0000 (19:24 +0200)]
po: Make it possible to override xgettext options from Makefile.in.in.
* gettext-runtime/po/Makefile.in.in ($(DOMAIN).pot-update): List the
XGETTEXT_OPTIONS and the XGETTEXT_EXTRA_OPTIONS after all other options.
* gettext-tools/examples/po/Makefile.am ($(DOMAIN).pot-update): Likewise.
* gettext-tools/examples/hello-*/po/Makefile.am ($(DOMAIN).pot-update):
Likewise.
* gettext-tools/examples/hello-objc-gnustep/po/GNUmakefile
($(DOMAIN).pot-update): Likewise.
* NEWS: Mention the change.
* gettext-tools/doc/gettext.texi (po/Makevars): Fix typo.
Bruno Haible [Sun, 28 Apr 2019 11:35:04 +0000 (13:35 +0200)]
libtextstyle: Fix test-term-ostream-xterm test failure on TrueOS and Trident.
The xterm description on these platforms includes support for italics.
Reported by Nelson H. F. Beebe.
* libtextstyle/gnulib-local/tests/test-term-ostream-xterm-freebsd-italic.out:
New file.
* libtextstyle/gnulib-local/tests/test-term-ostream-xterm.sh: Use it as possible
expected result.
* libtextstyle/gnulib-local/modules/term-ostream-tests (Files): Add it.
Bruno Haible [Sat, 27 Apr 2019 09:00:35 +0000 (11:00 +0200)]
libgettextpo: Don't rely on the undocumented variable libgettextpo_program_name.
* gnulib-local/lib/xerror.c: If IN_LIBGETTEXTPO is defined, include
getprogname.h instead of progname.h and define program_name as a macro.
* gnulib-local/lib/error-progname.c: Likewise.
* gettext-tools/src/po-xerror.c: Likewise.
* autogen.sh (GNULIB_MODULES_LIBGETTEXTPO): Remove progname.
Pass --avoid=progname to gnulib-tool invocation for libgettextpo.
Bruno Haible [Sat, 27 Apr 2019 02:58:24 +0000 (04:58 +0200)]
Fix a gcc warning on mingw.
* gettext-tools/src/msginit.c (get_user_pwd): Don't define if HAVE_PWD_H is not
set.
(get_user_fullname): Don't call get_user_pwd if HAVE_PWD_H is not set.
Bruno Haible [Sun, 14 Apr 2019 01:58:21 +0000 (03:58 +0200)]
autopoint: Reject AM_GNU_GETTEXT without 'external' for versions >= 0.20.
* gettext-tools/misc/autopoint.in: Fail if AM_GNU_GETTEXT without 'external' is
specified with a gettext version >= 0.20.
* gettext-tools/tests/autopoint-2: Update. Add two more scenarios.
* gettext-tools/tests/autopoint-3: Don't test AM_GNU_GETTEXT([use-libtool]) nor
--with-included-gettext. Don't use libtoolize.
Bruno Haible [Sat, 13 Apr 2019 10:30:06 +0000 (12:30 +0200)]
build: Fix build failure with a preinstalled libxml (regression from 2019-04-02).
* gettext-tools/src/Makefile.am (AM_CPPFLAGS): Remove -I options that point into
libtextstyle/lib.
(textstyle.h): New rule.
(BUILT_SOURCES, MOSTLYCLEANFILES): Add textstyle.h and textstyle/*.h.
Bruno Haible [Wed, 10 Apr 2019 21:49:09 +0000 (23:49 +0200)]
msgfmt: Fix a buffer overrun.
Reported by Tobi Schäfer at <https://trac.macports.org/ticket/58323>,
via Ryan Schmidt <@ryandesign.com> at <https://savannah.gnu.org/bugs/?56112>.
Patch proposed by Joshua Root.
* gettext-tools/src/write-java.c (msgid_hashcode): Allocate memory for the
trailing NUL byte as well.
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.