* libtextstyle/gnulib-local/lib/term-ostream.oo.h (term_ostream_create):
Document the multithreading constraints that come from term-style-control.h.
* libtextstyle/gnulib-local/lib/term-styled-ostream.oo.h
(term_styled_ostream_create): Likewise.
* libtextstyle/doc/libtextstyle.texi (The term_ostream class,
The term_styled_ostream class): Likewise.
Bruno Haible [Tue, 12 May 2026 14:28:19 +0000 (16:28 +0200)]
Update after gnulib changed.
* autogen.sh: When invoking gnulib-tool for libgrep, don't pass the option
--avoid=mbszero. Since 2026-05-06, gnulib module 'regex' depends on gnulib
module 'localeinfo', which depends on gnulib module 'mbszero', and this
produced a build failure on MSVC: "unresolved external symbol mbszero".
Bruno Haible [Tue, 12 May 2026 00:11:51 +0000 (02:11 +0200)]
Use countof, part 2.
* gettext-runtime/intl/setlocale.c: Include <stdcountof.h>
(setlocale_unixlike, get_main_locale_with_same_language,
get_main_locale_with_same_territory, libintl_setlocale, libintl_newlocale): Use
countof.
* gettext-tools/src/cldr-plurals.c: Include <stdcountof.h>
(remove_empty_examples): Use countof.
* gettext-tools/src/country-table.c: Include <stdcountof.h>
(country_table_size): Use countof.
* gettext-tools/src/lang-table.c: Include <stdcountof.h>
(language_table_size, language_variant_table_size): Use countof.
* gettext-tools/src/msgl-merge.c: Include <stdcountof.h>
(message_merge): Use countof.
* gettext-tools/src/plural-table.c: Include <stdcountof.h>
(plural_table_size): Use countof.
* gettext-tools/src/x-d.c: Include <stdcountof.h>
* gettext-tools/src/html5-entities.h (html5_lookup): Use countof.
* gettext-tools/tests/intl-setlocale-1-prg.c: Include <stdcountof.h>
(data_cnt, lang_cnt): Use countof.
Bruno Haible [Mon, 11 May 2026 15:08:06 +0000 (17:08 +0200)]
xgettext: Rust: Support --keyword option with a qualified name for macros.
Reported by Lucas Baudin <lbaudin@gnome.org>
at <https://savannah.gnu.org/bugs/?68297>.
* gettext-tools/src/x-rust.c (extract_from_function_call_like): Use the
accumulated qualified name also for macro invocations.
(extract_from_node): Allow generic identifiers also for macro invocations.
* gettext-tools/tests/xgettext-rust-9: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
Bruno Haible [Mon, 11 May 2026 14:45:30 +0000 (16:45 +0200)]
xgettext: Rust: Support --keyword option with a qualified name.
* gettext-tools/src/x-rust.c: Include string-buffer-reversed.h".
(x_rust_keyword): Call split_keywordspec_ok2 instead of split_keywordspec_ok.
(ts_symbol_double_colon, ts_field_path): New variables.
(is_generic_identifier, generic_identifier_name): New functions.
(extract_from_function_call): Simplify by using generic_identifier_name. Invoke
hash_find_entry for each tail of a qualified name.
(extract_from_function_call_like): Add parameter callee_name. Invoke
hash_find_entry for each tail of a qualified name. Before calling
extract_from_function_call_like recursively, accumulate the qualified name
formed by the tokens seen so far.
(extract_from_node): Simplify by using is_generic_identifier and
generic_identifier_name.
(extract_rust): Initialize ts_symbol_double_colon, ts_field_path.
* gettext-tools/tests/xgettext-rust-8: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.
Bruno Haible [Fri, 8 May 2026 21:08:14 +0000 (23:08 +0200)]
xgettext: C++: Support --keyword option with a qualified name.
* gettext-tools/src/x-c.c (add_keyword): Call split_keywordspec_ok2 instead of
split_keywordspec_ok.
(enum token_type_ty): New enum value token_type_scope.
(phase5_get): Recognize '::' as token_type_scope.
(enum xgettext_token_type_ty): New enum value xgettext_token_type_scope.
(phase9_pushback, phase9_pushback_length): New variables.
(x_c_lex): Implement pushback. Handle token_type_scope.
(x_c_unlex): New function.
(extract_parenthesized): Look for qualified names. Invoke hash_find_entry for
each tail of such a qualified name.
* gettext-tools/tests/xgettext-c-c++-3: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add it.
* NEWS: Mention the change.
Bruno Haible [Thu, 7 May 2026 23:17:18 +0000 (01:17 +0200)]
Update C++ tests and example.
* gettext-tools/examples/hello-c++20/hello.cc: Add comment regarding
runtime_format and dynamic_format.
(dynamic_format): Conditionally define to runtime_format.
(main): Use dynamic_format instead of runtime_format.
* gettext-tools/tests/lang-c++20: Conditionally define to runtime_format.
(main): Use dynamic_format instead of runtime_format.
* gettext-tools/tests/lang-c++26: Use dynamic_format instead of runtime_format.
Bruno Haible [Tue, 5 May 2026 22:51:28 +0000 (00:51 +0200)]
Use the counted_by attribute.
* gettext-runtime/src/envsubst.c (struct string_list_ty): Mark the item field as
counted_by nitems.
(string_list_append): Increase slp->nitems before writing into slp->item.
* gettext-runtime/src/printf-command.c (struct format_piece): Mark the
text_start field as counted_by text_length.
(struct format_string): Mark the pieces field as counted_by npieces.
* gettext-tools/src/cldr-plural-exp.h: Include attribute.h.
(struct cldr_plural_range_list_ty): Mark the items field as counted_by nitems.
(struct cldr_plural_rule_list_ty): Mark the items field as counted_by nitems.
* gettext-tools/src/cldr-plural-exp.c (cldr_plural_range_list_free): Decrease
ranges->nitems after accessing the last element of ranges->items.
(cldr_plural_rule_free, cldr_plural_rule_list_print): Decrease rules->nitems
after accessing the last element of rules->items.
* gettext-tools/src/cldr-plural.y (add_range): Increase ranges->nitems before
writing into ranges->items.
(rule): Increase result->nitems before writing into result->items.
* gettext-tools/src/format-awk.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.
* gettext-tools/src/format-boost.c (struct spec): Mark the numbered field as
counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.
* gettext-tools/src/format-c++-brace.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.
* gettext-tools/src/format-c.c: Include attribute.h.
* gettext-tools/src/format-c-parse.h (struct spec): Mark the unnumbered field as
counted_by unnumbered_arg_count.
(format_parse_entrails): Increase spec.unnumbered_arg_count before writing into
spec.unnumbered.
* gettext-tools/src/format-d.c (struct segment): Mark the element field as
counted_by count.
(normalize_outermost_list, unfold_loop): Increase list->repeated.count
immediately after calling ensure_repeated_alloc.
(rotate_loop, initial_splitelement, initial_unshare,
append_repeated_to_initial): Increase list->initial.count immediately after
calling ensure_initial_alloc.
(make_intersected_list): Increase result->initial.count immediately after
calling grow_initial_alloc. Increase result->repeated.count immediately after
calling grow_repeated_alloc.
* gettext-tools/src/format-elisp.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.
* gettext-tools/src/format-gcc-internal.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.
* gettext-tools/src/format-gfc-internal.c: Include attribute.h.
(struct spec): Mark the unnumbered field as counted_by unnumbered_arg_count.
* gettext-tools/src/format-go.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.
* gettext-tools/src/format-java.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(message_format_parse): Increase spec->numbered_arg_count before writing into
spec->numbered.
* gettext-tools/src/format-java-printf.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.
* gettext-tools/src/format-javascript.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.
* gettext-tools/src/format-kde.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.
* gettext-tools/src/format-kde-kuit.c: Include attribute.h.
(struct kde_spec): Mark the numbered field as counted_by numbered_arg_count.
* gettext-tools/src/format-librep.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.
* gettext-tools/src/format-lisp.c (struct segment): Mark the element field as
counted_by count.
(normalize_outermost_list, unfold_loop): Increase list->repeated.count
immediately after calling ensure_repeated_alloc.
(rotate_loop, initial_splitelement, initial_unshare, shift_list,
append_repeated_to_initial): Increase list->initial.count immediately after
calling ensure_initial_alloc.
(make_intersected_list): Increase result->initial.count immediately after
calling grow_initial_alloc. Increase result->repeated.count immediately after
calling grow_repeated_alloc.
(make_union_list): Increase result->initial.count immediately after calling
grow_initial_alloc or before writing into result->initial.element. Increase
result->repeated.count immediately after calling grow_repeated_alloc.
(make_repeated_list): Increase list->initial.count immediately after calling
grow_initial_alloc. Increase list->repeated.count before writing into
list->repeated.element.
* gettext-tools/src/format-lua.c: Include attribute.h.
(struct spec): Mark the format_args field as counted_by format_args_count.
(format_parse): Increase spec.format_args_count before writing into
spec.format_args.
* gettext-tools/src/format-modula2.c: Include attribute.h.
(struct spec): Mark the args field as counted_by arg_count.
(format_parse): Increase spec.arg_count before writing into spec.args.
* gettext-tools/src/format-ocaml.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(parse_upto): Increase spec->numbered_arg_count before writing into
spec->numbered. Temporarily use an 'unnumbered' variable instead of
spec->numbered.
* gettext-tools/src/format-pascal.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
* gettext-tools/src/format-perl.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
* gettext-tools/src/format-perl-brace.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
* gettext-tools/src/format-php.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
* gettext-tools/src/format-python-brace.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count.
(parse_directive): Increase spec->named_arg_count before writing into
spec->named.
* gettext-tools/src/format-python.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count. Mark the
unnamed field as counted_by unnamed_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
Increase spec.unnamed_arg_count before writing into spec.unnamed.
* gettext-tools/src/format-qt.c: Include attribute.h.
(struct spec): Add a comment.
* gettext-tools/src/format-ruby.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count. Mark the
numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
Increase spec.numbered_arg_count before writing into spec.numbered. Temporarily
use an 'unnumbered' variable instead of spec.numbered.
* gettext-tools/src/format-rust.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count. Mark the
numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
Increase spec.numbered_arg_count before writing into spec.numbered.
* gettext-tools/src/format-scheme.c (struct segment): Mark the element field as
counted_by count.
(normalize_outermost_list, unfold_loop): Increase list->repeated.count
immediately after calling ensure_repeated_alloc.
(rotate_loop, initial_splitelement, initial_unshare, shift_list,
append_repeated_to_initial): Increase list->initial.count immediately after
calling ensure_initial_alloc.
(make_intersected_list): Increase result->initial.count immediately after
calling grow_initial_alloc. Increase result->repeated.count immediately after
calling grow_repeated_alloc.
(make_union_list): Increase result->initial.count immediately after calling
grow_initial_alloc or before writing into result->initial.element. Increase
result->repeated.count immediately after calling grow_repeated_alloc.
(make_repeated_list): Increase list->initial.count immediately after calling
grow_initial_alloc. Increase list->repeated.count before writing into
list->repeated.element.
* gettext-tools/src/format-sh.c: Include attribute.h.
(struct spec): Mark the named field as counted_by named_arg_count.
(format_parse): Increase spec.named_arg_count before writing into spec.named.
* gettext-tools/src/format-sh-printf.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered. Temporarily use an 'unnumbered' variable instead of
spec.numbered.
* gettext-tools/src/format-smalltalk.c: Include attribute.h.
(struct spec): Add a comment.
* gettext-tools/src/format-tcl.c: Include attribute.h.
(struct spec): Mark the numbered field as counted_by numbered_arg_count.
(format_parse): Increase spec.numbered_arg_count before writing into
spec.numbered.
* gettext-tools/src/its.c: Include attribute.h.
(struct its_value_list_ty): Mark the items field as counted_by nitems.
(its_value_list_append): Increase values->nitems before writing into
values->items.
(struct its_pool_ty): Mark the items field as counted_by nitems.
(its_pool_alloc_value_list): Increase pool->nitems before writing into
pool->items.
(struct its_node_list_ty): Mark the items field as counted_by nitems.
(its_node_list_append): Increase nodes->nitems before writing into nodes->items.
(struct its_rule_list_ty): Mark the items field as counted_by nitems.
(its_rule_list_add_from_doc): Increase rules->nitems before writing into
rules->items.
* gettext-tools/src/locating-rules.c: Include attribute.h.
(struct document_locating_rule_list_ty): Mark the items field as counted_by
nitems.
(struct locating_rule_list_ty): Mark the items field as counted_by nitems.
(document_locating_rule_list_add, locating_rule_list_add_from_file): Increase
rules->nitems before writing into rules->items.
* gettext-tools/src/message.h: Include attribute.h.
(struct message_ty): Mark the filepos field as counted_by filepos_count. Mark
the alternative field as counted_by alternative_count.
(struct message_list_ty): Mark the item field as counted_by nitems.
(struct message_list_list_ty): Mark the item field as counted_by nitems.
(struct msgdomain_list_ty): Mark the item field as counted_by nitems.
* gettext-tools/src/message.c (message_comment_filepos): Increase
mp->filepos_count before writing into mp->filepos.
(message_list_append, message_list_prepend, message_list_insert_at): Increase
mlp->nitems before writing into mlp->item.
(message_list_list_append): Increase mllp->nitems before writing into
mllp->item.
(msgdomain_list_append): Increase mdlp->nitems before writing into mdlp->item.
* gettext-tools/src/msgl-cat.c (catenate_msgdomain_list): Increase
tmp->alternative_count before writing into tmp->alternative.
* gettext-tools/src/msgfmt.h: Include attribute.h.
(struct msgfmt_operand_list_ty): Mark the items field as counted_by nitems.
* gettext-tools/src/msgfmt.c (msgfmt_operand_list_append): Increase
operands->nitems before writing into operands->items.
* gettext-tools/src/msggrep.c: Include attribute.h.
(struct grep_task): Mark the patterns field as counted_by patterns_size.
(main): Increase gt->patterns_size before writing into gt->patterns.
* gettext-tools/src/msgl-fsearch.c (struct mult_index_list): Mark the item field
as counted_by nitems.
* gettext-tools/src/search-path.c: Include attribute.h.
(struct path_array_ty): Mark the ptr field as counted_by len.
(fill): Increase array->len before writing into array->ptr.
(get_search_path): Increase array.len before writing into array.ptr.
* gettext-tools/src/str-list.h: Include attribute.h.
(struct string_list_ty): Mark the item field as counted_by nitems.
* gettext-tools/src/str-list.c (string_list_append, string_list_append_move,
string_list_append_unique, string_list_append_unique_desc): Increase slp->nitems
before writing into slp->item.
(string_list_remove): Decrease slp->nitems after accessing the last element of
slp->items.
* gettext-tools/src/x-perl.c (struct token_stack_ty): Mark the items field as
counted_by nitems.
(token_stack_push): Increase stack->nitems before writing into stack->items.
(token_stack_pop): Decrease stack->nitems after accessing the last element of
stack->items.
* gettext-tools/src/xg-arglist-callshape.h: Include attribute.h.
(struct callshapes): Mark the keyword field as counted_by keyword_len. Mark the
shapes field as counted_by nshapes.
* gettext-tools/src/xg-arglist-context.h: Include attribute.h.
(struct remembered_message_list_ty): Mark the item field as counted_by nitems.
(struct flag_region_ty): Mark the subregion field as counted_by nsubregions.
* gettext-tools/src/xg-arglist-context.c (remembered_message_list_append):
Increase list->nitems before writing into list->item.
(the_null_context_region): Update.
(new_sub_region): Increase outer_region->nsubregions before writing into
outer_region->subregion.
* gettext-tools/src/xg-arglist-parser.h: Include attribute.h.
(struct arglist_parser): Mark the keyword field as counted_by keyword_len. Mark
the alternative field as counted_by nalternatives.
* gettext-tools/src/xg-check.c (struct bullet_stack_ty): Add a comment.
* gettext-tools/src/xg-mixed-string.h: Include attribute.h.
(struct mixed_string_segment): Mark the contents field as counted_by length.
(struct mixed_string): Mark the segments field as counted_by nsegments.
(struct mixed_string_buffer): Mark the segments field as counted_by nsegments.
* gettext-tools/src/xg-mixed-string.c (mixed_string_alloc_simple,
mixed_string_alloc_utf8, mixed_string_clone, mixed_string_concat,
mixed_string_concat_free1, mixed_string_buffer_add_segment,
mixed_string_buffer_result, mixed_string_buffer_cloned_result): Increase
ms->nsegments before writing into ms->segments.
* gettext-tools/libgrep/m-regex.c: Include attribute.h.
(struct compiled_regex): Mark the patterns field as counted_by pcount.
(compile): Increase cregex->pcount before writing into cregex->patterns.
Bruno Haible [Tue, 5 May 2026 19:23:01 +0000 (21:23 +0200)]
xgettext: Convert a struct to a flexible-member struct.
* gettext-tools/src/xg-arglist-callshape.h: Include flexmember.h.
(struct callshapes): Convert the 'shapes' field to a flexible array member.
* gettext-tools/src/xg-arglist-callshape.c (insert_keyword_callshape): Compute
the needed memory using FLEXSIZEOF.
* gettext-tools/src/x-perl.c (extract_variable): Use a union to allocate a
'struct callshapes' on the stack.
Bruno Haible [Tue, 5 May 2026 18:23:13 +0000 (20:23 +0200)]
intl: Fix an ISO C undefined behaviour.
ISO C 23 § 6.5.3.3.(7) and § 6.7.7.4.(14) and § 6.2.7 forbid invoking
a function pointer after having cast it to an incompatible function type.
* gettext-runtime/intl/localealias.c (alias_compare): Change type of parameters
to 'const void *'.
(_nl_expand_alias, read_alias_file): Don't cast the alias_compare function
pointer.
Bruno Haible [Thu, 9 Apr 2026 10:18:57 +0000 (12:18 +0200)]
build: Stop shipping tarballs in lzip-compressed format.
The lzip-compressed tarball is only 5% smaller than the xz-compressed tarball
since we added a customized am__tar variable on 2025-01-08. Not worth it.
* Admin/release-steps: Remove instruction for lzip.
Bruno Haible [Thu, 9 Apr 2026 09:33:08 +0000 (11:33 +0200)]
build: Stop shipping tarballs in lzip-compressed format.
The lzip-compressed tarball is only 5% smaller than the xz-compressed tarball
since we added a customized am__tar variable on 2025-01-08. Not worth it.
* Admin/release-steps: Remove instruction for lzip.
Bruno Haible [Thu, 5 Feb 2026 23:40:01 +0000 (00:40 +0100)]
build: Avoid build failures when building from the git repository.
Reported by Satadru Pramanik <satadru@gmail.com>
at <https://savannah.gnu.org/bugs/?67999>.
* gettext-tools/man/Makefile.am ($(man_MAN1MISC)): Use a temporary file, so that
we don't run 'patch' on a nonexistent file or on an already patched result.
Bruno Haible [Tue, 3 Feb 2026 20:55:48 +0000 (21:55 +0100)]
build: When help2man fails, let it show the reason.
This is needed for investigating failures in a CI environment.
* gettext-runtime/man/help2man (get_option_value): Pipe the program's stderr to
stderr, not to /dev/null.
* gettext-tools/man/help2man (get_option_value): Likewise.
Bruno Haible [Wed, 28 Jan 2026 23:47:27 +0000 (00:47 +0100)]
examples: Use infrastructure from gettext version 1.0.
* gettext-tools/examples/hello-*/configure.ac: Use AM_GNU_GETTEXT_VERSION with
version 1.0.
* gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise.
* gettext-tools/examples/hello-*/autogen.sh: Copy remove-potcdate.sed from the
new location in the source tree. Copy also the no-op fetch-po.
* gettext-tools/examples/hello-*/autoclean.sh: Remove also fetch-po.
Bruno Haible [Wed, 28 Jan 2026 12:50:21 +0000 (13:50 +0100)]
xgettext: PHP: Fix parsing of strings and heredocs with embedded expressions.
Reported by Gert Jan Schoneveld <gertjan@facilityapps.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2025-08/msg00007.html>
and by Benoit Waldmann <benoit.waldmann@siagilus.fr>
at <https://savannah.gnu.org/bugs/index.php?item_id=67948>.
* gettext-tools/src/x-php.c (enum token_type_ty): New enum values
token_type_lbrace, token_type_rbrace.
(struct php_extractor): New field brace_nesting_depth.
(php_extractor_init_rest): Initialize it.
(extract_balanced): Forward-declare.
(process_dquote_or_heredoc): Change handling of embedded expressions.
(phase4_get): Recognize token_type_lbrace, token_type_rbrace.
(extract_balanced): Recurse also for token_type_lbrace.
(extract_php_input): Remove function.
(extract_php): Inline it here.
* gettext-tools/tests/xgettext-php-1: Add more tests of embedded expressions.
Bruno Haible [Tue, 27 Jan 2026 05:03:04 +0000 (06:03 +0100)]
po-mode: Prepare for inclusion in GNU ELPA.
Suggested by Stefan Monnier <monnier@iro.umontreal.ca> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00086.html>.
* gettext-tools/emacs/po-mode.el: Add meta-information field 'Version:',
required by ELPA. Move meta-information after the copyright and license notice.
(po-mode-version-string): Move definition.
* gettext-tools/emacs/po-compat.el: Move meta-information after the copyright
and license notice. Convert the file to UTF-8 encoding.
Bruno Haible [Sun, 25 Jan 2026 18:17:48 +0000 (19:17 +0100)]
Fix a small memory leak in libgettextpo.
Reported by <gemmaro.dev@gmail.com> at
<https://savannah.gnu.org/bugs/index.php?item_id=67892>
and by Albert Astals Cid <aacid@kde.org> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00071.html>.
* gettext-tools/src/read-po-lex.h: Include str-list.h.
(lex_start): Add arena parameter.
* gettext-tools/src/read-po-lex.c (lex_start): Add arena parameter. Add the
heap-allocated file_name to the arena.
* gettext-tools/src/read-catalog-abstract.h: Include str-list.h.
(struct catalog_input_format): Add arena parameter to parse() method.
(catalog_reader_parse): Add arena parameter.
* gettext-tools/src/read-properties.c (properties_parse): Add arena parameter.
* gettext-tools/src/read-stringtable.c (stringtable_parse): Add arena parameter.
* gettext-tools/src/read-po.c (po_parse): Add arena parameter. Update lex_start
call.
* gettext-tools/src/read-catalog-abstract.c (catalog_reader_parse): Add arena
parameter. Update parse() method call.
* gettext-tools/src/read-catalog.h: Include str-list.h.
(read_catalog_stream): Add arena parameter.
* gettext-tools/src/read-catalog.c (read_catalog_stream): Add arena parameter.
Update catalog_reader_parse call.
* gettext-tools/src/read-catalog-file.c: Include str-list.h.
(read_catalog_file): Update read_catalog_stream call.
* gettext-tools/src/read-csharp.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-java.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-resources.c: Include str-list.h.
(execute_and_read_po_output): Update read_catalog_stream call.
* gettext-tools/src/read-tcl.c: Include str-list.h.
(msgdomain_read_tcl): Update read_catalog_stream call.
* gettext-tools/libgettextpo/gettext-po.c: Include str-list.h.
(struct po_file): Add field 'arena'.
(po_file_create): Initialize it.
(po_file_read): Likewise. Update read_catalog_stream call.
(po_file_free): Destroy the arena.
* gettext-tools/src/msgfmt.c (read_catalog_file_msgfmt): Update
catalog_reader_parse call.
* gettext-tools/src/x-po.c: Include str-list.h.
(extract): Update catalog_reader_parse call.
* gettext-tools/src/xgettext.c (read_exclusion_file): Update
catalog_reader_parse call.
Bruno Haible [Sun, 25 Jan 2026 03:51:32 +0000 (04:51 +0100)]
Fix warnings with gcc 15 and glibc 2.43.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.in.h (g_strstr_len): Change
return type to 'const gchar *'.
* libtextstyle/gnulib-local/lib/glib/gstrfuncs.c (g_strstr_len): Likewise.
* libtextstyle/gnulib-local/lib/libcroco/cr-rgb.c (cr_rgb_set_from_name): Change
type of 'result'.
* gettext-tools/src/cldr-plurals.c (extract_rules): Cast the sb_xcontents_c
result to 'char *'.
Bruno Haible [Thu, 15 Jan 2026 11:32:43 +0000 (12:32 +0100)]
build: Fix "make installcheck" on MSVC.
Reported by Kirill Makurin <maiddaisuki@outlook.com> in
<https://lists.gnu.org/archive/html/bug-gettext/2026-01/msg00042.html>.
* gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): New variable
INTL_WINDOWS_LIBS. Add it to LIBINTL and LTLIBINTL.
* gettext-runtime/configure.ac (INSTALLED_LIBINTL): Add $INTL_WINDOWS_LIBS.
* gettext-tools/configure.ac (INSTALLED_LIBINTL): Likewise.
* libtextstyle/configure.ac (INSTALLED_LIBTEXTSTYLE): New variable.
* libtextstyle/install-tests/Makefile.am (installcheck-local): Link with
$INSTALLED_LIBTEXTSTYLE instead of -ltextstyle.
Bruno Haible [Sat, 10 Jan 2026 19:16:46 +0000 (20:16 +0100)]
xgettext: Allow inhibiting the warnings about URLs and email addresses.
Reported at <https://savannah.gnu.org/bugs/?67672>.
* gettext-tools/src/message.h (enum syntax_check_type): Add sc_url, sc_email.
(NSYNTAXCHECKS): Increase by 2.
* gettext-tools/src/message.c (syntax_check_name): Update.
* gettext-tools/src/xgettext.h (default_syntax_check): Add comment.
* gettext-tools/src/xgettext.c (default_syntax_check): Add initializer.
(main): Recognize --no-check option.
(usage): Document --no-check option.
* gettext-tools/src/xg-message.c (decide_syntax_check): Assume that
default_syntax_check[i] != undecided.
* gettext-tools/src/xg-check.c (syntax_check_function): Remove the second
argument.
(string_has_ascii_ellipsis): New function, extracted from
syntax_check_ellipsis_unicode.
(message_has_ascii_ellipsis): New function.
(syntax_check_ellipsis_unicode): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(string_has_space_ellipsis): New function, extracted from
syntax_check_space_ellipsis.
(message_has_space_ellipsis): New function.
(syntax_check_space_ellipsis): Remove the second argument. Simplify. Emit only
a single error for both msgid and msgid_plural.
(syntax_check_quote_unicode): Remove the second argument.
(syntax_check_bullet_unicode_string): New function, extracted from
syntax_check_bullet_unicode.
(syntax_check_bullet_unicode): Remove the second argument. Simplify.
(string_has_url): Don't recognize 'mailto:' URLs.
(syntax_check_url, syntax_check_email): New functions, extracted from
url_check_message.
(url_check_message): Remove function.
(sc_funcs): Add syntax_check_url, syntax_check_email.
(syntax_check_message): Simplify.
(xgettext_check_message_list): Don't invoke url_check_message.
* gettext-tools/tests/xgettext-14: Update after xg-check.c changesd.
* gettext-tools/tests/xgettext-20: Add more testcases.
* gettext-tools/doc/xgettext.texi: Document the --no-check option.
* gettext-tools/doc/gettext.texi: Bump copyright year.
* NEWS: Mention the change.
gemmaro [Thu, 1 Jan 2026 13:29:08 +0000 (22:29 +0900)]
po-mode: Use define-derived-mode for po-subedit-mode.
* gettext-tools/emacs/po-mode.el (po-subedit-mode): Define as derived
mode from text mode using define-derived-mode.
(po-subedit-mode-syntax-table, po-mode-abbrev-table): Remove these
variables, as define-derived-mode creates them automatically.
(po-edit-string): Use po-subedit-mode instead of text-mode. Remove
local abbrev table, keymap, syntax table, and hook invocation, since
define-derived-mode handles these automatically. Move easy-menu
definition to the define-derived-mode body.
(Package-Requires): Add minimum Emacs version requirement. The
define-derived-mode was probably introduced in Emacs 19.23, and commit 7797a29e9 dropped support for Emacs versions before 23.
Bruno Haible [Wed, 31 Dec 2025 00:58:57 +0000 (01:58 +0100)]
Document the relation between fetch-po and version control.
Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.
* gettext-tools/doc/gettext.texi (po/fetch-po): Add a reference.
(Translations under Version Control): Remove subsection.
(PO Template File under Version Control?): New subsection.
(Translations under Version Control?): New subsection.
Bruno Haible [Tue, 30 Dec 2025 23:11:05 +0000 (00:11 +0100)]
po-fetch: Add man page.
Reported by Simon Josefsson in
<https://lists.gnu.org/archive/html/bug-gettext/2025-12/msg00030.html>.
* gettext-tools/man/po-fetch.x: New file.
* gettext-tools/man/po-fetch.1.diff: New file.
* gettext-tools/man/Makefile.am (man_aux): Add po-fetch.x.
(man_MAN1MISC): New variable.
(man_MAN1): Include it.
(man_HTML): Add po-fetch.1.html.
($(man_MAN1MISC)): New rule.
(po-fetch.1, po-fetch.1.html): State dependencies.
* PACKAGING: Update.
Bruno Haible [Fri, 26 Dec 2025 21:50:10 +0000 (22:50 +0100)]
Update ISO 3166 country codes list.
* gettext-tools/doc/ISO_3166: Update to match current Wikipedia.
* gettext-tools/doc/iso-3166.texi: Likewise.
* gettext-tools/src/msginit.c (catalogname_for_locale): Likewise.