From: Zack Weinberg Date: Tue, 3 Feb 2026 15:56:12 +0000 (-0500) Subject: make fetch X-Git-Tag: v2.72.90~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f1f41b8d3cf38101c6dce30e6319402f8c44b83;p=thirdparty%2Fautoconf.git make fetch Right now, Savannah’s HTTP interface to CVS repositories (viewvc) is responding to all queries with a 429 Too Many Requests error code, so those files were updated manually. (The actual CVS server is still working fine.) --- diff --git a/GNUmakefile b/GNUmakefile index 0f469c8a4..79fde1822 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,7 +5,7 @@ # It is necessary if you want to build targets usually of interest # only to the maintainer. -# Copyright (C) 2001, 2003, 2006-2024 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2006-2026 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -44,6 +44,9 @@ include $(srcdir)/maint.mk # Ensure that $(VERSION) is up to date for dist-related targets, but not # for others: rerunning autoreconf and recompiling everything isn't cheap. +# This is not part of the essential workflow with .tarball-version. Rather, +# it is meant to help the maintainer who has changed the current version +# but not done a "make distclean". _have-git-version-gen := \ $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes) ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) diff --git a/build-aux/announce-gen b/build-aux/announce-gen index f9e20129d..7b1d77407 100755 --- a/build-aux/announce-gen +++ b/build-aux/announce-gen @@ -3,7 +3,7 @@ # Generate a release announcement message. -# Copyright (C) 2002-2024 Free Software Foundation, Inc. +# Copyright (C) 2002-2026 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ # # Written by Jim Meyering -# This is a prologue that allows to run a perl script as an executable +# This prologue allows running a perl script as an executable # on systems that are compliant to a POSIX version before POSIX:2017. # On such systems, the usual invocation of an executable through execlp() # or execvp() fails with ENOEXEC if it is a script that does not start @@ -35,13 +35,13 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2023-12-29 18:26'; # UTC +my $VERSION = '2025-11-26 21:27'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -my $copyright_year = '2022'; +(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/; use strict; use Getopt::Long; @@ -50,7 +50,8 @@ use POSIX qw(strftime); (my $ME = $0) =~ s|.*/||; my %valid_release_types = map {$_ => 1} qw (alpha beta stable); -my @archive_suffixes = qw (tar.gz tar.bz2 tar.lz tar.lzma tar.xz); +my @archive_suffixes = qw (tar.gz tar.bz2 tar.bz3 tar.lz tar.lzma tar.xz + tar.zst zip); my $srcdir = '.'; sub usage ($) @@ -94,7 +95,9 @@ The following are optional: sign the tarballs --gpg-keyring-url=URL URL pointing to keyring containing the key used to sign the tarballs - --no-print-checksums do not emit SHA1 or SHA256 checksums + --no-print-checksums do not emit SHA256 or SHA3-256 checksums + --cksum-checksums emit SHA256 and SHA3-256 checksums in a form + that requires cksum from coreutils or OpenBSD --archive-suffix=SUF add SUF to the list of archive suffixes --mail-headers=HEADERS a space-separated list of mail headers, e.g., To: x\@example.com Cc: y-announce\@example.com,... @@ -102,13 +105,15 @@ The following are optional: --help display this help and exit --version output version information and exit +Send patches and bug reports to . EOF } exit $exit_code; } +=over -=item C<%size> = C +=item C<%size = sizes (@file)> Compute the sizes of the C<@file> and return them as a hash. Return C if one of the computation failed. @@ -123,7 +128,7 @@ sub sizes (@) my %res; foreach my $f (@file) { - my $cmd = "du -h $f"; + my $cmd = "du -h -L $f"; my $t = `$cmd`; # FIXME-someday: give a better diagnostic, a la $PROCESS_STATUS $@ @@ -135,9 +140,9 @@ sub sizes (@) return $fail ? undef : %res; } -=item C -Print a section C<$title> dedicated to the list of <@file>, which +Print a section C<$title> dedicated to the list of C<@file>, which sizes are stored in C<%size>, and which are available from the C<@url>. =cut @@ -159,42 +164,66 @@ sub print_locations ($\@\%@) print "\n"; } -=item C -Print the SHA1 and SHA256 signature section for each C<@file>. +Print the SHA256 and SHA3-256 signature section for each C<@file>. =cut # This digest function omits the "=" padding that is required by cksum, # so add the 0..2 bytes of padding required for each of Digest's algorithms. +# To verify such a digest, users need +# - a particular command ('cksum -a sha256 --check') +# - and particular tools (coreutils >= 9.2 or OpenBSD's cksum since 2007). sub digest_file_base64_wrap ($$) { my ($file, $alg) = @_; my $h = digest_file_base64($file, $alg); $alg =~ tr{-}{}d; - my %pad = (MD5 => 2, SHA1 => 1, SHA256 => 1, SHA384 => 0, SHA512 => 2); - return $h . '=' x $pad{$alg}; + my %pad = (MD5 => 2, SHA1 => 1, SHA256 => 1, SHA384 => 0, SHA512 => 2, + SHA3256 => 1, SHA3384 => 0, SHA3512 => 2); + (my $alg_tag = $alg) =~ s/^SHA3(\d{3})/SHA3-$1/; + return $alg_tag . " (" . $file . ") = " . $h . '=' x $pad{$alg}; } -sub print_checksums (@) +sub print_checksums ($@) { - my (@file) = @_; + my ($prefer_cksum, @file) = @_; - print "Here are the SHA1 and SHA256 checksums:\n"; + print "Here are the SHA256 and SHA3-256 checksums:\n"; print "\n"; use Digest::file qw(digest_file_hex digest_file_base64); - foreach my $f (@file) + if ($prefer_cksum) { - print ' ', digest_file_hex ($f, "SHA-1"), " $f\n"; - print ' ', digest_file_base64_wrap ($f, "SHA-256"), " $f\n"; + foreach my $f (@file) + { + print ' ', digest_file_base64_wrap ($f, "SHA-256"), "\n"; + print ' ', digest_file_base64_wrap ($f, "SHA3-256"), "\n"; + } + print "\nVerify the base64 SHA256 checksum with 'cksum -a sha256 --check'\n"; + print "from coreutils-9.2 or OpenBSD's cksum since 2007.\n"; + print "\nVerify the base64 SHA3-256 checksum with 'cksum -a sha3 --check'\n"; + print "from coreutils-9.8.\n\n"; + } + else + { + foreach my $f (@file) + { + print " File: $f\n"; + print ' SHA256 sum: ', digest_file_hex ($f, "SHA-256"), "\n"; + print ' SHA3-256 sum: ', digest_file_hex ($f, "SHA3-256"), "\n"; + print "\n"; + } + print "Verify the SHA256 checksum with either sha256sum, sha256, or\n"; + print "'shasum -a 256'.\n"; + print "\nVerify the SHA3-256 checksum with 'cksum -a sha3 -l 256 --base64'\n"; + print "from coreutils-9.8.\n\n"; } - print "\nVerify the base64 SHA256 checksum with cksum -a sha256 --check\n"; - print "from coreutils-9.2 or OpenBSD's cksum since 2007.\n\n"; } -=item C Print the section of the NEWS file C<$news_file> addressing changes between versions C<$prev_version> and C<$curr_version>. @@ -215,7 +244,7 @@ sub print_news_deltas ($$$) # the first occurrence of $prev_version. my $in_items; - my $re_prefix = qr/(?:\* )?(?:Noteworthy c|Major c|C)(?i:hanges)/; + my $re_prefix = qr/(?:[#*]+ )?(?:Noteworthy c|Major c|C)(?i:hanges)/; my $found_news; open NEWS, '<', $news_file @@ -356,16 +385,16 @@ sub get_tool_versions ($$) # Assume that the last "word" on the first line of # 'tool --version' output is the version string. my ($first_line, undef) = split ("\n", `$t --version`); - if ($first_line =~ /.* (\d[\w.-]+)$/) + if ($first_line =~ /.* ([a-f\d][\w.-]+)$/) { $t = ucfirst $t; push @tool_version_pair, "$t $1"; } else { + warn "$t: unexpected --version output:\n$first_line"; defined $first_line and $first_line = ''; - warn "$t: unexpected --version output\n:$first_line"; $fail = 1; } } @@ -424,6 +453,7 @@ sub readable_interval($) my $bootstrap_tools; my $gnulib_version; my $print_checksums_p = 1; + my $cksum_checksums_p; my $gpg_key_email; my $gpg_keyring_url; @@ -452,6 +482,7 @@ sub readable_interval($) 'bootstrap-tools=s' => \$bootstrap_tools, 'gnulib-version=s' => \$gnulib_version, 'print-checksums!' => \$print_checksums_p, + 'cksum-checksums' => \$cksum_checksums_p, 'archive-suffix=s' => \@archive_suffixes, help => sub { usage 0 }, @@ -545,17 +576,19 @@ EOF my $v0 = $prev_version; my $v1 = $curr_version; - (my $first_name = `git config user.name|cut -d' ' -f1`) + (my $first_name = `git -C "$srcdir" config user.name|cut -d' ' -f1`) =~ m{\S} or die "no name? set user.name in ~/.gitconfig\n"; - chomp (my $n_ci = `git rev-list "v$v0..v$v1" | wc -l`); - chomp (my $n_p = `git shortlog "v$v0..v$v1" | grep -c '^[^ ]'`); + chomp (my $n_ci = `git -C "$srcdir" rev-list "v$v0..v$v1" | wc -l`); + chomp (my $n_p = `git -C "$srcdir" shortlog "v$v0..v$v1" | grep -c '^[^ ]'`); - my $prev_release_date = `git log --pretty=%ct -1 "v$v0"`; - my $this_release_date = `git log --pretty=%ct -1 "v$v1"`; + my $this_commit_hash = `git -C "$srcdir" log --pretty=%H -1 "v$v1"`; + chop $this_commit_hash; + my $prev_release_date = `git -C "$srcdir" log --pretty=%ct -1 "v$v0"`; + my $this_release_date = `git -C "$srcdir" log --pretty=%ct -1 "v$v1"`; my $n_seconds = $this_release_date - $prev_release_date; my $time_since_prev = readable_interval $n_seconds; - my $names = `git shortlog "v$v0..v$v1"|perl -lne '/^(\\w.*):/ and print " ".\$1'`; + my $names = `git -C "$srcdir" shortlog "v$v0..v$v1"|perl -lne '/^(\\w.*):/ and print " ".\$1'`; print < "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -634,7 +634,8 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -718,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -1595,8 +1597,11 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; - *:Ironclad:*:*) - GUESS=$UNAME_MACHINE-unknown-ironclad + x86_64:[Ii]ronclad:*:*|i?86:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-pc-ironclad-mlibc + ;; + *:[Ii]ronclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad-mlibc ;; esac @@ -1621,6 +1626,7 @@ cat > "$dummy.c" <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2024 Free Software Foundation, Inc. +Copyright 1992-2025 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,7 +120,6 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; - kfreebsd*-gnu*- | kopensolaris*-gnu*-) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; @@ -1864,8 +2253,12 @@ case $kernel-$os-$obj in ;; os2-emx-) ;; + rtmk-nova-) + ;; *-eabi*- | *-gnueabi*-) ;; + ios*-simulator- | tvos*-simulator- | watchos*-simulator- ) + ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format @@ -1890,7 +2283,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1964,8 +2357,8 @@ echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-format: "%Y-%02m-%02d" # time-stamp-end: "'" # End: diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh index 60447d4f5..29896ab28 100755 --- a/build-aux/gendocs.sh +++ b/build-aux/gendocs.sh @@ -2,9 +2,9 @@ # gendocs.sh -- generate a GNU manual in many formats. This script is # mentioned in maintain.texi. See the help message below for usage details. -scriptversion=2024-01-27.16 +scriptversion=2026-01-01.00 -# Copyright 2003-2024 Free Software Foundation, Inc. +# Copyright 2003-2026 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -73,7 +73,7 @@ texarg="-t @finalout" version="gendocs.sh $scriptversion -Copyright 2024 Free Software Foundation, Inc. +Copyright 2026 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -232,8 +232,8 @@ fi # Function to return size of $1 in something resembling kilobytes. calcsize() { - size=`ls -ksl $1 | awk '{print $1}'` - echo $size + set `ls -ks "$1"` + echo $1 } # copy_images OUTDIR HTML-FILE... @@ -256,8 +256,8 @@ BEGIN { /"$outdir/index.html" echo "Done, see $outdir/ subdirectory for new files." # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-end: "$" # End: diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen index aa168e194..d955a16b9 100755 --- a/build-aux/git-version-gen +++ b/build-aux/git-version-gen @@ -1,8 +1,8 @@ #!/bin/sh # Print a version string. -scriptversion=2022-07-09.08; # UTC +scriptversion=2025-06-10.02; # UTC -# Copyright (C) 2007-2024 Free Software Foundation, Inc. +# Copyright (C) 2007-2026 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,58 +18,65 @@ scriptversion=2022-07-09.08; # UTC # along with this program. If not, see . # This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/. -# It may be run two ways: + +# It may be run in the following ways, presuming the script is invoked +# like "./git-version-gen .tarball-version": +# # - from a git repository in which the "git describe" command below # produces useful output (thus requiring at least one signed tag) -# - from a non-git-repo directory containing a .tarball-version file, which -# presumes this script is invoked like "./git-version-gen .tarball-version". +# +# - from a "make dist" non-git-repo directory containing a +# .tarball-version file +# +# - from a "git archive" non-git-repo directory containing a +# .tarball-version-git file -# In order to use intra-version strings in your project, you will need two +# In order to use intra-version strings in your project, you will need some # separate generated version string files: # -# .tarball-version - present only in a distribution tarball, and not in -# a checked-out repository. Created with contents that were learned at -# the last time autoconf was run, and used by git-version-gen. Must not -# be present in either $(srcdir) or $(builddir) for git-version-gen to -# give accurate answers during normal development with a checked out tree, -# but must be present in a tarball when there is no version control system. -# Therefore, it cannot be used in any dependencies. GNUmakefile has -# hooks to force a reconfigure at distribution time to get the value -# correct, without penalizing normal development with extra reconfigures. +# .tarball-version - contains the version number assigned by the maintainer. +# Present or missing in a checked-out repository, at the discretion of the +# maintainer/contributor. Present in a distribution tarball, because the +# tarball does not include the version control history. +# Used by git-version-gen as an override. +# Cannot be used in any dependencies (since it may be absent). +# GNUmakefile has hooks to force a reconfigure at "make dist" time to get +# the value correct, without penalizing normal development with extra +# reconfigures. # -# .version - present in a checked-out repository and in a distribution -# tarball. Usable in dependencies, particularly for files that don't -# want to depend on config.h but do want to track version changes. -# Delete this file prior to any autoconf run where you want to rebuild -# files to pick up a version string change; and leave it stale to -# minimize rebuild time after unrelated changes to configure sources. +# .tarball-version-git - a file committed to git containing a single +# line with the string $Format:%(describe)$ and that the file is +# marked in .gitattributes with ".tarball-version-git export-subst". +# If the file doesn't exist or the export-subst keyword wasn't +# effective, the file is ignored. # -# As with any generated file in a VC'd directory, you should add -# /.version to .gitignore, so that you don't accidentally commit it. -# .tarball-version is never generated in a VC'd directory, so needn't -# be listed there. -# -# Use the following line in your configure.ac, so that $(VERSION) will +# Use the following snippet in your configure.ac, so that $(VERSION) will # automatically be up-to-date each time configure is run (and note that # since configure.ac no longer includes a version string, Makefile rules # should not depend on configure.ac for version updates). # -# AC_INIT([GNU project], -# m4_esyscmd([build-aux/git-version-gen .tarball-version]), -# [bug-project@example]) +# AC_INIT([@var{package}], [package]) +# AC_CONFIG_SRCDIR([@var{unique-file-in-source-dir}]) +# AC_CONFIG_AUX_DIR([build-aux]) +# VERSION_NUMBER=`cd $srcdir \ +# && build-aux/git-version-gen .tarball-version` +# gl_INIT_PACKAGE_VERSION([$VERSION_NUMBER]) +# AM_INIT_AUTOMAKE([@var{options}]) # -# Then use the following lines in your Makefile.am, so that .version -# will be present for dependencies, and so that .version and +# Then use the following lines in your Makefile.am, so that # .tarball-version will exist in distribution tarballs. # -# EXTRA_DIST = $(top_srcdir)/.version -# BUILT_SOURCES = $(top_srcdir)/.version -# $(top_srcdir)/.version: -# echo '$(VERSION)' > $@-t -# mv $@-t $@ -# dist-hook: +# dist-hook: dist-tarball-version +# .PHONY: dist-tarball-version +# dist-tarball-version: # echo '$(VERSION)' > $(distdir)/.tarball-version - +# +# To setup support for "git archive" tarballs, use the following: +# +# echo '$Format:%(describe)$' > .tarball-version-git +# echo '.tarball-version-git export-subst' >> .gitattributes +# git add .tarball-version-git .gitattributes +# git commit -m "Add .tarball-version-git for git-version-gen." me=$0 @@ -138,9 +145,9 @@ v_from_git= # First see if there is a tarball-only version file. # then try "git describe", then default. -if test -f $tarball_version_file +if test -f "$tarball_version_file" then - v=`cat $tarball_version_file` || v= + v=`cat "$tarball_version_file"` || v= case $v in *$nl*) v= ;; # reject multi-line output esac @@ -184,10 +191,6 @@ then test "$commit_list" = failed && v=UNKNOWN ;; esac - - # Change the penultimate "-" to ".", for version-comparing tools. - # Remove the "g" to save a byte. - v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`; v_from_git=1 elif test "x$fallback" = x || git --version >/dev/null 2>&1; then v=UNKNOWN @@ -195,22 +198,43 @@ else v=$fallback fi +if test "x$v" = xUNKNOWN \ + && test -f "$tarball_version_file"-git \ + && v=$(head -1 "$tarball_version_file"-git); then + case $v in + *Format*) v=UNKNOWN ;; + esac +fi + +# Change the penultimate "-" to ".", for version-comparing tools. +# Remove the "g" to save a byte. +v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`; + v=`echo "$v" |sed "s/^$prefix//"` -# Test whether to append the "-dirty" suffix only if the version +# The "-modified" suffix was previously called "-dirty". While this term +# was invented by the git people to designate a checkout that is not "clean", +# it has a negative connotation that is not in line with the fact that +# a Free Software developer routinely works with modified source code. +# In fact, modifying source code is the *essence* of Free Software. +# What we need here is a term that is suitable for naming tarballs, without +# shaming the developer. Giving a name to a tarball is something else than +# describing the state of a git checkout. +# +# Test whether to append the "-modified" suffix only if the version # string we're using came from git. I.e., skip the test if it's "UNKNOWN" # or if it came from .tarball-version. if test "x$v_from_git" != x; then - # Don't declare a version "dirty" merely because a timestamp has changed. + # Don't declare a version "modified" merely because a timestamp has changed. git update-index --refresh > /dev/null 2>&1 - dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= - case "$dirty" in + modified=`exec 2>/dev/null;git diff-index --name-only HEAD` || modified= + case "$modified" in '') ;; *) # Append the suffix only if there isn't one already. case $v in - *-dirty) ;; - *) v="$v-dirty" ;; + *-dirty | *-modified) ;; + *) v="$v-modified" ;; esac ;; esac fi @@ -219,9 +243,9 @@ fi printf %s "$v" # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog index 16a9405a7..134833a98 100755 --- a/build-aux/gitlog-to-changelog +++ b/build-aux/gitlog-to-changelog @@ -3,7 +3,7 @@ # Convert git log output to ChangeLog format. -# Copyright (C) 2008-2024 Free Software Foundation, Inc. +# Copyright (C) 2008-2026 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,12 +35,14 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2023-06-24 21:59'; # UTC +my $VERSION = '2025-06-10 02:43'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. +(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/; + use strict; use warnings; use Getopt::Long; @@ -97,6 +99,7 @@ OPTIONS: --strip-cherry-pick remove data inserted by "git cherry-pick"; this includes the "cherry picked from commit ..." line, and the possible final "Conflicts:" paragraph. + --commit-timezone use dates respecting the timezone commits were made in. --help display this help and exit --version output version information and exit @@ -137,11 +140,24 @@ s/all tile types/all file types/ # Change the author to be Paul. Note the escaped "@": s,Jim .*>,Paul Eggert , +Send patches and bug reports to . EOF } exit $exit_code; } +sub print_version () +{ + print "$ME version $VERSION\n"; + print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n"; + print "License GPLv3+: GNU GPL version 3 or later \n" + . "This is free software: you are free to change and redistribute it.\n" + . "There is NO WARRANTY, to the extent permitted by law.\n"; + print "\n"; + my $author = "Jim Meyering"; + print "Written by $author.\n"; +} + # If the string $S is a well-behaved file name, simply return it. # If it contains white space, quotes, etc., quote it, and return the new string. sub shell_quote($) @@ -247,11 +263,12 @@ sub git_dir_option($) my $ignore_line; my $strip_tab = 0; my $strip_cherry_pick = 0; + my $commit_timezone = 0; my $srcdir; GetOptions ( help => sub { usage 0 }, - version => sub { print "$ME version $VERSION\n"; exit }, + version => sub { print_version; exit }, 'since=s' => \$since_date, 'until=s' => \$until_date, 'format=s' => \$format_string, @@ -262,6 +279,7 @@ sub git_dir_option($) 'ignore-line=s' => \$ignore_line, 'strip-tab' => \$strip_tab, 'strip-cherry-pick' => \$strip_cherry_pick, + 'commit-timezone' => \$commit_timezone, 'srcdir=s' => \$srcdir, ) or usage 1; @@ -274,10 +292,12 @@ sub git_dir_option($) # that makes a correction in the log or attribution of that commit. my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {}; + my $commit_time_format = $commit_timezone ? '%cI' : '%ct'; my @cmd = ('git', git_dir_option $srcdir, qw(log --log-size), - '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); + ("--pretty=format:%H:$commit_time_format" + . ' %an <%ae>%n%n'.$format_string, @ARGV)); open PIPE, '-|', @cmd or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n" . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); @@ -350,17 +370,31 @@ sub git_dir_option($) my $author_line = shift @line; defined $author_line or die "$ME:$.: unexpected EOF\n"; - $author_line =~ /^(\d+) (.*>)$/ + $author_line =~ /^(\S+) (.*>)$/ or die "$ME:$.: Invalid line " . "(expected date/author/email):\n$author_line\n"; + # Author + my $author = $2; + + my $commit_date = $1; + if (! $commit_timezone) + { + # Seconds since the Epoch. + $commit_date = strftime "%Y-%m-%d", localtime ($commit_date); + } + else + { + # ISO 8601 date. + $commit_date =~ s/T.*$//; + } + # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog # '(tiny change)' annotation. my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line) ? ' (tiny change)' : ''); - my $date_line = sprintf "%s %s$tiny\n", - strftime ("%Y-%m-%d", localtime ($1)), $2; + my $date_line = "$commit_date $author$tiny\n"; my @coauthors = grep /^Co-authored-by:.*$/, @line; # Omit meta-data lines we've already interpreted. @@ -495,7 +529,7 @@ sub git_dir_option($) # Complain about any unused entry in the --amend=F specified file. my $fail = 0; - foreach my $sha (keys %$amend_code) + foreach my $sha (sort keys %$amend_code) { warn "$ME:$amend_file: unused entry: $sha\n"; $fail = 1; @@ -507,10 +541,10 @@ sub git_dir_option($) # Local Variables: # mode: perl # indent-tabs-mode: nil -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-line-limit: 50 # time-stamp-start: "my $VERSION = '" -# time-stamp-format: "%:y-%02m-%02d %02H:%02M" +# time-stamp-format: "%Y-%02m-%02d %02H:%02M" # time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: diff --git a/build-aux/gnupload b/build-aux/gnupload index 298a6766f..3bacc1015 100755 --- a/build-aux/gnupload +++ b/build-aux/gnupload @@ -1,9 +1,9 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2022-01-27.18; # UTC +scriptversion=2025-06-28.18; # UTC -# Copyright (C) 2004-2024 Free Software Foundation, Inc. +# Copyright (C) 2004-2026 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ GPG=gpg # Choose the proper version of gpg, so as to avoid a # "gpg-agent is not available in this session" error # when gpg-agent is version 2 but gpg is still version 1. -# FIXME-2020: remove, once all major distros ship gpg version 2 as /usr/bin/gpg +# FIXME: remove, once all major distros ship gpg version 2 as /usr/bin/gpg gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'` case "$gpg_agent_version" in 2.*) @@ -39,7 +39,7 @@ case "$gpg_agent_version" in # gpg2 is present. GPG=gpg2 else - # gpg2 is missing. Ubuntu users should install the package 'gnupg2'. + # gpg2 is missing. Slackware users should install the package 'gnupg2'. echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2 fi ;; @@ -101,6 +101,9 @@ in the current working directory, its contents are prepended to the actual command line options. Use this to keep your defaults. Comments (#) and empty lines in $conffile are allowed. +You may need to set GPG_TTY=\$(tty) in your environment. See the +gpg-agent man page. + gives some further background. @@ -472,9 +475,9 @@ done exit 0 # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/install-sh b/build-aux/install-sh index 7c56c9c01..1d8d96696 100755 --- a/build-aux/install-sh +++ b/build-aux/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2023-11-23.18; # UTC +scriptversion=2025-06-18.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -170,7 +170,7 @@ while test $# -ne 0; do -T) is_target_a_directory=never;; - --version) echo "$0 $scriptversion"; exit $?;; + --version) echo "$0 (GNU Automake) $scriptversion"; exit $?;; --) shift break;; @@ -345,7 +345,7 @@ do ' 0 # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directly in world-writable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && @@ -353,7 +353,7 @@ do exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. + # Check for POSIX incompatibility with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. @@ -533,9 +533,9 @@ do done # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/build-aux/move-if-change b/build-aux/move-if-change index 18a720735..19c3ced7c 100755 --- a/build-aux/move-if-change +++ b/build-aux/move-if-change @@ -2,13 +2,13 @@ # Like mv $1 $2, but if the files are the same, just delete $1. # Status is zero if successful, nonzero otherwise. -VERSION='2018-03-07 03:47'; # UTC +VERSION='2025-06-10 02:42'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2002-2024 Free Software Foundation, Inc. +# Copyright (C) 2002-2026 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -76,9 +76,9 @@ else fi ## Local Variables: -## eval: (add-hook 'before-save-hook 'time-stamp) +## eval: (add-hook 'before-save-hook 'time-stamp nil t) ## time-stamp-start: "VERSION='" -## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-format: "%Y-%02m-%02d %02H:%02M" ## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff --git a/build-aux/texinfo.tex b/build-aux/texinfo.tex index fc38aa9b9..5f1195a91 100644 --- a/build-aux/texinfo.tex +++ b/build-aux/texinfo.tex @@ -3,9 +3,9 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2024-02-10.22} +\def\texinfoversion{2025-12-23.13} % -% Copyright 1985, 1986, 1988, 1990-2024 Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990-2025 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -156,8 +156,9 @@ % Give the space character the catcode for a space. \def\spaceisspace{\catcode`\ =10\relax} -% Likewise for ^^M, the end of line character. -\def\endlineisspace{\catcode13=10\relax} +% Used to ignore an active newline that may appear immediately after +% a macro name. +{\catcode13=\active \gdef\ignoreactivenewline{\let^^M\empty}} \chardef\dashChar = `\- \chardef\slashChar = `\/ @@ -286,7 +287,6 @@ % Avoid "undefined control sequence" errors. \def\currentchapterdefs{} \def\currentsectiondefs{} -\def\currentsection{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\currentcolordefs{} @@ -335,7 +335,7 @@ % % Make the heading and footing. \makeheadline and \makefootline % use the contents of \headline and \footline. - \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} + \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}% \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi @@ -483,8 +483,8 @@ % \envdef\foo{...} % \def\Efoo{...} % -% It's the responsibility of \envdef to insert \begingroup before the -% actual body; @end closes the group after calling \Efoo. \envdef also +% \envdef inserts \begingroup before the actual body; @end calls +% \Efoo then closes the group with \endgroup. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. @@ -558,7 +558,13 @@ \def\:{\spacefactor=1000 } % @* forces a line break. -\def\*{\unskip\hfil\break\hbox{}\ignorespaces} +% In internal horizontal or vertical mode, convert explicit line breaks +% from @* into spaces. For instance, if the user gives these in long +% section titles, this may occur in the table of contents, or the page +% heading line. +\def\*{% + \ifinner\unskip\space\ignorespaces + \else\unskip\hfil\break\hbox{}\ignorespaces\fi} % @/ allows a line break. \let\/=\allowbreak @@ -951,8 +957,16 @@ where each line of input produces a line of output.} \let\setfilename=\comment % @bye. -\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} +\outer\def\bye{% + \chappager\pagelabels + % possibly set in \printindex + \ifx\byeerror\relax\else\errmessage{\byeerror}\fi + \tracingstats=1\ptexend} +% set in \donoderef below, but we need to define this here so that +% conditionals balance inside the large \ifpdf ... \fi blocks below. +\newif\ifnodeseen +\nodeseenfalse \message{pdf,} % adobe `portable' document format @@ -971,15 +985,52 @@ where each line of input produces a line of output.} \newif\ifpdf \newif\ifpdfmakepagedest +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as being undefined. +\ifx\pdfoutput\thisisundefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +\newif\ifxetex +\ifx\XeTeXrevision\thisisundefined\else + \xetextrue +\fi + +\newif\ifluatex +\ifx\luatexversion\thisisundefined\else + \luatextrue + \ifnum\luatexversion>84 + \pdftrue + \fi +\fi + +\newif\ifpdforxetex +\ifpdf + \pdforxetextrue +\fi +\ifxetex + \pdforxetextrue +\fi + + + +% Whether to use non-ASCII bytes in internal link targets. Presently this +% is almost always on. +\newif\iftxiuseunicodedestname +\txiuseunicodedestnametrue + % % For LuaTeX % -\newif\iftxiuseunicodedestname -\txiuseunicodedestnamefalse % For pdfTeX etc. - -\ifx\luatexversion\thisisundefined -\else +\ifluatex % Use Unicode destination names \txiuseunicodedestnametrue % Escape PDF strings with converting UTF-16 from UTF-8 @@ -1032,7 +1083,7 @@ where each line of input produces a line of output.} % \endgroup \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} - \ifnum\luatexversion>84 + \ifpdf % For LuaTeX >= 0.85 \def\pdfdest{\pdfextension dest} \let\pdfoutput\outputmode @@ -1055,28 +1106,6 @@ where each line of input produces a line of output.} \fi \fi -% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 -% can be set). So we test for \relax and 0 as well as being undefined. -\ifx\pdfoutput\thisisundefined -\else - \ifx\pdfoutput\relax - \else - \ifcase\pdfoutput - \else - \pdftrue - \fi - \fi -\fi - -\newif\ifpdforxetex -\pdforxetexfalse -\ifpdf - \pdforxetextrue -\fi -\ifx\XeTeXrevision\thisisundefined\else - \pdforxetextrue -\fi - % Output page labels information. % See PDF reference v.1.7 p.594, section 8.3.1. @@ -1163,58 +1192,90 @@ with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} +% definitions for pdftex or luatex with pdf output \ifpdf + % Strings in PDF outlines can either be ASCII, or encoded in UTF-16BE + % with BOM. Unfortunately there is no simple way with pdftex to output + % UTF-16, so we have to do some quite convoluted expansion games if we + % find the string contains a non-ASCII codepoint if we want these to + % display correctly. We generated the UTF-16 sequences in + % \DeclareUnicodeCharacter and we access them here. + % + \def\defpdfoutlinetextunicode#1{% + \def\pdfoutlinetext{#1}% + % + % Make UTF-8 sequences expand to UTF-16 definitions. + \passthroughcharsfalse \utfbytespdftrue + \utfviiidefinedwarningfalse + % + % Completely expand, eliminating any control sequences such as \code, + % leaving only possibly \utfbytes. + \let\utfbytes\relax + \pdfaccentliterals + \xdef\pdfoutlinetextchecked{#1}% + \checkutfbytes + }% + % Check if \utfbytes occurs in expansion. + \def\checkutfbytes{% + \expandafter\checkutfbytesz\pdfoutlinetextchecked\utfbytes\finish + }% + \def\checkutfbytesz#1\utfbytes#2\finish{% + \def\after{#2}% + \ifx\after\empty + % No further action needed. Output ASCII string as-is, as converting + % to UTF-16 is somewhat slow (and uses more space). + \global\let\pdfoutlinetext\pdfoutlinetextchecked + \else + \passthroughcharstrue % pass UTF-8 sequences unaltered + \xdef\pdfoutlinetext{\pdfoutlinetext}% + \expandafter\expandutfsixteen\expandafter{\pdfoutlinetext}\pdfoutlinetext + \fi + }% % - % Color manipulation macros using ideas from pdfcolor.tex, - % except using rgb instead of cmyk; the latter is said to render as a - % very dark gray on-screen and a very dark halftone in print, instead - % of actual black. The dark red here is dark enough to print on paper as - % nearly black, but still distinguishable for online viewing. We use - % black by default, though. - \def\rgbDarkRed{0.50 0.09 0.12} - \def\rgbBlack{0 0 0} - % - % rg sets the color for filling (usual text, etc.); - % RG sets the color for stroking (thin rules, e.g., normal _'s). - \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} + \catcode2=1 % begin-group character + \catcode3=2 % end-group character % - % Set color, and create a mark which defines \thiscolor accordingly, - % so that \makeheadline knows which color to restore. - \def\curcolor{0 0 0}% - \def\setcolor#1{% - \ifx#1\curcolor\else - \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% - \domark - \pdfsetcolor{#1}% - \xdef\curcolor{#1}% - \fi - } + % argument should be pure UTF-8 with no control sequences. convert to + % UTF-16BE by inserting null bytes before bytes < 128 and expanding + % UTF-8 multibyte sequences to saved UTF-16BE sequences. + \def\expandutfsixteen#1#2{% + \bgroup \asciitounicode + \passthroughcharsfalse + \let\utfbytes\asis + % + % for Byte Order Mark (BOM) + \catcode"FE=12 + \catcode"FF=12 + % + % we want to treat { and } in #1 as any other ASCII bytes. however, + % we need grouping characters for \scantokens and definitions/assignments, + % so define alternative grouping characters using control characters + % that are unlikely to occur. + % this does not affect 0x02 or 0x03 bytes arising from expansion as + % these are tokens with different catcodes. + \catcode"02=1 % begin-group character + \catcode"03=2 % end-group character + % + \expandafter\xdef\expandafter#2\scantokens{% + ^^02^^fe^^ff#1^^03}% + % NB we need \scantokens to provide both the open and close group tokens + % for \xdef otherwise there is an e-TeX error "File ended while + % scanning definition of..." + % NB \scantokens is a e-TeX command which is assumed to be provided by + % pdfTeX. + % + \egroup + }% % - \let\maincolor\rgbBlack - \pdfsetcolor{\maincolor} - \edef\thiscolor{\maincolor} - \def\currentcolordefs{} + \catcode2=12 \catcode3=12 % defaults % - \def\makefootline{% - \baselineskip24pt - \line{\pdfsetcolor{\maincolor}\the\footline}% - } + % Color support % - \def\makeheadline{% - \vbox to 0pt{% - \vskip-22.5pt - \line{% - \vbox to8.5pt{}% - % Extract \thiscolor definition from the marks. - \getcolormarks - % Typeset the headline with \maincolor, then restore the color. - \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% - }% - \vss - }% - \nointerlineskip - } + % rg sets the color for filling (usual text, etc.); + % RG sets the color for stroking (thin rules, e.g., normal _'s). + \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % + % PDF outline support % \pdfcatalog{/PageMode /UseOutlines} % @@ -1311,18 +1372,15 @@ output) for that.)} \def\pdfoutlinetext{#1}% \else \ifx \declaredencoding \utfeight - \ifx\luatexversion\thisisundefined - % For pdfTeX with UTF-8. - % TODO: the PDF format can use UTF-16 in bookmark strings, - % but the code for this isn't done yet. - % Use ASCII approximations. - \passthroughcharsfalse - \def\pdfoutlinetext{#1}% - \else + \ifluatex % For LuaTeX with UTF-8. % Pass through Unicode characters for title texts. \passthroughcharstrue - \def\pdfoutlinetext{#1}% + \pdfaccentliterals + \xdef\pdfoutlinetext{#1}% + \else + % For pdfTeX with UTF-8. + \defpdfoutlinetextunicode{#1}% \fi \else % For non-Latin-1 or non-UTF-8 encodings. @@ -1341,14 +1399,6 @@ output) for that.)} \safewhatsit{\pdfdest name{\pdfdestname} xyz}% } % - % used to mark target names; must be expandable. - \def\pdfmkpgn#1{#1} - % - % by default, use black for everything. - \def\urlcolor{\rgbBlack} - \let\linkcolor\rgbBlack - \def\endlink{\setcolor{\maincolor}\pdfendlink} - % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% @@ -1374,7 +1424,7 @@ output) for that.)} \def\pdfdestname{#4}% \fi % - \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% + \pdfoutline goto name{\pdfdestname}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% @@ -1385,15 +1435,18 @@ output) for that.)} \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% + \def\indexlastsec{chap\thischapnum}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% + \def\indexlastsec{sec\thissecnum}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% + \def\indexlastsec{subsec\thissecnum}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% @@ -1401,7 +1454,13 @@ output) for that.)} \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% + \let\indexlastsec\empty % + % Index initials are subsidiary to whatever sectioning command just + % occurred, usually @appendix or @chapter but occasionally a lower level. + \def\idxinitialentry##1##2##3##4{% + \expandafter\advancenumber\expandafter{\indexlastsec}% + }% % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% @@ -1412,6 +1471,7 @@ output) for that.)} \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% + % \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. @@ -1433,28 +1493,23 @@ output) for that.)} \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% + \def\idxinitialentry##1##2##3##4{% + \dopdfoutline{##1}{}{idx.##1.##2}{##4}}% % - % PDF outlines are displayed using system fonts, instead of - % document fonts. Therefore we cannot use special characters, - % since the encoding is unknown. For example, the eogonek from - % Latin 2 (0xea) gets translated to a | character. Info from - % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. - % - % TODO this right, we have to translate 8-bit characters to - % their "best" equivalent, based on the @documentencoding. Too - % much work for too little return. Just use the ASCII equivalents - % we use for the index sort strings. - % - \indexnofonts + \ifnodeseen\else \dopdfoutlinecontents \fi % for @contents at beginning \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash - \input \tocreadfilename + \input \tocreadfilename\relax + \ifnodeseen \dopdfoutlinecontents \fi % for @contents at end \endgroup } + \def\dopdfoutlinecontents{% + \expandafter\dopdfoutline\expandafter{\putwordTOC}{}{txi.CONTENTS}{}% + } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% @@ -1480,55 +1535,16 @@ output) for that.)} \else \let \startlink \pdfstartlink \fi - % make a live url in pdf output. - \def\pdfurl#1{% - \begingroup - % it seems we really need yet another set of dummies; have not - % tried to figure out what each command should do in the context - % of @url. for now, just make @/ a no-op, that's the only one - % people have actually reported a problem with. - % - \normalturnoffactive - \def\@{@}% - \let\/=\empty - \makevalueexpandable - % do we want to go so far as to use \indexnofonts instead of just - % special-casing \var here? - \def\var##1{##1}% - % - \leavevmode\setcolor{\urlcolor}% - \startlink attr{/Border [0 0 0]}% - user{/Subtype /Link /A << /S /URI /URI (#1) >>}% - \endgroup} - % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may - % be a simple number, or a list of numbers in the case of an index - % entry. - \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} - \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} - \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} - \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS|\relax - \ifx\first0\adn0 - \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 - \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 - \else - \ifnum0=\countA\else\makelink\fi - \ifx\first.\let\next=\done\else - \let\next=\maketoks - \addtokens{\toksB}{\the\toksD} - \ifx\first,\addtokens{\toksB}{\space}\fi - \fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next} - \def\makelink{\addtokens{\toksB}% - {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdfmakeurl#1{% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + }% + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % \def\pdflink#1{\pdflinkpage{#1}{#1}}% \def\pdflinkpage#1#2{% - \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \startlink attr{/Border [0 0 0]} goto name{#1} \setcolor{\linkcolor}#2\endlink} - \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble @@ -1537,13 +1553,12 @@ output) for that.)} \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax -\fi % \ifx\pdfoutput +\fi % % For XeTeX % -\ifx\XeTeXrevision\thisisundefined -\else +\ifxetex % % XeTeX version check % @@ -1569,45 +1584,8 @@ output) for that.)} \fi % % Color support - % - \def\rgbDarkRed{0.50 0.09 0.12} - \def\rgbBlack{0 0 0} - % \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} % - % Set color, and create a mark which defines \thiscolor accordingly, - % so that \makeheadline knows which color to restore. - \def\setcolor#1{% - \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% - \domark - \pdfsetcolor{#1}% - } - % - \def\maincolor{\rgbBlack} - \pdfsetcolor{\maincolor} - \edef\thiscolor{\maincolor} - \def\currentcolordefs{} - % - \def\makefootline{% - \baselineskip24pt - \line{\pdfsetcolor{\maincolor}\the\footline}% - } - % - \def\makeheadline{% - \vbox to 0pt{% - \vskip-22.5pt - \line{% - \vbox to8.5pt{}% - % Extract \thiscolor definition from the marks. - \getcolormarks - % Typeset the headline with \maincolor, then restore the color. - \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% - }% - \vss - }% - \nointerlineskip - } - % % PDF outline support % % Emulate pdfTeX primitive @@ -1645,11 +1623,6 @@ output) for that.)} \safewhatsit{\pdfdest name{\pdfdestname} xyz}% } % - % by default, use black for everything. - \def\urlcolor{\rgbBlack} - \def\linkcolor{\rgbBlack} - \def\endlink{\setcolor{\maincolor}\pdfendlink} - % \def\dopdfoutline#1#2#3#4{% \setpdfoutlinetext{#1} \setpdfdestname{#3} @@ -1663,7 +1636,6 @@ output) for that.)} % \def\pdfmakeoutlines{% \begingroup - % % For XeTeX, counts of subentries are not necessary. % Therefore, we read toc only once. % @@ -1674,13 +1646,20 @@ output) for that.)} % horizontal space being required in the PDF viewer. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% - \dopdfoutline{##2 ##1}{1}{##3}{##4}}% + \dopdfoutline{##2 ##1}{1}{##3}{##4}% + \def\indexseclevel{2}}% \def\numsecentry##1##2##3##4{% - \dopdfoutline{##1}{2}{##3}{##4}}% + \dopdfoutline{##1}{2}{##3}{##4}% + \def\indexseclevel{3}}% \def\numsubsecentry##1##2##3##4{% - \dopdfoutline{##1}{3}{##3}{##4}}% + \dopdfoutline{##1}{3}{##3}{##4}% + \def\indexseclevel{4}}% \def\numsubsubsecentry##1##2##3##4{% - \dopdfoutline{##1}{4}{##3}{##4}}% + \dopdfoutline{##1}{4}{##3}{##4}% + \def\indexseclevel{5}}% + % + \def\idxinitialentry##1##2##3##4{% + \dopdfoutline{##1}{\indexseclevel}{idx.##1.##2}{##4}}% % \let\appentry\numchapentry% \let\appsecentry\numsecentry% @@ -1696,15 +1675,25 @@ output) for that.)} % Therefore, the encoding and the language may not be considered. % \indexnofonts + \pdfaccentliterals + \ifnodeseen\else \dopdfoutlinecontents \fi % for @contents at beginning + % \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash - \input \tocreadfilename + \xetexpreauxfile + \input \tocreadfilename\relax + \xetexpostauxfile + \ifnodeseen \dopdfoutlinecontents \fi % for @contents at end \endgroup } + \def\dopdfoutlinecontents{% + \expandafter\dopdfoutline\expandafter + {\putwordTOC}{1}{txi.CONTENTS}{txi.CONTENTS}% + } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% @@ -1717,7 +1706,7 @@ output) for that.)} % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). -% + % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces @@ -1732,55 +1721,17 @@ output) for that.)} \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } - % make a live url in pdf output. - \def\pdfurl#1{% - \begingroup - % it seems we really need yet another set of dummies; have not - % tried to figure out what each command should do in the context - % of @url. for now, just make @/ a no-op, that's the only one - % people have actually reported a problem with. - % - \normalturnoffactive - \def\@{@}% - \let\/=\empty - \makevalueexpandable - % do we want to go so far as to use \indexnofonts instead of just - % special-casing \var here? - \def\var##1{##1}% - % - \leavevmode\setcolor{\urlcolor}% - \special{pdf:bann << /Border [0 0 0] - /Subtype /Link /A << /S /URI /URI (#1) >> >>}% - \endgroup} + \def\pdfmakeurl#1{% + \special{pdf:bann << /Border [0 0 0] + /Subtype /Link /A << /S /URI /URI (#1) >> >>}% + } \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} - \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} - \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} - \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} - \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} - \def\maketoks{% - \expandafter\poptoks\the\toksA|ENDTOKS|\relax - \ifx\first0\adn0 - \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 - \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 - \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 - \else - \ifnum0=\countA\else\makelink\fi - \ifx\first.\let\next=\done\else - \let\next=\maketoks - \addtokens{\toksB}{\the\toksD} - \ifx\first,\addtokens{\toksB}{\space}\fi - \fi - \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi - \next} - \def\makelink{\addtokens{\toksB}% - {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{\pdflinkpage{#1}{#1}}% \def\pdflinkpage#1#2{% \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% \setcolor{\linkcolor}#2\endlink} - \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -% + % % % @image support % @@ -1831,12 +1782,170 @@ output) for that.)} \XeTeXpicfile "#1".\xeteximgext "" \fi \fi - \ifdim \wd0 >0pt width \xeteximagewidth \fi - \ifdim \wd2 >0pt height \xeteximageheight \fi \relax - \egroup - } + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + \egroup + } +\fi + +% common definitions and code for pdftex, luatex and xetex +\ifpdforxetex + % The dark red here is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. We use + % black by default, though. + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\curcolor{0 0 0}% + \def\setcolor#1{% + \ifx#1\curcolor\else + \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + \xdef\curcolor{#1}% + \fi + } + % + \let\maincolor\rgbBlack + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\currentcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \let\linkcolor\rgbBlack + % + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \pdfmakeurl{#1}% + \endgroup} + % + % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may + % be a simple number, or a list of numbers in the case of an index + % entry. + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \fi +\ifpdforxetex + % for pdftex. + {\catcode`^^cc=13 + \gdef\pdfaccentliteralsutfviii{% + % For PDF outline only. Unicode combining accents follow the + % character they modify. Note we need at least the first byte + % of the UTF-8 sequences to have an active catcode to allow the + % definitions to do their magic. + \def\"##1{##1^^cc^^88}% U+0308 + \def\'##1{##1^^cc^^81}% U+0301 + \def\,##1{##1^^cc^^a7}% U+0327 + \def\=##1{##1^^cc^^85}% U+0305 + \def\^##1{##1^^cc^^82}% U+0302 + \def\`##1{##1^^cc^^80}% U+0300 + \def\~##1{##1^^cc^^83}% U+0303 + \def\dotaccent##1{##1^^cc^^87}% U+0307 + \def\H##1{##1^^cc^^8b}% U+030B + \def\ogonek##1{##1^^cc^^a8}% U+0328 + \def\ringaccent##1{##1^^cc^^8a}% U+030A + \def\u##1{##1^^cc^^8c}% U+0306 + \def\ubaraccent##1{##1^^cc^^b1}% U+0331 + \def\udotaccent##1{##1^^cc^^a3}% U+0323 + \def\v##1{##1^^cc^^8c}% U+030C + % this definition of @tieaccent will only work with exactly two characters + % in argument as we need to insert the combining character between them. + \def\tieaccent##1{\tieaccentz##1}% + \def\tieaccentz##1##2{##1^^cd^^a1##2} % U+0361 + }}% + % + % for xetex and luatex, which both support extended ^^^^ escapes and + % process the Unicode codepoint as a single token. + \gdef\pdfaccentliteralsnative{% + \def\"##1{##1^^^^0308}% + \def\'##1{##1^^^^0301}% + \def\,##1{##1^^^^0327}% + \def\=##1{##1^^^^0305}% + \def\^##1{##1^^^^0302}% + \def\`##1{##1^^^^0300}% + \def\~##1{##1^^^^0303}% + \def\dotaccent##1{##1^^^^0307}% + \def\H##1{##1^^^^030b}% + \def\ogonek##1{##1^^^^0328}% + \def\ringaccent##1{##1^^^^030a}% + \def\u##1{##1^^^^0306}% + \def\ubaraccent##1{##1^^^^0331}% + \def\udotaccent##1{##1^^^^0323}% + \def\v##1{##1^^^^030c}% + \def\tieaccent##1{\tieaccentz##1}% + \def\tieaccentz##1##2{##1^^^^0361##2} % U+0361 + }% + % + % use the appropriate definition + \ifluatex + \let\pdfaccentliterals\pdfaccentliteralsnative + \else + \ifxetex + \let\pdfaccentliterals\pdfaccentliteralsnative + \else + \let\pdfaccentliterals\pdfaccentliteralsutfviii + \fi + \fi +\fi % \message{fonts,} @@ -2768,15 +2877,15 @@ end % @cite unconditionally uses \sl with \smartitaliccorrection. \def\cite#1{{\sl #1}\smartitaliccorrection} -% @var unconditionally uses \sl. This gives consistency for -% parameter names whether they are in @def, @table @code or a -% regular paragraph. -% To get ttsl font for @var when used in code context, @set txicodevaristt. -% The \null is to reset \spacefactor. +% By default, use ttsl font for @var when used in code context. +% To unconditionally use \sl for @var, @clear txicodevaristt. This +% gives consistency for parameter names whether they are in @def, +% @table @code or a regular paragraph. \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% + % The \null is to reset \spacefactor. % \ifflagclear{txicodevaristt}% {\def\varnext{{{\sl #1}}\smartitaliccorrection}}% @@ -2784,7 +2893,6 @@ end \varnext } -% To be removed after next release \def\SETtxicodevaristt{}% @set txicodevaristt \let\i=\smartitalic @@ -2804,7 +2912,7 @@ end \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. -\def\b#1{{\bf #1}} +\def\b#1{{\bf \defcharsdefault #1}} \let\strong=\b % @sansserif, explicit sans. @@ -3035,9 +3143,7 @@ end \unhbox0\ (\urefcode{#1})% \fi \else - \ifx\XeTeXrevision\thisisundefined - \unhbox0\ (\urefcode{#1})% DVI, always show arg and url - \else + \ifxetex % For XeTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg @@ -3047,6 +3153,8 @@ end % visibility, if the pdf is eventually used to print, etc. \unhbox0\ (\urefcode{#1})% \fi + \else + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url \fi \fi \else @@ -3126,11 +3234,12 @@ end % at the end of the line, or no break at all here. % Changing the value of the penalty and/or the amount of stretch affects how % preferable one choice is over the other. +% Check test cases in doc/texinfo-tex-test.texi before making any changes. \def\urefallowbreak{% \penalty0\relax - \hskip 0pt plus 2 em\relax + \hskip 0pt plus 3 em\relax \penalty1000\relax - \hskip 0pt plus -2 em\relax + \hskip 0pt plus -3 em\relax } \urefbreakstyle after @@ -3665,15 +3774,24 @@ $$% {\font\thisecfont = #1ctt\ecsize \space at \nominalsize}% % else {\ifx\curfontstyle\bfstylename - % bold: - \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize + \etcfontbold{#1}% \else - % regular: - \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \ifrmisbold + \etcfontbold{#1}% + \else + % regular: + \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space + at \nominalsize + \fi \fi}% \thisecfont } +\def\etcfontbold#1{% + % bold: + \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize +} + % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. @@ -3776,7 +3894,8 @@ $$% } \def\finishtitlepage{% - \vskip4pt \hrule height 2pt width \hsize + \ifseenauthor \vskip4pt \else \vskip 0pt plus 1filll \fi + \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } @@ -3799,33 +3918,105 @@ $$% \let\subtitlerm=\rmfont \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} +\let\savedtitle\empty +\let\savedsubtitlegroup\empty +\let\savedauthorgroup\empty + \parseargdef\title{% - \checkenv\titlepage - \vbox{\titlefonts \raggedtitlesettings #1\par}% - % print a rule at the page bottom also. - \finishedtitlepagefalse - \vskip4pt \hrule height 4pt width \hsize \vskip4pt + \expandafter\ifx\thisenv\documentinfo + \gdef\savedtitle{#1}% + \else + \checkenv\titlepage + \vbox{\titlefonts \raggedtitlesettings #1\par}% + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt + \fi } \parseargdef\subtitle{% - \checkenv\titlepage - {\subtitlefont \rightline{#1}}% + \expandafter\ifx\thisenv\documentinfo + \ifx\savedsubtitlegroup\empty + \gdef\savedsubtitlegroup{\savedsubtitle{#1}}% + \else + \expandafter\gdef\expandafter\savedsubtitlegroup\expandafter{% + \savedsubtitlegroup\savedsubtitle{#1}}% + \fi + \else + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% + \fi } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% - \def\temp{\quotation}% - \ifx\thisenv\temp - \def\quotationauthor{#1}% printed in \Equotation. + \expandafter\ifx\thisenv\documentinfo + \ifx\savedauthorgroup\empty + \gdef\savedauthorgroup{\savedauthor{#1}}% + \else + \expandafter\gdef\expandafter\savedauthorgroup\expandafter{% + \savedauthorgroup\savedauthor{#1}}% + \fi \else - \checkenv\titlepage - \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi - {\secfonts\rm \leftline{#1}}% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\secfonts\rm \leftline{#1}}% + \fi \fi } +% @maketitle +{\obeylines +\gdef\maketitle{% +\titlepage +\ifx\savedtitle\empty\else + \title \savedtitle + \ifx\savedsubtitlegroup\empty\else + \savedsubtitlegroup +\fi\fi +\ifx\savedauthorgroup\empty\else + \savedauthorgroup +\fi +% start verso page if either copying or publication text is given +\ifx\copyingtext\relax + \ifx\publicationtext\relax\else + \page \vskip 0pt plus 1filll + \fi +\else + \page \vskip 0pt plus 1filll +\fi +\ifx\publicationtext\relax\else + \insertpublication + \sp 1 +\fi +\ifx\copyingtext\relax\else + \insertcopying +\fi +\end titlepage +} + +% \savedauthor{#1}, called with braces. output an @author line. +\gdef\savedauthor#1{% +\author#1 +} + +% \savedsubtitle{#1}, called with braces. output a @subtitle line. +\gdef\savedsubtitle#1{% +\subtitle#1 +} +} % \obeylines + +% @documentinfo block +\envdef\documentinfo{% +} +\def\Edocumentinfo{}% + % Set up page headings and footings. @@ -5065,8 +5256,8 @@ $$% % \uccode`\1=`\{ \uppercase{\def\{{1}}% \uccode`\1=`\} \uppercase{\def\}{1}}% - \let\lbracechar\{% - \let\rbracechar\}% + \def\lbracechar##1{\{}% + \def\rbracechar##1{\}}% % % % We need to get rid of all macros, leaving only the arguments (if present). @@ -5411,6 +5602,8 @@ $$% \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. + \let\entry\indexentry + \ifxetex\xetexpreauxfile\fi % % See comment in \requireopenindexfile. \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi @@ -5436,8 +5629,12 @@ $$% \fi \fi \closein 1 + \ifxetex\xetexpostauxfile\fi \endgroup} +% Checked in @bye +\let\byeerror\relax + % If the index file starts with a backslash, forgo reading the index % file altogether. If somebody upgrades texinfo.tex they may still have % old index files using \ as the escape character. Reading this would @@ -5446,7 +5643,9 @@ $$% \ifflagclear{txiindexescapeisbackslash}{% \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 \ifflagclear{txiskipindexfileswithbackslash}{% -\errmessage{% + % Delay the error message until the very end to give a chance + % for the whole index to be output as input for texindex. + \global\def\byeerror{% ERROR: A sorted index file in an obsolete format was skipped. To fix this problem, please upgrade your version of 'texi2dvi' or 'texi2pdf' to that at . @@ -5466,7 +5665,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% }% \else \begindoublecolumns + \ifxetex\xetexpreauxfile\fi \input \jobname.\indexname s + \ifxetex\xetexpostauxfile\fi \enddoublecolumns \fi }{% @@ -5477,11 +5678,41 @@ might help (with 'rm \jobname.?? \jobname.??s')% % should work because we (hopefully) don't otherwise use @ in index files. %\catcode`\@=12\relax \catcode`\@=0\relax + \ifxetex\xetexpreauxfile\fi \input \jobname.\indexname s + \ifxetex\xetexpostauxfile\fi \enddoublecolumns }% } +\def\indexentry#1#2{% + \let\entrypagetarget\empty + \ifflagclear{txilinkindextext}{}{% + \ifpdforxetex + % link the index text to the page if no comma appears in the + % list of pages, i.e. there is only one page + \checkpagelistcomma{#2}\pagelistcomma + \expandafter\ifcase\pagelistcomma + \def\entrypagetarget{#2}% + \fi + \fi% + }% + \entryinternal{#1}{#2}% +} + +\def\checkpagelistcomma#1#2{% + \checkpagelistcommaxx#2#1,\finish +} +\def\checkpagelistcommaxx#1#2,#3\finish{% + \def\tmp{#3}% + \ifx\tmp\empty + \def#1{0\relax} + \else + \def#1{1\relax} + \fi +} + + % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. @@ -5518,7 +5749,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\initial{% \bgroup - \initialglyphs \initialx } @@ -5541,7 +5771,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus 1\baselineskip - \leftline{\secfonts \kern-0.05em \secbf #1}% + \doindexinitialentry{#1}% + \initialglyphs + \leftline{% + \secfonts \kern-0.05em \secbf #1}% % \secfonts is inside the argument of \leftline so that the change of % \baselineskip will not affect any glue inserted before the vbox that % \leftline creates. @@ -5551,6 +5784,29 @@ might help (with 'rm \jobname.?? \jobname.??s')% \egroup % \initialglyphs } +\def\doindexinitialentry#1{% + \ifpdforxetex + \global\advance\idxinitialno by 1 + \def\indexlbrace{\{}% + \def\indexrbrace{\}}% + \def\indexbackslash{\realbackslash}% + \def\indexatchar{\@}% + \writetocentry{idxinitial}{\asis #1\empty}{IDX\the\idxinitialno}% + % The @asis removes a pair of braces around e.g. {@indexatchar} that + % are output by texindex. \empty is an argument to \asis in case #1 + % is empty. + % + \pdfmkdest{idx.\asis #1.IDX\the\idxinitialno}% + \fi +} + +% No listing in TOC +\def\idxinitialentry#1#2#3#4{} + +% For index initials. +\newcount\idxinitialno \idxinitialno=1 + + \newdimen\entryrightmargin \entryrightmargin=0pt @@ -5559,16 +5815,18 @@ might help (with 'rm \jobname.?? \jobname.??s')% \newdimen\entrycontskip \entrycontskip=1em -% for PDF output, whether to make the text of the entry a link to the page -% number. set for @contents and @shortcontents where there is only one -% page number. +% for PDF output, whether to make the text of the entry a link to the section. +% set for @contents and @shortcontents. \newif\iflinkentrytext -% \entry typesets a paragraph consisting of the text (#1), dot leaders, and -% then page number (#2) flushed to the right margin. It is used for index -% and table of contents entries. The paragraph is indented by \leftskip. -% -\def\entry{% +% \entryinternal typesets a paragraph consisting of the text (#1), dot +% leaders, and then page number (#2) flushed to the right margin. It is +% used for index and table of contents entries. The paragraph is indented +% by \leftskip. +% For PDF output, if \linkentrytexttrue and \tocnodetarget is set, link text +% to the referenced node. Else if \entrypagetarget is set, link text to the +% page. +\def\entryinternal{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't @@ -5578,10 +5836,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% % No extra space above this paragraph. \parskip = 0in % - % When reading the text of entry, convert explicit line breaks - % from @* into spaces. The user might give these in long section - % titles, for instance. - \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% An undocumented command % % Swallow the left brace of the text (first parameter): @@ -5608,9 +5862,19 @@ might help (with 'rm \jobname.?? \jobname.??s')% \global\setbox\boxA=\hbox\bgroup \ifpdforxetex \iflinkentrytext - \pdflinkpage{#1}{\unhbox\boxA}% + \ifx\tocnodetarget\empty + \unhbox\boxA + \else + \startxreflink{\tocnodetarget}{}% + \unhbox\boxA + \endlink + \fi \else - \unhbox\boxA + \ifx\entrypagetarget\empty + \unhbox\boxA + \else + \pdflinkpage{\entrypagetarget}{\unhbox\boxA}% + \fi \fi \else \unhbox\boxA @@ -5625,11 +5889,18 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \null\nobreak\indexdotfill % Have leaders before the page number. % + \hskip\skip\thinshrinkable \ifpdforxetex - \pdfgettoks#1.% - \hskip\skip\thinshrinkable\the\toksA + \ifx\tocnodetarget\empty + \pdfgettoks#1.% + \the\toksA + \else + % Should just be a single page number in toc + \startxreflink{\tocnodetarget}{}% + #1\endlink + \fi \else - \hskip\skip\thinshrinkable #1% + #1% \fi \fi \egroup % end \boxA @@ -5925,10 +6196,17 @@ might help (with 'rm \jobname.?? \jobname.??s')% % and \thissection, as is done in \startcontents. \let\pchapsepmacro\relax \chapmacro{}{Yomitfromtoc}{}% + \gdef\thispart{#1}% \chapoddpage \endgroup } +% Name of current part, if any. +% Note: unlike @thischapter etc. defined below, the name of the part +% is always set before a page with a heading or footing is shipped out, +% so there is no need to keep the value of these in "marks". +\def\thispart{}% + % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter @@ -6275,6 +6553,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} +% @xrefname - give text with printed name for linking to node and allow +% referencing node, but do not print any heading. +\parseargdef\xrefname{\donoderef{Yomitfromtoc}{#1}}% + % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. @@ -6396,11 +6678,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \chapfonts \rm \let\footnote=\errfootnoteheading % give better error message % - % Have to define \currentsection before calling \donoderef, because the - % xref code eventually uses it. On the other hand, it has to be called - % after \pchapsepmacro, or the headline will change too soon. - \gdef\currentsection{#1}% - % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword @@ -6427,7 +6704,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. - \donoderef{#2}% + \donoderef{#2}{#1}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. @@ -6543,21 +6820,17 @@ might help (with 'rm \jobname.?? \jobname.??s')% \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% - \gdef\currentsection{#1}% \else\ifx\temptype\Yomitfromtockeyword - % for @headings -- no section number, don't include in toc, - % and don't redefine \currentsection. + % for @headings -- no section number, don't include in toc. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% - \gdef\currentsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% - \gdef\currentsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. @@ -6565,7 +6838,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. - \donoderef{#3}% + \donoderef{#3}{#1}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be @@ -6759,12 +7032,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Prepare to read what we've written to \tocfile. % -\def\startcontents#1{% +\def\startcontents#1#2{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. \contentsalignmacro \immediate\closeout\tocfile % + #2% % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% @@ -6784,7 +7058,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \raggedbottom in plain.tex hardcodes \topskip so override it \catcode`\@=11 -\def\raggedbottom{\advance\topskip by 0pt plus60pt \r@ggedbottomtrue} +\def\raggedbottom{\advance\topskip by 0pt plus30pt \r@ggedbottomtrue} \catcode`\@=\other % redefined for the two-volume lispref. We always output on @@ -6795,7 +7069,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Normal (long) toc. % \def\contents{% - \startcontents{\putwordTOC}% + \startcontents{\putwordTOC}{\contentsmkdest}% + \ifxetex\xetexpreauxfile\fi + \penalty2 % mark beginning of contents \openin 1 \tocreadfilename\space \ifeof 1 \else \findsecnowidths @@ -6807,13 +7083,18 @@ might help (with 'rm \jobname.?? \jobname.??s')% \pdfmakeoutlines \fi \closein 1 + \ifxetex\xetexpostauxfile\fi \endgroup \contentsendroman } +\def\contentsmkdest{% + \pdfmkdest{txi.CONTENTS}% +} + % And just the chapters. \def\summarycontents{% - \startcontents{\putwordShortTOC}% + \startcontents{\putwordShortTOC}{}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry @@ -6836,11 +7117,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry + \ifxetex\xetexpreauxfile\fi \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 + \ifxetex\xetexpostauxfile\fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup @@ -6881,36 +7164,45 @@ might help (with 'rm \jobname.?? \jobname.??s')% % #3 - level of section (e.g "chap", "sec") % #4 - page number -% Parts, in the main contents. Replace the part number, which doesn't -% exist, with an empty box. Let's hope all the numbers have the same width. -% Also ignore the page number, which is conventionally not printed. -\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} +% Parts, in the main contents. Ignore the page number, which is +% conventionally not printed. \def\partentry#1#2#3#4{% + \ifnum\lastpenalty = 2 + % use less space if at very first entry of contents + \vskip 1\baselineskip plus .33\baselineskip minus .25\baselineskip + \else + \vskip 2\baselineskip plus .66\baselineskip minus .5\baselineskip + \fi % Add stretch and a bonus for breaking the page before the part heading. % This reduces the chance of the page being broken immediately after the % part heading, before a following chapter heading. - \vskip 0pt plus 5\baselineskip + \vskip 0pt plus 3\baselineskip \penalty-300 - \vskip 0pt plus -5\baselineskip - \dochapentry{#1}{\numeralbox}{}% + \vskip 0pt plus -3\baselineskip + \begingroup + \secfonts \rm + \entryinternal{#1}{}% + \endgroup + \afterpartentrytrue } +\newif\ifafterpartentry % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip - \shortchapentry{{\bf #1}}{\numeralbox}{}{}% + \tocentry{{\bf #1}}{}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{% \retrievesecnowidth\secnowidthchap{#2}% - \dochapentry{#1}{#2}{#4}% + \dochapentry{#1}{#2}{#3}{#4}% } % Chapters, in the short toc. \def\shortchapentry#1#2#3#4{% - \tocentry{#1}{\shortchaplabel{#2}}{#4}% + \tocentry{#1}{\shortchaplabel{#2}}{#3}{#4}% } % Appendices, in the main contents. @@ -6923,79 +7215,83 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \def\appentry#1#2#3#4{% \retrievesecnowidth\secnowidthchap{#2}% - \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#4}% + \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#3}{#4}% } % Unnumbered chapters. -\def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#4}} -\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#4}} +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#3}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#3}{#4}} % Sections. -\def\numsecentry#1#2#3#4{\dosecentry{#1}{#2}{#4}} - \def\numsecentry#1#2#3#4{% \retrievesecnowidth\secnowidthsec{#2}% - \dosecentry{#1}{#2}{#4}% + \dosecentry{#1}{#2}{#3}{#4}% } \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{% \retrievesecnowidth\secnowidthsec{#2}% - \dosecentry{#1}{}{#4}% + \dosecentry{#1}{}{#3}{#4}% } % Subsections. \def\numsubsecentry#1#2#3#4{% \retrievesecnowidth\secnowidthssec{#2}% - \dosubsecentry{#1}{#2}{#4}% + \dosubsecentry{#1}{#2}{#3}{#4}% } \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{% \retrievesecnowidth\secnowidthssec{#2}% - \dosubsecentry{#1}{}{#4}% + \dosubsecentry{#1}{}{#3}{#4}% } % And subsubsections. -\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#4}} +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#3}{#4}} \let\appsubsubsecentry=\numsubsubsecentry -\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#4}} +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#3}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text, #2 is -% a section number if present, and #3 is the page number. +% a section number if present, #3 is the node, and #4 is the page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. -\def\dochapentry#1#2#3{% - \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip +\def\dochapentry#1#2#3#4{% + \ifafterpartentry + \afterpartentryfalse + \penalty5000 + \else + \penalty-300 + \fi + \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup % Move the page numbers slightly to the right \advance\entryrightmargin by -0.05em \chapentryfonts \extrasecnoskip=0.4em % separate chapter number more - \tocentry{#1}{#2}{#3}% + \tocentry{#1}{#2}{#3}{#4}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } -\def\dosecentry#1#2#3{\begingroup +\def\dosecentry#1#2#3#4{\begingroup \secnowidth=\secnowidthchap \secentryfonts \leftskip=\tocindent - \tocentry{#1}{#2}{#3}% + \tocentry{#1}{#2}{#3}{#4}% \endgroup} -\def\dosubsecentry#1#2#3{\begingroup +\def\dosubsecentry#1#2#3#4{\begingroup \secnowidth=\secnowidthsec \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{#2}{#3}% + \tocentry{#1}{#2}{#3}{#4}% \endgroup} -\def\dosubsubsecentry#1#2#3{\begingroup +\def\dosubsubsecentry#1#2#3#4{\begingroup \secnowidth=\secnowidthssec \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{#2}{#3}% + \tocentry{#1}{#2}{#3}{#4}% \endgroup} % Used for the maximum width of a section number so we can align @@ -7005,12 +7301,16 @@ might help (with 'rm \jobname.?? \jobname.??s')% \newdimen\extrasecnoskip \extrasecnoskip=0pt -% \tocentry{TITLE}{SEC NO}{PAGE} +\let\tocnodetarget\empty +\let\entrypagetarget\empty + +% \tocentry{TITLE}{SEC NO}{NODE}{PAGE} % -\def\tocentry#1#2#3{% +\def\tocentry#1#2#3#4{% + \def\tocnodetarget{#3}% \def\secno{#2}% \ifx\empty\secno - \entry{#1}{#3}% + \entryinternal{#1}{#4}% \else \ifdim 0pt=\secnowidth \setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}% @@ -7021,7 +7321,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% #2\hskip\labelspace\hskip\extrasecnoskip\hfill}% \fi \entrycontskip=\wd0 - \entry{\box0 #1}{#3}% + \entryinternal{\box0 #1}{#4}% \fi } \newdimen\labelspace @@ -7594,6 +7894,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% {\catcode`\ =\other \gdef\docopying#1@end copying{\endgroup\def\copyingtext{#1}} } +\let\copyingtext\relax \def\insertcopying{% \begingroup @@ -7602,6 +7903,18 @@ might help (with 'rm \jobname.?? \jobname.??s')% \endgroup } +\def\publication{\checkenv{}\begingroup\macrobodyctxt\dopublication} +{\catcode`\ =\other +\gdef\dopublication#1@end publication{\endgroup\def\publicationtext{#1}} +} +\let\publicationtext\relax + +\def\insertpublication{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\publicationtext + \endgroup +} \message{defuns,} % @defun etc. @@ -7901,7 +8214,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% {\rm\enskip}% hskip 0.5 em of \rmfont }{}% % - \boldbrax + \parenbrackglyphs % arguments will be output next, if any. } @@ -7911,7 +8224,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\^^M{}% for line continuation \df \ifdoingtypefn \tt \else \sl \fi \ifflagclear{txicodevaristt}{}% - {\def\var##1{{\setregularquotes \ttsl ##1}}}% + % use \ttsl for @var in both @def* and @deftype*. + % the kern prevents an italic correction at end, which appears + % too much for ttsl. + {\def\var##1{{\setregularquotes \ttsl ##1\kern 0pt }}}% #1% \egroup } @@ -7928,8 +8244,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, -% if the fn name has parens in it, \boldbrax will not be in effect yet, -% so TeX would otherwise complain about undefined control sequence. +% if the fn name has parens in it, \parenbrackglyphs will not be in +% effect yet, so TeX would otherwise complain about undefined control +% sequence. { \activeparens \gdef\defcharsdefault{% @@ -7939,49 +8256,28 @@ might help (with 'rm \jobname.?? \jobname.??s')% } \globaldefs=1 \defcharsdefault - \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\parenbrackglyphs{\let(=\opnr\let)=\cpnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \let\ampchar\& -\newcount\parencount - -% If we encounter &foo, then turn on ()-hacking afterwards -\newif\ifampseen -\def\amprm#1 {\ampseentrue{\rm\ }} - -\def\parenfont{% - \ifampseen - % At the first level, print parens in roman, - % otherwise use the default font. - \ifnum \parencount=1 \rm \fi - \else - % The \sf parens (in \boldbrax) actually are a little bolder than - % the contained text. This is especially needed for [ and ] . - \sf - \fi -} -\def\infirstlevel#1{% - \ifampseen - \ifnum\parencount=1 - #1% - \fi - \fi -} -\def\bfafterword#1 {#1 \bf} +\def\amprm#1 {{\rm\ }} +\newcount\parencount +% opening and closing parentheses in roman font \def\opnr{% + \ptexslash % italic correction \global\advance\parencount by 1 - {\parenfont(}% - \infirstlevel \bfafterword + {\sf(}% } -\def\clnr{% - {\parenfont)}% - \infirstlevel \sl +\def\cpnr{% + \ptexslash % italic correction + {\sf)}% \global\advance\parencount by -1 } \newcount\brackcount +% left and right square brackets in bold font \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% @@ -8023,18 +8319,11 @@ might help (with 'rm \jobname.?? \jobname.??s')% } \fi -\let\E=\expandafter - % Used at the time of macro expansion. % Argument is macro body with arguments substituted \def\scanmacro#1{% \newlinechar`\^^M - % expand the expansion of \eatleadingcr twice to maybe remove a leading - % newline (and \else and \fi tokens), then call \eatspaces on the result. - \def\xeatspaces##1{% - \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1% - }}% - \def\xempty##1{}% + \def\xeatspaces##1{\eatleadingcrthen\eatspaces{##1}}% % % Process the macro body under the current catcode regime. \scantokens{#1@comment}% @@ -8087,10 +8376,12 @@ might help (with 'rm \jobname.?? \jobname.??s')% \unbrace{\gdef\trim@@@ #1 } #2@{#1} } -{\catcode`\^^M=\other% -\gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}% -% Warning: this won't work for a delimited argument -% or for an empty argument +% Trim a single leading ^^M off a string, then call #1 +{\catcode`\^^M=\active \catcode`\Q=3% +\gdef\eatleadingcrthen #1#2{\eatlcra #1Q#2Q^^MQ}% +\gdef\eatlcra #1#2Q^^M{\eatlcrb #1#2Q}% +\gdef\eatlcrb #1Q#2Q#3Q{#1{#2}}% +} % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% @@ -8226,6 +8517,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. +% Make @ a letter, so that we can make private-to-Texinfo macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + % Parse the optional {params} list to @macro or @rmacro. % Set \paramno to the number of arguments, % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a @@ -8238,14 +8533,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% % That gets used by \mbodybackslash (above). % % If there are 10 or more arguments, a different technique is used: see -% \parsemmanyargdef. +% \parsemmanyargdef@@. % \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax % \hash is redefined to `#' later to get it into definitions \let\xeatspaces\relax - \let\xempty\relax \parsemargdefxxx#1,;,% \ifnum\paramno<10\relax\else \paramno0\relax @@ -8257,11 +8551,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname - {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}% + {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} -% the \xempty{} is to give \eatleadingcr an argument in the case of an -% empty macro argument. % \parsemacbody, \parsermacbody % @@ -8272,14 +8564,12 @@ might help (with 'rm \jobname.?? \jobname.??s')% % body to be transformed. % Set \macrobody to the body of the macro, and call \macrodef. % +\catcode `\@\texiatcatcode {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% \xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}% {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% \xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}% - -% Make @ a letter, so that we can make private-to-Texinfo macro names. -\edef\texiatcatcode{\the\catcode`\@} -\catcode `@=11\relax +\catcode `\@=11\relax %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% @@ -8511,7 +8801,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \expandafter\xdef\csname\the\macname\endcsname{% \begingroup \noexpand\spaceisspace - \noexpand\endlineisspace + \noexpand\ignoreactivenewline \noexpand\expandafter % skip any whitespace after the macro name. \expandafter\noexpand\csname\the\macname @@@\endcsname}% \expandafter\xdef\csname\the\macname @@@\endcsname{% @@ -8540,15 +8830,13 @@ might help (with 'rm \jobname.?? \jobname.??s')% \noexpand\expandafter \expandafter\noexpand\csname\the\macname @@\endcsname}% \expandafter\xdef\csname\the\macname @@\endcsname##1{% - \noexpand\passargtomacro - \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% \expandafter\xdef\csname\the\macname @@@\endcsname##1{% - \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname @@@@\endcsname\paramlist{% - \endgroup\noexpand\scanmacro{\macrobody}}% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% + \expandaftergroup{\expandafter\xdef\csname\the\macname @@@@\endcsname}% + \paramlist{% + \endgroup\noexpand\scanmacro{\macrobody}}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% @@ -8560,6 +8848,16 @@ might help (with 'rm \jobname.?? \jobname.??s')% \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes +% utility definition to avoid excessive use of \expandafter. call +% as \expandaftergroup{CONTENT}\WORD to expand \WORD exactly once and remove +% braces around CONTENT. +\def\expandaftergroup#1#2{% + \expandafter\expandaftergroupx\expandafter{#2}{#1}% +} +\def\expandaftergroupx#1#2{% + #2#1% +} + \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} @@ -8729,9 +9027,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% \expandafter\noexpand \csname\the\macname @@@\endcsname##1\noexpand\endlinemacro } - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter\csname\the\macname @@@\endcsname\paramlist{% + \expandaftergroup{\expandafter\xdef\csname\the\macname @@@\endcsname}% + \paramlist{% \newlinechar=13 % split \macrobody into lines \noexpand\scantokens{\macrobody}% } @@ -8806,14 +9103,19 @@ might help (with 'rm \jobname.?? \jobname.??s')% \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the -% type (Ynumbered, Yappendix, Ynothing). +% type (Ynumbered, Yappendix, Ynothing). #2 is the section title. % -\def\donoderef#1{% +\def\donoderef#1#2{% \ifx\lastnode\empty\else - \setref{\lastnode}{#1}% + \setref{\lastnode}{#1}{#2}% \global\let\lastnode=\empty + \setnodeseenonce \fi } +\def\setnodeseenonce{ + \global\nodeseentrue + \let\setnodeseenonce\relax +} % @nodedescription, @nodedescriptionblock - do nothing for TeX \parseargdef\nodedescription{} @@ -8826,21 +9128,28 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} -\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} - -% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an -% anchor), which consists of three parts: -% 1) NAME-title - the current sectioning name taken from \currentsection, -% or the anchor name. -% 2) NAME-snt - section number and type, passed as the SNT arg, or -% empty for anchors. +\def\anchor#1{% + \savesf \setref{#1}{Yanchor}{#1}\restoresf \ignorespaces +} + +% @namedanchor{NAME, XREFNAME} -- define xref target at arbitrary point +% with label text for cross-references to it. +\def\namedanchor#1{\donamedanchor#1\finish}% +\def\donamedanchor#1,#2\finish{% + \savesf \setref{#1}{Yanchor}{\ignorespaces #2\unskip}\restoresf \ignorespaces +} + +% \setref{NAME}{SNT}{TITLE} defines a cross-reference point NAME (a node +% or an anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name +% 2) NAME-snt - section number and type, passed as the SNT arg. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % -\def\setref#1#2{% +\def\setref#1#2#3{% \pdfmkdest{#1}% \iflinks {% @@ -8852,7 +9161,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% - \toks0 = \expandafter{\currentsection}% + \toks0 = {#3}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout @@ -8906,15 +9215,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \startxreflink{#1}{#4}% - {% - % Have to otherify everything special to allow the \csname to - % include an _ in the xref name, etc. - \indexnofonts - \turnoffactive - \def\value##1{##1}% - \expandafter\global\expandafter\let\expandafter\Xthisreftitle - \csname XR#1-title\endcsname - }% + \getrefx{#1-title}\Xthisreftitle % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". \iffloat distinguishes them by @@ -8947,21 +9248,23 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% - % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% - % \else % Reference within this manual. % - % Only output a following space if the -snt ref is nonempty, as the ref - % will be empty for @unnumbered and @anchor. - \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}% - \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + % Only output a following space if the -snt ref is nonempty, as is + % the case for @unnumbered and @anchor. + \getrefx{#1-snt}\tmp + \ifx\tmp\empty\else + \ifx\tmp\Yanchor\else + \tmp\space + \fi + \fi % % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname @@ -9017,7 +9320,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% - \fi% + \fi \fi \fi \fi @@ -9049,7 +9352,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfdestname}% \else - goto name{\pdfmkpgn{\pdfdestname}}% + goto name{\pdfdestname}% \fi \else % XeTeX \ifnum\filenamelength>0 @@ -9129,6 +9432,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \def\Ynothing{} \def\Yomitfromtoc{} +\def\Yanchor{\isanchor} \let\isanchor\relax \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno @@ -9155,14 +9459,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % \refx{NAME} - reference a cross-reference string named NAME. \def\refx#1{% - \requireauxfile - {% - \indexnofonts - \turnoffactive - \def\value##1{##1}% - \expandafter\global\expandafter\let\expandafter\thisrefX - \csname XR#1\endcsname - }% + \getrefx{#1}\thisrefX \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright @@ -9183,6 +9480,17 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi } +% Set #2 to xref string #1 +\def\getrefx#1#2{% + \requireauxfile + {% + \indexnofonts + \turnoffactive + \def\value##1{##1}% + \expandafter\global\expandafter\let\expandafter#2\csname XR#1\endcsname + }% +} + % This is the macro invoked by entries in the aux file. Define a control % sequence for a cross-reference target (we prepend XR to the control sequence % name to avoid collisions). The value is the page number. If this is a float @@ -9225,6 +9533,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi + \ignorespaces % ignore ends of line in aux file } % If working on a large document in chapters, it is convenient to @@ -9247,12 +9556,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% + \ifxetex\xetexpreauxfile\fi \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 + \ifxetex\xetexpostauxfile\fi } \def\setupdatafile{% @@ -9335,7 +9646,10 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \global\advance\footnoteno by \@ne - \edef\thisfootno{$^{\the\footnoteno}$}% + % + % Output for the footnote marker. If we are immediately after another + % footnote, output a comma and small space first. + \edef\thisfootno{$^{\ifnum\lastpenalty=3 ,\mskip 1mu \fi\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. @@ -9344,19 +9658,25 @@ might help (with 'rm \jobname.?? \jobname.??s')% % % Remove inadvertent blank space before typesetting the footnote number. \unskip - \thisfootno\@sf + % + % \scriptspace is 0.5pt by default and gives excessive space before the + % comma if we have multiple footnote markers in a row. + \bgroup\scriptspace=0pt + \thisfootno\@sf + \egroup \dofootnote }% -% Don't bother with the trickery in plain.tex to not require the -% footnote text as a parameter. Our footnotes don't need to be so general. -% -% Oh yes, they do; otherwise, @ifset (and anything else that uses -% \parseargline) fails inside footnotes because the tokens are fixed when -% the footnote is read. --karl, 16nov96. +% marker for immediately after a footnote marker +\gdef\footnoteendmarker{\penalty3 } + +% Do not require the footnote text as a parameter; otherwise, @ifset +% (and anything else that uses \parseargline) fails inside footnotes +% because the tokens are fixed when the footnote is read. % \gdef\dofootnote{% \insert\footins\bgroup + \aftergroup\footnoteendmarker % % Nested footnotes are not supported in TeX, that would take a lot % more work. (\startsavinginserts does not suffice.) @@ -9387,14 +9707,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% - \textindent{\thisfootno}% + \textindent{$^{\the\footnoteno}$}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % - % Invoke rest of plain TeX footnote routine. + % Eat opening brace and invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 @@ -9551,7 +9871,9 @@ might help (with 'rm \jobname.?? \jobname.??s')% % For pdfTeX and LuaTeX <= 0.80 \dopdfimage{#1}{#2}{#3}% \else - \ifx\XeTeXrevision\thisisundefined + \ifxetex + \doxeteximage{#1}{#2}{#3}% + \else % For epsf.tex % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}% @@ -9559,9 +9881,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% - \else - % For XeTeX - \doxeteximage{#1}{#2}{#3}% \fi \fi % @@ -9639,14 +9958,15 @@ might help (with 'rm \jobname.?? \jobname.??s')% \global\advance\floatno by 1 % {% - % This magic value for \currentsection is output by \setref as the - % XREFLABEL-title value. \xrefX uses it to distinguish float + % This magic value for the third argument of \setref is output as + % the XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % - \edef\currentsection{\floatmagic=\safefloattype}% - \setref{\floatlabel}{Yfloat}% + \edef\tmp{\noexpand\setref{\noexpand\floatlabel}{Yfloat}% + {\floatmagic=\safefloattype}}% + \tmp }% \fi % @@ -9768,7 +10088,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic -% \currentsection value which we \setref above. +% value which we passed to \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % @@ -9825,6 +10145,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. + \let\entry\entryinternal \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} @@ -9860,8 +10181,18 @@ might help (with 'rm \jobname.?? \jobname.??s')% \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% + \def\lang{#1}% + \def\enword{en}% + \ifx\lang\enword + % for English only, keep on going rather than issuing a fatal error + % message, as txi-en.tex likely doesn't contain any changes from the + % defaults. note that this is a problem if we already loaded another + % language file and want to switch back to English. + \message{Cannot read language file txi-#1.tex}% + \else + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \fi \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex @@ -9907,35 +10238,40 @@ directory should work if nowhere else does.} \newif\iftxinativeunicodecapable \newif\iftxiusebytewiseio -\ifx\XeTeXrevision\thisisundefined - \ifx\luatexversion\thisisundefined - \txinativeunicodecapablefalse - \txiusebytewiseiotrue - \else +\ifxetex + \txinativeunicodecapabletrue + \txiusebytewiseiofalse +\else + \ifluatex \txinativeunicodecapabletrue \txiusebytewiseiofalse + \else + \txinativeunicodecapablefalse + \txiusebytewiseiotrue \fi -\else - \txinativeunicodecapabletrue - \txiusebytewiseiofalse \fi +\let\xetexpreauxfile\relax +\let\xetexpostauxfile\relax + % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex % for non-UTF-8 (byte-wise) encodings. % \def\setbytewiseio{% - \ifx\XeTeXrevision\thisisundefined - \else - \XeTeXdefaultencoding "bytes" % For subsequent files to be read - \XeTeXinputencoding "bytes" % For document root file - % Unfortunately, there seems to be no corresponding XeTeX command for - % output encoding. This is a problem for auxiliary index and TOC files. - % The only solution would be perhaps to write out @U{...} sequences in - % place of non-ASCII characters. + \ifxetex + % For document root file + \XeTeXinputencoding "bytes" + % + % Setting for subsequent files to be read with @include. + \XeTeXdefaultencoding "bytes" + % + % Use UTF-8 for reading auxiliary index and TOC files, which are + % always output in UTF-8 with XeTeX. + \def\xetexpreauxfile{\XeTeXdefaultencoding "UTF-8"}% + \def\xetexpostauxfile{\XeTeXdefaultencoding "bytes"}% \fi - \ifx\luatexversion\thisisundefined - \else + \ifluatex \directlua{ local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub local function convert_char (char) @@ -10044,8 +10380,7 @@ directory should work if nowhere else does.} \fi % lattwo \fi % ascii % - \ifx\XeTeXrevision\thisisundefined - \else + \ifxetex \ifx \declaredencoding \utfeight \else \ifx \declaredencoding \ascii @@ -10100,7 +10435,7 @@ directory should work if nowhere else does.} \gdefchar^^af{\={}} % \gdefchar^^b0{\textdegree} - \gdefchar^^b1{$\pm$} + \gdefchar^^b1{\ensuremath\pm} \gdefchar^^b2{$^2$} \gdefchar^^b3{$^3$} \gdefchar^^b4{\'{}} @@ -10121,7 +10456,7 @@ directory should work if nowhere else does.} \gdefchar^^c2{\^A} \gdefchar^^c3{\~A} \gdefchar^^c4{\"A} - \gdefchar^^c5{\ringaccent A} + \gdefchar^^c5{\AA} \gdefchar^^c6{\AE} \gdefchar^^c7{\cedilla C} \gdefchar^^c8{\`E} @@ -10140,7 +10475,7 @@ directory should work if nowhere else does.} \gdefchar^^d4{\^O} \gdefchar^^d5{\~O} \gdefchar^^d6{\"O} - \gdefchar^^d7{$\times$} + \gdefchar^^d7{\ensuremath\times} \gdefchar^^d8{\O} \gdefchar^^d9{\`U} \gdefchar^^da{\'U} @@ -10155,7 +10490,7 @@ directory should work if nowhere else does.} \gdefchar^^e2{\^a} \gdefchar^^e3{\~a} \gdefchar^^e4{\"a} - \gdefchar^^e5{\ringaccent a} + \gdefchar^^e5{\aa} \gdefchar^^e6{\ae} \gdefchar^^e7{\cedilla c} \gdefchar^^e8{\`e} @@ -10174,7 +10509,7 @@ directory should work if nowhere else does.} \gdefchar^^f4{\^o} \gdefchar^^f5{\~o} \gdefchar^^f6{\"o} - \gdefchar^^f7{$\div$} + \gdefchar^^f7{\ensuremath\div} \gdefchar^^f8{\o} \gdefchar^^f9{\`u} \gdefchar^^fa{\'u} @@ -10260,7 +10595,7 @@ directory should work if nowhere else does.} \gdefchar^^d4{\^O} \gdefchar^^d5{\H O} \gdefchar^^d6{\"O} - \gdefchar^^d7{$\times$} + \gdefchar^^d7{\ensuremath\times} \gdefchar^^d8{\v R} \gdefchar^^d9{\ringaccent U} \gdefchar^^da{\'U} @@ -10294,7 +10629,7 @@ directory should work if nowhere else does.} \gdefchar^^f4{\^o} \gdefchar^^f5{\H o} \gdefchar^^f6{\"o} - \gdefchar^^f7{$\div$} + \gdefchar^^f7{\ensuremath\div} \gdefchar^^f8{\v r} \gdefchar^^f9{\ringaccent u} \gdefchar^^fa{\'u} @@ -10328,11 +10663,15 @@ directory should work if nowhere else does.} \gdef\UTFviiiDefined#1{% \ifx #1\relax - \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \ifutfviiidefinedwarning + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \fi \else \expandafter #1% \fi } +\newif\ifutfviiidefinedwarning +\utfviiidefinedwarningtrue % Give non-ASCII bytes the active definitions for processing UTF-8 sequences \begingroup @@ -10342,8 +10681,8 @@ directory should work if nowhere else does.} % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp % substituting ~ and $ with a character token of that value. - \def\UTFviiiLoop{% - \global\catcode\countUTFx\active + \gdef\UTFviiiLoop{% + \catcode\countUTFx\active \uccode`\~\countUTFx \uccode`\$\countUTFx \uppercase\expandafter{\UTFviiiTmp}% @@ -10351,7 +10690,7 @@ directory should work if nowhere else does.} \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} - + % % For bytes other than the first in a UTF-8 sequence. Not expected to % be expanded except when writing to auxiliary files. \countUTFx = "80 @@ -10385,6 +10724,16 @@ directory should work if nowhere else does.} \else\expandafter\UTFviiiFourOctets\expandafter$\fi }}% \UTFviiiLoop + % + % for pdftex only, used to expand ASCII to UTF-16BE. + \gdef\asciitounicode{% + \countUTFx = "20 + \countUTFy = "80 + \def\UTFviiiTmp{% + \def~{\nullbyte $}}% + \UTFviiiLoop + } + {\catcode0=11 \gdef\nullbyte{^^00}}% \endgroup \def\globallet{\global\let} % save some \expandafter's below @@ -10409,8 +10758,8 @@ directory should work if nowhere else does.} \fi } -% These macros are used here to construct the name of a control -% sequence to be defined. +% These macros are used here to construct the names of macros +% that expand to the definitions for UTF-8 sequences. \def\UTFviiiTwoOctetsName#1#2{% \csname u8:#1\string #2\endcsname}% \def\UTFviiiThreeOctetsName#1#2#3{% @@ -10418,6 +10767,35 @@ directory should work if nowhere else does.} \def\UTFviiiFourOctetsName#1#2#3#4{% \csname u8:#1\string #2\string #3\string #4\endcsname}% +% generate UTF-16 from codepoint +\def\utfsixteentotoks#1#2{% + \countUTFz = "#2\relax + \ifnum \countUTFz > 65535 + % doesn't work for codepoints > U+FFFF + % we don't define glyphs for any of these anyway, so it doesn't matter + #1={U+#2}% + \else + \countUTFx = \countUTFz + \divide\countUTFx by 256 + \countUTFy = \countUTFx + \multiply\countUTFx by 256 + \advance\countUTFz by -\countUTFx + \uccode`,=\countUTFy + \uccode`;=\countUTFz + \ifnum\countUTFy = 0 + \uppercase{#1={\nullbyte\string;}}% + \else\ifnum\countUTFz = 0 + \uppercase{#1={\string,\nullbyte}}% + \else + \uppercase{#1={\string,\string;}}% + \fi\fi + % NB \uppercase cannot insert a null byte + \fi +} + +\newif\ifutfbytespdf +\utfbytespdffalse + % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), % provide a definition macro to replace a Unicode character; % this gets used by the @U command @@ -10434,18 +10812,22 @@ directory should work if nowhere else does.} \countUTFz = "#1\relax \begingroup \parseXMLCharref - - % Give \u8:... its definition. The sequence of seven \expandafter's - % expands after the \gdef three times, e.g. % + % Completely expand \UTFviiiTmp, which looks like: % 1. \UTFviiTwoOctetsName B1 B2 % 2. \csname u8:B1 \string B2 \endcsname % 3. \u8: B1 B2 (a single control sequence token) + \xdef\UTFviiiTmp{\UTFviiiTmp}% % - \expandafter\expandafter - \expandafter\expandafter - \expandafter\expandafter - \expandafter\gdef \UTFviiiTmp{#2}% + \ifpdf + \toksA={#2}% + \utfsixteentotoks\toksB{#1}% + \expandafter\xdef\UTFviiiTmp{% + \noexpand\ifutfbytespdf\noexpand\utfbytes{\the\toksB}% + \noexpand\else\the\toksA\noexpand\fi}% + \else + \expandafter\gdef\UTFviiiTmp{#2}% + \fi % \expandafter\ifx\csname uni:#1\endcsname \relax \else \message{Internal error, already defined: #1}% @@ -10455,8 +10837,9 @@ directory should work if nowhere else does.} \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} % - % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp - % to the corresponding UTF-8 sequence. + % Given the value in \countUTFz as a Unicode code point, set + % \UTFviiiTmp to one of the \UTVviii*OctetsName macros followed by + % the corresponding UTF-8 sequence. \gdef\parseXMLCharref{% \ifnum\countUTFz < "20\relax \errhelp = \EMsimple @@ -10515,6 +10898,16 @@ directory should work if nowhere else does.} \catcode"#1=\other } +% Suppress ligature creation from adjacent characters. +\ifluatex + % Braces do not suppress ligature creation in LuaTeX, e.g. in of{}fice + % to suppress the "ff" ligature. Using a kern appears to be the only + % workaround. + \def\nolig{\kern0pt{}} +\else + \def\nolig{{}} +\fi + % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) @@ -11132,8 +11525,8 @@ directory should work if nowhere else does.} % Punctuation \DeclareUnicodeCharacter{2013}{--}% \DeclareUnicodeCharacter{2014}{---}% - \DeclareUnicodeCharacter{2018}{\quoteleft{}}% - \DeclareUnicodeCharacter{2019}{\quoteright{}}% + \DeclareUnicodeCharacter{2018}{\quoteleft\nolig}% + \DeclareUnicodeCharacter{2019}{\quoteright\nolig}% \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% \DeclareUnicodeCharacter{201D}{\quotedblright{}}% @@ -11168,7 +11561,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% % \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% - \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% + \DeclareUnicodeCharacter{2032}{\ensuremath{^\prime}}% \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% @@ -11291,6 +11684,25 @@ directory should work if nowhere else does.} % \global\mathchardef\checkmark="1370% actually the square root sign \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% + % + % These are all the combining accents. We need these empty definitions + % at present for the sake of PDF outlines. + \DeclareUnicodeCharacter{0300}{}% + \DeclareUnicodeCharacter{0301}{}% + \DeclareUnicodeCharacter{0302}{}% + \DeclareUnicodeCharacter{0303}{}% + \DeclareUnicodeCharacter{0305}{}% + \DeclareUnicodeCharacter{0306}{}% + \DeclareUnicodeCharacter{0307}{}% + \DeclareUnicodeCharacter{0308}{}% + \DeclareUnicodeCharacter{030A}{}% + \DeclareUnicodeCharacter{030B}{}% + \DeclareUnicodeCharacter{030C}{}% + \DeclareUnicodeCharacter{0323}{}% + \DeclareUnicodeCharacter{0327}{}% + \DeclareUnicodeCharacter{0328}{}% + \DeclareUnicodeCharacter{0331}{}% + \DeclareUnicodeCharacter{0361}{}% }% end of \unicodechardefs % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) @@ -11429,12 +11841,12 @@ directory should work if nowhere else does.} \pdfhorigin = 1 true in \pdfvorigin = 1 true in \else - \ifx\XeTeXrevision\thisisundefined - \special{papersize=#8,#7}% - \else + \ifxetex \pdfpageheight #7\relax \pdfpagewidth #8\relax % XeTeX does not have \pdfhorigin and \pdfvorigin. + \else + \special{papersize=#8,#7}% \fi \fi % @@ -11634,21 +12046,21 @@ directory should work if nowhere else does.} #1#2#3=\countB\relax } -\ifx\XeTeXrevision\thisisundefined - \ifx\luatexversion\thisisundefined +\ifxetex % XeTeX + \mtsetprotcode\textrm + \def\mtfontexpand#1{} +\else + \ifluatex % LuaTeX + \mtsetprotcode\textrm + \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax} + \else \ifpdf % pdfTeX \mtsetprotcode\textrm \def\mtfontexpand#1{\pdffontexpand#1 20 20 1 autoexpand\relax} \else % TeX \def\mtfontexpand#1{} \fi - \else % LuaTeX - \mtsetprotcode\textrm - \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax} \fi -\else % XeTeX - \mtsetprotcode\textrm - \def\mtfontexpand#1{} \fi @@ -11657,18 +12069,18 @@ directory should work if nowhere else does.} \def\microtypeON{% \microtypetrue % - \ifx\XeTeXrevision\thisisundefined - \ifx\luatexversion\thisisundefined + \ifxetex % XeTeX + \XeTeXprotrudechars=2 + \else + \ifluatex % LuaTeX + \adjustspacing=2 + \protrudechars=2 + \else \ifpdf % pdfTeX \pdfadjustspacing=2 \pdfprotrudechars=2 \fi - \else % LuaTeX - \adjustspacing=2 - \protrudechars=2 \fi - \else % XeTeX - \XeTeXprotrudechars=2 \fi % \mtfontexpand\textrm @@ -11679,18 +12091,18 @@ directory should work if nowhere else does.} \def\microtypeOFF{% \microtypefalse % - \ifx\XeTeXrevision\thisisundefined - \ifx\luatexversion\thisisundefined + \ifxetex % XeTeX + \XeTeXprotrudechars=0 + \else + \ifluatex % LuaTeX + \adjustspacing=0 + \protrudechars=0 + \else \ifpdf % pdfTeX \pdfadjustspacing=0 \pdfprotrudechars=0 \fi - \else % LuaTeX - \adjustspacing=0 - \protrudechars=0 \fi - \else % XeTeX - \XeTeXprotrudechars=0 \fi } diff --git a/build-aux/update-copyright b/build-aux/update-copyright index ea3e46fe6..b50bec9ac 100755 --- a/build-aux/update-copyright +++ b/build-aux/update-copyright @@ -3,7 +3,7 @@ # Update an FSF copyright year list to include the current year. -# Copyright (C) 2009-2024 Free Software Foundation, Inc. +# Copyright (C) 2009-2026 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ # Each file's copyright statement must be formatted correctly in # order to be recognized. For example, each of these is fine: # -# Copyright @copyright{} 1990-2005, 2007-2009 Free Software +# Copyright @copyright{} 1990-2005, 2007-2009, 2025-2026 Free Software # Foundation, Inc. # # # Copyright (C) 1990-2005, 2007-2009 Free Software @@ -138,7 +138,7 @@ eval 'exec perl -wSx -0777 -pi "$0" "$@"' if 0; -my $VERSION = '2024-01-15.18:30'; # UTC +my $VERSION = '2025-06-10.02:42'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook @@ -235,7 +235,7 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/cg) else { my $ndash = ($ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" - : $ARGV =~ /\.(\d[a-z]*|man)$/ ? "\\(en" + : $ARGV =~ /\.(\d[a-z]*|man)(\.in)?$/ && $ARGV !~ /ChangeLog\./ ? "\\(en" : "-"); $stmt =~ @@ -298,10 +298,10 @@ if (!$found) # coding: utf-8 # mode: perl # indent-tabs-mode: nil -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-line-limit: 200 # time-stamp-start: "my $VERSION = '" -# time-stamp-format: "%:y-%02m-%02d.%02H:%02M" +# time-stamp-format: "%Y-%02m-%02d.%02H:%02M" # time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free index ac9c89017..712b42fc1 100755 --- a/build-aux/useless-if-before-free +++ b/build-aux/useless-if-before-free @@ -4,7 +4,7 @@ # Detect instances of "if (p) free (p);". # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. -# Copyright (C) 2008-2024 Free Software Foundation, Inc. +# Copyright (C) 2008-2026 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ # # Written by Jim Meyering -# This is a prologue that allows to run a perl script as an executable +# This prologue allows running a perl script as an executable # on systems that are compliant to a POSIX version before POSIX:2017. # On such systems, the usual invocation of an executable through execlp() # or execvp() fails with ENOEXEC if it is a script that does not start @@ -36,13 +36,13 @@ eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2022-01-27 18:51'; # UTC +my $VERSION = '2025-06-10 02:42'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -my $copyright_year = '2022'; +(my $copyright_year = $VERSION) =~ s/^(\d*)-.*$/$1/; use strict; use warnings; @@ -98,6 +98,7 @@ and "kfree" calls in the linux kernel sources: git ls-files -z |xargs -0 $ME --name=kfree +Send patches and bug reports to . EOF } exit $exit_code; @@ -106,7 +107,7 @@ EOF sub is_NULL ($) { my ($expr) = @_; - return ($expr eq 'NULL' || $expr eq '0'); + return ($expr eq 'NULL' || $expr eq 'nullptr' || $expr eq '0'); } { @@ -211,7 +212,7 @@ free=xfree git grep -l -z "$free *(" \ | xargs -0 useless-if-before-free -l --name="$free" \ | xargs -0 perl -0x3b -pi -e \ - 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s' + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL|nullptr))?\s*\)\s+('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\)\s*;)/$2/s' # Use the following to remove redundant uses of kfree inside braces. # Note that -0777 puts perl in slurp-whole-file mode; @@ -220,7 +221,7 @@ free=kfree git grep -l -z "$free *(" \ | xargs -0 useless-if-before-free -l --name="$free" \ | xargs -0 perl -0777 -pi -e \ - 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms' + 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*(?:0|NULL|nullptr))?\s*\)\s*\{\s*('"$free"'\s*\((?:\s*\([^)]+\))?\s*\1\s*\);)\s*\}[^\n]*$/$2/gms' Be careful that the result of the above transformation is valid. If the matched string is followed by "else", then obviously, it won't be. @@ -231,10 +232,10 @@ EOF ## Local Variables: ## mode: perl ## indent-tabs-mode: nil -## eval: (add-hook 'before-save-hook 'time-stamp) +## eval: (add-hook 'before-save-hook 'time-stamp nil t) ## time-stamp-line-limit: 50 ## time-stamp-start: "my $VERSION = '" -## time-stamp-format: "%:y-%02m-%02d %02H:%02M" +## time-stamp-format: "%Y-%02m-%02d %02H:%02M" ## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files index 703657640..a6e5b9562 100755 --- a/build-aux/vc-list-files +++ b/build-aux/vc-list-files @@ -2,9 +2,9 @@ # List version-controlled file names. # Print a version string. -scriptversion=2018-03-07.03; # UTC +scriptversion=2025-06-10.02; # UTC -# Copyright (C) 2006-2024 Free Software Foundation, Inc. +# Copyright (C) 2006-2026 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -105,9 +105,9 @@ do done # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-format: "%Y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/doc/gendocs_template b/doc/gendocs_template index 277b1755d..327d5f039 100644 --- a/doc/gendocs_template +++ b/doc/gendocs_template @@ -2,7 +2,7 @@