guile-commonmark-0.1.2+20240812/ 0000755 0001750 0001750 00000000000 14656404356 015513 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/COPYING.LESSER 0000644 0001750 0001750 00000016743 13652433030 017537 0 ustar frankie frankie GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
guile-commonmark-0.1.2+20240812/Makefile.in 0000644 0001750 0001750 00000144050 14641033013 017542 0 ustar frankie frankie # Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/guile.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(srcdir)/doc/version.texi \
$(srcdir)/doc/stamp-vti $(nobase_dist_mod_DATA) \
$(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES = pre-inst-env scripts/gcmark
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DIST_SOURCES =
AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
am__v_DVIPS_0 = @echo " DVIPS " $@;
am__v_DVIPS_1 =
AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
am__v_MAKEINFO_1 =
AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
am__v_INFOHTML_0 = @echo " INFOHTML" $@;
am__v_INFOHTML_1 =
AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
am__v_TEXI2DVI_1 =
AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
am__v_TEXI2PDF_1 =
AM_V_texinfo = $(am__v_texinfo_@AM_V@)
am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
am__v_texinfo_0 = -q
am__v_texinfo_1 =
AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
am__v_texidevnull_0 = > /dev/null
am__v_texidevnull_1 =
am__dirstamp = $(am__leading_dot)dirstamp
INFO_DEPS = $(srcdir)/doc/guile-commonmark.info
TEXINFO_TEX = $(top_srcdir)/build-aux/texinfo.tex
am__TEXINFO_TEX_DIR = $(top_srcdir)/build-aux
DVIS = doc/guile-commonmark.dvi
PDFS = doc/guile-commonmark.pdf
PSS = doc/guile-commonmark.ps
HTMLS = doc/guile-commonmark.html
TEXINFOS = doc/guile-commonmark.texi
TEXI2DVI = texi2dvi
TEXI2PDF = $(TEXI2DVI) --pdf --batch
MAKEINFOHTML = $(MAKEINFO) --html
AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
DVIPS = dvips
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__installdirs = "$(DESTDIR)$(infodir)" "$(DESTDIR)$(moddir)" \
"$(DESTDIR)$(godir)"
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
DATA = $(nobase_dist_mod_DATA) $(nobase_go_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
AM_RECURSIVE_TARGETS = cscope check recheck
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
am__tty_colors = { \
$(am__tty_colors_dummy); \
if test "X$(AM_COLOR_TESTS)" = Xno; then \
am__color_tests=no; \
elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
am__color_tests=yes; \
elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
am__color_tests=yes; \
fi; \
if test $$am__color_tests = yes; then \
red='[0;31m'; \
grn='[0;32m'; \
lgn='[1;32m'; \
blu='[1;34m'; \
mgn='[0;35m'; \
brg='[1m'; \
std='[m'; \
fi; \
}
am__recheck_rx = ^[ ]*:recheck:[ ]*
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
# A command that, given a newline-separated list of test names on the
# standard input, print the name of the tests that are to be re-run
# upon "make recheck".
am__list_recheck_tests = $(AWK) '{ \
recheck = 1; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
{ \
if ((getline line2 < ($$0 ".log")) < 0) \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
{ \
recheck = 0; \
break; \
} \
else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
{ \
break; \
} \
}; \
if (recheck) \
print $$0; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# A command that, given a newline-separated list of test names on the
# standard input, create the global log from their .trs and .log files.
am__create_global_log = $(AWK) ' \
function fatal(msg) \
{ \
print "fatal: making $@: " msg | "cat >&2"; \
exit 1; \
} \
function rst_section(header) \
{ \
print header; \
len = length(header); \
for (i = 1; i <= len; i = i + 1) \
printf "="; \
printf "\n\n"; \
} \
{ \
copy_in_global_log = 1; \
global_test_result = "RUN"; \
while ((rc = (getline line < ($$0 ".trs"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".trs"); \
if (line ~ /$(am__global_test_result_rx)/) \
{ \
sub("$(am__global_test_result_rx)", "", line); \
sub("[ ]*$$", "", line); \
global_test_result = line; \
} \
else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
copy_in_global_log = 0; \
}; \
if (copy_in_global_log) \
{ \
rst_section(global_test_result ": " $$0); \
while ((rc = (getline line < ($$0 ".log"))) != 0) \
{ \
if (rc < 0) \
fatal("failed to read from " $$0 ".log"); \
print line; \
}; \
printf "\n"; \
}; \
close ($$0 ".trs"); \
close ($$0 ".log"); \
}'
# Restructured Text title.
am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
# Solaris 10 'make', and several other traditional 'make' implementations,
# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
# by disabling -e (using the XSI extension "set +e") if it's set.
am__sh_e_setup = case $$- in *e*) set +e;; esac
# Default flags passed to test drivers.
am__common_driver_flags = \
--color-tests "$$am__color_tests" \
--enable-hard-errors "$$am__enable_hard_errors" \
--expect-failure "$$am__expect_failure"
# To be inserted before the command running the test. Creates the
# directory for the log if needed. Stores in $dir the directory
# containing $f, in $tst the test, in $log the log. Executes the
# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
# will run the test scripts (or their associated LOG_COMPILER, if
# thy have one).
am__check_pre = \
$(am__sh_e_setup); \
$(am__vpath_adj_setup) $(am__vpath_adj) \
$(am__tty_colors); \
srcdir=$(srcdir); export srcdir; \
case "$@" in \
*/*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
*) am__odir=.;; \
esac; \
test "x$$am__odir" = x"." || test -d "$$am__odir" \
|| $(MKDIR_P) "$$am__odir" || exit $$?; \
if test -f "./$$f"; then dir=./; \
elif test -f "$$f"; then dir=; \
else dir="$(srcdir)/"; fi; \
tst=$$dir$$f; log='$@'; \
if test -n '$(DISABLE_HARD_ERRORS)'; then \
am__enable_hard_errors=no; \
else \
am__enable_hard_errors=yes; \
fi; \
case " $(XFAIL_TESTS) " in \
*[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
am__expect_failure=yes;; \
*) \
am__expect_failure=no;; \
esac; \
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
# A shell command to get the names of the tests scripts with any registered
# extension removed (i.e., equivalently, the names of the test logs, with
# the '.log' extension removed). The result is saved in the shell variable
# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
# since that might cause problem with VPATH rewrites for suffix-less tests.
# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
am__set_TESTS_bases = \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
TEST_SUITE_LOG = test-suite.log
am__test_logs1 = $(TESTS:=.log)
TEST_LOGS = $(am__test_logs1:.scm.log=.log)
SCM_LOG_COMPILE = $(SCM_LOG_COMPILER) $(AM_SCM_LOG_FLAGS) \
$(SCM_LOG_FLAGS)
am__set_b = \
case '$@' in \
*/*) \
case '$*' in \
*/*) b='$*';; \
*) b=`echo '$@' | sed 's/\.log$$//'`; \
esac;; \
*) \
b='$*';; \
esac
am__DIST_COMMON = $(doc_guile_commonmark_TEXINFOS) \
$(srcdir)/Makefile.in $(srcdir)/guile.am \
$(srcdir)/pre-inst-env.in $(top_srcdir)/build-aux/install-sh \
$(top_srcdir)/build-aux/mdate-sh \
$(top_srcdir)/build-aux/missing \
$(top_srcdir)/build-aux/texinfo.tex $(top_srcdir)/doc/local.mk \
$(top_srcdir)/scripts/gcmark.in COPYING COPYING.LESSER NEWS \
README.md build-aux/install-sh build-aux/mdate-sh \
build-aux/missing build-aux/texinfo.tex
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
# Exists only to be overridden by the user if desired.
AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CSCOPE = @CSCOPE@
CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
ETAGS = @ETAGS@
GUILD = @GUILD@
GUILE = @GUILE@
GUILE_CONFIG = @GUILE_CONFIG@
GUILE_EFFECTIVE_VERSION = @GUILE_EFFECTIVE_VERSION@
GUILE_TOOLS = @GUILE_TOOLS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
am__leading_dot = @am__leading_dot@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
moddir = $(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)
godir = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
GOBJECTS = $(SOURCES:%.scm=%.go)
nobase_dist_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES)
nobase_go_DATA = $(GOBJECTS)
# Make sure source files are installed first, so that the mtime of
# installed compiled files is greater than that of installed source
# files. See
#
# for details.
guile_install_go_files = install-nobase_goDATA
CLEANFILES = $(GOBJECTS)
GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
SUFFIXES = .scm .go
SOURCES = \
commonmark/utils.scm \
commonmark/common.scm \
commonmark/parser.scm \
commonmark/entities.scm \
commonmark/node.scm \
commonmark/blocks.scm \
commonmark/inlines.scm \
commonmark/sxml.scm \
commonmark.scm
TESTS = \
tests/node.scm \
tests/tabs.scm \
tests/blocks/paragraphs.scm \
tests/blocks/atx-headings.scm \
tests/blocks/block-quotes.scm \
tests/blocks/code-blocks.scm \
tests/blocks/fenced-code.scm \
tests/blocks/link-reference-definitions.scm \
tests/blocks/list-items.scm \
tests/blocks/lists.scm \
tests/blocks/setext-headings.scm \
tests/blocks/thematic-breaks.scm \
tests/inlines/code-spans.scm \
tests/inlines/emphasis.scm \
tests/inlines/backslash-escape.scm \
tests/inlines/softbreak.scm \
tests/inlines/hardbreak.scm \
tests/inlines/links.scm \
tests/inlines/images.scm \
tests/inlines/autolinks.scm \
tests/inlines/entities.scm
TEST_EXTENSIONS = .scm
SCM_LOG_DRIVER = \
$(top_builddir)/pre-inst-env \
$(GUILE) --no-auto-compile -e main \
$(top_srcdir)/build-aux/test-driver.scm
AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
info_TEXINFOS = doc/guile-commonmark.texi
doc_guile_commonmark_TEXINFOS = doc/fdl.texi
EXTRA_DIST = README.md \
pre-inst-env.in \
tests/utils.scm \
build-aux/test-driver.scm \
$(TESTS)
all: all-am
.SUFFIXES:
.SUFFIXES: .scm .go .dvi .log .ps .trs
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/guile.am $(top_srcdir)/doc/local.mk $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(srcdir)/guile.am $(top_srcdir)/doc/local.mk $(am__empty):
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
pre-inst-env: $(top_builddir)/config.status $(srcdir)/pre-inst-env.in
cd $(top_builddir) && $(SHELL) ./config.status $@
scripts/gcmark: $(top_builddir)/config.status $(top_srcdir)/scripts/gcmark.in
cd $(top_builddir) && $(SHELL) ./config.status $@
doc/$(am__dirstamp):
@$(MKDIR_P) doc
@: > doc/$(am__dirstamp)
$(srcdir)/doc/guile-commonmark.info: doc/guile-commonmark.texi $(srcdir)/doc/version.texi $(doc_guile_commonmark_TEXINFOS)
$(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
am__cwd=`pwd` && $(am__cd) $(srcdir) && \
rm -rf $$backupdir && mkdir $$backupdir && \
if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
done; \
else :; fi && \
cd "$$am__cwd"; \
if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
-o $@ $(srcdir)/doc/guile-commonmark.texi; \
then \
rc=0; \
$(am__cd) $(srcdir); \
else \
rc=$$?; \
$(am__cd) $(srcdir) && \
$$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
fi; \
rm -rf $$backupdir; exit $$rc
doc/guile-commonmark.dvi: doc/guile-commonmark.texi $(srcdir)/doc/version.texi $(doc_guile_commonmark_TEXINFOS) doc/$(am__dirstamp)
$(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
$(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
`test -f 'doc/guile-commonmark.texi' || echo '$(srcdir)/'`doc/guile-commonmark.texi
doc/guile-commonmark.pdf: doc/guile-commonmark.texi $(srcdir)/doc/version.texi $(doc_guile_commonmark_TEXINFOS) doc/$(am__dirstamp)
$(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc' \
$(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
`test -f 'doc/guile-commonmark.texi' || echo '$(srcdir)/'`doc/guile-commonmark.texi
doc/guile-commonmark.html: doc/guile-commonmark.texi $(srcdir)/doc/version.texi $(doc_guile_commonmark_TEXINFOS) doc/$(am__dirstamp)
$(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
$(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I doc -I $(srcdir)/doc \
-o $(@:.html=.htp) `test -f 'doc/guile-commonmark.texi' || echo '$(srcdir)/'`doc/guile-commonmark.texi; \
then \
rm -rf $@ && mv $(@:.html=.htp) $@; \
else \
rm -rf $(@:.html=.htp); exit 1; \
fi
$(srcdir)/doc/version.texi: $(srcdir)/doc/stamp-vti
$(srcdir)/doc/stamp-vti: doc/guile-commonmark.texi $(top_srcdir)/configure
@test -f doc/$(am__dirstamp) || $(MAKE) $(AM_MAKEFLAGS) doc/$(am__dirstamp)
@(dir=.; test -f ./doc/guile-commonmark.texi || dir=$(srcdir); \
set `$(SHELL) $(top_srcdir)/build-aux/mdate-sh $$dir/doc/guile-commonmark.texi`; \
echo "@set UPDATED $$1 $$2 $$3"; \
echo "@set UPDATED-MONTH $$2 $$3"; \
echo "@set EDITION $(VERSION)"; \
echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
(cmp -s vti.tmp$$$$ $(srcdir)/doc/version.texi \
|| (echo "Updating $(srcdir)/doc/version.texi" && \
cp vti.tmp$$$$ $(srcdir)/doc/version.texi.tmp$$$$ && \
mv $(srcdir)/doc/version.texi.tmp$$$$ $(srcdir)/doc/version.texi)) && \
rm -f vti.tmp$$$$ $(srcdir)/doc/version.texi.$$$$
@cp $(srcdir)/doc/version.texi $@
mostlyclean-vti:
-rm -f vti.tmp* $(srcdir)/doc/version.texi.tmp*
maintainer-clean-vti:
-rm -f $(srcdir)/doc/stamp-vti $(srcdir)/doc/version.texi
.dvi.ps:
$(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
$(DVIPS) $(AM_V_texinfo) -o $@ $<
uninstall-dvi-am:
@$(NORMAL_UNINSTALL)
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
rm -f "$(DESTDIR)$(dvidir)/$$f"; \
done
uninstall-html-am:
@$(NORMAL_UNINSTALL)
@list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
done
uninstall-info-am:
@$(PRE_UNINSTALL)
@if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
done; \
else :; fi
@$(NORMAL_UNINSTALL)
@list='$(INFO_DEPS)'; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
(if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
else :; fi); \
done
uninstall-pdf-am:
@$(NORMAL_UNINSTALL)
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
done
uninstall-ps-am:
@$(NORMAL_UNINSTALL)
@list='$(PSS)'; test -n "$(psdir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
rm -f "$(DESTDIR)$(psdir)/$$f"; \
done
dist-info: $(INFO_DEPS)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; \
for base in $$list; do \
case $$base in \
$(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$base; then d=.; else d=$(srcdir); fi; \
base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
if test -f $$file; then \
relfile=`expr "$$file" : "$$d/\(.*\)"`; \
test -f "$(distdir)/$$relfile" || \
cp -p $$file "$(distdir)/$$relfile"; \
else :; fi; \
done; \
done
mostlyclean-aminfo:
-rm -rf doc/guile-commonmark.t2d doc/guile-commonmark.t2p
clean-aminfo:
-test -z "doc/guile-commonmark.dvi doc/guile-commonmark.pdf \
doc/guile-commonmark.ps doc/guile-commonmark.html" \
|| rm -rf doc/guile-commonmark.dvi doc/guile-commonmark.pdf \
doc/guile-commonmark.ps doc/guile-commonmark.html
maintainer-clean-aminfo:
@list='$(INFO_DEPS)'; for i in $$list; do \
i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
install-nobase_dist_modDATA: $(nobase_dist_mod_DATA)
@$(NORMAL_INSTALL)
@list='$(nobase_dist_mod_DATA)'; test -n "$(moddir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(moddir)'"; \
$(MKDIR_P) "$(DESTDIR)$(moddir)" || exit 1; \
fi; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for file in $$files; do \
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(moddir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(moddir)/$$dir"; }; \
echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(moddir)/$$dir'"; \
$(INSTALL_DATA) $$xfiles "$(DESTDIR)$(moddir)/$$dir" || exit $$?; }; \
done
uninstall-nobase_dist_modDATA:
@$(NORMAL_UNINSTALL)
@list='$(nobase_dist_mod_DATA)'; test -n "$(moddir)" || list=; \
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(moddir)'; $(am__uninstall_files_from_dir)
install-nobase_goDATA: $(nobase_go_DATA)
@$(NORMAL_INSTALL)
@list='$(nobase_go_DATA)'; test -n "$(godir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(godir)'"; \
$(MKDIR_P) "$(DESTDIR)$(godir)" || exit 1; \
fi; \
$(am__nobase_list) | while read dir files; do \
xfiles=; for file in $$files; do \
if test -f "$$file"; then xfiles="$$xfiles $$file"; \
else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \
test -z "$$xfiles" || { \
test "x$$dir" = x. || { \
echo " $(MKDIR_P) '$(DESTDIR)$(godir)/$$dir'"; \
$(MKDIR_P) "$(DESTDIR)$(godir)/$$dir"; }; \
echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(godir)/$$dir'"; \
$(INSTALL_DATA) $$xfiles "$(DESTDIR)$(godir)/$$dir" || exit $$?; }; \
done
uninstall-nobase_goDATA:
@$(NORMAL_UNINSTALL)
@list='$(nobase_go_DATA)'; test -n "$(godir)" || list=; \
$(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \
dir='$(DESTDIR)$(godir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
# Recover from deleted '.trs' file; this should ensure that
# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
# to avoid problems with "make -n".
.log.trs:
rm -f $< $@
$(MAKE) $(AM_MAKEFLAGS) $<
# Leading 'am--fnord' is there to ensure the list of targets does not
# expand to empty, as could happen e.g. with make check TESTS=''.
am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
am--force-recheck:
@:
$(TEST_SUITE_LOG): $(TEST_LOGS)
@$(am__set_TESTS_bases); \
am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
redo_bases=`for i in $$bases; do \
am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
done`; \
if test -n "$$redo_bases"; then \
redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
if $(am__make_dryrun); then :; else \
rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
fi; \
fi; \
if test -n "$$am__remaking_logs"; then \
echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
"recursion detected" >&2; \
elif test -n "$$redo_logs"; then \
am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
fi; \
if $(am__make_dryrun); then :; else \
st=0; \
errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
for i in $$redo_bases; do \
test -f $$i.trs && test -r $$i.trs \
|| { echo "$$errmsg $$i.trs" >&2; st=1; }; \
test -f $$i.log && test -r $$i.log \
|| { echo "$$errmsg $$i.log" >&2; st=1; }; \
done; \
test $$st -eq 0 || exit 1; \
fi
@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
ws='[ ]'; \
results=`for b in $$bases; do echo $$b.trs; done`; \
test -n "$$results" || results=/dev/null; \
all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
if test `expr $$fail + $$xpass + $$error` -eq 0; then \
success=true; \
else \
success=false; \
fi; \
br='==================='; br=$$br$$br$$br$$br; \
result_count () \
{ \
if test x"$$1" = x"--maybe-color"; then \
maybe_colorize=yes; \
elif test x"$$1" = x"--no-color"; then \
maybe_colorize=no; \
else \
echo "$@: invalid 'result_count' usage" >&2; exit 4; \
fi; \
shift; \
desc=$$1 count=$$2; \
if test $$maybe_colorize = yes && test $$count -gt 0; then \
color_start=$$3 color_end=$$std; \
else \
color_start= color_end=; \
fi; \
echo "$${color_start}# $$desc $$count$${color_end}"; \
}; \
create_testsuite_report () \
{ \
result_count $$1 "TOTAL:" $$all "$$brg"; \
result_count $$1 "PASS: " $$pass "$$grn"; \
result_count $$1 "SKIP: " $$skip "$$blu"; \
result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
result_count $$1 "FAIL: " $$fail "$$red"; \
result_count $$1 "XPASS:" $$xpass "$$red"; \
result_count $$1 "ERROR:" $$error "$$mgn"; \
}; \
{ \
echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
$(am__rst_title); \
create_testsuite_report --no-color; \
echo; \
echo ".. contents:: :depth: 2"; \
echo; \
for b in $$bases; do echo $$b; done \
| $(am__create_global_log); \
} >$(TEST_SUITE_LOG).tmp || exit 1; \
mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
if $$success; then \
col="$$grn"; \
else \
col="$$red"; \
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
if $$success; then :; else \
echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
if test -n "$(PACKAGE_BUGREPORT)"; then \
echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
fi; \
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
check-TESTS:
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
log_list=`for i in $$bases; do echo $$i.log; done`; \
trs_list=`for i in $$bases; do echo $$i.trs; done`; \
log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
exit $$?;
recheck: all
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@set +e; $(am__set_TESTS_bases); \
bases=`for i in $$bases; do echo $$i; done \
| $(am__list_recheck_tests)` || exit 1; \
log_list=`for i in $$bases; do echo $$i.log; done`; \
log_list=`echo $$log_list`; \
$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
am__force_recheck=am--force-recheck \
TEST_LOGS="$$log_list"; \
exit $$?
.scm.log:
@p='$<'; \
$(am__set_b); \
$(am__check_pre) $(SCM_LOG_DRIVER) --test-name "$$f" \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_SCM_LOG_DRIVER_FLAGS) $(SCM_LOG_DRIVER_FLAGS) -- $(SCM_LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" distdir="$(distdir)" \
dist-info
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-zstd: distdir
tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
*.tar.zst*) \
zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist \
&& rm -rf $(DIST_ARCHIVES) \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
@if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(INFO_DEPS) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(infodir)" "$(DESTDIR)$(moddir)" "$(DESTDIR)$(godir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
-test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
-test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
-test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f doc/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-aminfo clean-generic mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-am
dvi-am: $(DVIS)
html: html-am
html-am: $(HTMLS)
info: info-am
info-am: $(INFO_DEPS)
install-data-am: install-info-am install-nobase_dist_modDATA \
install-nobase_goDATA
install-dvi: install-dvi-am
install-dvi-am: $(DVIS)
@$(NORMAL_INSTALL)
@list='$(DVIS)'; test -n "$(dvidir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
$(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
done
install-exec-am:
install-html: install-html-am
install-html-am: $(HTMLS)
@$(NORMAL_INSTALL)
@list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
$(am__strip_dir) \
d2=$$d$$p; \
if test -d "$$d2"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
$(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
$(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
else \
list2="$$list2 $$d2"; \
fi; \
done; \
test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
done; }
install-info: install-info-am
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
$(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
fi; \
for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
esac; \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
$$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
if test -f $$ifile; then \
echo "$$ifile"; \
else : ; fi; \
done; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
@$(POST_INSTALL)
@if $(am__can_run_installinfo); then \
list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
for file in $$list; do \
relfile=`echo "$$file" | sed 's|^.*/||'`; \
echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
done; \
else : ; fi
install-man:
install-pdf: install-pdf-am
install-pdf-am: $(PDFS)
@$(NORMAL_INSTALL)
@list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
install-ps: install-ps-am
install-ps-am: $(PSS)
@$(NORMAL_INSTALL)
@list='$(PSS)'; test -n "$(psdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-aminfo \
maintainer-clean-generic maintainer-clean-vti
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti
pdf: pdf-am
pdf-am: $(PDFS)
ps: ps-am
ps-am: $(PSS)
uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
uninstall-nobase_dist_modDATA uninstall-nobase_goDATA \
uninstall-pdf-am uninstall-ps-am
.MAKE: check-am install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \
check-am clean clean-aminfo clean-cscope clean-generic cscope \
cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
dist-gzip dist-info dist-lzip dist-shar dist-tarZ dist-xz \
dist-zip dist-zstd distcheck distclean distclean-generic \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man \
install-nobase_dist_modDATA install-nobase_goDATA install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-aminfo maintainer-clean-generic \
maintainer-clean-vti mostlyclean mostlyclean-aminfo \
mostlyclean-generic mostlyclean-vti pdf pdf-am ps ps-am \
recheck tags tags-am uninstall uninstall-am uninstall-dvi-am \
uninstall-html-am uninstall-info-am \
uninstall-nobase_dist_modDATA uninstall-nobase_goDATA \
uninstall-pdf-am uninstall-ps-am
.PRECIOUS: Makefile
$(guile_install_go_files): install-nobase_dist_modDATA
.scm.go:
$(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILD) compile $(GUILE_WARNINGS) -o "$@" "$<"
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
guile-commonmark-0.1.2+20240812/pre-inst-env.in 0000644 0001750 0001750 00000000650 13652433030 020355 0 ustar frankie frankie #!/bin/sh
abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`"
abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`"
GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
PATH="$abs_top_builddir:$PATH"
export PATH
exec "$@" guile-commonmark-0.1.2+20240812/build-aux/ 0000755 0001750 0001750 00000000000 14641033013 017363 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/build-aux/missing 0000755 0001750 0001750 00000015336 14641033013 020772 0 ustar frankie frankie #! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard , 1996.
# 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
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to ."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
guile-commonmark-0.1.2+20240812/build-aux/mdate-sh 0000755 0001750 0001750 00000013732 14641033013 021021 0 ustar frankie frankie #!/bin/sh
# Get modification time of a file or directory and pretty-print it.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1995-2021 Free Software Foundation, Inc.
# written by Ulrich Drepper , June 1995
#
# 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
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is maintained in Automake, please report
# bugs to or send patches to
# .
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
fi
case $1 in
'')
echo "$0: No file. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: mdate-sh [--help] [--version] FILE
Pretty-print the modification day of FILE, in the format:
1 January 1970
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "mdate-sh $scriptversion"
exit $?
;;
esac
error ()
{
echo "$0: $1" >&2
exit 1
}
# Prevent date giving response in another language.
LANG=C
export LANG
LC_ALL=C
export LC_ALL
LC_TIME=C
export LC_TIME
# Use UTC to get reproducible result.
TZ=UTC0
export TZ
# GNU ls changes its time format in response to the TIME_STYLE
# variable. Since we cannot assume 'unset' works, revert this
# variable to its documented default.
if test "${TIME_STYLE+set}" = set; then
TIME_STYLE=posix-long-iso
export TIME_STYLE
fi
save_arg1=$1
# Find out how to get the extended ls output of a file or directory.
if ls -L /dev/null 1>/dev/null 2>&1; then
ls_command='ls -L -l -d'
else
ls_command='ls -l -d'
fi
# Avoid user/group names that might have spaces, when possible.
if ls -n /dev/null 1>/dev/null 2>&1; then
ls_command="$ls_command -n"
fi
# A 'ls -l' line looks as follows on OS/2.
# drwxrwx--- 0 Aug 11 2001 foo
# This differs from Unix, which adds ownership information.
# drwxrwx--- 2 root root 4096 Aug 11 2001 foo
#
# To find the date, we split the line on spaces and iterate on words
# until we find a month. This cannot work with files whose owner is a
# user named "Jan", or "Feb", etc. However, it's unlikely that '/'
# will be owned by a user whose name is a month. So we first look at
# the extended ls output of the root directory to decide how many
# words should be skipped to get the date.
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
set x`$ls_command /`
# Find which argument is the month.
month=
command=
until test $month
do
test $# -gt 0 || error "failed parsing '$ls_command /' output"
shift
# Add another shift to the command.
command="$command shift;"
case $1 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
done
test -n "$month" || error "failed parsing '$ls_command /' output"
# Get the extended ls output of the file or directory.
set dummy x`eval "$ls_command \"\\\$save_arg1\""`
# Remove all preceding arguments
eval $command
# Because of the dummy argument above, month is in $2.
#
# On a POSIX system, we should have
#
# $# = 5
# $1 = file size
# $2 = month
# $3 = day
# $4 = year or time
# $5 = filename
#
# On Darwin 7.7.0 and 7.6.0, we have
#
# $# = 4
# $1 = day
# $2 = month
# $3 = year or time
# $4 = filename
# Get the month.
case $2 in
Jan) month=January; nummonth=1;;
Feb) month=February; nummonth=2;;
Mar) month=March; nummonth=3;;
Apr) month=April; nummonth=4;;
May) month=May; nummonth=5;;
Jun) month=June; nummonth=6;;
Jul) month=July; nummonth=7;;
Aug) month=August; nummonth=8;;
Sep) month=September; nummonth=9;;
Oct) month=October; nummonth=10;;
Nov) month=November; nummonth=11;;
Dec) month=December; nummonth=12;;
esac
case $3 in
???*) day=$1;;
*) day=$3; shift;;
esac
# Here we have to deal with the problem that the ls output gives either
# the time of day or the year.
case $3 in
*:*) set `date`; eval year=\$$#
case $2 in
Jan) nummonthtod=1;;
Feb) nummonthtod=2;;
Mar) nummonthtod=3;;
Apr) nummonthtod=4;;
May) nummonthtod=5;;
Jun) nummonthtod=6;;
Jul) nummonthtod=7;;
Aug) nummonthtod=8;;
Sep) nummonthtod=9;;
Oct) nummonthtod=10;;
Nov) nummonthtod=11;;
Dec) nummonthtod=12;;
esac
# For the first six month of the year the time notation can also
# be used for files modified in the last year.
if (expr $nummonth \> $nummonthtod) > /dev/null;
then
year=`expr $year - 1`
fi;;
*) year=$3;;
esac
# The result.
echo $day $month $year
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
guile-commonmark-0.1.2+20240812/build-aux/texinfo.tex 0000644 0001750 0001750 00001332726 14641033013 021577 0 ustar frankie frankie % texinfo.tex -- TeX macros to handle Texinfo files.
%
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2021-04-25.21}
%
% Copyright 1985, 1986, 1988, 1990-2021 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
% published by the Free Software Foundation, either version 3 of the
% License, or (at your option) any later version.
%
% This texinfo.tex file is distributed in the hope that it will be
% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see .
%
% As a special exception, when this file is read by TeX when processing
% a Texinfo source document, you may use the result without
% restriction. This Exception is an additional permission under section 7
% of the GNU General Public License, version 3 ("GPLv3").
%
% Please try the latest version of texinfo.tex before submitting bug
% reports; you can get the latest version from:
% https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
% https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
% https://www.gnu.org/software/texinfo/ (the Texinfo home page)
% The texinfo.tex in any given distribution could well be out
% of date, so if that's what you're using, please check.
%
% Send bug reports to bug-texinfo@gnu.org. Please include a
% complete document in each bug report with which we can reproduce the
% problem. Patches are, of course, greatly appreciated.
%
% To process a Texinfo manual with TeX, it's most reliable to use the
% texi2dvi shell script that comes with the distribution. For a simple
% manual foo.texi, however, you can get away with this:
% tex foo.texi
% texindex foo.??
% tex foo.texi
% tex foo.texi
% dvips foo.dvi -o # or whatever; this makes foo.ps.
% The extra TeX runs get the cross-reference information correct.
% Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary.
%
% It is possible to adapt texinfo.tex for other languages, to some
% extent. You can get the existing language-specific files from the
% full Texinfo distribution.
%
% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
\message{Loading texinfo [version \texinfoversion]:}
% If in a .fmt file, print the version number
% and turn on active characters that we couldn't do earlier because
% they might have appeared in the input file name.
\everyjob{\message{[Texinfo version \texinfoversion]}%
\catcode`+=\active \catcode`\_=\active}
% LaTeX's \typeout. This ensures that the messages it is used for
% are identical in format to the corresponding ones from latex/pdflatex.
\def\typeout{\immediate\write17}%
\chardef\other=12
% We never want plain's \outer definition of \+ in Texinfo.
% For @tex, we can use \tabalign.
\let\+ = \relax
% Save some plain tex macros whose names we will redefine.
\let\ptexb=\b
\let\ptexbullet=\bullet
\let\ptexc=\c
\let\ptexcomma=\,
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
\let\ptexequiv=\equiv
\let\ptexexclam=\!
\let\ptexfootnote=\footnote
\let\ptexgtr=>
\let\ptexhat=^
\let\ptexi=\i
\let\ptexindent=\indent
\let\ptexinsert=\insert
\let\ptexlbrace=\{
\let\ptexless=<
\let\ptexnewwrite\newwrite
\let\ptexnoindent=\noindent
\let\ptexplus=+
\let\ptexraggedright=\raggedright
\let\ptexrbrace=\}
\let\ptexslash=\/
\let\ptexsp=\sp
\let\ptexstar=\*
\let\ptexsup=\sup
\let\ptext=\t
\let\ptextop=\top
{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
% If this character appears in an error message or help string, it
% starts a new line in the output.
\newlinechar = `^^J
% Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything.
%
\ifx\inputlineno\thisisundefined
\let\linenumber = \empty % Pre-3.0.
\else
\def\linenumber{l.\the\inputlineno:\space}
\fi
% Set up fixed words for English if not already set.
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
\ifx\putworderror\undefined \gdef\putworderror{error}\fi
\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
\ifx\putwordin\undefined \gdef\putwordin{in}\fi
\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
\ifx\putwordof\undefined \gdef\putwordof{of}\fi
\ifx\putwordon\undefined \gdef\putwordon{on}\fi
\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
%
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
%
\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
% 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}
\chardef\dashChar = `\-
\chardef\slashChar = `\/
\chardef\underChar = `\_
% Ignore a token.
%
\def\gobble#1{}
% The following is used inside several \edef's.
\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
% Hyphenation fixes.
\hyphenation{
Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
ap-pen-dix bit-map bit-maps
data-base data-bases eshell fall-ing half-way long-est man-u-script
man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
spell-ing spell-ings
stand-alone strong-est time-stamp time-stamps which-ever white-space
wide-spread wrap-around
}
% Sometimes it is convenient to have everything in the transcript file
% and nothing on the terminal. We don't just call \tracingall here,
% since that produces some useless output on the terminal. We also make
% some effort to order the tracing commands to reduce output in the log
% file; cf. trace.sty in LaTeX.
%
\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
\def\loggingall{%
\tracingstats2
\tracingpages1
\tracinglostchars2 % 2 gives us more in etex
\tracingparagraphs1
\tracingoutput1
\tracingmacros2
\tracingrestores1
\showboxbreadth\maxdimen \showboxdepth\maxdimen
\ifx\eTeXversion\thisisundefined\else % etex gives us more logging
\tracingscantokens1
\tracingifs1
\tracinggroups1
\tracingnesting2
\tracingassigns1
\fi
\tracingcommands3 % 3 gives us more in etex
\errorcontextlines16
}%
% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
% aren't perfect, it's not the end of the world, being an error message,
% after all.
%
\def\errormsg{\begingroup \indexnofonts \doerrormsg}
\def\doerrormsg#1{\errmessage{#1}}
% add check for \lastpenalty to plain's definitions. If the last thing
% we did was a \nobreak, we don't want to insert more space.
%
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
\removelastskip\penalty-50\smallskip\fi\fi}
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
\removelastskip\penalty-100\medskip\fi\fi}
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
\removelastskip\penalty-200\bigskip\fi\fi}
% Output routine
%
% For a final copy, take out the rectangles
% that mark overfull boxes (in case you have decided
% that the text looks ok even though it passes the margin).
%
\def\finalout{\overfullrule=0pt }
\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
\newdimen\topandbottommargin \topandbottommargin=.75in
% Output a mark which sets \thischapter, \thissection and \thiscolor.
% We dump everything together because we only have one kind of mark.
% This works because we only use \botmark / \topmark, not \firstmark.
%
% A mark contains a subexpression of the \ifcase ... \fi construct.
% \get*marks macros below extract the needed part using \ifcase.
%
% Another complication is to let the user choose whether \thischapter
% (\thissection) refers to the chapter (section) in effect at the top
% of a page, or that at the bottom of a page.
% \domark is called twice inside \chapmacro, to add one
% mark before the section break, and one after.
% In the second call \prevchapterdefs is the same as \currentchapterdefs,
% and \prevsectiondefs is the same as \currentsectiondefs.
% Then if the page is not broken at the mark, some of the previous
% section appears on the page, and we can get the name of this section
% from \firstmark for @everyheadingmarks top.
% @everyheadingmarks bottom uses \botmark.
%
% See page 260 of The TeXbook.
\def\domark{%
\toks0=\expandafter{\currentchapterdefs}%
\toks2=\expandafter{\currentsectiondefs}%
\toks4=\expandafter{\prevchapterdefs}%
\toks6=\expandafter{\prevsectiondefs}%
\toks8=\expandafter{\currentcolordefs}%
\mark{%
\the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
\noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
\noexpand\else \the\toks8 % 2: color marks
}%
}
% \gettopheadingmarks, \getbottomheadingmarks,
% \getcolormarks - extract needed part of mark.
%
% \topmark doesn't work for the very first chapter (after the title
% page or the contents), so we use \firstmark there -- this gets us
% the mark with the chapter defs, unless the user sneaks in, e.g.,
% @setcolor (or @url, or @link, etc.) between @contents and the very
% first @chapter.
\def\gettopheadingmarks{%
\ifcase0\the\savedtopmark\fi
\ifx\thischapter\empty \ifcase0\firstmark\fi \fi
}
\def\getbottomheadingmarks{\ifcase1\botmark\fi}
\def\getcolormarks{\ifcase2\the\savedtopmark\fi}
% Avoid "undefined control sequence" errors.
\def\currentchapterdefs{}
\def\currentsectiondefs{}
\def\currentsection{}
\def\prevchapterdefs{}
\def\prevsectiondefs{}
\def\currentcolordefs{}
% Margin to add to right of even pages, to left of odd pages.
\newdimen\bindingoffset
\newdimen\normaloffset
\newdimen\txipagewidth \newdimen\txipageheight
% Main output routine.
%
\chardef\PAGE = 255
\newtoks\defaultoutput
\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
\output=\expandafter{\the\defaultoutput}
\newbox\headlinebox
\newbox\footlinebox
% When outputting the double column layout for indices, an output routine
% is run several times, which hides the original value of \topmark. This
% can lead to a page heading being output and duplicating the chapter heading
% of the index. Hence, save the contents of \topmark at the beginning of
% the output routine. The saved contents are valid until we actually
% \shipout a page.
%
% (We used to run a short output routine to actually set \topmark and
% \firstmark to the right values, but if this was called with an empty page
% containing whatsits for writing index entries, the whatsits would be thrown
% away and the index auxiliary file would remain empty.)
%
\newtoks\savedtopmark
\newif\iftopmarksaved
\topmarksavedtrue
\def\savetopmark{%
\iftopmarksaved\else
\global\savedtopmark=\expandafter{\topmark}%
\global\topmarksavedtrue
\fi
}
% \onepageout takes a vbox as an argument.
% \shipout a vbox for a single page, adding an optional header, footer
% and footnote. This also causes index entries for this page to be written
% to the auxiliary files.
%
\def\onepageout#1{%
\hoffset=\normaloffset
%
\ifodd\pageno \advance\hoffset by \bindingoffset
\else \advance\hoffset by -\bindingoffset\fi
%
\checkchapterpage
%
% Retrieve the information for the headings from the marks in the page,
% and call Plain TeX's \makeheadline and \makefootline, which use the
% values in \headline and \footline.
%
% Common context changes for both heading and footing.
% Do this outside of the \shipout so @code etc. will be expanded in
% the headline as they should be, not taken literally (outputting ''code).
\def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
%
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
\global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
\ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
\global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
%
{%
% Set context for writing to auxiliary files like index files.
% Have to do this stuff outside the \shipout because we want it to
% take effect in \write's, yet the group defined by the \vbox ends
% before the \shipout runs.
%
\atdummies % don't expand commands in the output.
\turnoffactive
\shipout\vbox{%
% Do this early so pdf references go to the beginning of the page.
\ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
%
\unvbox\headlinebox
\pagebody{#1}%
\ifdim\ht\footlinebox > 0pt
% Only leave this space if the footline is nonempty.
% (We lessened \vsize for it in \oddfootingyyy.)
% The \baselineskip=24pt in plain's \makefootline has no effect.
\vskip 24pt
\unvbox\footlinebox
\fi
%
}%
}%
\global\topmarksavedfalse
\advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi
}
\newinsert\margin \dimen\margin=\maxdimen
% Main part of page, including any footnotes
\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
{\catcode`\@ =11
\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
% marginal hacks, juha@viisa.uucp (Juha Takala)
\ifvoid\margin\else % marginal info is present
\rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
\dimen@=\dp#1\relax \unvbox#1\relax
\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
\ifr@ggedbottom \kern-\dimen@ \vfil \fi}
}
% Check if we are on the first page of a chapter. Used for printing headings.
\newif\ifchapterpage
\def\checkchapterpage{%
% Get the chapter that was current at the end of the last page
\ifcase1\the\savedtopmark\fi
\let\prevchaptername\thischaptername
%
\ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
\let\curchaptername\thischaptername
%
\ifx\curchaptername\prevchaptername
\chapterpagefalse
\else
\chapterpagetrue
\fi
}
% Argument parsing
% Parse an argument, then pass it to #1. The argument is the rest of
% the input line (except we remove a trailing comment). #1 should be a
% macro which expects an ordinary undelimited TeX argument.
% For example, \def\foo{\parsearg\fooxxx}.
%
\def\parsearg{\parseargusing{}}
\def\parseargusing#1#2{%
\def\argtorun{#2}%
\begingroup
\obeylines
\spaceisspace
#1%
\parseargline\empty% Insert the \empty token, see \finishparsearg below.
}
{\obeylines %
\gdef\parseargline#1^^M{%
\endgroup % End of the group started in \parsearg.
\argremovecomment #1\comment\ArgTerm%
}%
}
% First remove any @comment, then any @c comment. Pass the result on to
% \argcheckspaces.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
% Each occurrence of `\^^M' or `\^^M' is replaced by a single space.
%
% \argremovec might leave us with trailing space, e.g.,
% @end itemize @c foo
% This space token undergoes the same procedure and is eventually removed
% by \finishparsearg.
%
\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
\def\temp{#3}%
\ifx\temp\empty
% Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
\let\temp\finishparsearg
\else
\let\temp\argcheckspaces
\fi
% Put the space token in:
\temp#1 #3\ArgTerm
}
% If a _delimited_ argument is enclosed in braces, they get stripped; so
% to get _exactly_ the rest of the line, we had to prevent such situation.
% We prepended an \empty token at the very beginning and we expand it now,
% just before passing the control to \argtorun.
% (Similarly, we have to think about #3 of \argcheckspacesY above: it is
% either the null string, or it ends with \^^M---thus there is no danger
% that a pair of braces would be stripped.
%
% But first, we have to remove the trailing space token.
%
\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
% \parseargdef - define a command taking an argument on the line
%
% \parseargdef\foo{...}
% is roughly equivalent to
% \def\foo{\parsearg\Xfoo}
% \def\Xfoo#1{...}
\def\parseargdef#1{%
\expandafter \doparseargdef \csname\string#1\endcsname #1%
}
\def\doparseargdef#1#2{%
\def#2{\parsearg#1}%
\def#1##1%
}
% Several utility definitions with active space:
{
\obeyspaces
\gdef\obeyedspace{ }
% Make each space character in the input produce a normal interword
% space in the output. Don't allow a line break at this space, as this
% is used only in environments like @example, where each line of input
% should produce a line of output anyway.
%
\gdef\sepspaces{\obeyspaces\let =\tie}
% If an index command is used in an @example environment, any spaces
% therein should become regular spaces in the raw index file, not the
% expansion of \tie (\leavevmode \penalty \@M \ ).
\gdef\unsepspaces{\let =\space}
}
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
% Define the framework for environments in texinfo.tex. It's used like this:
%
% \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
% 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.
%
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
% are not treated as environments; they don't open a group. (The
% implementation of @end takes care not to call \endgroup in this
% special case.)
% At run-time, environments start with this:
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
% initialize
\let\thisenv\empty
% ... but they get defined via ``\envdef\foo{...}'':
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
% Check whether we're in the right environment:
\def\checkenv#1{%
\def\temp{#1}%
\ifx\thisenv\temp
\else
\badenverr
\fi
}
% Environment mismatch, #1 expected:
\def\badenverr{%
\errhelp = \EMsimple
\errmessage{This command can appear only \inenvironment\temp,
not \inenvironment\thisenv}%
}
\def\inenvironment#1{%
\ifx#1\empty
outside of any environment%
\else
in environment \expandafter\string#1%
\fi
}
% @end foo calls \checkenv and executes the definition of \Efoo.
\parseargdef\end{%
\if 1\csname iscond.#1\endcsname
\else
% The general wording of \badenverr may not be ideal.
\expandafter\checkenv\csname#1\endcsname
\csname E#1\endcsname
\endgroup
\fi
}
\newhelp\EMsimple{Press RETURN to continue.}
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
% since \penalty is valid in vertical mode, we'd end up putting the
% penalty on the vertical list instead of in the new paragraph.
{\catcode`@ = 11
% Avoid using \@M directly, because that causes trouble
% if the definition is written into an index file.
\global\let\tiepenalty = \@M
\gdef\tie{\leavevmode\penalty\tiepenalty\ }
}
% @: forces normal size whitespace following.
\def\:{\spacefactor=1000 }
% @* forces a line break.
\def\*{\unskip\hfil\break\hbox{}\ignorespaces}
% @/ allows a line break.
\let\/=\allowbreak
% @. is an end-of-sentence period.
\def\.{.\spacefactor=\endofsentencespacefactor\space}
% @! is an end-of-sentence bang.
\def\!{!\spacefactor=\endofsentencespacefactor\space}
% @? is an end-of-sentence query.
\def\?{?\spacefactor=\endofsentencespacefactor\space}
% @frenchspacing on|off says whether to put extra space after punctuation.
%
\def\onword{on}
\def\offword{off}
%
\parseargdef\frenchspacing{%
\def\temp{#1}%
\ifx\temp\onword \plainfrenchspacing
\else\ifx\temp\offword \plainnonfrenchspacing
\else
\errhelp = \EMsimple
\errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
\fi\fi
}
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
% produce a whole line of output instead of starting the paragraph.
\def\w#1{\leavevmode\hbox{#1}}
% @group ... @end group forces ... to be all on one page, by enclosing
% it in a TeX vbox. We use \vtop instead of \vbox to construct the box
% to keep its height that of a normal line. According to the rules for
% \topskip (p.114 of the TeXbook), the glue inserted is
% max (\topskip - \ht (first item), 0). If that height is large,
% therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad.
%
% Another complication is that the group might be very large. This can
% cause the glue on the previous page to be unduly stretched, because it
% does not have much material. In this case, it's better to add an
% explicit \vfill so that the extra space is at the bottom. The
% threshold for doing this is if the group is more than \vfilllimit
% percent of a page (\vfilllimit can be changed inside of @tex).
%
\newbox\groupbox
\def\vfilllimit{0.7}
%
\envdef\group{%
\ifnum\catcode`\^^M=\active \else
\errhelp = \groupinvalidhelp
\errmessage{@group invalid in context where filling is enabled}%
\fi
\startsavinginserts
%
\setbox\groupbox = \vtop\bgroup
% Do @comment since we are called inside an environment such as
% @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
% the `@group' to put extra space in the output. Since @group
% should appear on a line by itself (according to the Texinfo
% manual), we don't worry about eating any user text.
\comment
}
%
% The \vtop produces a box with normal height and large depth; thus, TeX puts
% \baselineskip glue before it, and (when the next line of text is done)
% \lineskip glue after it. Thus, space below is not quite equal to space
% above. But it's pretty close.
\def\Egroup{%
% To get correct interline space between the last line of the group
% and the first line afterwards, we have to propagate \prevdepth.
\endgraf % Not \par, as it may have been set to \lisppar.
\global\dimen1 = \prevdepth
\egroup % End the \vtop.
\addgroupbox
\prevdepth = \dimen1
\checkinserts
}
\def\addgroupbox{
% \dimen0 is the vertical size of the group's box.
\dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
% \dimen2 is how much space is left on the page (more or less).
\dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
% if the group doesn't fit on the current page, and it's a big big
% group, force a page break.
\ifdim \dimen0 > \dimen2
\ifdim \pagetotal < \vfilllimit\txipageheight
\page
\fi
\fi
\box\groupbox
}
%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
% message, so this ends up printing `@group can only ...'.
%
\newhelp\groupinvalidhelp{%
group can only be used in environments such as @example,^^J%
where each line of input produces a line of output.}
% @need space-in-mils
% forces a page break if there is not space-in-mils remaining.
\newdimen\mil \mil=0.001in
\parseargdef\need{%
% Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
%
% If the @need value is less than one line space, it's useless.
\dimen0 = #1\mil
\dimen2 = \ht\strutbox
\advance\dimen2 by \dp\strutbox
\ifdim\dimen0 > \dimen2
%
% Do a \strut just to make the height of this box be normal, so the
% normal leading is inserted relative to the preceding line.
% And a page break here is fine.
\vtop to #1\mil{\strut\vfil}%
%
% TeX does not even consider page breaks if a penalty added to the
% main vertical list is 10000 or more. But in order to see if the
% empty box we just added fits on the page, we must make it consider
% page breaks. On the other hand, we don't want to actually break the
% page after the empty box. So we use a penalty of 9999.
%
% There is an extremely small chance that TeX will actually break the
% page at this \penalty, if there are no other feasible breakpoints in
% sight. (If the user is using lots of big @group commands, which
% almost-but-not-quite fill up a page, TeX will have a hard time doing
% good page breaking, for example.) However, I could not construct an
% example where a page broke at this \penalty; if it happens in a real
% document, then we can reconsider our strategy.
\penalty9999
%
% Back up by the size of the box, whether we did a page break or not.
\kern -#1\mil
%
% Do not allow a page break right after this kern.
\nobreak
\fi
}
% @br forces paragraph break (and is undocumented).
\let\br = \par
% @page forces the start of a new page.
%
\def\page{\par\vfill\supereject}
% @exdent text....
% outputs text on separate line in roman font, starting at standard page margin
% This records the amount of indent in the innermost environment.
% That's how much \exdent should take out.
\newskip\exdentamount
% This defn is used inside fill environments such as @defun.
\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
% This defn is used inside nofill environments such as @example.
\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
\leftline{\hskip\leftskip{\rm#1}}}}
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
% paragraph. For more general purposes, use the \margin insertion
% class. WHICH is `l' or `r'. Not documented, written for gawk manual.
%
\newskip\inmarginspacing \inmarginspacing=1cm
\def\strutdepth{\dp\strutbox}
%
\def\doinmargin#1#2{\strut\vadjust{%
\nobreak
\kern-\strutdepth
\vtop to \strutdepth{%
\baselineskip=\strutdepth
\vss
% if you have multiple lines of stuff to put here, you'll need to
% make the vbox yourself of the appropriate size.
\ifx#1l%
\llap{\ignorespaces #2\hskip\inmarginspacing}%
\else
\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
\fi
\null
}%
}}
\def\inleftmargin{\doinmargin l}
\def\inrightmargin{\doinmargin r}
%
% @inmargin{TEXT [, RIGHT-TEXT]}
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
% else use TEXT for both).
%
\def\inmargin#1{\parseinmargin #1,,\finish}
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt
\def\lefttext{#1}% have both texts
\def\righttext{#2}%
\else
\def\lefttext{#1}% have only one text
\def\righttext{#1}%
\fi
%
\ifodd\pageno
\def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
\else
\def\temp{\inleftmargin\lefttext}%
\fi
\temp
}
% @include FILE -- \input text of FILE.
%
\def\include{\parseargusing\filenamecatcodes\includezzz}
\def\includezzz#1{%
\pushthisfilestack
\def\thisfile{#1}%
{%
\makevalueexpandable % we want to expand any @value in FILE.
\turnoffactive % and allow special characters in the expansion
\indexnofonts % Allow `@@' and other weird things in file names.
\wlog{texinfo.tex: doing @include of #1^^J}%
\edef\temp{\noexpand\input #1 }%
%
% This trickery is to read FILE outside of a group, in case it makes
% definitions, etc.
\expandafter
}\temp
\popthisfilestack
}
\def\filenamecatcodes{%
\catcode`\\=\other
\catcode`~=\other
\catcode`^=\other
\catcode`_=\other
\catcode`|=\other
\catcode`<=\other
\catcode`>=\other
\catcode`+=\other
\catcode`-=\other
\catcode`\`=\other
\catcode`\'=\other
}
\def\pushthisfilestack{%
\expandafter\pushthisfilestackX\popthisfilestack\StackTerm
}
\def\pushthisfilestackX{%
\expandafter\pushthisfilestackY\thisfile\StackTerm
}
\def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
\gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
}
\def\popthisfilestack{\errthisfilestackempty}
\def\errthisfilestackempty{\errmessage{Internal error:
the stack of filenames is empty.}}
%
\def\thisfile{}
% @center line
% outputs that line, centered.
%
\parseargdef\center{%
\ifhmode
\let\centersub\centerH
\else
\let\centersub\centerV
\fi
\centersub{\hfil \ignorespaces#1\unskip \hfil}%
\let\centersub\relax % don't let the definition persist, just in case
}
\def\centerH#1{{%
\hfil\break
\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\line{#1}%
\break
}}
%
\newcount\centerpenalty
\def\centerV#1{%
% The idea here is the same as in \startdefun, \cartouche, etc.: if
% @center is the first thing after a section heading, we need to wipe
% out the negative parskip inserted by \sectionheading, but still
% prevent a page break here.
\centerpenalty = \lastpenalty
\ifnum\centerpenalty>10000 \vskip\parskip \fi
\ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
\line{\kern\leftskip #1\kern\rightskip}%
}
% @sp n outputs n lines of vertical space
%
\parseargdef\sp{\vskip #1\baselineskip}
% @comment ...line which is ignored...
% @c is the same as @comment
% @ignore ... @end ignore is another way to write a comment
\def\c{\begingroup \catcode`\^^M=\active%
\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
\cxxx}
{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
%
\let\comment\c
% @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough.
% NCHARS can also be the word `asis' or `none'.
% We cannot feasibly implement @paragraphindent asis, though.
%
\def\asisword{asis} % no translation, these are keywords
\def\noneword{none}
%
\parseargdef\paragraphindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
\ifx\temp\noneword
\defaultparindent = 0pt
\else
\defaultparindent = #1em
\fi
\fi
\parindent = \defaultparindent
}
% @exampleindent NCHARS
% We'll use ems for NCHARS like @paragraphindent.
% It seems @exampleindent asis isn't necessary, but
% I preserve it to make it similar to @paragraphindent.
\parseargdef\exampleindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
\ifx\temp\noneword
\lispnarrowing = 0pt
\else
\lispnarrowing = #1em
\fi
\fi
}
% @firstparagraphindent WORD
% If WORD is `none', then suppress indentation of the first paragraph
% after a section heading. If WORD is `insert', then do indent at such
% paragraphs.
%
% The paragraph indentation is suppressed or not by calling
% \suppressfirstparagraphindent, which the sectioning commands do.
% We switch the definition of this back and forth according to WORD.
% By default, we suppress indentation.
%
\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
\def\insertword{insert}
%
\parseargdef\firstparagraphindent{%
\def\temp{#1}%
\ifx\temp\noneword
\let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
\else\ifx\temp\insertword
\let\suppressfirstparagraphindent = \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @firstparagraphindent option `\temp'}%
\fi\fi
}
% Here is how we actually suppress indentation. Redefine \everypar to
% \kern backwards by \parindent, and then reset itself to empty.
%
% We also make \indent itself not actually do anything until the next
% paragraph.
%
\gdef\dosuppressfirstparagraphindent{%
\gdef\indent {\restorefirstparagraphindent \indent}%
\gdef\noindent{\restorefirstparagraphindent \noindent}%
\global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
}
%
\gdef\restorefirstparagraphindent{%
\global\let\indent = \ptexindent
\global\let\noindent = \ptexnoindent
\global\everypar = {}%
}
% leave vertical mode without cancelling any first paragraph indent
\gdef\imageindent{%
\toks0=\everypar
\everypar={}%
\ptexnoindent
\global\everypar=\toks0
}
% @refill is a no-op.
\let\refill=\relax
% @setfilename INFO-FILENAME - ignored
\let\setfilename=\comment
% @bye.
\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
\message{pdf,}
% adobe `portable' document format
\newcount\tempnum
\newcount\lnkcount
\newtoks\filename
\newcount\filenamelength
\newcount\pgn
\newtoks\toksA
\newtoks\toksB
\newtoks\toksC
\newtoks\toksD
\newbox\boxA
\newbox\boxB
\newcount\countA
\newif\ifpdf
\newif\ifpdfmakepagedest
%
% For LuaTeX
%
\newif\iftxiuseunicodedestname
\txiuseunicodedestnamefalse % For pdfTeX etc.
\ifx\luatexversion\thisisundefined
\else
% Use Unicode destination names
\txiuseunicodedestnametrue
% Escape PDF strings with converting UTF-16 from UTF-8
\begingroup
\catcode`\%=12
\directlua{
function UTF16oct(str)
tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
for c in string.utfvalues(str) do
if c < 0x10000 then
tex.sprint(
string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o',
math.floor(c / 256), math.floor(c % 256)))
else
c = c - 0x10000
local c_hi = c / 1024 + 0xd800
local c_lo = c % 1024 + 0xdc00
tex.sprint(
string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o' ..
string.char(0x5c) .. string.char(0x25) .. '03o',
math.floor(c_hi / 256), math.floor(c_hi % 256),
math.floor(c_lo / 256), math.floor(c_lo % 256)))
end
end
end
}
\endgroup
\def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
% Escape PDF strings without converting
\begingroup
\directlua{
function PDFescstr(str)
for c in string.bytes(str) do
if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
tex.sprint(-2,
string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
c))
else
tex.sprint(-2, string.char(c))
end
end
end
}
% The -2 in the arguments here gives all the input to TeX catcode 12
% (other) or 10 (space), preventing undefined control sequence errors. See
% https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
%
\endgroup
\def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
\ifnum\luatexversion>84
% For LuaTeX >= 0.85
\def\pdfdest{\pdfextension dest}
\let\pdfoutput\outputmode
\def\pdfliteral{\pdfextension literal}
\def\pdfcatalog{\pdfextension catalog}
\def\pdftexversion{\numexpr\pdffeedback version\relax}
\let\pdfximage\saveimageresource
\let\pdfrefximage\useimageresource
\let\pdflastximage\lastsavedimageresourceindex
\def\pdfendlink{\pdfextension endlink\relax}
\def\pdfoutline{\pdfextension outline}
\def\pdfstartlink{\pdfextension startlink}
\def\pdffontattr{\pdfextension fontattr}
\def\pdfobj{\pdfextension obj}
\def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
\let\pdfpagewidth\pagewidth
\let\pdfpageheight\pageheight
\edef\pdfhorigin{\pdfvariable horigin}
\edef\pdfvorigin{\pdfvariable vorigin}
\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.
\ifpdf
\def\pagelabels{%
\def\title{0 << /P (T-) /S /D >>}%
\edef\roman{\the\romancount << /S /r >>}%
\edef\arabic{\the\arabiccount << /S /D >>}%
%
% Page label ranges must be increasing. Remove any duplicates.
% (There is a slight chance of this being wrong if e.g. there is
% a @contents but no @titlepage, etc.)
%
\ifnum\romancount=0 \def\roman{}\fi
\ifnum\arabiccount=0 \def\title{}%
\else
\ifnum\romancount=\arabiccount \def\roman{}\fi
\fi
%
\ifnum\romancount<\arabiccount
\pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
\else
\pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
\fi
}
\else
\let\pagelabels\relax
\fi
\newcount\pagecount \pagecount=0
\newcount\romancount \romancount=0
\newcount\arabiccount \arabiccount=0
\ifpdf
\let\ptxadvancepageno\advancepageno
\def\advancepageno{%
\ptxadvancepageno\global\advance\pagecount by 1
}
\fi
% PDF uses PostScript string constants for the names of xref targets,
% for display in the outlines, and in other places. Thus, we have to
% double any backslashes. Otherwise, a name like "\node" will be
% interpreted as a newline (\n), followed by o, d, e. Not good.
%
% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
% related messages. The final outcome is that it is up to the TeX user
% to double the backslashes and otherwise make the string valid, so
% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
% do this reliably, so we use it.
% #1 is a control sequence in which to do the replacements,
% which we \xdef.
\def\txiescapepdf#1{%
\ifx\pdfescapestring\thisisundefined
% No primitive available; should we give a warning or log?
% Many times it won't matter.
\xdef#1{#1}%
\else
% The expandable \pdfescapestring primitive escapes parentheses,
% backslashes, and other special chars.
\xdef#1{\pdfescapestring{#1}}%
\fi
}
\def\txiescapepdfutfsixteen#1{%
\ifx\pdfescapestrutfsixteen\thisisundefined
% No UTF-16 converting macro available.
\txiescapepdf{#1}%
\else
\xdef#1{\pdfescapestrutfsixteen{#1}}%
\fi
}
\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
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.)}
\ifpdf
%
% 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}}
%
% 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
}
%
%
\pdfcatalog{/PageMode /UseOutlines}
%
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
\def\dopdfimage#1#2#3{%
\def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
\def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
%
% pdftex (and the PDF format) support .pdf, .png, .jpg (among
% others). Let's try in that order, PDF first since if
% someone has a scalable image, presumably better to use that than a
% bitmap.
\let\pdfimgext=\empty
\begingroup
\openin 1 #1.pdf \ifeof 1
\openin 1 #1.PDF \ifeof 1
\openin 1 #1.png \ifeof 1
\openin 1 #1.jpg \ifeof 1
\openin 1 #1.jpeg \ifeof 1
\openin 1 #1.JPG \ifeof 1
\errhelp = \nopdfimagehelp
\errmessage{Could not find image file #1 for pdf}%
\else \gdef\pdfimgext{JPG}%
\fi
\else \gdef\pdfimgext{jpeg}%
\fi
\else \gdef\pdfimgext{jpg}%
\fi
\else \gdef\pdfimgext{png}%
\fi
\else \gdef\pdfimgext{PDF}%
\fi
\else \gdef\pdfimgext{pdf}%
\fi
\closein 1
\endgroup
%
% without \immediate, ancient pdftex seg faults when the same image is
% included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
\ifnum\pdftexversion < 14
\immediate\pdfimage
\else
\immediate\pdfximage
\fi
\ifdim \wd0 >0pt width \pdfimagewidth \fi
\ifdim \wd2 >0pt height \pdfimageheight \fi
\ifnum\pdftexversion<13
#1.\pdfimgext
\else
{#1.\pdfimgext}%
\fi
\ifnum\pdftexversion < 14 \else
\pdfrefximage \pdflastximage
\fi}
%
\def\setpdfdestname#1{{%
% We have to set dummies so commands such as @code, and characters
% such as \, aren't expanded when present in a section title.
\indexnofonts
\makevalueexpandable
\turnoffactive
\iftxiuseunicodedestname
\ifx \declaredencoding \latone
% Pass through Latin-1 characters.
% LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
\else
\ifx \declaredencoding \utfeight
% Pass through Unicode characters.
\else
% Use ASCII approximations in destination names.
\passthroughcharsfalse
\fi
\fi
\else
% Use ASCII approximations in destination names.
\passthroughcharsfalse
\fi
\def\pdfdestname{#1}%
\txiescapepdf\pdfdestname
}}
%
\def\setpdfoutlinetext#1{{%
\indexnofonts
\makevalueexpandable
\turnoffactive
\ifx \declaredencoding \latone
% The PDF format can use an extended form of Latin-1 in bookmark
% strings. See Appendix D of the PDF Reference, Sixth Edition, for
% the "PDFDocEncoding".
\passthroughcharstrue
% Pass through Latin-1 characters.
% LuaTeX: Convert to Unicode
% pdfTeX: Use Latin-1 as PDFDocEncoding
\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
% For LuaTeX with UTF-8.
% Pass through Unicode characters for title texts.
\passthroughcharstrue
\def\pdfoutlinetext{#1}%
\fi
\else
% For non-Latin-1 or non-UTF-8 encodings.
% Use ASCII approximations.
\passthroughcharsfalse
\def\pdfoutlinetext{#1}%
\fi
\fi
% LuaTeX: Convert to UTF-16
% pdfTeX: Use Latin-1 as PDFDocEncoding
\txiescapepdfutfsixteen\pdfoutlinetext
}}
%
\def\pdfmkdest#1{%
\setpdfdestname{#1}%
\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}
\def\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%
\else \csname#1\endcsname \fi}
\def\advancenumber#1{\tempnum=\expnumber{#1}\relax
\advance\tempnum by 1
\expandafter\xdef\csname#1\endcsname{\the\tempnum}}
%
% #1 is the section text, which is what will be displayed in the
% outline by the pdf viewer. #2 is the pdf expression for the number
% of subentries (or empty, for subsubsections). #3 is the node text,
% which might be empty if this toc entry had no corresponding node.
% #4 is the page number
%
\def\dopdfoutline#1#2#3#4{%
% Generate a link to the node text if that exists; else, use the
% page number. We could generate a destination for the section
% text in the case where a section has no node, but it doesn't
% seem worth the trouble, since most documents are normally structured.
\setpdfoutlinetext{#1}
\setpdfdestname{#3}
\ifx\pdfdestname\empty
\def\pdfdestname{#4}%
\fi
%
\pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
}
%
\def\pdfmakeoutlines{%
\begingroup
% Read toc silently, to get counts of subentries for \pdfoutline.
\def\partentry##1##2##3##4{}% ignore parts in the outlines
\def\numchapentry##1##2##3##4{%
\def\thischapnum{##2}%
\def\thissecnum{0}%
\def\thissubsecnum{0}%
}%
\def\numsecentry##1##2##3##4{%
\advancenumber{chap\thischapnum}%
\def\thissecnum{##2}%
\def\thissubsecnum{0}%
}%
\def\numsubsecentry##1##2##3##4{%
\advancenumber{sec\thissecnum}%
\def\thissubsecnum{##2}%
}%
\def\numsubsubsecentry##1##2##3##4{%
\advancenumber{subsec\thissubsecnum}%
}%
\def\thischapnum{0}%
\def\thissecnum{0}%
\def\thissubsecnum{0}%
%
% use \def rather than \let here because we redefine \chapentry et
% al. a second time, below.
\def\appentry{\numchapentry}%
\def\appsecentry{\numsecentry}%
\def\appsubsecentry{\numsubsecentry}%
\def\appsubsubsecentry{\numsubsubsecentry}%
\def\unnchapentry{\numchapentry}%
\def\unnsecentry{\numsecentry}%
\def\unnsubsecentry{\numsubsecentry}%
\def\unnsubsubsecentry{\numsubsubsecentry}%
\readdatafile{toc}%
%
% Read toc second time, this time actually producing the outlines.
% The `-' means take the \expnumber as the absolute number of
% subentries, which we calculated on our first read of the .toc above.
%
% We use the node names as the destinations.
%
% Currently we prefix the section name with the section number
% for chapter and appendix headings only in order to avoid too much
% horizontal space being required in the PDF viewer.
\def\numchapentry##1##2##3##4{%
\dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
\def\unnchapentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
\def\numsecentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
\def\numsubsecentry##1##2##3##4{%
\dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
\def\numsubsubsecentry##1##2##3##4{% count is always zero
\dopdfoutline{##1}{}{##3}{##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
\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
\endgroup
}
{\catcode`[=1 \catcode`]=2
\catcode`{=\other \catcode`}=\other
\gdef\lbracecharliteral[{]%
\gdef\rbracecharliteral[}]%
]
%
\def\skipspaces#1{\def\PP{#1}\def\D{|}%
\ifx\PP\D\let\nextsp\relax
\else\let\nextsp\skipspaces
\addtokens{\filename}{\PP}%
\advance\filenamelength by 1
\fi
\nextsp}
\def\getfilename#1{%
\filenamelength=0
% If we don't expand the argument now, \skipspaces will get
% snagged on things like "@value{foo}".
\edef\temp{#1}%
\expandafter\skipspaces\temp|\relax
}
\ifnum\pdftexversion < 14
\let \startlink \pdfannotlink
\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\pdflink#1{%
\startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
\setcolor{\linkcolor}#1\endlink}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
\else
% non-pdf mode
\let\pdfmkdest = \gobble
\let\pdfurl = \gobble
\let\endlink = \relax
\let\setcolor = \gobble
\let\pdfsetcolor = \gobble
\let\pdfmakeoutlines = \relax
\fi % \ifx\pdfoutput
%
% For XeTeX
%
\ifx\XeTeXrevision\thisisundefined
\else
%
% XeTeX version check
%
\ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
% TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
% It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
% For avoiding PDF destination name replacement, we use this special
% instead of xdvipdfmx's command line option `-C 0x0010'.
\special{dvipdfmx:config C 0x0010}
% XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
% It can handle Unicode destination names for PDF.
\txiuseunicodedestnametrue
\else
% XeTeX < 0.99996 (TeX Live < 2016) cannot use the
% `dvipdfmx:config' special.
% So for avoiding PDF destination name replacement,
% xdvipdfmx's command line option `-C 0x0010' is necessary.
%
% XeTeX < 0.99995 can not handle Unicode destination names for PDF
% because xdvipdfmx 20150315 has a UTF-16 conversion issue.
% It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
\txiuseunicodedestnamefalse
\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
\def\pdfdest name#1 xyz{%
\special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
}
%
\def\setpdfdestname#1{{%
% We have to set dummies so commands such as @code, and characters
% such as \, aren't expanded when present in a section title.
\indexnofonts
\makevalueexpandable
\turnoffactive
\iftxiuseunicodedestname
% Pass through Unicode characters.
\else
% Use ASCII approximations in destination names.
\passthroughcharsfalse
\fi
\def\pdfdestname{#1}%
\txiescapepdf\pdfdestname
}}
%
\def\setpdfoutlinetext#1{{%
\turnoffactive
% Always use Unicode characters in title texts.
\def\pdfoutlinetext{#1}%
% For XeTeX, xdvipdfmx converts to UTF-16.
% So we do not convert.
\txiescapepdf\pdfoutlinetext
}}
%
\def\pdfmkdest#1{%
\setpdfdestname{#1}%
\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}
\ifx\pdfdestname\empty
\def\pdfdestname{#4}%
\fi
%
\special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
<< /S /GoTo /D (\pdfdestname) >> >> }%
}
%
\def\pdfmakeoutlines{%
\begingroup
%
% For XeTeX, counts of subentries are not necessary.
% Therefore, we read toc only once.
%
% We use node names as destinations.
%
% Currently we prefix the section name with the section number
% for chapter and appendix headings only in order to avoid too much
% 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}}%
\def\numsecentry##1##2##3##4{%
\dopdfoutline{##1}{2}{##3}{##4}}%
\def\numsubsecentry##1##2##3##4{%
\dopdfoutline{##1}{3}{##3}{##4}}%
\def\numsubsubsecentry##1##2##3##4{%
\dopdfoutline{##1}{4}{##3}{##4}}%
%
\let\appentry\numchapentry%
\let\appsecentry\numsecentry%
\let\appsubsecentry\numsubsecentry%
\let\appsubsubsecentry\numsubsubsecentry%
\def\unnchapentry##1##2##3##4{%
\dopdfoutline{##1}{1}{##3}{##4}}%
\let\unnsecentry\numsecentry%
\let\unnsubsecentry\numsubsecentry%
\let\unnsubsubsecentry\numsubsubsecentry%
%
% For XeTeX, xdvipdfmx converts strings to UTF-16.
% Therefore, the encoding and the language may not be considered.
%
\indexnofonts
\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
\endgroup
}
{\catcode`[=1 \catcode`]=2
\catcode`{=\other \catcode`}=\other
\gdef\lbracecharliteral[{]%
\gdef\rbracecharliteral[}]%
]
\special{pdf:docview << /PageMode /UseOutlines >> }
% ``\special{pdf:tounicode ...}'' is not necessary
% because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
% 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
\addtokens{\filename}{\PP}%
\advance\filenamelength by 1
\fi
\nextsp}
\def\getfilename#1{%
\filenamelength=0
% If we don't expand the argument now, \skipspaces will get
% snagged on things like "@value{foo}".
\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\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{%
\special{pdf:bann << /Border [0 0 0]
/Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
\setcolor{\linkcolor}#1\endlink}
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
%
%
% @image support
%
% #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
\def\doxeteximage#1#2#3{%
\def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
\def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
%
% XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
% others). Let's try in that order, PDF first since if
% someone has a scalable image, presumably better to use that than a
% bitmap.
\let\xeteximgext=\empty
\begingroup
\openin 1 #1.pdf \ifeof 1
\openin 1 #1.PDF \ifeof 1
\openin 1 #1.png \ifeof 1
\openin 1 #1.jpg \ifeof 1
\openin 1 #1.jpeg \ifeof 1
\openin 1 #1.JPG \ifeof 1
\errmessage{Could not find image file #1 for XeTeX}%
\else \gdef\xeteximgext{JPG}%
\fi
\else \gdef\xeteximgext{jpeg}%
\fi
\else \gdef\xeteximgext{jpg}%
\fi
\else \gdef\xeteximgext{png}%
\fi
\else \gdef\xeteximgext{PDF}%
\fi
\else \gdef\xeteximgext{pdf}%
\fi
\closein 1
\endgroup
%
% Putting an \hbox around the image can prevent an over-long line
% after the image.
\hbox\bgroup
\def\xetexpdfext{pdf}%
\ifx\xeteximgext\xetexpdfext
\XeTeXpdffile "#1".\xeteximgext ""
\else
\def\xetexpdfext{PDF}%
\ifx\xeteximgext\xetexpdfext
\XeTeXpdffile "#1".\xeteximgext ""
\else
\XeTeXpicfile "#1".\xeteximgext ""
\fi
\fi
\ifdim \wd0 >0pt width \xeteximagewidth \fi
\ifdim \wd2 >0pt height \xeteximageheight \fi \relax
\egroup
}
\fi
%
\message{fonts,}
% Set the baselineskip to #1, and the lineskip and strut size
% correspondingly. There is no deep meaning behind these magic numbers
% used as factors; they just match (closely enough) what Knuth defined.
%
\def\lineskipfactor{.08333}
\def\strutheightpercent{.70833}
\def\strutdepthpercent {.29167}
%
% can get a sort of poor man's double spacing by redefining this.
\def\baselinefactor{1}
%
\newdimen\textleading
\def\setleading#1{%
\dimen0 = #1\relax
\normalbaselineskip = \baselinefactor\dimen0
\normallineskip = \lineskipfactor\normalbaselineskip
\normalbaselines
\setbox\strutbox =\hbox{%
\vrule width0pt height\strutheightpercent\baselineskip
depth \strutdepthpercent \baselineskip
}%
}
% PDF CMaps. See also LaTeX's t1.cmap.
%
% do nothing with this by default.
\expandafter\let\csname cmapOT1\endcsname\gobble
\expandafter\let\csname cmapOT1IT\endcsname\gobble
\expandafter\let\csname cmapOT1TT\endcsname\gobble
% if we are producing pdf, and we have \pdffontattr, then define cmaps.
% (\pdffontattr was introduced many years ago, but people still run
% older pdftex's; it's easy to conditionalize, so we do.)
\ifpdf \ifx\pdffontattr\thisisundefined \else
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1-0)
%%Title: (TeX-OT1-0 TeX OT1 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1)
/Supplement 0
>> def
/CMapName /TeX-OT1-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
8 beginbfrange
<00> <01> <0393>
<09> <0A> <03A8>
<23> <26> <0023>
<28> <3B> <0028>
<3F> <5B> <003F>
<5D> <5E> <005D>
<61> <7A> <0061>
<7B> <7C> <2013>
endbfrange
40 beginbfchar
<02> <0398>
<03> <039B>
<04> <039E>
<05> <03A0>
<06> <03A3>
<07> <03D2>
<08> <03A6>
<0B> <00660066>
<0C> <00660069>
<0D> <0066006C>
<0E> <006600660069>
<0F> <00660066006C>
<10> <0131>
<11> <0237>
<12> <0060>
<13> <00B4>
<14> <02C7>
<15> <02D8>
<16> <00AF>
<17> <02DA>
<18> <00B8>
<19> <00DF>
<1A> <00E6>
<1B> <0153>
<1C> <00F8>
<1D> <00C6>
<1E> <0152>
<1F> <00D8>
<21> <0021>
<22> <201D>
<27> <2019>
<3C> <00A1>
<3D> <003D>
<3E> <00BF>
<5C> <201C>
<5F> <02D9>
<60> <2018>
<7D> <02DD>
<7E> <007E>
<7F> <00A8>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
}\endgroup
\expandafter\edef\csname cmapOT1\endcsname#1{%
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
%
% \cmapOT1IT
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1IT-0)
%%Title: (TeX-OT1IT-0 TeX OT1IT 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1IT)
/Supplement 0
>> def
/CMapName /TeX-OT1IT-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
8 beginbfrange
<00> <01> <0393>
<09> <0A> <03A8>
<25> <26> <0025>
<28> <3B> <0028>
<3F> <5B> <003F>
<5D> <5E> <005D>
<61> <7A> <0061>
<7B> <7C> <2013>
endbfrange
42 beginbfchar
<02> <0398>
<03> <039B>
<04> <039E>
<05> <03A0>
<06> <03A3>
<07> <03D2>
<08> <03A6>
<0B> <00660066>
<0C> <00660069>
<0D> <0066006C>
<0E> <006600660069>
<0F> <00660066006C>
<10> <0131>
<11> <0237>
<12> <0060>
<13> <00B4>
<14> <02C7>
<15> <02D8>
<16> <00AF>
<17> <02DA>
<18> <00B8>
<19> <00DF>
<1A> <00E6>
<1B> <0153>
<1C> <00F8>
<1D> <00C6>
<1E> <0152>
<1F> <00D8>
<21> <0021>
<22> <201D>
<23> <0023>
<24> <00A3>
<27> <2019>
<3C> <00A1>
<3D> <003D>
<3E> <00BF>
<5C> <201C>
<5F> <02D9>
<60> <2018>
<7D> <02DD>
<7E> <007E>
<7F> <00A8>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
}\endgroup
\expandafter\edef\csname cmapOT1IT\endcsname#1{%
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
%
% \cmapOT1TT
\begingroup
\catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
\catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (TeX-OT1TT-0)
%%Title: (TeX-OT1TT-0 TeX OT1TT 0)
%%Version: 1.000
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo
<< /Registry (TeX)
/Ordering (OT1TT)
/Supplement 0
>> def
/CMapName /TeX-OT1TT-0 def
/CMapType 2 def
1 begincodespacerange
<00> <7F>
endcodespacerange
5 beginbfrange
<00> <01> <0393>
<09> <0A> <03A8>
<21> <26> <0021>
<28> <5F> <0028>
<61> <7E> <0061>
endbfrange
32 beginbfchar
<02> <0398>
<03> <039B>
<04> <039E>
<05> <03A0>
<06> <03A3>
<07> <03D2>
<08> <03A6>
<0B> <2191>
<0C> <2193>
<0D> <0027>
<0E> <00A1>
<0F> <00BF>
<10> <0131>
<11> <0237>
<12> <0060>
<13> <00B4>
<14> <02C7>
<15> <02D8>
<16> <00AF>
<17> <02DA>
<18> <00B8>
<19> <00DF>
<1A> <00E6>
<1B> <0153>
<1C> <00F8>
<1D> <00C6>
<1E> <0152>
<1F> <00D8>
<20> <2423>
<27> <2019>
<60> <2018>
<7F> <00A8>
endbfchar
endcmap
CMapName currentdict /CMap defineresource pop
end
end
%%EndResource
%%EOF
}\endgroup
\expandafter\edef\csname cmapOT1TT\endcsname#1{%
\pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
}%
\fi\fi
% Set the font macro #1 to the font named \fontprefix#2.
% #3 is the font's design size, #4 is a scale factor, #5 is the CMap
% encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
% Example:
% #1 = \textrm
% #2 = \rmshape
% #3 = 10
% #4 = \mainmagstep
% #5 = OT1
%
\def\setfont#1#2#3#4#5{%
\font#1=\fontprefix#2#3 scaled #4
\csname cmap#5\endcsname#1%
}
% This is what gets called when #5 of \setfont is empty.
\let\cmap\gobble
%
% (end of cmaps)
% Use cm as the default font prefix.
% To specify the font prefix, you must define \fontprefix
% before you read in texinfo.tex.
\ifx\fontprefix\thisisundefined
\def\fontprefix{cm}
\fi
% Support font families that don't use the same naming scheme as CM.
\def\rmshape{r}
\def\rmbshape{bx} % where the normal face is bold
\def\bfshape{b}
\def\bxshape{bx}
\def\ttshape{tt}
\def\ttbshape{tt}
\def\ttslshape{sltt}
\def\itshape{ti}
\def\itbshape{bxti}
\def\slshape{sl}
\def\slbshape{bxsl}
\def\sfshape{ss}
\def\sfbshape{ss}
\def\scshape{csc}
\def\scbshape{csc}
% Definitions for a main text size of 11pt. (The default in Texinfo.)
%
\def\definetextfontsizexi{%
% Text fonts (11.2pt, magstep1).
\def\textnominalsize{11pt}
\edef\mainmagstep{\magstephalf}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\def\textecsize{1095}
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstep1}{OT1}
\setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
\setfont\defsl\slshape{10}{\magstep1}{OT1}
\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
\def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\ttslfont=\defttsl \let\slfont=\defsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\font\smalli=cmmi9
\font\smallsy=cmsy9
\def\smallecsize{0900}
% Fonts for small examples (8pt).
\def\smallernominalsize{8pt}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\font\smalleri=cmmi8
\font\smallersy=cmsy8
\def\smallerecsize{0800}
% Fonts for math mode superscripts (7pt).
\def\sevennominalsize{7pt}
\setfont\sevenrm\rmshape{7}{1000}{OT1}
\setfont\seventt\ttshape{10}{700}{OT1TT}
\setfont\sevenbf\bfshape{10}{700}{OT1}
\setfont\sevenit\itshape{7}{1000}{OT1IT}
\setfont\sevensl\slshape{10}{700}{OT1}
\setfont\sevensf\sfshape{10}{700}{OT1}
\setfont\sevensc\scshape{10}{700}{OT1}
\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
\font\seveni=cmmi7
\font\sevensy=cmsy7
\def\sevenecsize{0700}
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\def\titleecsize{2074}
% Chapter (and unnumbered) fonts (17.28pt).
\def\chapnominalsize{17pt}
\setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
\setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
\setfont\chapsl\slbshape{10}{\magstep3}{OT1}
\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
\setfont\chapsf\sfbshape{17}{1000}{OT1}
\let\chapbf=\chaprm
\setfont\chapsc\scbshape{10}{\magstep3}{OT1}
\font\chapi=cmmi12 scaled \magstep2
\font\chapsy=cmsy10 scaled \magstep3
\def\chapecsize{1728}
% Section fonts (14.4pt).
\def\secnominalsize{14pt}
\setfont\secrm\rmbshape{12}{\magstep1}{OT1}
\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
\setfont\secit\itbshape{10}{\magstep2}{OT1IT}
\setfont\secsl\slbshape{10}{\magstep2}{OT1}
\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\secsf\sfbshape{12}{\magstep1}{OT1}
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep2}{OT1}
\font\seci=cmmi12 scaled \magstep1
\font\secsy=cmsy10 scaled \magstep2
\def\sececsize{1440}
% Subsection fonts (13.15pt).
\def\ssecnominalsize{13pt}
\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
\setfont\ssecit\itbshape{10}{1315}{OT1IT}
\setfont\ssecsl\slbshape{10}{1315}{OT1}
\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{1315}{OT1}
\font\sseci=cmmi12 scaled \magstephalf
\font\ssecsy=cmsy10 scaled 1315
\def\ssececsize{1200}
% Reduced fonts for @acronym in text (10pt).
\def\reducednominalsize{10pt}
\setfont\reducedrm\rmshape{10}{1000}{OT1}
\setfont\reducedtt\ttshape{10}{1000}{OT1TT}
\setfont\reducedbf\bfshape{10}{1000}{OT1}
\setfont\reducedit\itshape{10}{1000}{OT1IT}
\setfont\reducedsl\slshape{10}{1000}{OT1}
\setfont\reducedsf\sfshape{10}{1000}{OT1}
\setfont\reducedsc\scshape{10}{1000}{OT1}
\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
\font\reducedi=cmmi10
\font\reducedsy=cmsy10
\def\reducedecsize{1000}
\textleading = 13.2pt % line spacing for 11pt CM
\textfonts % reset the current fonts
\rm
} % end of 11pt text font size definitions, \definetextfontsizexi
% Definitions to make the main text be 10pt Computer Modern, with
% section, chapter, etc., sizes following suit. This is for the GNU
% Press printing of the Emacs 22 manual. Maybe other manuals in the
% future. Used with @smallbook, which sets the leading to 12pt.
%
\def\definetextfontsizex{%
% Text fonts (10pt).
\def\textnominalsize{10pt}
\edef\mainmagstep{1000}
\setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
\setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
\setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
\setfont\textsl\slshape{10}{\mainmagstep}{OT1}
\setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
\setfont\textsc\scshape{10}{\mainmagstep}{OT1}
\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
\font\texti=cmmi10 scaled \mainmagstep
\font\textsy=cmsy10 scaled \mainmagstep
\def\textecsize{1000}
% A few fonts for @defun names and args.
\setfont\defbf\bfshape{10}{\magstephalf}{OT1}
\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
\setfont\defsl\slshape{10}{\magstephalf}{OT1}
\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
\def\df{\let\ttfont=\deftt \let\bffont = \defbf
\let\slfont=\defsl \let\ttslfont=\defttsl \bf}
% Fonts for indices, footnotes, small examples (9pt).
\def\smallnominalsize{9pt}
\setfont\smallrm\rmshape{9}{1000}{OT1}
\setfont\smalltt\ttshape{9}{1000}{OT1TT}
\setfont\smallbf\bfshape{10}{900}{OT1}
\setfont\smallit\itshape{9}{1000}{OT1IT}
\setfont\smallsl\slshape{9}{1000}{OT1}
\setfont\smallsf\sfshape{9}{1000}{OT1}
\setfont\smallsc\scshape{10}{900}{OT1}
\setfont\smallttsl\ttslshape{10}{900}{OT1TT}
\font\smalli=cmmi9
\font\smallsy=cmsy9
\def\smallecsize{0900}
% Fonts for small examples (8pt).
\def\smallernominalsize{8pt}
\setfont\smallerrm\rmshape{8}{1000}{OT1}
\setfont\smallertt\ttshape{8}{1000}{OT1TT}
\setfont\smallerbf\bfshape{10}{800}{OT1}
\setfont\smallerit\itshape{8}{1000}{OT1IT}
\setfont\smallersl\slshape{8}{1000}{OT1}
\setfont\smallersf\sfshape{8}{1000}{OT1}
\setfont\smallersc\scshape{10}{800}{OT1}
\setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
\font\smalleri=cmmi8
\font\smallersy=cmsy8
\def\smallerecsize{0800}
% Fonts for math mode superscripts (7pt).
\def\sevennominalsize{7pt}
\setfont\sevenrm\rmshape{7}{1000}{OT1}
\setfont\seventt\ttshape{10}{700}{OT1TT}
\setfont\sevenbf\bfshape{10}{700}{OT1}
\setfont\sevenit\itshape{7}{1000}{OT1IT}
\setfont\sevensl\slshape{10}{700}{OT1}
\setfont\sevensf\sfshape{10}{700}{OT1}
\setfont\sevensc\scshape{10}{700}{OT1}
\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
\font\seveni=cmmi7
\font\sevensy=cmsy7
\def\sevenecsize{0700}
% Fonts for title page (20.4pt):
\def\titlenominalsize{20pt}
\setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
\setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
\setfont\titlesl\slbshape{10}{\magstep4}{OT1}
\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
\setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
\let\titlebf=\titlerm
\setfont\titlesc\scbshape{10}{\magstep4}{OT1}
\font\titlei=cmmi12 scaled \magstep3
\font\titlesy=cmsy10 scaled \magstep4
\def\titleecsize{2074}
% Chapter fonts (14.4pt).
\def\chapnominalsize{14pt}
\setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
\setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
\setfont\chapsl\slbshape{10}{\magstep2}{OT1}
\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
\setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
\let\chapbf\chaprm
\setfont\chapsc\scbshape{10}{\magstep2}{OT1}
\font\chapi=cmmi12 scaled \magstep1
\font\chapsy=cmsy10 scaled \magstep2
\def\chapecsize{1440}
% Section fonts (12pt).
\def\secnominalsize{12pt}
\setfont\secrm\rmbshape{12}{1000}{OT1}
\setfont\secit\itbshape{10}{\magstep1}{OT1IT}
\setfont\secsl\slbshape{10}{\magstep1}{OT1}
\setfont\sectt\ttbshape{12}{1000}{OT1TT}
\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
\setfont\secsf\sfbshape{12}{1000}{OT1}
\let\secbf\secrm
\setfont\secsc\scbshape{10}{\magstep1}{OT1}
\font\seci=cmmi12
\font\secsy=cmsy10 scaled \magstep1
\def\sececsize{1200}
% Subsection fonts (10pt).
\def\ssecnominalsize{10pt}
\setfont\ssecrm\rmbshape{10}{1000}{OT1}
\setfont\ssecit\itbshape{10}{1000}{OT1IT}
\setfont\ssecsl\slbshape{10}{1000}{OT1}
\setfont\ssectt\ttbshape{10}{1000}{OT1TT}
\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
\setfont\ssecsf\sfbshape{10}{1000}{OT1}
\let\ssecbf\ssecrm
\setfont\ssecsc\scbshape{10}{1000}{OT1}
\font\sseci=cmmi10
\font\ssecsy=cmsy10
\def\ssececsize{1000}
% Reduced fonts for @acronym in text (9pt).
\def\reducednominalsize{9pt}
\setfont\reducedrm\rmshape{9}{1000}{OT1}
\setfont\reducedtt\ttshape{9}{1000}{OT1TT}
\setfont\reducedbf\bfshape{10}{900}{OT1}
\setfont\reducedit\itshape{9}{1000}{OT1IT}
\setfont\reducedsl\slshape{9}{1000}{OT1}
\setfont\reducedsf\sfshape{9}{1000}{OT1}
\setfont\reducedsc\scshape{10}{900}{OT1}
\setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
\font\reducedi=cmmi9
\font\reducedsy=cmsy9
\def\reducedecsize{0900}
\divide\parskip by 2 % reduce space between paragraphs
\textleading = 12pt % line spacing for 10pt CM
\textfonts % reset the current fonts
\rm
} % end of 10pt text font size definitions, \definetextfontsizex
% Fonts for short table of contents.
\setfont\shortcontrm\rmshape{12}{1000}{OT1}
\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
\setfont\shortcontsl\slshape{12}{1000}{OT1}
\setfont\shortconttt\ttshape{12}{1000}{OT1TT}
% We provide the user-level command
% @fonttextsize 10
% (or 11) to redefine the text font size. pt is assumed.
%
\def\xiword{11}
\def\xword{10}
\def\xwordpt{10pt}
%
\parseargdef\fonttextsize{%
\def\textsizearg{#1}%
%\wlog{doing @fonttextsize \textsizearg}%
%
% Set \globaldefs so that documents can use this inside @tex, since
% makeinfo 4.8 does not support it, but we need it nonetheless.
%
\begingroup \globaldefs=1
\ifx\textsizearg\xword \definetextfontsizex
\else \ifx\textsizearg\xiword \definetextfontsizexi
\else
\errhelp=\EMsimple
\errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
\fi\fi
\endgroup
}
%
% Change the current font style to #1, remembering it in \curfontstyle.
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% italics, not bold italics.
%
\def\setfontstyle#1{%
\def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
\csname #1font\endcsname % change the current font
}
\def\rm{\fam=0 \setfontstyle{rm}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
\def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf.
\newfam\sffam
\def\sf{\fam=\sffam \setfontstyle{sf}}
% We don't need math for this font style.
\def\ttsl{\setfontstyle{ttsl}}
% In order for the font changes to affect most math symbols and letters,
% we have to define the \textfont of the standard families.
% We don't bother to reset \scriptscriptfont; awaiting user need.
%
\def\resetmathfonts{%
\textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
\textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
\textfont\ttfam=\ttfont \textfont\sffam=\sffont
%
% Fonts for superscript. Note that the 7pt fonts are used regardless
% of the current font size.
\scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
\scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
\scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
\scriptfont\sffam=\sevensf
}
%
% The font-changing commands (all called \...fonts) redefine the meanings
% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs
% to also set the current \fam for math mode. Our \STYLE (e.g., \rm)
% commands hardwire \STYLEfont to set the current font.
%
% The fonts used for \ifont are for "math italics" (\itfont is for italics
% in regular text). \syfont is also used in math mode only.
%
% Each font-changing command also sets the names \lsize (one size lower)
% and \lllsize (three sizes lower). These relative commands are used
% in, e.g., the LaTeX logo and acronyms.
%
% This all needs generalizing, badly.
%
\def\assignfonts#1{%
\expandafter\let\expandafter\rmfont\csname #1rm\endcsname
\expandafter\let\expandafter\itfont\csname #1it\endcsname
\expandafter\let\expandafter\slfont\csname #1sl\endcsname
\expandafter\let\expandafter\bffont\csname #1bf\endcsname
\expandafter\let\expandafter\ttfont\csname #1tt\endcsname
\expandafter\let\expandafter\smallcaps\csname #1sc\endcsname
\expandafter\let\expandafter\sffont \csname #1sf\endcsname
\expandafter\let\expandafter\ifont \csname #1i\endcsname
\expandafter\let\expandafter\syfont \csname #1sy\endcsname
\expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname
}
\newif\ifrmisbold
% Select smaller font size with the current style. Used to change font size
% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
% normal roman text, also use bold fonts for roman text in the smaller size.
\def\switchtolllsize{%
\expandafter\assignfonts\expandafter{\lllsize}%
\ifrmisbold
\let\rmfont\bffont
\fi
\csname\curfontstyle\endcsname
}%
\def\switchtolsize{%
\expandafter\assignfonts\expandafter{\lsize}%
\ifrmisbold
\let\rmfont\bffont
\fi
\csname\curfontstyle\endcsname
}%
\def\definefontsetatsize#1#2#3#4#5{%
\expandafter\def\csname #1fonts\endcsname{%
\def\curfontsize{#1}%
\def\lsize{#2}\def\lllsize{#3}%
\csname rmisbold#5\endcsname
\assignfonts{#1}%
\resetmathfonts
\setleading{#4}%
}}
\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
\definefontsetatsize{title} {chap} {subsec} {27pt} {true}
\definefontsetatsize{chap} {sec} {text} {19pt} {true}
\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
\definefontsetatsize{ssec} {text} {small} {15pt} {true}
\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
\def\titlefont#1{{\titlefonts\rm #1}}
\let\subsecfonts = \ssecfonts
\let\subsubsecfonts = \ssecfonts
% Define these just so they can be easily changed for other fonts.
\def\angleleft{$\langle$}
\def\angleright{$\rangle$}
% Set the fonts to use with the @small... environments.
\let\smallexamplefonts = \smallfonts
% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
% can fit this many characters:
% 8.5x11=86 smallbook=72 a4=90 a5=69
% If we use \scriptfonts (8pt), then we can fit this many characters:
% 8.5x11=90+ smallbook=80 a4=90+ a5=77
% For me, subjectively, the few extra characters that fit aren't worth
% the additional smallness of 8pt. So I'm making the default 9pt.
%
% By the way, for comparison, here's what fits with @example (10pt):
% 8.5x11=71 smallbook=60 a4=75 a5=58
% --karl, 24jan03.
% Set up the default fonts, so we can use them for creating boxes.
%
\definetextfontsizexi
% Check if we are currently using a typewriter font. Since all the
% Computer Modern typewriter fonts have zero interword stretch (and
% shrink), and it is reasonable to expect all typewriter fonts to have
% this property, we can check that font parameter.
%
\def\ifmonospace{\ifdim\fontdimen3\font=0pt }
{
\catcode`\'=\active
\catcode`\`=\active
\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
\gdef\setregularquotes{\let`\lq \let'\rq}
}
% Allow an option to not use regular directed right quote/apostrophe
% (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
% The undirected quote is ugly, so don't make it the default, but it
% works for pasting with more pdf viewers (at least evince), the
% lilypond developers report. xpdf does work with the regular 0x27.
%
\def\codequoteright{%
\ifmonospace
\expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
\expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
'%
\else \char'15 \fi
\else \char'15 \fi
\else
'%
\fi
}
%
% and a similar option for the left quote char vs. a grave accent.
% Modern fonts display ASCII 0x60 as a grave accent, so some people like
% the code environments to do likewise.
%
\def\codequoteleft{%
\ifmonospace
\expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
\expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
% [Knuth] pp. 380,381,391
% \relax disables Spanish ligatures ?` and !` of \tt font.
\relax`%
\else \char'22 \fi
\else \char'22 \fi
\else
\relax`%
\fi
}
% Commands to set the quote options.
%
\parseargdef\codequoteundirected{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETtxicodequoteundirected\endcsname
= t%
\else\ifx\temp\offword
\expandafter\let\csname SETtxicodequoteundirected\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
\fi\fi
}
%
\parseargdef\codequotebacktick{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETtxicodequotebacktick\endcsname
= t%
\else\ifx\temp\offword
\expandafter\let\csname SETtxicodequotebacktick\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
\fi\fi
}
% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
\def\noligaturesquoteleft{\relax\lq}
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
% Font commands.
% #1 is the font command (\sl or \it), #2 is the text to slant.
% If we are in a monospaced environment, however, 1) always use \ttsl,
% and 2) do not add an italic correction.
\def\dosmartslant#1#2{%
\ifusingtt
{{\ttsl #2}\let\next=\relax}%
{\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
\next
}
\def\smartslanted{\dosmartslant\sl}
\def\smartitalic{\dosmartslant\it}
% Output an italic correction unless \next (presumed to be the following
% character) is such as not to need one.
\def\smartitaliccorrection{%
\ifx\next,%
\else\ifx\next-%
\else\ifx\next.%
\else\ifx\next\.%
\else\ifx\next\comma%
\else\ptexslash
\fi\fi\fi\fi\fi
\aftersmartic
}
% Unconditional use \ttsl, and no ic. @var is set to this for defuns.
\def\ttslanted#1{{\ttsl #1}}
% @cite is like \smartslanted except unconditionally use \sl. We never want
% ttsl for book titles, do we?
\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
\def\aftersmartic{}
\def\var#1{%
\let\saveaftersmartic = \aftersmartic
\def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
\smartslanted{#1}%
}
\let\i=\smartitalic
\let\slanted=\smartslanted
\let\dfn=\smartslanted
\let\emph=\smartitalic
% Explicit font changes: @r, @sc, undocumented @ii.
\def\r#1{{\rm #1}} % roman font
\def\sc#1{{\smallcaps#1}} % smallcaps font
\def\ii#1{{\it #1}} % italic font
% @b, explicit bold. Also @strong.
\def\b#1{{\bf #1}}
\let\strong=\b
% @sansserif, explicit sans.
\def\sansserif#1{{\sf #1}}
% We can't just use \exhyphenpenalty, because that only has effect at
% the end of a paragraph. Restore normal hyphenation at the end of the
% group within which \nohyphenation is presumably called.
%
\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
\def\restorehyphenation{\hyphenchar\font = `- }
% Set sfcode to normal for the chars that usually have another value.
% Can't use plain's \frenchspacing because it uses the `\x notation, and
% sometimes \x has an active definition that messes things up.
%
\catcode`@=11
\def\plainfrenchspacing{%
\sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
\sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
\def\endofsentencespacefactor{1000}% for @. and friends
}
\def\plainnonfrenchspacing{%
\sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
\sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
\def\endofsentencespacefactor{3000}% for @. and friends
}
\catcode`@=\other
\def\endofsentencespacefactor{3000}% default
% @t, explicit typewriter.
\def\t#1{%
{\tt \plainfrenchspacing #1}%
\null
}
% @samp.
\def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
% @indicateurl is \samp, that is, with quotes.
\let\indicateurl=\samp
% @code (and similar) prints in typewriter, but with spaces the same
% size as normal in the surrounding text, without hyphenation, etc.
% This is a subroutine for that.
\def\tclose#1{%
{%
% Change normal interword space to be same as for the current font.
\spaceskip = \fontdimen2\font
%
% Switch to typewriter.
\tt
%
% But `\ ' produces the large typewriter interword space.
\def\ {{\spaceskip = 0pt{} }}%
%
% Turn off hyphenation.
\nohyphenation
%
\plainfrenchspacing
#1%
}%
\null % reset spacefactor to 1000
}
% We *must* turn on hyphenation at `-' and `_' in @code.
% (But see \codedashfinish below.)
% Otherwise, it is too hard to avoid overfull hboxes
% in the Emacs manual, the Library manual, etc.
%
% Unfortunately, TeX uses one parameter (\hyphenchar) to control
% both hyphenation at - and hyphenation within words.
% We must therefore turn them both off (\tclose does that)
% and arrange explicitly to hyphenate at a dash. -- rms.
{
\catcode`\-=\active \catcode`\_=\active
\catcode`\'=\active \catcode`\`=\active
\global\let'=\rq \global\let`=\lq % default definitions
%
\global\def\code{\begingroup
\setcodequotes
\catcode\dashChar=\active \catcode\underChar=\active
\ifallowcodebreaks
\let-\codedash
\let_\codeunder
\else
\let-\normaldash
\let_\realunder
\fi
% Given -foo (with a single dash), we do not want to allow a break
% after the hyphen.
\global\let\codedashprev=\codedash
%
\codex
}
%
\gdef\codedash{\futurelet\next\codedashfinish}
\gdef\codedashfinish{%
\normaldash % always output the dash character itself.
%
% Now, output a discretionary to allow a line break, unless
% (a) the next character is a -, or
% (b) the preceding character is a -.
% E.g., given --posix, we do not want to allow a break after either -.
% Given --foo-bar, we do want to allow a break between the - and the b.
\ifx\next\codedash \else
\ifx\codedashprev\codedash
\else \discretionary{}{}{}\fi
\fi
% we need the space after the = for the case when \next itself is a
% space token; it would get swallowed otherwise. As in @code{- a}.
\global\let\codedashprev= \next
}
}
\def\normaldash{-}
%
\def\codex #1{\tclose{#1}\endgroup}
\def\codeunder{%
% this is all so @math{@code{var_name}+1} can work. In math mode, _
% is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
% will therefore expand the active definition of _, which is us
% (inside @code that is), therefore an endless loop.
\ifusingtt{\ifmmode
\mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
\else\normalunderscore \fi
\discretionary{}{}{}}%
{\_}%
}
% An additional complication: the above will allow breaks after, e.g.,
% each of the four underscores in __typeof__. This is bad.
% @allowcodebreaks provides a document-level way to turn breaking at -
% and _ on and off.
%
\newif\ifallowcodebreaks \allowcodebreakstrue
\def\keywordtrue{true}
\def\keywordfalse{false}
\parseargdef\allowcodebreaks{%
\def\txiarg{#1}%
\ifx\txiarg\keywordtrue
\allowcodebreakstrue
\else\ifx\txiarg\keywordfalse
\allowcodebreaksfalse
\else
\errhelp = \EMsimple
\errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
\fi\fi
}
% For @command, @env, @file, @option quotes seem unnecessary,
% so use \code rather than \samp.
\let\command=\code
\let\env=\code
\let\file=\code
\let\option=\code
% @uref (abbreviation for `urlref') aka @url takes an optional
% (comma-separated) second argument specifying the text to display and
% an optional third arg as text to display instead of (rather than in
% addition to) the url itself. First (mandatory) arg is the url.
% TeX-only option to allow changing PDF output to show only the second
% arg (if given), and not the url (which is then just the link target).
\newif\ifurefurlonlylink
% The default \pretolerance setting stops the penalty inserted in
% \urefallowbreak being a discouragement to line breaking. Set it to
% a negative value for this paragraph only. Hopefully this does not
% conflict with redefinitions of \par done elsewhere.
\def\nopretolerance{%
\pretolerance=-1
\def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
}
% The main macro is \urefbreak, which allows breaking at expected
% places within the url.
\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
\let\uref=\urefbreak
%
\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
\unsepspaces
\pdfurl{#1}%
\setbox0 = \hbox{\ignorespaces #3}%
\ifdim\wd0 > 0pt
\unhbox0 % third arg given, show only that
\else
\setbox0 = \hbox{\ignorespaces #2}% look for second arg
\ifdim\wd0 > 0pt
\ifpdf
% For pdfTeX and LuaTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
\unhbox0
\else
% PDF, normally display both arg and url for consistency,
% visibility, if the pdf is eventually used to print, etc.
\unhbox0\ (\urefcode{#1})%
\fi
\else
\ifx\XeTeXrevision\thisisundefined
\unhbox0\ (\urefcode{#1})% DVI, always show arg and url
\else
% For XeTeX
\ifurefurlonlylink
% PDF plus option to not display url, show just arg
\unhbox0
\else
% PDF, normally display both arg and url for consistency,
% visibility, if the pdf is eventually used to print, etc.
\unhbox0\ (\urefcode{#1})%
\fi
\fi
\fi
\else
\urefcode{#1}% only url given, so show it
\fi
\fi
\endlink
\endgroup}
% Allow line breaks around only a few characters (only).
\def\urefcatcodes{%
\catcode`\&=\active \catcode`\.=\active
\catcode`\#=\active \catcode`\?=\active
\catcode`\/=\active
}
{
\urefcatcodes
%
\global\def\urefcode{\begingroup
\setcodequotes
\urefcatcodes
\let&\urefcodeamp
\let.\urefcodedot
\let#\urefcodehash
\let?\urefcodequest
\let/\urefcodeslash
\codex
}
%
% By default, they are just regular characters.
\global\def&{\normalamp}
\global\def.{\normaldot}
\global\def#{\normalhash}
\global\def?{\normalquest}
\global\def/{\normalslash}
}
\def\urefcodeamp{\urefprebreak \&\urefpostbreak}
\def\urefcodedot{\urefprebreak .\urefpostbreak}
\def\urefcodehash{\urefprebreak \#\urefpostbreak}
\def\urefcodequest{\urefprebreak ?\urefpostbreak}
\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
{
\catcode`\/=\active
\global\def\urefcodeslashfinish{%
\urefprebreak \slashChar
% Allow line break only after the final / in a sequence of
% slashes, to avoid line break between the slashes in http://.
\ifx\next/\else \urefpostbreak \fi
}
}
% By default we'll break after the special characters, but some people like to
% break before the special chars, so allow that. Also allow no breaking at
% all, for manual control.
%
\parseargdef\urefbreakstyle{%
\def\txiarg{#1}%
\ifx\txiarg\wordnone
\def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordbefore
\def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
\else\ifx\txiarg\wordafter
\def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
\else
\errhelp = \EMsimple
\errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
\fi\fi\fi
}
\def\wordafter{after}
\def\wordbefore{before}
\def\wordnone{none}
% Allow a ragged right output to aid breaking long URL's. There can
% be a break at the \allowbreak with no extra glue (if the existing stretch in
% the line is sufficient), a break at the \penalty with extra glue added
% 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.
\def\urefallowbreak{%
\penalty0\relax
\hskip 0pt plus 2 em\relax
\penalty1000\relax
\hskip 0pt plus -2 em\relax
}
\urefbreakstyle after
% @url synonym for @uref, since that's how everyone uses it.
%
\let\url=\uref
% rms does not like angle brackets --karl, 17may97.
% So now @email is just like @uref, unless we are pdf.
%
%\def\email#1{\angleleft{\tt #1}\angleright}
\ifpdforxetex
\def\email#1{\doemail#1,,\finish}
\def\doemail#1,#2,#3\finish{\begingroup
\unsepspaces
\pdfurl{mailto:#1}%
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
\endlink
\endgroup}
\else
\let\email=\uref
\fi
% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
% `example' (@kbd uses ttsl only inside of @example and friends),
% or `code' (@kbd uses normal tty font always).
\parseargdef\kbdinputstyle{%
\def\txiarg{#1}%
\ifx\txiarg\worddistinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
\else\ifx\txiarg\wordexample
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\txiarg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\else
\errhelp = \EMsimple
\errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
\fi\fi\fi
}
\def\worddistinct{distinct}
\def\wordexample{example}
\def\wordcode{code}
% Default is `distinct'.
\kbdinputstyle distinct
% @kbd is like @code, except that if the argument is just one @key command,
% then @kbd has no effect.
\def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
\def\xkey{\key}
\def\kbdsub#1#2#3\par{%
\def\one{#1}\def\three{#3}\def\threex{??}%
\ifx\one\xkey\ifx\threex\three \key{#2}%
\else{\tclose{\kbdfont\setcodequotes\look}}\fi
\else{\tclose{\kbdfont\setcodequotes\look}}\fi
}
% definition of @key that produces a lozenge. Doesn't adjust to text size.
%\setfont\keyrm\rmshape{8}{1000}{OT1}
%\font\keysy=cmsy9
%\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
% \vbox{\hrule\kern-0.4pt
% \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
% \kern-0.4pt\hrule}%
% \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% definition of @key with no lozenge. If the current font is already
% monospace, don't change it; that way, we respect @kbdinputstyle. But
% if it isn't monospace, then use \tt.
%
\def\key#1{{\setregularquotes
\nohyphenation
\ifmonospace\else\tt\fi
#1}\null}
% @clicksequence{File @click{} Open ...}
\def\clicksequence#1{\begingroup #1\endgroup}
% @clickstyle @arrow (by default)
\parseargdef\clickstyle{\def\click{#1}}
\def\click{\arrow}
% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
%
\def\dmn#1{\thinspace #1}
% @acronym for "FBI", "NATO", and the like.
% We print this one point size smaller, since it's intended for
% all-uppercase.
%
\def\acronym#1{\doacronym #1,,\finish}
\def\doacronym#1,#2,#3\finish{%
{\switchtolsize #1}%
\def\temp{#2}%
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
\fi
\null % reset \spacefactor=1000
}
% @abbr for "Comput. J." and the like.
% No font change, but don't do end-of-sentence spacing.
%
\def\abbr#1{\doabbr #1,,\finish}
\def\doabbr#1,#2,#3\finish{%
{\plainfrenchspacing #1}%
\def\temp{#2}%
\ifx\temp\empty \else
\space ({\unsepspaces \ignorespaces \temp \unskip})%
\fi
\null % reset \spacefactor=1000
}
% @asis just yields its argument. Used with @table, for example.
%
\def\asis#1{#1}
% @math outputs its argument in math mode.
%
% One complication: _ usually means subscripts, but it could also mean
% an actual _ character, as in @math{@var{some_variable} + 1}. So make
% _ active, and distinguish by seeing if the current family is \slfam,
% which is what @var uses.
{
\catcode`\_ = \active
\gdef\mathunderscore{%
\catcode`\_=\active
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
}
}
% Another complication: we want \\ (and @\) to output a math (or tt) \.
% FYI, plain.tex uses \\ as a temporary control sequence (for no
% particular reason), but this is not advertised and we don't care.
%
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
%
\def\math{%
\ifmmode\else % only go into math if not in math mode already
\tex
\mathunderscore
\let\\ = \mathbackslash
\mathactive
% make the texinfo accent commands work in math mode
\let\"=\ddot
\let\'=\acute
\let\==\bar
\let\^=\hat
\let\`=\grave
\let\u=\breve
\let\v=\check
\let\~=\tilde
\let\dotaccent=\dot
% have to provide another name for sup operator
\let\mathopsup=\sup
$\expandafter\finishmath\fi
}
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
% Some active characters (such as <) are spaced differently in math.
% We have to reset their definitions in case the @math was an argument
% to a command which sets the catcodes (such as @item or @section).
%
{
\catcode`^ = \active
\catcode`< = \active
\catcode`> = \active
\catcode`+ = \active
\catcode`' = \active
\gdef\mathactive{%
\let^ = \ptexhat
\let< = \ptexless
\let> = \ptexgtr
\let+ = \ptexplus
\let' = \ptexquoteright
}
}
% for @sub and @sup, if in math mode, just do a normal sub/superscript.
% If in text, use math to place as sub/superscript, but switch
% into text mode, with smaller fonts. This is a different font than the
% one used for real math sub/superscripts (8pt vs. 7pt), but let's not
% fix it (significant additions to font machinery) until someone notices.
%
\def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
%
\def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
% provide this command from LaTeX as it is very common
\def\frac#1#2{{{#1}\over{#2}}}
% @displaymath.
% \globaldefs is needed to recognize the end lines in \tex and
% \end tex. Set \thisenv as @end displaymath is seen before @end tex.
{\obeylines
\globaldefs=1
\envdef\displaymath{%
\tex%
\def\thisenv{\displaymath}%
\begingroup\let\end\displaymathend%
$$%
}
\def\displaymathend{$$\endgroup\end}%
\def\Edisplaymath{%
\def\thisenv{\tex}%
\end tex
}}
% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
% except specified as a normal braced arg, so no newlines to worry about.
%
\def\outfmtnametex{tex}
%
\long\def\inlinefmt#1{\doinlinefmt #1,\finish}
\long\def\doinlinefmt#1,#2,\finish{%
\def\inlinefmtname{#1}%
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
}
%
% @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
% FMTNAME is tex, else ELSE-TEXT.
\long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
\long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
\def\inlinefmtname{#1}%
\ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
}
%
% For raw, must switch into @tex before parsing the argument, to avoid
% setting catcodes prematurely. Doing it this way means that, for
% example, @inlineraw{html, foo{bar} gets a parse error instead of being
% ignored. But this isn't important because if people want a literal
% *right* brace they would have to use a command anyway, so they may as
% well use a command to get a left brace too. We could re-use the
% delimiter character idea from \verb, but it seems like overkill.
%
\long\def\inlineraw{\tex \doinlineraw}
\long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
\def\doinlinerawtwo#1,#2,\finish{%
\def\inlinerawname{#1}%
\ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
\endgroup % close group opened by \tex.
}
% @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
%
\long\def\inlineifset#1{\doinlineifset #1,\finish}
\long\def\doinlineifset#1,#2,\finish{%
\def\inlinevarname{#1}%
\expandafter\ifx\csname SET\inlinevarname\endcsname\relax
\else\ignorespaces#2\fi
}
% @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
%
\long\def\inlineifclear#1{\doinlineifclear #1,\finish}
\long\def\doinlineifclear#1,#2,\finish{%
\def\inlinevarname{#1}%
\expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
}
\message{glyphs,}
% and logos.
% @@ prints an @, as does @atchar{}.
\def\@{\char64 }
\let\atchar=\@
% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}}
\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}}
\let\{=\lbracechar
\let\}=\rbracechar
% @comma{} to avoid , parsing problems.
\let\comma = ,
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \ptexc
\let\dotaccent = \ptexdot
\def\ringaccent#1{{\accent23 #1}}
\let\tieaccent = \ptext
\let\ubaraccent = \ptexb
\let\udotaccent = \d
% Other special characters: @questiondown @exclamdown @ordf @ordm
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
% Dotless i and dotless j, used for accents.
\def\imacro{i}
\def\jmacro{j}
\def\dotless#1{%
\def\temp{#1}%
\ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
\else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
\else \errmessage{@dotless can be used only with i or j}%
\fi\fi
}
% The \TeX{} logo, as in plain, but resetting the spacing so that a
% period following counts as ending a sentence. (Idea found in latex.)
%
\edef\TeX{\TeX \spacefactor=1000 }
% @LaTeX{} logo. Not quite the same results as the definition in
% latex.ltx, since we use a different font for the raised A; it's most
% convenient for us to use an explicitly smaller font, rather than using
% the \scriptstyle font (since we don't reset \scriptstyle and
% \scriptscriptstyle).
%
\def\LaTeX{%
L\kern-.36em
{\setbox0=\hbox{T}%
\vbox to \ht0{\hbox{%
\ifx\textnominalsize\xwordpt
% for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
% Revert to plain's \scriptsize, which is 7pt.
\count255=\the\fam $\fam\count255 \scriptstyle A$%
\else
% For 11pt, we can use our lllsize.
\switchtolllsize A%
\fi
}%
\vss
}}%
\kern-.15em
\TeX
}
% Some math mode symbols. Define \ensuremath to switch into math mode
% unless we are already there. Expansion tricks may not be needed here,
% but safer, and can't hurt.
\def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
\def\ensuredmath#1{$\relax#1$}
%
\def\bullet{\ensuremath\ptexbullet}
\def\geq{\ensuremath\ge}
\def\leq{\ensuremath\le}
\def\minus{\ensuremath-}
% @dots{} outputs an ellipsis using the current font.
% We do .5em per period so that it has the same spacing in the cm
% typewriter fonts as three actual period characters; on the other hand,
% in other typewriter fonts three periods are wider than 1.5em. So do
% whichever is larger.
%
\def\dots{%
\leavevmode
\setbox0=\hbox{...}% get width of three periods
\ifdim\wd0 > 1.5em
\dimen0 = \wd0
\else
\dimen0 = 1.5em
\fi
\hbox to \dimen0{%
\hskip 0pt plus.25fil
.\hskip 0pt plus1fil
.\hskip 0pt plus1fil
.\hskip 0pt plus.5fil
}%
}
% @enddots{} is an end-of-sentence ellipsis.
%
\def\enddots{%
\dots
\spacefactor=\endofsentencespacefactor
}
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
%
% Since these characters are used in examples, they should be an even number of
% \tt widths. Each \tt character is 1en, so two makes it 1em.
%
\def\point{$\star$}
\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
% The @error{} command.
% Adapted from the TeXbook's \boxit.
%
\newbox\errorbox
%
{\ttfont \global\dimen0 = 3em}% Width of the box.
\dimen2 = .55pt % Thickness of rules
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
%
\setbox\errorbox=\hbox to \dimen0{\hfil
\hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
\advance\hsize by -2\dimen2 % Rules.
\vbox{%
\hrule height\dimen2
\hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
\vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
\kern3pt\vrule width\dimen2}% Space to right.
\hrule height\dimen2}
\hfil}
%
\def\error{\leavevmode\lower.7ex\copy\errorbox}
% @pounds{} is a sterling sign, which Knuth put in the CM italic font.
%
\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi}
% @euro{} comes from a separate font, depending on the current style.
% We use the free feym* fonts from the eurosym package by Henrik
% Theiling, which support regular, slanted, bold and bold slanted (and
% "outlined" (blackboard board, sort of) versions, which we don't need).
% It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
%
% Although only regular is the truly official Euro symbol, we ignore
% that. The Euro is designed to be slightly taller than the regular
% font height.
%
% feymr - regular
% feymo - slanted
% feybr - bold
% feybo - bold slanted
%
% There is no good (free) typewriter version, to my knowledge.
% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
% Hmm.
%
% Also doesn't work in math. Do we need to do math with euro symbols?
% Hope not.
%
%
\def\euro{{\eurofont e}}
\def\eurofont{%
% We set the font at each command, rather than predefining it in
% \textfonts and the other font-switching commands, so that
% installations which never need the symbol don't have to have the
% font installed.
%
% There is only one designed size (nominal 10pt), so we always scale
% that to the current nominal size.
%
% By the way, simply using "at 1em" works for cmr10 and the like, but
% does not work for cmbx10 and other extended/shrunken fonts.
%
\def\eurosize{\csname\curfontsize nominalsize\endcsname}%
%
\ifx\curfontstyle\bfstylename
% bold:
\font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
\else
% regular:
\font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
\fi
\thiseurofont
}
% Glyphs from the EC fonts. We don't use \let for the aliases, because
% sometimes we redefine the original macro, and the alias should reflect
% the redefinition.
%
% Use LaTeX names for the Icelandic letters.
\def\DH{{\ecfont \char"D0}} % Eth
\def\dh{{\ecfont \char"F0}} % eth
\def\TH{{\ecfont \char"DE}} % Thorn
\def\th{{\ecfont \char"FE}} % thorn
%
\def\guillemetleft{{\ecfont \char"13}}
\def\guillemotleft{\guillemetleft}
\def\guillemetright{{\ecfont \char"14}}
\def\guillemotright{\guillemetright}
\def\guilsinglleft{{\ecfont \char"0E}}
\def\guilsinglright{{\ecfont \char"0F}}
\def\quotedblbase{{\ecfont \char"12}}
\def\quotesinglbase{{\ecfont \char"0D}}
%
% This positioning is not perfect (see the ogonek LaTeX package), but
% we have the precomposed glyphs for the most common cases. We put the
% tests to use those glyphs in the single \ogonek macro so we have fewer
% dummy definitions to worry about for index entries, etc.
%
% ogonek is also used with other letters in Lithuanian (IOU), but using
% the precomposed glyphs for those is not so easy since they aren't in
% the same EC font.
\def\ogonek#1{{%
\def\temp{#1}%
\ifx\temp\macrocharA\Aogonek
\else\ifx\temp\macrochara\aogonek
\else\ifx\temp\macrocharE\Eogonek
\else\ifx\temp\macrochare\eogonek
\else
\ecfont \setbox0=\hbox{#1}%
\ifdim\ht0=1ex\accent"0C #1%
\else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
\fi
\fi\fi\fi\fi
}%
}
\def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
\def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
\def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
\def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
%
% Use the European Computer Modern fonts (cm-super in outline format)
% for non-CM glyphs. That is ec* for regular text and tc* for the text
% companion symbols (LaTeX TS1 encoding). Both are part of the ec
% package and follow the same conventions.
%
\def\ecfont{\etcfont{e}}
\def\tcfont{\etcfont{t}}
%
\def\etcfont#1{%
% We can't distinguish serif/sans and italic/slanted, but this
% is used for crude hacks anyway (like adding French and German
% quotes to documents typeset with CM, where we lose kerning), so
% hopefully nobody will notice/care.
\edef\ecsize{\csname\curfontsize ecsize\endcsname}%
\edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
\ifmonospace
% typewriter:
\font\thisecfont = #1ctt\ecsize \space at \nominalsize
\else
\ifx\curfontstyle\bfstylename
% bold:
\font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
\else
% regular:
\font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
\fi
\fi
\thisecfont
}
% @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.
%
\def\registeredsymbol{%
$^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
\hfil\crcr\Orb}}%
}$%
}
% @textdegree - the normal degrees sign.
%
\def\textdegree{$^\circ$}
% Laurent Siebenmann reports \Orb undefined with:
% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
% so we'll define it if necessary.
%
\ifx\Orb\thisisundefined
\def\Orb{\mathhexbox20D}
\fi
% Quotes.
\chardef\quoteleft=`\`
\chardef\quoteright=`\'
% only change font for tt for correct kerning and to avoid using
% \ecfont unless necessary.
\def\quotedblleft{%
\ifmonospace{\ecfont\char"10}\else{\char"5C}\fi
}
\def\quotedblright{%
\ifmonospace{\ecfont\char"11}\else{\char`\"}\fi
}
\message{page headings,}
\newskip\titlepagetopglue \titlepagetopglue = 1.5in
\newskip\titlepagebottomglue \titlepagebottomglue = 2pc
% First the title page. Must do @settitle before @titlepage.
\newif\ifseenauthor
\newif\iffinishedtitlepage
% @setcontentsaftertitlepage used to do an implicit @contents or
% @shortcontents after @end titlepage, but it is now obsolete.
\def\setcontentsaftertitlepage{%
\errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
command; move your @contents command if you want the contents
after the title page.}}%
\def\setshortcontentsaftertitlepage{%
\errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
command; move your @shortcontents and @contents commands if you
want the contents after the title page.}}%
\parseargdef\shorttitlepage{%
\begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
\endgroup\page\hbox{}\page}
\envdef\titlepage{%
% Open one extra group, as we want to close it in the middle of \Etitlepage.
\begingroup
\parindent=0pt \textfonts
% Leave some space at the very top of the page.
\vglue\titlepagetopglue
% No rule at page bottom unless we print one at the top with @title.
\finishedtitlepagetrue
%
% Most title ``pages'' are actually two pages long, with space
% at the top of the second. We don't want the ragged left on the second.
\let\oldpage = \page
\def\page{%
\iffinishedtitlepage\else
\finishtitlepage
\fi
\let\page = \oldpage
\page
\null
}%
}
\def\Etitlepage{%
\iffinishedtitlepage\else
\finishtitlepage
\fi
% It is important to do the page break before ending the group,
% because the headline and footline are only empty inside the group.
% If we use the new definition of \page, we always get a blank page
% after the title page, which we certainly don't want.
\oldpage
\endgroup
%
% Need this before the \...aftertitlepage checks so that if they are
% in effect the toc pages will come out with page numbers.
\HEADINGSon
}
\def\finishtitlepage{%
\vskip4pt \hrule height 2pt width \hsize
\vskip\titlepagebottomglue
\finishedtitlepagetrue
}
% Settings used for typesetting titles: no hyphenation, no indentation,
% don't worry much about spacing, ragged right. This should be used
% inside a \vbox, and fonts need to be set appropriately first. \par should
% be specified before the end of the \vbox, since a vbox is a group.
%
\def\raggedtitlesettings{%
\rm
\hyphenpenalty=10000
\parindent=0pt
\tolerance=5000
\ptexraggedright
}
% Macros to be used within @titlepage:
\let\subtitlerm=\rmfont
\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
\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
}
\parseargdef\subtitle{%
\checkenv\titlepage
{\subtitlefont \rightline{#1}}%
}
% @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.
\else
\checkenv\titlepage
\ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
{\secfonts\rm \leftline{#1}}%
\fi
}
% Set up page headings and footings.
\let\thispage=\folio
\newtoks\evenheadline % headline on even pages
\newtoks\oddheadline % headline on odd pages
\newtoks\evenchapheadline% headline on even pages with a new chapter
\newtoks\oddchapheadline % headline on odd pages with a new chapter
\newtoks\evenfootline % footline on even pages
\newtoks\oddfootline % footline on odd pages
% Now make \makeheadline and \makefootline in Plain TeX use those variables
\headline={{\textfonts\rm
\ifchapterpage
\ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
\else
\ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
\fi}}
\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
\else \the\evenfootline \fi}\HEADINGShook}
\let\HEADINGShook=\relax
% Commands to set those variables.
% For example, this is what @headings on does
% @evenheading @thistitle|@thispage|@thischapter
% @oddheading @thischapter|@thispage|@thistitle
% @evenfooting @thisfile||
% @oddfooting ||@thisfile
\def\evenheading{\parsearg\evenheadingxxx}
\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
\def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
\global\evenchapheadline=\evenheadline}
\def\oddheading{\parsearg\oddheadingxxx}
\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
\def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
\global\oddchapheadline=\oddheadline}
\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
\def\evenfooting{\parsearg\evenfootingxxx}
\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
\def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
\def\oddfooting{\parsearg\oddfootingxxx}
\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
\def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
\global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
%
% Leave some space for the footline. Hopefully ok to assume
% @evenfooting will not be used by itself.
\global\advance\txipageheight by -12pt
\global\advance\vsize by -12pt
}
\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
% @evenheadingmarks top \thischapter <- chapter at the top of a page
% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
%
% The same set of arguments for:
%
% @oddheadingmarks
% @evenfootingmarks
% @oddfootingmarks
% @everyheadingmarks
% @everyfootingmarks
% These define \getoddheadingmarks, \getevenheadingmarks,
% \getoddfootingmarks, and \getevenfootingmarks, each to one of
% \gettopheadingmarks, \getbottomheadingmarks.
%
\def\evenheadingmarks{\headingmarks{even}{heading}}
\def\oddheadingmarks{\headingmarks{odd}{heading}}
\def\evenfootingmarks{\headingmarks{even}{footing}}
\def\oddfootingmarks{\headingmarks{odd}{footing}}
\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
\headingmarks{odd}{heading}{#1} }
\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
\headingmarks{odd}{footing}{#1} }
% #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
\def\headingmarks#1#2#3 {%
\expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
\global\expandafter\let\csname get#1#2marks\endcsname \temp
}
\everyheadingmarks bottom
\everyfootingmarks bottom
% @headings double turns headings on for double-sided printing.
% @headings single turns headings on for single-sided printing.
% @headings off turns them off.
% @headings on same as @headings double, retained for compatibility.
% @headings after turns on double-sided headings after this page.
% @headings doubleafter turns on double-sided headings after this page.
% @headings singleafter turns on single-sided headings after this page.
% By default, they are off at the start of a document,
% and turned `on' after @end titlepage.
\parseargdef\headings{\csname HEADINGS#1\endcsname}
\def\headingsoff{% non-global headings elimination
\evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
\oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
}
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
\HEADINGSoff % it's the default
% When we turn headings on, set the page number to 1.
\def\pageone{
\global\pageno=1
\global\arabiccount = \pagecount
}
% For double-sided printing, put current file name in lower left corner,
% chapter name on inside top of right hand pages, document
% title on inside top of left hand pages, and page numbers on outside top
% edge of all pages.
\def\HEADINGSdouble{%
\pageone
\HEADINGSdoublex
}
\let\contentsalignmacro = \chappager
% For single-sided printing, chapter title goes across top left of page,
% page number on top right.
\def\HEADINGSsingle{%
\pageone
\HEADINGSsinglex
}
\def\HEADINGSon{\HEADINGSdouble}
\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
\let\HEADINGSdoubleafter=\HEADINGSafter
\def\HEADINGSdoublex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\folio\hfil\thistitle}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\evenchapheadline={\line{\folio\hfil}}
\global\oddchapheadline={\line{\hfil\folio}}
\global\let\contentsalignmacro = \chapoddpage
}
\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
\def\HEADINGSsinglex{%
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\evenchapheadline={\line{\hfil\folio}}
\global\oddchapheadline={\line{\hfil\folio}}
\global\let\contentsalignmacro = \chappager
}
% for @setchapternewpage off
\def\HEADINGSsinglechapoff{%
\pageone
\global\evenfootline={\hfil}
\global\oddfootline={\hfil}
\global\evenheadline={\line{\thischapter\hfil\folio}}
\global\oddheadline={\line{\thischapter\hfil\folio}}
\global\evenchapheadline=\evenheadline
\global\oddchapheadline=\oddheadline
\global\let\contentsalignmacro = \chappager
}
% Subroutines used in generating headings
% This produces Day Month Year style of output.
% Only define if not already defined, in case a txi-??.tex file has set
% up a different format (e.g., txi-cs.tex does this).
\ifx\today\thisisundefined
\def\today{%
\number\day\space
\ifcase\month
\or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
\or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
\or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
\fi
\space\number\year}
\fi
% @settitle line... specifies the title of the document, for headings.
% It generates no output of its own.
\def\thistitle{\putwordNoTitle}
\def\settitle{\parsearg{\gdef\thistitle}}
\message{tables,}
% Tables -- @table, @ftable, @vtable, @item(x).
% default indentation of table text
\newdimen\tableindent \tableindent=.8in
% default indentation of @itemize and @enumerate text
\newdimen\itemindent \itemindent=.3in
% margin between end of table item and start of table text.
\newdimen\itemmargin \itemmargin=.1in
% used internally for \itemindent minus \itemmargin
\newdimen\itemmax
% Note @table, @ftable, and @vtable define @item, @itemx, etc., with
% these defs.
% They also define \itemindex
% to index the item name in whatever manner is desired (perhaps none).
\newif\ifitemxneedsnegativevskip
\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
\def\internalBitem{\smallbreak \parsearg\itemzzz}
\def\internalBitemx{\itemxpar \parsearg\itemzzz}
\def\itemzzz #1{\begingroup %
\advance\hsize by -\rightskip
\advance\hsize by -\tableindent
\setbox0=\hbox{\itemindicate{#1}}%
\itemindex{#1}%
\nobreak % This prevents a break before @itemx.
%
% If the item text does not fit in the space we have, put it on a line
% by itself, and do not allow a page break either before or after that
% line. We do not start a paragraph here because then if the next
% command is, e.g., @kindex, the whatsit would get put into the
% horizontal list on a line by itself, resulting in extra blank space.
\ifdim \wd0>\itemmax
%
% Make this a paragraph so we get the \parskip glue and wrapping,
% but leave it ragged-right.
\begingroup
\advance\leftskip by-\tableindent
\advance\hsize by\tableindent
\advance\rightskip by0pt plus1fil\relax
\leavevmode\unhbox0\par
\endgroup
%
% We're going to be starting a paragraph, but we don't want the
% \parskip glue -- logically it's part of the @item we just started.
\nobreak \vskip-\parskip
%
% Stop a page break at the \parskip glue coming up. However, if
% what follows is an environment such as @example, there will be no
% \parskip glue; then the negative vskip we just inserted would
% cause the example and the item to crash together. So we use this
% bizarre value of 10001 as a signal to \aboveenvbreak to insert
% \parskip glue after all. Section titles are handled this way also.
%
\penalty 10001
\endgroup
\itemxneedsnegativevskipfalse
\else
% The item text fits into the space. Start a paragraph, so that the
% following text (if any) will end up on the same line.
\noindent
% Do this with kerns and \unhbox so that if there is a footnote in
% the item text, it can migrate to the main vertical list and
% eventually be printed.
\nobreak\kern-\tableindent
\dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
\unhbox0
\nobreak\kern\dimen0
\endgroup
\itemxneedsnegativevskiptrue
\fi
}
\def\item{\errmessage{@item while not in a list environment}}
\def\itemx{\errmessage{@itemx while not in a list environment}}
% @table, @ftable, @vtable.
\envdef\table{%
\let\itemindex\gobble
\tablecheck{table}%
}
\envdef\ftable{%
\def\itemindex ##1{\doind {fn}{\code{##1}}}%
\tablecheck{ftable}%
}
\envdef\vtable{%
\def\itemindex ##1{\doind {vr}{\code{##1}}}%
\tablecheck{vtable}%
}
\def\tablecheck#1{%
\ifnum \the\catcode`\^^M=\active
\endgroup
\errmessage{This command won't work in this context; perhaps the problem is
that we are \inenvironment\thisenv}%
\def\next{\doignore{#1}}%
\else
\let\next\tablex
\fi
\next
}
\def\tablex#1{%
\def\itemindicate{#1}%
\parsearg\tabley
}
\def\tabley#1{%
{%
\makevalueexpandable
\edef\temp{\noexpand\tablez #1\space\space\space}%
\expandafter
}\temp \endtablez
}
\def\tablez #1 #2 #3 #4\endtablez{%
\aboveenvbreak
\ifnum 0#1>0 \advance \leftskip by #1\mil \fi
\ifnum 0#2>0 \tableindent=#2\mil \fi
\ifnum 0#3>0 \advance \rightskip by #3\mil \fi
\itemmax=\tableindent
\advance \itemmax by -\itemmargin
\advance \leftskip by \tableindent
\exdentamount=\tableindent
\parindent = 0pt
\parskip = \smallskipamount
\ifdim \parskip=0pt \parskip=2pt \fi
\let\item = \internalBitem
\let\itemx = \internalBitemx
}
\def\Etable{\endgraf\afterenvbreak}
\let\Eftable\Etable
\let\Evtable\Etable
\let\Eitemize\Etable
\let\Eenumerate\Etable
% This is the counter used by @enumerate, which is really @itemize
\newcount \itemno
\envdef\itemize{\parsearg\doitemize}
\def\doitemize#1{%
\aboveenvbreak
\itemmax=\itemindent
\advance\itemmax by -\itemmargin
\advance\leftskip by \itemindent
\exdentamount=\itemindent
\parindent=0pt
\parskip=\smallskipamount
\ifdim\parskip=0pt \parskip=2pt \fi
%
% Try typesetting the item mark so that if the document erroneously says
% something like @itemize @samp (intending @table), there's an error
% right away at the @itemize. It's not the best error message in the
% world, but it's better than leaving it to the @item. This means if
% the user wants an empty mark, they have to say @w{} not just @w.
\def\itemcontents{#1}%
\setbox0 = \hbox{\itemcontents}%
%
% @itemize with no arg is equivalent to @itemize @bullet.
\ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
%
\let\item=\itemizeitem
}
% Definition of @item while inside @itemize and @enumerate.
%
\def\itemizeitem{%
\advance\itemno by 1 % for enumerations
{\let\par=\endgraf \smallbreak}% reasonable place to break
{%
% If the document has an @itemize directly after a section title, a
% \nobreak will be last on the list, and \sectionheading will have
% done a \vskip-\parskip. In that case, we don't want to zero
% parskip, or the item text will crash with the heading. On the
% other hand, when there is normal text preceding the item (as there
% usually is), we do want to zero parskip, or there would be too much
% space. In that case, we won't have a \nobreak before. At least
% that's the theory.
\ifnum\lastpenalty<10000 \parskip=0in \fi
\noindent
\hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
%
\ifinner\else
\vadjust{\penalty 1200}% not good to break after first line of item.
\fi
% We can be in inner vertical mode in a footnote, although an
% @itemize looks awful there.
}%
\flushcr
}
% \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder.
%
\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
% Allow an optional argument of an uppercase letter, lowercase letter,
% or number, to specify the first label in the enumerated list. No
% argument is the same as `1'.
%
\envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
\def\enumeratey #1 #2\endenumeratey{%
% If we were given no argument, pretend we were given `1'.
\def\thearg{#1}%
\ifx\thearg\empty \def\thearg{1}\fi
%
% Detect if the argument is a single token. If so, it might be a
% letter. Otherwise, the only valid thing it can be is a number.
% (We will always have one token, because of the test we just made.
% This is a good thing, since \splitoff doesn't work given nothing at
% all -- the first parameter is undelimited.)
\expandafter\splitoff\thearg\endmark
\ifx\rest\empty
% Only one token in the argument. It could still be anything.
% A ``lowercase letter'' is one whose \lccode is nonzero.
% An ``uppercase letter'' is one whose \lccode is both nonzero, and
% not equal to itself.
% Otherwise, we assume it's a number.
%
% We need the \relax at the end of the \ifnum lines to stop TeX from
% continuing to look for a .
%
\ifnum\lccode\expandafter`\thearg=0\relax
\numericenumerate % a number (we hope)
\else
% It's a letter.
\ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
\lowercaseenumerate % lowercase letter
\else
\uppercaseenumerate % uppercase letter
\fi
\fi
\else
% Multiple tokens in the argument. We hope it's a number.
\numericenumerate
\fi
}
% An @enumerate whose labels are integers. The starting integer is
% given in \thearg.
%
\def\numericenumerate{%
\itemno = \thearg
\startenumeration{\the\itemno}%
}
% The starting (lowercase) letter is in \thearg.
\def\lowercaseenumerate{%
\itemno = \expandafter`\thearg
\startenumeration{%
% Be sure we're not beyond the end of the alphabet.
\ifnum\itemno=0
\errmessage{No more lowercase letters in @enumerate; get a bigger
alphabet}%
\fi
\char\lccode\itemno
}%
}
% The starting (uppercase) letter is in \thearg.
\def\uppercaseenumerate{%
\itemno = \expandafter`\thearg
\startenumeration{%
% Be sure we're not beyond the end of the alphabet.
\ifnum\itemno=0
\errmessage{No more uppercase letters in @enumerate; get a bigger
alphabet}
\fi
\char\uccode\itemno
}%
}
% Call \doitemize, adding a period to the first argument and supplying the
% common last two arguments. Also subtract one from the initial value in
% \itemno, since @item increments \itemno.
%
\def\startenumeration#1{%
\advance\itemno by -1
\doitemize{#1.}\flushcr
}
% @multitable macros
% Macros used to set up halign preamble:
%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
% #1 is the @columnfraction, usually a decimal number like .5, but might
% be just 1. We just use it, whatever it is.
%
\def\pickupwholefraction#1 {%
\global\advance\colcount by 1
\expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
\setuptable
}
\newcount\colcount
\def\setuptable#1{%
\def\firstarg{#1}%
\ifx\firstarg\xendsetuptable
\let\go = \relax
\else
\ifx\firstarg\xcolumnfractions
\global\setpercenttrue
\else
\ifsetpercent
\let\go\pickupwholefraction
\else
\global\advance\colcount by 1
\setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
% separator; typically that is always in the input, anyway.
\expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
\fi
\fi
\ifx\go\pickupwholefraction
% Put the argument back for the \pickupwholefraction call, so
% we'll always have a period there to be parsed.
\def\go{\pickupwholefraction#1}%
\else
\let\go = \setuptable
\fi%
\fi
\go
}
% @headitem starts a heading row, which we typeset in bold. Assignments
% have to be global since we are inside the implicit group of an
% alignment entry. \everycr below resets \everytab so we don't have to
% undo it ourselves.
\def\headitemfont{\b}% for people to use in the template row; not changeable
\def\headitem{%
\checkenv\multitable
\crcr
\gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
\global\everytab={\bf}% can't use \headitemfont since the parsing differs
\the\everytab % for the first item
}%
%
% default for tables with no headings.
\let\headitemcrhook=\relax
%
\def\tab{\checkenv\multitable &\the\everytab}%
\newtoks\everytab % insert after every tab.
%
\envdef\multitable{%
\vskip\parskip
\startsavinginserts
%
% @item within a multitable starts a normal row.
% We use \def instead of \let so that if one of the multitable entries
% contains an @itemize, we don't choke on the \item (seen as \crcr aka
% \endtemplate) expanding \doitemize.
\def\item{\crcr}%
%
\tolerance=9500
\hbadness=9500
\parskip=0pt
\parindent=6pt
\overfullrule=0pt
\global\colcount=0
%
\everycr = {%
\noalign{%
\global\everytab={}% Reset from possible headitem.
\global\colcount=0 % Reset the column counter.
%
% Check for saved footnotes, etc.:
\checkinserts
%
% Perhaps a \nobreak, then reset:
\headitemcrhook
\global\let\headitemcrhook=\relax
}%
}%
%
\parsearg\domultitable
}
\def\domultitable#1{%
% To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable
%
% This preamble sets up a generic column definition, which will
% be used as many times as user calls for columns.
% \vtop will set a single line and will also let text wrap and
% continue for many paragraphs if desired.
\halign\bgroup &%
\global\advance\colcount by 1
\strut
\vtop{%
\advance\hsize by -1\leftskip
% Find the correct column width
\hsize=\expandafter\csname col\the\colcount\endcsname
%
\rightskip=0pt
\ifnum\colcount=1
\advance\hsize by\leftskip % Add indent of surrounding text
\else
% In order to keep entries from bumping into each other.
\leftskip=12pt
\ifsetpercent \else
% If a template has been used
\advance\hsize by \leftskip
\fi
\fi
\noindent\ignorespaces##\unskip\strut
}\cr
}
\def\Emultitable{%
\crcr
\egroup % end the \halign
\global\setpercentfalse
}
\message{conditionals,}
% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
% @ifnotxml always succeed. They currently do nothing; we don't
% attempt to check whether the conditionals are properly nested. But we
% have to remember that they are conditionals, so that @end doesn't
% attempt to close an environment group.
%
\def\makecond#1{%
\expandafter\let\csname #1\endcsname = \relax
\expandafter\let\csname iscond.#1\endcsname = 1
}
\makecond{iftex}
\makecond{ifnotdocbook}
\makecond{ifnothtml}
\makecond{ifnotinfo}
\makecond{ifnotplaintext}
\makecond{ifnotxml}
% Ignore @ignore, @ifhtml, @ifinfo, and the like.
%
\def\direntry{\doignore{direntry}}
\def\documentdescription{\doignore{documentdescription}}
\def\docbook{\doignore{docbook}}
\def\html{\doignore{html}}
\def\ifdocbook{\doignore{ifdocbook}}
\def\ifhtml{\doignore{ifhtml}}
\def\ifinfo{\doignore{ifinfo}}
\def\ifnottex{\doignore{ifnottex}}
\def\ifplaintext{\doignore{ifplaintext}}
\def\ifxml{\doignore{ifxml}}
\def\ignore{\doignore{ignore}}
\def\menu{\doignore{menu}}
\def\xml{\doignore{xml}}
% Ignore text until a line `@end #1', keeping track of nested conditionals.
%
% A count to remember the depth of nesting.
\newcount\doignorecount
\def\doignore#1{\begingroup
% Scan in ``verbatim'' mode:
\obeylines
\catcode`\@ = \other
\catcode`\{ = \other
\catcode`\} = \other
%
% Make sure that spaces turn into tokens that match what \doignoretext wants.
\spaceisspace
%
% Count number of #1's that we've seen.
\doignorecount = 0
%
% Swallow text until we reach the matching `@end #1'.
\dodoignore{#1}%
}
{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
\obeylines %
%
\gdef\dodoignore#1{%
% #1 contains the command name as a string, e.g., `ifinfo'.
%
% Define a command to find the next `@end #1'.
\long\def\doignoretext##1^^M@end #1{%
\doignoretextyyy##1^^M@#1\_STOP_}%
%
% And this command to find another #1 command, at the beginning of a
% line. (Otherwise, we would consider a line `@c @ifset', for
% example, to count as an @ifset for nesting.)
\long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
%
% And now expand that command.
\doignoretext ^^M%
}%
}
\def\doignoreyyy#1{%
\def\temp{#1}%
\ifx\temp\empty % Nothing found.
\let\next\doignoretextzzz
\else % Found a nested condition, ...
\advance\doignorecount by 1
\let\next\doignoretextyyy % ..., look for another.
% If we're here, #1 ends with ^^M\ifinfo (for example).
\fi
\next #1% the token \_STOP_ is present just after this macro.
}
% We have to swallow the remaining "\_STOP_".
%
\def\doignoretextzzz#1{%
\ifnum\doignorecount = 0 % We have just found the outermost @end.
\let\next\enddoignore
\else % Still inside a nested condition.
\advance\doignorecount by -1
\let\next\doignoretext % Look for the next @end.
\fi
\next
}
% Finish off ignored text.
{ \obeylines%
% Ignore anything after the last `@end #1'; this matters in verbatim
% environments, where otherwise the newline after an ignored conditional
% would result in a blank line in the output.
\gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
}
% @set VAR sets the variable VAR to an empty value.
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
%
% Since we want to separate VAR from REST-OF-LINE (which might be
% empty), we can't just use \parsearg; we have to insert a space of our
% own to delimit the rest of the line, and then take it out again if we
% didn't need it.
% We rely on the fact that \parsearg sets \catcode`\ =10.
%
\parseargdef\set{\setyyy#1 \endsetyyy}
\def\setyyy#1 #2\endsetyyy{%
{%
\makevalueexpandable
\def\temp{#2}%
\edef\next{\gdef\makecsname{SET#1}}%
\ifx\temp\empty
\next{}%
\else
\setzzz#2\endsetzzz
\fi
}%
}
% Remove the trailing space \setxxx inserted.
\def\setzzz#1 \endsetzzz{\next{#1}}
% @clear VAR clears (i.e., unsets) the variable VAR.
%
\parseargdef\clear{%
{%
\makevalueexpandable
\global\expandafter\let\csname SET#1\endcsname=\relax
}%
}
% @value{foo} gets the text saved in variable foo.
\def\value{\begingroup\makevalueexpandable\valuexxx}
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
{
\catcode`\-=\active \catcode`\_=\active
%
\gdef\makevalueexpandable{%
\let\value = \expandablevalue
% We don't want these characters active, ...
\catcode`\-=\other \catcode`\_=\other
% ..., but we might end up with active ones in the argument if
% we're called from @code, as @code{@value{foo-bar_}}, though.
% So \let them to their normal equivalents.
\let-\normaldash \let_\normalunderscore
}
}
\def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
{[No value for ``#1'']}%
\message{Variable `#1', used in @value, is not set.}%
\else
\csname SET#1\endcsname
\fi
}
% Like \expandablevalue, but completely expandable (the \message in the
% definition above operates at the execution level of TeX). Used when
% writing to auxiliary files, due to the expansion that \write does.
% If flag is undefined, pass through an unexpanded @value command: maybe it
% will be set by the time it is read back in.
%
% NB flag names containing - or _ may not work here.
\def\dummyvalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
\string\value{#1}%
\else
\csname SET#1\endcsname
\fi
}
% Used for @value's in index entries to form the sort key: expand the @value
% if possible, otherwise sort late.
\def\indexnofontsvalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax
ZZZZZZZ%
\else
\csname SET#1\endcsname
\fi
}
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set.
%
% To get the special treatment we need for `@end ifset,' we call
% \makecond and then redefine.
%
\makecond{ifset}
\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
\def\doifset#1#2{%
{%
\makevalueexpandable
\let\next=\empty
\expandafter\ifx\csname SET#2\endcsname\relax
#1% If not set, redefine \next.
\fi
\expandafter
}\next
}
\def\ifsetfail{\doignore{ifset}}
% @ifclear VAR ... @end executes the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear.
%
% The `\else' inside the `\doifset' parameter is a trick to reuse the
% above code: if the variable is not set, do nothing, if it is set,
% then redefine \next to \ifclearfail.
%
\makecond{ifclear}
\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
\def\ifclearfail{\doignore{ifclear}}
% @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
% without the @) is in fact defined. We can only feasibly check at the
% TeX level, so something like `mathcode' is going to considered
% defined even though it is not a Texinfo command.
%
\makecond{ifcommanddefined}
\def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
%
\def\doifcmddefined#1#2{{%
\makevalueexpandable
\let\next=\empty
\expandafter\ifx\csname #2\endcsname\relax
#1% If not defined, \let\next as above.
\fi
\expandafter
}\next
}
\def\ifcmddefinedfail{\doignore{ifcommanddefined}}
% @ifcommandnotdefined CMD ... handled similar to @ifclear above.
\makecond{ifcommandnotdefined}
\def\ifcommandnotdefined{%
\parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
\def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
% Set the `txicommandconditionals' variable, so documents have a way to
% test if the @ifcommand...defined conditionals are available.
\set txicommandconditionals
% @dircategory CATEGORY -- specify a category of the dir file
% which this file should belong to. Ignore this in TeX.
\let\dircategory=\comment
% @defininfoenclose.
\let\definfoenclose=\comment
\message{indexing,}
% Index generation facilities
% Define \newwrite to be identical to plain tex's \newwrite
% except not \outer, so it can be used within macros and \if's.
\edef\newwrite{\makecsname{ptexnewwrite}}
% \newindex {foo} defines an index named IX.
% It automatically defines \IXindex such that
% \IXindex ...rest of line... puts an entry in the index IX.
% It also defines \IXindfile to be the number of the output channel for
% the file that accumulates this index. The file's extension is IX.
% The name of an index should be no more than 2 characters long
% for the sake of vms.
%
\def\newindex#1{%
\expandafter\chardef\csname#1indfile\endcsname=0
\expandafter\xdef\csname#1index\endcsname{% % Define @#1index
\noexpand\doindex{#1}}
}
% @defindex foo == \newindex{foo}
%
\def\defindex{\parsearg\newindex}
% Define @defcodeindex, like @defindex except put all entries in @code.
%
\def\defcodeindex{\parsearg\newcodeindex}
%
\def\newcodeindex#1{%
\expandafter\chardef\csname#1indfile\endcsname=0
\expandafter\xdef\csname#1index\endcsname{%
\noexpand\docodeindex{#1}}%
}
% The default indices:
\newindex{cp}% concepts,
\newcodeindex{fn}% functions,
\newcodeindex{vr}% variables,
\newcodeindex{tp}% types,
\newcodeindex{ky}% keys
\newcodeindex{pg}% and programs.
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
%
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
%
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
% #3 the target index (bar).
\def\dosynindex#1#2#3{%
\requireopenindexfile{#3}%
% redefine \fooindfile:
\expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
\expandafter\let\csname#2indfile\endcsname=\temp
% redefine \fooindex:
\expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
}
% Define \doindex, the driver for all index macros.
% Argument #1 is generated by the calling \fooindex macro,
% and it is the two-letter name of the index.
\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
\def\doindexxxx #1{\doind{\indexname}{#1}}
% like the previous two, but they put @code around the argument.
\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
\def\docodeindexxxx #1{\docind{\indexname}{#1}}
% Used for the aux, toc and index files to prevent expansion of Texinfo
% commands.
%
\def\atdummies{%
\definedummyletter\@%
\definedummyletter\ %
\definedummyletter\{%
\definedummyletter\}%
\definedummyletter\&%
%
% Do the redefinitions.
\definedummies
\otherbackslash
}
% \definedummyword defines \#1 as \string\#1\space, thus effectively
% preventing its expansion. This is used only for control words,
% not control letters, because the \space would be incorrect for
% control characters, but is needed to separate the control word
% from whatever follows.
%
% These can be used both for control words that take an argument and
% those that do not. If it is followed by {arg} in the input, then
% that will dutifully get written to the index (or wherever).
%
% For control letters, we have \definedummyletter, which omits the
% space.
%
\def\definedummyword #1{\def#1{\string#1\space}}%
\def\definedummyletter#1{\def#1{\string#1}}%
\let\definedummyaccent\definedummyletter
% Called from \atdummies to prevent the expansion of commands.
%
\def\definedummies{%
%
\let\commondummyword\definedummyword
\let\commondummyletter\definedummyletter
\let\commondummyaccent\definedummyaccent
\commondummiesnofonts
%
\definedummyletter\_%
\definedummyletter\-%
%
% Non-English letters.
\definedummyword\AA
\definedummyword\AE
\definedummyword\DH
\definedummyword\L
\definedummyword\O
\definedummyword\OE
\definedummyword\TH
\definedummyword\aa
\definedummyword\ae
\definedummyword\dh
\definedummyword\exclamdown
\definedummyword\l
\definedummyword\o
\definedummyword\oe
\definedummyword\ordf
\definedummyword\ordm
\definedummyword\questiondown
\definedummyword\ss
\definedummyword\th
%
% Although these internal commands shouldn't show up, sometimes they do.
\definedummyword\bf
\definedummyword\gtr
\definedummyword\hat
\definedummyword\less
\definedummyword\sf
\definedummyword\sl
\definedummyword\tclose
\definedummyword\tt
%
\definedummyword\LaTeX
\definedummyword\TeX
%
% Assorted special characters.
\definedummyword\ampchar
\definedummyword\atchar
\definedummyword\arrow
\definedummyword\backslashchar
\definedummyword\bullet
\definedummyword\comma
\definedummyword\copyright
\definedummyword\registeredsymbol
\definedummyword\dots
\definedummyword\enddots
\definedummyword\entrybreak
\definedummyword\equiv
\definedummyword\error
\definedummyword\euro
\definedummyword\expansion
\definedummyword\geq
\definedummyword\guillemetleft
\definedummyword\guillemetright
\definedummyword\guilsinglleft
\definedummyword\guilsinglright
\definedummyword\lbracechar
\definedummyword\leq
\definedummyword\mathopsup
\definedummyword\minus
\definedummyword\ogonek
\definedummyword\pounds
\definedummyword\point
\definedummyword\print
\definedummyword\quotedblbase
\definedummyword\quotedblleft
\definedummyword\quotedblright
\definedummyword\quoteleft
\definedummyword\quoteright
\definedummyword\quotesinglbase
\definedummyword\rbracechar
\definedummyword\result
\definedummyword\sub
\definedummyword\sup
\definedummyword\textdegree
%
\definedummyword\subentry
%
% We want to disable all macros so that they are not expanded by \write.
\macrolist
\let\value\dummyvalue
%
\normalturnoffactive
}
% \commondummiesnofonts: common to \definedummies and \indexnofonts.
% Define \commondummyletter, \commondummyaccent and \commondummyword before
% using. Used for accents, font commands, and various control letters.
%
\def\commondummiesnofonts{%
% Control letters and accents.
\commondummyletter\!%
\commondummyaccent\"%
\commondummyaccent\'%
\commondummyletter\*%
\commondummyaccent\,%
\commondummyletter\.%
\commondummyletter\/%
\commondummyletter\:%
\commondummyaccent\=%
\commondummyletter\?%
\commondummyaccent\^%
\commondummyaccent\`%
\commondummyaccent\~%
\commondummyword\u
\commondummyword\v
\commondummyword\H
\commondummyword\dotaccent
\commondummyword\ogonek
\commondummyword\ringaccent
\commondummyword\tieaccent
\commondummyword\ubaraccent
\commondummyword\udotaccent
\commondummyword\dotless
%
% Texinfo font commands.
\commondummyword\b
\commondummyword\i
\commondummyword\r
\commondummyword\sansserif
\commondummyword\sc
\commondummyword\slanted
\commondummyword\t
%
% Commands that take arguments.
\commondummyword\abbr
\commondummyword\acronym
\commondummyword\anchor
\commondummyword\cite
\commondummyword\code
\commondummyword\command
\commondummyword\dfn
\commondummyword\dmn
\commondummyword\email
\commondummyword\emph
\commondummyword\env
\commondummyword\file
\commondummyword\image
\commondummyword\indicateurl
\commondummyword\inforef
\commondummyword\kbd
\commondummyword\key
\commondummyword\math
\commondummyword\option
\commondummyword\pxref
\commondummyword\ref
\commondummyword\samp
\commondummyword\strong
\commondummyword\tie
\commondummyword\U
\commondummyword\uref
\commondummyword\url
\commondummyword\var
\commondummyword\verb
\commondummyword\w
\commondummyword\xref
}
\let\indexlbrace\relax
\let\indexrbrace\relax
\let\indexatchar\relax
\let\indexbackslash\relax
{\catcode`\@=0
\catcode`\\=13
@gdef@backslashdisappear{@def\{}}
}
{
\catcode`\<=13
\catcode`\-=13
\catcode`\`=13
\gdef\indexnonalnumdisappear{%
\expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
% @set txiindexlquoteignore makes us ignore left quotes in the sort term.
% (Introduced for FSFS 2nd ed.)
\let`=\empty
\fi
%
\expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
\backslashdisappear
\fi
%
\expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
\def-{}%
\fi
\expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
\def<{}%
\fi
\expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
\def\@{}%
\fi
}
\gdef\indexnonalnumreappear{%
\let-\normaldash
\let<\normalless
}
}
% \indexnofonts is used when outputting the strings to sort the index
% by, and when constructing control sequence names. It eliminates all
% control sequences and just writes whatever the best ASCII sort string
% would be for a given command (usually its argument).
%
\def\indexnofonts{%
% Accent commands should become @asis.
\def\commondummyaccent##1{\let##1\asis}%
% We can just ignore other control letters.
\def\commondummyletter##1{\let##1\empty}%
% All control words become @asis by default; overrides below.
\let\commondummyword\commondummyaccent
\commondummiesnofonts
%
% Don't no-op \tt, since it isn't a user-level command
% and is used in the definitions of the active chars like <, >, |, etc.
% Likewise with the other plain tex font commands.
%\let\tt=\asis
%
\def\ { }%
\def\@{@}%
\def\_{\normalunderscore}%
\def\-{}% @- shouldn't affect sorting
%
\uccode`\1=`\{ \uppercase{\def\{{1}}%
\uccode`\1=`\} \uppercase{\def\}{1}}%
\let\lbracechar\{%
\let\rbracechar\}%
%
% Non-English letters.
\def\AA{AA}%
\def\AE{AE}%
\def\DH{DZZ}%
\def\L{L}%
\def\OE{OE}%
\def\O{O}%
\def\TH{TH}%
\def\aa{aa}%
\def\ae{ae}%
\def\dh{dzz}%
\def\exclamdown{!}%
\def\l{l}%
\def\oe{oe}%
\def\ordf{a}%
\def\ordm{o}%
\def\o{o}%
\def\questiondown{?}%
\def\ss{ss}%
\def\th{th}%
%
\let\do\indexnofontsdef
%
\do\LaTeX{LaTeX}%
\do\TeX{TeX}%
%
% Assorted special characters.
\do\atchar{@}%
\do\arrow{->}%
\do\bullet{bullet}%
\do\comma{,}%
\do\copyright{copyright}%
\do\dots{...}%
\do\enddots{...}%
\do\equiv{==}%
\do\error{error}%
\do\euro{euro}%
\do\expansion{==>}%
\do\geq{>=}%
\do\guillemetleft{<<}%
\do\guillemetright{>>}%
\do\guilsinglleft{<}%
\do\guilsinglright{>}%
\do\leq{<=}%
\do\lbracechar{\{}%
\do\minus{-}%
\do\point{.}%
\do\pounds{pounds}%
\do\print{-|}%
\do\quotedblbase{"}%
\do\quotedblleft{"}%
\do\quotedblright{"}%
\do\quoteleft{`}%
\do\quoteright{'}%
\do\quotesinglbase{,}%
\do\rbracechar{\}}%
\do\registeredsymbol{R}%
\do\result{=>}%
\do\textdegree{o}%
%
% We need to get rid of all macros, leaving only the arguments (if present).
% Of course this is not nearly correct, but it is the best we can do for now.
% makeinfo does not expand macros in the argument to @deffn, which ends up
% writing an index entry, and texindex isn't prepared for an index sort entry
% that starts with \.
%
% Since macro invocations are followed by braces, we can just redefine them
% to take a single TeX argument. The case of a macro invocation that
% goes to end-of-line is not handled.
%
\macrolist
\let\value\indexnofontsvalue
}
% Give the control sequence a definition that removes the {} that follows
% its use, e.g. @AA{} -> AA
\def\indexnofontsdef#1#2{\def#1##1{#2}}%
% #1 is the index name, #2 is the entry text.
\def\doind#1#2{%
\iflinks
{%
%
\requireopenindexfile{#1}%
\edef\writeto{\csname#1indfile\endcsname}%
%
\def\indextext{#2}%
\safewhatsit\doindwrite
}%
\fi
}
% Same as \doind, but for code indices
\def\docind#1#2{%
\iflinks
{%
%
\requireopenindexfile{#1}%
\edef\writeto{\csname#1indfile\endcsname}%
%
\def\indextext{#2}%
\safewhatsit\docindwrite
}%
\fi
}
% Check if an index file has been opened, and if not, open it.
\def\requireopenindexfile#1{%
\ifnum\csname #1indfile\endcsname=0
\expandafter\newwrite \csname#1indfile\endcsname
\edef\suffix{#1}%
% A .fls suffix would conflict with the file extension for the output
% of -recorder, so use .f1s instead.
\ifx\suffix\indexisfl\def\suffix{f1}\fi
% Open the file
\immediate\openout\csname#1indfile\endcsname \jobname.\suffix
% Using \immediate above here prevents an object entering into the current
% box, which could confound checks such as those in \safewhatsit for
% preceding skips.
\typeout{Writing index file \jobname.\suffix}%
\fi}
\def\indexisfl{fl}
% Definition for writing index entry sort key.
{
\catcode`\-=13
\gdef\indexwritesortas{%
\begingroup
\indexnonalnumreappear
\indexwritesortasxxx}
\gdef\indexwritesortasxxx#1{%
\xdef\indexsortkey{#1}\endgroup}
}
\def\indexwriteseealso#1{
\gdef\pagenumbertext{\string\seealso{#1}}%
}
\def\indexwriteseeentry#1{
\gdef\pagenumbertext{\string\seeentry{#1}}%
}
% The default definitions
\def\sortas#1{}%
\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
\def\putwordSeeAlso{See also}
\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
% * Set \bracedtext to "{aaa}{bbb}"
% * Set \fullindexsortkey to "aaa @subentry ZZZ"
% * If @seealso occurs, set \pagenumbertext
%
\def\splitindexentry#1{%
\gdef\fullindexsortkey{}%
\xdef\bracedtext{}%
\def\sep{}%
\def\seealso##1{}%
\def\seeentry##1{}%
\expandafter\doindexsegment#1\subentry\finish\subentry
}
% append the results from the next segment
\def\doindexsegment#1\subentry{%
\def\segment{#1}%
\ifx\segment\isfinish
\else
%
% Fully expand the segment, throwing away any @sortas directives, and
% trim spaces.
\edef\trimmed{\segment}%
\edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
\ifincodeindex
\edef\trimmed{\noexpand\code{\trimmed}}%
\fi
%
\xdef\bracedtext{\bracedtext{\trimmed}}%
%
% Get the string to sort by. Process the segment with all
% font commands turned off.
\bgroup
\let\sortas\indexwritesortas
\let\seealso\indexwriteseealso
\let\seeentry\indexwriteseeentry
\indexnofonts
% The braces around the commands are recognized by texindex.
\def\lbracechar{{\string\indexlbrace}}%
\def\rbracechar{{\string\indexrbrace}}%
\let\{=\lbracechar
\let\}=\rbracechar
\def\@{{\string\indexatchar}}%
\def\atchar##1{\@}%
\def\backslashchar{{\string\indexbackslash}}%
\uccode`\~=`\\ \uppercase{\let~\backslashchar}%
%
\let\indexsortkey\empty
\global\let\pagenumbertext\empty
% Execute the segment and throw away the typeset output. This executes
% any @sortas or @seealso commands in this segment.
\setbox\dummybox = \hbox{\segment}%
\ifx\indexsortkey\empty{%
\indexnonalnumdisappear
\xdef\trimmed{\segment}%
\xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
\xdef\indexsortkey{\trimmed}%
\ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
}\fi
%
% Append to \fullindexsortkey.
\edef\tmp{\gdef\noexpand\fullindexsortkey{%
\fullindexsortkey\sep\indexsortkey}}%
\tmp
\egroup
\def\sep{\subentry}%
%
\expandafter\doindexsegment
\fi
}
\def\isfinish{\finish}%
\newbox\dummybox % used above
\let\subentry\relax
% Use \ instead of @ in index files. To support old texi2dvi and texindex.
% This works without changing the escape character used in the toc or aux
% files because the index entries are fully expanded here, and \string uses
% the current value of \escapechar.
\def\escapeisbackslash{\escapechar=`\\}
% Use \ in index files by default. texi2dvi didn't support @ as the escape
% character (as it checked for "\entry" in the files, and not "@entry"). When
% the new version of texi2dvi has had a chance to become more prevalent, then
% the escape character can change back to @ again. This should be an easy
% change to make now because both @ and \ are only used as escape characters in
% index files, never standing for themselves.
%
\set txiindexescapeisbackslash
% Write the entry in \indextext to the index file.
%
\newif\ifincodeindex
\def\doindwrite{\incodeindexfalse\doindwritex}
\def\docindwrite{\incodeindextrue\doindwritex}
\def\doindwritex{%
\maybemarginindex
%
\atdummies
%
\expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
\escapeisbackslash
\fi
%
% For texindex which always views { and } as separators.
\def\{{\lbracechar{}}%
\def\}{\rbracechar{}}%
\uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
%
% Split the entry into primary entry and any subentries, and get the index
% sort key.
\splitindexentry\indextext
%
% Set up the complete index entry, with both the sort key and
% the original text, including any font commands. We write
% three arguments to \entry to the .?? file (four in the
% subentry case), texindex reduces to two when writing the .??s
% sorted result.
%
\edef\temp{%
\write\writeto{%
\string\entry{\fullindexsortkey}%
{\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
\bracedtext}%
}%
\temp
}
% Put the index entry in the margin if desired (undocumented).
\def\maybemarginindex{%
\ifx\SETmarginindex\relax\else
\insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
\fi
}
\let\SETmarginindex=\relax
% Take care of unwanted page breaks/skips around a whatsit:
%
% If a skip is the last thing on the list now, preserve it
% by backing up by \lastskip, doing the \write, then inserting
% the skip again. Otherwise, the whatsit generated by the
% \write or \pdfdest will make \lastskip zero. The result is that
% sequences like this:
% @end defun
% @tindex whatever
% @defun ...
% will have extra space inserted, because the \medbreak in the
% start of the @defun won't see the skip inserted by the @end of
% the previous defun.
%
% But don't do any of this if we're not in vertical mode. We
% don't want to do a \vskip and prematurely end a paragraph.
%
% Avoid page breaks due to these extra skips, too.
%
% But wait, there is a catch there:
% We'll have to check whether \lastskip is zero skip. \ifdim is not
% sufficient for this purpose, as it ignores stretch and shrink parts
% of the skip. The only way seems to be to check the textual
% representation of the skip.
%
% The following is almost like \def\zeroskipmacro{0.0pt} except that
% the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
%
\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
%
\newskip\whatsitskip
\newcount\whatsitpenalty
%
% ..., ready, GO:
%
\def\safewhatsit#1{\ifhmode
#1%
\else
% \lastskip and \lastpenalty cannot both be nonzero simultaneously.
\whatsitskip = \lastskip
\edef\lastskipmacro{\the\lastskip}%
\whatsitpenalty = \lastpenalty
%
% If \lastskip is nonzero, that means the last item was a
% skip. And since a skip is discardable, that means this
% -\whatsitskip glue we're inserting is preceded by a
% non-discardable item, therefore it is not a potential
% breakpoint, therefore no \nobreak needed.
\ifx\lastskipmacro\zeroskipmacro
\else
\vskip-\whatsitskip
\fi
%
#1%
%
\ifx\lastskipmacro\zeroskipmacro
% If \lastskip was zero, perhaps the last item was a penalty, and
% perhaps it was >=10000, e.g., a \nobreak. In that case, we want
% to re-insert the same penalty (values >10000 are used for various
% signals); since we just inserted a non-discardable item, any
% following glue (such as a \parskip) would be a breakpoint. For example:
% @deffn deffn-whatever
% @vindex index-whatever
% Description.
% would allow a break between the index-whatever whatsit
% and the "Description." paragraph.
\ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
\else
% On the other hand, if we had a nonzero \lastskip,
% this make-up glue would be preceded by a non-discardable item
% (the whatsit from the \write), so we must insert a \nobreak.
\nobreak\vskip\whatsitskip
\fi
\fi}
% The index entry written in the file actually looks like
% \entry {sortstring}{page}{topic}
% or
% \entry {sortstring}{page}{topic}{subtopic}
% The texindex program reads in these files and writes files
% containing these kinds of lines:
% \initial {c}
% before the first topic whose initial is c
% \entry {topic}{pagelist}
% for a topic that is used without subtopics
% \primary {topic}
% \entry {topic}{}
% for the beginning of a topic that is used with subtopics
% \secondary {subtopic}{pagelist}
% for each subtopic.
% \secondary {subtopic}{}
% for a subtopic with sub-subtopics
% \tertiary {subtopic}{subsubtopic}{pagelist}
% for each sub-subtopic.
% Define the user-accessible indexing commands
% @findex, @vindex, @kindex, @cindex.
\def\findex {\fnindex}
\def\kindex {\kyindex}
\def\cindex {\cpindex}
\def\vindex {\vrindex}
\def\tindex {\tpindex}
\def\pindex {\pgindex}
% Define the macros used in formatting output of the sorted index material.
% @printindex causes a particular index (the ??s file) to get printed.
% It does not print any chapter heading (usually an @unnumbered).
%
\parseargdef\printindex{\begingroup
\dobreak \chapheadingskip{10000}%
%
\smallfonts \rm
\tolerance = 9500
\plainfrenchspacing
\everypar = {}% don't want the \kern\-parindent from indentation suppression.
%
% See comment in \requireopenindexfile.
\def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
%
% See if the index file exists and is nonempty.
\openin 1 \jobname.\indexname s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
% and it loses the chapter title and the aux file entries for the
% index. The easiest way to prevent this problem is to make sure
% there is some text.
\putwordIndexNonexistent
\typeout{No file \jobname.\indexname s.}%
\else
% If the index file exists but is empty, then \openin leaves \ifeof
% false. We have to make TeX try to read something from the file, so
% it can discover if there is anything in it.
\read 1 to \thisline
\ifeof 1
\putwordIndexIsEmpty
\else
\expandafter\printindexzz\thisline\relax\relax\finish%
\fi
\fi
\closein 1
\endgroup}
% 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
% at best lead to typesetting garbage, at worst a TeX syntax error.
\def\printindexzz#1#2\finish{%
\expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
\uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
\expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax
\errmessage{%
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 .
If you are using an old version of 'texindex' (part of the Texinfo
distribution), you may also need to upgrade to a newer version (at least 6.0).
You may be able to typeset the index if you run
'texindex \jobname.\indexname' yourself.
You could also try setting the 'txiindexescapeisbackslash' flag by
running a command like
'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
this, Texinfo will try to use index files in the old format.
If you continue to have problems, deleting the index files and starting again
might help (with 'rm \jobname.?? \jobname.??s')%
}%
\else
(Skipped sorted index file in obsolete format)
\fi
\else
\begindoublecolumns
\input \jobname.\indexname s
\enddoublecolumns
\fi
\else
\begindoublecolumns
\catcode`\\=0\relax
%
% Make @ an escape character to give macros a chance to work. This
% should work because we (hopefully) don't otherwise use @ in index files.
%\catcode`\@=12\relax
\catcode`\@=0\relax
\input \jobname.\indexname s
\enddoublecolumns
\fi
}
% These macros are used by the sorted index file itself.
% Change them to control the appearance of the index.
{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
\catcode`\$=3
\gdef\initialglyphs{%
% special control sequences used in the index sort key
\let\indexlbrace\{%
\let\indexrbrace\}%
\let\indexatchar\@%
\def\indexbackslash{\math{\backslash}}%
%
% Some changes for non-alphabetic characters. Using the glyphs from the
% math fonts looks more consistent than the typewriter font used elsewhere
% for these characters.
\uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
%
% In case @\ is used for backslash
\uppercase{\let\\=~}
% Can't get bold backslash so don't use bold forward slash
\catcode`\/=13
\def/{{\secrmnotbold \normalslash}}%
\def-{{\normaldash\normaldash}}% en dash `--'
\def^{{\chapbf \normalcaret}}%
\def~{{\chapbf \normaltilde}}%
\def\_{%
\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
\def|{$\vert$}%
\def<{$\less$}%
\def>{$\gtr$}%
\def+{$\normalplus$}%
}}
\def\initial{%
\bgroup
\initialglyphs
\initialx
}
\def\initialx#1{%
% Remove any glue we may have, we'll be inserting our own.
\removelastskip
%
% We like breaks before the index initials, so insert a bonus.
% The glue before the bonus allows a little bit of space at the
% bottom of a column to reduce an increase in inter-line spacing.
\nobreak
\vskip 0pt plus 5\baselineskip
\penalty -300
\vskip 0pt plus -5\baselineskip
%
% Typeset the initial. Making this add up to a whole number of
% baselineskips increases the chance of the dots lining up from column
% to column. It still won't often be perfect, because of the stretch
% we need before each entry, but it's better.
%
% No shrink because it confuses \balancecolumns.
\vskip 1.67\baselineskip plus 1\baselineskip
\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.
% Do our best not to break after the initial.
\nobreak
\vskip .33\baselineskip plus .1\baselineskip
\egroup % \initialglyphs
}
\newdimen\entryrightmargin
\entryrightmargin=0pt
% \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{%
\begingroup
%
% Start a new paragraph if necessary, so our assignments below can't
% affect previous text.
\par
%
% 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):
\afterassignment\doentry
\let\temp =
}
\def\entrybreak{\unskip\space\ignorespaces}%
\def\doentry{%
% Save the text of the entry
\global\setbox\boxA=\hbox\bgroup
\bgroup % Instead of the swallowed brace.
\noindent
\aftergroup\finishentry
% And now comes the text of the entry.
% Not absorbing as a macro argument reduces the chance of problems
% with catcodes occurring.
}
{\catcode`\@=11
\gdef\finishentry#1{%
\egroup % end box A
\dimen@ = \wd\boxA % Length of text of entry
\global\setbox\boxA=\hbox\bgroup
\unhbox\boxA
% #1 is the page number.
%
% Get the width of the page numbers, and only use
% leaders if they are present.
\global\setbox\boxB = \hbox{#1}%
\ifdim\wd\boxB = 0pt
\null\nobreak\hfill\ %
\else
%
\null\nobreak\indexdotfill % Have leaders before the page number.
%
\ifpdforxetex
\pdfgettoks#1.%
\hskip\skip\thinshrinkable\the\toksA
\else
\hskip\skip\thinshrinkable #1%
\fi
\fi
\egroup % end \boxA
\ifdim\wd\boxB = 0pt
\noindent\unhbox\boxA\par
\nobreak
\else\bgroup
% We want the text of the entries to be aligned to the left, and the
% page numbers to be aligned to the right.
%
\parindent = 0pt
\advance\leftskip by 0pt plus 1fil
\advance\leftskip by 0pt plus -1fill
\rightskip = 0pt plus -1fil
\advance\rightskip by 0pt plus 1fill
% Cause last line, which could consist of page numbers on their own
% if the list of page numbers is long, to be aligned to the right.
\parfillskip=0pt plus -1fill
%
\advance\rightskip by \entryrightmargin
% Determine how far we can stretch into the margin.
% This allows, e.g., "Appendix H GNU Free Documentation License" to
% fit on one line in @letterpaper format.
\ifdim\entryrightmargin>2.1em
\dimen@i=2.1em
\else
\dimen@i=0em
\fi
\advance \parfillskip by 0pt minus 1\dimen@i
%
\dimen@ii = \hsize
\advance\dimen@ii by -1\leftskip
\advance\dimen@ii by -1\entryrightmargin
\advance\dimen@ii by 1\dimen@i
\ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
\ifdim\dimen@ > 0.8\dimen@ii % due to long index text
% Try to split the text roughly evenly. \dimen@ will be the length of
% the first line.
\dimen@ = 0.7\dimen@
\dimen@ii = \hsize
\ifnum\dimen@>\dimen@ii
% If the entry is too long (for example, if it needs more than
% two lines), use all the space in the first line.
\dimen@ = \dimen@ii
\fi
\advance\leftskip by 0pt plus 1fill % ragged right
\advance \dimen@ by 1\rightskip
\parshape = 2 0pt \dimen@ 0em \dimen@ii
% Ideally we'd add a finite glue at the end of the first line only,
% instead of using \parshape with explicit line lengths, but TeX
% doesn't seem to provide a way to do such a thing.
%
% Indent all lines but the first one.
\advance\leftskip by 1em
\advance\parindent by -1em
\fi\fi
\indent % start paragraph
\unhbox\boxA
%
% Do not prefer a separate line ending with a hyphen to fewer lines.
\finalhyphendemerits = 0
%
% Word spacing - no stretch
\spaceskip=\fontdimen2\font minus \fontdimen4\font
%
\linepenalty=1000 % Discourage line breaks.
\hyphenpenalty=5000 % Discourage hyphenation.
%
\par % format the paragraph
\egroup % The \vbox
\fi
\endgroup
}}
\newskip\thinshrinkable
\skip\thinshrinkable=.15em minus .15em
% Like plain.tex's \dotfill, except uses up at least 1 em.
% The filll stretch here overpowers both the fil and fill stretch to push
% the page number to the right.
\def\indexdotfill{\cleaders
\hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
\def\primary #1{\line{#1\hfil}}
\def\secondary{\indententry{0.5cm}}
\def\tertiary{\indententry{1cm}}
\def\indententry#1#2#3{%
\bgroup
\leftskip=#1
\entry{#2}{#3}%
\egroup
}
% Define two-column mode, which we use to typeset indexes.
% Adapted from the TeXbook, page 416, which is to say,
% the manmac.tex format used to print the TeXbook itself.
\catcode`\@=11 % private names
\newbox\partialpage
\newdimen\doublecolumnhsize
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
% If not much space left on page, start a new page.
\ifdim\pagetotal>0.8\vsize\vfill\eject\fi
%
% Grab any single-column material above us.
\output = {%
\savetopmark
%
\global\setbox\partialpage = \vbox{%
% Unvbox the main output page.
\unvbox\PAGE
\kern-\topskip \kern\baselineskip
}%
}%
\eject % run that output routine to set \partialpage
%
% Use the double-column output routine for subsequent pages.
\output = {\doublecolumnout}%
%
% Change the page size parameters. We could do this once outside this
% routine, in each of @smallbook, @afourpaper, and the default 8.5x11
% format, but then we repeat the same computation. Repeating a couple
% of assignments once per index is clearly meaningless for the
% execution time, so we may as well do it in one place.
%
% First we halve the line length, less a little for the gutter between
% the columns. We compute the gutter based on the line length, so it
% changes automatically with the paper format. The magic constant
% below is chosen so that the gutter has the same value (well, +-<1pt)
% as it did when we hard-coded it.
%
% We put the result in a separate register, \doublecolumhsize, so we
% can restore it in \pagesofar, after \hsize itself has (potentially)
% been clobbered.
%
\doublecolumnhsize = \hsize
\advance\doublecolumnhsize by -.04154\hsize
\divide\doublecolumnhsize by 2
\hsize = \doublecolumnhsize
%
% Get the available space for the double columns -- the normal
% (undoubled) page height minus any material left over from the
% previous page.
\advance\vsize by -\ht\partialpage
\vsize = 2\vsize
%
% For the benefit of balancing columns
\advance\baselineskip by 0pt plus 0.5pt
}
% The double-column output routine for all double-column pages except
% the last, which is done by \balancecolumns.
%
\def\doublecolumnout{%
%
\savetopmark
\splittopskip=\topskip \splitmaxdepth=\maxdepth
\dimen@ = \vsize
\divide\dimen@ by 2
%
% box0 will be the left-hand column, box2 the right.
\setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
\global\advance\vsize by 2\ht\partialpage
\onepageout\pagesofar % empty except for the first time we are called
\unvbox\PAGE
\penalty\outputpenalty
}
%
% Re-output the contents of the output page -- any previous material,
% followed by the two boxes we just split, in box0 and box2.
\def\pagesofar{%
\unvbox\partialpage
%
\hsize = \doublecolumnhsize
\wd0=\hsize \wd2=\hsize
\hbox to\txipagewidth{\box0\hfil\box2}%
}
% Finished with double columns.
\def\enddoublecolumns{%
% The following penalty ensures that the page builder is exercised
% _before_ we change the output routine. This is necessary in the
% following situation:
%
% The last section of the index consists only of a single entry.
% Before this section, \pagetotal is less than \pagegoal, so no
% break occurs before the last section starts. However, the last
% section, consisting of \initial and the single \entry, does not
% fit on the page and has to be broken off. Without the following
% penalty the page builder will not be exercised until \eject
% below, and by that time we'll already have changed the output
% routine to the \balancecolumns version, so the next-to-last
% double-column page will be processed with \balancecolumns, which
% is wrong: The two columns will go to the main vertical list, with
% the broken-off section in the recent contributions. As soon as
% the output routine finishes, TeX starts reconsidering the page
% break. The two columns and the broken-off section both fit on the
% page, because the two columns now take up only half of the page
% goal. When TeX sees \eject from below which follows the final
% section, it invokes the new output routine that we've set after
% \balancecolumns below; \onepageout will try to fit the two columns
% and the final section into the vbox of \txipageheight (see
% \pagebody), causing an overfull box.
%
% Note that glue won't work here, because glue does not exercise the
% page builder, unlike penalties (see The TeXbook, pp. 280-281).
\penalty0
%
\output = {%
% Split the last of the double-column material.
\savetopmark
\balancecolumns
}%
\eject % call the \output just set
\ifdim\pagetotal=0pt
% Having called \balancecolumns once, we do not
% want to call it again. Therefore, reset \output to its normal
% definition right away.
\global\output=\expandafter{\the\defaultoutput}
%
\endgroup % started in \begindoublecolumns
% Leave the double-column material on the current page, no automatic
% page break.
\box\balancedcolumns
%
% \pagegoal was set to the doubled \vsize above, since we restarted
% the current page. We're now back to normal single-column
% typesetting, so reset \pagegoal to the normal \vsize.
\global\vsize = \txipageheight %
\pagegoal = \txipageheight %
\else
% We had some left-over material. This might happen when \doublecolumnout
% is called in \balancecolumns. Try again.
\expandafter\enddoublecolumns
\fi
}
\newbox\balancedcolumns
\setbox\balancedcolumns=\vbox{shouldnt see this}%
%
% Only called for the last of the double column material. \doublecolumnout
% does the others.
\def\balancecolumns{%
\setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
\dimen@ = \ht0
\ifdim\dimen@<7\baselineskip
% Don't split a short final column in two.
\setbox2=\vbox{}%
\global\setbox\balancedcolumns=\vbox{\pagesofar}%
\else
% double the leading vertical space
\advance\dimen@ by \topskip
\advance\dimen@ by-\baselineskip
\divide\dimen@ by 2 % target to split to
\dimen@ii = \dimen@
\splittopskip = \topskip
% Loop until left column is at least as high as the right column.
{%
\vbadness = 10000
\loop
\global\setbox3 = \copy0
\global\setbox1 = \vsplit3 to \dimen@
\ifdim\ht1<\ht3
\global\advance\dimen@ by 1pt
\repeat
}%
% Now the left column is in box 1, and the right column in box 3.
%
% Check whether the left column has come out higher than the page itself.
% (Note that we have doubled \vsize for the double columns, so
% the actual height of the page is 0.5\vsize).
\ifdim2\ht1>\vsize
% It appears that we have been called upon to balance too much material.
% Output some of it with \doublecolumnout, leaving the rest on the page.
\setbox\PAGE=\box0
\doublecolumnout
\else
% Compare the heights of the two columns.
\ifdim4\ht1>5\ht3
% Column heights are too different, so don't make their bottoms
% flush with each other.
\setbox2=\vbox to \ht1 {\unvbox3\vfill}%
\setbox0=\vbox to \ht1 {\unvbox1\vfill}%
\else
% Make column bottoms flush with each other.
\setbox2=\vbox to\ht1{\unvbox3\unskip}%
\setbox0=\vbox to\ht1{\unvbox1\unskip}%
\fi
\global\setbox\balancedcolumns=\vbox{\pagesofar}%
\fi
\fi
%
}
\catcode`\@ = \other
\message{sectioning,}
% Chapters, sections, etc.
% Let's start with @part.
\outer\parseargdef\part{\partzzz{#1}}
\def\partzzz#1{%
\chapoddpage
\null
\vskip.3\vsize % move it down on the page a bit
\begingroup
\noindent \titlefonts\rm #1\par % the text
\let\lastnode=\empty % no node to associate with
\writetocentry{part}{#1}{}% but put it in the toc
\headingsoff % no headline or footline on the part page
% This outputs a mark at the end of the page that clears \thischapter
% and \thissection, as is done in \startcontents.
\let\pchapsepmacro\relax
\chapmacro{}{Yomitfromtoc}{}%
\chapoddpage
\endgroup
}
% \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
% numbers by starting them at 10000. (If a document ever has 10000
% chapters, we're in trouble anyway, I'm sure.)
\newcount\unnumberedno \unnumberedno = 10000
\newcount\chapno
\newcount\secno \secno=0
\newcount\subsecno \subsecno=0
\newcount\subsubsecno \subsubsecno=0
% This counter is funny since it counts through charcodes of letters A, B, ...
\newcount\appendixno \appendixno = `\@
%
% \def\appendixletter{\char\the\appendixno}
% We do the following ugly conditional instead of the above simple
% construct for the sake of pdftex, which needs the actual
% letter in the expansion, not just typeset.
%
\def\appendixletter{%
\ifnum\appendixno=`A A%
\else\ifnum\appendixno=`B B%
\else\ifnum\appendixno=`C C%
\else\ifnum\appendixno=`D D%
\else\ifnum\appendixno=`E E%
\else\ifnum\appendixno=`F F%
\else\ifnum\appendixno=`G G%
\else\ifnum\appendixno=`H H%
\else\ifnum\appendixno=`I I%
\else\ifnum\appendixno=`J J%
\else\ifnum\appendixno=`K K%
\else\ifnum\appendixno=`L L%
\else\ifnum\appendixno=`M M%
\else\ifnum\appendixno=`N N%
\else\ifnum\appendixno=`O O%
\else\ifnum\appendixno=`P P%
\else\ifnum\appendixno=`Q Q%
\else\ifnum\appendixno=`R R%
\else\ifnum\appendixno=`S S%
\else\ifnum\appendixno=`T T%
\else\ifnum\appendixno=`U U%
\else\ifnum\appendixno=`V V%
\else\ifnum\appendixno=`W W%
\else\ifnum\appendixno=`X X%
\else\ifnum\appendixno=`Y Y%
\else\ifnum\appendixno=`Z Z%
% The \the is necessary, despite appearances, because \appendixletter is
% expanded while writing the .toc file. \char\appendixno is not
% expandable, thus it is written literally, thus all appendixes come out
% with the same letter (or @) in the toc without it.
\else\char\the\appendixno
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
% Each @chapter defines these (using marks) as the number+name, number
% and name of the chapter. Page headings and footings can use
% these. @section does likewise.
\def\thischapter{}
\def\thischapternum{}
\def\thischaptername{}
\def\thissection{}
\def\thissectionnum{}
\def\thissectionname{}
\newcount\absseclevel % used to calculate proper heading level
\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
% @raisesections: treat @section as chapter, @subsection as section, etc.
\def\raisesections{\global\advance\secbase by -1}
% @lowersections: treat @chapter as section, @section as subsection, etc.
\def\lowersections{\global\advance\secbase by 1}
% we only have subsub.
\chardef\maxseclevel = 3
%
% A numbered section within an unnumbered changes to unnumbered too.
% To achieve this, remember the "biggest" unnum. sec. we are currently in:
\chardef\unnlevel = \maxseclevel
%
% Trace whether the current chapter is an appendix or not:
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
\def\chapheadtype{N}
% Choose a heading macro
% #1 is heading type
% #2 is heading level
% #3 is text for heading
\def\genhead#1#2#3{%
% Compute the abs. sec. level:
\absseclevel=#2
\advance\absseclevel by \secbase
% Make sure \absseclevel doesn't fall outside the range:
\ifnum \absseclevel < 0
\absseclevel = 0
\else
\ifnum \absseclevel > 3
\absseclevel = 3
\fi
\fi
% The heading type:
\def\headtype{#1}%
\if \headtype U%
\ifnum \absseclevel < \unnlevel
\chardef\unnlevel = \absseclevel
\fi
\else
% Check for appendix sections:
\ifnum \absseclevel = 0
\edef\chapheadtype{\headtype}%
\else
\if \headtype A\if \chapheadtype N%
\errmessage{@appendix... within a non-appendix chapter}%
\fi\fi
\fi
% Check for numbered within unnumbered:
\ifnum \absseclevel > \unnlevel
\def\headtype{U}%
\else
\chardef\unnlevel = 3
\fi
\fi
% Now print the heading:
\if \headtype U%
\ifcase\absseclevel
\unnumberedzzz{#3}%
\or \unnumberedseczzz{#3}%
\or \unnumberedsubseczzz{#3}%
\or \unnumberedsubsubseczzz{#3}%
\fi
\else
\if \headtype A%
\ifcase\absseclevel
\appendixzzz{#3}%
\or \appendixsectionzzz{#3}%
\or \appendixsubseczzz{#3}%
\or \appendixsubsubseczzz{#3}%
\fi
\else
\ifcase\absseclevel
\chapterzzz{#3}%
\or \seczzz{#3}%
\or \numberedsubseczzz{#3}%
\or \numberedsubsubseczzz{#3}%
\fi
\fi
\fi
\suppressfirstparagraphindent
}
% an interface:
\def\numhead{\genhead N}
\def\apphead{\genhead A}
\def\unnmhead{\genhead U}
% @chapter, @appendix, @unnumbered. Increment top-level counter, reset
% all lower-level sectioning counters to zero.
%
% Also set \chaplevelprefix, which we prepend to @float sequence numbers
% (e.g., figures), q.v. By default (before any chapter), that is empty.
\let\chaplevelprefix = \empty
%
\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
\def\chapterzzz#1{%
% section resetting is \global in case the chapter is in a group, such
% as an @include file.
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\chapno by 1
%
% Used for \float.
\gdef\chaplevelprefix{\the\chapno.}%
\resetallfloatnos
%
% \putwordChapter can contain complex things in translations.
\toks0=\expandafter{\putwordChapter}%
\message{\the\toks0 \space \the\chapno}%
%
% Write the actual heading.
\chapmacro{#1}{Ynumbered}{\the\chapno}%
%
% So @section and the like are numbered underneath this chapter.
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
}
\outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
%
\def\appendixzzz#1{%
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\appendixno by 1
\gdef\chaplevelprefix{\appendixletter.}%
\resetallfloatnos
%
% \putwordAppendix can contain complex things in translations.
\toks0=\expandafter{\putwordAppendix}%
\message{\the\toks0 \space \appendixletter}%
%
\chapmacro{#1}{Yappendix}{\appendixletter}%
%
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
}
% normally unnmhead0 calls unnumberedzzz:
\outer\parseargdef\unnumbered{\unnmhead0{#1}}
\def\unnumberedzzz#1{%
\global\secno=0 \global\subsecno=0 \global\subsubsecno=0
\global\advance\unnumberedno by 1
%
% Since an unnumbered has no number, no prefix for figures.
\global\let\chaplevelprefix = \empty
\resetallfloatnos
%
% This used to be simply \message{#1}, but TeX fully expands the
% argument to \message. Therefore, if #1 contained @-commands, TeX
% expanded them. For example, in `@unnumbered The @cite{Book}', TeX
% expanded @cite (which turns out to cause errors because \cite is meant
% to be executed, not expanded).
%
% Anyway, we don't want the fully-expanded definition of @cite to appear
% as a result of the \message, we just want `@cite' itself. We use
% \the to achieve this: TeX expands \the only once,
% simply yielding the contents of . (We also do this for
% the toc entries.)
\toks0 = {#1}%
\message{(\the\toks0)}%
%
\chapmacro{#1}{Ynothing}{\the\unnumberedno}%
%
\global\let\section = \unnumberedsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
}
% @centerchap is like @unnumbered, but the heading is centered.
\outer\parseargdef\centerchap{%
\let\centerparametersmaybe = \centerparameters
\unnmhead0{#1}%
\let\centerparametersmaybe = \relax
}
% @top is like @unnumbered.
\let\top\unnumbered
% Sections.
%
\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
\def\seczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
}
% normally calls appendixsectionzzz:
\outer\parseargdef\appendixsection{\apphead1{#1}}
\def\appendixsectionzzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
}
\let\appendixsec\appendixsection
% normally calls unnumberedseczzz:
\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
\def\unnumberedseczzz#1{%
\global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
\sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
}
% Subsections.
%
% normally calls numberedsubseczzz:
\outer\parseargdef\numberedsubsec{\numhead2{#1}}
\def\numberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
}
% normally calls appendixsubseczzz:
\outer\parseargdef\appendixsubsec{\apphead2{#1}}
\def\appendixsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Yappendix}%
{\appendixletter.\the\secno.\the\subsecno}%
}
% normally calls unnumberedsubseczzz:
\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
\def\unnumberedsubseczzz#1{%
\global\subsubsecno=0 \global\advance\subsecno by 1
\sectionheading{#1}{subsec}{Ynothing}%
{\the\unnumberedno.\the\secno.\the\subsecno}%
}
% Subsubsections.
%
% normally numberedsubsubseczzz:
\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
\def\numberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynumbered}%
{\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% normally appendixsubsubseczzz:
\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
\def\appendixsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Yappendix}%
{\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% normally unnumberedsubsubseczzz:
\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
\def\unnumberedsubsubseczzz#1{%
\global\advance\subsubsecno by 1
\sectionheading{#1}{subsubsec}{Ynothing}%
{\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
}
% These macros control what the section commands do, according
% to what kind of chapter we are in (ordinary, appendix, or unnumbered).
% Define them by default for a numbered chapter.
\let\section = \numberedsec
\let\subsection = \numberedsubsec
\let\subsubsection = \numberedsubsubsec
% Define @majorheading, @heading and @subheading
\def\majorheading{%
{\advance\chapheadingskip by 10pt \chapbreak }%
\parsearg\chapheadingzzz
}
\def\chapheading{\chapbreak \parsearg\chapheadingzzz}
\def\chapheadingzzz#1{%
\vbox{\chapfonts \raggedtitlesettings #1\par}%
\nobreak\bigskip \nobreak
\suppressfirstparagraphindent
}
% @heading, @subheading, @subsubheading.
\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
\suppressfirstparagraphindent}
% These macros generate a chapter, section, etc. heading only
% (including whitespace, linebreaking, etc. around it),
% given all the information in convenient, parsed form.
% Args are the skip and penalty (usually negative)
\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
% Parameter controlling skip before chapter headings (if needed)
\newskip\chapheadingskip
% Define plain chapter starts, and page on/off switching for it.
\def\chapbreak{\dobreak \chapheadingskip {-4000}}
% Start a new page
\def\chappager{\par\vfill\supereject}
% \chapoddpage - start on an odd page for a new chapter
% Because \domark is called before \chapoddpage, the filler page will
% get the headings for the next chapter, which is wrong. But we don't
% care -- we just disable all headings on the filler page.
\def\chapoddpage{%
\chappager
\ifodd\pageno \else
\begingroup
\headingsoff
\null
\chappager
\endgroup
\fi
}
\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
\def\CHAPPAGoff{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chapbreak
\global\def\HEADINGSon{\HEADINGSsinglechapoff}}
\def\CHAPPAGon{%
\global\let\contentsalignmacro = \chappager
\global\let\pchapsepmacro=\chappager
\global\def\HEADINGSon{\HEADINGSsingle}}
\def\CHAPPAGodd{%
\global\let\contentsalignmacro = \chapoddpage
\global\let\pchapsepmacro=\chapoddpage
\global\def\HEADINGSon{\HEADINGSdouble}}
\CHAPPAGon
% \chapmacro - Chapter opening.
%
% #1 is the text, #2 is the section type (Ynumbered, Ynothing,
% Yappendix, Yomitfromtoc), #3 the chapter number.
% Not used for @heading series.
%
% To test against our argument.
\def\Ynothingkeyword{Ynothing}
\def\Yappendixkeyword{Yappendix}
\def\Yomitfromtockeyword{Yomitfromtoc}
%
\def\chapmacro#1#2#3{%
\expandafter\ifx\thisenv\titlepage\else
\checkenv{}% chapters, etc., should not start inside an environment.
\fi
% Insert the first mark before the heading break (see notes for \domark).
\let\prevchapterdefs=\currentchapterdefs
\let\prevsectiondefs=\currentsectiondefs
\gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
\gdef\thissection{}}%
%
\def\temptype{#2}%
\ifx\temptype\Ynothingkeyword
\gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{\thischaptername}}%
\else\ifx\temptype\Yomitfromtockeyword
\gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
\gdef\thischapter{}}%
\else\ifx\temptype\Yappendixkeyword
\toks0={#1}%
\xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\appendixletter}%
% \noexpand\putwordAppendix avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
\noexpand\thischapternum:
\noexpand\thischaptername}%
}%
\else
\toks0={#1}%
\xdef\currentchapterdefs{%
\gdef\noexpand\thischaptername{\the\toks0}%
\gdef\noexpand\thischapternum{\the\chapno}%
% \noexpand\putwordChapter avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thischapter{\noexpand\putwordChapter{}
\noexpand\thischapternum:
\noexpand\thischaptername}%
}%
\fi\fi\fi
%
% Output the mark. Pass it through \safewhatsit, to take care of
% the preceding space.
\safewhatsit\domark
%
% Insert the chapter heading break.
\pchapsepmacro
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
\let\prevchapterdefs=\currentchapterdefs
\let\prevsectiondefs=\currentsectiondefs
\domark
%
{%
\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
\setbox0 = \hbox{}%
\def\toctype{unnchap}%
\else\ifx\temptype\Yomitfromtockeyword
\setbox0 = \hbox{}% contents like unnumbered, but no toc entry
\def\toctype{omit}%
\else\ifx\temptype\Yappendixkeyword
\setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
\def\toctype{app}%
\else
\setbox0 = \hbox{#3\enspace}%
\def\toctype{numchap}%
\fi\fi\fi
%
% Write the toc entry for this chapter. Must come before the
% \donoderef, because we include the current node name in the toc
% entry, and \donoderef resets it to empty.
\writetocentry{\toctype}{#1}{#3}%
%
% For pdftex, we have to write out the node definition (aka, make
% the pdfdest) after any page break, but before the actual text has
% 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}%
%
% Typeset the actual heading.
\nobreak % Avoid page breaks at the interline glue.
\vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
\unhbox0 #1\par}%
}%
\nobreak\bigskip % no page break after a chapter title
\nobreak
}
% @centerchap -- centered and unnumbered.
\let\centerparametersmaybe = \relax
\def\centerparameters{%
\advance\rightskip by 3\rightskip
\leftskip = \rightskip
\parfillskip = 0pt
}
% Section titles. These macros combine the section number parts and
% call the generic \sectionheading to do the printing.
%
\newskip\secheadingskip
\def\secheadingbreak{\dobreak \secheadingskip{-1000}}
% Subsection titles.
\newskip\subsecheadingskip
\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
% Subsubsection titles.
\def\subsubsecheadingskip{\subsecheadingskip}
\def\subsubsecheadingbreak{\subsecheadingbreak}
% Print any size, any type, section title.
%
% #1 is the text of the title,
% #2 is the section level (sec/subsec/subsubsec),
% #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
% #4 is the section number.
%
\def\seckeyword{sec}
%
\def\sectionheading#1#2#3#4{%
{%
\def\sectionlevel{#2}%
\def\temptype{#3}%
%
% It is ok for the @heading series commands to appear inside an
% environment (it's been historically allowed, though the logic is
% dubious), but not the others.
\ifx\temptype\Yomitfromtockeyword\else
\checkenv{}% non-@*heading should not be in an environment.
\fi
\let\footnote=\errfootnoteheading
%
% Switch to the right set of fonts.
\csname #2fonts\endcsname \rm
%
% Insert first mark before the heading break (see notes for \domark).
\let\prevsectiondefs=\currentsectiondefs
\ifx\temptype\Ynothingkeyword
\ifx\sectionlevel\seckeyword
\gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
\gdef\thissection{\thissectionname}}%
\fi
\else\ifx\temptype\Yomitfromtockeyword
% Don't redefine \thissection.
\else\ifx\temptype\Yappendixkeyword
\ifx\sectionlevel\seckeyword
\toks0={#1}%
\xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thissection{\noexpand\putwordSection{}
\noexpand\thissectionnum:
\noexpand\thissectionname}%
}%
\fi
\else
\ifx\sectionlevel\seckeyword
\toks0={#1}%
\xdef\currentsectiondefs{%
\gdef\noexpand\thissectionname{\the\toks0}%
\gdef\noexpand\thissectionnum{#4}%
% \noexpand\putwordSection avoids expanding indigestible
% commands in some of the translations.
\gdef\noexpand\thissection{\noexpand\putwordSection{}
\noexpand\thissectionnum:
\noexpand\thissectionname}%
}%
\fi
\fi\fi\fi
%
% Go into vertical mode. Usually we'll already be there, but we
% don't want the following whatsit to end up in a preceding paragraph
% if the document didn't happen to have a blank line.
\par
%
% Output the mark. Pass it through \safewhatsit, to take care of
% the preceding space.
\safewhatsit\domark
%
% Insert space above the heading.
\csname #2headingbreak\endcsname
%
% Now the second mark, after the heading break. No break points
% between here and the heading.
\global\let\prevsectiondefs=\currentsectiondefs
\domark
%
% Only insert the space after the number if we have a section number.
\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.
\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.
\writetocentry{\toctype\sectionlevel}{#1}{#4}%
%
% Write the node reference (= pdf destination for pdftex).
% Again, see comments in \chapmacro.
\donoderef{#3}%
%
% Interline glue will be inserted when the vbox is completed.
% That glue will be a valid breakpoint for the page, since it'll be
% preceded by a whatsit (usually from the \donoderef, or from the
% \writetocentry if there was no node). We don't want to allow that
% break, since then the whatsits could end up on page n while the
% section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
\nobreak
%
% Output the actual section heading.
\vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
\hangindent=\wd0 % zero if no section number
\unhbox0 #1}%
}%
% Add extra space after the heading -- half of whatever came above it.
% Don't allow stretch, though.
\kern .5 \csname #2headingskip\endcsname
%
% Do not let the kern be a potential breakpoint, as it would be if it
% was followed by glue.
\nobreak
%
% We'll almost certainly start a paragraph next, so don't let that
% glue accumulate. (Not a breakpoint because it's preceded by a
% discardable item.) However, when a paragraph is not started next
% (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
% or the negative glue will cause weirdly wrong output, typically
% obscuring the section heading with something else.
\vskip-\parskip
%
% This is so the last item on the main vertical list is a known
% \penalty > 10000, so \startdefun, etc., can recognize the situation
% and do the needful.
\penalty 10001
}
\message{toc,}
% Table of contents.
\newwrite\tocfile
% Write an entry to the toc file, opening it if necessary.
% Called from @chapter, etc.
%
% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
% We append the current node name (if any) and page number as additional
% arguments for the \{chap,sec,...}entry macros which will eventually
% read this. The node name is used in the pdf outlines as the
% destination to jump to.
%
% We open the .toc file for writing here instead of at @setfilename (or
% any other fixed time) so that @contents can be anywhere in the document.
% But if #1 is `omit', then we don't do anything. This is used for the
% table of contents chapter openings themselves.
%
\newif\iftocfileopened
\def\omitkeyword{omit}%
%
\def\writetocentry#1#2#3{%
\edef\writetoctype{#1}%
\ifx\writetoctype\omitkeyword \else
\iftocfileopened\else
\immediate\openout\tocfile = \jobname.toc
\global\tocfileopenedtrue
\fi
%
\iflinks
{\atdummies
\edef\temp{%
\write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
\temp
}%
\fi
\fi
%
% Tell \shipout to create a pdf destination on each page, if we're
% writing pdf. These are used in the table of contents. We can't
% just write one on every page because the title pages are numbered
% 1 and 2 (the page numbers aren't printed), and so are the first
% two pages of the document. Thus, we'd have two destinations named
% `1', and two named `2'.
\ifpdforxetex
\global\pdfmakepagedesttrue
\fi
}
% These characters do not print properly in the Computer Modern roman
% fonts, so we must take special care. This is more or less redundant
% with the Texinfo input format setup at the end of this file.
%
\def\activecatcodes{%
\catcode`\"=\active
\catcode`\$=\active
\catcode`\<=\active
\catcode`\>=\active
\catcode`\\=\active
\catcode`\^=\active
\catcode`\_=\active
\catcode`\|=\active
\catcode`\~=\active
}
% Read the toc file, which is essentially Texinfo input.
\def\readtocfile{%
\setupdatafile
\activecatcodes
\input \tocreadfilename
}
\newskip\contentsrightmargin \contentsrightmargin=1in
\newcount\savepageno
\newcount\lastnegativepageno \lastnegativepageno = -1
% Prepare to read what we've written to \tocfile.
%
\def\startcontents#1{%
% If @setchapternewpage on, and @headings double, the contents should
% start on an odd page, unlike chapters.
\contentsalignmacro
\immediate\closeout\tocfile
%
% Don't need to put `Contents' or `Short Contents' in the headline.
% It is abundantly clear what they are.
\chapmacro{#1}{Yomitfromtoc}{}%
%
\savepageno = \pageno
\begingroup % Set up to handle contents files properly.
\raggedbottom % Worry more about breakpoints than the bottom.
\entryrightmargin=\contentsrightmargin % Don't use the full line length.
%
% Roman numerals for page numbers.
\ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
\def\thistitle{}% no title in double-sided headings
% Record where the Roman numerals started.
\ifnum\romancount=0 \global\romancount=\pagecount \fi
}
% redefined for the two-volume lispref. We always output on
% \jobname.toc even if this is redefined.
%
\def\tocreadfilename{\jobname.toc}
% Normal (long) toc.
%
\def\contents{%
\startcontents{\putwordTOC}%
\openin 1 \tocreadfilename\space
\ifeof 1 \else
\readtocfile
\fi
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\ifeof 1 \else
\pdfmakeoutlines
\fi
\closein 1
\endgroup
\contentsendroman
}
% And just the chapters.
\def\summarycontents{%
\startcontents{\putwordShortTOC}%
%
\let\partentry = \shortpartentry
\let\numchapentry = \shortchapentry
\let\appentry = \shortchapentry
\let\unnchapentry = \shortunnchapentry
% We want a true roman here for the page numbers.
\secfonts
\let\rm=\shortcontrm \let\bf=\shortcontbf
\let\sl=\shortcontsl \let\tt=\shortconttt
\rm
\hyphenpenalty = 10000
\advance\baselineskip by 1pt % Open it up a little.
\def\numsecentry##1##2##3##4{}
\let\appsecentry = \numsecentry
\let\unnsecentry = \numsecentry
\let\numsubsecentry = \numsecentry
\let\appsubsecentry = \numsecentry
\let\unnsubsecentry = \numsecentry
\let\numsubsubsecentry = \numsecentry
\let\appsubsubsecentry = \numsecentry
\let\unnsubsubsecentry = \numsecentry
\openin 1 \tocreadfilename\space
\ifeof 1 \else
\readtocfile
\fi
\closein 1
\vfill \eject
\contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup
\contentsendroman
}
\let\shortcontents = \summarycontents
% Get ready to use Arabic numerals again
\def\contentsendroman{%
\lastnegativepageno = \pageno
\global\pageno = \savepageno
%
% If \romancount > \arabiccount, the contents are at the end of the
% document. Otherwise, advance where the Arabic numerals start for
% the page numbers.
\ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi
}
% Typeset the label for a chapter or appendix for the short contents.
% The arg is, e.g., `A' for an appendix, or `3' for a chapter.
%
\def\shortchaplabel#1{%
% This space should be enough, since a single number is .5em, and the
% widest letter (M) is 1em, at least in the Computer Modern fonts.
% But use \hss just in case.
% (This space doesn't include the extra space that gets added after
% the label; that gets put in by \shortchapentry above.)
%
% We'd like to right-justify chapter numbers, but that looks strange
% with appendix letters. And right-justifying numbers and
% left-justifying letters looks strange when there is less than 10
% chapters. Have to read the whole toc once to know how many chapters
% there are before deciding ...
\hbox to 1em{#1\hss}%
}
% These macros generate individual entries in the table of contents.
% The first argument is the chapter or section name.
% The last argument is the page number.
% The arguments in between are the chapter number, section 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}}
\def\partentry#1#2#3#4{%
% 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
\penalty-300
\vskip 0pt plus -5\baselineskip
\dochapentry{\numeralbox\labelspace#1}{}%
}
%
% 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}{}{}%
}
% Chapters, in the main contents.
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
% Chapters, in the short toc.
% See comments in \dochapentry re vbox and related settings.
\def\shortchapentry#1#2#3#4{%
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
}
% Appendices, in the main contents.
% Need the word Appendix, and a fixed-size box.
%
\def\appendixbox#1{%
% We use M since it's probably the widest letter.
\setbox0 = \hbox{\putwordAppendix{} M}%
\hbox to \wd0{\putwordAppendix{} #1\hss}}
%
\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
% Unnumbered chapters.
\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
% Sections.
\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
\let\appsecentry=\numsecentry
\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
% Subsections.
\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
\let\appsubsecentry=\numsubsecentry
\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
% And subsubsections.
\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
\let\appsubsubsecentry=\numsubsubsecentry
\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#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 and #2 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{%
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
\begingroup
% Move the page numbers slightly to the right
\advance\entryrightmargin by -0.05em
\chapentryfonts
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup
\nobreak\vskip .25\baselineskip plus.1\baselineskip
}
\def\dosecentry#1#2{\begingroup
\secentryfonts \leftskip=\tocindent
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsecentry#1#2{\begingroup
\subsecentryfonts \leftskip=2\tocindent
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
\def\dosubsubsecentry#1#2{\begingroup
\subsubsecentryfonts \leftskip=3\tocindent
\tocentry{#1}{\dopageno\bgroup#2\egroup}%
\endgroup}
% We use the same \entry macro as for the index entries.
\let\tocentry = \entry
% Space between chapter (or whatever) number and the title.
\def\labelspace{\hskip1em \relax}
\def\dopageno#1{{\rm #1}}
\def\doshortpageno#1{{\rm #1}}
\def\chapentryfonts{\secfonts \rm}
\def\secentryfonts{\textfonts}
\def\subsecentryfonts{\textfonts}
\def\subsubsecentryfonts{\textfonts}
\message{environments,}
% @foo ... @end foo.
% @tex ... @end tex escapes into raw TeX temporarily.
% One exception: @ is still an escape character, so that @end tex works.
% But \@ or @@ will get a plain @ character.
\envdef\tex{%
\setregularquotes
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
\catcode `\%=14
\catcode `\+=\other
\catcode `\"=\other
\catcode `\|=\other
\catcode `\<=\other
\catcode `\>=\other
\catcode `\`=\other
\catcode `\'=\other
%
% ' is active in math mode (mathcode"8000). So reset it, and all our
% other math active characters (just in case), to plain's definitions.
\mathactive
%
% Inverse of the list at the beginning of the file.
\let\b=\ptexb
\let\bullet=\ptexbullet
\let\c=\ptexc
\let\,=\ptexcomma
\let\.=\ptexdot
\let\dots=\ptexdots
\let\equiv=\ptexequiv
\let\!=\ptexexclam
\let\i=\ptexi
\let\indent=\ptexindent
\let\noindent=\ptexnoindent
\let\{=\ptexlbrace
\let\+=\tabalign
\let\}=\ptexrbrace
\let\/=\ptexslash
\let\sp=\ptexsp
\let\*=\ptexstar
%\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
\let\t=\ptext
\expandafter \let\csname top\endcsname=\ptextop % we've made it outer
\let\frenchspacing=\plainfrenchspacing
%
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
\def\@{@}%
}
% There is no need to define \Etex.
% Define @lisp ... @end lisp.
% @lisp environment forms a group so it can rebind things,
% including the definition of @end lisp (which normally is erroneous).
% Amount to narrow the margins by for @lisp.
\newskip\lispnarrowing \lispnarrowing=0.4in
% This is the definition that ^^M gets inside @lisp, @example, and other
% such environments. \null is better than a space, since it doesn't
% have any width.
\def\lisppar{\null\endgraf}
% This space is always present above and below environments.
\newskip\envskipamount \envskipamount = 0pt
% Make spacing and below environment symmetrical. We use \parskip here
% to help in doing that, since in @example-like environments \parskip
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
% start of the next paragraph will insert \parskip.
%
\def\aboveenvbreak{{%
% =10000 instead of <10000 because of a special case in \itemzzz and
% \sectionheading, q.v.
\ifnum \lastpenalty=10000 \else
\advance\envskipamount by \parskip
\endgraf
\ifdim\lastskip<\envskipamount
\removelastskip
\ifnum\lastpenalty<10000
% Penalize breaking before the environment, because preceding text
% often leads into it.
\penalty100
\fi
\vskip\envskipamount
\fi
\fi
}}
\def\afterenvbreak{{%
% =10000 instead of <10000 because of a special case in \itemzzz and
% \sectionheading, q.v.
\ifnum \lastpenalty=10000 \else
\advance\envskipamount by \parskip
\endgraf
\ifdim\lastskip<\envskipamount
\removelastskip
% it's not a good place to break if the last penalty was \nobreak
% or better ...
\ifnum\lastpenalty<10000 \penalty-50 \fi
\vskip\envskipamount
\fi
\fi
}}
% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
% also clear it, so that its embedded environments do the narrowing again.
\let\nonarrowing=\relax
% @cartouche ... @end cartouche: draw rectangle w/rounded corners around
% environment contents.
%
\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
\def\ctr{{\hskip 6pt\circle\char'010}}
\def\cbl{{\circle\char'012\hskip -6pt}}
\def\cbr{{\hskip 6pt\circle\char'011}}
\def\carttop{\hbox to \cartouter{\hskip\lskip
\ctl\leaders\hrule height\circthick\hfil\ctr
\hskip\rskip}}
\def\cartbot{\hbox to \cartouter{\hskip\lskip
\cbl\leaders\hrule height\circthick\hfil\cbr
\hskip\rskip}}
%
\newskip\lskip\newskip\rskip
% only require the font if @cartouche is actually used
\def\cartouchefontdefs{%
\font\circle=lcircle10\relax
\circthick=\fontdimen8\circle
}
\newdimen\circthick
\newdimen\cartouter\newdimen\cartinner
\newskip\normbskip\newskip\normpskip\newskip\normlskip
\envdef\cartouche{%
\cartouchefontdefs
\ifhmode\par\fi % can't be in the midst of a paragraph.
\startsavinginserts
\lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt % we want these *outside*.
\cartinner=\hsize \advance\cartinner by-\lskip
\advance\cartinner by-\rskip
\cartouter=\hsize
\advance\cartouter by 18.4pt % allow for 3pt kerns on either
% side, and for 6pt waste from
% each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
%
% If this cartouche directly follows a sectioning command, we need the
% \parskip glue (backspaced over by default) or the cartouche can
% collide with the section heading.
\ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
%
\setbox\groupbox=\vbox\bgroup
\baselineskip=0pt\parskip=0pt\lineskip=0pt
\carttop
\hbox\bgroup
\hskip\lskip
\vrule\kern3pt
\vbox\bgroup
\kern3pt
\hsize=\cartinner
\baselineskip=\normbskip
\lineskip=\normlskip
\parskip=\normpskip
\vskip -\parskip
\comment % For explanation, see the end of def\group.
}
\def\Ecartouche{%
\ifhmode\par\fi
\kern3pt
\egroup
\kern3pt\vrule
\hskip\rskip
\egroup
\cartbot
\egroup
\addgroupbox
\checkinserts
}
% This macro is called at the beginning of all the @example variants,
% inside a group.
\newdimen\nonfillparindent
\def\nonfillstart{%
\aboveenvbreak
\ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
\sepspaces % Make spaces be word-separators rather than space tokens.
\let\par = \lisppar % don't ignore blank lines
\obeylines % each line of input is a line of output
\parskip = 0pt
% Turn off paragraph indentation but redefine \indent to emulate
% the normal \indent.
\nonfillparindent=\parindent
\parindent = 0pt
\let\indent\nonfillindent
%
\emergencystretch = 0pt % don't try to avoid overfull boxes
\ifx\nonarrowing\relax
\advance \leftskip by \lispnarrowing
\exdentamount=\lispnarrowing
\else
\let\nonarrowing = \relax
\fi
\let\exdent=\nofillexdent
}
\begingroup
\obeyspaces
% We want to swallow spaces (but not other tokens) after the fake
% @indent in our nonfill-environments, where spaces are normally
% active and set to @tie, resulting in them not being ignored after
% @indent.
\gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
\gdef\nonfillindentcheck{%
\ifx\temp %
\expandafter\nonfillindentgobble%
\else%
\leavevmode\nonfillindentbox%
\fi%
}%
\endgroup
\def\nonfillindentgobble#1{\nonfillindent}
\def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
% If you want all examples etc. small: @set dispenvsize small.
% If you want even small examples the full size: @set dispenvsize nosmall.
% This affects the following displayed environments:
% @example, @display, @format, @lisp, @verbatim
%
\def\smallword{small}
\def\nosmallword{nosmall}
\let\SETdispenvsize\relax
\def\setnormaldispenv{%
\ifx\SETdispenvsize\smallword
% end paragraph for sake of leading, in case document has no blank
% line. This is redundant with what happens in \aboveenvbreak, but
% we need to do it before changing the fonts, and it's inconvenient
% to change the fonts afterward.
\ifnum \lastpenalty=10000 \else \endgraf \fi
\smallexamplefonts \rm
\fi
}
\def\setsmalldispenv{%
\ifx\SETdispenvsize\nosmallword
\else
\ifnum \lastpenalty=10000 \else \endgraf \fi
\smallexamplefonts \rm
\fi
}
% We often define two environments, @foo and @smallfoo.
% Let's do it in one command. #1 is the env name, #2 the definition.
\def\makedispenvdef#1#2{%
\expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
\expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
\expandafter\let\csname E#1\endcsname \afterenvbreak
\expandafter\let\csname Esmall#1\endcsname \afterenvbreak
}
% Define two environment synonyms (#1 and #2) for an environment.
\def\maketwodispenvdef#1#2#3{%
\makedispenvdef{#1}{#3}%
\makedispenvdef{#2}{#3}%
}
%
% @lisp: indented, narrowed, typewriter font;
% @example: same as @lisp.
%
% @smallexample and @smalllisp: use smaller fonts.
% Originally contributed by Pavel@xerox.
%
\maketwodispenvdef{lisp}{example}{%
\nonfillstart
\tt\setcodequotes
\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
\parsearg\gobble
}
% @display/@smalldisplay: same as @lisp except keep current font.
%
\makedispenvdef{display}{%
\nonfillstart
\gobble
}
% @format/@smallformat: same as @display except don't narrow margins.
%
\makedispenvdef{format}{%
\let\nonarrowing = t%
\nonfillstart
\gobble
}
% @flushleft: same as @format, but doesn't obey \SETdispenvsize.
\envdef\flushleft{%
\let\nonarrowing = t%
\nonfillstart
\gobble
}
\let\Eflushleft = \afterenvbreak
% @flushright.
%
\envdef\flushright{%
\let\nonarrowing = t%
\nonfillstart
\advance\leftskip by 0pt plus 1fill\relax
\gobble
}
\let\Eflushright = \afterenvbreak
% @raggedright does more-or-less normal line breaking but no right
% justification. From plain.tex.
\envdef\raggedright{%
\rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
}
\let\Eraggedright\par
\envdef\raggedleft{%
\parindent=0pt \leftskip0pt plus2em
\spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
\hbadness=10000 % Last line will usually be underfull, so turn off
% badness reporting.
}
\let\Eraggedleft\par
\envdef\raggedcenter{%
\parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
\spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
\hbadness=10000 % Last line will usually be underfull, so turn off
% badness reporting.
}
\let\Eraggedcenter\par
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
% and narrows the margins. We keep \parskip nonzero in general, since
% we're doing normal filling. So, when using \aboveenvbreak and
% \afterenvbreak, temporarily make \parskip 0.
%
\makedispenvdef{quotation}{\quotationstart}
%
\def\quotationstart{%
\indentedblockstart % same as \indentedblock, but increase right margin too.
\ifx\nonarrowing\relax
\advance\rightskip by \lispnarrowing
\fi
\parsearg\quotationlabel
}
% We have retained a nonzero parskip for the environment, since we're
% doing normal filling.
%
\def\Equotation{%
\par
\ifx\quotationauthor\thisisundefined\else
% indent a bit.
\leftline{\kern 2\leftskip \sl ---\quotationauthor}%
\fi
{\parskip=0pt \afterenvbreak}%
}
\def\Esmallquotation{\Equotation}
% If we're given an argument, typeset it in bold with a colon after.
\def\quotationlabel#1{%
\def\temp{#1}%
\ifx\temp\empty \else
{\bf #1: }%
\fi
}
% @indentedblock is like @quotation, but indents only on the left and
% has no optional argument.
%
\makedispenvdef{indentedblock}{\indentedblockstart}
%
\def\indentedblockstart{%
{\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
\parindent=0pt
%
% @cartouche defines \nonarrowing to inhibit narrowing at next level down.
\ifx\nonarrowing\relax
\advance\leftskip by \lispnarrowing
\exdentamount = \lispnarrowing
\else
\let\nonarrowing = \relax
\fi
}
% Keep a nonzero parskip for the environment, since we're doing normal filling.
%
\def\Eindentedblock{%
\par
{\parskip=0pt \afterenvbreak}%
}
\def\Esmallindentedblock{\Eindentedblock}
% LaTeX-like @verbatim...@end verbatim and @verb{...}
% If we want to allow any as delimiter,
% we need the curly braces so that makeinfo sees the @verb command, eg:
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
%
% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
%
% [Knuth] p.344; only we need to do the other characters Texinfo sets
% active too. Otherwise, they get lost as the first character on a
% verbatim line.
\def\dospecials{%
\do\ \do\\\do\{\do\}\do\$\do\&%
\do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
\do\<\do\>\do\|\do\@\do+\do\"%
% Don't do the quotes -- if we do, @set txicodequoteundirected and
% @set txicodequotebacktick will not have effect on @verb and
% @verbatim, and ?` and !` ligatures won't get disabled.
%\do\`\do\'%
}
%
% [Knuth] p. 380
\def\uncatcodespecials{%
\def\do##1{\catcode`##1=\other}\dospecials}
%
% Setup for the @verb command.
%
% Eight spaces for a tab
\begingroup
\catcode`\^^I=\active
\gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
\endgroup
%
\def\setupverb{%
\tt % easiest (and conventionally used) font for verbatim
\def\par{\leavevmode\endgraf}%
\setcodequotes
\tabeightspaces
% Respect line breaks,
% print special symbols as themselves, and
% make each space count
% must do in this order:
\obeylines \uncatcodespecials \sepspaces
}
% Setup for the @verbatim environment
%
% Real tab expansion.
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
%
% We typeset each line of the verbatim in an \hbox, so we can handle
% tabs.
\newbox\verbbox
\def\starttabbox{\setbox\verbbox=\hbox\bgroup}
%
\begingroup
\catcode`\^^I=\active
\gdef\tabexpand{%
\catcode`\^^I=\active
\def^^I{\leavevmode\egroup
\dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
\divide\dimen\verbbox by\tabw
\multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
\advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
\wd\verbbox=\dimen\verbbox
\leavevmode\box\verbbox \starttabbox
}%
}
\endgroup
% start the verbatim environment.
\def\setupverbatim{%
\let\nonarrowing = t%
\nonfillstart
\tt % easiest (and conventionally used) font for verbatim
\def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
\tabexpand
\setcodequotes
% Respect line breaks,
% print special symbols as themselves, and
% make each space count.
% Must do in this order:
\obeylines \uncatcodespecials \sepspaces
}
% Do the @verb magic: verbatim text is quoted by unique
% delimiter characters. Before first delimiter expect a
% right brace, after last delimiter expect closing brace:
%
% \def\doverb'{'#1'}'{#1}
%
% [Knuth] p. 382; only eat outer {}
\begingroup
\catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
\endgroup
%
\def\verb{\begingroup\setupverb\doverb}
%
%
% Do the @verbatim magic: define the macro \doverbatim so that
% the (first) argument ends when '@end verbatim' is reached, ie:
%
% \def\doverbatim#1@end verbatim{#1}
%
% For Texinfo it's a lot easier than for LaTeX,
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
% we need not redefine '\', '{' and '}'.
%
% Inspired by LaTeX's verbatim command set [latex.ltx]
%
\begingroup
\catcode`\ =\active
\obeylines %
% ignore everything up to the first ^^M, that's the newline at the end
% of the @verbatim input line itself. Otherwise we get an extra blank
% line in the output.
\xdef\doverbatim#1^^M#2@end verbatim{%
\starttabbox#2\egroup\noexpand\end\gobble verbatim}%
% We really want {...\end verbatim} in the body of the macro, but
% without the active space; thus we have to use \xdef and \gobble.
% The \egroup ends the \verbbox started at the end of the last line in
% the block.
\endgroup
%
\envdef\verbatim{%
\setnormaldispenv\setupverbatim\doverbatim
}
\let\Everbatim = \afterenvbreak
% @verbatiminclude FILE - insert text of file in verbatim environment.
%
\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
%
\def\doverbatiminclude#1{%
{%
\makevalueexpandable
\setupverbatim
{%
\indexnofonts % Allow `@@' and other weird things in file names.
\wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
\edef\tmp{\noexpand\input #1 }
\expandafter
}\expandafter\starttabbox\tmp\egroup
\afterenvbreak
}%
}
% @copying ... @end copying.
% Save the text away for @insertcopying later.
%
% We save the uninterpreted tokens, rather than creating a box.
% Saving the text in a box would be much easier, but then all the
% typesetting commands (@smallbook, font changes, etc.) have to be done
% beforehand -- and a) we want @copying to be done first in the source
% file; b) letting users define the frontmatter in as flexible order as
% possible is desirable.
%
\def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
%
\def\insertcopying{%
\begingroup
\parindent = 0pt % paragraph indentation looks wrong on title page
\scanexp\copyingtext
\endgroup
}
\message{defuns,}
% @defun etc.
\newskip\defbodyindent \defbodyindent=.4in
\newskip\defargsindent \defargsindent=50pt
\newskip\deflastargmargin \deflastargmargin=18pt
\newcount\defunpenalty
% Start the processing of @deffn:
\def\startdefun{%
\ifnum\lastpenalty<10000
\medbreak
\defunpenalty=10003 % Will keep this @deffn together with the
% following @def command, see below.
\else
% If there are two @def commands in a row, we'll have a \nobreak,
% which is there to keep the function description together with its
% header. But if there's nothing but headers, we need to allow a
% break somewhere. Check specifically for penalty 10002, inserted
% by \printdefunline, instead of 10000, since the sectioning
% commands also insert a nobreak penalty, and we don't want to allow
% a break between a section heading and a defun.
%
% As a further refinement, we avoid "club" headers by signalling
% with penalty of 10003 after the very first @deffn in the
% sequence (see above), and penalty of 10002 after any following
% @def command.
\ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
%
% Similarly, after a section heading, do not allow a break.
% But do insert the glue.
\medskip % preceded by discardable penalty, so not a breakpoint
\fi
%
\parindent=0in
\advance\leftskip by \defbodyindent
\exdentamount=\defbodyindent
}
\def\dodefunx#1{%
% First, check whether we are in the right environment:
\checkenv#1%
%
% As above, allow line break if we have multiple x headers in a row.
% It's not a great place, though.
\ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
%
% And now, it's time to reuse the body of the original defun:
\expandafter\gobbledefun#1%
}
\def\gobbledefun#1\startdefun{}
% \printdefunline \deffnheader{text}
%
\def\printdefunline#1#2{%
\begingroup
% call \deffnheader:
#1#2 \endheader
% common ending:
\interlinepenalty = 10000
\advance\rightskip by 0pt plus 1fil\relax
\endgraf
\nobreak\vskip -\parskip
\penalty\defunpenalty % signal to \startdefun and \dodefunx
% Some of the @defun-type tags do not enable magic parentheses,
% rendering the following check redundant. But we don't optimize.
\checkparencounts
\endgroup
}
\def\Edefun{\endgraf\medbreak}
% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
% the only thing remaining is to define \deffnheader.
%
\def\makedefun#1{%
\expandafter\let\csname E#1\endcsname = \Edefun
\edef\temp{\noexpand\domakedefun
\makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
\temp
}
% \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
%
% Define \deffn and \deffnx, without parameters.
% \deffnheader has to be defined explicitly.
%
\def\domakedefun#1#2#3{%
\envdef#1{%
\startdefun
\doingtypefnfalse % distinguish typed functions from all else
\parseargusing\activeparens{\printdefunline#3}%
}%
\def#2{\dodefunx#1}%
\def#3%
}
\newif\ifdoingtypefn % doing typed function?
\newif\ifrettypeownline % typeset return type on its own line?
% @deftypefnnewline on|off says whether the return type of typed functions
% are printed on their own line. This affects @deftypefn, @deftypefun,
% @deftypeop, and @deftypemethod.
%
\parseargdef\deftypefnnewline{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETtxideftypefnnl\endcsname
= \empty
\else\ifx\temp\offword
\expandafter\let\csname SETtxideftypefnnl\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @txideftypefnnl value `\temp',
must be on|off}%
\fi\fi
}
% \dosubind {index}{topic}{subtopic}
%
% If SUBTOPIC is present, precede it with a space, and call \doind.
% (At some time during the 20th century, this made a two-level entry in an
% index such as the operation index. Nobody seemed to notice the change in
% behaviour though.)
\def\dosubind#1#2#3{%
\def\thirdarg{#3}%
\ifx\thirdarg\empty
\doind{#1}{#2}%
\else
\doind{#1}{#2\space#3}%
\fi
}
% Untyped functions:
% @deffn category name args
\makedefun{deffn}{\deffngeneral{}}
% @deffn category class name args
\makedefun{defop}#1 {\defopon{#1\ \putwordon}}
% \defopon {category on}class name args
\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
% \deffngeneral {subind}category name args
%
\def\deffngeneral#1#2 #3 #4\endheader{%
\dosubind{fn}{\code{#3}}{#1}%
\defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
}
% Typed functions:
% @deftypefn category type name args
\makedefun{deftypefn}{\deftypefngeneral{}}
% @deftypeop category class type name args
\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
% \deftypeopon {category on}class type name args
\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
% \deftypefngeneral {subind}category type name args
%
\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
\dosubind{fn}{\code{#4}}{#1}%
\doingtypefntrue
\defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
% Typed variables:
% @deftypevr category type var args
\makedefun{deftypevr}{\deftypecvgeneral{}}
% @deftypecv category class type var args
\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
% \deftypecvof {category of}class type var args
\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
% \deftypecvgeneral {subind}category type var args
%
\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
\dosubind{vr}{\code{#4}}{#1}%
\defname{#2}{#3}{#4}\defunargs{#5\unskip}%
}
% Untyped variables:
% @defvr category var args
\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
% @defcv category class var args
\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
% \defcvof {category of}class var args
\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
% Types:
% @deftp category name args
\makedefun{deftp}#1 #2 #3\endheader{%
\doind{tp}{\code{#2}}%
\defname{#1}{}{#2}\defunargs{#3\unskip}%
}
% Remaining @defun-like shortcuts:
\makedefun{defun}{\deffnheader{\putwordDeffunc} }
\makedefun{defmac}{\deffnheader{\putwordDefmac} }
\makedefun{defspec}{\deffnheader{\putwordDefspec} }
\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
\makedefun{defvar}{\defvrheader{\putwordDefvar} }
\makedefun{defopt}{\defvrheader{\putwordDefopt} }
\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
\makedefun{defmethod}{\defopon\putwordMethodon}
\makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
\makedefun{defivar}{\defcvof\putwordInstanceVariableof}
\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
% \defname, which formats the name of the @def (not the args).
% #1 is the category, such as "Function".
% #2 is the return type, if any.
% #3 is the function name.
%
% We are followed by (but not passed) the arguments, if any.
%
\def\defname#1#2#3{%
\par
% Get the values of \leftskip and \rightskip as they were outside the @def...
\advance\leftskip by -\defbodyindent
%
% Determine if we are typesetting the return type of a typed function
% on a line by itself.
\rettypeownlinefalse
\ifdoingtypefn % doing a typed function specifically?
% then check user option for putting return type on its own line:
\expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
\rettypeownlinetrue
\fi
\fi
%
% How we'll format the category name. Putting it in brackets helps
% distinguish it from the body text that may end up on the next line
% just below it.
\def\temp{#1}%
\setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
%
% Figure out line sizes for the paragraph shape. We'll always have at
% least two.
\tempnum = 2
%
% The first line needs space for \box0; but if \rightskip is nonzero,
% we need only space for the part of \box0 which exceeds it:
\dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
%
% If doing a return type on its own line, we'll have another line.
\ifrettypeownline
\advance\tempnum by 1
\def\maybeshapeline{0in \hsize}%
\else
\def\maybeshapeline{}%
\fi
%
% The continuations:
\dimen2=\hsize \advance\dimen2 by -\defargsindent
%
% The final paragraph shape:
\parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
%
% Put the category name at the right margin.
\noindent
\hbox to 0pt{%
\hfil\box0 \kern-\hsize
% \hsize has to be shortened this way:
\kern\leftskip
% Intentionally do not respect \rightskip, since we need the space.
}%
%
% Allow all lines to be underfull without complaint:
\tolerance=10000 \hbadness=10000
\exdentamount=\defbodyindent
{%
% defun fonts. We use typewriter by default (used to be bold) because:
% . we're printing identifiers, they should be in tt in principle.
% . in languages with many accents, such as Czech or French, it's
% common to leave accents off identifiers. The result looks ok in
% tt, but exceedingly strange in rm.
% . we don't want -- and --- to be treated as ligatures.
% . this still does not fix the ?` and !` ligatures, but so far no
% one has made identifiers using them :).
\df \tt
\def\temp{#2}% text of the return type
\ifx\temp\empty\else
\tclose{\temp}% typeset the return type
\ifrettypeownline
% put return type on its own line; prohibit line break following:
\hfil\vadjust{\nobreak}\break
\else
\space % type on same line, so just followed by a space
\fi
\fi % no return type
#3% output function name
}%
{\rm\enskip}% hskip 0.5 em of \rmfont
%
\boldbrax
% arguments will be output next, if any.
}
% Print arguments in slanted roman (not ttsl), inconsistently with using
% tt for the name. This is because literal text is sometimes needed in
% the argument list (groff manual), and ttsl and tt are not very
% distinguishable. Prevent hyphenation at `-' chars.
%
\def\defunargs#1{%
% use sl by default (not ttsl),
% tt for the names.
\df \sl \hyphenchar\font=0
%
% On the other hand, if an argument has two dashes (for instance), we
% want a way to get ttsl. We used to recommend @var for that, so
% leave the code in, but it's strange for @var to lead to typewriter.
% Nowadays we recommend @code, since the difference between a ttsl hyphen
% and a tt hyphen is pretty tiny. @code also disables ?` !`.
\def\var##1{{\setregularquotes\ttslanted{##1}}}%
#1%
\sl\hyphenchar\font=45
}
% We want ()&[] to print specially on the defun line.
%
\def\activeparens{%
\catcode`\(=\active \catcode`\)=\active
\catcode`\[=\active \catcode`\]=\active
\catcode`\&=\active
}
% Make control sequences which act like normal parenthesis chars.
\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.
{
\activeparens
\global\let(=\lparen \global\let)=\rparen
\global\let[=\lbrack \global\let]=\rbrack
\global\let& = \&
\gdef\boldbrax{\let(=\opnr\let)=\clnr\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{\bf\ }}
\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\opnr{%
\global\advance\parencount by 1
{\parenfont(}%
\infirstlevel \bfafterword
}
\def\clnr{%
{\parenfont)}%
\infirstlevel \sl
\global\advance\parencount by -1
}
\newcount\brackcount
\def\lbrb{%
\global\advance\brackcount by 1
{\bf[}%
}
\def\rbrb{%
{\bf]}%
\global\advance\brackcount by -1
}
\def\checkparencounts{%
\ifnum\parencount=0 \else \badparencount \fi
\ifnum\brackcount=0 \else \badbrackcount \fi
}
% these should not use \errmessage; the glibc manual, at least, actually
% has such constructs (when documenting function pointers).
\def\badparencount{%
\message{Warning: unbalanced parentheses in @def...}%
\global\parencount=0
}
\def\badbrackcount{%
\message{Warning: unbalanced square brackets in @def...}%
\global\brackcount=0
}
\message{macros,}
% @macro.
% To do this right we need a feature of e-TeX, \scantokens,
% which we arrange to emulate with a temporary file in ordinary TeX.
\ifx\eTeXversion\thisisundefined
\newwrite\macscribble
\def\scantokens#1{%
\toks0={#1}%
\immediate\openout\macscribble=\jobname.tmp
\immediate\write\macscribble{\the\toks0}%
\immediate\closeout\macscribble
\input \jobname.tmp
}
\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{}%
%
% Process the macro body under the current catcode regime.
\scantokens{#1@comment}%
%
% The \comment is to remove the \newlinechar added by \scantokens, and
% can be noticed by \parsearg. Note \c isn't used because this means cedilla
% in math mode.
}
% Used for copying and captions
\def\scanexp#1{%
\expandafter\scanmacro\expandafter{#1}%
}
\newcount\paramno % Count of parameters
\newtoks\macname % Macro name
\newif\ifrecursive % Is it recursive?
% List of all defined macros in the form
% \commondummyword\macro1\commondummyword\macro2...
% Currently is also contains all @aliases; the list can be split
% if there is a need.
\def\macrolist{}
% Add the macro to \macrolist
\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
\def\addtomacrolistxxx#1{%
\toks0 = \expandafter{\macrolist\commondummyword#1}%
\xdef\macrolist{\the\toks0}%
}
% Utility routines.
% This does \let #1 = #2, with \csnames; that is,
% \let \csname#1\endcsname = \csname#2\endcsname
% (except of course we have to play expansion games).
%
\def\cslet#1#2{%
\expandafter\let
\csname#1\expandafter\endcsname
\csname#2\endcsname
}
% Trim leading and trailing spaces off a string.
% Concepts from aro-bend problem 15 (see CTAN).
{\catcode`\@=11
\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
\def\unbrace#1{#1}
\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 trailing ^^M off a string.
{\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcrb#1Q#2Q{#1}%
}
% Macro bodies are absorbed as an argument in a context where
% all characters are catcode 10, 11 or 12, except \ which is active
% (as in normal texinfo). It is necessary to change the definition of \
% to recognize macro arguments; this is the job of \mbodybackslash.
%
% Non-ASCII encodings make 8-bit characters active, so un-activate
% them to avoid their expansion. Must do this non-globally, to
% confine the change to the current group.
%
% It's necessary to have hard CRs when the macro is executed. This is
% done by making ^^M (\endlinechar) catcode 12 when reading the macro
% body, and then making it the \newlinechar in \scanmacro.
%
\def\scanctxt{% used as subroutine
\catcode`\"=\other
\catcode`\+=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode`\^=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\~=\other
\passthroughcharstrue
}
\def\scanargctxt{% used for copying and captions, not macros.
\scanctxt
\catcode`\@=\other
\catcode`\\=\other
\catcode`\^^M=\other
}
\def\macrobodyctxt{% used for @macro definitions
\scanctxt
\catcode`\ =\other
\catcode`\@=\other
\catcode`\{=\other
\catcode`\}=\other
\catcode`\^^M=\other
\usembodybackslash
}
% Used when scanning braced macro arguments. Note, however, that catcode
% changes here are ineffectual if the macro invocation was nested inside
% an argument to another Texinfo command.
\def\macroargctxt{%
\scanctxt
\catcode`\ =\active
\catcode`\@=\other
\catcode`\^^M=\other
\catcode`\\=\active
}
\def\macrolineargctxt{% used for whole-line arguments without braces
\scanctxt
\catcode`\@=\other
\catcode`\{=\other
\catcode`\}=\other
}
% \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N
% where N is the macro parameter number.
% We define \csname macarg.\endcsname to be \realbackslash, so
% \\ in macro replacement text gets you a backslash.
%
{\catcode`@=0 @catcode`@\=@active
@gdef@usembodybackslash{@let\=@mbodybackslash}
@gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
}
\expandafter\def\csname macarg.\endcsname{\realbackslash}
\def\margbackslash#1{\char`\#1 }
\def\macro{\recursivefalse\parsearg\macroxxx}
\def\rmacro{\recursivetrue\parsearg\macroxxx}
\def\macroxxx#1{%
\getargs{#1}% now \macname is the macname and \argl the arglist
\ifx\argl\empty % no arguments
\paramno=0\relax
\else
\expandafter\parsemargdef \argl;%
\if\paramno>256\relax
\ifx\eTeXversion\thisisundefined
\errhelp = \EMsimple
\errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
\fi
\fi
\fi
\if1\csname ismacro.\the\macname\endcsname
\message{Warning: redefining \the\macname}%
\else
\expandafter\ifx\csname \the\macname\endcsname \relax
\else \errmessage{Macro name \the\macname\space already defined}\fi
\global\cslet{macsave.\the\macname}{\the\macname}%
\global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
\addtomacrolist{\the\macname}%
\fi
\begingroup \macrobodyctxt
\ifrecursive \expandafter\parsermacbody
\else \expandafter\parsemacbody
\fi}
\parseargdef\unmacro{%
\if1\csname ismacro.#1\endcsname
\global\cslet{#1}{macsave.#1}%
\global\expandafter\let \csname ismacro.#1\endcsname=0%
% Remove the macro name from \macrolist:
\begingroup
\expandafter\let\csname#1\endcsname \relax
\let\commondummyword\unmacrodo
\xdef\macrolist{\macrolist}%
\endgroup
\else
\errmessage{Macro #1 not defined}%
\fi
}
% Called by \do from \dounmacro on each macro. The idea is to omit any
% macro definitions that have been changed to \relax.
%
\def\unmacrodo#1{%
\ifx #1\relax
% remove this
\else
\noexpand\commondummyword \noexpand#1%
\fi
}
% \getargs -- Parse the arguments to a @macro line. Set \macname to
% the name of the macro, and \argl to the braced argument list.
\def\getargs#1{\getargsxxx#1{}}
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
\def\getmacname#1 #2\relax{\macname={#1}}
\def\getmacargs#1{\def\argl{#1}}
% This made use of the feature that if the last token of a
% is #, then the preceding argument is delimited by
% an opening brace, and that opening brace is not consumed.
% 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
% three-param macro.) Define \macarg.BLAH for each BLAH in the params
% list to some hook where the argument is to be expanded. If there are
% less than 10 arguments that hook is to be replaced by ##N where N
% is the position in that list, that is to say the macro arguments are to be
% defined `a la TeX in the macro body.
%
% That gets used by \mbodybackslash (above).
%
% If there are 10 or more arguments, a different technique is used: see
% \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
\parsemmanyargdef@@#1,;,% 10 or more arguments
\fi
}
\def\parsemargdefxxx#1,{%
\if#1;\let\next=\relax
\else \let\next=\parsemargdefxxx
\advance\paramno by 1
\expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
{\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
\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
%
% Read recursive and nonrecursive macro bodies. (They're different since
% rec and nonrec macros end differently.)
%
% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
% body to be transformed.
% Set \macrobody to the body of the macro, and call \defmacro.
%
{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
% Make @ a letter, so that we can make private-to-Texinfo macro names.
\edef\texiatcatcode{\the\catcode`\@}
\catcode `@=11\relax
%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
% If there are 10 or more arguments, a different technique is used, where the
% hook remains in the body, and when macro is to be expanded the body is
% processed again to replace the arguments.
%
% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
% argument N value and then \edef the body (nothing else will expand because of
% the catcode regime under which the body was input).
%
% If you compile with TeX (not eTeX), and you have macros with 10 or more
% arguments, no macro can have more than 256 arguments (else error).
%
% In case that there are 10 or more arguments we parse again the arguments
% list to set new definitions for the \macarg.BLAH macros corresponding to
% each BLAH argument. It was anyhow needed to parse already once this list
% in order to count the arguments, and as macros with at most 9 arguments
% are by far more frequent than macro with 10 or more arguments, defining
% twice the \macarg.BLAH macros does not cost too much processing power.
\def\parsemmanyargdef@@#1,{%
\if#1;\let\next=\relax
\else
\let\next=\parsemmanyargdef@@
\edef\tempb{\eatspaces{#1}}%
\expandafter\def\expandafter\tempa
\expandafter{\csname macarg.\tempb\endcsname}%
% Note that we need some extra \noexpand\noexpand, this is because we
% don't want \the to be expanded in the \parsermacbody as it uses an
% \xdef .
\expandafter\edef\tempa
{\noexpand\noexpand\noexpand\the\toks\the\paramno}%
\advance\paramno by 1\relax
\fi\next}
\let\endargs@\relax
\let\nil@\relax
\def\nilm@{\nil@}%
\long\def\nillm@{\nil@}%
% This macro is expanded during the Texinfo macro expansion, not during its
% definition. It gets all the arguments' values and assigns them to macros
% macarg.ARGNAME
%
% #1 is the macro name
% #2 is the list of argument names
% #3 is the list of argument values
\def\getargvals@#1#2#3{%
\def\macargdeflist@{}%
\def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
\def\paramlist{#2,\nil@}%
\def\macroname{#1}%
\begingroup
\macroargctxt
\def\argvaluelist{#3,\nil@}%
\def\@tempa{#3}%
\ifx\@tempa\empty
\setemptyargvalues@
\else
\getargvals@@
\fi
}
\def\getargvals@@{%
\ifx\paramlist\nilm@
% Some sanity check needed here that \argvaluelist is also empty.
\ifx\argvaluelist\nillm@
\else
\errhelp = \EMsimple
\errmessage{Too many arguments in macro `\macroname'!}%
\fi
\let\next\macargexpandinbody@
\else
\ifx\argvaluelist\nillm@
% No more arguments values passed to macro. Set remaining named-arg
% macros to empty.
\let\next\setemptyargvalues@
\else
% pop current arg name into \@tempb
\def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
\expandafter\@tempa\expandafter{\paramlist}%
% pop current argument value into \@tempc
\def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
\expandafter\@tempa\expandafter{\argvaluelist}%
% Here \@tempb is the current arg name and \@tempc is the current arg value.
% First place the new argument macro definition into \@tempd
\expandafter\macname\expandafter{\@tempc}%
\expandafter\let\csname macarg.\@tempb\endcsname\relax
\expandafter\def\expandafter\@tempe\expandafter{%
\csname macarg.\@tempb\endcsname}%
\edef\@tempd{\long\def\@tempe{\the\macname}}%
\push@\@tempd\macargdeflist@
\let\next\getargvals@@
\fi
\fi
\next
}
\def\push@#1#2{%
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter#2%
\expandafter\expandafter\expandafter{%
\expandafter#1#2}%
}
% Replace arguments by their values in the macro body, and place the result
% in macro \@tempa.
%
\def\macvalstoargs@{%
% To do this we use the property that token registers that are \the'ed
% within an \edef expand only once. So we are going to place all argument
% values into respective token registers.
%
% First we save the token context, and initialize argument numbering.
\begingroup
\paramno0\relax
% Then, for each argument number #N, we place the corresponding argument
% value into a new token list register \toks#N
\expandafter\putargsintokens@\saveparamlist@,;,%
% Then, we expand the body so that argument are replaced by their
% values. The trick for values not to be expanded themselves is that they
% are within tokens and that tokens expand only once in an \edef .
\edef\@tempc{\csname mac.\macroname .body\endcsname}%
% Now we restore the token stack pointer to free the token list registers
% which we have used, but we make sure that expanded body is saved after
% group.
\expandafter
\endgroup
\expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
}
% Define the named-macro outside of this group and then close this group.
%
\def\macargexpandinbody@{%
\expandafter
\endgroup
\macargdeflist@
% First the replace in body the macro arguments by their values, the result
% is in \@tempa .
\macvalstoargs@
% Then we point at the \norecurse or \gobble (for recursive) macro value
% with \@tempb .
\expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
% Depending on whether it is recursive or not, we need some tailing
% \egroup .
\ifx\@tempb\gobble
\let\@tempc\relax
\else
\let\@tempc\egroup
\fi
% And now we do the real job:
\edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
\@tempd
}
\def\putargsintokens@#1,{%
\if#1;\let\next\relax
\else
\let\next\putargsintokens@
% First we allocate the new token list register, and give it a temporary
% alias \@tempb .
\toksdef\@tempb\the\paramno
% Then we place the argument value into that token list register.
\expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
\expandafter\@tempb\expandafter{\@tempa}%
\advance\paramno by 1\relax
\fi
\next
}
% Trailing missing arguments are set to empty.
%
\def\setemptyargvalues@{%
\ifx\paramlist\nilm@
\let\next\macargexpandinbody@
\else
\expandafter\setemptyargvaluesparser@\paramlist\endargs@
\let\next\setemptyargvalues@
\fi
\next
}
\def\setemptyargvaluesparser@#1,#2\endargs@{%
\expandafter\def\expandafter\@tempa\expandafter{%
\expandafter\def\csname macarg.#1\endcsname{}}%
\push@\@tempa\macargdeflist@
\def\paramlist{#2}%
}
% #1 is the element target macro
% #2 is the list macro
% #3,#4\endargs@ is the list value
\def\pop@#1#2#3,#4\endargs@{%
\def#1{#3}%
\def#2{#4}%
}
\long\def\longpop@#1#2#3,#4\endargs@{%
\long\def#1{#3}%
\long\def#2{#4}%
}
%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
% This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
% \macrobody has the body of the macro in it, with placeholders for
% its parameters, looking like "\xeatspaces{\hash 1}".
% \paramno is the number of parameters
% \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
% There are four cases: macros of zero, one, up to nine, and many arguments.
% \xdef is used so that macro definitions will survive the file
% they're defined in: @include reads the file inside a group.
%
\def\defmacro{%
\let\hash=##% convert placeholders to macro parameter chars
\ifnum\paramno=1
\def\xeatspaces##1{##1}%
% This removes the pair of braces around the argument. We don't
% use \eatspaces, because this can cause ends of lines to be lost
% when the argument to \eatspaces is read, leading to line-based
% commands like "@itemize" not being read correctly.
\else
\let\xeatspaces\relax % suppress expansion
\fi
\ifcase\paramno
% 0
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup
\noexpand\spaceisspace
\noexpand\endlineisspace
\noexpand\expandafter % skip any whitespace after the macro name.
\expandafter\noexpand\csname\the\macname @@@\endcsname}%
\expandafter\xdef\csname\the\macname @@@\endcsname{%
\egroup
\noexpand\scanmacro{\macrobody}}%
\or % 1
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup
\noexpand\braceorline
\expandafter\noexpand\csname\the\macname @@@\endcsname}%
\expandafter\xdef\csname\the\macname @@@\endcsname##1{%
\egroup
\noexpand\scanmacro{\macrobody}%
}%
\else % at most 9
\ifnum\paramno<10\relax
% @MACNAME sets the context for reading the macro argument
% @MACNAME@@ gets the argument, processes backslashes and appends a
% comma.
% @MACNAME@@@ removes braces surrounding the argument list.
% @MACNAME@@@@ scans the macro body with arguments substituted.
\expandafter\xdef\csname\the\macname\endcsname{%
\bgroup
\noexpand\expandafter % This \expandafter skip any spaces after the
\noexpand\macroargctxt % macro before we change the catcode of space.
\noexpand\expandafter
\expandafter\noexpand\csname\the\macname @@\endcsname}%
\expandafter\xdef\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{%
\egroup\noexpand\scanmacro{\macrobody}}%
\else % 10 or more:
\expandafter\xdef\csname\the\macname\endcsname{%
\noexpand\getargvals@{\the\macname}{\argl}%
}%
\global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
\global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
\fi
\fi}
\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
@catcode`@_=11 % private names
@catcode`@!=11 % used as argument separator
% \passargtomacro#1#2 -
% Call #1 with a list of tokens #2, with any doubled backslashes in #2
% compressed to one.
%
% This implementation works by expansion, and not execution (so we cannot use
% \def or similar). This reduces the risk of this failing in contexts where
% complete expansion is done with no execution (for example, in writing out to
% an auxiliary file for an index entry).
%
% State is kept in the input stream: the argument passed to
% @look_ahead, @gobble_and_check_finish and @add_segment is
%
% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
%
% where:
% THE_MACRO - name of the macro we want to call
% ARG_RESULT - argument list we build to pass to that macro
% PENDING_BS - either a backslash or nothing
% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
@gdef@passargtomacro#1#2{%
@add_segment #1!{}@relax#2\@_finish\%
}
@gdef@_finish{@_finishx} @global@let@_finishx@relax
% #1 - THE_MACRO ARG_RESULT
% #2 - PENDING_BS
% #3 - NEXT_TOKEN
% #4 used to look ahead
%
% If the next token is not a backslash, process the rest of the argument;
% otherwise, remove the next token.
@gdef@look_ahead#1!#2#3#4{%
@ifx#4\%
@expandafter@gobble_and_check_finish
@else
@expandafter@add_segment
@fi#1!{#2}#4#4%
}
% #1 - THE_MACRO ARG_RESULT
% #2 - PENDING_BS
% #3 - NEXT_TOKEN
% #4 should be a backslash, which is gobbled.
% #5 looks ahead
%
% Double backslash found. Add a single backslash, and look ahead.
@gdef@gobble_and_check_finish#1!#2#3#4#5{%
@add_segment#1\!{}#5#5%
}
@gdef@is_fi{@fi}
% #1 - THE_MACRO ARG_RESULT
% #2 - PENDING_BS
% #3 - NEXT_TOKEN
% #4 is input stream until next backslash
%
% Input stream is either at the start of the argument, or just after a
% backslash sequence, either a lone backslash, or a doubled backslash.
% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
% finish; otherwise, append to ARG_RESULT the segment of the argument up until
% the next backslash. PENDING_BACKSLASH contains a backslash to represent
% a backslash just before the start of the input stream that has not been
% added to ARG_RESULT.
@gdef@add_segment#1!#2#3#4\{%
@ifx#3@_finish
@call_the_macro#1!%
@else
% append the pending backslash to the result, followed by the next segment
@expandafter@is_fi@look_ahead#1#2#4!{\}@fi
% this @fi is discarded by @look_ahead.
% we can't get rid of it with \expandafter because we don't know how
% long #4 is.
}
% #1 - THE_MACRO
% #2 - ARG_RESULT
% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
% conditional.
@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \braceorline MAC is used for a one-argument macro MAC. It checks
% whether the next non-whitespace character is a {. It sets the context
% for reading the argument (slightly different in the two cases). Then,
% to read the argument, in the whole-line case, it then calls the regular
% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
%
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
\def\braceorlinexxx{%
\ifx\nchar\bgroup
\macroargctxt
\expandafter\passargtomacro
\else
\macrolineargctxt\expandafter\parsearg
\fi \macnamexxx}
% @alias.
% We need some trickery to remove the optional spaces around the equal
% sign. Make them active and then expand them all to nothing.
%
\def\alias{\parseargusing\obeyspaces\aliasxxx}
\def\aliasxxx #1{\aliasyyy#1\relax}
\def\aliasyyy #1=#2\relax{%
{%
\expandafter\let\obeyedspace=\empty
\addtomacrolist{#1}%
\xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
}%
\next
}
\message{cross references,}
\newwrite\auxfile
\newif\ifhavexrefs % True if xref values are known.
\newif\ifwarnedxrefs % True if we warned once that they aren't known.
% @inforef is relatively simple.
\def\inforef #1{\inforefzzz #1,,,,**}
\def\inforefzzz #1,#2,#3,#4**{%
\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
node \samp{\ignorespaces#1{}}}
% @node's only job in TeX is to define \lastnode, which is used in
% cross-references. The @node line might or might not have commas, and
% might or might not have spaces before the first comma, like:
% @node foo , bar , ...
% We don't want such trailing spaces in the node name.
%
\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
%
% also remove a trailing comma, in case of something like this:
% @node Help-Cross, , , Cross-refs
\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
% Used so that the @top node doesn't have to be wrapped in an @ifnottex
% conditional.
% \doignore goes to more effort to skip nested conditionals but we don't need
% that here.
\def\omittopnode{%
\ifx\lastnode\wordTop
\expandafter\ignorenode\fi
}
\def\wordTop{Top}
% Until the next @node or @bye command, divert output to a box that is not
% output.
\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
\ignorenodebye
}
{\let\bye\relax
\gdef\ignorenodebye{\let\bye\ignorenodebyedef}
\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
% The redefinition of \bye here is because it is declared \outer
\let\lastnode=\empty
% Write a cross-reference definition for the current node. #1 is the
% type (Ynumbered, Yappendix, Ynothing).
%
\def\donoderef#1{%
\ifx\lastnode\empty\else
\setref{\lastnode}{#1}%
\global\let\lastnode=\empty
\fi
}
% @anchor{NAME} -- define xref target at arbitrary point.
%
\newcount\savesfregister
%
\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.
% 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{%
\pdfmkdest{#1}%
\iflinks
{%
\requireauxfile
\atdummies % preserve commands, but don't expand them
% match definition in \xrdef, \refx, \xrefX.
\def\value##1{##1}%
\edef\writexrdef##1##2{%
\write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
##1}{##2}}% these are parameters of \writexrdef
}%
\toks0 = \expandafter{\currentsection}%
\immediate \writexrdef{title}{\the\toks0 }%
\immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
\safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
}%
\fi
}
% @xrefautosectiontitle on|off says whether @section(ing) names are used
% automatically in xrefs, if the third arg is not explicitly specified.
% This was provided as a "secret" @set xref-automatic-section-title
% variable, now it's official.
%
\parseargdef\xrefautomaticsectiontitle{%
\def\temp{#1}%
\ifx\temp\onword
\expandafter\let\csname SETxref-automatic-section-title\endcsname
= \empty
\else\ifx\temp\offword
\expandafter\let\csname SETxref-automatic-section-title\endcsname
= \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
must be on|off}%
\fi\fi
}
%
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
% the node name, #2 the name of the Info cross-reference, #3 the printed
% node name, #4 the name of the Info file, #5 the name of the printed
% manual. All but the node name can be omitted.
%
\def\pxref{\putwordsee{} \xrefXX}
\def\xref{\putwordSee{} \xrefXX}
\def\ref{\xrefXX}
\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
%
\newbox\toprefbox
\newbox\printedrefnamebox
\newbox\infofilenamebox
\newbox\printedmanualbox
%
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
\unsepspaces
%
% Get args without leading/trailing spaces.
\def\printedrefname{\ignorespaces #3}%
\setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
%
\def\infofilename{\ignorespaces #4}%
\setbox\infofilenamebox = \hbox{\infofilename\unskip}%
%
\def\printedmanual{\ignorespaces #5}%
\setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
%
% If the printed reference name (arg #3) was not explicitly given in
% the @xref, figure out what we want to use.
\ifdim \wd\printedrefnamebox = 0pt
% No printed node name was explicitly given.
\expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
% Not auto section-title: use node name inside the square brackets.
\def\printedrefname{\ignorespaces #1}%
\else
% Auto section-title: use chapter/section title inside
% the square brackets if we have it.
\ifdim \wd\printedmanualbox > 0pt
% It is in another manual, so we don't have it; use node name.
\def\printedrefname{\ignorespaces #1}%
\else
\ifhavexrefs
% We (should) know the real title if we have the xref values.
\def\printedrefname{\refx{#1-title}}%
\else
% Otherwise just copy the Info node name.
\def\printedrefname{\ignorespaces #1}%
\fi%
\fi
\fi
\fi
%
% Make link in pdf output.
\ifpdf
% For pdfTeX and LuaTeX
{\indexnofonts
\makevalueexpandable
\turnoffactive
% This expands tokens, so do it after making catcode changes, so _
% etc. don't get their TeX definitions. This ignores all spaces in
% #4, including (wrongly) those in the middle of the filename.
\getfilename{#4}%
%
% This (wrongly) does not take account of leading or trailing
% spaces in #1, which should be ignored.
\setpdfdestname{#1}%
%
\ifx\pdfdestname\empty
\def\pdfdestname{Top}% no empty targets
\fi
%
\leavevmode
\startlink attr{/Border [0 0 0]}%
\ifnum\filenamelength>0
goto file{\the\filename.pdf} name{\pdfdestname}%
\else
goto name{\pdfmkpgn{\pdfdestname}}%
\fi
}%
\setcolor{\linkcolor}%
\else
\ifx\XeTeXrevision\thisisundefined
\else
% For XeTeX
{\indexnofonts
\makevalueexpandable
\turnoffactive
% This expands tokens, so do it after making catcode changes, so _
% etc. don't get their TeX definitions. This ignores all spaces in
% #4, including (wrongly) those in the middle of the filename.
\getfilename{#4}%
%
% This (wrongly) does not take account of leading or trailing
% spaces in #1, which should be ignored.
\setpdfdestname{#1}%
%
\ifx\pdfdestname\empty
\def\pdfdestname{Top}% no empty targets
\fi
%
\leavevmode
\ifnum\filenamelength>0
% With default settings,
% XeTeX (xdvipdfmx) replaces link destination names with integers.
% In this case, the replaced destination names of
% remote PDFs are no longer known. In order to avoid a replacement,
% you can use xdvipdfmx's command line option `-C 0x0010'.
% If you use XeTeX 0.99996+ (TeX Live 2016+),
% this command line option is no longer necessary
% because we can use the `dvipdfmx:config' special.
\special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
<< /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
\else
\special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
<< /S /GoTo /D (\pdfdestname) >> >>}%
\fi
}%
\setcolor{\linkcolor}%
\fi
\fi
{%
% 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
}%
%
% Float references are printed completely differently: "Figure 1.2"
% instead of "[somenode], p.3". \iffloat distinguishes them by
% \Xthisreftitle being set to a magic string.
\iffloat\Xthisreftitle
% If the user specified the print name (third arg) to the ref,
% print it instead of our usual "Figure 1.2".
\ifdim\wd\printedrefnamebox = 0pt
\refx{#1-snt}%
\else
\printedrefname
\fi
%
% If the user also gave the printed manual name (fifth arg), append
% "in MANUALNAME".
\ifdim \wd\printedmanualbox > 0pt
\space \putwordin{} \cite{\printedmanual}%
\fi
\else
% node/anchor (non-float) references.
%
% If we use \unhbox to print the node names, TeX does not insert
% empty discretionaries after hyphens, which means that it will not
% find a line break at a hyphen in a node names. Since some manuals
% are best written with fairly long node names, containing hyphens,
% this is a loss. Therefore, we give the text of the node name
% again, so it is as if TeX is seeing it for the first time.
%
\ifdim \wd\printedmanualbox > 0pt
% 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
%
% output the `[mynode]' via the macro below so it can be overridden.
\xrefprintnodename\printedrefname
%
\expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax
% But we always want a comma and a space:
,\space
%
% output the `page 3'.
\turnoffactive \putwordpage\tie\refx{#1-pg}%
% Add a , if xref followed by a space
\if\space\noexpand\tokenafterxref ,%
\else\ifx\ \tokenafterxref ,% @TAB
\else\ifx\*\tokenafterxref ,% @*
\else\ifx\ \tokenafterxref ,% @SPACE
\else\ifx\
\tokenafterxref ,% @NL
\else\ifx\tie\tokenafterxref ,% @tie
\fi\fi\fi\fi\fi\fi
\fi
\fi\fi
\fi
\endlink
\endgroup}
% Output a cross-manual xref to #1. Used just above (twice).
%
% Only include the text "Section ``foo'' in" if the foo is neither
% missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
% "see The Foo Manual", the idea being to refer to the whole manual.
%
% But, this being TeX, we can't easily compare our node name against the
% string "Top" while ignoring the possible spaces before and after in
% the input. By adding the arbitrary 7sp below, we make it much less
% likely that a real node name would have the same width as "Top" (e.g.,
% in a monospaced font). Hopefully it will never happen in practice.
%
% For the same basic reason, we retypeset the "Top" at every
% reference, since the current font is indeterminate.
%
\def\crossmanualxref#1{%
\setbox\toprefbox = \hbox{Top\kern7sp}%
\setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
\ifdim \wd2 > 7sp % nonempty?
\ifdim \wd2 = \wd\toprefbox \else % same as Top?
\putwordSection{} ``\printedrefname'' \putwordin{}\space
\fi
\fi
#1%
}
% This macro is called from \xrefX for the `[nodename]' part of xref
% output. It's a separate macro only so it can be changed more easily,
% since square brackets don't work well in some documents. Particularly
% one that Bob is working on :).
%
\def\xrefprintnodename#1{[#1]}
% Things referred to by \setref.
%
\def\Ynothing{}
\def\Yomitfromtoc{}
\def\Ynumbered{%
\ifnum\secno=0
\putwordChapter@tie \the\chapno
\else \ifnum\subsecno=0
\putwordSection@tie \the\chapno.\the\secno
\else \ifnum\subsubsecno=0
\putwordSection@tie \the\chapno.\the\secno.\the\subsecno
\else
\putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
\def\Yappendix{%
\ifnum\secno=0
\putwordAppendix@tie @char\the\appendixno{}%
\else \ifnum\subsecno=0
\putwordSection@tie @char\the\appendixno.\the\secno
\else \ifnum\subsubsecno=0
\putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
\else
\putwordSection@tie
@char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
% \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
}%
\ifx\thisrefX\relax
% If not defined, say something at least.
\angleleft un\-de\-fined\angleright
\iflinks
\ifhavexrefs
{\toks0 = {#1}% avoid expansion of possibly-complex value
\message{\linenumber Undefined cross reference `\the\toks0'.}}%
\else
\ifwarnedxrefs\else
\global\warnedxrefstrue
\message{Cross reference values unknown; you must run TeX again.}%
\fi
\fi
\fi
\else
% It's defined, so just use it.
\thisrefX
\fi
}
% 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
% type, we have more work to do.
%
\def\xrdef#1#2{%
{% Expand the node or anchor name to remove control sequences.
% \turnoffactive stops 8-bit characters being changed to commands
% like @'e. \refx does the same to retrieve the value in the definition.
\indexnofonts
\turnoffactive
\def\value##1{##1}%
\xdef\safexrefname{#1}%
}%
%
\bgroup
\expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
\egroup
% We put the \gdef inside a group to avoid the definitions building up on
% TeX's save stack, which can cause it to run out of space for aux files with
% thousands of lines. \gdef doesn't use the save stack, but \csname does
% when it defines an unknown control sequence as \relax.
%
% Was that xref control sequence that we just defined for a float?
\expandafter\iffloat\csname XR\safexrefname\endcsname
% it was a float, and we have the (safe) float type in \iffloattype.
\expandafter\let\expandafter\floatlist
\csname floatlist\iffloattype\endcsname
%
% Is this the first time we've seen this float type?
\expandafter\ifx\floatlist\relax
\toks0 = {\do}% yes, so just \do
\else
% had it before, so preserve previous elements in list.
\toks0 = \expandafter{\floatlist\do}%
\fi
%
% Remember this xref in the control sequence \floatlistFLOATTYPE,
% for later use in \listoffloats.
\expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
{\safexrefname}}%
\fi
}
% If working on a large document in chapters, it is convenient to
% be able to disable indexing, cross-referencing, and contents, for test runs.
% This is done with @novalidate at the beginning of the file.
%
\newif\iflinks \linkstrue % by default we want the aux files.
\let\novalidate = \linksfalse
% Used when writing to the aux file, or when using data from it.
\def\requireauxfile{%
\iflinks
\tryauxfile
% Open the new aux file. TeX will close it automatically at exit.
\immediate\openout\auxfile=\jobname.aux
\fi
\global\let\requireauxfile=\relax % Only do this once.
}
% Read the last existing aux file, if any. No error if none exists.
%
\def\tryauxfile{%
\openin 1 \jobname.aux
\ifeof 1 \else
\readdatafile{aux}%
\global\havexrefstrue
\fi
\closein 1
}
\def\setupdatafile{%
\catcode`\^^@=\other
\catcode`\^^A=\other
\catcode`\^^B=\other
\catcode`\^^C=\other
\catcode`\^^D=\other
\catcode`\^^E=\other
\catcode`\^^F=\other
\catcode`\^^G=\other
\catcode`\^^H=\other
\catcode`\^^K=\other
\catcode`\^^L=\other
\catcode`\^^N=\other
\catcode`\^^P=\other
\catcode`\^^Q=\other
\catcode`\^^R=\other
\catcode`\^^S=\other
\catcode`\^^T=\other
\catcode`\^^U=\other
\catcode`\^^V=\other
\catcode`\^^W=\other
\catcode`\^^X=\other
\catcode`\^^Z=\other
\catcode`\^^[=\other
\catcode`\^^\=\other
\catcode`\^^]=\other
\catcode`\^^^=\other
\catcode`\^^_=\other
\catcode`\^=\other
%
% Special characters. Should be turned off anyway, but...
\catcode`\~=\other
\catcode`\[=\other
\catcode`\]=\other
\catcode`\"=\other
\catcode`\_=\active
\catcode`\|=\active
\catcode`\<=\active
\catcode`\>=\active
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
\catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off
%
\catcode`\\=\active
%
% @ is our escape character in .aux files, and we need braces.
\catcode`\{=1
\catcode`\}=2
\catcode`\@=0
}
\def\readdatafile#1{%
\begingroup
\setupdatafile
\input\jobname.#1
\endgroup}
\message{insertions,}
% including footnotes.
\newcount \footnoteno
% The trailing space in the following definition for supereject is
% vital for proper filling; pages come out unaligned when you do a
% pagealignmacro call if that space before the closing brace is
% removed. (Generally, numeric constants should always be followed by a
% space to prevent strange expansion errors.)
\def\supereject{\par\penalty -20000\footnoteno =0 }
% @footnotestyle is meaningful for Info output only.
\let\footnotestyle=\comment
{\catcode `\@=11
%
% Auto-number footnotes. Otherwise like plain.
\gdef\footnote{%
\global\advance\footnoteno by \@ne
\edef\thisfootno{$^{\the\footnoteno}$}%
%
% In case the footnote comes at the end of a sentence, preserve the
% extra spacing after we do the footnote number.
\let\@sf\empty
\ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
%
% Remove inadvertent blank space before typesetting the footnote number.
\unskip
\thisfootno\@sf
\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.
%
\gdef\dofootnote{%
\insert\footins\bgroup
%
% Nested footnotes are not supported in TeX, that would take a lot
% more work. (\startsavinginserts does not suffice.)
\let\footnote=\errfootnotenest
%
% We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment.
% So reset some parameters.
\hsize=\txipagewidth
\interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox
\floatingpenalty\@MM
\leftskip\z@skip
\rightskip\z@skip
\spaceskip\z@skip
\xspaceskip\z@skip
\parindent\defaultparindent
%
\smallfonts \rm
%
% Because we use hanging indentation in footnotes, a @noindent appears
% to exdent this text, so make it be a no-op. makeinfo does not use
% hanging indentation so @noindent can still be needed within footnote
% text after an @example or the like (not that this is good style).
\let\noindent = \relax
%
% Hang the footnote text off the number. Use \everypar in case the
% footnote extends for more than one paragraph.
\everypar = {\hang}%
\textindent{\thisfootno}%
%
% 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.
\futurelet\next\fo@t
}
}%end \catcode `\@=11
\def\errfootnotenest{%
\errhelp=\EMsimple
\errmessage{Nested footnotes not supported in texinfo.tex,
even though they work in makeinfo; sorry}
}
\def\errfootnoteheading{%
\errhelp=\EMsimple
\errmessage{Footnotes in chapters, sections, etc., are not supported}
}
% In case a @footnote appears in a vbox, save the footnote text and create
% the real \insert just after the vbox finished. Otherwise, the insertion
% would be lost.
% Similarly, if a @footnote appears inside an alignment, save the footnote
% text to a box and make the \insert when a row of the table is finished.
% And the same can be done for other insert classes. --kasal, 16nov03.
%
% Replace the \insert primitive by a cheating macro.
% Deeper inside, just make sure that the saved insertions are not spilled
% out prematurely.
%
\def\startsavinginserts{%
\ifx \insert\ptexinsert
\let\insert\saveinsert
\else
\let\checkinserts\relax
\fi
}
% This \insert replacement works for both \insert\footins{foo} and
% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
%
\def\saveinsert#1{%
\edef\next{\noexpand\savetobox \makeSAVEname#1}%
\afterassignment\next
% swallow the left brace
\let\temp =
}
\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
\def\placesaveins#1{%
\ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
{\box#1}%
}
% eat @SAVE -- beware, all of them have catcode \other:
{
\def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
\gdef\gobblesave @SAVE{}
}
% initialization:
\def\newsaveins #1{%
\edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
\next
}
\def\newsaveinsX #1{%
\csname newbox\endcsname #1%
\expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
\checksaveins #1}%
}
% initialize:
\let\checkinserts\empty
\newsaveins\footins
\newsaveins\margin
% @image. We use the macros from epsf.tex to support this.
% If epsf.tex is not installed and @image is used, we complain.
%
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
\openin 1 = epsf.tex
\ifeof 1 \else
% Do not bother showing banner with epsf.tex v2.7k (available in
% doc/epsf.tex and on ctan).
\def\epsfannounce{\toks0 = }%
\input epsf.tex
\fi
\closein 1
%
% We will only complain once about lack of epsf.tex.
\newif\ifwarnednoepsf
\newhelp\noepsfhelp{epsf.tex must be installed for images to
work. It is also included in the Texinfo distribution, or you can get
it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
%
\def\image#1{%
\ifx\epsfbox\thisisundefined
\ifwarnednoepsf \else
\errhelp = \noepsfhelp
\errmessage{epsf.tex not found, images will be ignored}%
\global\warnednoepsftrue
\fi
\else
\imagexxx #1,,,,,\finish
\fi
}
%
% Arguments to @image:
% #1 is (mandatory) image filename; we tack on .eps extension.
% #2 is (optional) width, #3 is (optional) height.
% #4 is (ignored optional) html alt text.
% #5 is (ignored optional) extension.
% #6 is just the usual extra ignored arg for parsing stuff.
\newif\ifimagevmode
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
\catcode`\^^M = 5 % in case we're inside an example
\normalturnoffactive % allow _ et al. in names
\makevalueexpandable
% If the image is by itself, center it.
\ifvmode
\imagevmodetrue
\else \ifx\centersub\centerV
% for @center @image, we need a vbox so we can have our vertical space
\imagevmodetrue
\vbox\bgroup % vbox has better behavior than vtop herev
\fi\fi
%
\ifimagevmode
\nobreak\medskip
% Usually we'll have text after the image which will insert
% \parskip glue, so insert it here too to equalize the space
% above and below.
\nobreak\vskip\parskip
\nobreak
\fi
%
% Leave vertical mode so that indentation from an enclosing
% environment such as @quotation is respected.
% However, if we're at the top level, we don't want the
% normal paragraph indentation.
% On the other hand, if we are in the case of @center @image, we don't
% want to start a paragraph, which will create a hsize-width box and
% eradicate the centering.
\ifx\centersub\centerV \else \imageindent \fi
%
% Output the image.
\ifpdf
% For pdfTeX and LuaTeX <= 0.80
\dopdfimage{#1}{#2}{#3}%
\else
\ifx\XeTeXrevision\thisisundefined
% For epsf.tex
% \epsfbox itself resets \epsf?size at each figure.
\setbox0 = \hbox{\ignorespaces #2}%
\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
\setbox0 = \hbox{\ignorespaces #3}%
\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
\epsfbox{#1.eps}%
\else
% For XeTeX
\doxeteximage{#1}{#2}{#3}%
\fi
\fi
%
\ifimagevmode
\medskip % space after a standalone image
\fi
\ifx\centersub\centerV \egroup \fi
\endgroup}
% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
% etc. We don't actually implement floating yet, we always include the
% float "here". But it seemed the best name for the future.
%
\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
% There may be a space before second and/or third parameter; delete it.
\def\eatcommaspace#1, {#1,}
% #1 is the optional FLOATTYPE, the text label for this float, typically
% "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
% this float will not be numbered and cannot be referred to.
%
% #2 is the optional xref label. Also must be present for the float to
% be referable.
%
% #3 is the optional positioning argument; for now, it is ignored. It
% will somehow specify the positions allowed to float to (here, top, bottom).
%
% We keep a separate counter for each FLOATTYPE, which we reset at each
% chapter-level command.
\let\resetallfloatnos=\empty
%
\def\dofloat#1,#2,#3,#4\finish{%
\let\thiscaption=\empty
\let\thisshortcaption=\empty
%
% don't lose footnotes inside @float.
%
% BEWARE: when the floats start float, we have to issue warning whenever an
% insert appears inside a float which could possibly float. --kasal, 26may04
%
\startsavinginserts
%
% We can't be used inside a paragraph.
\par
%
\vtop\bgroup
\def\floattype{#1}%
\def\floatlabel{#2}%
\def\floatloc{#3}% we do nothing with this yet.
%
\ifx\floattype\empty
\let\safefloattype=\empty
\else
{%
% the floattype might have accents or other special characters,
% but we need to use it in a control sequence name.
\indexnofonts
\turnoffactive
\xdef\safefloattype{\floattype}%
}%
\fi
%
% If label is given but no type, we handle that as the empty type.
\ifx\floatlabel\empty \else
% We want each FLOATTYPE to be numbered separately (Figure 1,
% Table 1, Figure 2, ...). (And if no label, no number.)
%
\expandafter\getfloatno\csname\safefloattype floatno\endcsname
\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
% 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}%
}%
\fi
%
% start with \parskip glue, I guess.
\vskip\parskip
%
% Don't suppress indentation if a float happens to start a section.
\restorefirstparagraphindent
}
% we have these possibilities:
% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
% @float Foo,lbl & no caption: Foo 1.1
% @float Foo & @caption{Cap}: Foo: Cap
% @float Foo & no caption: Foo
% @float ,lbl & Caption{Cap}: 1.1: Cap
% @float ,lbl & no caption: 1.1
% @float & @caption{Cap}: Cap
% @float & no caption:
%
\def\Efloat{%
\let\floatident = \empty
%
% In all cases, if we have a float type, it comes first.
\ifx\floattype\empty \else \def\floatident{\floattype}\fi
%
% If we have an xref label, the number comes next.
\ifx\floatlabel\empty \else
\ifx\floattype\empty \else % if also had float type, need tie first.
\appendtomacro\floatident{\tie}%
\fi
% the number.
\appendtomacro\floatident{\chaplevelprefix\the\floatno}%
\fi
%
% Start the printed caption with what we've constructed in
% \floatident, but keep it separate; we need \floatident again.
\let\captionline = \floatident
%
\ifx\thiscaption\empty \else
\ifx\floatident\empty \else
\appendtomacro\captionline{: }% had ident, so need a colon between
\fi
%
% caption text.
\appendtomacro\captionline{\scanexp\thiscaption}%
\fi
%
% If we have anything to print, print it, with space before.
% Eventually this needs to become an \insert.
\ifx\captionline\empty \else
\vskip.5\parskip
\captionline
%
% Space below caption.
\vskip\parskip
\fi
%
% If have an xref label, write the list of floats info. Do this
% after the caption, to avoid chance of it being a breakpoint.
\ifx\floatlabel\empty \else
% Write the text that goes in the lof to the aux file as
% \floatlabel-lof. Besides \floatident, we include the short
% caption if specified, else the full caption if specified, else nothing.
{%
\requireauxfile
\atdummies
%
\ifx\thisshortcaption\empty
\def\gtemp{\thiscaption}%
\else
\def\gtemp{\thisshortcaption}%
\fi
\immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
\ifx\gtemp\empty \else : \gtemp \fi}}%
}%
\fi
\egroup % end of \vtop
%
\checkinserts
}
% Append the tokens #2 to the definition of macro #1, not expanding either.
%
\def\appendtomacro#1#2{%
\expandafter\def\expandafter#1\expandafter{#1#2}%
}
% @caption, @shortcaption
%
\def\caption{\docaption\thiscaption}
\def\shortcaption{\docaption\thisshortcaption}
\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
\def\defcaption#1#2{\egroup \def#1{#2}}
% The parameter is the control sequence identifying the counter we are
% going to use. Create it if it doesn't exist and assign it to \floatno.
\def\getfloatno#1{%
\ifx#1\relax
% Haven't seen this figure type before.
\csname newcount\endcsname #1%
%
% Remember to reset this floatno at the next chap.
\expandafter\gdef\expandafter\resetallfloatnos
\expandafter{\resetallfloatnos #1=0 }%
\fi
\let\floatno#1%
}
% \setref calls this to get the XREFLABEL-snt value. We want an @xref
% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
% first read the @float command.
%
\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
% Magic string used for the XREFLABEL-title value, so \xrefX can
% distinguish floats from other xref types.
\def\floatmagic{!!float!!}
% #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.
%
\def\iffloat#1{\expandafter\doiffloat#1==\finish}
%
% #1 is (maybe) the \floatmagic string. If so, #2 will be the
% (safe) float type for this float. We set \iffloattype to #2.
%
\def\doiffloat#1=#2=#3\finish{%
\def\temp{#1}%
\def\iffloattype{#2}%
\ifx\temp\floatmagic
}
% @listoffloats FLOATTYPE - print a list of floats like a table of contents.
%
\parseargdef\listoffloats{%
\def\floattype{#1}% floattype
{%
% the floattype might have accents or other special characters,
% but we need to use it in a control sequence name.
\indexnofonts
\turnoffactive
\xdef\safefloattype{\floattype}%
}%
%
% \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
\expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
\ifhavexrefs
% if the user said @listoffloats foo but never @float foo.
\message{\linenumber No `\safefloattype' floats to list.}%
\fi
\else
\begingroup
\leftskip=\tocindent % indent these entries like a toc
\let\do=\listoffloatsdo
\csname floatlist\safefloattype\endcsname
\endgroup
\fi
}
% This is called on each entry in a list of floats. We're passed the
% xref label, in the form LABEL-title, which is how we save it in the
% aux file. We strip off the -title and look up \XRLABEL-lof, which
% has the text we're supposed to typeset here.
%
% Figures without xref labels will not be included in the list (since
% they won't appear in the aux file).
%
\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
\def\listoffloatsdoentry#1-title\finish{{%
% Can't fully expand XR#1-lof because it can contain anything. Just
% pass the control sequence. On the other hand, XR#1-pg is just the
% page number, and we want to fully expand that so we can get a link
% in pdf output.
\toksA = \expandafter{\csname XR#1-lof\endcsname}%
%
% use the same \entry macro we use to generate the TOC and index.
\edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
\writeentry
}}
\message{localization,}
% For single-language documents, @documentlanguage is usually given very
% early, just after @documentencoding. Single argument is the language
% (de) or locale (de_DE) abbreviation.
%
{
\catcode`\_ = \active
\globaldefs=1
\parseargdef\documentlanguage{%
\tex % read txi-??.tex file in plain TeX.
% Read the file by the name they passed if it exists.
\let_ = \normalunderscore % normal _ character for filename test
\openin 1 txi-#1.tex
\ifeof 1
\documentlanguagetrywithoutunderscore #1_\finish
\else
\globaldefs = 1 % everything in the txi-LL files needs to persist
\input txi-#1.tex
\fi
\closein 1
\endgroup % end raw TeX
}
%
% If they passed de_DE, and txi-de_DE.tex doesn't exist,
% try txi-de.tex.
%
\gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
\openin 1 txi-#1.tex
\ifeof 1
\errhelp = \nolanghelp
\errmessage{Cannot read language file txi-#1.tex}%
\else
\globaldefs = 1 % everything in the txi-LL files needs to persist
\input txi-#1.tex
\fi
\closein 1
}
}% end of special _ catcode
%
\newhelp\nolanghelp{The given language definition file cannot be found or
is empty. Maybe you need to install it? Putting it in the current
directory should work if nowhere else does.}
% This macro is called from txi-??.tex files; the first argument is the
% \language name to set (without the "\lang@" prefix), the second and
% third args are \{left,right}hyphenmin.
%
% The language names to pass are determined when the format is built.
% See the etex.log file created at that time, e.g.,
% /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
%
% With TeX Live 2008, etex now includes hyphenation patterns for all
% available languages. This means we can support hyphenation in
% Texinfo, at least to some extent. (This still doesn't solve the
% accented characters problem.)
%
\catcode`@=11
\def\txisetlanguage#1#2#3{%
% do not set the language if the name is undefined in the current TeX.
\expandafter\ifx\csname lang@#1\endcsname \relax
\message{no patterns for #1}%
\else
\global\language = \csname lang@#1\endcsname
\fi
% but there is no harm in adjusting the hyphenmin values regardless.
\global\lefthyphenmin = #2\relax
\global\righthyphenmin = #3\relax
}
% XeTeX and LuaTeX can handle Unicode natively.
% Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
%
\newif\iftxinativeunicodecapable
\newif\iftxiusebytewiseio
\ifx\XeTeXrevision\thisisundefined
\ifx\luatexversion\thisisundefined
\txinativeunicodecapablefalse
\txiusebytewiseiotrue
\else
\txinativeunicodecapabletrue
\txiusebytewiseiofalse
\fi
\else
\txinativeunicodecapabletrue
\txiusebytewiseiofalse
\fi
% 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.
\fi
\ifx\luatexversion\thisisundefined
\else
\directlua{
local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
local function convert_char (char)
return utf8_char(byte(char))
end
local function convert_line (line)
return gsub(line, ".", convert_char)
end
callback.register("process_input_buffer", convert_line)
local function convert_line_out (line)
local line_out = ""
for c in string.utfvalues(line) do
line_out = line_out .. string.char(c)
end
return line_out
end
callback.register("process_output_buffer", convert_line_out)
}
\fi
\txiusebytewiseiotrue
}
% Helpers for encodings.
% Set the catcode of characters 128 through 255 to the specified number.
%
\def\setnonasciicharscatcode#1{%
\count255=128
\loop\ifnum\count255<256
\global\catcode\count255=#1\relax
\advance\count255 by 1
\repeat
}
\def\setnonasciicharscatcodenonglobal#1{%
\count255=128
\loop\ifnum\count255<256
\catcode\count255=#1\relax
\advance\count255 by 1
\repeat
}
% @documentencoding sets the definition of non-ASCII characters
% according to the specified encoding.
%
\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
\def\documentencodingzzz#1{%
%
% Encoding being declared for the document.
\def\declaredencoding{\csname #1.enc\endcsname}%
%
% Supported encodings: names converted to tokens in order to be able
% to compare them with \ifx.
\def\ascii{\csname US-ASCII.enc\endcsname}%
\def\latnine{\csname ISO-8859-15.enc\endcsname}%
\def\latone{\csname ISO-8859-1.enc\endcsname}%
\def\lattwo{\csname ISO-8859-2.enc\endcsname}%
\def\utfeight{\csname UTF-8.enc\endcsname}%
%
\ifx \declaredencoding \ascii
\asciichardefs
%
\else \ifx \declaredencoding \lattwo
\iftxinativeunicodecapable
\setbytewiseio
\fi
\setnonasciicharscatcode\active
\lattwochardefs
%
\else \ifx \declaredencoding \latone
\iftxinativeunicodecapable
\setbytewiseio
\fi
\setnonasciicharscatcode\active
\latonechardefs
%
\else \ifx \declaredencoding \latnine
\iftxinativeunicodecapable
\setbytewiseio
\fi
\setnonasciicharscatcode\active
\latninechardefs
%
\else \ifx \declaredencoding \utfeight
\iftxinativeunicodecapable
% For native Unicode handling (XeTeX and LuaTeX)
\nativeunicodechardefs
\else
% For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
\setnonasciicharscatcode\active
% since we already invoked \utfeightchardefs at the top level
% (below), do not re-invoke it, otherwise our check for duplicated
% definitions gets triggered. Making non-ascii chars active is
% sufficient.
\fi
%
\else
\message{Ignoring unknown document encoding: #1.}%
%
\fi % utfeight
\fi % latnine
\fi % latone
\fi % lattwo
\fi % ascii
%
\ifx\XeTeXrevision\thisisundefined
\else
\ifx \declaredencoding \utfeight
\else
\ifx \declaredencoding \ascii
\else
\message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
non-ASCII characters in auxiliary files.}%
\fi
\fi
\fi
}
% emacs-page
% A message to be logged when using a character that isn't available
% the default font encoding (OT1).
%
\def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
% Take account of \c (plain) vs. \, (Texinfo) difference.
\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
% First, make active non-ASCII characters in order for them to be
% correctly categorized when TeX reads the replacement text of
% macros containing the character definitions.
\setnonasciicharscatcode\active
%
\def\gdefchar#1#2{%
\gdef#1{%
\ifpassthroughchars
\string#1%
\else
#2%
\fi
}}
% Latin1 (ISO-8859-1) character definitions.
\def\latonechardefs{%
\gdefchar^^a0{\tie}
\gdefchar^^a1{\exclamdown}
\gdefchar^^a2{{\tcfont \char162}} % cent
\gdefchar^^a3{\pounds{}}
\gdefchar^^a4{{\tcfont \char164}} % currency
\gdefchar^^a5{{\tcfont \char165}} % yen
\gdefchar^^a6{{\tcfont \char166}} % broken bar
\gdefchar^^a7{\S}
\gdefchar^^a8{\"{}}
\gdefchar^^a9{\copyright{}}
\gdefchar^^aa{\ordf}
\gdefchar^^ab{\guillemetleft{}}
\gdefchar^^ac{\ensuremath\lnot}
\gdefchar^^ad{\-}
\gdefchar^^ae{\registeredsymbol{}}
\gdefchar^^af{\={}}
%
\gdefchar^^b0{\textdegree}
\gdefchar^^b1{$\pm$}
\gdefchar^^b2{$^2$}
\gdefchar^^b3{$^3$}
\gdefchar^^b4{\'{}}
\gdefchar^^b5{$\mu$}
\gdefchar^^b6{\P}
\gdefchar^^b7{\ensuremath\cdot}
\gdefchar^^b8{\cedilla\ }
\gdefchar^^b9{$^1$}
\gdefchar^^ba{\ordm}
\gdefchar^^bb{\guillemetright{}}
\gdefchar^^bc{$1\over4$}
\gdefchar^^bd{$1\over2$}
\gdefchar^^be{$3\over4$}
\gdefchar^^bf{\questiondown}
%
\gdefchar^^c0{\`A}
\gdefchar^^c1{\'A}
\gdefchar^^c2{\^A}
\gdefchar^^c3{\~A}
\gdefchar^^c4{\"A}
\gdefchar^^c5{\ringaccent A}
\gdefchar^^c6{\AE}
\gdefchar^^c7{\cedilla C}
\gdefchar^^c8{\`E}
\gdefchar^^c9{\'E}
\gdefchar^^ca{\^E}
\gdefchar^^cb{\"E}
\gdefchar^^cc{\`I}
\gdefchar^^cd{\'I}
\gdefchar^^ce{\^I}
\gdefchar^^cf{\"I}
%
\gdefchar^^d0{\DH}
\gdefchar^^d1{\~N}
\gdefchar^^d2{\`O}
\gdefchar^^d3{\'O}
\gdefchar^^d4{\^O}
\gdefchar^^d5{\~O}
\gdefchar^^d6{\"O}
\gdefchar^^d7{$\times$}
\gdefchar^^d8{\O}
\gdefchar^^d9{\`U}
\gdefchar^^da{\'U}
\gdefchar^^db{\^U}
\gdefchar^^dc{\"U}
\gdefchar^^dd{\'Y}
\gdefchar^^de{\TH}
\gdefchar^^df{\ss}
%
\gdefchar^^e0{\`a}
\gdefchar^^e1{\'a}
\gdefchar^^e2{\^a}
\gdefchar^^e3{\~a}
\gdefchar^^e4{\"a}
\gdefchar^^e5{\ringaccent a}
\gdefchar^^e6{\ae}
\gdefchar^^e7{\cedilla c}
\gdefchar^^e8{\`e}
\gdefchar^^e9{\'e}
\gdefchar^^ea{\^e}
\gdefchar^^eb{\"e}
\gdefchar^^ec{\`{\dotless i}}
\gdefchar^^ed{\'{\dotless i}}
\gdefchar^^ee{\^{\dotless i}}
\gdefchar^^ef{\"{\dotless i}}
%
\gdefchar^^f0{\dh}
\gdefchar^^f1{\~n}
\gdefchar^^f2{\`o}
\gdefchar^^f3{\'o}
\gdefchar^^f4{\^o}
\gdefchar^^f5{\~o}
\gdefchar^^f6{\"o}
\gdefchar^^f7{$\div$}
\gdefchar^^f8{\o}
\gdefchar^^f9{\`u}
\gdefchar^^fa{\'u}
\gdefchar^^fb{\^u}
\gdefchar^^fc{\"u}
\gdefchar^^fd{\'y}
\gdefchar^^fe{\th}
\gdefchar^^ff{\"y}
}
% Latin9 (ISO-8859-15) encoding character definitions.
\def\latninechardefs{%
% Encoding is almost identical to Latin1.
\latonechardefs
%
\gdefchar^^a4{\euro{}}
\gdefchar^^a6{\v S}
\gdefchar^^a8{\v s}
\gdefchar^^b4{\v Z}
\gdefchar^^b8{\v z}
\gdefchar^^bc{\OE}
\gdefchar^^bd{\oe}
\gdefchar^^be{\"Y}
}
% Latin2 (ISO-8859-2) character definitions.
\def\lattwochardefs{%
\gdefchar^^a0{\tie}
\gdefchar^^a1{\ogonek{A}}
\gdefchar^^a2{\u{}}
\gdefchar^^a3{\L}
\gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
\gdefchar^^a5{\v L}
\gdefchar^^a6{\'S}
\gdefchar^^a7{\S}
\gdefchar^^a8{\"{}}
\gdefchar^^a9{\v S}
\gdefchar^^aa{\cedilla S}
\gdefchar^^ab{\v T}
\gdefchar^^ac{\'Z}
\gdefchar^^ad{\-}
\gdefchar^^ae{\v Z}
\gdefchar^^af{\dotaccent Z}
%
\gdefchar^^b0{\textdegree{}}
\gdefchar^^b1{\ogonek{a}}
\gdefchar^^b2{\ogonek{ }}
\gdefchar^^b3{\l}
\gdefchar^^b4{\'{}}
\gdefchar^^b5{\v l}
\gdefchar^^b6{\'s}
\gdefchar^^b7{\v{}}
\gdefchar^^b8{\cedilla\ }
\gdefchar^^b9{\v s}
\gdefchar^^ba{\cedilla s}
\gdefchar^^bb{\v t}
\gdefchar^^bc{\'z}
\gdefchar^^bd{\H{}}
\gdefchar^^be{\v z}
\gdefchar^^bf{\dotaccent z}
%
\gdefchar^^c0{\'R}
\gdefchar^^c1{\'A}
\gdefchar^^c2{\^A}
\gdefchar^^c3{\u A}
\gdefchar^^c4{\"A}
\gdefchar^^c5{\'L}
\gdefchar^^c6{\'C}
\gdefchar^^c7{\cedilla C}
\gdefchar^^c8{\v C}
\gdefchar^^c9{\'E}
\gdefchar^^ca{\ogonek{E}}
\gdefchar^^cb{\"E}
\gdefchar^^cc{\v E}
\gdefchar^^cd{\'I}
\gdefchar^^ce{\^I}
\gdefchar^^cf{\v D}
%
\gdefchar^^d0{\DH}
\gdefchar^^d1{\'N}
\gdefchar^^d2{\v N}
\gdefchar^^d3{\'O}
\gdefchar^^d4{\^O}
\gdefchar^^d5{\H O}
\gdefchar^^d6{\"O}
\gdefchar^^d7{$\times$}
\gdefchar^^d8{\v R}
\gdefchar^^d9{\ringaccent U}
\gdefchar^^da{\'U}
\gdefchar^^db{\H U}
\gdefchar^^dc{\"U}
\gdefchar^^dd{\'Y}
\gdefchar^^de{\cedilla T}
\gdefchar^^df{\ss}
%
\gdefchar^^e0{\'r}
\gdefchar^^e1{\'a}
\gdefchar^^e2{\^a}
\gdefchar^^e3{\u a}
\gdefchar^^e4{\"a}
\gdefchar^^e5{\'l}
\gdefchar^^e6{\'c}
\gdefchar^^e7{\cedilla c}
\gdefchar^^e8{\v c}
\gdefchar^^e9{\'e}
\gdefchar^^ea{\ogonek{e}}
\gdefchar^^eb{\"e}
\gdefchar^^ec{\v e}
\gdefchar^^ed{\'{\dotless{i}}}
\gdefchar^^ee{\^{\dotless{i}}}
\gdefchar^^ef{\v d}
%
\gdefchar^^f0{\dh}
\gdefchar^^f1{\'n}
\gdefchar^^f2{\v n}
\gdefchar^^f3{\'o}
\gdefchar^^f4{\^o}
\gdefchar^^f5{\H o}
\gdefchar^^f6{\"o}
\gdefchar^^f7{$\div$}
\gdefchar^^f8{\v r}
\gdefchar^^f9{\ringaccent u}
\gdefchar^^fa{\'u}
\gdefchar^^fb{\H u}
\gdefchar^^fc{\"u}
\gdefchar^^fd{\'y}
\gdefchar^^fe{\cedilla t}
\gdefchar^^ff{\dotaccent{}}
}
% UTF-8 character definitions.
%
% This code to support UTF-8 is based on LaTeX's utf8.def, with some
% changes for Texinfo conventions. It is included here under the GPL by
% permission from Frank Mittelbach and the LaTeX team.
%
\newcount\countUTFx
\newcount\countUTFy
\newcount\countUTFz
\gdef\UTFviiiTwoOctets#1#2{\expandafter
\UTFviiiDefined\csname u8:#1\string #2\endcsname}
%
\gdef\UTFviiiThreeOctets#1#2#3{\expandafter
\UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
%
\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
\UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
\gdef\UTFviiiDefined#1{%
\ifx #1\relax
\message{\linenumber Unicode char \string #1 not defined for Texinfo}%
\else
\expandafter #1%
\fi
}
% Give non-ASCII bytes the active definitions for processing UTF-8 sequences
\begingroup
\catcode`\~13
\catcode`\$12
\catcode`\"12
% Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
% substituting ~ and $ with a character token of that value.
\def\UTFviiiLoop{%
\global\catcode\countUTFx\active
\uccode`\~\countUTFx
\uccode`\$\countUTFx
\uppercase\expandafter{\UTFviiiTmp}%
\advance\countUTFx by 1
\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
\countUTFy = "C2
\def\UTFviiiTmp{%
\gdef~{%
\ifpassthroughchars $\fi}}%
\UTFviiiLoop
\countUTFx = "C2
\countUTFy = "E0
\def\UTFviiiTmp{%
\gdef~{%
\ifpassthroughchars $%
\else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
\UTFviiiLoop
\countUTFx = "E0
\countUTFy = "F0
\def\UTFviiiTmp{%
\gdef~{%
\ifpassthroughchars $%
\else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
\UTFviiiLoop
\countUTFx = "F0
\countUTFy = "F4
\def\UTFviiiTmp{%
\gdef~{%
\ifpassthroughchars $%
\else\expandafter\UTFviiiFourOctets\expandafter$\fi
}}%
\UTFviiiLoop
\endgroup
\def\globallet{\global\let} % save some \expandafter's below
% @U{xxxx} to produce U+xxxx, if we support it.
\def\U#1{%
\expandafter\ifx\csname uni:#1\endcsname \relax
\iftxinativeunicodecapable
% All Unicode characters can be used if native Unicode handling is
% active. However, if the font does not have the glyph,
% letters are missing.
\begingroup
\uccode`\.="#1\relax
\uppercase{.}
\endgroup
\else
\errhelp = \EMsimple
\errmessage{Unicode character U+#1 not supported, sorry}%
\fi
\else
\csname uni:#1\endcsname
\fi
}
% These macros are used here to construct the name of a control
% sequence to be defined.
\def\UTFviiiTwoOctetsName#1#2{%
\csname u8:#1\string #2\endcsname}%
\def\UTFviiiThreeOctetsName#1#2#3{%
\csname u8:#1\string #2\string #3\endcsname}%
\def\UTFviiiFourOctetsName#1#2#3#4{%
\csname u8:#1\string #2\string #3\string #4\endcsname}%
% 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
%
\begingroup
\catcode`\"=12
\catcode`\<=12
\catcode`\.=12
\catcode`\,=12
\catcode`\;=12
\catcode`\!=12
\catcode`\~=13
\gdef\DeclareUnicodeCharacterUTFviii#1#2{%
\countUTFz = "#1\relax
\begingroup
\parseXMLCharref
% Give \u8:... its definition. The sequence of seven \expandafter's
% expands after the \gdef three times, e.g.
%
% 1. \UTFviiTwoOctetsName B1 B2
% 2. \csname u8:B1 \string B2 \endcsname
% 3. \u8: B1 B2 (a single control sequence token)
%
\expandafter\expandafter
\expandafter\expandafter
\expandafter\expandafter
\expandafter\gdef \UTFviiiTmp{#2}%
%
\expandafter\ifx\csname uni:#1\endcsname \relax \else
\message{Internal error, already defined: #1}%
\fi
%
% define an additional control sequence for this code point.
\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.
\gdef\parseXMLCharref{%
\ifnum\countUTFz < "A0\relax
\errhelp = \EMsimple
\errmessage{Cannot define Unicode char value < 00A0}%
\else\ifnum\countUTFz < "800\relax
\parseUTFviiiA,%
\parseUTFviiiB C\UTFviiiTwoOctetsName.,%
\else\ifnum\countUTFz < "10000\relax
\parseUTFviiiA;%
\parseUTFviiiA,%
\parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
\else
\parseUTFviiiA;%
\parseUTFviiiA,%
\parseUTFviiiA!%
\parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
\fi\fi\fi
}
% Extract a byte from the end of the UTF-8 representation of \countUTFx.
% It must be a non-initial byte in the sequence.
% Change \uccode of #1 for it to be used in \parseUTFviiiB as one
% of the bytes.
\gdef\parseUTFviiiA#1{%
\countUTFx = \countUTFz
\divide\countUTFz by 64
\countUTFy = \countUTFz % Save to be the future value of \countUTFz.
\multiply\countUTFz by 64
% \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
% in order to get the last five bits.
\advance\countUTFx by -\countUTFz
% Convert this to the byte in the UTF-8 sequence.
\advance\countUTFx by 128
\uccode `#1\countUTFx
\countUTFz = \countUTFy}
% Used to put a UTF-8 byte sequence into \UTFviiiTmp
% #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
% sequence.
% #2 is one of the \UTFviii*OctetsName macros.
% #3 is always a full stop (.)
% #4 is a template for the other bytes in the sequence. The values for these
% bytes is substituted in here with \uppercase using the \uccode's.
\gdef\parseUTFviiiB#1#2#3#4{%
\advance\countUTFz by "#10\relax
\uccode `#3\countUTFz
\uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
\endgroup
% For native Unicode handling (XeTeX and LuaTeX),
% provide a definition macro that sets a catcode to `other' non-globally
%
\def\DeclareUnicodeCharacterNativeOther#1#2{%
\catcode"#1=\other
}
% 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)
% U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
% U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
%
% Many of our renditions are less than wonderful, and all the missing
% characters are available somewhere. Loading the necessary fonts
% awaits user request. We can't truly support Unicode without
% reimplementing everything that's been done in LaTeX for many years,
% plus probably using luatex or xetex, and who knows what else.
% We won't be doing that here in this simple file. But we can try to at
% least make most of the characters not bomb out.
%
\def\unicodechardefs{%
\DeclareUnicodeCharacter{00A0}{\tie}%
\DeclareUnicodeCharacter{00A1}{\exclamdown}%
\DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
\DeclareUnicodeCharacter{00A3}{\pounds{}}%
\DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
\DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
\DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
\DeclareUnicodeCharacter{00A7}{\S}%
\DeclareUnicodeCharacter{00A8}{\"{ }}%
\DeclareUnicodeCharacter{00A9}{\copyright{}}%
\DeclareUnicodeCharacter{00AA}{\ordf}%
\DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
\DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
\DeclareUnicodeCharacter{00AD}{\-}%
\DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
\DeclareUnicodeCharacter{00AF}{\={ }}%
%
\DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
\DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
\DeclareUnicodeCharacter{00B2}{$^2$}%
\DeclareUnicodeCharacter{00B3}{$^3$}%
\DeclareUnicodeCharacter{00B4}{\'{ }}%
\DeclareUnicodeCharacter{00B5}{$\mu$}%
\DeclareUnicodeCharacter{00B6}{\P}%
\DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
\DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
\DeclareUnicodeCharacter{00B9}{$^1$}%
\DeclareUnicodeCharacter{00BA}{\ordm}%
\DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
\DeclareUnicodeCharacter{00BC}{$1\over4$}%
\DeclareUnicodeCharacter{00BD}{$1\over2$}%
\DeclareUnicodeCharacter{00BE}{$3\over4$}%
\DeclareUnicodeCharacter{00BF}{\questiondown}%
%
\DeclareUnicodeCharacter{00C0}{\`A}%
\DeclareUnicodeCharacter{00C1}{\'A}%
\DeclareUnicodeCharacter{00C2}{\^A}%
\DeclareUnicodeCharacter{00C3}{\~A}%
\DeclareUnicodeCharacter{00C4}{\"A}%
\DeclareUnicodeCharacter{00C5}{\AA}%
\DeclareUnicodeCharacter{00C6}{\AE}%
\DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
\DeclareUnicodeCharacter{00C8}{\`E}%
\DeclareUnicodeCharacter{00C9}{\'E}%
\DeclareUnicodeCharacter{00CA}{\^E}%
\DeclareUnicodeCharacter{00CB}{\"E}%
\DeclareUnicodeCharacter{00CC}{\`I}%
\DeclareUnicodeCharacter{00CD}{\'I}%
\DeclareUnicodeCharacter{00CE}{\^I}%
\DeclareUnicodeCharacter{00CF}{\"I}%
%
\DeclareUnicodeCharacter{00D0}{\DH}%
\DeclareUnicodeCharacter{00D1}{\~N}%
\DeclareUnicodeCharacter{00D2}{\`O}%
\DeclareUnicodeCharacter{00D3}{\'O}%
\DeclareUnicodeCharacter{00D4}{\^O}%
\DeclareUnicodeCharacter{00D5}{\~O}%
\DeclareUnicodeCharacter{00D6}{\"O}%
\DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
\DeclareUnicodeCharacter{00D8}{\O}%
\DeclareUnicodeCharacter{00D9}{\`U}%
\DeclareUnicodeCharacter{00DA}{\'U}%
\DeclareUnicodeCharacter{00DB}{\^U}%
\DeclareUnicodeCharacter{00DC}{\"U}%
\DeclareUnicodeCharacter{00DD}{\'Y}%
\DeclareUnicodeCharacter{00DE}{\TH}%
\DeclareUnicodeCharacter{00DF}{\ss}%
%
\DeclareUnicodeCharacter{00E0}{\`a}%
\DeclareUnicodeCharacter{00E1}{\'a}%
\DeclareUnicodeCharacter{00E2}{\^a}%
\DeclareUnicodeCharacter{00E3}{\~a}%
\DeclareUnicodeCharacter{00E4}{\"a}%
\DeclareUnicodeCharacter{00E5}{\aa}%
\DeclareUnicodeCharacter{00E6}{\ae}%
\DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
\DeclareUnicodeCharacter{00E8}{\`e}%
\DeclareUnicodeCharacter{00E9}{\'e}%
\DeclareUnicodeCharacter{00EA}{\^e}%
\DeclareUnicodeCharacter{00EB}{\"e}%
\DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
\DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
\DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
\DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
%
\DeclareUnicodeCharacter{00F0}{\dh}%
\DeclareUnicodeCharacter{00F1}{\~n}%
\DeclareUnicodeCharacter{00F2}{\`o}%
\DeclareUnicodeCharacter{00F3}{\'o}%
\DeclareUnicodeCharacter{00F4}{\^o}%
\DeclareUnicodeCharacter{00F5}{\~o}%
\DeclareUnicodeCharacter{00F6}{\"o}%
\DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
\DeclareUnicodeCharacter{00F8}{\o}%
\DeclareUnicodeCharacter{00F9}{\`u}%
\DeclareUnicodeCharacter{00FA}{\'u}%
\DeclareUnicodeCharacter{00FB}{\^u}%
\DeclareUnicodeCharacter{00FC}{\"u}%
\DeclareUnicodeCharacter{00FD}{\'y}%
\DeclareUnicodeCharacter{00FE}{\th}%
\DeclareUnicodeCharacter{00FF}{\"y}%
%
\DeclareUnicodeCharacter{0100}{\=A}%
\DeclareUnicodeCharacter{0101}{\=a}%
\DeclareUnicodeCharacter{0102}{\u{A}}%
\DeclareUnicodeCharacter{0103}{\u{a}}%
\DeclareUnicodeCharacter{0104}{\ogonek{A}}%
\DeclareUnicodeCharacter{0105}{\ogonek{a}}%
\DeclareUnicodeCharacter{0106}{\'C}%
\DeclareUnicodeCharacter{0107}{\'c}%
\DeclareUnicodeCharacter{0108}{\^C}%
\DeclareUnicodeCharacter{0109}{\^c}%
\DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
\DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
\DeclareUnicodeCharacter{010C}{\v{C}}%
\DeclareUnicodeCharacter{010D}{\v{c}}%
\DeclareUnicodeCharacter{010E}{\v{D}}%
\DeclareUnicodeCharacter{010F}{d'}%
%
\DeclareUnicodeCharacter{0110}{\DH}%
\DeclareUnicodeCharacter{0111}{\dh}%
\DeclareUnicodeCharacter{0112}{\=E}%
\DeclareUnicodeCharacter{0113}{\=e}%
\DeclareUnicodeCharacter{0114}{\u{E}}%
\DeclareUnicodeCharacter{0115}{\u{e}}%
\DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
\DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
\DeclareUnicodeCharacter{0118}{\ogonek{E}}%
\DeclareUnicodeCharacter{0119}{\ogonek{e}}%
\DeclareUnicodeCharacter{011A}{\v{E}}%
\DeclareUnicodeCharacter{011B}{\v{e}}%
\DeclareUnicodeCharacter{011C}{\^G}%
\DeclareUnicodeCharacter{011D}{\^g}%
\DeclareUnicodeCharacter{011E}{\u{G}}%
\DeclareUnicodeCharacter{011F}{\u{g}}%
%
\DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
\DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
\DeclareUnicodeCharacter{0122}{\cedilla{G}}%
\DeclareUnicodeCharacter{0123}{\cedilla{g}}%
\DeclareUnicodeCharacter{0124}{\^H}%
\DeclareUnicodeCharacter{0125}{\^h}%
\DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
\DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
\DeclareUnicodeCharacter{0128}{\~I}%
\DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
\DeclareUnicodeCharacter{012A}{\=I}%
\DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
\DeclareUnicodeCharacter{012C}{\u{I}}%
\DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
\DeclareUnicodeCharacter{012E}{\ogonek{I}}%
\DeclareUnicodeCharacter{012F}{\ogonek{i}}%
%
\DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
\DeclareUnicodeCharacter{0131}{\dotless{i}}%
\DeclareUnicodeCharacter{0132}{IJ}%
\DeclareUnicodeCharacter{0133}{ij}%
\DeclareUnicodeCharacter{0134}{\^J}%
\DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
\DeclareUnicodeCharacter{0136}{\cedilla{K}}%
\DeclareUnicodeCharacter{0137}{\cedilla{k}}%
\DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
\DeclareUnicodeCharacter{0139}{\'L}%
\DeclareUnicodeCharacter{013A}{\'l}%
\DeclareUnicodeCharacter{013B}{\cedilla{L}}%
\DeclareUnicodeCharacter{013C}{\cedilla{l}}%
\DeclareUnicodeCharacter{013D}{L'}% should kern
\DeclareUnicodeCharacter{013E}{l'}% should kern
\DeclareUnicodeCharacter{013F}{L\U{00B7}}%
%
\DeclareUnicodeCharacter{0140}{l\U{00B7}}%
\DeclareUnicodeCharacter{0141}{\L}%
\DeclareUnicodeCharacter{0142}{\l}%
\DeclareUnicodeCharacter{0143}{\'N}%
\DeclareUnicodeCharacter{0144}{\'n}%
\DeclareUnicodeCharacter{0145}{\cedilla{N}}%
\DeclareUnicodeCharacter{0146}{\cedilla{n}}%
\DeclareUnicodeCharacter{0147}{\v{N}}%
\DeclareUnicodeCharacter{0148}{\v{n}}%
\DeclareUnicodeCharacter{0149}{'n}%
\DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
\DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
\DeclareUnicodeCharacter{014C}{\=O}%
\DeclareUnicodeCharacter{014D}{\=o}%
\DeclareUnicodeCharacter{014E}{\u{O}}%
\DeclareUnicodeCharacter{014F}{\u{o}}%
%
\DeclareUnicodeCharacter{0150}{\H{O}}%
\DeclareUnicodeCharacter{0151}{\H{o}}%
\DeclareUnicodeCharacter{0152}{\OE}%
\DeclareUnicodeCharacter{0153}{\oe}%
\DeclareUnicodeCharacter{0154}{\'R}%
\DeclareUnicodeCharacter{0155}{\'r}%
\DeclareUnicodeCharacter{0156}{\cedilla{R}}%
\DeclareUnicodeCharacter{0157}{\cedilla{r}}%
\DeclareUnicodeCharacter{0158}{\v{R}}%
\DeclareUnicodeCharacter{0159}{\v{r}}%
\DeclareUnicodeCharacter{015A}{\'S}%
\DeclareUnicodeCharacter{015B}{\'s}%
\DeclareUnicodeCharacter{015C}{\^S}%
\DeclareUnicodeCharacter{015D}{\^s}%
\DeclareUnicodeCharacter{015E}{\cedilla{S}}%
\DeclareUnicodeCharacter{015F}{\cedilla{s}}%
%
\DeclareUnicodeCharacter{0160}{\v{S}}%
\DeclareUnicodeCharacter{0161}{\v{s}}%
\DeclareUnicodeCharacter{0162}{\cedilla{T}}%
\DeclareUnicodeCharacter{0163}{\cedilla{t}}%
\DeclareUnicodeCharacter{0164}{\v{T}}%
\DeclareUnicodeCharacter{0165}{\v{t}}%
\DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
\DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
\DeclareUnicodeCharacter{0168}{\~U}%
\DeclareUnicodeCharacter{0169}{\~u}%
\DeclareUnicodeCharacter{016A}{\=U}%
\DeclareUnicodeCharacter{016B}{\=u}%
\DeclareUnicodeCharacter{016C}{\u{U}}%
\DeclareUnicodeCharacter{016D}{\u{u}}%
\DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
\DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
%
\DeclareUnicodeCharacter{0170}{\H{U}}%
\DeclareUnicodeCharacter{0171}{\H{u}}%
\DeclareUnicodeCharacter{0172}{\ogonek{U}}%
\DeclareUnicodeCharacter{0173}{\ogonek{u}}%
\DeclareUnicodeCharacter{0174}{\^W}%
\DeclareUnicodeCharacter{0175}{\^w}%
\DeclareUnicodeCharacter{0176}{\^Y}%
\DeclareUnicodeCharacter{0177}{\^y}%
\DeclareUnicodeCharacter{0178}{\"Y}%
\DeclareUnicodeCharacter{0179}{\'Z}%
\DeclareUnicodeCharacter{017A}{\'z}%
\DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
\DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
\DeclareUnicodeCharacter{017D}{\v{Z}}%
\DeclareUnicodeCharacter{017E}{\v{z}}%
\DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
%
\DeclareUnicodeCharacter{01C4}{D\v{Z}}%
\DeclareUnicodeCharacter{01C5}{D\v{z}}%
\DeclareUnicodeCharacter{01C6}{d\v{z}}%
\DeclareUnicodeCharacter{01C7}{LJ}%
\DeclareUnicodeCharacter{01C8}{Lj}%
\DeclareUnicodeCharacter{01C9}{lj}%
\DeclareUnicodeCharacter{01CA}{NJ}%
\DeclareUnicodeCharacter{01CB}{Nj}%
\DeclareUnicodeCharacter{01CC}{nj}%
\DeclareUnicodeCharacter{01CD}{\v{A}}%
\DeclareUnicodeCharacter{01CE}{\v{a}}%
\DeclareUnicodeCharacter{01CF}{\v{I}}%
%
\DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
\DeclareUnicodeCharacter{01D1}{\v{O}}%
\DeclareUnicodeCharacter{01D2}{\v{o}}%
\DeclareUnicodeCharacter{01D3}{\v{U}}%
\DeclareUnicodeCharacter{01D4}{\v{u}}%
%
\DeclareUnicodeCharacter{01E2}{\={\AE}}%
\DeclareUnicodeCharacter{01E3}{\={\ae}}%
\DeclareUnicodeCharacter{01E6}{\v{G}}%
\DeclareUnicodeCharacter{01E7}{\v{g}}%
\DeclareUnicodeCharacter{01E8}{\v{K}}%
\DeclareUnicodeCharacter{01E9}{\v{k}}%
%
\DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
\DeclareUnicodeCharacter{01F1}{DZ}%
\DeclareUnicodeCharacter{01F2}{Dz}%
\DeclareUnicodeCharacter{01F3}{dz}%
\DeclareUnicodeCharacter{01F4}{\'G}%
\DeclareUnicodeCharacter{01F5}{\'g}%
\DeclareUnicodeCharacter{01F8}{\`N}%
\DeclareUnicodeCharacter{01F9}{\`n}%
\DeclareUnicodeCharacter{01FC}{\'{\AE}}%
\DeclareUnicodeCharacter{01FD}{\'{\ae}}%
\DeclareUnicodeCharacter{01FE}{\'{\O}}%
\DeclareUnicodeCharacter{01FF}{\'{\o}}%
%
\DeclareUnicodeCharacter{021E}{\v{H}}%
\DeclareUnicodeCharacter{021F}{\v{h}}%
%
\DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
\DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
\DeclareUnicodeCharacter{0228}{\cedilla{E}}%
\DeclareUnicodeCharacter{0229}{\cedilla{e}}%
\DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
\DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
%
\DeclareUnicodeCharacter{0232}{\=Y}%
\DeclareUnicodeCharacter{0233}{\=y}%
\DeclareUnicodeCharacter{0237}{\dotless{j}}%
%
\DeclareUnicodeCharacter{02BC}{'}%
%
\DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
%
% Greek letters upper case
\DeclareUnicodeCharacter{0391}{{\it A}}%
\DeclareUnicodeCharacter{0392}{{\it B}}%
\DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
\DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
\DeclareUnicodeCharacter{0395}{{\it E}}%
\DeclareUnicodeCharacter{0396}{{\it Z}}%
\DeclareUnicodeCharacter{0397}{{\it H}}%
\DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
\DeclareUnicodeCharacter{0399}{{\it I}}%
\DeclareUnicodeCharacter{039A}{{\it K}}%
\DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
\DeclareUnicodeCharacter{039C}{{\it M}}%
\DeclareUnicodeCharacter{039D}{{\it N}}%
\DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
\DeclareUnicodeCharacter{039F}{{\it O}}%
\DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
\DeclareUnicodeCharacter{03A1}{{\it P}}%
%\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
\DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
\DeclareUnicodeCharacter{03A4}{{\it T}}%
\DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
\DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
\DeclareUnicodeCharacter{03A7}{{\it X}}%
\DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
\DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
%
% Vowels with accents
\DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
\DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
\DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
\DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
\DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
\DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
%
% Standalone accent
\DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
%
% Greek letters lower case
\DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
\DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
\DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
\DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
\DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
\DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
\DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
\DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
\DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
\DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
\DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
\DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
\DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
\DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
\DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
\DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
\DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
\DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
\DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
\DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
\DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
\DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
\DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
\DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
\DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
%
% More Greek vowels with accents
\DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
\DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
\DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
\DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
\DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
%
% Variant Greek letters
\DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
\DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
\DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
%
\DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
\DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
\DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
\DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
\DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
\DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
\DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
\DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
\DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
\DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
\DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
\DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
%
\DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
\DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
%
\DeclareUnicodeCharacter{1E20}{\=G}%
\DeclareUnicodeCharacter{1E21}{\=g}%
\DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
\DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
\DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
\DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
\DeclareUnicodeCharacter{1E26}{\"H}%
\DeclareUnicodeCharacter{1E27}{\"h}%
%
\DeclareUnicodeCharacter{1E30}{\'K}%
\DeclareUnicodeCharacter{1E31}{\'k}%
\DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
\DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
\DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
\DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
\DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
\DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
\DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
\DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
\DeclareUnicodeCharacter{1E3E}{\'M}%
\DeclareUnicodeCharacter{1E3F}{\'m}%
%
\DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
\DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
\DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
\DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
\DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
\DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
\DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
\DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
\DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
\DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
%
\DeclareUnicodeCharacter{1E54}{\'P}%
\DeclareUnicodeCharacter{1E55}{\'p}%
\DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
\DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
\DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
\DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
\DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
\DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
\DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
\DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
%
\DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
\DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
\DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
\DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
\DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
\DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
\DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
\DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
\DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
\DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
%
\DeclareUnicodeCharacter{1E7C}{\~V}%
\DeclareUnicodeCharacter{1E7D}{\~v}%
\DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
\DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
%
\DeclareUnicodeCharacter{1E80}{\`W}%
\DeclareUnicodeCharacter{1E81}{\`w}%
\DeclareUnicodeCharacter{1E82}{\'W}%
\DeclareUnicodeCharacter{1E83}{\'w}%
\DeclareUnicodeCharacter{1E84}{\"W}%
\DeclareUnicodeCharacter{1E85}{\"w}%
\DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
\DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
\DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
\DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
\DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
\DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
\DeclareUnicodeCharacter{1E8C}{\"X}%
\DeclareUnicodeCharacter{1E8D}{\"x}%
\DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
\DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
%
\DeclareUnicodeCharacter{1E90}{\^Z}%
\DeclareUnicodeCharacter{1E91}{\^z}%
\DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
\DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
\DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
\DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
\DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
\DeclareUnicodeCharacter{1E97}{\"t}%
\DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
\DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
%
\DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
\DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
%
\DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
\DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
\DeclareUnicodeCharacter{1EBC}{\~E}%
\DeclareUnicodeCharacter{1EBD}{\~e}%
%
\DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
\DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
\DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
\DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
%
\DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
\DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
%
\DeclareUnicodeCharacter{1EF2}{\`Y}%
\DeclareUnicodeCharacter{1EF3}{\`y}%
\DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
%
\DeclareUnicodeCharacter{1EF8}{\~Y}%
\DeclareUnicodeCharacter{1EF9}{\~y}%
%
% Punctuation
\DeclareUnicodeCharacter{2013}{--}%
\DeclareUnicodeCharacter{2014}{---}%
\DeclareUnicodeCharacter{2018}{\quoteleft{}}%
\DeclareUnicodeCharacter{2019}{\quoteright{}}%
\DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
\DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
\DeclareUnicodeCharacter{201D}{\quotedblright{}}%
\DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
\DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
\DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
\DeclareUnicodeCharacter{2022}{\bullet{}}%
\DeclareUnicodeCharacter{202F}{\thinspace}%
\DeclareUnicodeCharacter{2026}{\dots{}}%
\DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
\DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
%
\DeclareUnicodeCharacter{20AC}{\euro{}}%
%
\DeclareUnicodeCharacter{2192}{\expansion{}}%
\DeclareUnicodeCharacter{21D2}{\result{}}%
%
% Mathematical symbols
\DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
\DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
\DeclareUnicodeCharacter{2208}{\ensuremath\in}%
\DeclareUnicodeCharacter{2212}{\minus{}}%
\DeclareUnicodeCharacter{2217}{\ast}%
\DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
\DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
\DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
\DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
\DeclareUnicodeCharacter{2261}{\equiv{}}%
\DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
\DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
\DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
\DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
%
\DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
\DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
\DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
\DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
\DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
\DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
\DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
\DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
\DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
\DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
\DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
\DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
\DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
\DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
\DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
\DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
\DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
\DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
\DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
\DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
\DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
\DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
\DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
\DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
\DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
\DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
\DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
\DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
\DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
\DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
\DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
\DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
\DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
\DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
\DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
\DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
\DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
\DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
\DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
\DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
\DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
\DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
\DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
\DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
\DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
\DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
\DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
\DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
\DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
\DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
\DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
\DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
\DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
\DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
\DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
\DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
\DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
\DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
\DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
\DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
\DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
\DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
\DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
\DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
\DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
\DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
\DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
\DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
\DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
\DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
\DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
\DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
\DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
\DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
\DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
\DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
\DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
\DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
\DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
\DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
\DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
\DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
\DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
\DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
\DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
\DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
\DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
\DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
\DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
\DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
\DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
%
\DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
\DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
\DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
\DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
\DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
\DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
\DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
\DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
\DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
\DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
\DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
\DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
\DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
\DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
\DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
\DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
\DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
\DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
\DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
\DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
\DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
\DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
\DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
\DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
\DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
\DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
\DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
\DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
\DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
%
\global\mathchardef\checkmark="1370% actually the square root sign
\DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
}% end of \unicodechardefs
% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
% It makes the setting that replace UTF-8 byte sequence.
\def\utfeightchardefs{%
\let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
\unicodechardefs
}
% Whether the active definitions of non-ASCII characters expand to
% non-active tokens with the same character code. This is used to
% write characters literally, instead of using active definitions for
% printing the correct glyphs.
\newif\ifpassthroughchars
\passthroughcharsfalse
% For native Unicode handling (XeTeX and LuaTeX),
% provide a definition macro to replace/pass-through a Unicode character
%
\def\DeclareUnicodeCharacterNative#1#2{%
\catcode"#1=\active
\def\dodeclareunicodecharacternative##1##2##3{%
\begingroup
\uccode`\~="##2\relax
\uppercase{\gdef~}{%
\ifpassthroughchars
##1%
\else
##3%
\fi
}
\endgroup
}
\begingroup
\uccode`\.="#1\relax
\uppercase{\def\UTFNativeTmp{.}}%
\expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
\endgroup
}
% Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
% It activates the setting that replaces Unicode characters.
\def\nativeunicodechardefs{%
\let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
\unicodechardefs
}
% For native Unicode handling (XeTeX and LuaTeX),
% make the character token expand
% to the sequences given in \unicodechardefs for printing.
\def\DeclareUnicodeCharacterNativeAtU#1#2{%
\def\UTFAtUTmp{#2}
\expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
}
% @U command definitions for native Unicode handling (XeTeX and LuaTeX).
\def\nativeunicodechardefsatu{%
\let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
\unicodechardefs
}
% US-ASCII character definitions.
\def\asciichardefs{% nothing need be done
\relax
}
% Define all Unicode characters we know about. This makes UTF-8 the default
% input encoding and allows @U to work.
\iftxinativeunicodecapable
\nativeunicodechardefsatu
\else
\utfeightchardefs
\fi
\message{formatting,}
\newdimen\defaultparindent \defaultparindent = 15pt
\chapheadingskip = 15pt plus 4pt minus 2pt
\secheadingskip = 12pt plus 3pt minus 2pt
\subsecheadingskip = 9pt plus 2pt minus 2pt
% Prevent underfull vbox error messages.
\vbadness = 10000
% Don't be very finicky about underfull hboxes, either.
\hbadness = 6666
% Following George Bush, get rid of widows and orphans.
\widowpenalty=10000
\clubpenalty=10000
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
% using an old version of TeX, don't do anything. We want the amount of
% stretch added to depend on the line length, hence the dependence on
% \hsize. We call this whenever the paper size is set.
%
\def\setemergencystretch{%
\ifx\emergencystretch\thisisundefined
% Allow us to assign to \emergencystretch anyway.
\def\emergencystretch{\dimen0}%
\else
\emergencystretch = .15\hsize
\fi
}
% Parameters in order: 1) textheight; 2) textwidth;
% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
% 7) physical page height; 8) physical page width.
%
% We also call \setleading{\textleading}, so the caller should define
% \textleading. The caller should also set \parskip.
%
\def\internalpagesizes#1#2#3#4#5#6#7#8{%
\voffset = #3\relax
\topskip = #6\relax
\splittopskip = \topskip
%
\vsize = #1\relax
\advance\vsize by \topskip
\outervsize = \vsize
\advance\outervsize by 2\topandbottommargin
\txipageheight = \vsize
%
\hsize = #2\relax
\outerhsize = \hsize
\advance\outerhsize by 0.5in
\txipagewidth = \hsize
%
\normaloffset = #4\relax
\bindingoffset = #5\relax
%
\ifpdf
\pdfpageheight #7\relax
\pdfpagewidth #8\relax
% if we don't reset these, they will remain at "1 true in" of
% whatever layout pdftex was dumped with.
\pdfhorigin = 1 true in
\pdfvorigin = 1 true in
\else
\ifx\XeTeXrevision\thisisundefined
\special{papersize=#8,#7}%
\else
\pdfpageheight #7\relax
\pdfpagewidth #8\relax
% XeTeX does not have \pdfhorigin and \pdfvorigin.
\fi
\fi
%
\setleading{\textleading}
%
\parindent = \defaultparindent
\setemergencystretch
}
% @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
\textleading = 13.2pt
%
% If page is nothing but text, make it come out even.
\internalpagesizes{607.2pt}{6in}% that's 46 lines
{\voffset}{.25in}%
{\bindingoffset}{36pt}%
{11in}{8.5in}%
}}
% Use @smallbook to reset parameters for 7x9.25 trim size.
\def\smallbook{{\globaldefs = 1
\parskip = 2pt plus 1pt
\textleading = 12pt
%
\internalpagesizes{7.5in}{5in}%
{-.2in}{0in}%
{\bindingoffset}{16pt}%
{9.25in}{7in}%
%
\lispnarrowing = 0.3in
\tolerance = 700
\contentsrightmargin = 0pt
\defbodyindent = .5cm
}}
% Use @smallerbook to reset parameters for 6x9 trim size.
% (Just testing, parameters still in flux.)
\def\smallerbook{{\globaldefs = 1
\parskip = 1.5pt plus 1pt
\textleading = 12pt
%
\internalpagesizes{7.4in}{4.8in}%
{-.2in}{-.4in}%
{0pt}{14pt}%
{9in}{6in}%
%
\lispnarrowing = 0.25in
\tolerance = 700
\contentsrightmargin = 0pt
\defbodyindent = .4cm
}}
% Use @afourpaper to print on European A4 paper.
\def\afourpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt
\textleading = 13.2pt
%
% Double-side printing via postscript on Laserjet 4050
% prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
% To change the settings for a different printer or situation, adjust
% \normaloffset until the front-side and back-side texts align. Then
% do the same for \bindingoffset. You can set these for testing in
% your texinfo source file like this:
% @tex
% \global\normaloffset = -6mm
% \global\bindingoffset = 10mm
% @end tex
\internalpagesizes{673.2pt}{160mm}% that's 51 lines
{\voffset}{\hoffset}%
{\bindingoffset}{44pt}%
{297mm}{210mm}%
%
\tolerance = 700
\contentsrightmargin = 0pt
\defbodyindent = 5mm
}}
% Use @afivepaper to print on European A5 paper.
% From romildo@urano.iceb.ufop.br, 2 July 2000.
% He also recommends making @example and @lisp be small.
\def\afivepaper{{\globaldefs = 1
\parskip = 2pt plus 1pt minus 0.1pt
\textleading = 12.5pt
%
\internalpagesizes{160mm}{120mm}%
{\voffset}{\hoffset}%
{\bindingoffset}{8pt}%
{210mm}{148mm}%
%
\lispnarrowing = 0.2in
\tolerance = 800
\contentsrightmargin = 0pt
\defbodyindent = 2mm
\tableindent = 12mm
}}
% A specific text layout, 24x15cm overall, intended for A4 paper.
\def\afourlatex{{\globaldefs = 1
\afourpaper
\internalpagesizes{237mm}{150mm}%
{\voffset}{4.6mm}%
{\bindingoffset}{7mm}%
{297mm}{210mm}%
%
% Must explicitly reset to 0 because we call \afourpaper.
\globaldefs = 0
}}
% Use @afourwide to print on A4 paper in landscape format.
\def\afourwide{{\globaldefs = 1
\afourpaper
\internalpagesizes{241mm}{165mm}%
{\voffset}{-2.95mm}%
{\bindingoffset}{7mm}%
{297mm}{210mm}%
\globaldefs = 0
}}
\def\bsixpaper{{\globaldefs = 1
\afourpaper
\internalpagesizes{140mm}{100mm}%
{-6.35mm}{-12.7mm}%
{\bindingoffset}{14pt}%
{176mm}{125mm}%
\let\SETdispenvsize=\smallword
\lispnarrowing = 0.2in
\globaldefs = 0
}}
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
% Perhaps we should allow setting the margins, \topskip, \parskip,
% and/or leading, also. Or perhaps we should compute them somehow.
%
\parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
\def\pagesizesyyy#1,#2,#3\finish{{%
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
\globaldefs = 1
%
\parskip = 3pt plus 2pt minus 1pt
\setleading{\textleading}%
%
\dimen0 = #1\relax
\advance\dimen0 by 2.5in % default 1in margin above heading line
% and 1.5in to include heading, footing and
% bottom margin
%
\dimen2 = \hsize
\advance\dimen2 by 2in % default to 1 inch margin on each side
%
\internalpagesizes{#1}{\hsize}%
{\voffset}{\normaloffset}%
{\bindingoffset}{44pt}%
{\dimen0}{\dimen2}%
}}
% Set default to letter.
%
\letterpaper
% Default value of \hfuzz, for suppressing warnings about overfull hboxes.
\hfuzz = 1pt
\message{and turning on texinfo input format.}
\def^^L{\par} % remove \outer, so ^L can appear in an @comment
% DEL is a comment character, in case @c does not suffice.
\catcode`\^^? = 14
% Define macros to output various characters with catcode for normal text.
\catcode`\"=\other \def\normaldoublequote{"}
\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
\catcode`\+=\other \def\normalplus{+}
\catcode`\<=\other \def\normalless{<}
\catcode`\>=\other \def\normalgreater{>}
\catcode`\^=\other \def\normalcaret{^}
\catcode`\_=\other \def\normalunderscore{_}
\catcode`\|=\other \def\normalverticalbar{|}
\catcode`\~=\other \def\normaltilde{~}
% This macro is used to make a character print one way in \tt
% (where it can probably be output as-is), and another way in other fonts,
% where something hairier probably needs to be done.
%
% #1 is what to print if we are indeed using \tt; #2 is what to print
% otherwise. Since all the Computer Modern typewriter fonts have zero
% interword stretch (and shrink), and it is reasonable to expect all
% typewriter fonts to have this, we can check that font parameter.
%
\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
% Same as above, but check for italic font. Actually this also catches
% non-italic slanted fonts since it is impossible to distinguish them from
% italic fonts. But since this is only used by $ and it uses \sl anyway
% this is not a problem.
\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
% Set catcodes for Texinfo file
% Active characters for printing the wanted glyph.
% Most of these we simply print from the \tt font, but for some, we can
% use math or other variants that look better in normal text.
%
\catcode`\"=\active
\def\activedoublequote{{\tt\char34}}
\let"=\activedoublequote
\catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
\chardef\hatchar=`\^
\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
\catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_}
\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
\let\realunder=_
\catcode`\|=\active \def|{{\tt\char124}}
\chardef \less=`\<
\catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
\chardef \gtr=`\>
\catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
\catcode`\+=\active \def+{{\tt \char 43}}
\catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
\catcode`\-=\active \let-=\normaldash
% used for headline/footline in the output routine, in case the page
% breaks in the middle of an @tex block.
\def\texinfochars{%
\let< = \activeless
\let> = \activegtr
\let~ = \activetilde
\let^ = \activehat
\setregularquotes
\let\b = \strong
\let\i = \smartitalic
% in principle, all other definitions in \tex have to be undone too.
}
% Used sometimes to turn off (effectively) the active characters even after
% parsing them.
\def\turnoffactive{%
\normalturnoffactive
\otherbackslash
}
\catcode`\@=0
% \backslashcurfont outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\backslashcurfont=`\\
% \realbackslash is an actual character `\' with catcode other.
{\catcode`\\=\other @gdef@realbackslash{\}}
% In Texinfo, backslash is an active character; it prints the backslash
% in fixed width font.
\catcode`\\=\active % @ for escape char from now on.
% Print a typewriter backslash. For math mode, we can't simply use
% \backslashcurfont: the story here is that in math mode, the \char
% of \backslashcurfont ends up printing the roman \ from the math symbol
% font (because \char in math mode uses the \mathcode, and plain.tex
% sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
% ignored family value; char position "5C). We can't use " for the
% usual hex value because it has already been made active.
@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
% \otherbackslash defines an active \ to be a literal `\' character with
% catcode other.
@gdef@otherbackslash{@let\=@realbackslash}
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'.
%
{@catcode`- = @active
@gdef@normalturnoffactive{%
@passthroughcharstrue
@let-=@normaldash
@let"=@normaldoublequote
@let$=@normaldollar %$ font-lock fix
@let+=@normalplus
@let<=@normalless
@let>=@normalgreater
@let^=@normalcaret
@let_=@normalunderscore
@let|=@normalverticalbar
@let~=@normaltilde
@let\=@ttbackslash
@setregularquotes
@unsepspaces
}
}
% If a .fmt file is being used, characters that might appear in a file
% name cannot be active until we have parsed the command line.
% So turn them off again, and have @fixbackslash turn them back on.
@catcode`+=@other @catcode`@_=@other
% \enablebackslashhack - allow file to begin `\input texinfo'
%
% If a .fmt file is being used, we don't want the `\input texinfo' to show up.
% That is what \eatinput is for; after that, the `\' should revert to printing
% a backslash.
% If the file did not have a `\input texinfo', then it is turned off after
% the first line; otherwise the first `\' in the file would cause an error.
% This is used on the very last line of this file, texinfo.tex.
% We also use @c to call @fixbackslash, in case ends of lines are hidden.
{
@catcode`@^=7
@catcode`@^^M=13@gdef@enablebackslashhack{%
@global@let\ = @eatinput%
@catcode`@^^M=13%
@def@c{@fixbackslash@c}%
% Definition for the newline at the end of this file.
@def ^^M{@let^^M@secondlinenl}%
% Definition for a newline in the main Texinfo file.
@gdef @secondlinenl{@fixbackslash}%
% In case the first line has a whole-line command on it
@let@originalparsearg@parsearg
@def@parsearg{@fixbackslash@originalparsearg}
}}
{@catcode`@^=7 @catcode`@^^M=13%
@gdef@eatinput input texinfo#1^^M{@fixbackslash}}
% Emergency active definition of newline, in case an active newline token
% appears by mistake.
{@catcode`@^=7 @catcode13=13%
@gdef@enableemergencynewline{%
@gdef^^M{%
@par%
%@par%
}}}
@gdef@fixbackslash{%
@ifx\@eatinput @let\ = @ttbackslash @fi
@catcode13=5 % regular end of line
@enableemergencynewline
@let@c=@comment
@let@parsearg@originalparsearg
% Also turn back on active characters that might appear in the input
% file name, in case not using a pre-dumped format.
@catcode`+=@active
@catcode`@_=@active
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
% called at the beginning of every Texinfo file. Not opening texinfo.cnf
% directly in this file, texinfo.tex, makes it possible to make a format
% file for Texinfo.
%
@openin 1 texinfo.cnf
@ifeof 1 @else @input texinfo.cnf @fi
@closein 1
}
% Say @foo, not \foo, in error messages.
@escapechar = `@@
% These (along with & and #) are made active for url-breaking, so need
% active definitions as the normal characters.
@def@normaldot{.}
@def@normalquest{?}
@def@normalslash{/}
% These look ok in all fonts, so just make them not special.
% @hashchar{} gets its own user-level command, because of #line.
@catcode`@& = @other @def@normalamp{&}
@catcode`@# = @other @def@normalhash{#}
@catcode`@% = @other @def@normalpercent{%}
@let @hashchar = @normalhash
@c Finally, make ` and ' active, so that txicodequoteundirected and
@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
@c don't make ` and ' active, @code will not get them as active chars.
@c Do this last of all since we use ` in the previous @catcode assignments.
@catcode`@'=@active
@catcode`@`=@active
@setregularquotes
@c Local variables:
@c eval: (add-hook 'before-save-hook 'time-stamp)
@c page-delimiter: "^\\\\message\\|emacs-page"
@c time-stamp-start: "def\\\\texinfoversion{"
@c time-stamp-format: "%:y-%02m-%02d.%02H"
@c time-stamp-end: "}"
@c End:
@c vim:sw=2:
@enablebackslashhack
guile-commonmark-0.1.2+20240812/build-aux/install-sh 0000755 0001750 0001750 00000035776 14641033013 021411 0 ustar frankie frankie #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-p pass -p to $cpprog.
-s $stripprog installed files.
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
By default, rm is invoked with -f; when overridden with RMPROG,
it's up to you to specify -f if you want it.
If -S is not specified, no backups are attempted.
Email bug reports to bug-automake@gnu.org.
Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
-S) backupsuffix="$2"
shift;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
# Don't chown directories that already exist.
if test $dstdir_status = 0; then
chowncmd=""
fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities 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.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# If $backupsuffix is set, and the file being installed
# already exists, attempt a backup. Don't worry if it fails,
# e.g., if mv doesn't support -f.
if test -n "$backupsuffix" && test -f "$dst"; then
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
fi
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
guile-commonmark-0.1.2+20240812/build-aux/test-driver.scm 0000644 0001750 0001750 00000017275 13652433030 022357 0 ustar frankie frankie ;;;; test-driver.scm - Guile test driver for Automake testsuite harness
(define script-version "2017-03-22.13") ;UTC
;;; Copyright © 2015, 2016 Mathieu Lirzin
;;;
;;; 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
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see .
;;;; Commentary:
;;;
;;; This script provides a Guile test driver using the SRFI-64 Scheme API for
;;; test suites. SRFI-64 is distributed with Guile since version 2.0.9.
;;;
;;;; Code:
(use-modules (ice-9 getopt-long)
(ice-9 pretty-print)
(srfi srfi-26)
(srfi srfi-64))
(define (show-help)
(display "Usage:
test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
[--expect-failure={yes|no}] [--color-tests={yes|no}]
[--enable-hard-errors={yes|no}] [--brief={yes|no}}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
The '--test-name', '--log-file' and '--trs-file' options are mandatory.\n"))
(define %options
'((test-name (value #t))
(log-file (value #t))
(trs-file (value #t))
(color-tests (value #t))
(expect-failure (value #t)) ;XXX: not implemented yet
(enable-hard-errors (value #t)) ;not implemented in SRFI-64
(brief (value #t))
(help (single-char #\h) (value #f))
(version (single-char #\V) (value #f))))
(define (option->boolean options key)
"Return #t if the value associated with KEY in OPTIONS is \"yes\"."
(and=> (option-ref options key #f) (cut string=? <> "yes")))
(define* (test-display field value #:optional (port (current-output-port))
#:key pretty?)
"Display \"FIELD: VALUE\\n\" on PORT."
(if pretty?
(begin
(format port "~A:~%" field)
(pretty-print value port #:per-line-prefix "+ "))
(format port "~A: ~S~%" field value)))
(define* (result->string symbol #:key colorize?)
"Return SYMBOL as an upper case string. Use colors when COLORIZE is #t."
(let ((result (string-upcase (symbol->string symbol))))
(if colorize?
(string-append (case symbol
((pass) "[0;32m") ;green
((xfail) "[1;32m") ;light green
((skip) "[1;34m") ;blue
((fail xpass) "[0;31m") ;red
((error) "[0;35m")) ;magenta
result
"[m") ;no color
result)))
(define* (test-runner-gnu test-name #:key color? brief? out-port trs-port)
"Return an custom SRFI-64 test runner. TEST-NAME is a string specifying the
file name of the current the test. COLOR? specifies whether to use colors,
and BRIEF?, well, you know. OUT-PORT and TRS-PORT must be output ports. The
current output port is supposed to be redirected to a '.log' file."
(define (test-on-test-begin-gnu runner)
;; Procedure called at the start of an individual test case, before the
;; test expression (and expected value) are evaluated.
(let ((result (cute assq-ref (test-result-alist runner) <>)))
(format #t "test-name: ~A~%" (result 'test-name))
(format #t "location: ~A~%"
(string-append (result 'source-file) ":"
(number->string (result 'source-line))))
(test-display "source" (result 'source-form) #:pretty? #t)))
(define (test-on-test-end-gnu runner)
;; Procedure called at the end of an individual test case, when the result
;; of the test is available.
(let* ((results (test-result-alist runner))
(result? (cut assq <> results))
(result (cut assq-ref results <>)))
(unless brief?
;; Display the result of each test case on the console.
(format out-port "~A: ~A - ~A~%"
(result->string (test-result-kind runner) #:colorize? color?)
test-name (test-runner-test-name runner)))
(when (result? 'expected-value)
(test-display "expected-value" (result 'expected-value)))
(when (result? 'expected-error)
(test-display "expected-error" (result 'expected-error) #:pretty? #t))
(when (result? 'actual-value)
(test-display "actual-value" (result 'actual-value)))
(when (result? 'actual-error)
(test-display "actual-error" (result 'actual-error) #:pretty? #t))
(format #t "result: ~a~%" (result->string (result 'result-kind)))
(newline)
(format trs-port ":test-result: ~A ~A~%"
(result->string (test-result-kind runner))
(test-runner-test-name runner))))
(define (test-on-group-end-gnu runner)
;; Procedure called by a 'test-end', including at the end of a test-group.
(let ((fail (or (positive? (test-runner-fail-count runner))
(positive? (test-runner-xpass-count runner))))
(skip (or (positive? (test-runner-skip-count runner))
(positive? (test-runner-xfail-count runner)))))
;; XXX: The global results need some refinements for XPASS.
(format trs-port ":global-test-result: ~A~%"
(if fail "FAIL" (if skip "SKIP" "PASS")))
(format trs-port ":recheck: ~A~%"
(if fail "yes" "no"))
(format trs-port ":copy-in-global-log: ~A~%"
(if (or fail skip) "yes" "no"))
(when brief?
;; Display the global test group result on the console.
(format out-port "~A: ~A~%"
(result->string (if fail 'fail (if skip 'skip 'pass))
#:colorize? color?)
test-name))
#f))
(let ((runner (test-runner-null)))
(test-runner-on-test-begin! runner test-on-test-begin-gnu)
(test-runner-on-test-end! runner test-on-test-end-gnu)
(test-runner-on-group-end! runner test-on-group-end-gnu)
(test-runner-on-bad-end-name! runner test-on-bad-end-name-simple)
runner))
;;;
;;; Entry point.
;;;
(define (main . args)
(let* ((opts (getopt-long (command-line) %options))
(option (cut option-ref opts <> <>)))
(cond
((option 'help #f) (show-help))
((option 'version #f) (format #t "test-driver.scm ~A" script-version))
(else
(let ((log (open-file (option 'log-file "") "w0"))
(trs (open-file (option 'trs-file "") "wl"))
(out (duplicate-port (current-output-port) "wl")))
(redirect-port log (current-output-port))
(redirect-port log (current-warning-port))
(redirect-port log (current-error-port))
(test-with-runner
(test-runner-gnu (option 'test-name #f)
#:color? (option->boolean opts 'color-tests)
#:brief? (option->boolean opts 'brief)
#:out-port out #:trs-port trs)
(load-from-path (option 'test-name #f)))
(close-port log)
(close-port trs)
(close-port out))))
(exit 0)))
;;; Local Variables:
;;; eval: (add-hook 'write-file-functions 'time-stamp)
;;; time-stamp-start: "(define script-version \""
;;; time-stamp-format: "%:y-%02m-%02d.%02H"
;;; time-stamp-time-zone: "UTC"
;;; time-stamp-end: "\") ;UTC"
;;; End:
;;;; test-driver.scm ends here.
guile-commonmark-0.1.2+20240812/configure.ac 0000644 0001750 0001750 00000001111 13652433030 017755 0 ustar frankie frankie
AC_INIT([guile-commonmark], [0.2])
AC_CONFIG_SRCDIR([commonmark.scm])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
GUILE_PKG([3.0 2.2 2.0])
GUILE_PROGS
if test "x$GUILD" = "x"; then
AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
fi
dnl srfi-64 required for tests, introduced by Guile 2.0.11
GUILE_MODULE_REQUIRED([srfi srfi-64])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_CONFIG_FILES([scripts/gcmark], [chmod +x scripts/gcmark])
AC_OUTPUT
guile-commonmark-0.1.2+20240812/aclocal.m4 0000644 0001750 0001750 00000116661 14641033013 017344 0 ustar frankie frankie # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant .
dnl Copyright © 2012-2015 Dan Nicholson
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see .])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])
[_AM_PROG_CC_C_O
])
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
m4_ifdef([_$0_ALREADY_INIT],
[m4_fatal([$0 expanded multiple times
]m4_defn([_$0_ALREADY_INIT]))],
[m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[AC_DIAGNOSE([obsolete],
[$0: two- and three-arguments forms are deprecated.])
m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
AM_MISSING_PROG([AUTOCONF], [autoconf])
AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
AM_MISSING_PROG([AUTOHEADER], [autoheader])
AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
#
#
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES([CC])],
[m4_define([AC_PROG_CC],
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES([CXX])],
[m4_define([AC_PROG_CXX],
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES([OBJC])],
[m4_define([AC_PROG_OBJC],
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[_AM_DEPENDENCIES([OBJCXX])],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
# Variables for tags utilities; see am/tags.am
if test -z "$CTAGS"; then
CTAGS=ctags
fi
AC_SUBST([CTAGS])
if test -z "$ETAGS"; then
ETAGS=etags
fi
AC_SUBST([ETAGS])
if test -z "$CSCOPE"; then
CSCOPE=cscope
fi
AC_SUBST([CSCOPE])
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard:
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: .
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST([install_sh])])
# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it is modern enough.
# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
AC_MSG_WARN(['missing' script is too old or missing])
fi
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
if test "$[2]" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT([yes])
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
AC_CONFIG_COMMANDS_PRE(
[AC_MSG_CHECKING([that generated files are newer than configure])
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
AC_MSG_RESULT([done])])
rm -f conftest.file
])
# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# ("yes" being less verbose, "no" or empty being verbose).
AC_DEFUN([AM_SILENT_RULES],
[AC_ARG_ENABLE([silent-rules], [dnl
AS_HELP_STRING(
[--enable-silent-rules],
[less verbose build output (undo: "make V=1")])
AS_HELP_STRING(
[--disable-silent-rules],
[verbose build output (undo: "make V=0")])dnl
])
case $enable_silent_rules in @%:@ (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
esac
dnl
dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
dnl do not support nested variable expansions.
dnl See automake bug#9928 and bug#10237.
am_make=${MAKE-make}
AC_CACHE_CHECK([whether $am_make supports nested variables],
[am_cv_make_support_nested_variables],
[if AS_ECHO([['TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi])
if test $am_cv_make_support_nested_variables = yes; then
dnl Using '$V' instead of '$(V)' breaks IRIX make.
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AC_SUBST([AM_V])dnl
AM_SUBST_NOTMAKE([AM_V])dnl
AC_SUBST([AM_DEFAULT_V])dnl
AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
AM_BACKSLASH='\'
AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
#
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AC_SUBST([AMTAR], ['$${TAR-tar}'])
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
m4_if([$1], [v7],
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
[m4_case([$1],
[ustar],
[# The POSIX 1988 'ustar' format is defined with fixed-size fields.
# There is notably a 21 bits limit for the UID and the GID. In fact,
# the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
# and bug#13588).
am_max_uid=2097151 # 2^21 - 1
am_max_gid=$am_max_uid
# The $UID and $GID variables are not portable, so we need to resort
# to the POSIX-mandated id(1) utility. Errors in the 'id' calls
# below are definitely unexpected, so allow the users to see them
# (that is, avoid stderr redirection).
am_uid=`id -u || echo unknown`
am_gid=`id -g || echo unknown`
AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
if test $am_uid -le $am_max_uid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi
AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
if test $am_gid -le $am_max_gid; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
_am_tools=none
fi],
[pax],
[],
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Go ahead even if we have the value already cached. We do so because we
# need to set the values for the 'am__tar' and 'am__untar' variables.
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
for _am_tool in $_am_tools; do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar; do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works.
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar /dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/guile.m4])
guile-commonmark-0.1.2+20240812/.travis.yml 0000644 0001750 0001750 00000000422 13652433030 017604 0 ustar frankie frankie before_install:
- sudo add-apt-repository ppa:dns/gnu -y
- sudo apt-get update -qq
- sudo apt-get install -y guile-2.0-dev dh-autoreconf autoconf automake make
install: true
script: ./bootstrap && ./configure && make && make check
after_failure: cat test-suite.log
guile-commonmark-0.1.2+20240812/doc/ 0000755 0001750 0001750 00000000000 14656402071 016250 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/doc/stamp-vti 0000644 0001750 0001750 00000000133 14641033025 020105 0 ustar frankie frankie @set UPDATED 30 April 2020
@set UPDATED-MONTH April 2020
@set EDITION 0.2
@set VERSION 0.2
guile-commonmark-0.1.2+20240812/doc/guile-commonmark.info 0000644 0001750 0001750 00000064543 14641033026 022401 0 ustar frankie frankie This is guile-commonmark.info, produced by makeinfo version 6.8 from
guile-commonmark.texi.
This manual is for Guile-CommonMark (version 0.2, 30 April 2020), which
is a GNU Guile library for parsing and rendering CommonMark.
Copyright © 2018 Erik Edrosa
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts, and
no Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License".
INFO-DIR-SECTION The Algorithmic Language Scheme
START-INFO-DIR-ENTRY
* Guile-CommonMark: (guile-commonmark). CommonMark implementation.
END-INFO-DIR-ENTRY
File: guile-commonmark.info, Node: Top, Next: Introduction, Up: (dir)
Guile-CommonMark
****************
This manual is for Guile-CommonMark (version 0.2, 30 April 2020), which
is a GNU Guile library for parsing and rendering CommonMark.
* Menu:
* Introduction::
* Installation::
* GNU Free Documentation License:: Copying and sharing this documentation.
File: guile-commonmark.info, Node: Introduction, Next: Installation, Prev: Top, Up: Top
1 Introduction
**************
File: guile-commonmark.info, Node: Installation, Next: GNU Free Documentation License, Prev: Introduction, Up: Top
2 Installation
**************
File: guile-commonmark.info, Node: GNU Free Documentation License, Prev: Installation, Up: Top
Appendix A GNU Free Documentation License
*****************************************
Version 1.3, 3 November 2008
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
0. PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document “free” in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or
noncommercially. Secondarily, this License preserves for the
author and publisher a way to get credit for their work, while not
being considered responsible for modifications made by others.
This License is a kind of “copyleft”, which means that derivative
works of the document must themselves be free in the same sense.
It complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for
free software, because free software needs free documentation: a
free program should come with manuals providing the same freedoms
that the software does. But this License is not limited to
software manuals; it can be used for any textual work, regardless
of subject matter or whether it is published as a printed book. We
recommend this License principally for works whose purpose is
instruction or reference.
1. APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium,
that contains a notice placed by the copyright holder saying it can
be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration,
to use that work under the conditions stated herein. The
“Document”, below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as “you”. You accept
the license if you copy, modify or distribute the work in a way
requiring permission under copyright law.
A “Modified Version” of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A “Secondary Section” is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document’s overall
subject (or to related matters) and contains nothing that could
fall directly within that overall subject. (Thus, if the Document
is in part a textbook of mathematics, a Secondary Section may not
explain any mathematics.) The relationship could be a matter of
historical connection with the subject or with related matters, or
of legal, commercial, philosophical, ethical or political position
regarding them.
The “Invariant Sections” are certain Secondary Sections whose
titles are designated, as being those of Invariant Sections, in the
notice that says that the Document is released under this License.
If a section does not fit the above definition of Secondary then it
is not allowed to be designated as Invariant. The Document may
contain zero Invariant Sections. If the Document does not identify
any Invariant Sections then there are none.
The “Cover Texts” are certain short passages of text that are
listed, as Front-Cover Texts or Back-Cover Texts, in the notice
that says that the Document is released under this License. A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may
be at most 25 words.
A “Transparent” copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed
of pixels) generic paint programs or (for drawings) some widely
available drawing editor, and that is suitable for input to text
formatters or for automatic translation to a variety of formats
suitable for input to text formatters. A copy made in an otherwise
Transparent file format whose markup, or absence of markup, has
been arranged to thwart or discourage subsequent modification by
readers is not Transparent. An image format is not Transparent if
used for any substantial amount of text. A copy that is not
“Transparent” is called “Opaque”.
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format,
SGML or XML using a publicly available DTD, and standard-conforming
simple HTML, PostScript or PDF designed for human modification.
Examples of transparent image formats include PNG, XCF and JPG.
Opaque formats include proprietary formats that can be read and
edited only by proprietary word processors, SGML or XML for which
the DTD and/or processing tools are not generally available, and
the machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
The “Title Page” means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the
material this License requires to appear in the title page. For
works in formats which do not have any title page as such, “Title
Page” means the text near the most prominent appearance of the
work’s title, preceding the beginning of the body of the text.
The “publisher” means any person or entity that distributes copies
of the Document to the public.
A section “Entitled XYZ” means a named subunit of the Document
whose title either is precisely XYZ or contains XYZ in parentheses
following text that translates XYZ in another language. (Here XYZ
stands for a specific section name mentioned below, such as
“Acknowledgements”, “Dedications”, “Endorsements”, or “History”.)
To “Preserve the Title” of such a section when you modify the
Document means that it remains a section “Entitled XYZ” according
to this definition.
The Document may include Warranty Disclaimers next to the notice
which states that this License applies to the Document. These
Warranty Disclaimers are considered to be included by reference in
this License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and
has no effect on the meaning of this License.
2. VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License
applies to the Document are reproduced in all copies, and that you
add no other conditions whatsoever to those of this License. You
may not use technical measures to obstruct or control the reading
or further copying of the copies you make or distribute. However,
you may accept compensation in exchange for copies. If you
distribute a large enough number of copies you must also follow the
conditions in section 3.
You may also lend copies, under the same conditions stated above,
and you may publicly display copies.
3. COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly
have printed covers) of the Document, numbering more than 100, and
the Document’s license notice requires Cover Texts, you must
enclose the copies in covers that carry, clearly and legibly, all
these Cover Texts: Front-Cover Texts on the front cover, and
Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The
front cover must present the full title with all words of the title
equally prominent and visible. You may add other material on the
covers in addition. Copying with changes limited to the covers, as
long as they preserve the title of the Document and satisfy these
conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto
adjacent pages.
If you publish or distribute Opaque copies of the Document
numbering more than 100, you must either include a machine-readable
Transparent copy along with each Opaque copy, or state in or with
each Opaque copy a computer-network location from which the general
network-using public has access to download using public-standard
network protocols a complete Transparent copy of the Document, free
of added material. If you use the latter option, you must take
reasonably prudent steps, when you begin distribution of Opaque
copies in quantity, to ensure that this Transparent copy will
remain thus accessible at the stated location until at least one
year after the last time you distribute an Opaque copy (directly or
through your agents or retailers) of that edition to the public.
It is requested, but not required, that you contact the authors of
the Document well before redistributing any large number of copies,
to give them a chance to provide you with an updated version of the
Document.
4. MODIFICATIONS
You may copy and distribute a Modified Version of the Document
under the conditions of sections 2 and 3 above, provided that you
release the Modified Version under precisely this License, with the
Modified Version filling the role of the Document, thus licensing
distribution and modification of the Modified Version to whoever
possesses a copy of it. In addition, you must do these things in
the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title
distinct from that of the Document, and from those of previous
versions (which should, if there were any, be listed in the
History section of the Document). You may use the same title
as a previous version if the original publisher of that
version gives permission.
B. List on the Title Page, as authors, one or more persons or
entities responsible for authorship of the modifications in
the Modified Version, together with at least five of the
principal authors of the Document (all of its principal
authors, if it has fewer than five), unless they release you
from this requirement.
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
F. Include, immediately after the copyright notices, a license
notice giving the public permission to use the Modified
Version under the terms of this License, in the form shown in
the Addendum below.
G. Preserve in that license notice the full lists of Invariant
Sections and required Cover Texts given in the Document’s
license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled “History”, Preserve its Title,
and add to it an item stating at least the title, year, new
authors, and publisher of the Modified Version as given on the
Title Page. If there is no section Entitled “History” in the
Document, create one stating the title, year, authors, and
publisher of the Document as given on its Title Page, then add
an item describing the Modified Version as stated in the
previous sentence.
J. Preserve the network location, if any, given in the Document
for public access to a Transparent copy of the Document, and
likewise the network locations given in the Document for
previous versions it was based on. These may be placed in the
“History” section. You may omit a network location for a work
that was published at least four years before the Document
itself, or if the original publisher of the version it refers
to gives permission.
K. For any section Entitled “Acknowledgements” or “Dedications”,
Preserve the Title of the section, and preserve in the section
all the substance and tone of each of the contributor
acknowledgements and/or dedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered
in their text and in their titles. Section numbers or the
equivalent are not considered part of the section titles.
M. Delete any section Entitled “Endorsements”. Such a section
may not be included in the Modified Version.
N. Do not retitle any existing section to be Entitled
“Endorsements” or to conflict in title with any Invariant
Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no
material copied from the Document, you may at your option designate
some or all of these sections as invariant. To do this, add their
titles to the list of Invariant Sections in the Modified Version’s
license notice. These titles must be distinct from any other
section titles.
You may add a section Entitled “Endorsements”, provided it contains
nothing but endorsements of your Modified Version by various
parties—for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of
a standard.
You may add a passage of up to five words as a Front-Cover Text,
and a passage of up to 25 words as a Back-Cover Text, to the end of
the list of Cover Texts in the Modified Version. Only one passage
of Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document
already includes a cover text for the same cover, previously added
by you or by arrangement made by the same entity you are acting on
behalf of, you may not add another; but you may replace the old
one, on explicit permission from the previous publisher that added
the old one.
The author(s) and publisher(s) of the Document do not by this
License give permission to use their names for publicity for or to
assert or imply endorsement of any Modified Version.
5. COMBINING DOCUMENTS
You may combine the Document with other documents released under
this License, under the terms defined in section 4 above for
modified versions, provided that you include in the combination all
of the Invariant Sections of all of the original documents,
unmodified, and list them all as Invariant Sections of your
combined work in its license notice, and that you preserve all
their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name
but different contents, make the title of each such section unique
by adding at the end of it, in parentheses, the name of the
original author or publisher of that section if known, or else a
unique number. Make the same adjustment to the section titles in
the list of Invariant Sections in the license notice of the
combined work.
In the combination, you must combine any sections Entitled
“History” in the various original documents, forming one section
Entitled “History”; likewise combine any sections Entitled
“Acknowledgements”, and any sections Entitled “Dedications”. You
must delete all sections Entitled “Endorsements.”
6. COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other
documents released under this License, and replace the individual
copies of this License in the various documents with a single copy
that is included in the collection, provided that you follow the
rules of this License for verbatim copying of each of the documents
in all other respects.
You may extract a single document from such a collection, and
distribute it individually under this License, provided you insert
a copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that
document.
7. AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other
separate and independent documents or works, in or on a volume of a
storage or distribution medium, is called an “aggregate” if the
copyright resulting from the compilation is not used to limit the
legal rights of the compilation’s users beyond what the individual
works permit. When the Document is included in an aggregate, this
License does not apply to the other works in the aggregate which
are not themselves derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half
of the entire aggregate, the Document’s Cover Texts may be placed
on covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic
form. Otherwise they must appear on printed covers that bracket
the whole aggregate.
8. TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section
4. Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also
include the original English version of this License and the
original versions of those notices and disclaimers. In case of a
disagreement between the translation and the original version of
this License or a notice or disclaimer, the original version will
prevail.
If a section in the Document is Entitled “Acknowledgements”,
“Dedications”, or “History”, the requirement (section 4) to
Preserve its Title (section 1) will typically require changing the
actual title.
9. TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void,
and will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the
copyright holder fails to notify you of the violation by some
reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from
that copyright holder, and you cure the violation prior to 30 days
after your receipt of the notice.
Termination of your rights under this section does not terminate
the licenses of parties who have received copies or rights from you
under this License. If your rights have been terminated and not
permanently reinstated, receipt of a copy of some or all of the
same material does not give you any rights to use it.
10. FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions of
the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
.
Each version of the License is given a distinguishing version
number. If the Document specifies that a particular numbered
version of this License “or any later version” applies to it, you
have the option of following the terms and conditions either of
that specified version or of any later version that has been
published (not as a draft) by the Free Software Foundation. If the
Document does not specify a version number of this License, you may
choose any version ever published (not as a draft) by the Free
Software Foundation. If the Document specifies that a proxy can
decide which future versions of this License can be used, that
proxy’s public statement of acceptance of a version permanently
authorizes you to choose that version for the Document.
11. RELICENSING
“Massive Multiauthor Collaboration Site” (or “MMC Site”) means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server.
A “Massive Multiauthor Collaboration” (or “MMC”) contained in the
site means any set of copyrightable works thus published on the MMC
site.
“CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
“Incorporate” means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is “eligible for relicensing” if it is licensed under this
License, and if all works that were first published under this
License somewhere other than this MMC, and subsequently
incorporated in whole or in part into the MMC, (1) had no cover
texts or invariant sections, and (2) were thus incorporated prior
to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the
site under CC-BY-SA on the same site at any time before August 1,
2009, provided the MMC is eligible for relicensing.
ADDENDUM: How to use this License for your documents
====================================================
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and license
notices just after the title page:
Copyright (C) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover
Texts, replace the “with...Texts.” line with this:
with the Invariant Sections being LIST THEIR TITLES, with
the Front-Cover Texts being LIST, and with the Back-Cover Texts
being LIST.
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of free
software license, such as the GNU General Public License, to permit
their use in free software.
Tag Table:
Node: Top817
Node: Introduction1181
Node: Installation1307
Node: GNU Free Documentation License1460
End Tag Table
Local Variables:
coding: utf-8
End:
guile-commonmark-0.1.2+20240812/doc/fdl.texi 0000644 0001750 0001750 00000055610 13652433030 017711 0 ustar frankie frankie @c The GNU Free Documentation License.
@center Version 1.3, 3 November 2008
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
@uref{http://fsf.org/}
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, La@TeX{} input
format, SGML or XML using a publicly available
DTD, and standard-conforming simple HTML,
PostScript or PDF designed for human modification. Examples
of transparent image formats include PNG, XCF and
JPG@. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are
not generally available, and the machine-generated HTML,
PostScript or PDF produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
The ``publisher'' means any person or entity that distributes copies
of the Document to the public.
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@item
COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@item
MODIFICATIONS
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@item
COMBINING DOCUMENTS
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
You may not copy, modify, sublicense, or distribute the Document
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense, or distribute it is void, and
will automatically terminate your rights under this License.
However, if you cease all violation of this License, then your license
from a particular copyright holder is reinstated (a) provisionally,
unless and until the copyright holder explicitly and finally
terminates your license, and (b) permanently, if the copyright holder
fails to notify you of the violation by some reasonable means prior to
60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, receipt of a copy of some or all of the same material does
not give you any rights to use it.
@item
FUTURE REVISIONS OF THIS LICENSE
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License ``or any later version'' applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation. If the Document
specifies that a proxy can decide which future versions of this
License can be used, that proxy's public statement of acceptance of a
version permanently authorizes you to choose that version for the
Document.
@item
RELICENSING
``Massive Multiauthor Collaboration Site'' (or ``MMC Site'') means any
World Wide Web server that publishes copyrightable works and also
provides prominent facilities for anybody to edit those works. A
public wiki that anybody can edit is an example of such a server. A
``Massive Multiauthor Collaboration'' (or ``MMC'') contained in the
site means any set of copyrightable works thus published on the MMC
site.
``CC-BY-SA'' means the Creative Commons Attribution-Share Alike 3.0
license published by Creative Commons Corporation, a not-for-profit
corporation with a principal place of business in San Francisco,
California, as well as future copyleft versions of that license
published by that same organization.
``Incorporate'' means to publish or republish a Document, in whole or
in part, as part of another Document.
An MMC is ``eligible for relicensing'' if it is licensed under this
License, and if all works that were first published under this License
somewhere other than this MMC, and subsequently incorporated in whole
or in part into the MMC, (1) had no cover texts or invariant sections,
and (2) were thus incorporated prior to November 1, 2008.
The operator of an MMC Site may republish an MMC contained in the site
under CC-BY-SA on the same site at any time before August 1, 2009,
provided the MMC is eligible for relicensing.
@end enumerate
@page
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.''@: line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:
guile-commonmark-0.1.2+20240812/doc/guile-commonmark.texi 0000644 0001750 0001750 00000003127 13652433030 022406 0 ustar frankie frankie \input texinfo
@c %** start of header
@setfilename guile-commonmark.info
@documentencoding UTF-8
@include version.texi
@settitle Guile-CommonMark @value{VERSION}
@c %**end of header
@copying
This manual is for Guile-CommonMark (version @value{VERSION}, @value{UPDATED}),
which is a GNU Guile library for parsing and rendering CommonMark.
Copyright @copyright{} 2018 Erik Edrosa
@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
@end quotation
@end copying
@dircategory The Algorithmic Language Scheme
@direntry
* Guile-CommonMark: (guile-commonmark). CommonMark implementation.
@end direntry
@titlepage
@title Guile-CommonMark Reference Manual
@subtitle for version @value{VERSION}, @value{UPDATED}
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top Guile-CommonMark
This manual is for Guile-CommonMark (version @value{VERSION}, @value{UPDATED}),
which is a GNU Guile library for parsing and rendering CommonMark.
@end ifnottex
@menu
* Introduction::
* Installation::
* GNU Free Documentation License:: Copying and sharing this documentation.
@end menu
@node Introduction
@chapter Introduction
@node Installation
@chapter Installation
@node GNU Free Documentation License
@appendix GNU Free Documentation License
@include fdl.texi
@bye
guile-commonmark-0.1.2+20240812/doc/version.texi 0000644 0001750 0001750 00000000133 14641033025 020616 0 ustar frankie frankie @set UPDATED 30 April 2020
@set UPDATED-MONTH April 2020
@set EDITION 0.2
@set VERSION 0.2
guile-commonmark-0.1.2+20240812/doc/local.mk 0000644 0001750 0001750 00000000130 13652433030 017657 0 ustar frankie frankie
info_TEXINFOS = doc/guile-commonmark.texi
doc_guile_commonmark_TEXINFOS = doc/fdl.texi
guile-commonmark-0.1.2+20240812/COPYING 0000644 0001750 0001750 00000104513 13652433030 016534 0 ustar frankie frankie GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
guile-commonmark-0.1.2+20240812/NEWS 0000644 0001750 0001750 00000001663 13652433030 016202 0 ustar frankie frankie # -*- mode: org -*-
#+TITLE: guile-commonmark NEWS
* Changes in 0.2 (since 0.1)
This release update
** CommonMark changes
The changes make this implemenation now follows version 0.28 of the
CommonMark spec.
*** Tabs
Tabs are no longer expanded to spaces, however when parsing blocks
they behave like spaces with a tab stop of 4 characters.
*** Paragraphs
Spaces are now stripped from the end of paragraphs so that two or more
spaces will not become a hard line break.
*** Fenced code
Closing fences of fenced code blocks can now be longer than the
opening fence.
*** Link reference definitions
Link destinations can be enclosed in an opening < and >
** Bug fixes
*** Fix nonportable range expression for control characters
glibc 2.28 made some changes to the collation of Unicode characters
which affect regular expression ranges. This caused the regular
expression range for control characters to match charaacters it
shouldn't.
guile-commonmark-0.1.2+20240812/configure 0000755 0001750 0001750 00000360634 14641033013 017414 0 ustar frankie frankie #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for guile-commonmark 0.2.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
# Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="as_nop=:
if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" )
then :
else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
blah=\$(echo \$(echo blah))
test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
if (eval "$as_required") 2>/dev/null
then :
as_have_required=yes
else $as_nop
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
then :
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$as_shell as_have_required=yes
if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
then :
break 2
fi
fi
done;;
esac
as_found=false
done
IFS=$as_save_IFS
if $as_found
then :
else $as_nop
if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi
fi
if test "x$CONFIG_SHELL" != x
then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno
then :
printf "%s\n" "$0: This script requires a shell more modern than all"
printf "%s\n" "$0: the shells that I found on your system."
if test ${ZSH_VERSION+y} ; then
printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='guile-commonmark'
PACKAGE_TARNAME='guile-commonmark'
PACKAGE_VERSION='0.2'
PACKAGE_STRING='guile-commonmark 0.2'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
ac_unique_file="commonmark.scm"
ac_subst_vars='LTLIBOBJS
LIBOBJS
GUILE_TOOLS
GUILE_CONFIG
GUILD
GUILE
GUILE_EFFECTIVE_VERSION
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
CSCOPE
ETAGS
CTAGS
am__untar
am__tar
AMTAR
am__leading_dot
SET_MAKE
AWK
mkdir_p
MKDIR_P
INSTALL_STRIP_PROGRAM
STRIP
install_sh
MAKEINFO
AUTOHEADER
AUTOMAKE
AUTOCONF
ACLOCAL
VERSION
PACKAGE
CYGPATH_W
am__isrc
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_silent_rules
'
ac_precious_vars='build_alias
host_alias
target_alias
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures guile-commonmark 0.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
[DATAROOTDIR/doc/guile-commonmark]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of guile-commonmark 0.2:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
Some influential environment variables:
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for configure.gnu first; this name is used for a wrapper for
# Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
guile-commonmark configure 0.2
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
ac_configure_args_raw=
for ac_arg
do
case $ac_arg in
*\'*)
ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append ac_configure_args_raw " '$ac_arg'"
done
case $ac_configure_args_raw in
*$as_nl*)
ac_safe_unquote= ;;
*)
ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
ac_unsafe_a="$ac_unsafe_z#~"
ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
esac
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by guile-commonmark $as_me 0.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Sanitize IFS.
IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
printf "%s\n" "$as_me: caught signal $ac_signal"
printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
if test -n "$CONFIG_SITE"; then
ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
for ac_site_file in $ac_site_files
do
case $ac_site_file in #(
*/*) :
;; #(
*) :
ac_site_file=./$ac_site_file ;;
esac
if test -f "$ac_site_file" && test -r "$ac_site_file"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Auxiliary files required by this configure script.
ac_aux_files="missing install-sh"
# Locations in which to look for auxiliary files.
ac_aux_dir_candidates="${srcdir}/build-aux"
# Search for a directory containing all of the required auxiliary files,
# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
# If we don't find one directory that contains all the files we need,
# we report the set of missing files from the *first* directory in
# $ac_aux_dir_candidates and give up.
ac_missing_aux_files=""
ac_first_candidate=:
printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in $ac_aux_dir_candidates
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
as_found=:
printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
ac_aux_dir_found=yes
ac_install_sh=
for ac_aux in $ac_aux_files
do
# As a special case, if "install-sh" is required, that requirement
# can be satisfied by any of "install-sh", "install.sh", or "shtool",
# and $ac_install_sh is set appropriately for whichever one is found.
if test x"$ac_aux" = x"install-sh"
then
if test -f "${as_dir}install-sh"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
ac_install_sh="${as_dir}install-sh -c"
elif test -f "${as_dir}install.sh"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
ac_install_sh="${as_dir}install.sh -c"
elif test -f "${as_dir}shtool"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
ac_install_sh="${as_dir}shtool install -c"
else
ac_aux_dir_found=no
if $ac_first_candidate; then
ac_missing_aux_files="${ac_missing_aux_files} install-sh"
else
break
fi
fi
else
if test -f "${as_dir}${ac_aux}"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
else
ac_aux_dir_found=no
if $ac_first_candidate; then
ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
else
break
fi
fi
fi
done
if test "$ac_aux_dir_found" = yes; then
ac_aux_dir="$as_dir"
break
fi
ac_first_candidate=false
as_found=false
done
IFS=$as_save_IFS
if $as_found
then :
else $as_nop
as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
if test -f "${ac_aux_dir}config.guess"; then
ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
fi
if test -f "${ac_aux_dir}config.sub"; then
ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
fi
if test -f "$ac_aux_dir/configure"; then
ac_configure="$SHELL ${ac_aux_dir}configure"
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
am__api_version='1.16'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if test ${ac_cv_path_install+y}
then :
printf %s "(cached) " >&6
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
# Account for fact that we put trailing slashes in our PATH walk.
case $as_dir in #((
./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
printf %s "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
if test "$*" != "X $srcdir/configure conftest.file" \
&& test "$*" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
if test "$2" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$2" = conftest.file
)
then
# Ok.
:
else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
rm -f conftest.file
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $.
# By default was `s,x,x', remove it if useless.
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
# Expand $ac_aux_dir to an absolute path.
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
# Installed binaries are usually stripped using 'strip' when the user
# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the 'STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_STRIP+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$STRIP"; then
ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
printf "%s\n" "$STRIP" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_STRIP+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$ac_ct_STRIP"; then
ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
printf "%s\n" "$ac_ct_STRIP" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_STRIP" = x; then
STRIP=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
STRIP=$ac_ct_STRIP
fi
else
STRIP="$ac_cv_prog_STRIP"
fi
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
printf %s "checking for a race-free mkdir -p... " >&6; }
if test -z "$MKDIR_P"; then
if test ${ac_cv_path_mkdir+y}
then :
printf %s "(cached) " >&6
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir ('*'coreutils) '* | \
'BusyBox '* | \
'mkdir (fileutils) '4.1*)
ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
break 3;;
esac
done
done
done
IFS=$as_save_IFS
fi
test -d ./--version && rmdir ./--version
if test ${ac_cv_path_mkdir+y}; then
MKDIR_P="$ac_cv_path_mkdir -p"
else
# As a last resort, use the slow shell script. Don't cache a
# value for MKDIR_P within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
MKDIR_P="$ac_install_sh -d"
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
printf "%s\n" "$MKDIR_P" >&6; }
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_AWK+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
printf "%s\n" "$AWK" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$AWK" && break
done
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval test \${ac_cv_prog_make_${ac_make}_set+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
SET_MAKE=
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
# Check whether --enable-silent-rules was given.
if test ${enable_silent_rules+y}
then :
enableval=$enable_silent_rules;
fi
case $enable_silent_rules in # (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
printf %s "checking whether $am_make supports nested variables... " >&6; }
if test ${am_cv_make_support_nested_variables+y}
then :
printf %s "(cached) " >&6
else $as_nop
if printf "%s\n" 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AM_BACKSLASH='\'
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
am__isrc=' -I$(srcdir)'
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
# Define the identity of the package.
PACKAGE='guile-commonmark'
VERSION='0.2'
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
# Some tools Automake needs.
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
#
#
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar pax cpio none'
am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
# Variables for tags utilities; see am/tags.am
if test -z "$CTAGS"; then
CTAGS=ctags
fi
if test -z "$ETAGS"; then
ETAGS=etags
fi
if test -z "$CSCOPE"; then
CSCOPE=cscope
fi
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard:
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: .
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
fi
fi
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
printf "%s\n" "$PKG_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_ac_pt_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
PKG_CONFIG=""
fi
fi
_guile_versions_to_search="3.0 2.2 2.0"
if test -n "$GUILE_EFFECTIVE_VERSION"; then
_guile_tmp=""
for v in $_guile_versions_to_search; do
if test "$v" = "$GUILE_EFFECTIVE_VERSION"; then
_guile_tmp=$v
fi
done
if test -z "$_guile_tmp"; then
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "searching for guile development files for versions $_guile_versions_to_search, but previously found $GUILE version $GUILE_EFFECTIVE_VERSION
See \`config.log' for more details" "$LINENO" 5; }
fi
_guile_versions_to_search=$GUILE_EFFECTIVE_VERSION
fi
GUILE_EFFECTIVE_VERSION=""
_guile_errors=""
for v in $_guile_versions_to_search; do
if test -z "$GUILE_EFFECTIVE_VERSION"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for guile $v" >&5
printf "%s\n" "$as_me: checking for guile $v" >&6;}
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"guile-\$v\""; } >&5
($PKG_CONFIG --exists --print-errors "guile-$v") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
GUILE_EFFECTIVE_VERSION=$v
fi
fi
done
if test -z "$GUILE_EFFECTIVE_VERSION"; then
as_fn_error $? "
No Guile development packages were found.
Please verify that you have Guile installed. If you installed Guile
from a binary distribution, please verify that you have also installed
the development packages. If you installed it yourself, you might need
to adjust your PKG_CONFIG_PATH; see the pkg-config man page for more.
" "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found guile $GUILE_EFFECTIVE_VERSION" >&5
printf "%s\n" "$as_me: found guile $GUILE_EFFECTIVE_VERSION" >&6;}
_guile_required_version="$GUILE_EFFECTIVE_VERSION"
if test -z "$_guile_required_version"; then
_guile_required_version=3.0
fi
_guile_candidates=guile
_tmp=
for v in `echo "$_guile_required_version" | tr . ' '`; do
if test -n "$_tmp"; then _tmp=$_tmp.; fi
_tmp=$_tmp$v
_guile_candidates="guile-$_tmp guile$_tmp $_guile_candidates"
done
for ac_prog in $_guile_candidates
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_GUILE+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $GUILE in
[\\/]* | ?:[\\/]*)
ac_cv_path_GUILE="$GUILE" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_GUILE="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
GUILE=$ac_cv_path_GUILE
if test -n "$GUILE"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GUILE" >&5
printf "%s\n" "$GUILE" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$GUILE" && break
done
if test -z "$GUILE"; then
as_fn_error $? "guile required but not found" "$LINENO" 5
fi
_guile_suffix=`echo "$GUILE" | sed -e 's,^.*/guile\(.*\)$,\1,'`
_guile_effective_version=`$GUILE -c "(display (effective-version))"`
if test -z "$GUILE_EFFECTIVE_VERSION"; then
GUILE_EFFECTIVE_VERSION=$_guile_effective_version
elif test "$GUILE_EFFECTIVE_VERSION" != "$_guile_effective_version"; then
as_fn_error $? "found development files for Guile $GUILE_EFFECTIVE_VERSION, but $GUILE has effective version $_guile_effective_version" "$LINENO" 5
fi
_guile_major_version=`$GUILE -c "(display (major-version))"`
_guile_minor_version=`$GUILE -c "(display (minor-version))"`
_guile_micro_version=`$GUILE -c "(display (micro-version))"`
_guile_prog_version="$_guile_major_version.$_guile_minor_version.$_guile_micro_version"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Guile version >= $_guile_required_version" >&5
printf %s "checking for Guile version >= $_guile_required_version... " >&6; }
_major_version=`echo $_guile_required_version | cut -d . -f 1`
_minor_version=`echo $_guile_required_version | cut -d . -f 2`
_micro_version=`echo $_guile_required_version | cut -d . -f 3`
if test "$_guile_major_version" -gt "$_major_version"; then
true
elif test "$_guile_major_version" -eq "$_major_version"; then
if test "$_guile_minor_version" -gt "$_minor_version"; then
true
elif test "$_guile_minor_version" -eq "$_minor_version"; then
if test -n "$_micro_version"; then
if test "$_guile_micro_version" -lt "$_micro_version"; then
as_fn_error $? "Guile $_guile_required_version required, but $_guile_prog_version found" "$LINENO" 5
fi
fi
elif test "$GUILE_EFFECTIVE_VERSION" = "$_major_version.$_minor_version" -a -z "$_micro_version"; then
# Allow prereleases that have the right effective version.
true
else
as_fn_error $? "Guile $_guile_required_version required, but $_guile_prog_version found" "$LINENO" 5
fi
elif test "$GUILE_EFFECTIVE_VERSION" = "$_major_version.$_minor_version" -a -z "$_micro_version"; then
# Allow prereleases that have the right effective version.
true
else
as_fn_error $? "Guile $_guile_required_version required, but $_guile_prog_version found" "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $_guile_prog_version" >&5
printf "%s\n" "$_guile_prog_version" >&6; }
# Extract the first word of "guild$_guile_suffix", so it can be a program name with args.
set dummy guild$_guile_suffix; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_GUILD+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $GUILD in
[\\/]* | ?:[\\/]*)
ac_cv_path_GUILD="$GUILD" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_GUILD="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
GUILD=$ac_cv_path_GUILD
if test -n "$GUILD"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GUILD" >&5
printf "%s\n" "$GUILD" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
# Extract the first word of "guile-config$_guile_suffix", so it can be a program name with args.
set dummy guile-config$_guile_suffix; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_GUILE_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $GUILE_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_GUILE_CONFIG="$GUILE_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_GUILE_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
GUILE_CONFIG=$ac_cv_path_GUILE_CONFIG
if test -n "$GUILE_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GUILE_CONFIG" >&5
printf "%s\n" "$GUILE_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test -n "$GUILD"; then
GUILE_TOOLS=$GUILD
else
# Extract the first word of "guile-tools$_guile_suffix", so it can be a program name with args.
set dummy guile-tools$_guile_suffix; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_GUILE_TOOLS+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $GUILE_TOOLS in
[\\/]* | ?:[\\/]*)
ac_cv_path_GUILE_TOOLS="$GUILE_TOOLS" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_GUILE_TOOLS="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
GUILE_TOOLS=$ac_cv_path_GUILE_TOOLS
if test -n "$GUILE_TOOLS"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GUILE_TOOLS" >&5
printf "%s\n" "$GUILE_TOOLS" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test "x$GUILD" = "x"; then
as_fn_error $? "'guild' binary not found; please check your guile-2.x installation." "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if (srfi srfi-64) is available" >&5
printf %s "checking if (srfi srfi-64) is available... " >&6; }
$GUILE -c "(use-modules (srfi srfi-64)) (exit ((lambda () 0)))" > /dev/null 2>&1
ac_guile_module_required=$?
if test "$ac_guile_module_required" = "0" ; then ac_guile_module_required=yes ; else ac_guile_module_required=no ; fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_guile_module_required" >&5
printf "%s\n" "$ac_guile_module_required" >&6; }
if test "$ac_guile_module_required" = "no" ; then
as_fn_error $? "required guile module not found: (srfi srfi-64)" "$LINENO" 5
fi
ac_config_files="$ac_config_files Makefile"
ac_config_files="$ac_config_files pre-inst-env"
ac_config_files="$ac_config_files scripts/gcmark"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
ac_script='
:mline
/\\$/{
N
s,\\\n,,
b mline
}
t clear
:clear
s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
t quote
s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
t quote
b any
:quote
s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
s/\[/\\&/g
s/\]/\\&/g
s/\$/$$/g
H
:any
${
g
s/^\n//
s/\n/ /g
p
}
'
DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
printf %s "checking that generated files are newer than configure... " >&6; }
if test -n "$am_sleep_pid"; then
# Hide warnings about reused PIDs.
wait $am_sleep_pid 2>/dev/null
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
printf "%s\n" "done" >&6; }
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by guile-commonmark $as_me 0.2, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
Configuration files:
$config_files
Report bugs to the package provider."
_ACEOF
ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
guile-commonmark config.status 0.2
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
MKDIR_P='$MKDIR_P'
AWK='$AWK'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
printf "%s\n" "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"pre-inst-env") CONFIG_FILES="$CONFIG_FILES pre-inst-env" ;;
"scripts/gcmark") CONFIG_FILES="$CONFIG_FILES scripts/gcmark" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
eval set X " :F $CONFIG_FILES "
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
ac_MKDIR_P=$MKDIR_P
case $MKDIR_P in
[\\/$]* | ?:[\\/]* ) ;;
*/*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
s&@MKDIR_P@&$ac_MKDIR_P&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
esac
case $ac_file$ac_mode in
"pre-inst-env":F) chmod +x pre-inst-env ;;
"scripts/gcmark":F) chmod +x scripts/gcmark ;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
guile-commonmark-0.1.2+20240812/guix.scm 0000644 0001750 0001750 00000002710 13652433030 017155 0 ustar frankie frankie (use-modules (guix packages)
(guix licenses)
(guix build-system gnu)
(guix git-download)
(gnu packages guile)
(gnu packages autotools)
(gnu packages pkg-config)
(gnu packages texinfo))
(package
(name "guile-commonmark")
(version "6a1f15f")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/OrangeShark/guile-commonmark.git")
(commit version)))
(sha256
(base32
"04ms67pphlnk8fm1n5p7nkkz4hcnhyqdkrcg3fb1m6s2ynmca780"))))
(build-system gnu-build-system)
(arguments
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'bootstrap
(lambda _ (zero? (system* "sh" "bootstrap")))))))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
("texinfo" ,texinfo)
("pkg-config" ,pkg-config)))
(inputs
`(("guile" ,guile-3.0)))
(synopsis "CommonMark parser for Guile")
(description
"guile-commonmark is a library for parsing CommonMark, a fully specified
+variant of Markdown. The library is written in Guile Scheme and is designed
+to transform a CommonMark document to SXML. guile-commonmark tries to closely
+follow the @uref{http://commonmark.org/, CommonMark spec}, the main difference
+is no support for parsing block and inline level HTML.")
(home-page "https://github.com/OrangeShark/guile-commonmark")
(license lgpl3+))
guile-commonmark-0.1.2+20240812/bootstrap 0000755 0001750 0001750 00000000034 13652433030 017435 0 ustar frankie frankie #! /bin/sh
autoreconf -vif
guile-commonmark-0.1.2+20240812/guile.am 0000644 0001750 0001750 00000001412 13652433030 017117 0 ustar frankie frankie moddir=$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)
godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
GOBJECTS = $(SOURCES:%.scm=%.go)
nobase_dist_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES)
nobase_go_DATA = $(GOBJECTS)
# Make sure source files are installed first, so that the mtime of
# installed compiled files is greater than that of installed source
# files. See
#
# for details.
guile_install_go_files = install-nobase_goDATA
$(guile_install_go_files): install-nobase_dist_modDATA
CLEANFILES = $(GOBJECTS)
GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
SUFFIXES = .scm .go
.scm.go:
$(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILD) compile $(GUILE_WARNINGS) -o "$@" "$<"
guile-commonmark-0.1.2+20240812/Makefile.am 0000644 0001750 0001750 00000003721 13652433030 017534 0 ustar frankie frankie include guile.am
SOURCES = \
commonmark/utils.scm \
commonmark/common.scm \
commonmark/parser.scm \
commonmark/entities.scm \
commonmark/node.scm \
commonmark/blocks.scm \
commonmark/inlines.scm \
commonmark/sxml.scm \
commonmark.scm
TESTS = \
tests/node.scm \
tests/tabs.scm \
tests/blocks/paragraphs.scm \
tests/blocks/atx-headings.scm \
tests/blocks/block-quotes.scm \
tests/blocks/code-blocks.scm \
tests/blocks/fenced-code.scm \
tests/blocks/link-reference-definitions.scm \
tests/blocks/list-items.scm \
tests/blocks/lists.scm \
tests/blocks/setext-headings.scm \
tests/blocks/thematic-breaks.scm \
tests/inlines/code-spans.scm \
tests/inlines/emphasis.scm \
tests/inlines/backslash-escape.scm \
tests/inlines/softbreak.scm \
tests/inlines/hardbreak.scm \
tests/inlines/links.scm \
tests/inlines/images.scm \
tests/inlines/autolinks.scm \
tests/inlines/entities.scm
TEST_EXTENSIONS = .scm
SCM_LOG_DRIVER = \
$(top_builddir)/pre-inst-env \
$(GUILE) --no-auto-compile -e main \
$(top_srcdir)/build-aux/test-driver.scm
AM_SCM_LOG_DRIVER_FLAGS = --brief=yes
AM_SCM_LOG_FLAGS = --no-auto-compile -L "$(top_srcdir)"
include $(top_srcdir)/doc/local.mk
EXTRA_DIST = README.md \
pre-inst-env.in \
tests/utils.scm \
build-aux/test-driver.scm \
$(TESTS)
guile-commonmark-0.1.2+20240812/scripts/ 0000755 0001750 0001750 00000000000 14656402071 017172 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/scripts/gcmark.in 0000644 0001750 0001750 00000002247 13652433030 020765 0 ustar frankie frankie #!@GUILE@ --no-auto-compile
-*- scheme -*-
!#
;; Copyright (C) 2017 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (commonmark)
(ice-9 match)
(sxml simple))
(setlocale LC_ALL "")
(let ((args (command-line)))
(match args
((_ file-name)
(with-output-to-file (string-append file-name ".html")
(lambda ()
(sxml->xml (call-with-input-file file-name commonmark->sxml)))))
(_ (display "Requires file name"))))
guile-commonmark-0.1.2+20240812/tests/ 0000755 0001750 0001750 00000000000 13652433030 016637 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/tests/inlines/ 0000755 0001750 0001750 00000000000 13652433030 020300 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/tests/inlines/links.scm 0000644 0001750 0001750 00000127466 13652433030 022144 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines links)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines links")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(define (destination=? node-data destination)
(equal? (assq-ref node-data 'destination) destination))
(define (title=? node-data title)
(equal? (assq-ref node-data 'title) title))
(test-assert "parse-inlines, simple inline link"
(match (parse-inlines (make-paragraph "[link](/uri \"title\")"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/uri")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link title may be omitted"
(match (parse-inlines (make-paragraph "[link](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/uri")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link both the title and the destination may be omitted"
(match (parse-inlines (make-paragraph "[link]()"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link both the title and the destination may be omitted"
(match (parse-inlines (make-paragraph "[link](<>)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link the destination cannot contain spaces, even if enclosed in
pointy brackets"
(match (parse-inlines (make-paragraph "[link](/my uri)"))
(('document doc-data
('paragraph para-data
('text text-data "link](/my uri)")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link the destination cannot contain spaces, even if enclosed in
pointy brackets"
(match (parse-inlines (make-paragraph "[link]()"))
(('document doc-data
('paragraph para-data
('text text-data "/my uri>)")
('text text-data "<")
('text text-data "link](")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link the destination cannot contain line breaks, even if enclosed in
pointy brackets"
(match (parse-inlines (make-paragraph "[link](foo\nbar)"))
(('document doc-data
('paragraph para-data
('text text-data "bar)")
('softbreak break-data)
('text text-data "link](foo")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link the destination cannot contain line breaks, even if enclosed in
pointy brackets"
(match (parse-inlines (make-paragraph "[link]()"))
(('document doc-data
('paragraph para-data
('text text-data "bar>)")
('softbreak break-data)
('text text-data "foo")
('text text-data "<")
('text text-data "link](")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link parentheses inside the link destination may be escaped"
(match (parse-inlines (make-paragraph "[link](\\(foo\\))"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "(foo)")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link one level of balanced parentheses is allowed without escaping"
(match (parse-inlines (make-paragraph "[link]((foo)and(bar))"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "(foo)and(bar)")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link if you have parentheses within parentheses, you need to
escape or use the <...> form"
(match (parse-inlines (make-paragraph "[link](foo(and(bar)))"))
(('document doc-data
('paragraph para-data
('text text-data "link](foo(and(bar)))")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link if you have parentheses within parentheses, you need to
escape or use the <...> form"
(match (parse-inlines (make-paragraph "[link](foo(and\\(bar\\)))"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "foo(and(bar))")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link if you have parentheses within parentheses, you need to
escape or use the <...> form"
(match (parse-inlines (make-paragraph "[link]()"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "foo(and(bar))")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link parentheses and other symbols can also be escaped"
(match (parse-inlines (make-paragraph "[link](foo\\)\\:)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "foo):")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link can contain fragment identifiers and queries"
(match (parse-inlines (make-paragraph "[link](#fragment)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "#fragment")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link can contain fragment identifiers and queries"
(match (parse-inlines (make-paragraph "[link](http://example.com#fragment)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "http://example.com#fragment")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link can contain fragment identifiers and queries"
(match (parse-inlines (make-paragraph "[link](http://example.com?foo=3#frag)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "http://example.com?foo=3#frag")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link backslash before a non-escapable character is just
a backslash"
(match (parse-inlines (make-paragraph "[link](foo\\bar)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "foo\\bar")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link url-escaping should be left alone and entity and
numerical character references in the destination will be parsed into the corresponding
Unicode code points"
(match (parse-inlines (make-paragraph "[link](foo%20bä)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "foo%20bä")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link titles can often be parsed as destinations, if you
try to omit the destination and keep the title, you'll get unexpected results"
(match (parse-inlines (make-paragraph "[link](\"title\")"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "\"title\"")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link titles may be in double quotes"
(match (parse-inlines (make-paragraph "[link](/url \"title\")"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link titles may be in single quotes"
(match (parse-inlines (make-paragraph "[link](/url 'title')"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link titles may be in parentheses"
(match (parse-inlines (make-paragraph "[link](/url (title))"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link backslash escapes and entity and numeric character
references may be used in titles"
(match (parse-inlines (make-paragraph "[link](/url \"title \\\""\")"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/url")
(title=? link-data "title \"\"")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link nested balanced quotes are not allowed without escaping"
(match (parse-inlines (make-paragraph "[link](/url \"title \"and\" title\")"))
(('document doc-data
('paragraph para-data
('text text-data "link](/url \"title \"and\" title\")")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link but it is easy to work around this by using a different quote type"
(match (parse-inlines (make-paragraph "[link](/url 'title \"and\" title')"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/url")
(title=? link-data "title \"and\" title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link whitespace is allowed around the destination and title"
(match (parse-inlines (make-paragraph "[link]( /url\n \"title\" )"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "link"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link but it is not allowed between the link text and
the following parenthesis"
(match (parse-inlines (make-paragraph "[link] (/uri)"))
(('document doc-data
('paragraph para-data
('text text-data "link] (/uri)")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text may contain balanced brackets, but not
unbalanced ones, unless they are escaped"
(match (parse-inlines (make-paragraph "[link [foo [bar]]](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar]]")
('text text-data "[")
('text text-data "foo ")
('text text-data "[")
('text text-data "link "))))
(and (destination=? link-data "/uri")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text may contain balanced brackets, but not
unbalanced ones, unless they are escaped"
(match (parse-inlines (make-paragraph "[link] bar](/uri)"))
(('document doc-data
('paragraph para-data
('text text-data "link] bar](/uri)")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text may contain balanced brackets, but not
unbalanced ones, unless they are escaped"
(match (parse-inlines (make-paragraph "[link [bar](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar"))
('text text-data "link ")
('text text-data "[")))
(and (destination=? link-data "/uri")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text may contain balanced brackets, but not
unbalanced ones, unless they are escaped"
(match (parse-inlines (make-paragraph "[link \\[bar](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar")
('text text-data "[")
('text text-data "link "))))
(and (destination=? link-data "/uri")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(define (em? node-data)
(eq? (assq-ref node-data 'type) 'em))
(define (strong? node-data)
(eq? (assq-ref node-data 'type) 'strong))
(test-assert "parse-inlines, link text may contain inline content"
(match (parse-inlines (make-paragraph "[link *foo **bar** `#`*](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('emphasis em-data1
('code-span code-data "#")
('text text-data " ")
(emphasis em-data2
('text text-data "bar"))
('text text-data "foo "))
('text text-data "link "))))
(and (destination=? link-data "/uri")
(title=? link-data #f)
(em? em-data1)
(strong? em-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text may contain inline content"
(match (parse-inlines (make-paragraph "[](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('image image-data
('text text-data "moon")))))
(and (destination=? link-data "/uri")
(title=? link-data #f)
(destination=? image-data "moon.jpg")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, links may not contain other links at any level of nesting"
(match (parse-inlines (make-paragraph "[foo [bar](/uri)](/uri)"))
(('document doc-data
('paragraph para-data
('text text-data "](/uri)")
('link link-data
('text text-data "bar"))
('text text-data "foo ")
('text text-data "[")))
(and (destination=? link-data "/uri")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, links may not contain other links at any level of nesting"
(match (parse-inlines (make-paragraph "[foo *[bar [baz](/uri)](/uri)*](/uri)"))
(('document doc-data
('paragraph para-data
('text text-data "](/uri)")
('emphasis em-data
('text text-data "](/uri)")
('link link-data
('text text-data "baz"))
('text text-data "bar ")
('text text-data "["))
('text text-data "foo ")
('text text-data "[")))
(and (destination=? link-data "/uri")
(title=? link-data #f)
(em? em-data)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, links may not contain other links at any level of nesting"
(match (parse-inlines (make-paragraph "](uri2)](uri3)"))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "](uri2)")
('link link-data
('text text-data "foo"))
('text text-data "["))))
(and (destination=? link-data "uri1")
(title=? link-data #f)
(destination=? image-data "uri3")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text have higher precedence over emphasis"
(match (parse-inlines (make-paragraph "*[foo*](/uri)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "*")
('text text-data "foo"))
('text text-data "*")))
(and (destination=? link-data "/uri")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link text have higher precedence over emphasis"
(match (parse-inlines (make-paragraph "[foo *bar](baz*)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar")
('text text-data "*")
('text text-data "foo "))))
(and (destination=? link-data "baz*")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, brackets that aren't part of links do not take
precedence"
(match (parse-inlines (make-paragraph "*foo [bar* baz]"))
(('document doc-data
('paragraph para-data
('text text-data " baz]")
('emphasis em-data
('text text-data "bar")
('text text-data "[")
('text text-data "foo "))))
(em? em-data))
(x (pk 'fail x #f))))
(test-expect-fail 1)
(test-assert "parse-inlines, link these cases illustrate the precedence of HTML,
tags, code spans, and autolinks over link grouping"
(match (parse-inlines (make-paragraph "[foo "))
(('document doc-data
('paragraph para-data
('text text-data " baz]")
('emphasis em-data
('text text-data "bar")
('text text-data "[")
('text text-data "foo "))))
(em? em-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link these cases illustrate the precedence of HTML,
tags, code spans, and autolinks over link grouping"
(match (parse-inlines (make-paragraph "[foo`](/uri)`"))
(('document doc-data
('paragraph para-data
('code-span code-data "](/uri)")
('text text-data "foo")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, link these cases illustrate the precedence of HTML,
tags, code spans, and autolinks over link grouping"
(match (parse-inlines (make-paragraph "[foo"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "http://example.com/?search=](uri)"))
('text text-data "foo")
('text text-data "[")))
(destination=? link-data "http://example.com/?search=](uri)"))
(x (pk 'fail x #f))))
;; full reference links
(define (make-document text references)
(node-add-data
(make-node 'document '()
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text))))))
'link-references references))
(test-assert "parse-inlines, full reference link simple"
(match (parse-inlines (make-document "[foo][bar]"
'(("bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link may contain balanced brackets, but not
unbalanced ones, unless they are escaped"
(match (parse-inlines (make-document "[link [foo [bar]]][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar]]")
('text text-data "[")
('text text-data "foo ")
('text text-data "[")
('text text-data "link "))))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link may contain balanced brackets, but not
unbalanced ones, unless they are escaped"
(match (parse-inlines (make-document "[link \\[bar][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar")
('text text-data "[")
('text text-data "link "))))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text may contain inline content"
(match (parse-inlines (make-document "[link *foo **bar** `#`*][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('emphasis em-data1
('code-span code-data "#")
('text text-data " ")
('emphasis em-data2
('text text-data "bar"))
('text text-data "foo "))
('text text-data "link "))))
(and (destination=? link-data "/uri")
(em? em-data1)
(strong? em-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text may contain inline content"
(match (parse-inlines (make-document "[][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('image image-data
('text text-data "moon")))))
(and (destination=? link-data "/uri")
(title=? link-data #f)
(destination=? image-data "moon.jpg")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text may not contain other links,
at any level of nesting"
(match (parse-inlines (make-document "[foo [bar](/uri)][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data2
('text text-data "ref"))
('text text-data "]")
('link link-data1
('text text-data "bar"))
('text text-data "foo ")
('text text-data "[")))
(and (destination=? link-data1 "/uri")
(destination=? link-data2 "/uri")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text may not contain other links,
at any level of nesting"
(match (parse-inlines (make-document "[foo *bar [baz][ref]*][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data2
('text text-data "ref"))
('text text-data "]")
('emphasis em-data
('link link-data
('text text-data "baz"))
('text text-data "bar "))
('text text-data "foo ")
('text text-data "[")))
(and (destination=? link-data "/uri")
(em? em-data)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text precedence over emphasis grouping"
(match (parse-inlines (make-document "*[foo*][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "*")
('text text-data "foo"))
('text text-data "*")))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text precedence over emphasis grouping"
(match (parse-inlines (make-document "[foo *bar][ref]"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar")
('text text-data "*")
('text text-data "foo "))))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
(test-expect-fail 1)
(test-assert "parse-inlines, full reference link text precedence lower than HTML tags,
code spans, and autolinks"
(match (parse-inlines (make-document "[foo "
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar")
('text text-data "*")
('text text-data "foo "))))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text precedence lower than HTML tags,
code spans, and autolinks"
(match (parse-inlines (make-document "[foo`][ref]`"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('code-span code-data "][ref]")
('text text-data "foo")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link text precedence lower than HTML tags,
code spans, and autolinks"
(match (parse-inlines (make-document "[foo"
'(("ref" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "http://example.com/?search=][ref]"))
('text text-data "foo")
('text text-data "[")))
(and (destination=? link-data "http://example.com/?search=][ref]")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link matching is case-insensitive"
(match (parse-inlines (make-document "[foo][BaR]"
'(("bar" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
(setlocale LC_ALL "en_US.utf8")
(test-assert "parse-inlines, full reference link unicode case fold is used"
(match (parse-inlines (make-document "[Толпой][ТОЛПОЙ] is a Russian word."
'(("толпой" "/url" #f))))
(('document doc-data
('paragraph para-data
('text text-data " is a Russian word.")
('link link-data
('text text-data "Толпой"))))
(destination=? link-data "/url"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link no whitespace is allowed between the link text
and the link label"
(match (parse-inlines (make-document "[foo] [bar]"
'(("bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar"))
('text text-data "foo] ")
('text text-data "[")))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link no whitespace is allowed between the link text
and the link label"
(match (parse-inlines (make-document "[foo]\n[bar]"
'(("bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar"))
('softbreak break-data)
('text text-data "foo]")
('text text-data "[")))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link when there are multiple matching link
reference definitions, the first is used"
(match (parse-inlines (make-document "[bar][foo]"
'(("foo" "/url1" #f)
("foo" "/url2" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar"))))
(destination=? link-data "/url1"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link matching is performed on normalized strings,
not parsed inline content"
(match (parse-inlines (make-document "[bar][foo\\!]"
'(("foo!" "/url" #f))))
(('document doc-data
('paragraph para-data
('text text-data "]")
('text text-data "!")
('text text-data "foo")
('text text-data "[")
('text text-data "bar]")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, full reference link labels cannot contain brackets, unless
they are backslash-escaped"
(match (parse-inlines (make-document "[foo][ref\\[]"
'(("ref\\[" "/uri" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(destination=? link-data "/uri"))
(x (pk 'fail x #f))))
;; collapsed reference link
(test-assert "parse-inlines, simple collapsed reference link"
(match (parse-inlines (make-document "[foo][]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple collapsed reference link"
(match (parse-inlines (make-document "[*foo* bar][]"
'(("*foo* bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data " bar")
('emphasis em-data
('text text-data "foo")))))
(and (destination=? link-data "/url")
(title=? link-data "title")
(em? em-data)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, collapsed reference link labels are case-insensitive"
(match (parse-inlines (make-document "[Foo][]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "Foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, collapsed reference link, whitespace is not allowed between
the two sets of brackets"
(match (parse-inlines (make-document "[foo] \n[]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('text text-data "]")
('text text-data "[")
('softbreak break-data)
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
;; shortcut reference link
(test-assert "parse-inlines, shortcut reference link simple"
(match (parse-inlines (make-document "[foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link simple"
(match (parse-inlines (make-document "[*foo* bar]"
'(("*foo* bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data " bar")
('emphasis em-data
('text text-data "foo")))))
(and (destination=? link-data "/url")
(title=? link-data "title")
(em? em-data)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link simple"
(match (parse-inlines (make-document "[[*foo* bar]]"
'(("*foo* bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('text text-data "]")
('link link-data
('text text-data " bar")
('emphasis em-data
('text text-data "foo")))
('text text-data "[")))
(and (destination=? link-data "/url")
(title=? link-data "title")
(em? em-data)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link simple"
(match (parse-inlines (make-document "[[bar [foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))
('text text-data "bar ")
('text text-data "[")
('text text-data "[")))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link labels are case-insensitive"
(match (parse-inlines (make-document "[Foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "Foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link a space after the link text should
be preserved"
(match (parse-inlines (make-document "[foo] bar"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('text text-data " bar")
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link backslash-escape the opening bracket
to avoid links"
(match (parse-inlines (make-document "\\[foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('text text-data "foo]")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link note that this is a link,
because a link label ends with the first following closing bracket"
(match (parse-inlines (make-document "*[foo*]"
'(("foo*" "/url" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "*")
('text text-data "foo"))
('text text-data "*")))
(and (destination=? link-data "/url")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link, full references take precedence
over shortcut references"
(match (parse-inlines (make-document "[foo][bar]"
'(("foo" "/url1" #f)
("bar" "/url2" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/url2")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link, in the following case [bar][baz]
is parsed as a reference, [foo] as normal text"
(match (parse-inlines (make-document "[foo][bar][baz]"
'(("baz" "/url" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar"))
('text text-data "foo]")
('text text-data "[")))
(and (destination=? link-data "/url")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link, here [foo][bar] is parsed as a reference
since [bar] is defined"
(match (parse-inlines (make-document "[foo][bar][baz]"
'(("baz" "/url1" #f)
("bar" "/url2" #f))))
(('document doc-data
('paragraph para-data
('link link-data2
('text text-data "baz"))
('link link-data1
('text text-data "foo"))))
(and (destination=? link-data1 "/url2")
(title=? link-data1 #f)
(destination=? link-data2 "/url1")
(title=? link-data2 #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference link, here [foo] is not parsed as a shortcut
reference, because it is followed by a link label (even though [bar] is not defined)"
(match (parse-inlines (make-document "[foo][bar][baz]"
'(("baz" "/url1" #f)
("foo" "/url2" #f))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "bar"))
('text text-data "foo]")
('text text-data "[")))
(and (destination=? link-data "/url1")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/softbreak.scm 0000644 0001750 0001750 00000003715 13652433030 022772 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines softbreak)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines softbreak")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(test-assert "parse-inlines, any ASCII punctuation character may be backslashed-escaped"
(match (parse-inlines (make-paragraph "foo\nbaz"))
(('document doc-data
('paragraph para-data
('text text-data "baz")
('softbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, spaces at the end of the line and beginning of
the next line are removed"
(match (parse-inlines (make-paragraph "foo \n baz"))
(('document doc-data
('paragraph para-data
('text text-data "baz")
('softbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/backslash-escape.scm 0000644 0001750 0001750 00000015152 13652433030 024201 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines backslash)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (ice-9 i18n)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(setlocale LC_ALL "en_US.utf8")
(test-begin "inlines backslash")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(test-assert "parse-inlines, any ASCII punctuation character may be backslashed-escaped"
(match (parse-inlines (make-paragraph "\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\-\\.\\/"))
(('document doc-data
('paragraph para-data
('text text-data "/")
('text text-data ".")
('text text-data "-")
('text text-data ",")
('text text-data "+")
('text text-data "*")
('text text-data ")")
('text text-data "(")
('text text-data "'")
('text text-data "&")
('text text-data "%")
('text text-data "$")
('text text-data "#")
('text text-data "\"")
('text text-data "!")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, any ASCII punctuation character may be backslash-escaped"
(match (parse-inlines (make-paragraph "\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\_\\`\\{\\|\\}\\~"))
(('document doc-data
('paragraph para-data
('text text-data "~")
('text text-data "}")
('text text-data "|")
('text text-data "{")
('text text-data "`")
('text text-data "_")
('text text-data "^")
('text text-data "]")
('text text-data "[")
('text text-data "@")
('text text-data "?")
('text text-data ">")
('text text-data "=")
('text text-data "<")
('text text-data ";")
('text text-data ":")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, backslashes before other characters are treated as literal backslashes"
(match (parse-inlines (make-paragraph "\\→\\A\\a\\ \\3\\φ\\«"))
(('document doc-data
('paragraph para-data
('text text-data "«")
('text text-data "\\")
('text text-data "φ")
('text text-data "\\")
('text text-data "3")
('text text-data "\\")
('text text-data " ")
('text text-data "\\")
('text text-data "a")
('text text-data "\\")
('text text-data "A")
('text text-data "\\")
('text text-data "→")
('text text-data "\\")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, escaped characters are treated as regular characters and do not have
their usual Markdown meanings"
(match (parse-inlines (make-paragraph (string-append "\\*not emphasized*\n"
"\\ not a autolink\n"
"\\[not a link](/foo)\n"
"\\`not code`")))
(('document doc-data
('paragraph para-data
('text text-data "`")
('text text-data "not code")
('text text-data "`")
('softbreak softbreak-data)
('text text-data "not a link](/foo)")
('text text-data "[")
('softbreak softbreak-data)
('text text-data "http://example.com> not a autolink")
('text text-data "<")
('softbreak softbreak-data)
('text text-data "*")
('text text-data "not emphasized")
('text text-data "*")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, if a backslash is itself escaped, the following character is not"
(match (parse-inlines (make-paragraph "\\\\*emphasis*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "emphasis"))
('text text-data "\\")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, a backslash at the end of the line is a hard line break"
(match (parse-inlines (make-paragraph "foo\\\nbar"))
(('document doc-data
('paragraph para-data
('text text-data "bar")
('hardbreak hardbreak-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, backslash escapes do not work in code spans"
(match (parse-inlines (make-paragraph "`` \\[\\` ``"))
(('document doc-data
('paragraph para-data
('code-span code-data "\\[\\`")))
#t)
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/code-spans.scm 0000644 0001750 0001750 00000017035 13652433030 023046 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines code-spans)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines code-spans")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(test-assert "parse-inlines, simple code span"
(match (parse-inlines (make-paragraph "`foo`"))
(('document doc-data
('paragraph para-data
('code-span code-data
"foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, two backs ticks"
(match (parse-inlines (make-paragraph "`` foo ` bar ``"))
(('document doc-data
('paragraph para-data
('code-span code-data
"foo ` bar")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans stripping leading and trailing spaces"
(match (parse-inlines (make-paragraph "` `` `"))
(('document doc-data
('paragraph para-data
('code-span code-data
"``")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans line endings are treated like spaces"
(match (parse-inlines (make-paragraph "``\nfoo\n``"))
(('document doc-data
('paragraph para-data
('code-span code-data
"foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans interior spaces and line endings are collasped into single spaces"
(match (parse-inlines (make-paragraph "`foo bar\n baz`"))
(('document doc-data
('paragraph para-data
('code-span code-data
"foo bar baz")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans with two ticks inside"
(match (parse-inlines (make-paragraph "`foo `` bar`"))
(('document doc-data
('paragraph para-data
('code-span code-data
"foo `` bar")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, backslash escapes do not work in code spans"
(match (parse-inlines (make-paragraph "`foo\\`bar`"))
(('document doc-data
('paragraph para-data
('text text-data2
"`")
('text text-data
"bar")
('code-span code-data
"foo\\")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans backticks have higher precedence, emphasized text"
(match (parse-inlines (make-paragraph "*foo`*`"))
(('document doc-data
('paragraph para-data
('code-span code-data
"*")
('text text-data
"foo")
('text text-data
"*")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans backticks have higher precedence, link"
(match (parse-inlines (make-paragraph "[not a `link](/foo`)"))
(('document doc-data
('paragraph para-data
('text text-data2
")")
('code-span code-data
"link](/foo")
('text text-data
"not a ")
('text text-data "[")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, code spans have same precedence as HTML tags, code"
(match (parse-inlines (make-paragraph "``"))
(('document doc-data
('paragraph para-data
('text text-data1
"`")
('text text-data2
"\">")
('code-span code-data
"`"))
(('document doc-data
('paragraph para-data
('text text-data2
"\">`")
('code-span code-data
"`"))
(('document doc-data
('paragraph para-data
('text text-data1
"`")
('text text-data2
"baz>")
('code-span code-data
"`"))
(('document doc-data
('paragraph para-data
('text text-data2
"`")
('link link-data
('text text-data "http://foo.bar.`baz"))))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, backticks with no matching backtick are literal backticks"
(match (parse-inlines (make-paragraph "```foo``"))
(('document doc-data
('paragraph para-data
('text text-data3
"``")
('text text-data2
"foo")
('text text-data1
"```")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, backticks with no matching backtick are literal backticks"
(match (parse-inlines (make-paragraph "`foo"))
(('document doc-data
('paragraph para-data
('text text-data2
"foo")
('text text-data1
"`")))
#t)
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/hardbreak.scm 0000644 0001750 0001750 00000014117 13652433030 022733 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines hardbreak)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines hardbreak")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(test-assert "parse-inlines, A line break that is preceded by two or more spaces
and does not occur at the end of a block is parsed as a hard line break"
(match (parse-inlines (make-paragraph "foo \nbaz"))
(('document doc-data
('paragraph para-data
('text text-data "baz")
('hardbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, a backslash before the line ending may be used
instead of two spaces"
(match (parse-inlines (make-paragraph "foo\\\nbaz"))
(('document doc-data
('paragraph para-data
('text text-data "baz")
('hardbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, hardbreak more than two spaces can be used"
(match (parse-inlines (make-paragraph "foo \nbaz"))
(('document doc-data
('paragraph para-data
('text text-data "baz")
('hardbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, hardbreak leading spaces at the beginning of the next
are ignored"
(match (parse-inlines (make-paragraph "foo \n bar"))
(('document doc-data
('paragraph para-data
('text text-data "bar")
('hardbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, hardbreak leading spaces at the beginning of the next
are ignored"
(match (parse-inlines (make-paragraph "foo\\\n bar"))
(('document doc-data
('paragraph para-data
('text text-data "bar")
('hardbreak break-data)
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, line breaks can occur inside emphasis, links, and other
constructs that allow inline content"
(match (parse-inlines (make-paragraph "*foo \nbar*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "bar")
('hardbreak break-data)
('text text-data "foo"))))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, line breaks can occur inside emphasis, links, and other
constructs that allow inline content"
(match (parse-inlines (make-paragraph "*foo\\\nbar*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "bar")
('hardbreak break-data)
('text text-data "foo"))))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, line breaks do not occur inside code spans"
(match (parse-inlines (make-paragraph "`code \nspan`"))
(('document doc-data
('paragraph para-data
('code-span code-data "code span")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, line breaks do not occur inside code spans"
(match (parse-inlines (make-paragraph "`code\\\nspan`"))
(('document doc-data
('paragraph para-data
('code-span code-data "code\\ span")))
#t)
(x (pk 'fail x #f))))
(test-expect-fail 2)
(test-assert "parse-inlines, line breaks do not occur inside html tags"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('code-span code-data "code span")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, line breaks do not occur inside html tags"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('code-span code-data "code\\ span")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, hard line breaks do not work at the end of a paragraph or other
block element"
(match (parse-inlines (make-paragraph "foo\\"))
(('document doc-data
('paragraph para-data
('text text-data "\\")
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, hard line breaks do not work at the end of a paragraph or other
block element"
(match (parse-inlines (make-paragraph "foo "))
(('document doc-data
('paragraph para-data
('text text-data "foo")))
#t)
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/images.scm 0000644 0001750 0001750 00000026426 13652433030 022263 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines images)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines images")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(define (destination=? node-data destination)
(equal? (assq-ref node-data 'destination) destination))
(define (title=? node-data title)
(equal? (assq-ref node-data 'title) title))
(test-assert "parse-inlines, simple inline image"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "/url")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(define (make-document text references)
(node-add-data
(make-node 'document '()
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text))))))
'link-references references))
(test-assert "parse-inlines, full reference image"
(match (parse-inlines (make-document "![foo *bar*]"
'(("foo *bar*" "train.jpg" "\"train & tracks\""))))
(('document doc-data
('paragraph para-data
('image image-data
('emphasis em-data
('text text-data "bar"))
('text text-data "foo "))))
(and (destination=? image-data "train.jpg")
(title=? image-data "train & tracks")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, image can have inline images in image description"
(match (parse-inlines (make-paragraph "](/url2)"))
(('document doc-data
('paragraph para-data
('image image-data1
('image image-data2
('text text-data "bar"))
('text text-data "foo "))))
(and (destination=? image-data1 "/url2")
(title=? image-data1 #f)
(destination=? image-data2 "/url1")
(title=? image-data2 #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, image can have inline links in image description"
(match (parse-inlines (make-paragraph "](/url2)"))
(('document doc-data
('paragraph para-data
('image image-data
('link link-data
('text text-data "bar"))
('text text-data "foo "))))
(and (destination=? image-data "/url2")
(title=? image-data #f)
(destination=? link-data "/url1")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut reference image"
(match (parse-inlines (make-document "![foo *bar*][]"
'(("foo *bar*" "train.jpg" "\"train & tracks\""))))
(('document doc-data
('paragraph para-data
('image image-data
('emphasis em-data
('text text-data "bar"))
('text text-data "foo "))))
(and (destination=? image-data "train.jpg")
(title=? image-data "train & tracks")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, reference image reference case does not matter"
(match (parse-inlines (make-document "![foo *bar*][FOOBAR]"
'(("foobar" "train.jpg" "\"train & tracks\""))))
(('document doc-data
('paragraph para-data
('image image-data
('emphasis em-data
('text text-data "bar"))
('text text-data "foo "))))
(and (destination=? image-data "train.jpg")
(title=? image-data "train & tracks")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, image title not required"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "train.jpg")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, image whitespaces allowed between destination and title"
(match (parse-inlines (make-paragraph "My "))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo bar"))
('text text-data "My ")))
(and (destination=? image-data "/path/to/train.jpg")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, image destination can use <>"
(match (parse-inlines (make-paragraph "![foo]()"))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "url")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, image description can be empty"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('image image-data)))
(and (destination=? image-data "/url")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, reference image style"
(match (parse-inlines (make-document "![foo][bar]"
'(("bar" "/url" #f))))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "/url")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, reference image style"
(match (parse-inlines (make-document "![foo][BAR]"
'(("bar" "/url" #f))))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "/url")
(title=? image-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, collapsed image style"
(match (parse-inlines (make-document "![foo][]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "/url")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, collapsed image style"
(match (parse-inlines (make-document "![*foo* bar][]"
'(("*foo* bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data " bar")
('emphasis em-data
('text text-data "foo")))))
(and (destination=? image-data "/url")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, reference images, whitespace is not allowed between two sets
of brackets"
(match (parse-inlines (make-document "![foo] \n[]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('text text-data "]")
('text text-data "[")
('softbreak break-data)
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "/url")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut image style"
(match (parse-inlines (make-document "![foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data "foo"))))
(and (destination=? image-data "/url")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, shortcut image style"
(match (parse-inlines (make-document "![*foo* bar]"
'(("*foo* bar" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('image image-data
('text text-data " bar")
('emphasis em-data
('text text-data "foo")))))
(and (destination=? image-data "/url")
(title=? image-data "title")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, images if you just want bracketed text, you can
backslash-escape the opening ! and ["
(match (parse-inlines (make-document "\\!\\[foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('text text-data "foo]")
('text text-data "[")
('text text-data "!")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, images if you want a link after a literal !,
backslash-escape the !"
(match (parse-inlines (make-document "\\![foo]"
'(("foo" "/url" "\"title\""))))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))
('text text-data "!")))
(and (destination=? link-data "/url")
(title=? link-data "title")))
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/autolinks.scm 0000644 0001750 0001750 00000021771 13652433030 023025 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines autolinks)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines autolinks")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(define (destination=? node-data destination)
(equal? (assq-ref node-data 'destination) destination))
(define (title=? node-data title)
(equal? (assq-ref node-data 'title) title))
(test-assert "parse-inlines, simple autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "http://foo.bar.baz"))))
(and (destination=? link-data "http://foo.bar.baz")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "http://foo.bar.baz/test?q=hello&id=22&boolean"))))
(and (destination=? link-data "http://foo.bar.baz/test?q=hello&id=22&boolean")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "irc://foo.bar:2233/baz"))))
(and (destination=? link-data "irc://foo.bar:2233/baz")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks uppercase is also fine"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "MAILTO:FOO@BAR.BAZ"))))
(and (destination=? link-data "MAILTO:FOO@BAR.BAZ")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks note that many strings that count as absolute URIs for
purposes of this spec are not valid URIs"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "a+b+c:d"))))
(and (destination=? link-data "a+b+c:d")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks note that many strings that count as absolute URIs for
purposes of this spec are not valid URIs"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "made-up-scheme://foo,bar"))))
(and (destination=? link-data "made-up-scheme://foo,bar")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks note that many strings that count as absolute URIs for
purposes of this spec are not valid URIs"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "http://../"))))
(and (destination=? link-data "http://../")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks note that many strings that count as absolute URIs for
purposes of this spec are not valid URIs"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "localhost:5001/foo"))))
(and (destination=? link-data "localhost:5001/foo")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks spaces are not allowed"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('text text-data "http://foo.bar/baz bim>")
('text text-data "<")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, autolinks backslash-escpaes do not work inside autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "http://example.com/\\[\\"))))
(and (destination=? link-data "http://example.com/\\[\\")
(title=? link-data #f)))
(x (pk 'fail x #f))))
;; email autolinks
(test-assert "parse-inlines, simple email autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo@bar.example.com"))))
(and (destination=? link-data "mailto:foo@bar.example.com")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple email autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo+special@Bar.baz-bar0.com"))))
(and (destination=? link-data "mailto:foo+special@Bar.baz-bar0.com")
(title=? link-data #f)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, email autolinks backslash-escapes do not work inside"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('text text-data "@bar.example.com>")
('text text-data "+")
('text text-data "foo")
('text text-data "<")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, these are not autolinks"
(match (parse-inlines (make-paragraph "<>"))
(('document doc-data
('paragraph para-data
('text text-data ">")
('text text-data "<")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, these are not autolinks"
(match (parse-inlines (make-paragraph "< http://foo.bar >"))
(('document doc-data
('paragraph para-data
('text text-data " http://foo.bar >")
('text text-data "<")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, these are not autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('text text-data "m:abc>")
('text text-data "<")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, these are not autolinks"
(match (parse-inlines (make-paragraph ""))
(('document doc-data
('paragraph para-data
('text text-data "foo.bar.baz>")
('text text-data "<")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, these are not autolinks"
(match (parse-inlines (make-paragraph "http://example.com"))
(('document doc-data
('paragraph para-data
('text text-data "http://example.com")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, these are not autolinks"
(match (parse-inlines (make-paragraph "foo@bar.example.com"))
(('document doc-data
('paragraph para-data
('text text-data "foo@bar.example.com")))
#t)
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/emphasis.scm 0000644 0001750 0001750 00000170012 13652433030 022616 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines emphasis)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(test-begin "inlines emphasis")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(define (em? node-data)
(eq? 'em (assq-ref node-data 'type)))
(test-assert "parse-inlines, simple emphasis"
(match (parse-inlines (make-paragraph "*foo bar*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "foo bar"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because whitespace after *"
(match (parse-inlines (make-paragraph "a * foo bar*"))
(('document doc-data
('paragraph para-data
('text text-data1 "*")
('text text-data2 " foo bar")
('text text-data3 "*")
('text text-data4 "a ")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because punctuation after alphanumeric before"
(match (parse-inlines (make-paragraph "a*\"foo\"*"))
(('document doc-data
('paragraph para-data
('text text-data1 "*")
('text text-data2 "\"foo\"")
('text text-data3 "*")
('text text-data4 "a")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because unicode nonbreaking spaces count as whitespace"
(match (parse-inlines (make-paragraph "*\xa0a\xa0*"))
(('document doc-data
('paragraph para-data
('text text-data1 "*")
('text text-data2 "\xa0a\xa0")
('text text-data3 "*")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with intraword emphasis"
(match (parse-inlines (make-paragraph "foo*bar*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "bar"))
('text text-data "foo")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with intraword emphasis"
(match (parse-inlines (make-paragraph "5*6*78"))
(('document doc-data
('paragraph para-data
('text text-data "78")
('emphasis emphasis-data
('text text-data "6"))
('text text-data "5")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple _ emphasis"
(match (parse-inlines (make-paragraph "_foo bar_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "foo bar"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because punctuation after alphanumeric before"
(match (parse-inlines (make-paragraph "a_\"foo\"_"))
(('document doc-data
('paragraph para-data
('text text-data1 "_")
('text text-data2 "\"foo\"")
('text text-data3 "_")
('text text-data4 "a")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with _ is not allowed inside words"
(match (parse-inlines (make-paragraph "foo_bar_"))
(('document doc-data
('paragraph para-data
('text text-data1 "_")
('text text-data2 "bar")
('text text-data3 "_")
('text text-data4 "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with _ is not allowed inside words"
(match (parse-inlines (make-paragraph "5_6_78"))
(('document doc-data
('paragraph para-data
('text text-data1 "78")
('text text-data2 "_")
('text text-data3 "6")
('text text-data4 "_")
('text text-data5 "5")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with _ is not allowed inside words"
(match (parse-inlines (make-paragraph "пристаням_стремятся_"))
(('document doc-data
('paragraph para-data
('text text-data1 "_")
('text text-data2 "стремятся")
('text text-data3 "_")
('text text-data4 "пристаням")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with _ is not allowed to have delimiters to be both flanking"
(match (parse-inlines (make-paragraph "aa_\"bb\"_cc"))
(('document doc-data
('paragraph para-data
('text text-data1 "cc")
('text text-data2 "_")
('text text-data3 "\"bb\"")
('text text-data4 "_")
('text text-data5 "aa")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis with _ is allowed when preceded by punctuation"
(match (parse-inlines (make-paragraph "foo-_(bar)_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "(bar)"))
('text text-data2 "foo-")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis delimiters must match"
(match (parse-inlines (make-paragraph "_foo*"))
(('document doc-data
('paragraph para-data
('text text-data1 "*")
('text text-data2 "foo")
('text text-data3 "_")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis closing delimiter must not be preceded by whitespace"
(match (parse-inlines (make-paragraph "*foo bar *"))
(('document doc-data
('paragraph para-data
('text text-data1 "*")
('text text-data2 "foo bar ")
('text text-data3 "*")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because second * is not right-flanking delimiter run"
(match (parse-inlines (make-paragraph "*(*foo)"))
(('document doc-data
('paragraph para-data
('text text-data1 "foo)")
('text text-data2 "*")
('text text-data3 "(")
('text text-data4 "*")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis example showing previous restriction benefits"
(match (parse-inlines (make-paragraph "*(*foo*)*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 ")")
('emphasis emphasis-data2
('text text-data2 "foo"))
('text text-data3 "("))
))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword emphasis with * is allowed"
(match (parse-inlines (make-paragraph "*foo*bar"))
(('document doc-data
('paragraph para-data
('text text-data2 "bar")
('emphasis emphasis-data
('text text-data1 "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because the closing _ is preceded by whitespace"
(match (parse-inlines (make-paragraph "_foo bar _"))
(('document doc-data
('paragraph para-data
('text text-data1 "_")
('text text-data2 "foo bar ")
('text text-data3 "_")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not emphasis because the second _ is preceded by punctuation and
followed by an alphanumeric"
(match (parse-inlines (make-paragraph "_(_foo)"))
(('document doc-data
('paragraph para-data
('text text-data1 "foo)")
('text text-data2 "_")
('text text-data3 "(")
('text text-data4 "_")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis within emphasis"
(match (parse-inlines (make-paragraph "_(_foo_)_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 ")")
('emphasis emphasis-data2
('text text-data2 "foo"))
('text text-data3 "("))
))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, intraword emphasis is disallowed for _"
(match (parse-inlines (make-paragraph "_foo_bar"))
(('document doc-data
('paragraph para-data
('text text-data1 "bar")
('text text-data2 "_")
('text text-data3 "foo")
('text text-data4 "_")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, intraword emphasis is disallowed for _"
(match (parse-inlines (make-paragraph "_пристаням_стремятся"))
(('document doc-data
('paragraph para-data
('text text-data1 "стремятся")
('text text-data2 "_")
('text text-data3 "пристаням")
('text text-data4 "_")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, intraword emphasis is disallowed for _"
(match (parse-inlines (make-paragraph "_foo_bar_baz_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "baz")
('text text-data2 "_")
('text text-data3 "bar")
('text text-data4 "_")
('text text-data5 "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis closing delimiter is followed by punctuation"
(match (parse-inlines (make-paragraph "_(bar)_."))
(('document doc-data
('paragraph para-data
('text text-data1 ".")
('emphasis emphasis-data
('text text-data2 "(bar)"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(define (strong? node-data)
(eq? 'strong (assq-ref node-data 'type)))
(test-assert "parse-inlines, emphasis rule 5"
(match (parse-inlines (make-paragraph "**foo bar**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "foo bar"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because opening delimiter
is followed by whitespace"
(match (parse-inlines (make-paragraph "** foo bar**"))
(('document doc-data
('paragraph para-data
('text text-data1 "**")
('text text-data2 " foo bar")
('text text-data3 "**")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because opening ** is preceded
by an alphanumeric and followed by punctuation"
(match (parse-inlines (make-paragraph "a**\"foo\"**"))
(('document doc-data
('paragraph para-data
('text text-data1 "**")
('text text-data2 "\"foo\"")
('text text-data3 "**")
('text text-data4 "a") ))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis with ** is permitted"
(match (parse-inlines (make-paragraph "foo**bar**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "bar"))
('text text-data2 "foo")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 6"
(match (parse-inlines (make-paragraph "__foo bar__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "foo bar"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because opening delimiter
is followed by whitespace"
(match (parse-inlines (make-paragraph "__ foo bar__"))
(('document doc-data
('paragraph para-data
('text text-data1 "__")
('text text-data2 " foo bar")
('text text-data3 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because newline counts as whitespace"
(match (parse-inlines (make-paragraph "__\nfoo bar__"))
(('document doc-data
('paragraph para-data
('text text-data1 "__")
('text text-data2 "foo bar")
('softbreak break-data)
('text text-data3 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because the opening __ is preceded
by an alphanumeric and followed by punctuation"
(match (parse-inlines (make-paragraph "a__\"foo\"__"))
(('document doc-data
('paragraph para-data
('text text-data1 "__")
('text text-data2 "\"foo\"")
('text text-data3 "__")
('text text-data4 "a")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "foo__bar__"))
(('document doc-data
('paragraph para-data
('text text-data1 "__")
('text text-data2 "bar")
('text text-data3 "__")
('text text-data4 "foo")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "5__6__78"))
(('document doc-data
('paragraph para-data
('text text-data1 "78")
('text text-data2 "__")
('text text-data3 "6")
('text text-data4 "__")
('text text-data4 "5")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "пристаням__стремятся__"))
(('document doc-data
('paragraph para-data
('text text-data1 "__")
('text text-data2 "стремятся")
('text text-data3 "__")
('text text-data4 "пристаням")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "__foo, __bar__, baz__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 ", baz")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data3 "foo, "))))
(and (strong? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis is strong emphais because it is preceded by punctuation"
(match (parse-inlines (make-paragraph "foo-__(bar)__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "(bar)"))
('text text-data2 "foo-")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because closing delimiter
is preceded by whitespace"
(match (parse-inlines (make-paragraph "**foo bar **"))
(('document doc-data
('paragraph para-data
('text text-data1 "**")
('text text-data2 "foo bar ")
('text text-data3 "**")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis not strong emphasis because the second ** is preceded
by punctuation and followed by an alphanumeric"
(match (parse-inlines (make-paragraph "**(**foo)"))
(('document doc-data
('paragraph para-data
('text text-data1 "foo)")
('text text-data2 "**")
('text text-data3 "(")
('text text-data3 "**")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis restriction is appreciated with these examples"
(match (parse-inlines (make-paragraph "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.
*Asclepias physocarpa*)**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 ")")
('emphasis emphasis-data2
('text text-data2 "Asclepias physocarpa"))
('softbreak break-data)
('text text-data3 ", syn.")
('emphasis emphasis-data3
('text text-data4 "Gomphocarpus physocarpus"))
('text text-data5 "Gomphocarpus ("))))
(and (strong? emphasis-data1)
(em? emphasis-data2)
(em? emphasis-data3)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis restriction is appreciated with these examples"
(match (parse-inlines (make-paragraph "**foo \"*bar*\" foo**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "\" foo")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data3 "foo \""))))
(and (strong? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword emphasis"
(match (parse-inlines (make-paragraph "**foo**bar"))
(('document doc-data
('paragraph para-data
('text text-data2 "bar")
('emphasis emphasis-data1
('text text-data1 "foo"))))
(strong? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not strong emphasis because the closing delimiter is preceded
by whitespace"
(match (parse-inlines (make-paragraph "__foo bar __"))
(('document doc-data
('paragraph para-data
('text text-data1 "__")
('text text-data2 "foo bar ")
('text text-data3 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, not strong emphasis because the second __ is preceded
by punctuation and followed by an alphanumeric"
(match (parse-inlines (make-paragraph "__(__foo)"))
(('document doc-data
('paragraph para-data
('text text-data1 "foo)")
('text text-data2 "__")
('text text-data3 "(")
('text text-data3 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis restriction is appreciated with this examples"
(match (parse-inlines (make-paragraph "_(__foo__)_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 ")")
('emphasis emphasis-data2
('text text-data2 "foo"))
('text text-data3 "("))))
(and (em? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "__foo__bar"))
(('document doc-data
('paragraph para-data
('text text-data1 "bar")
('text text-data2 "__")
('text text-data3 "foo")
('text text-data4 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "__пристаням__стремятся"))
(('document doc-data
('paragraph para-data
('text text-data1 "стремятся")
('text text-data2 "__")
('text text-data3 "пристаням")
('text text-data4 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis intraword strong emphasis is forbidden with __"
(match (parse-inlines (make-paragraph "__foo__bar__baz__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "baz")
('text text-data2 "__")
('text text-data3 "bar")
('text text-data4 "__")
('text text-data5 "foo"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, strong emphasis, even though the closing delimiter is both
left- and right-flanking, because it is followed by punctuation"
(match (parse-inlines (make-paragraph "__(bar)__."))
(('document doc-data
('paragraph para-data
('text text-data1 ".")
('emphasis emphasis-data
('text text-data2 "(bar)"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(define (destination=? node-data destination)
(equal? (assq-ref node-data 'destination) destination))
(test-assert "parse-inlines, emphasis any nonempty sequence of inline elements can
be the contents of an emphasized span."
(match (parse-inlines (make-paragraph "*foo [bar](/url)*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('link link-data
('text text-data "bar"))
('text text-data2 "foo "))))
(and (em? emphasis-data)
(destination=? link-data "/url")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis any nonempty sequence of inline elements can
be the contents of an emphasized span."
(match (parse-inlines (make-paragraph "*foo\nbar*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "bar")
('softbreak break-data)
('text text-data "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, in particular, emphasis and strong emphasis can be nested
inside emphasis"
(match (parse-inlines (make-paragraph "_foo __bar__ baz_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " baz")
('emphasis emphasis-data2
('text text-data3 "bar"))
('text text-data2 "foo "))))
(and (em? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, in particular, emphasis and strong emphasis can be nested
inside emphasis"
(match (parse-inlines (make-paragraph "_foo _bar_ baz_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " baz")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data2 "foo "))))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, in particular, emphasis and strong emphasis can be nested
inside emphasis"
(match (parse-inlines (make-paragraph "__foo_ bar_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " bar")
('emphasis emphasis-data2
('text text-data2 "foo")))))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, in particular, emphasis and strong emphasis can be nested
inside emphasis"
(match (parse-inlines (make-paragraph "*foo *bar**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data1 "foo "))))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, in particular, emphasis and strong emphasis can be nested
inside emphasis"
(match (parse-inlines (make-paragraph "*foo **bar** baz*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " baz")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data3 "foo "))))
(and (em? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, internal delimiters can close emphasis"
(match (parse-inlines (make-paragraph "*foo**bar**baz*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "baz"))
('emphasis emphasis-data2
('text text-data2 "bar"))
('emphasis emphasis-data3
('text text-data3 "foo"))))
(and (em? emphasis-data1)
(em? emphasis-data2)
(em? emphasis-data3)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis in cases with spaces, they cannot"
(match (parse-inlines (make-paragraph "***foo** bar*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " bar")
('emphasis emphasis-data2
('text text-data2 "foo")))))
(and (em? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis in cases with spaces, they cannot"
(match (parse-inlines (make-paragraph "*foo **bar***"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data1 "foo "))))
(and (em? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis no strong emphasis because the opening
delimiter is closed by the first * before bar"
(match (parse-inlines (make-paragraph "*foo**bar***"))
(('document doc-data
('paragraph para-data
('text text-data3 "**")
('emphasis emphasis-data2
('text text-data2 "bar"))
('emphasis emphasis-data1
('text text-data1 "foo"))))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis indefinite levels of nesting are possible"
(match (parse-inlines (make-paragraph "*foo **bar *baz* bim** bop*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " bop")
('emphasis emphasis-data2
('text text-data2 " bim")
('emphasis emphasis-data3
('text text-data4 "baz"))
('text text-data5 "bar "))
('text text-data6 "foo "))))
(and (em? emphasis-data1)
(strong? emphasis-data2)
(em? emphasis-data3)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis indefinite levels of nesting are possible"
(match (parse-inlines (make-paragraph "*foo [*bar*](/url)*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('link link-data
('emphasis emphasis-data2
('text text-data5 "bar")))
('text text-data6 "foo "))))
(and (em? emphasis-data1)
(em? emphasis-data2)
(destination=? link-data "/url")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, there can be no empty emphasis or strong emphasis"
(match (parse-inlines (make-paragraph "** is not an empty emphasis"))
(('document doc-data
('paragraph para-data
('text text-data1 " is not an empty emphasis")
('text text-data2 "**")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, there can be no empty emphasis or strong emphasis"
(match (parse-inlines (make-paragraph "**** is not an empty strong emphasis"))
(('document doc-data
('paragraph para-data
('text text-data1 " is not an empty strong emphasis")
('text text-data2 "****")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, any nonempty sequence of inline elements can be the
contents of a strongly emphasized span"
(match (parse-inlines (make-paragraph "**foo [bar](/url)**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('link link-data
('text text-data "bar"))
('text text-data "foo "))))
(and (strong? emphasis-data1)
(destination=? link-data "/url")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, any nonempty sequence of inline elements can be the
contents of a strongly emphasized span"
(match (parse-inlines (make-paragraph "**foo\nbar**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data "bar")
('softbreak break-data)
('text text-data "foo"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis and strong emphasis can be nested inside strong
emphasis"
(match (parse-inlines (make-paragraph "__foo _bar_ baz__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " baz")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data3 "foo "))))
(and (strong? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis and strong emphasis can be nested inside strong
emphasis"
(match (parse-inlines (make-paragraph "__foo __bar__ baz__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " baz")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data3 "foo "))))
(and (strong? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis and strong emphasis can be nested inside strong
emphasis"
(match (parse-inlines (make-paragraph "____foo__ bar__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " bar")
('emphasis emphasis-data2
('text text-data2 "foo")))))
(and (strong? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis and strong emphasis can be nested inside strong
emphasis"
(match (parse-inlines (make-paragraph "**foo **bar****"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data1 "foo "))))
(and (strong? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis and strong emphasis can be nested inside strong
emphasis"
(match (parse-inlines (make-paragraph "**foo *bar* baz**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " baz")
('emphasis emphasis-data2
('text text-data2 "bar"))
('text text-data3 "foo "))))
(and (strong? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, internal delimiters can close emphasis"
(match (parse-inlines (make-paragraph "**foo*bar*baz**"))
(('document doc-data
('paragraph para-data
('text text-data "**")
('text text-data1 "baz")
('emphasis emphasis-data1
('text text-data2 "bar")
('emphasis emphasis-data2
('text text-data3 "foo")))))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, delimiters with spaces cannot close emphasis"
(match (parse-inlines (make-paragraph "***foo* bar**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " bar")
('emphasis emphasis-data2
('text text-data2 "foo")))))
(and (strong? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, delimiters with spaces cannot close emphasis"
(match (parse-inlines (make-paragraph "**foo *bar***"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('text text-data1 "bar"))
('text text-data2 "foo "))))
(and (strong? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis indefinite levels of nesting are possible"
(match (parse-inlines (make-paragraph "**foo *bar **baz**\nbim* bop**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data5 " bop")
('emphasis emphasis-data2
('text text-data4 "bim")
('softbreak break-data)
('emphasis emphasis-data3
('text text-data3 "baz"))
('text text-data1 "bar "))
('text text-data2 "foo "))))
(and (strong? emphasis-data1)
(em? emphasis-data2)
(strong? emphasis-data3)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis indefinite levels of nesting are possible"
(match (parse-inlines (make-paragraph "**foo [*bar*](/url)**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('link link-data
('emphasis emphasis-data2
('text text-data1 "bar")))
('text text-data2 "foo "))))
(and (strong? emphasis-data1)
(em? emphasis-data2)
(destination=? link-data "/url")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, there can be no empty emphasis or strong emphasis"
(match (parse-inlines (make-paragraph "__ is not an empty emphasis"))
(('document doc-data
('paragraph para-data
('text text-data1 " is not an empty emphasis")
('text text-data2 "__")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, there can be no empty emphasis or strong emphasis"
(match (parse-inlines (make-paragraph "____ is not an empty strong emphasis"))
(('document doc-data
('paragraph para-data
('text text-data1 " is not an empty strong emphasis")
('text text-data2 "____")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11"
(match (parse-inlines (make-paragraph "foo ***"))
(('document doc-data
('paragraph para-data
('text text-data1 "***")
('text text-data2 "foo ")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11"
(match (parse-inlines (make-paragraph "foo *\\**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "*"))
('text text-data2 "foo ")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11"
(match (parse-inlines (make-paragraph "foo *_*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "_"))
('text text-data2 "foo ")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11"
(match (parse-inlines (make-paragraph "foo *****"))
(('document doc-data
('paragraph para-data
('text text-data1 "*****")
('text text-data2 "foo ")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11"
(match (parse-inlines (make-paragraph "foo **\\***"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "*"))
('text text-data2 "foo ")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11"
(match (parse-inlines (make-paragraph "foo **_**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "_"))
('text text-data2 "foo ")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11 excess literal * characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "**foo*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "foo"))
('text text-data2 "*")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11 excess literal * characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "*foo**"))
(('document doc-data
('paragraph para-data
('text text-data2 "*")
('emphasis emphasis-data
('text text-data1 "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11 excess literal * characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "***foo**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "foo"))
('text text-data2 "*")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11 excess literal * characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "****foo*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "foo"))
('text text-data2 "***")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11 excess literal * characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "**foo***"))
(('document doc-data
('paragraph para-data
('text text-data2 "*")
('emphasis emphasis-data
('text text-data1 "foo"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 11 excess literal * characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "*foo****"))
(('document doc-data
('paragraph para-data
('text text-data2 "***")
('emphasis emphasis-data
('text text-data1 "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12"
(match (parse-inlines (make-paragraph "foo ___"))
(('document doc-data
('paragraph para-data
('text text-data1 "___")
('text text-data2 "foo ")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12"
(match (parse-inlines (make-paragraph "foo _\\__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "_"))
('text text-data2 "foo ")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12"
(match (parse-inlines (make-paragraph "foo _*_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "*"))
('text text-data2 "foo ")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12"
(match (parse-inlines (make-paragraph "foo _____"))
(('document doc-data
('paragraph para-data
('text text-data1 "_____")
('text text-data2 "foo ")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12"
(match (parse-inlines (make-paragraph "foo __\\___"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "_"))
('text text-data2 "foo ")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12"
(match (parse-inlines (make-paragraph "foo __*__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "*"))
('text text-data2 "foo ")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12 excess literal _ characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "__foo_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "foo"))
('text text-data2 "_")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12 excess literal _ characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "_foo__"))
(('document doc-data
('paragraph para-data
('text text-data2 "_")
('emphasis emphasis-data
('text text-data1 "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12 excess literal _ characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "___foo__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "foo"))
('text text-data2 "_")))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12 excess literal _ characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "____foo_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data
('text text-data1 "foo"))
('text text-data2 "___")))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12 excess literal _ characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "__foo___"))
(('document doc-data
('paragraph para-data
('text text-data2 "_")
('emphasis emphasis-data
('text text-data1 "foo"))))
(strong? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 12 excess literal _ characters
will appear outside of the emphasis"
(match (parse-inlines (make-paragraph "_foo____"))
(('document doc-data
('paragraph para-data
('text text-data2 "___")
('emphasis emphasis-data
('text text-data1 "foo"))))
(em? emphasis-data))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 13 can be applied to arbitrarily
long sequences of delimiters"
(match (parse-inlines (make-paragraph "******foo******"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('emphasis emphasis-data3
('text text-data1 "foo"))))))
(and (strong? emphasis-data1)
(strong? emphasis-data2)
(strong? emphasis-data3)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 14"
(match (parse-inlines (make-paragraph "***foo***"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('text text-data1 "foo")))))
(and (strong? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 14"
(match (parse-inlines (make-paragraph "_____foo_____"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('emphasis emphasis-data2
('emphasis emphasis-data3
('text text-data1 "foo"))))))
(and (strong? emphasis-data1)
(strong? emphasis-data2)
(em? emphasis-data3)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 15"
(match (parse-inlines (make-paragraph "*foo _bar* baz_"))
(('document doc-data
('paragraph para-data
('text text-data1 "_")
('text text-data2 " baz")
('emphasis emphasis-data1
('text text-data3 "bar")
('text text-data4 "_")
('text text-data5 "foo "))))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 15"
(match (parse-inlines (make-paragraph "**foo*bar**"))
(('document doc-data
('paragraph para-data
('text text-data1 "*")
('emphasis emphasis-data1
('text text-data2 "bar")
('emphasis emphasis-data2
('text text-data3 "foo")))))
(and (em? emphasis-data1)
(em? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 15"
(match (parse-inlines (make-paragraph "*foo __bar *baz bim__ bam*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 " bam")
('emphasis emphasis-data2
('text text-data3 "baz bim")
('text text-data4 "*")
('text text-data5 "bar "))
('text text-data2 "foo "))))
(and (em? emphasis-data1)
(strong? emphasis-data2)))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 16"
(match (parse-inlines (make-paragraph "**foo **bar baz**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "bar baz"))
('text text-data2 "foo ")
('text text-data3 "**")))
(strong? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 16"
(match (parse-inlines (make-paragraph "*foo *bar baz*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "bar baz"))
('text text-data2 "foo ")
('text text-data3 "*")))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "*[bar*](/url)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "*")
('text text-data2 "bar"))
('text text-data "*")))
(destination=? link-data "/url"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "_foo [bar_](/url)"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "_")
('text text-data2 "bar"))
('text text-data "foo ")
('text text-data "_")))
(destination=? link-data "/url"))
(x (pk 'fail x #f))))
(test-expect-fail 3)
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "*
"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "bar baz"))
('text text-data2 "foo ")
('text text-data3 "*")))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "**"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "bar baz"))
('text text-data2 "foo ")
('text text-data3 "*")))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "__"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('text text-data1 "bar baz"))
('text text-data2 "foo ")
('text text-data3 "*")))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "*a `*`*"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('code-span code-data1 "*")
('text text-data1 "a "))))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "_a `_`_"))
(('document doc-data
('paragraph para-data
('emphasis emphasis-data1
('code-span code-data1 "_")
('text text-data1 "a "))))
(em? emphasis-data1))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "**a"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data1 "http://foo.bar/?q**"))
('text text-data "a")
('text text-data "**")))
(destination=? link-data "http://foo.bar/?q**"))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, emphasis rule 17"
(match (parse-inlines (make-paragraph "__a"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data1 "http://foo.bar/?q=__"))
('text text-data "a")
('text text-data "__")))
(destination=? link-data "http://foo.bar/?q=__"))
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/inlines/entities.scm 0000644 0001750 0001750 00000013605 13652433030 022635 0 ustar frankie frankie ;; Copyright (C) 2016, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-inlines entities)
#:use-module (srfi srfi-64)
#:use-module (ice-9 match)
#:use-module (ice-9 i18n)
#:use-module (commonmark inlines)
#:use-module (commonmark node))
(setlocale LC_ALL "en_US.utf8")
(test-begin "inlines entities")
(define (make-paragraph text)
(make-node 'document #f
(list (make-node 'paragraph #f
(list (make-node 'text #f (list text)))))))
(test-assert "parse-inlines, simple entity references"
(match (parse-inlines (make-paragraph (string-append " & © Æ Ď\n"
"¾ ℋ ⅆ\n"
"∲ ≧̸")))
(('document doc-data
('paragraph para-data
('text text-data "≧̸")
('text text-data " ")
('text text-data "∲")
('softbreak break-data)
('text text-data "ⅆ")
('text text-data " ")
('text text-data "ℋ")
('text text-data " ")
('text text-data "¾")
('softbreak break-data)
('text text-data "Ď")
('text text-data " ")
('text text-data "Æ")
('text text-data " ")
('text text-data "©")
('text text-data " ")
('text text-data "&")
('text text-data " ")
('text text-data "\u00A0")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple decimal numeric character references"
(match (parse-inlines (make-paragraph "# Ӓ Ϡ "))
(('document doc-data
('paragraph para-data
('text text-data "�")
('text text-data " ")
('text text-data "�")
('text text-data " ")
('text text-data "Ϡ")
('text text-data " ")
('text text-data "Ӓ")
('text text-data " ")
('text text-data "#")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, simple hexadecimal numeric character references"
(match (parse-inlines (make-paragraph "" ആ ಫ"))
(('document doc-data
('paragraph para-data
('text text-data "ಫ")
('text text-data " ")
('text text-data "ആ")
('text text-data " ")
('text text-data "\"")))
#t)
(x (pk 'fail x #f))))
(test-assert "parse-inlines, here are some nonentities"
(match (parse-inlines (make-paragraph (string-append "  &x; \n"
"&ThisIsNotDefined; &hi?;")))
(('document doc-data
('paragraph para-data
('text text-data "hi?;")
('text text-data "&")
('text text-data "ThisIsNotDefined; ")
('text text-data "&")
('softbreak break-data)
('text text-data "#x;")
('text text-data "&")
('text text-data "#; ")
('text text-data "&")
('text text-data "x; ")
('text text-data "&")
('text text-data "nbsp ")
('text text-data "&")))
#t)
(x (pk 'fail x #f))))
(define (destination=? node-data destination)
(equal? (assq-ref node-data 'destination) destination))
(define (title=? node-data title)
(equal? (assq-ref node-data 'title) title))
(test-assert "parse-inlines, entity and numeric character references are recognized in any context
besides code spans or code blocks, including URLs, link titles, and fenced code block info strings"
(match (parse-inlines (make-paragraph "[foo](/föö \"föö\")"))
(('document doc-data
('paragraph para-data
('link link-data
('text text-data "foo"))))
(and (destination=? link-data "/föö")
(title=? link-data "föö")))
(x (pk 'fail x #f))))
(test-assert "parse-inlines, entity and numeric character references are treated as literal text in
code spans and code blocks"
(match (parse-inlines (make-paragraph "`föö`"))
(('document doc-data
('paragraph para-data
('code-span code-data
"föö")))
#t)
(x (pk 'fail x #f))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/ 0000755 0001750 0001750 00000000000 13652433030 020114 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/tests/blocks/code-blocks.scm 0000644 0001750 0001750 00000006241 13652433030 023010 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks code-blocks")
(block-expect "parse-blocks, indented code block"
" a simple
indented code block"
('document _ ('code-block _ "a simple\n indented code block")))
(block-expect "parse-blocks, indented code block, list takes precedence"
" - foo
bar"
('document
_ ('list
_ ('item _
('paragraph _ ('text _ "bar"))
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, indented code block, list takes precedence"
"1. foo
- bar"
('document
_ ('list _
('item _
('list _ ('item _ ('paragraph _ ('text _ "bar"))))
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, indented code block chunks separated by blank lines"
" chunk1
chunk2
chunk3"
('document _
('code-block _ "chunk1\n\nchunk2\n\n\n\nchunk3")))
(block-expect "parse-blocks, indented code block spaces beyond four are included even
blank lines"
" chunk1
chunk2"
('document _
('code-block _ "chunk1\n \n chunk2")))
(block-expect "parse-blocks, indented code block cannot interrupt a paragraph"
"Foo
bar"
('document _ ('paragraph _ ('text _ "Foo\nbar"))))
(block-expect "parse-blocks, indented code block any non-blank line with fewer than four
leading spaces ends code block immediately"
" foo
bar"
('document _
('paragraph _ ('text _ "bar"))
('code-block _ "foo")))
(block-expect "parse-blocks, indented code block can occur immediately before and after
other kinds of blocks"
"# Heading
foo
Heading
------
foo
----"
('document _
('thematic-break _)
('code-block _ "foo")
('heading _ ('text _ "Heading"))
('code-block _ "foo")
('heading _ ('text _ "Heading"))))
(block-expect "parse-blocks, indented code block, first line can be indented more than
four spaces"
" foo
bar"
('document _ ('code-block _ " foo\nbar")))
(block-expect "parse-blocks, indented code block, blank lines preceding
or following an indented code block are not included"
"
foo
"
('document _ ('code-block _ "foo")))
(block-expect "parse-blocks, indented code block trailing spaces are included"
" foo "
('document _ ('code-block _ "foo ")))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/paragraphs.scm 0000644 0001750 0001750 00000004573 13652433030 022761 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks paragraphs")
(block-expect "parse-blocks, simple paragraph"
"aaa
bbb"
('document _
('paragraph _ ('text _ "bbb"))
('paragraph _ ('text _ "aaa"))))
(block-expect "parse-blocks, paragraph can contain multiple lines, but no blank lines"
"aaa
bbb
ccc
ddd"
('document _
('paragraph _ ('text _ "ccc\nddd"))
('paragraph _ ('text _ "aaa\nbbb"))))
(block-expect "parse-blocks, multiple blank lines between paragraph have no effect"
"aaa
bbb"
('document _
('paragraph _ ('text _ "bbb"))
('paragraph _ ('text _ "aaa"))))
(block-expect "parse-blocks, paragraph leading spaces are skipped"
" aaa\n bbb"
('document _
('paragraph _ ('text _ "aaa\nbbb"))))
(block-expect "parse-blocks, paragraph lines after the first may be indented any amount"
"aaa
bbb
ccc"
('document _
('paragraph _ ('text _ "aaa\nbbb\nccc"))))
(block-expect "parse-blocks, paragraph the first line may be indented at most three spaces"
" aaa
bbb"
('document _
('paragraph _ ('text _ "aaa\nbbb"))))
(block-expect "parse-blocks, paragraph the first line may be indented at most three spaces"
" aaa
bbb"
('document _
('paragraph _ ('text _ "bbb"))
('code-block _ "aaa")))
(block-expect "parse-blocks, paragraph final spaces are stripped before inline parsing"
"aaa
bbb "
('document _
('paragraph _ ('text _ "aaa \nbbb"))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/fenced-code.scm 0000644 0001750 0001750 00000013065 13652433030 022761 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(srfi srfi-1)
(srfi srfi-26)
(ice-9 match)
(commonmark blocks)
(tests utils))
(test-begin "blocks fenced-code")
(block-expect "parse-blocks, fenced code simple"
"```
<
>
```"
('document _
('fenced-code _ "<\n >")))
(block-expect "parse-blocks, fenced code simple with tildes"
"~~~
<
>
~~~"
('document _
('fenced-code _ "<\n >")))
(block-expect "parse-blocks, fenced code must use the same character as the opening"
"```
aaa
~~~
```"
('document _
('fenced-code _ "aaa\n~~~")))
(block-expect "parse-blocks, fenced code must use the same character as the opening"
"~~~
aaa
```
~~~"
('document _
('fenced-code _ "aaa\n```")))
(block-expect "parse-blocks, fenced code closing fence must be at least as long as
the opening fence"
"````
aaa
```
``````"
('document _
('fenced-code _ "aaa\n```")))
(block-expect "parse-blocks, fenced code closing fence must be at least as long as
the opening fence"
"~~~~
aaa
~~~
~~~~"
('document _
('fenced-code _ "aaa\n~~~")))
(block-expect "parse-blocks, fenced code unclosed code blocks are closed by the end of
the document"
"```"
('document _
('fenced-code _)))
(block-expect "parse-blocks fenced code unclosed code blocks are closed by the end of
the document"
"`````
```
aaa"
('document _
('fenced-code _ "\n```\naaa")))
(block-expect "parse-blocks, fenced code unclosed code blocks are closed by the end of
block quote"
"> ```
> aaa
bbb"
('document _
('paragraph _ ('text _ "bbb"))
('block-quote _
('fenced-code _ "aaa"))))
(block-expect "parse-blocks, fenced code can have all empty lines as its content"
"```
```"
('document _
('fenced-code _ "\n ")))
(block-expect "parse-blocks, fenced code can be empty"
"```
```"
('document _
('fenced-code _)))
(block-expect "parse-blocks, fenced code can be indented with equivalent opening
indentation removed"
" ```
aaa
aaa
```"
('document _
('fenced-code _ "aaa\naaa")))
(block-expect "parse-blocks, fenced code can be indented with equivalent opening
indentation removed"
" ```
aaa
aaa
aaa
```"
('document _
('fenced-code _ "aaa\naaa\naaa")))
(block-expect "parse-blocks, fenced code can be indented with equivalent opening
indentation removed"
" ```
aaa
aaa
aaa
```"
('document _
('fenced-code _ "aaa\n aaa\naaa")))
(block-expect "parse-blocks, fenced code four spaces indentation produces code-block"
" ```
aaa
```"
('document _
('code-block _ "```\naaa\n```")))
(block-expect "parse-blocks, fenced code closing fence may be indented by 0-3 spaces
and does not need to match opening fence indentation"
"```
aaa
```"
('document _
('fenced-code _ "aaa")))
(block-expect "parse-blocks, fenced code closing fence may be indented by 0-3 spaces
and does not need to match opening fence indentation"
" ```
aaa
```"
('document _
('fenced-code _ "aaa")))
(block-expect "parse-blocks, fenced code not a closing fence because it is indented 4 spaces"
"```
aaa
```"
('document _
('fenced-code _ "aaa\n ```")))
(block-expect "parse-blocks, fenced code fences cannot contain internal spaces"
"``` ```
aaa"
('document _
('paragraph _ ('text _ "``` ```\naaa"))))
(block-expect "parse-blocks, fenced code fences cannot contain internal spaces"
"~~~~~~
aaa
~~~ ~~~"
('document _
('fenced-code _ "aaa\n~~~ ~~~")))
(block-expect "parse-blocks, fenced code can interrupt paragraphs, and can be followed
by paragraphs, without a blank line between"
"foo
```
bar
```
baz"
('document _
('paragraph _ ('text _ "baz"))
('fenced-code _ "bar")
('paragraph _ ('text _ "foo"))))
(block-expect "parse-blocks, fenced code, other blocks can occur before and after fenced code
blocks without a blank line"
"foo
---
~~~
bar
~~~
# baz"
('document _
('heading _ ('text _ "baz"))
('fenced-code _ "bar")
('heading _ ('text _ "foo"))))
(block-expect "parse-blocks, fenced code info string"
"```ruby
def foo(x)
return 3
end
```"
('document _
('fenced-code code-data "def foo(x)\n return 3\nend"))
(info-string code-data) "ruby")
(block-expect "parse-blocks, fenced code info strings backtick code blocks cannot
contain backticks"
"``` aa ```
foo"
('document _
('paragraph _ ('text _ "``` aa ```\nfoo"))))
(block-expect "parse-blocks, fenced code closing fences cannot have info strings"
"```
``` aaa
```"
('document _
('fenced-code _ "``` aaa")))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/list-items.scm 0000644 0001750 0001750 00000033475 13652433030 022726 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks list-items")
(block-expect "parse-blocks, list item basic case"
"1. A paragraph
with two lines.
indented code
> A block quote."
('document _
('list _
('item _
('block-quote _
('paragraph _ ('text _ "A block quote.")))
('code-block _ "indented code")
('paragraph _ ('text _ "A paragraph\nwith two lines."))))))
(block-expect "parse-blocks, list item content must be indented enough to be part of the item"
"- one
two"
('document _
('paragraph _ ('text _ "two"))
('list _ ('item _ ('paragraph _ ('text _ "one"))))))
(block-expect "parse-blocks, list item content must be indented enough to be part of the item"
"- one
two"
('document _
('list _
('item _
('paragraph _ ('text _ "two"))
('paragraph _ ('text _ "one"))))))
(block-expect "parse-blocks, list item content must be indented enough to be part of the item"
" - one
two"
('document _
('code-block _ " two")
('list _ ('item _ ('paragraph _ ('text _ "one"))))))
(block-expect "parse-blocks, list item content must be indented enough to be part of the item"
" - one
two"
('document _
('list _
('item _
('paragraph _ ('text _ "two"))
('paragraph _ ('text _ "one"))))))
(block-expect "parse-blocks, list item content must be indented enough to be part of the item
not column"
" > > 1. one
>>
>> two"
('document
_ ('block-quote
_ ('block-quote
_ ('list
_ ('item _
('paragraph _ ('text _ "two"))
('paragraph _ ('text _ "one"))))))))
(block-expect "parse-blocks, list item content must be indented enough to be part of the item
not column"
">>- one
>>
> > two"
('document
_ ('block-quote
_ ('block-quote _
('paragraph _ ('text _ "two"))
('list _ ('item _ ('paragraph _ ('text _ "one"))))))))
(block-expect "parse-blocks, list item needs one space after the list marker"
"-one
2.two"
('document _
('paragraph _ ('text _ "2.two"))
('paragraph _ ('text _ "-one"))))
(block-expect "parse-blocks, list item may contain blocks separated by more than one blank
line"
"- foo
bar"
('document _
('list _
('item _
('paragraph _ ('text _ "bar"))
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item may contain any kind of block"
"1. foo
```
bar
```
baz
> bam"
('document _
('list _
('item _
('block-quote _ ('paragraph _ ('text _ "bam")))
('paragraph _ ('text _ "baz"))
('fenced-code _ "bar")
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item contains indented code block preserve empty lines"
"- Foo
bar
baz"
('document _
('list _
('item _
('code-block _ "bar\n\n\nbaz")
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item start numbers must be nine digits or less"
"123456789. ok"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "ok")))))
(list-start list-data) 123456789)
(block-expect "parse-blocks, list item start numbers must be nine digits or less"
"1234567890. not ok"
('document _
('paragraph _ ('text _ "1234567890. not ok"))))
(block-expect "parse-blocks, list item may begin with 0s"
"0. ok"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "ok")))))
(list-start list-data) 0)
(block-expect "parse-blocks, list item may begin with 0s"
"003. ok"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "ok")))))
(list-start list-data) 3)
(block-expect "parse-blocks, list item number may not be negative"
"-1. not ok"
('document _ ('paragraph _ ('text _ "-1. not ok"))))
(block-expect "parse-blocks, list item code block must be indented four spaces beyond the edge"
"- foo
bar"
('document _
('list _
('item _
('code-block _ "bar")
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item code block must be indented four spaces beyond the edge"
" 10. foo
bar"
('document _
('list _
('item _
('code-block _ "bar")
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item if code block is first block, contents must be indented
one space after"
"1. indented code
paragraph
more code"
('document _
('list _
('item _
('code-block _ "more code")
('paragraph _ ('text _ "paragraph"))
('code-block _ "indented code")))))
(block-expect "parse-blocks, list item if code block is first block, additional space inside
code block"
"1. indented code
paragraph
more code"
('document _
('list _
('item _
('code-block _ "more code")
('paragraph _ ('text _ "paragraph"))
('code-block _ " indented code")))))
(block-expect "parse-blocks, list item does not not apply with three-space indent"
"- foo
bar"
('document _
('paragraph _ ('text _ "bar"))
('list _ ('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item can start with a blank line"
"-
foo
-
```
bar
```
-
baz"
('document _
('list _
('item _ ('code-block _ "baz"))
('item _ ('fenced-code _ "bar"))
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item blank line, the number of spaces does not change
required indentation"
"-
foo"
('document _
('list _
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item can begin with at most one blank line"
"-
foo"
('document _
('paragraph _ ('text _ "foo"))
('list _ ('item _))))
(block-expect "parse-blocks, list item empty bullet list item"
"- foo
-
- bar"
('document _
('list _
('item _ ('paragraph _ ('text _ "bar")))
('item _)
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item empty bullet list item space does not matter after list marker"
"- foo
-
- bar"
('document _
('list _
('item _ ('paragraph _ ('text _ "bar")))
('item _)
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item empty ordered list item"
"1. foo
2.
3. bar"
('document _
('list _
('item _ ('paragraph _ ('text _ "bar")))
('item _)
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, a list may start or end with an empty list item"
"*"
('document _
('list _
('item _))))
(block-expect "parse-blocks, an empty list item cannot interrupt a paragraph"
"foo
*
foo
1."
('document _
('paragraph _ ('text "foo\n1."))
('paragraph _ ('text "foo\n*"))))
(block-expect "parse-blocks, list item indented one space"
" 1. A paragraph
with two lines.
indented code
> A block quote."
('document _
('list _
('item _
('block-quote _ ('paragraph _ ('text _ "A block quote.")))
('code-block _ "indented code")
('paragraph _ ('text _ "A paragraph\nwith two lines."))))))
(block-expect "parse-blocks, list item indented two spaces"
" 1. A paragraph
with two lines.
indented code
> A block quote."
('document _
('list _
('item _
('block-quote _ ('paragraph _ ('text _ "A block quote.")))
('code-block _ "indented code")
('paragraph _ ('text _ "A paragraph\nwith two lines."))))))
(block-expect "parse-blocks, list item indented three spaces"
" 1. A paragraph
with two lines.
indented code
> A block quote."
('document _
('list _
('item _
('block-quote _ ('paragraph _ ('text _ "A block quote.")))
('code-block _ "indented code")
('paragraph _ ('text _ "A paragraph\nwith two lines."))))))
(block-expect "parse-blocks, list item indented four spaces gives a code block"
" 1. A paragraph
with two lines.
indented code
> A block quote."
('document _
('code-block _ "1. A paragraph
with two lines.
indented code
> A block quote.")))
(block-expect "parse-blocks, list item lazy continuation lines"
" 1. A paragraph
with two lines.
indented code
> A block quote."
('document _
('list _
('item _
('block-quote _ ('paragraph _ ('text _ "A block quote.")))
('code-block _ "indented code")
('paragraph _ ('text _ "A paragraph\nwith two lines."))))))
(block-expect "parse-blocks, list item identation can be partially deleted"
" 1. A paragraph
with two lines."
('document _
('list _
('item _
('paragraph _ ('text _ "A paragraph\nwith two lines."))))))
(block-expect "parse-blocks, list item lazy continuation in nested structures"
"> 1. > Blockquote
continued here."
('document
_ ('block-quote
_ ('list
_ ('item _ ('block-quote _ ('paragraph _ ('text _ "Blockquote\ncontinued here."))))))))
(block-expect "parse-blocks, list item lazy continuation in nested structures"
"> 1. > Blockquote
> continued here."
('document
_ ('block-quote
_ ('list
_ ('item _ ('block-quote _ ('paragraph _ ('text _ "Blockquote\ncontinued here."))))))))
(block-expect "parse-blocks, list item with sublists need to be indented"
"- foo
- bar
- baz
- boo"
('document
_ ('list
_ ('item
_ ('list
_ ('item
_ ('list
_ ('item
_ ('list
_ ('item _ ('paragraph _ ('text _ "boo"))))
('paragraph _ ('text _ "baz"))))
('paragraph _ ('text _ "bar"))))
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item with sublists need to be indented, one is not enough"
"- foo
- bar
- baz
- boo"
('document _
('list _
('item _ ('paragraph _ ('text _ "boo")))
('item _ ('paragraph _ ('text _ "baz")))
('item _ ('paragraph _ ('text _ "bar")))
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item with sublists need to be indented, need four here"
"10) foo
- bar"
('document _
('list _
('item _
('list _ ('item _ ('paragraph _ ('text _ "bar"))))
('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item with sublists need to be indented, three not enough here"
"10) foo
- bar"
('document _
('list _ ('item _ ('paragraph _ ('text _ "bar"))))
('list _ ('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list item may have a list as the first block"
"- - foo"
('document _
('list _ ('item _ ('list _ ('item _ ('paragraph _ ('text _ "foo"))))))))
(block-expect "parse-blocks, list item may have a list as the first block"
"1. - 2. foo"
('document
_ ('list
_ ('item
_ ('list
_ ('item
_ ('list
_ ('item _ ('paragraph _ ('text _ "foo"))))))))))
(block-expect "parse-blocks, list item can contain a heading"
"- # Foo
- Bar
---
baz"
('document _
('list _
('item _
('paragraph _ ('text _ "baz"))
('heading _ ('text _ "Bar")))
('item _ ('heading _ ('text _ "Foo"))))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/link-reference-definitions.scm 0000644 0001750 0001750 00000013774 13652433030 026036 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-1)
(srfi srfi-26)
(srfi srfi-64)
(tests utils))
(test-begin "blocks link-reference-definitions")
(define (link-reference? link-reference document-data)
(any (cut equal? link-reference <>) (link-references document-data)))
(block-expect "parse-blocks, link reference definition simple"
"[foo]: /url \"title\"\n\n[foo]"
('document doc-data
('paragraph _ ('text _ "[foo]")))
(link-reference? '("foo" "/url" "\"title\"") doc-data) #true)
(block-expect "parse-blocks, link reference definition multiline"
" [foo]: \n /url \n 'the title' \n\n[foo]"
('document doc-data
('paragraph _ ('text _ "[foo]")))
(link-reference? '("foo" "/url" "'the title'") doc-data) #true)
(block-expect "parse-blocks, link reference definition with parens and escapes"
"[Foo*bar\\]]:my_(url) 'title (with parens)'\n\n[Foo*bar\\]]"
('document doc-data
('paragraph _ ('text _ "[Foo*bar\\]]")))
(link-reference? '("foo*bar\\]" "my_(url)" "'title (with parens)'") doc-data) #true)
(block-expect "parse-blocks, link reference defitinion"
"[Foo bar]:\n\n'title'\n\n[Foo bar]"
('document doc-data
('paragraph _ ('text _ "[Foo bar]")))
(link-reference? '("foo bar" "my%20url" "'title'") doc-data) #true)
(block-expect "parse-blocks, link reference definition multiline title"
"[foo]: /url '\ntitle\nline1\nline2\n'\n\n[foo]"
('document doc-data
('paragraph _ ('text _ "[foo]")))
(link-reference? '("foo" "/url" "'\ntitle\nline1\nline2\n'") doc-data) #true)
(block-expect "parse-blocks, link reference definition title may not contain a blank line"
"[foo]: /url 'title\n\nwith blank line'\n\n[foo]"
('document _
('paragraph _ ('text _ "[foo]"))
('paragraph _ ('text _ "with blank line'"))
('paragraph _ ('text _ "[foo]: /url 'title"))))
(block-expect "parse-blocks, link reference definition title may be omitted"
"[foo]:\n/url\n\n[foo]"
('document doc-data
('paragraph _ ('text _ "[foo]")))
(link-reference? '("foo" "/url" #f) doc-data) #true)
(block-expect "parse-blocks, link reference definition link destination may not be omitted"
"[foo]:\n\n[foo]"
('document _
('paragraph _ ('text _ "[foo]"))
('paragraph _ ('text _ "[foo]:"))))
(block-expect "parse-blocks, link reference definition both title and destination
can contain backslash escapes and literal backslashes"
"[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]"
('document doc-data
('paragraph _ ('text _ "[foo]")))
(link-reference? '("foo" "/url\\bar*baz" "\"foo\"bar\\baz\"") doc-data) #true)
(block-expect "parse-blocks, link reference definition with no corresponding link
contributes nothing to the document."
"[foo]: /url"
('document doc-data))
(block-expect "parse-blocks, link reference definition with no corresponding link
contributes nothing to the document."
"[\nfoo\n]: /url\nbar"
('document _
('paragraph _ ('text _ "bar"))))
(block-expect "parse-blocks, link reference definition not a link reference definition"
"[foo]: /url \"title\" ok"
('document _
('paragraph _ ('text _ "[foo]: /url \"title\" ok"))))
(block-expect "parse-blocks, link reference definition, but it has no title"
"[foo]: /url\n\"title\" ok"
('document doc-data
('paragraph _ ('text _ "\"title\" ok")))
(link-reference? '("foo" "/url" #f) doc-data) #true)
(block-expect "parse-blocks, link reference definition not a link definition because
indented four spaces"
" [foo]: /url \"title\"\n\n[foo]"
('document _
('paragraph _ ('text _ "[foo]"))
('code-block _ "[foo]: /url \"title\"")))
(block-expect "parse-blocks, link reference definition not a link definition because
it occurs inside a code block"
"```\n[foo]: /url\n```\n\n[foo]"
('document _
('paragraph _ ('text _ "[foo]"))
('fenced-code _ "[foo]: /url")))
(block-expect "parse-blocks, link reference definition cannot interrupt a paragraph"
"Foo\n[bar]: /baz\n\n[bar]"
('document _
('paragraph _ ('text _ "[bar]"))
('paragraph _ ('text _ "Foo\n[bar]: /baz"))))
(block-expect "parse-blocks, link reference definition can directly follow other blocks"
"# [Foo]\n[foo]: /url\n> bar"
('document doc-data
('block-quote _ ('paragraph _ ('text _ "bar")))
('heading _ ('text _ "[Foo]")))
(link-reference? '("foo" "/url" #f) doc-data) #true)
(block-expect "parse-blocks, link reference definition can occur one after another"
"[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]"
('document doc-data
('paragraph _ ('text _ "[foo],\n[bar],\n[baz]")))
(link-reference? '("foo" "/foo-url" "\"foo\"") doc-data) #true
(link-reference? '("bar" "/bar-url" "\"bar\"") doc-data) #true
(link-reference? '("baz" "/baz-url" #f) doc-data) #true)
(block-expect "parse-blocks, link reference definition can occur inside block containers"
"[foo]\n\n> [foo]: /url"
('document doc-data
('block-quote _)
('paragraph _ ('text _ "[foo]")))
(link-reference? '("foo" "/url" #f) doc-data) #true)
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/lists.scm 0000644 0001750 0001750 00000023642 13652433030 021765 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks lists")
(block-expect "parse-blocks, list changing bullet list delimiter starts a new list"
"- foo
- bar
+ baz"
('document _
('list _ ('item _ ('paragraph _ ('text _ "baz"))))
('list _
('item _ ('paragraph _ ('text _ "bar")))
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list changing ordered list delimiter starts a new list"
"1. foo
2. bar
3) baz"
('document _
('list list-data ('item _ ('paragraph _ ('text _ "baz"))))
('list _
('item _ ('paragraph _ ('text _ "bar")))
('item _ ('paragraph _ ('text _ "foo")))))
(list-start list-data) 3)
(block-expect "parse-blocks, list can interrupt a paragraph"
"Foo
- bar
- baz"
('document _
('list _
('item _ ('paragraph _ ('text _ "baz")))
('item _ ('paragraph _ ('text _ "bar"))))
('paragraph _ ('text _ "Foo"))))
(block-expect "parse-blocks, list must start with 1 to interrupt a paragraph"
"The number of windows in my house is
14. The number of doors is 6."
('document _
('paragraph _ ('text _ "The number of windows in my house is\n14. The number of doors is 6."))))
(block-expect "parse-blocks, list must start with 1 to interrupt a paragraph"
"The number of windows in my house is
1. The number of doors is 6."
('document _
('list _ ('item _ ('paragraph _ ('text _ "The number of doors is 6."))))
('paragraph _ ('text _ "The number of windows in my house is"))))
(block-expect "parse-blocks, list there can be any number of blank lines between items"
"- foo
- bar
- baz"
('document _
('list _
('item _ ('paragraph _ ('text _ "baz")))
('item _ ('paragraph _ ('text _ "bar")))
('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, list there can be any number of blank lines between items"
"- foo
- bar
- baz
bam"
('document
_ ('list
_ ('list
_ ('list _
('item _
('paragraph _ ('text _ "bim"))
('paragraph _ ('text _ "baz"))))
('paragraph _ ('text _ "bar")))
('paragraph _ ('text _ "foo")))))
(block-expect "parse-blocks, separate consecutive lists of the same type with blank HTML comment"
"- foo
- bar
- baz
- bim"
('document _))
(block-expect "parse-blocks, separate a list from indented code block with blank HTML comment"
"- foo
notcode
- foo
code"
('document _))
(block-expect "parse-blocks, list need not be indented to the same level"
"- a
- b
- c
- d
- e
- f
- g
- h
- i"
('document _
('list _
('item _ ('paragraph _ ('text _ "i")))
('item _ ('paragraph _ ('text _ "h")))
('item _ ('paragraph _ ('text _ "g")))
('item _ ('paragraph _ ('text _ "f")))
('item _ ('paragraph _ ('text _ "e")))
('item _ ('paragraph _ ('text _ "d")))
('item _ ('paragraph _ ('text _ "c")))
('item _ ('paragraph _ ('text _ "b")))
('item _ ('paragraph _ ('text _ "a"))))))
(block-expect "parse-blocks, list need not be indented to the same level"
"1. a
2. b
3. c"
('document _
('list _
('item _ ('paragraph _ ('text _ "c")))
('item _ ('paragraph _ ('text _ "b")))
('item _ ('paragraph _ ('text _ "a"))))))
(block-expect "parse-blocks, list with a blank line between items is loose"
"- a
- b
- c"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "c")))
('item _ ('paragraph _ ('text _ "b")))
('item _ ('paragraph _ ('text _ "a")))))
(list-tight? list-data) #f)
(block-expect "parse-blocks, list with a blank line between items is loose"
"* a
*
* c"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "c")))
('item _)
('item _ ('paragraph _ ('text _ "a")))))
(list-tight? list-data) #f)
(block-expect "parse-blocks, list with a list item with two block level elements is loose"
"- a
- b
c
- d"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "d")))
('item _
('paragraph _ ('text _ "c"))
('paragraph _ ('text _ "b")))
('item _ ('paragraph _ ('text _ "a")))))
(list-tight? list-data) #f)
(block-expect "parse-blocks, list with a list item with two block level elements is loose"
"- a
- b
[ref]: /url
- d"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "d")))
('item _ ('paragraph _ ('text _ "b")))
('item _ ('paragraph _ ('text _ "a")))))
(list-tight? list-data) #f)
(block-expect "parse-blocks, list with blank lines in code block are tight"
"- a
- ```
b
```
- c"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "c")))
('item _ ('fenced-code _ "b\n\n"))
('item _ ('paragraph _ ('text _ "a")))))
(list-tight? list-data) #t)
(block-expect "parse-blocks, list is tight even if a sublist is loose"
"- a
- b
c
- d"
('document _
('list tight-list
('item _ ('paragraph _ ('text _ "d")))
('item _
('list loose-list
('item _
('paragraph _ ('text _ "c"))
('paragraph _ ('text _ "b"))))
('paragraph _ ('text _ "a")))))
(list-tight? tight-list) #t
(list-tight? loose-list) #f)
(block-expect "parse-blocks, list is tight because blank line is inside a block quote"
"* a
> b
>
* c"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "c")))
('item _
('block-quote _ ('paragraph _ ('text _ "b")))
('paragraph _ ('text _ "a")))))
(list-tight? list-data) #t)
(block-expect "parse-blocks, list is tight because the consecutive block elements are not
separated by blank lines"
"- a
> b
```
c
```
- d"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "d")))
('item _
('fenced-code _ "c")
('block-quote _ ('paragraph _ ('text _ "b")))
('paragraph _ ('text _ "a")))))
(list-tight? list-data) #t)
(block-expect "parse-blocks, list a single paragraph list is tight"
"- a"
('document _
('list list-data
('item _ ('paragraph _ ('text _ "a")))))
(list-tight? list-data) #t)
(block-expect "parse-blocks, list a single paragraph is tight"
"- a
- b"
('document _
('list list-data1
('item _
('list list-data2
('item _ ('paragraph _ ('text _ "b"))))
('paragraph _ ('text _ "a")))))
(list-tight? list-data1) #t
(list-tight? list-data2) #t)
(block-expect "parse-blocks, list is loose because the blank line between two block elements"
"1. ```
foo
```
bar"
('document _
('list list-data
('item _
('paragraph _ ('text _ "bar"))
('fenced-code _ "foo"))))
(list-tight? list-data) #f)
(block-expect "parse-blocks, outer list is loose and inner list tight"
"* foo
* bar
baz"
('document _
('list outer-list
('item _
('paragraph _ ('text _ "baz"))
('list inner-list
('item _ ('paragraph _ ('text _ "bar"))))
('paragraph _ ('text _ "foo")))))
(list-tight? outer-list) #f
(list-tight? inner-list) #t)
(block-expect "parse-blocks, outer list is loose and inner list tight"
"- a
- b
- c
- d
- e
- f"
('document _
('list outer-list
('item _
('list inner-list1
('item _ ('paragraph _ ('text _ "f")))
('item _ ('paragraph _ ('text _ "e"))))
('paragraph _ ('text _ "d")))
('item _
('list inner-list2
('item _ ('paragraph _ ('text _ "c")))
('item _ ('paragraph _ ('text _ "b"))))
('paragraph _ ('text _ "a")))))
(list-tight? outer-list) #f
(list-tight? inner-list1) #t
(list-tight? inner-list2) #t)
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/thematic-breaks.scm 0000644 0001750 0001750 00000010226 13652433030 023664 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks thematic-breaks")
(block-expect "parse-blocks, basic thematic breaks"
"***
---
___"
('document _
('thematic-break _)
('thematic-break _)
('thematic-break _)))
(block-expect "parse-blocks, not enough characters"
"--
**
__"
('document _
('paragraph _
('text _ "--\n**\n__"))))
(block-expect "parse-blocks, thematic break one to three spaces indent are allowed"
" ***
***
***"
('document _
('thematic-break _)
('thematic-break _)
('thematic-break _)))
(block-expect "parse-blocks, thematic break four spaces is too many"
" ***"
('document _
('code-block _ "***")))
(block-expect "parse-blocks, thematic break four spaces is too many"
"Foo
***"
('document _
('paragraph _
('text _ "Foo\n***"))))
(block-expect "parse-blocks, thematic break more than three characters may be used"
"_____________________________________"
('document _
('thematic-break _)))
(block-expect "parse-blocks, thematic break spaces are allowed between the characters"
" - - -"
('document _
('thematic-break _)))
(block-expect "parse-blocks, thematic break spaces are allowed between the characters"
" ** * ** * ** * **"
('document _
('thematic-break _)))
(block-expect "parse-blocks, thematic break spaces are allowed between the characters"
"- - - -"
('document _
('thematic-break _)))
(block-expect "parse-blocks, thematic break spaces are allowed at the end"
"- - - - "
('document _
('thematic-break _)))
(block-expect "parse-blocks, thematic break no other characters may occur in the line"
"_ _ _ _ a
a------
---a---"
('document _
('paragraph _ ('text _ "---a---"))
('paragraph _ ('text _ "a------"))
('paragraph _ ('text _ "_ _ _ _ a"))))
(block-expect "parse-blocks, thematic break all characters need to be the same"
" *-*"
('document _
('paragraph _ ('text _ "*-*"))))
(block-expect "parse-blocks, thematic break do not need blank lines before or after"
"- foo
***
- bar"
('document _
('list _ ('item _ ('paragraph _ ('text _ "bar"))))
('thematic-break _)
('list _ ('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, thematic break can interrupt a paragraph"
"Foo
***
bar"
('document _
('paragraph _ ('text _ "bar"))
('thematic-break _)
('paragraph _ ('text _ "Foo"))))
(block-expect "parse-blocks, thematic break line of dashes interpreted as setext heading"
"Foo
---
bar"
('document _
('paragraph _ ('text _ "bar"))
('heading _ ('text _ "Foo"))))
(block-expect "parse-blocks, thematic break takes precedence with lists"
"* Foo
* * *
* Bar"
('document _
('list _ ('item _ ('paragraph _ ('text _ "Bar"))))
('thematic-break _)
('list _ ('item _ ('paragraph _ ('text _ "Foo"))))))
(block-expect "parse-blocks, thematic break use a different symbol in a list"
"- Foo
- * * *"
('document _
('list _
('item _ ('thematic-break _))
('item _ ('paragraph _ ('text _ "Foo"))))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/block-quotes.scm 0000644 0001750 0001750 00000013534 13652433030 023236 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks block-quotes")
(block-expect "parse-blocks, block quote simple"
"> # Foo
> bar
> baz"
('document _
('block-quote _
('paragraph _ ('text _ "bar\nbaz"))
('heading _ ('text _ "Foo")))))
(block-expect "parse-blocks, block quote spaces can be omitted"
"># Foo
>bar
> baz"
('document _
('block-quote _
('paragraph _ ('text _ "bar\nbaz"))
('heading _ ('text _ "Foo")))))
(block-expect "parse-blocks, block quote can be indented 1-3 spaces"
" > # Foo
> bar
> baz"
('document _
('block-quote _
('paragraph _ ('text _ "bar\nbaz"))
('heading _ ('text _ "Foo")))))
(block-expect "parse-blocks, block quote 4 spaces is a code block"
" > # Foo
> bar
> baz"
('document _
('code-block _ "> # Foo\n> bar\n> baz")))
(block-expect "parse-blocks, block quote paragraph laziness"
"> # Foo
> bar
baz"
('document
_ ('block-quote _
('paragraph _ ('text _ "bar\nbaz"))
('heading _ ('text _ "Foo")))))
(block-expect "parse-blocks, block quote can contain some lazy and some
non-lazy continuation lines"
"> bar
baz
> foo"
('document
_ ('block-quote
_ ('paragraph
_ ('text _ "bar\nbaz\nfoo")))))
(block-expect "parse-blocks, block quote laziness only applies if they would be a paragraph"
"> foo
---"
('document _
('thematic-break _)
('block-quote _
('paragraph _ ('text _ "foo")))))
(block-expect "parse-blocks, block quote lists are similar"
"> - foo
- bar"
('document _
('list
_ ('item _ ('paragraph _ ('text _ "bar"))))
('block-quote
_ ('list
_ ('item
_ ('paragraph _ ('text _ "foo")))))))
(block-expect "parse-blocks, block quote code blocks are similar"
"> foo
bar"
('document _
('code-block _ "bar")
('block-quote _ ('code-block _ "foo"))))
(block-expect "parse-blocks, block quote fenced code are similar"
"> ```
foo
```"
('document _
('fenced-code _)
('paragraph _ ('text _ "foo"))
('block-quote _ ('fenced-code _))))
(block-expect "parse-blocks, block quote the following is a lazy continuation line"
"> foo
- bar"
('document
_ ('block-quote
_ ('paragraph _ ('text _ "foo\n- bar")))))
(block-expect "parse-blocks, block quote can be empty"
">"
('document _ ('block-quote _)))
(block-expect "parse-blocks, block quote can be empty with spaces"
">
>
> "
('document _ ('block-quote _)))
(block-expect "parse-blocks, block quote can have initial or final blank lines"
">
> foo
> "
('document
_ ('block-quote
_ ('paragraph _ ('text _ "foo")))))
(block-expect "parse-blocks, block quote a blank line always separates block quotes"
"> foo
> bar"
('document _
('block-quote _ ('paragraph _ ('text _ "bar")))
('block-quote _ ('paragraph _ ('text _ "foo")))))
(block-expect "parse-blocks, block quote blank lines in a block quote separates paragraph"
"> foo
>
> bar"
('document
_ ('block-quote _
('paragraph _ ('text _ "bar"))
('paragraph _ ('text _ "foo")))))
(block-expect "parse-block, block quote can interrupt paragraphs"
"foo
> bar"
('document _
('block-quote _ ('paragraph _ ('text _ "bar")))
('paragraph _ ('text _ "foo"))))
(block-expect "parse-blocks, block quote blank lines are not needed before or after"
"> aaa
***
> bbb"
('document _
('block-quote _ ('paragraph _ ('text _ "bbb")))
('thematic-break _)
('block-quote _ ('paragraph _ ('text _ "aaa")))))
(block-expect "parse-blocks, block quote blank line needed to break laziness"
"> bar
baz"
('document _
('paragraph _ ('text _ "baz"))
('block-quote _ ('paragraph _ ('text _ "bar")))))
(block-expect "parse-blocks, block quote blank line needed to break laziness in block quotes as well"
"> bar
>
baz"
('document _
('paragraph _ ('text _ "baz"))
('block-quote _ ('paragraph _ ('text _ "bar")))))
(block-expect "parse-blocks, block quote laziness rule allowed in nested block quotes"
"> > > foo
bar"
('document
_ ('block-quote
_ ('block-quote
_ ('block-quote
_ ('paragraph _ ('text _ "foo\nbar")))))))
(block-expect "parse-blocks, block quote laziness rule allowed in nested block quotes of multiple
levels"
">>> foo
> bar
>>baz"
('document
_ ('block-quote
_ ('block-quote
_ ('block-quote
_ ('paragraph _ ('text _ "foo\nbar\nbaz")))))))
(block-expect "parse-blocks, block quote code blocks need five spaces"
"> code
> not code"
('document _
('block-quote _ ('paragraph _ ('text _ "not code")))
('block-quote _ ('code-block _ "code"))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/setext-headings.scm 0000644 0001750 0001750 00000012750 13652433030 023721 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-64)
(tests utils))
(test-begin "blocks setext-headings")
(block-expect "parse-blocks, simple setext headings"
"Foo *bar*
=========
Foo *bar*
---------"
('document _
('heading heading-data1 ('text _ "Foo *bar*"))
('heading heading-data2 ('text _ "Foo *bar*")))
(heading-level heading-data1) 2
(heading-level heading-data2) 1)
;;TODO implement multiline headings
(block-expect "parse-blocks, setext headings may span more than one line"
"Foo *bar
baz*
===="
('document _
('heading heading-data ('text _ "Foo *bar\nbaz*")))
(heading-level heading-data) 1)
(block-expect "parse-blocks, setext heading underline can be any length"
"Foo
-------------------------
Foo
="
('document _
('heading heading-data1 ('text _ "Foo"))
('heading heading-data2 ('text _ "Foo")))
(heading-level heading-data1) 1
(heading-level heading-data2) 2)
(block-expect "parse-blocks, setext heading content can be indented up to three spaces"
" Foo
---
Foo
-----
Foo
==="
('document _
('heading heading-data1 ('text _ "Foo"))
('heading heading-data2 ('text _ "Foo"))
('heading heading-data3 ('text _ "Foo")))
(heading-level heading-data1) 1
(heading-level heading-data2) 2
(heading-level heading-data3) 2)
(block-expect "parse-blocks, setext heading four spaces indent is too much"
" Foo
---
Foo
---"
('document _
('thematic-break _)
('code-block _ "Foo\n---\n\nFoo")))
(block-expect "parse-blocks, setext heading underline can be indented up to three spaces
and may have trailing spaces"
"Foo
---- "
('document _
('heading heading-data ('text _ "Foo")))
(heading-level heading-data) 2)
(block-expect "parse-blocks, setext heading underline four spaces it too much"
"Foo
---"
('document _
('paragraph _ ('text _ "Foo\n---"))))
(block-expect "parse-blocks, setext heading underline cannot contain internal spaces"
"Foo
= =
Foo
--- -"
('document _
('thematic-break _)
('paragraph _ ('text _ "Foo"))
('paragraph _ ('text _ "Foo\n= ="))))
(block-expect "parse-blocks, setext heading underline cannot be a lazy continuation line"
"> Foo
---"
('document _
('thematic-break _)
('block-quote
_ ('paragraph _ ('text _ "Foo")))))
(block-expect "parse-blocks, setext heading underline cannot be a lazy continuation line"
"> foo
bar
==="
('document
_ ('block-quote _ ('paragraph _ ('text _ "foo\nbar\n===")))))
(block-expect "parse-blocks, setext heading underline cannot be a lazy continuation line"
"- Foo
---"
('document _
('thematic-break _)
('list _ ('item _ ('paragraph _ ('text _ "Foo"))))))
(block-expect "parse-blocks, setext heading a blank line is needed between a paragraph
and a setext heading"
"Foo
Bar
---"
('document _
('heading heading-data ('text _ "Foo\nBar")))
(heading-level heading-data) 2)
(block-expect "parse-blocks, setext heading a blank line is not required before or after
setext headings"
"---
Foo
---
Bar
---
Baz"
('document _
('paragraph _ ('text _ "Baz"))
('heading heading-data1 ('text _ "Bar"))
('heading heading-data2 ('text _ "Foo"))
('thematic-break _))
(heading-level heading-data1) 2
(heading-level heading-data2) 2)
(block-expect "parse-blocks, setext headings cannot be empty"
"
===="
('document _
('paragraph _ ('text _ "===="))))
(block-expect "parse-blocks, setext heading text lines must not be interpretable as block
constructs other than paragraphs"
"---
---"
('document _
('thematic-break _)
('thematic-break _)))
(block-expect "parse-blocks, setext heading text lines must not be interpretable as block
constructs other than paragraphs"
"- foo
-----"
('document _
('thematic-break _)
('list _ ('item _ ('paragraph _ ('text _ "foo"))))))
(block-expect "parse-blocks, setext heading text lines must not be interpretable as block
constructs other than paragraphs"
" foo
---"
('document _
('thematic-break _)
('code-block _ "foo")))
(block-expect "parse-blocks, setext heading text lines must not be interpretable as block
constructs other than paragraphs"
"> foo
-----"
('document _
('thematic-break _)
('block-quote _ ('paragraph _ ('text _ "foo")))))
(block-expect "parse-blocks, setext heading use a backslash escape to allow >"
"\\> foo
------"
('document _
('heading heading-data ('text _ "\\> foo")))
(heading-level heading-data) 2)
(test-end)
guile-commonmark-0.1.2+20240812/tests/blocks/atx-headings.scm 0000644 0001750 0001750 00000013505 13652433030 023200 0 ustar frankie frankie ;; Copyright (C) 2016-2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-1)
(srfi srfi-26)
(srfi srfi-64)
(ice-9 match)
(tests utils)
(commonmark blocks))
(test-begin "blocks atx-headings")
(block-expect "parse-blocks, atx headings"
"# foo
## foo
### foo
#### foo
##### foo
###### foo"
('document _
('heading heading-data6
('text _ "foo"))
('heading heading-data5
('text _ "foo"))
('heading heading-data4
('text _ "foo"))
('heading heading-data3
('text _ "foo"))
('heading heading-data2
('text _ "foo"))
('heading heading-data1
('text _ "foo")))
(heading-level heading-data6) 6
(heading-level heading-data5) 5
(heading-level heading-data4) 4
(heading-level heading-data3) 3
(heading-level heading-data2) 2
(heading-level heading-data1) 1)
(block-expect "parse-blocks, atx headings not more than 6 #"
"####### foo"
('document _
('paragraph _
('text _ "####### foo"))))
(block-expect "parse-blocks, atx headings requires an empty space"
"#5 bolt
#hashtag"
('document _
('paragraph _
('text _ "#hashtag"))
('paragraph _
('text _ "#5 bolt"))))
(block-expect "parse-blocks, atx headings not a heading when # is escaped"
"\\## foo"
('document _
('paragraph _
('text _ "\\## foo"))))
(block-expect "parse-blocks, atx headings leading and trailing blanks are ignored"
"# foo "
('document _
('heading heading-data
('text _ "foo")))
(heading-level heading-data) 1)
(block-expect "parse-blocks, atx headings one to three spaces indentation are allowed"
" ### foo
## foo
# foo"
('document _
('heading heading-data3
('text _ "foo"))
('heading heading-data2
('text _ "foo"))
('heading heading-data1
('text _ "foo")))
(heading-level heading-data3) 1
(heading-level heading-data2) 2
(heading-level heading-data1) 3)
(block-expect "parse-blocks, atx heading four spaces are too much"
" # foo"
('document _
('code-block _ "# foo")))
(block-expect "parse-blocks, atx heading four spaces are too much"
"foo
# bar"
('document _
('paragraph _ ('text _ "foo\n# bar"))))
(block-expect "parse-blocks, atx headings closing # characters are optional"
"## foo ##
### bar ###"
('document _
('heading heading-data1
('text _ "bar"))
('heading heading-data2
('text _ "foo")))
(heading-level heading-data1) 3
(heading-level heading-data2) 2)
(block-expect "parse-blocks, atx headings closing sequence does not need be same length"
"# foo ##################################
##### bar ##"
('document _
('heading heading-data1
('text _ "bar"))
('heading heading-data2
('text _ "foo")))
(heading-level heading-data1) 5
(heading-level heading-data2) 1)
(block-expect "parse-blocks, atx headings spaces are allowed after closing sequence"
"### foo ### "
('document _
('heading heading-data
('text _ "foo")))
(heading-level heading-data) 3)
(block-expect "parse-blocks, atx headings nonspace character after closing sequence"
"### foo ### b"
('document _
('heading heading-data
('text _ "foo ### b")))
(heading-level heading-data) 3)
(block-expect "parse-blocks, atx headings closing sequence must be preceded by a space"
"# foo#"
('document _
('heading heading-data
('text _ "foo#")))
(heading-level heading-data) 1)
(block-expect "parse-blocks, atx headings need not be separated from surrounding content
by blank lines"
"****
## foo
****"
('document _
('thematic-break _)
('heading heading-data
('text _ "foo"))
('thematic-break _))
(heading-level heading-data) 2)
(block-expect "parse-blocks, atx headings can interrupt paragraphs"
"Foo bar
# baz
Bar foo"
('document _
('paragraph _
('text _ "Bar foo"))
('heading heading-data
('text _ "baz"))
('paragraph _
('text _ "Foo bar")))
(heading-level heading-data) 1)
(block-expect "parse-blocks, atx headings can be empty"
"## \n#\n### ###"
('document _
('heading heading-data1
('text _ ""))
('heading heading-data2
('text _ ""))
('heading heading-data3
('text _ "")))
(heading-level heading-data1) 3
(heading-level heading-data2) 1
(heading-level heading-data3) 2)
(test-end)
guile-commonmark-0.1.2+20240812/tests/tabs.scm 0000644 0001750 0001750 00000004645 13652433030 020305 0 ustar frankie frankie ;; Copyright (C) 2017, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(use-modules (srfi srfi-1)
(srfi srfi-26)
(srfi srfi-64)
(ice-9 match)
(tests utils))
(test-begin "tabs")
(block-expect "parse atx headings with tabs"
"#\tfoo\t#\t"
('document _
('heading heading-data
('text _ "foo")))
(heading-level heading-data) 1)
(block-expect "parse setext heading ending with tab"
"foo
===\t"
('document _
('heading heading-data
('text _ "foo")))
(heading-level heading-data) 1)
(block-expect "parse thematic breaks with tabs"
"*\t*\t*\t"
('document _
('thematic-break _)))
(block-expect "parse link reference definition with tabs"
"[foo]:\t/url\t'the title'\t\n\n[foo]"
('document doc-data
('paragraph _
(text _ "[foo]")))
(any (cut equal? '("foo" "/url" "'the title'") <>) (link-references doc-data))
#t)
(block-expect "parse code block preserves tabs"
"\tfoo\tbaz\t\tbim"
('document _
('code-block _ "foo\tbaz\t\tbim")))
(block-expect "parse code block preserves tabs and expands"
" \tfoo\tbaz\t\tbim"
('document _
('code-block _ "foo\tbaz\t\tbim")))
(block-expect "parse block quote with code block with tabs"
">\t\tfoo"
('document _
('block-quote _
('code-block _ " foo"))))
(block-expect "parse continuation paragraph in a list"
" - foo
\tbar"
('document _
('list _
('item _
('paragraph _ ('text _ "bar"))
('paragraph _ ('text _ "foo"))))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/node.scm 0000644 0001750 0001750 00000002215 13652433030 020270 0 ustar frankie frankie ;; Copyright (C) 2015, 2018 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (test-node)
#:use-module (srfi srfi-64)
#:use-module (commonmark node))
(test-begin "node")
(define test-node (make-node 'test))
(test-assert "no-children, true when no children"
(no-children? test-node))
(test-assert "no-children, false when children"
(not (no-children? (add-child-node test-node test-node))))
(test-end)
guile-commonmark-0.1.2+20240812/tests/utils.scm 0000644 0001750 0001750 00000005515 13652433030 020511 0 ustar frankie frankie ;; Copyright (C) 2017 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (tests utils)
#:use-module (ice-9 match)
#:use-module (srfi srfi-64)
#:use-module (commonmark blocks)
#:export (heading-level
link-references
info-string
link-references
list-start
list-tight?
block-expect))
(define (heading-level heading-data)
(assq-ref heading-data 'level))
(define (link-references data)
(assq-ref data 'link-references))
(define (info-string data)
(assq-ref data 'info-string))
(define (link-references data)
(assq-ref data 'link-references))
(define (list-start data)
(assq-ref data 'start))
(define (list-tight? data)
(assq-ref data 'tight))
(define-syntax test-asserts
(syntax-rules ()
((_ exp expect-exp)
(let* ((exp* exp)
(result (equal? exp* expect-exp)))
(if result
result
(begin
(format #t "*** Computed: ~s => ~s\n" (quote exp) exp*)
(format #t "*** Expected: ~s\n" expect-exp)
#f))))
((_ exp expect-exp rest ...)
(let* ((exp* exp)
(result (equal? exp* expect-exp)))
(if result
(test-asserts rest ...)
(begin
(format #t "*** Computed: ~s => ~s\n" (quote exp) exp*)
(format #t "*** Expected: ~s\n" expect-exp)
#f))))))
(define-syntax block-expect
(syntax-rules ()
((_ test-name test-string test-expect)
(let ((result (call-with-input-string test-string parse-blocks)))
(test-assert test-name
(match result
(test-expect #t)
(x (format #t "*** Expected: ~s\n" (quote test-expect))
(format #t "*** Result: ~s\n" x)
#f)))))
((_ test-name test-string test-expect test-assertions ...)
(let ((result (call-with-input-string test-string parse-blocks)))
(test-assert test-name
(match result
(test-expect (test-asserts test-assertions ...))
(x (format #t "*** Expected: ~s\n" (quote test-expect))
(format #t "*** Result: ~s\n" x)
#f)))))))
guile-commonmark-0.1.2+20240812/tests/.dir-locals.el 0000644 0001750 0001750 00000000246 13652433030 021272 0 ustar frankie frankie ;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((scheme-mode
(eval put 'block-expect 'scheme-indent-function 1)))
guile-commonmark-0.1.2+20240812/commonmark/ 0000755 0001750 0001750 00000000000 14656375351 017660 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/commonmark/blocks.scm 0000644 0001750 0001750 00000034760 13652433030 021633 0 ustar frankie frankie ;; Copyright (C) 2015, 2016 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark blocks)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (commonmark node)
#:use-module (commonmark utils)
#:use-module (commonmark parser)
#:use-module (commonmark common)
#:export (parse-blocks))
;; Port -> Document
(define (parse-blocks port)
"Parses CommonMark blocks from PORT returning a CommonMark Document tree"
(let loop ((root (make-document-node))
(line (read-line-without-nul port)))
(if (eof-object? line)
(parse-clean-up root (lambda (doc references)
(if (null? references)
doc
(node-add-data doc 'link-references references))))
(loop (parse-open-block root (make-parser line))
(read-line-without-nul port)))))
;; Node Parser -> Node
(define (parse-open-block node parser)
(cond ((node-closed? node) node)
((document-node? node) (parse-container-block node parser))
((block-quote-node? node) (parse-block-quote node parser))
((code-block-node? node) (parse-code-block node parser))
((fenced-code-node? node) (parse-fenced-code node parser))
((list-node? node) (parse-list node parser))
((paragraph-node? node) (parse-paragraph node parser))))
;; Node Parser -> Node
(define (parse-container-block node parser)
(cond ((and (no-children? node) (empty-line parser)) ;; empty line
node)
((no-children? node) ;; first line
(add-child-node node (parse-line parser)))
((and (node-closed? (last-child node)) (not (empty-line parser))) ;; new block
(add-child-node node (parse-line parser)))
(else (let ((new-child (parse-open-block (last-child node) parser)))
(cond ((and (not (empty-line parser))
(node-closed? new-child)
(not (fenced-code-node? new-child))
(not (heading-node? new-child)))
(add-child-node (replace-last-child node new-child)
(parse-line parser)))
(else (replace-last-child node new-child)))))))
(define (parse-block-quote node parser)
(cond ((block-quote (parser-advance-min-spaces parser 3)) => (lambda (rest)
(parse-container-block node (block-quote-rest rest))))
((open-descendant? node 'paragraph) ;; lazy continuation line
(let ((parsed-line (parse-line parser)))
(if (or (paragraph-node? parsed-line) (code-block-node? parsed-line))
(parse-container-block node parser)
(close-node node))))
(else (close-node node))))
(define (parse-code-block node parser)
(let ((nonspace-parser (parser-advance-next-nonspace parser)))
(cond ((parser-indented? parser nonspace-parser)
(add-child-node node (parser-rest-str (parser-advance parser code-indent))))
((empty-line parser) (add-child-node node ""))
(else (close-node node)))))
(define (parse-paragraph node parser)
(let ((parsed-line (parse-line parser)))
(cond ((blank-node? parsed-line)
(close-node node))
((and (setext-heading (parser-advance-min-spaces parser 3)) (= (length (node-children (last-child node))) 1))
(make-heading-node (last-child (last-child node))
(if (string-any #\= (parser-rest-str parser)) 1 2)))
((paragraph-node? parsed-line)
(replace-last-child node (join-text-nodes (last-child node) (last-child parsed-line))))
((code-block-node? parsed-line)
(replace-last-child node (add-text (last-child node) (parser-rest-str parser))))
(else (close-node node)))))
(define (fence-start node)
(node-get-data node 'fence-start))
(define (fence-type node)
(node-get-data node 'fence))
(define (parse-fenced-code node parser)
(cond ((fenced-code-end (parser-advance-min-spaces parser 3) (fence-type node))
(close-node node))
((no-children? node)
(add-child-node node (parser-rest-str (parser-advance-min-spaces parser (fence-start node)))))
(else (replace-last-child
node
(string-append (last-child node)
"\n"
(parser-rest-str (parser-advance-min-spaces parser (fence-start node))))))))
(define (list-type node)
(node-get-data node 'type))
(define (list-bullet node)
(node-get-data node 'bullet))
(define (list-delimiter node)
(node-get-data node 'delimiter))
(define (eq-list-types? l1 l2)
(or (and (eq? (list-type l1) (list-type l2) 'bullet)
(string=? (list-bullet l1) (list-bullet l2)))
(and (eq? (list-type l1) (list-type l2) 'ordered)
(string=? (list-delimiter l1) (list-delimiter l2)))))
(define (parse-list node parser)
(define (remove-blank-node item)
(if (blank-last-child? item)
(remove-last-child item)
item))
(define (parse-new-item node parser item)
(let ((new-list (parse-line parser)))
(cond ((and (list-node? new-list)
(eq-list-types? node new-list))
(add-child-node (replace-last-child node item)
(last-child new-list)))
(else (close-node (replace-last-child node (remove-blank-node item)))))))
(if (node-closed? (last-child node))
(parse-new-item node parser (last-child node))
(let ((item (parse-item (last-child node) parser)))
(cond ((and (node-closed? item) (empty-line parser))
(close-node (replace-last-child node item)))
((node-closed? item)
(parse-new-item node parser item))
(else (replace-last-child node item))))))
(define (n-spaces? n str)
(>= (string-index str (lambda (c) (not (char=? #\space c)))) n))
(define (item-padding node)
(node-get-data node 'padding))
(define (blank-last-child? node)
(and (not (no-children? node)) (blank-node? (last-child node))))
(define (parse-item node parser)
(let ((padding (item-padding node)))
(cond ((and (blank-last-child? node) (= (length (node-children node)) 1))
(close-node node))
((and (empty-line parser) (no-children? node))
(add-child-node node (make-blank-node)))
((and (empty-line parser) (blank-node? (last-child node)))
node) ;; may be separated by more than one blank line
((empty-line parser)
(cond ((open-descendant? node 'fenced-code)
(parse-container-block node parser))
((list-node? (last-child node))
(let ((container (parse-container-block node parser)))
(if (node-closed? (last-child container))
(close-node container)
(add-child-node container (make-blank-node)))))
((open-descendant? node 'code-block)
(add-child-node (parse-container-block node parser)
(make-blank-node)))
(else (add-child-node (replace-last-child node (close-node (last-child node)))
(make-blank-node)))))
((n-spaces? padding (parser-rest-str parser))
(let* ((parser (parser-advance parser padding))
(n (if (and (blank-last-child? node) (or (prev-node? node 'code-block) (prev-node? node 'list)))
(remove-last-child node)
node))
(new-item (parse-container-block n parser)))
(if (and (blank-last-child? node) (prev-node? new-item 'list) (prev-node-closed? new-item))
(add-child-node (replace-last-child new-item (last-child node)) (last-child new-item))
new-item)))
((or (no-children? node) (blank-node? (last-child node)))
(close-node node))
((open-descendant? node 'paragraph)
(let ((parsed-line (parse-line (parser-advance-min-spaces parser padding))))
(if (paragraph-node? parsed-line)
(parse-container-block node parser)
(close-node (replace-last-child node (close-node (last-child node)))))))
(else (close-node (replace-last-child node (close-node (last-child node))))))))
(define (heading-level str)
(string-length str))
;; Parser -> Node
(define (parse-line parser)
(let ((nonspace-parser (parser-advance-next-nonspace parser)))
(cond ((empty-line nonspace-parser) (make-blank-node))
((parser-indented? parser nonspace-parser) (make-code-block parser))
((thematic-break nonspace-parser) (make-thematic-break))
((block-quote nonspace-parser) => make-block-quote)
((atx-heading nonspace-parser) => make-atx-heading)
((fenced-code nonspace-parser) => make-fenced-code)
((bullet-list-marker nonspace-parser) => (cut make-bullet-list-marker parser <>))
((ordered-list-marker nonspace-parser) => (cut make-ordered-list-marker parser <>))
(else (make-paragraph nonspace-parser)))))
(define (make-thematic-break)
(make-thematic-break-node))
(define (make-block-quote match)
(make-block-quote-node (parse-line (block-quote-rest match))))
(define (make-atx-heading match)
(make-heading-node (atx-heading-content match)
(heading-level (atx-heading-opening match))))
(define (make-code-block parser)
(make-code-block-node (parser-rest-str (parser-advance parser code-indent))))
(define (make-fenced-code match)
(make-fenced-code-node
`((fence . ,(fenced-code-fence match))
(fence-start . ,(fenced-code-start match))
(info-string . ,(unescape-string (string-trim-both (fenced-code-info-string match)))))))
(define (make-bullet-list-marker parser match)
(let ((rest-parser (bullet-list-rest parser match)))
(make-list-node (make-item rest-parser
(bullet-list-offset parser rest-parser)
(bullet-list-spaces rest-parser))
`((type . bullet)
(tight . #t)
(bullet . ,(bullet-list-bullet match))))))
(define (make-ordered-list-marker parser match)
(let ((rest-parser (ordered-list-rest parser match)))
(make-list-node (make-item rest-parser
(ordered-list-offset parser rest-parser)
(ordered-list-spaces rest-parser))
`((type . ordered)
(start . ,(ordered-list-number match))
(tight . #t)
(delimiter . ,(ordered-list-delimiter match))))))
(define (make-item parser width spaces)
(cond ((>= spaces 5)
(make-item-node (parse-line (parser-advance parser 1))
(+ width 1)))
((< spaces 1)
(make-item-node #f (+ width 1)))
(else (make-item-node (parse-line (parser-advance parser spaces)) (+ width spaces)))))
(define (make-paragraph parser)
(make-paragraph-node (parser-rest-str parser)))
(define (parse-clean-up node col)
(cond ((not (node? node)) (col node '()))
((code-block-node? node) (remove-empty-lines node col))
((paragraph-node? node) (parse-reference-definition node col))
((list-node? node) (clean-list-nodes node col))
((item-node? node) (remove-blank-nodes node col))
(else (filter-map&co parse-clean-up (node-children node)
(lambda (v d)
(col (make-node (node-type node)
(node-data node)
v)
d))))))
(define (reverse-join ls)
(reduce (cut string-append <> "\n" <>) "" ls))
(define (parse-reference-definition node col)
(let loop ((text (reverse-join (node-children (last-child node))))
(links '()))
(cond ((link-definition text) =>
(lambda (match)
(loop (link-definition-rest match)
(cons (list (string-map char-downcase (link-definition-label match))
(link-definition-destination match)
(link-definition-title match))
links))))
(else (col (if (= (string-length text) 0)
#f
(make-paragraph-node (string-trim-right text))) links)))))
(define (remove-empty-lines node col)
(col (make-node (node-type node) (node-data node)
(list (reverse-join (drop-while (cut string-every char-set:blank <>)
(node-children node)))))
'()))
(define (clean-list-nodes node col)
(define (any-blank-nodes? item)
(any blank-node? (node-children item)))
(let ((blank-nodes (any any-blank-nodes? (node-children node))))
(filter-map&co parse-clean-up (node-children node)
(lambda (v d)
(col (make-node (node-type node)
(if blank-nodes
(acons 'tight #f (node-data node))
(node-data node))
v)
d)))))
(define (remove-blank-nodes node col)
(cond ((no-children? node) (col node '()))
(else (filter-map&co parse-clean-up (filter (negate blank-node?) (node-children node))
(lambda (v d)
(col (make-node (node-type node)
(node-data node)
v)
d))))))
guile-commonmark-0.1.2+20240812/commonmark/node.scm 0000644 0001750 0001750 00000023700 13652433030 021273 0 ustar frankie frankie ;; Copyright (C) 2015, 2016 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark node)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-9)
#:export (make-node
node?
node-type
node-children
node-data
node-get-data
node-add-data
node-closed?
no-children?
make-document-node
document-node?
make-thematic-break-node
thematic-break-node?
make-paragraph-node
paragraph-node?
make-block-quote-node
block-quote-node?
make-code-block-node
code-block-node?
make-fenced-code-node
fenced-code-node?
make-list-node
list-node?
make-item-node
item-node?
make-heading-node
heading-node?
make-text-node
join-text-nodes
add-text
text-node?
make-softbreak-node
softbreak-node?
make-hardbreak-node
hardbreak-node?
make-blank-node
blank-node?
make-code-span-node
code-span-node?
make-emphasis-node
emphasis-node?
make-link-node
link-node?
make-image-node
image-node?
child-closed?
close-node
last-child
rest-children
add-child-node
replace-last-child
remove-last-child
open-descendant?
prev-node?
prev-node-closed?
print-node))
;; Node-Type is one of:
;; - 'document
;; - 'thematic-break
;; - 'paragraph
;; - 'block-quote
;; - 'code-block
;; - 'fenced-code
;; - 'list
;; - 'item
;; - 'heading
;; - 'text
;; - 'softbreak
;; - 'hardbreak
;; - 'blank
;; - 'code-span
;; - 'emphasis
;; - 'link
;; interp. The type of CommonMark block node
;; Node is (make-node Node-Type Node-Data (listof Node))
;; interp. a node to represent a CommonMark document
(define* (make-node type #:optional data (children '()))
(cons* type (or data '((closed . #f))) children))
(define (node? node)
(pair? node))
(define (node-type node)
(car node))
(define (node-data node)
(cadr node))
(define (node-children node)
(cddr node))
(define (node-get-data node key)
(assq-ref (node-data node) key))
(define (node-add-data node key value)
(make-node (node-type node)
(acons key value (node-data node))
(node-children node)))
(define (node-closed? node)
(node-get-data node 'closed))
;; (listof Node) -> Boolean
;; returns true if the n has no children
(define (no-children? n)
(null? (node-children n)))
;; Node Node-Type -> Boolean
(define (node-type? n t)
(and (node? n) (eq? (node-type n) t)))
;; Document node
;; A document node is the root of a commonmark document
(define (make-document-node)
(make-node 'document))
;; Node -> Boolean
(define (document-node? n)
(node-type? n 'document))
;; Thematic-Break node
;; A thematic-break node represents a horizontal rule in a commonmark document
(define (make-thematic-break-node)
(make-node 'thematic-break '((closed . #t))))
;; Node -> Boolean
(define (thematic-break-node? n)
(node-type? n 'thematic-break))
;; Paragraph node
;; A paragraph node represents a paragraph in a commonmark document
;; with text nodes as children
;; String -> Node
(define (make-paragraph-node text)
(make-node 'paragraph #f (list (make-text-node (string-trim text)))))
;; Node -> Boolean
(define (paragraph-node? n)
(node-type? n 'paragraph))
;; Block quote node
;; A block quote node represents a block quote in a commonmark document
;; which contains other nodes as children
;; Node -> Node
(define (make-block-quote-node node)
(make-node 'block-quote #f (if (or (not node) (blank-node? node))
'()
(list node))))
;; Node -> Boolean
(define (block-quote-node? n)
(node-type? n 'block-quote))
;; Code block node
;; represents a code block which contains string as children
;; String -> Node
(define (make-code-block-node line)
(make-node 'code-block #f (list line)))
;; Node -> Boolean
(define (code-block-node? n)
(node-type? n 'code-block))
;; Fenced code node
;; represents a fenced code block which contains a fence type
;; and info-string
;; Data -> Node
(define (make-fenced-code-node data)
(make-node 'fenced-code data '()))
;; Node -> Boolean
(define (fenced-code-node? n)
(node-type? n 'fenced-code))
;; List node
;; represents a list which only contains item nodes
;; Node Data -> Node
(define (make-list-node item data)
(make-node 'list data (list item)))
;; Node-> Boolean
(define (list-node? n)
(node-type? n 'list))
;; Item node
;; represents a item which can only be in a list
;; Node -> Node
(define (make-item-node node padding)
(make-node 'item `((padding . ,padding))
(if (or (not node) (blank-node? node))
'()
(list node))))
;; Node -> Boolean
(define (item-node? n)
(node-type? n 'item))
;; Level is an Integer [1-6]
;; Heading node
;; represents either a atx heading or setext heading
;; String Level -> Node
(define (make-heading-node text level)
(make-node 'heading
`((level . ,level)
(closed . #t))
(list (make-text-node (string-trim-both text))) ))
;; Node -> Boolean
(define (heading-node? n)
(node-type? n 'heading))
;; Text node
;; String Boolean -> Node
(define (make-text-node text)
(make-node 'text '((closed . #t)) (list text)))
(define (join-text-nodes tn1 tn2)
(make-node 'text
'((closed . #t))
(append (node-children tn2) (node-children tn1))))
(define (add-text tn text)
(make-node 'text
'((closed . #t))
(cons (string-trim text) (node-children tn))))
(define (text-node? n)
(node-type? n 'text))
;; Softbreak node
(define (make-softbreak-node)
(make-node 'softbreak '((closed . #t))))
(define (softbreak-node? n)
(node-type? n 'softbreak))
;; Hardbreak node
(define (make-hardbreak-node)
(make-node 'hardbreak '((closed . #t))))
(define (hardbreak-node? n)
(node-type? n 'hardbreak))
;; Blank node
(define (make-blank-node)
(make-node 'blank '((closed . #t))))
(define (blank-node? n)
(node-type? n 'blank))
;; Code span node
(define (make-code-span-node text)
(define (collapse-spaces)
(regexp-substitute/global #f "[ \t\n]+" text 'pre " " 'post))
(make-node 'code-span #f (list (string-trim-both (collapse-spaces)))))
(define (code-span-node? node)
(node-type? node 'code-span))
;; Emphasis node
(define (make-emphasis-node nodes type)
(make-node 'emphasis `((type . ,type)) nodes))
(define (emphasis-node? node)
(node-type? node 'emphasis))
;; Link node
(define (make-link-node nodes destination title)
(make-node 'link `((destination . ,destination)
(title . ,title)) nodes))
(define (link-node? node)
(node-type? node 'link))
(define (make-image-node nodes destination title)
(make-node 'image `((destination . ,destination)
(title . ,title)) nodes))
(define (image-node? node)
(node-type? node 'image))
(define (child-closed? n)
(node-closed? (last-child n)))
;; Node -> Node
;; closes the node without changing any of the other properties
(define (close-node n)
(node-add-data n 'closed #t))
(define (last-child n)
(car (node-children n)))
(define (rest-children n)
(cdr (node-children n)))
(define (add-child-node node child)
(make-node (node-type node)
(node-data node)
(cons child (node-children node))))
(define (replace-last-child node new-child)
(make-node (node-type node)
(node-data node)
(cons new-child (rest-children node))))
(define (remove-last-child node)
(make-node (node-type node)
(node-data node)
(rest-children node)))
(define (open-descendant? node node-type)
(cond ((not (node? node)) #f)
((and (node-type? node node-type) (not (node-closed? node)))
#t)
((no-children? node) #f)
(else (open-descendant? (last-child node) node-type))))
(define (prev-node? node node-type)
(let loop ((count 1)
(children (node-children node)))
(cond ((null? children) #f)
((= count 0) (node-type? (car children) node-type))
(else (loop (- count 1) (cdr children))))))
(define (prev-node-closed? node)
(let loop ((count 1)
(children (node-children node)))
(cond ((null? children) #f)
((= count 0) (node-closed? (car children)))
(else (loop (- count 1) (cdr children))))))
(define (print-node n)
(define (inner n d)
(cond ((null? n) #f)
((string? n)
(display "\"")
(display n)
(display "\""))
((text-node? n)
(add-depth d)
(display (node-children n)))
(else
(add-depth d)
(display (node-type n))
(display (node-data n))
(map (lambda (n)
(newline)
(inner n (+ d 1))) (node-children n)))))
(inner n 0)
(newline))
(define (add-depth d)
(when (> d 0)
(display " ")
(add-depth (- d 1))))
guile-commonmark-0.1.2+20240812/commonmark/parser.scm 0000644 0001750 0001750 00000031714 13652433030 021646 0 ustar frankie frankie ;; Copyright (C) 2016-2018, 2020 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark parser)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-26)
#:use-module (ice-9 regex)
#:use-module (commonmark common)
#:export (make-parser
parser-str
parser-pos
parser-col
parser-end?
parser-advance
parser-advance-next-nonspace
parser-advance-min-spaces
code-indent
parser-indented?
parser-rest-str
block-quote
block-quote-rest
atx-heading
atx-heading-content
atx-heading-opening
empty-line
thematic-break
setext-heading
fenced-code
fenced-code-fence
fenced-code-start
fenced-code-info-string
fenced-code-end
bullet-list-marker
bullet-list-rest
bullet-list-offset
bullet-list-spaces
bullet-list-bullet
ordered-list-marker
ordered-list-rest
ordered-list-offset
ordered-list-spaces
ordered-list-number
ordered-list-delimiter
link-definition
link-definition-rest
link-definition-label
link-definition-destination
link-definition-title))
(define-record-type
(%make-parser str pos col)
parser?
(str parser-str)
(pos parser-pos)
(col parser-col))
(define (make-parser str)
(%make-parser str 0 0))
(define (parser-char=? parser ch)
(char=? (string-ref (parser-str parser) (parser-pos parser))
ch))
(define (parser-end? parser)
(>= (parser-pos parser) (string-length (parser-str parser))))
(define (parser-advance parser offset)
(let ((str (parser-str parser)))
(let loop ((pos (parser-pos parser))
(col (parser-col parser))
(count offset))
(cond ((>= pos (string-length str))
(%make-parser str pos col))
((<= count 0)
(%make-parser str pos col))
((char=? (string-ref str pos) #\tab)
(let ((col-change (- 4 (modulo col 4))))
(if (>= count col-change)
(loop (+ pos 1) (+ col col-change) (- count col-change))
(%make-parser str pos (+ col count)))))
(else (loop (+ pos 1) (+ col 1) (- count 1)))))))
(define (parser-advance-optional parser ch)
(define new-parser (cut %make-parser
(parser-str parser)
(+ (parser-pos parser) 1)
<>))
(if (and (not (parser-end? parser)) (parser-char=? parser ch))
(new-parser (+ (parser-col parser)
(case ch
((#\tab) (- 4 (modulo (parser-col parser) 4)))
(else 1))))
parser))
(define (parser-advance-next-nonspace parser)
(let ((str (parser-str parser)))
(let loop ((pos (parser-pos parser))
(col (parser-col parser)))
(if (>= pos (string-length str))
(%make-parser str pos col)
(case (string-ref str pos)
((#\space) (loop (+ pos 1) (+ col 1)))
((#\tab) (loop (+ pos 1) (+ col (- 4 (modulo col 4)))))
(else (%make-parser str pos col)))))))
(define (parser-advance-min-spaces parser n)
(let ((str (parser-str parser)))
(let loop ((pos (parser-pos parser))
(col (parser-col parser))
(count n))
(cond ((>= pos (string-length str))
(%make-parser str pos col))
((<= count 0)
(%make-parser str pos col))
((char=? (string-ref str pos) #\space)
(loop (+ pos 1) (+ col 1) (- count 1)))
((char=? (string-ref str pos) #\tab)
(let ((col-change (- 4 (modulo col 4))))
(if (>= count col-change)
(loop (+ pos 1) (+ col col-change) (- count col-change))
(%make-parser str pos (+ col count)))))
(else (%make-parser str pos col))))))
(define code-indent 4)
(define (parser-indented? start end)
(>= (- (parser-col end) (parser-col start)) code-indent))
(define (parser-rest-str parser)
(let ((str (parser-str parser))
(pos (parser-pos parser)))
(if (or (>= pos (string-length str))
(not (char=? (string-ref str pos) #\tab)))
(substring str pos)
(let* ((col (parser-col parser))
(expand (- 4 (modulo col 4))))
(if (= expand 0)
(substring str pos)
(string-append (make-string expand #\space) (substring str (+ pos 1))))))))
(define re-thematic-break (make-regexp "^((\\*[ \t]*){3,}|(_[ \t]*){3,}|(-[ \t]*){3,})[ \t]*$"))
(define re-atx-heading (make-regexp "^(#{1,6})([ \t]+|$)"))
(define re-atx-heading-end (make-regexp "([ \t]+#+[ \t]*)$|(^#+[ \t]*)$"))
(define re-setext-heading (make-regexp "^(=+|-+)[ \t]*$"))
(define re-empty-line (make-regexp "^[ \t]*$"))
(define re-fenced-code (make-regexp "^(```+|~~~+)([^`]*)$"))
(define re-bullet-list-marker (make-regexp "^([-+*])([ \t]|$)"))
(define re-ordered-list-marker (make-regexp "^([0-9]{1,9})([.)])([ \t]|$)"))
(define re-link-definition (make-regexp (string-append "^"
link-label
":[ \t\v]*\n?[ \t\v]*"
link-destination
"([ \t\v]+|[ \t\v]*\n?[ \t\v]*)"
link-title
"?[ \t\v]*(\n|$)")))
(define re-link-label (make-regexp (string-append "^" link-label ":")))
(define re-link-destination-brackets (make-regexp (string-append "^<(([^ <>\n\t\\]|"
escaped-characters
")*)>")))
(define re-link-destination (make-regexp link-destination))
(define re-link-title (make-regexp link-title))
(define (block-quote parser)
(if (and (not (parser-end? parser)) (parser-char=? parser #\>))
(parser-advance parser 1)
#f))
(define (block-quote-rest parser)
(if (and (not (parser-end? parser))
(or (parser-char=? parser #\space)
(parser-char=? parser #\tab)))
(parser-advance parser 1)
parser))
(define (atx-heading parser)
(regexp-exec re-atx-heading (parser-str parser) (parser-pos parser)))
(define (atx-heading-content match)
(let ((end-match (regexp-exec re-atx-heading-end (match:suffix match))))
(if end-match
(match:prefix end-match)
(match:suffix match))))
(define (atx-heading-opening match)
(match:substring match 1))
(define (fenced-code-fence match)
(match:substring match 1))
(define (fenced-code-start match)
(match:start match 1))
(define (fenced-code-info-string match)
(match:substring match 2))
(define (empty-line parser)
(regexp-exec re-empty-line (parser-str parser) (parser-pos parser)))
(define (thematic-break parser)
(regexp-exec re-thematic-break (parser-str parser) (parser-pos parser)))
(define (setext-heading parser)
(regexp-exec re-setext-heading (parser-str parser) (parser-pos parser)))
(define (fenced-code parser)
(regexp-exec re-fenced-code (parser-str parser) (parser-pos parser)))
(define (fenced-code-end parser fence)
(string-match (string-append "^" fence "+$") (parser-str parser) (parser-pos parser)))
(define (bullet-list-marker parser)
(regexp-exec re-bullet-list-marker (parser-str parser) (parser-pos parser)))
(define (bullet-list-rest parser match)
(parser-advance parser (- (match:end match 1) (parser-col parser))))
(define (bullet-list-offset parser parser-rest)
(- (parser-col parser-rest) (parser-col parser)))
(define (bullet-list-spaces parser)
(- (parser-col (parser-advance-next-nonspace parser)) (parser-col parser)))
(define (bullet-list-bullet match)
(match:substring match 1))
(define (ordered-list-marker parser)
(regexp-exec re-ordered-list-marker (parser-str parser) (parser-pos parser)))
(define (ordered-list-rest parser match)
(parser-advance parser (- (match:end match 2) (parser-col parser))))
(define (ordered-list-offset parser parser-rest)
(- (parser-col parser-rest) (parser-col parser)))
(define (ordered-list-spaces parser)
(- (parser-col (parser-advance-next-nonspace parser)) (parser-col parser)))
(define (ordered-list-number match)
(string->number (match:substring match 1)))
(define (ordered-list-delimiter match)
(match:substring match 2))
;; Link Definitions
(define (make-link-definition label destination title rest)
(list label destination title rest))
(define (link-definition-label match)
(first match))
(define (link-definition-destination match)
(second match))
(define (link-definition-title match)
(third match))
(define (link-definition-rest match)
(fourth match))
(define (link-definition str)
(define (link-label parser)
(regexp-exec re-link-label (parser-str parser) (parser-pos parser)))
(define (link-label-rest parser match)
(parser-advance parser (- (match:end match 0) (parser-pos parser))))
(define (link-title parser)
(regexp-exec re-link-title (parser-str parser) (parser-pos parser)))
(define (link-title-match-rest parser match)
(parser-advance parser (- (match:end match 0) (parser-pos parser))))
(define (link-title-rest title-match after-dest)
(parser-advance-next-nonspace
(link-title-match-rest after-dest title-match)))
(define skip-optional-whitespace-newline
(compose parser-advance-next-nonspace
(cut parser-advance-optional <> #\newline)))
(define (parser-rest-empty? parser)
(or (parser-end? parser) (parser-char=? parser #\newline)))
(and-let* ((parser (make-parser str))
(label-match (link-label (parser-advance-next-nonspace parser)))
(after-label (link-label-rest parser label-match))
(before-dest (skip-optional-whitespace-newline after-label))
(dest-match (match-link-destination (parser-advance-next-nonspace before-dest)))
(after-dest (parser-advance-next-nonspace (cdr dest-match))))
(let* ((title-match (link-title (parser-advance-next-nonspace
(skip-optional-whitespace-newline after-dest))))
(after-title (and title-match (link-title-rest title-match after-dest))))
(cond
;; optional title must have no non-whitespace characters after title
((and title-match (parser-rest-empty? after-title))
(make-link-definition (match:substring label-match 1)
(unescape-string (car dest-match))
(unescape-string (match:substring title-match 1))
(parser-rest-str
(skip-optional-whitespace-newline
(link-title-rest title-match after-dest)))))
;; must have no non-whitespace characters after destination
((parser-rest-empty? after-dest)
(make-link-definition (match:substring label-match 1)
(unescape-string (car dest-match))
#f
(parser-rest-str
(skip-optional-whitespace-newline after-dest))))
(else #f)))))
(define (link-destination-brackets parser)
(regexp-exec re-link-destination-brackets (parser-str parser) (parser-pos parser)))
(define (link-destination-normal parser)
(regexp-exec re-link-destination (parser-str parser) (parser-pos parser)))
(define (match-link-destination parser)
(define (link-destination-rest match)
(parser-advance parser (- (match:end match 0) (parser-pos parser))))
(define (match:substring-suffix match)
(cons (match:substring match 0)
(link-destination-rest match)))
(define (remove-brackets pair)
(cons (substring (car pair) 1 (- (string-length (car pair)) 1))
(cdr pair)))
(or (and=> (link-destination-brackets parser)
(compose remove-brackets match:substring-suffix))
(and=> (link-destination-normal parser)
match:substring-suffix)))
guile-commonmark-0.1.2+20240812/commonmark/utils.scm 0000644 0001750 0001750 00000003227 13652433030 021510 0 ustar frankie frankie ;; Copyright (C) 2015, 2016 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark utils)
#:use-module (ice-9 rdelim)
#:export (filter-map&co
read-line-without-nul))
(define (filter-map&co f l k)
"like filter-map but uses a continuation to collect an extra list of values"
(if (null? l)
(k '() '())
(f (car l) (lambda (v d)
(filter-map&co f (cdr l)
(lambda (v2 d2)
(k (if v (cons v v2) v2) (append d d2))))))))
;; Line is one of:
;; - String
;; - eof-object
;; Port -> Line
(define (read-line-without-nul port)
"Return a line of text from PORT replacing '\0' with '\uFFFD' or
returns eof-object."
(define (replace-nul x)
(if (char=? x #\nul) #\xFFFD x))
(let ((line (read-line port)))
(cond ((eof-object? line) line)
((string-any #\nul line) (string-map replace-nul line))
(else line))))
guile-commonmark-0.1.2+20240812/commonmark/sxml.scm 0000644 0001750 0001750 00000012300 13652433030 021323 0 ustar frankie frankie ;; Copyright (C) 2015, 2020 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark sxml)
#:use-module (srfi srfi-1)
#:use-module (sxml simple)
#:use-module (commonmark blocks)
#:use-module (commonmark inlines)
#:use-module (commonmark node)
#:export (commonmark->sxml))
(define* (commonmark->sxml #:optional (string-or-port (current-input-port)))
"Parses a commonmark document from optional argument STRING-OR-PORT or
the current input port into SXML."
(let ((port (if (string? string-or-port)
(open-input-string string-or-port)
string-or-port)))
(document->sxml (parse-inlines (parse-blocks port)))))
(define (document->sxml d)
(if (document-node? d)
(fold (lambda (elem prev) (cons (node->sxml elem) prev)) '() (node-children d))
(error "not a document node")))
(define (node->sxml n)
(cond ((thematic-break-node? n) (thematic-break-node->sxml n))
((paragraph-node? n) (paragraph-node->sxml n))
((block-quote-node? n) (block-quote-node->sxml n))
((code-block-node? n) (code-block-node->sxml n))
((fenced-code-node? n) (fenced-code-node->sxml n))
((heading-node? n) (heading-node->sxml n))
((list-node? n) (list-node->sxml n))
((text-node? n) (text-node->sxml n))
((code-span-node? n) (code-span-node->sxml n))
((softbreak-node? n) (softbreak-node->sxml n))
((hardbreak-node? n) (hardbreak-node->sxml n))
((emphasis-node? n) (emphasis-node->sxml n))
((link-node? n) (link-node->sxml n))
((image-node? n) (image-node->sxml n))
(else (error "unknown node"))))
(define (thematic-break-node->sxml n)
'(hr))
(define (paragraph-node->sxml n)
`(p ,@(fold-nodes node->sxml (node-children n))))
(define (text-node->sxml n)
(last-child n))
(define (code-span-node->sxml n)
`(code ,@(node-children n)))
(define (block-quote-node->sxml n)
`(blockquote ,@(fold-nodes node->sxml (node-children n))))
(define (code-block-node->sxml n)
`(pre (code ,@(node-children n))))
(define (fenced-code-node->sxml n)
`(pre (code ,(infostring (assq-ref (node-data n) 'info-string)),@(node-children n))))
(define (heading-node->sxml n)
`(,(level n) ,@(fold-nodes node->sxml (node-children n))))
(define (list-type n)
(case (assq-ref (node-data n) 'type)
((bullet) 'ul)
(else 'ol)))
(define (list-tight? node)
(assq-ref (node-data node) 'tight))
(define (list-node->sxml n)
`(,(list-type n) ,@(if (list-tight? n)
(fold-nodes tight-item-node->sxml (node-children n))
(fold-nodes item-node->sxml (node-children n)))))
(define (item-node->sxml n)
`(li ,@(fold-nodes node->sxml (node-children n))))
(define (tight-item-node->sxml node)
`(li ,@(if (and (not (null? (node-children node)))
(paragraph-node? (last-child node)))
(fold-nodes node->sxml (node-children (last-child node)))
(fold-nodes node->sxml (node-children node)))))
(define (softbreak-node->sxml n)
"\n")
(define (hardbreak-node->sxml n)
'(br))
(define (emphasis-type n)
(case (assq-ref (node-data n) 'type)
((em) 'em)
(else 'strong)))
(define (emphasis-node->sxml n)
`(,(emphasis-type n) ,@(fold-nodes node->sxml (node-children n))))
(define (destination node)
(assq-ref (node-data node) 'destination))
(define (title node)
(assq-ref (node-data node) 'title))
(define (link-node->sxml node)
(let ((dest (destination node))
(title (title node)))
`(a (@ (href ,dest) ,@(if title (list (list 'title title)) '()))
,@(fold-nodes node->sxml (node-children node)))))
(define (fold-text node)
(fold (lambda (elem prev)
(append (node->text elem) prev))
'()
(node-children node)))
(define (node->text node)
(if (text-node? node)
(node-children node)
(fold-text node)))
(define (alt-text node)
(string-concatenate (fold-text node)))
(define (image-node->sxml node)
(let ((dest (destination node))
(title (title node)))
`(img (@ (src ,dest) (alt ,(alt-text node)) ,@(if title (list (list 'title title)) '())))))
(define (infostring s)
(let ((language (string-trim-both s)))
(if (string-null? language)
'(@)
`(@ (class ,(string-append "language-" language))))))
(define (level n)
(case (assq-ref (node-data n) 'level)
((1) 'h1)
((2) 'h2)
((3) 'h3)
((4) 'h4)
((5) 'h5)
((6) 'h6)))
(define (fold-nodes f ns)
(fold (lambda (elem prev) (cons (f elem) prev)) '() ns))
guile-commonmark-0.1.2+20240812/commonmark/entities.scm 0000644 0001750 0001750 00000151701 13652433030 022175 0 ustar frankie frankie ;; Copyright (C) 2016 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module
(commonmark entities)
#:use-module
(srfi srfi-43)
#:export
(entity->codepoints))
(define entities
#("AElig"
"AMP"
"Aacute"
"Abreve"
"Acirc"
"Acy"
"Afr"
"Agrave"
"Alpha"
"Amacr"
"And"
"Aogon"
"Aopf"
"ApplyFunction"
"Aring"
"Ascr"
"Assign"
"Atilde"
"Auml"
"Backslash"
"Barv"
"Barwed"
"Bcy"
"Because"
"Bernoullis"
"Beta"
"Bfr"
"Bopf"
"Breve"
"Bscr"
"Bumpeq"
"CHcy"
"COPY"
"Cacute"
"Cap"
"CapitalDifferentialD"
"Cayleys"
"Ccaron"
"Ccedil"
"Ccirc"
"Cconint"
"Cdot"
"Cedilla"
"CenterDot"
"Cfr"
"Chi"
"CircleDot"
"CircleMinus"
"CirclePlus"
"CircleTimes"
"ClockwiseContourIntegral"
"CloseCurlyDoubleQuote"
"CloseCurlyQuote"
"Colon"
"Colone"
"Congruent"
"Conint"
"ContourIntegral"
"Copf"
"Coproduct"
"CounterClockwiseContourIntegral"
"Cross"
"Cscr"
"Cup"
"CupCap"
"DD"
"DDotrahd"
"DJcy"
"DScy"
"DZcy"
"Dagger"
"Darr"
"Dashv"
"Dcaron"
"Dcy"
"Del"
"Delta"
"Dfr"
"DiacriticalAcute"
"DiacriticalDot"
"DiacriticalDoubleAcute"
"DiacriticalGrave"
"DiacriticalTilde"
"Diamond"
"DifferentialD"
"Dopf"
"Dot"
"DotDot"
"DotEqual"
"DoubleContourIntegral"
"DoubleDot"
"DoubleDownArrow"
"DoubleLeftArrow"
"DoubleLeftRightArrow"
"DoubleLeftTee"
"DoubleLongLeftArrow"
"DoubleLongLeftRightArrow"
"DoubleLongRightArrow"
"DoubleRightArrow"
"DoubleRightTee"
"DoubleUpArrow"
"DoubleUpDownArrow"
"DoubleVerticalBar"
"DownArrow"
"DownArrowBar"
"DownArrowUpArrow"
"DownBreve"
"DownLeftRightVector"
"DownLeftTeeVector"
"DownLeftVector"
"DownLeftVectorBar"
"DownRightTeeVector"
"DownRightVector"
"DownRightVectorBar"
"DownTee"
"DownTeeArrow"
"Downarrow"
"Dscr"
"Dstrok"
"ENG"
"ETH"
"Eacute"
"Ecaron"
"Ecirc"
"Ecy"
"Edot"
"Efr"
"Egrave"
"Element"
"Emacr"
"EmptySmallSquare"
"EmptyVerySmallSquare"
"Eogon"
"Eopf"
"Epsilon"
"Equal"
"EqualTilde"
"Equilibrium"
"Escr"
"Esim"
"Eta"
"Euml"
"Exists"
"ExponentialE"
"Fcy"
"Ffr"
"FilledSmallSquare"
"FilledVerySmallSquare"
"Fopf"
"ForAll"
"Fouriertrf"
"Fscr"
"GJcy"
"GT"
"Gamma"
"Gammad"
"Gbreve"
"Gcedil"
"Gcirc"
"Gcy"
"Gdot"
"Gfr"
"Gg"
"Gopf"
"GreaterEqual"
"GreaterEqualLess"
"GreaterFullEqual"
"GreaterGreater"
"GreaterLess"
"GreaterSlantEqual"
"GreaterTilde"
"Gscr"
"Gt"
"HARDcy"
"Hacek"
"Hat"
"Hcirc"
"Hfr"
"HilbertSpace"
"Hopf"
"HorizontalLine"
"Hscr"
"Hstrok"
"HumpDownHump"
"HumpEqual"
"IEcy"
"IJlig"
"IOcy"
"Iacute"
"Icirc"
"Icy"
"Idot"
"Ifr"
"Igrave"
"Im"
"Imacr"
"ImaginaryI"
"Implies"
"Int"
"Integral"
"Intersection"
"InvisibleComma"
"InvisibleTimes"
"Iogon"
"Iopf"
"Iota"
"Iscr"
"Itilde"
"Iukcy"
"Iuml"
"Jcirc"
"Jcy"
"Jfr"
"Jopf"
"Jscr"
"Jsercy"
"Jukcy"
"KHcy"
"KJcy"
"Kappa"
"Kcedil"
"Kcy"
"Kfr"
"Kopf"
"Kscr"
"LJcy"
"LT"
"Lacute"
"Lambda"
"Lang"
"Laplacetrf"
"Larr"
"Lcaron"
"Lcedil"
"Lcy"
"LeftAngleBracket"
"LeftArrow"
"LeftArrowBar"
"LeftArrowRightArrow"
"LeftCeiling"
"LeftDoubleBracket"
"LeftDownTeeVector"
"LeftDownVector"
"LeftDownVectorBar"
"LeftFloor"
"LeftRightArrow"
"LeftRightVector"
"LeftTee"
"LeftTeeArrow"
"LeftTeeVector"
"LeftTriangle"
"LeftTriangleBar"
"LeftTriangleEqual"
"LeftUpDownVector"
"LeftUpTeeVector"
"LeftUpVector"
"LeftUpVectorBar"
"LeftVector"
"LeftVectorBar"
"Leftarrow"
"Leftrightarrow"
"LessEqualGreater"
"LessFullEqual"
"LessGreater"
"LessLess"
"LessSlantEqual"
"LessTilde"
"Lfr"
"Ll"
"Lleftarrow"
"Lmidot"
"LongLeftArrow"
"LongLeftRightArrow"
"LongRightArrow"
"Longleftarrow"
"Longleftrightarrow"
"Longrightarrow"
"Lopf"
"LowerLeftArrow"
"LowerRightArrow"
"Lscr"
"Lsh"
"Lstrok"
"Lt"
"Map"
"Mcy"
"MediumSpace"
"Mellintrf"
"Mfr"
"MinusPlus"
"Mopf"
"Mscr"
"Mu"
"NJcy"
"Nacute"
"Ncaron"
"Ncedil"
"Ncy"
"NegativeMediumSpace"
"NegativeThickSpace"
"NegativeThinSpace"
"NegativeVeryThinSpace"
"NestedGreaterGreater"
"NestedLessLess"
"NewLine"
"Nfr"
"NoBreak"
"NonBreakingSpace"
"Nopf"
"Not"
"NotCongruent"
"NotCupCap"
"NotDoubleVerticalBar"
"NotElement"
"NotEqual"
"NotEqualTilde"
"NotExists"
"NotGreater"
"NotGreaterEqual"
"NotGreaterFullEqual"
"NotGreaterGreater"
"NotGreaterLess"
"NotGreaterSlantEqual"
"NotGreaterTilde"
"NotHumpDownHump"
"NotHumpEqual"
"NotLeftTriangle"
"NotLeftTriangleBar"
"NotLeftTriangleEqual"
"NotLess"
"NotLessEqual"
"NotLessGreater"
"NotLessLess"
"NotLessSlantEqual"
"NotLessTilde"
"NotNestedGreaterGreater"
"NotNestedLessLess"
"NotPrecedes"
"NotPrecedesEqual"
"NotPrecedesSlantEqual"
"NotReverseElement"
"NotRightTriangle"
"NotRightTriangleBar"
"NotRightTriangleEqual"
"NotSquareSubset"
"NotSquareSubsetEqual"
"NotSquareSuperset"
"NotSquareSupersetEqual"
"NotSubset"
"NotSubsetEqual"
"NotSucceeds"
"NotSucceedsEqual"
"NotSucceedsSlantEqual"
"NotSucceedsTilde"
"NotSuperset"
"NotSupersetEqual"
"NotTilde"
"NotTildeEqual"
"NotTildeFullEqual"
"NotTildeTilde"
"NotVerticalBar"
"Nscr"
"Ntilde"
"Nu"
"OElig"
"Oacute"
"Ocirc"
"Ocy"
"Odblac"
"Ofr"
"Ograve"
"Omacr"
"Omega"
"Omicron"
"Oopf"
"OpenCurlyDoubleQuote"
"OpenCurlyQuote"
"Or"
"Oscr"
"Oslash"
"Otilde"
"Otimes"
"Ouml"
"OverBar"
"OverBrace"
"OverBracket"
"OverParenthesis"
"PartialD"
"Pcy"
"Pfr"
"Phi"
"Pi"
"PlusMinus"
"Poincareplane"
"Popf"
"Pr"
"Precedes"
"PrecedesEqual"
"PrecedesSlantEqual"
"PrecedesTilde"
"Prime"
"Product"
"Proportion"
"Proportional"
"Pscr"
"Psi"
"QUOT"
"Qfr"
"Qopf"
"Qscr"
"RBarr"
"REG"
"Racute"
"Rang"
"Rarr"
"Rarrtl"
"Rcaron"
"Rcedil"
"Rcy"
"Re"
"ReverseElement"
"ReverseEquilibrium"
"ReverseUpEquilibrium"
"Rfr"
"Rho"
"RightAngleBracket"
"RightArrow"
"RightArrowBar"
"RightArrowLeftArrow"
"RightCeiling"
"RightDoubleBracket"
"RightDownTeeVector"
"RightDownVector"
"RightDownVectorBar"
"RightFloor"
"RightTee"
"RightTeeArrow"
"RightTeeVector"
"RightTriangle"
"RightTriangleBar"
"RightTriangleEqual"
"RightUpDownVector"
"RightUpTeeVector"
"RightUpVector"
"RightUpVectorBar"
"RightVector"
"RightVectorBar"
"Rightarrow"
"Ropf"
"RoundImplies"
"Rrightarrow"
"Rscr"
"Rsh"
"RuleDelayed"
"SHCHcy"
"SHcy"
"SOFTcy"
"Sacute"
"Sc"
"Scaron"
"Scedil"
"Scirc"
"Scy"
"Sfr"
"ShortDownArrow"
"ShortLeftArrow"
"ShortRightArrow"
"ShortUpArrow"
"Sigma"
"SmallCircle"
"Sopf"
"Sqrt"
"Square"
"SquareIntersection"
"SquareSubset"
"SquareSubsetEqual"
"SquareSuperset"
"SquareSupersetEqual"
"SquareUnion"
"Sscr"
"Star"
"Sub"
"Subset"
"SubsetEqual"
"Succeeds"
"SucceedsEqual"
"SucceedsSlantEqual"
"SucceedsTilde"
"SuchThat"
"Sum"
"Sup"
"Superset"
"SupersetEqual"
"Supset"
"THORN"
"TRADE"
"TSHcy"
"TScy"
"Tab"
"Tau"
"Tcaron"
"Tcedil"
"Tcy"
"Tfr"
"Therefore"
"Theta"
"ThickSpace"
"ThinSpace"
"Tilde"
"TildeEqual"
"TildeFullEqual"
"TildeTilde"
"Topf"
"TripleDot"
"Tscr"
"Tstrok"
"Uacute"
"Uarr"
"Uarrocir"
"Ubrcy"
"Ubreve"
"Ucirc"
"Ucy"
"Udblac"
"Ufr"
"Ugrave"
"Umacr"
"UnderBar"
"UnderBrace"
"UnderBracket"
"UnderParenthesis"
"Union"
"UnionPlus"
"Uogon"
"Uopf"
"UpArrow"
"UpArrowBar"
"UpArrowDownArrow"
"UpDownArrow"
"UpEquilibrium"
"UpTee"
"UpTeeArrow"
"Uparrow"
"Updownarrow"
"UpperLeftArrow"
"UpperRightArrow"
"Upsi"
"Upsilon"
"Uring"
"Uscr"
"Utilde"
"Uuml"
"VDash"
"Vbar"
"Vcy"
"Vdash"
"Vdashl"
"Vee"
"Verbar"
"Vert"
"VerticalBar"
"VerticalLine"
"VerticalSeparator"
"VerticalTilde"
"VeryThinSpace"
"Vfr"
"Vopf"
"Vscr"
"Vvdash"
"Wcirc"
"Wedge"
"Wfr"
"Wopf"
"Wscr"
"Xfr"
"Xi"
"Xopf"
"Xscr"
"YAcy"
"YIcy"
"YUcy"
"Yacute"
"Ycirc"
"Ycy"
"Yfr"
"Yopf"
"Yscr"
"Yuml"
"ZHcy"
"Zacute"
"Zcaron"
"Zcy"
"Zdot"
"ZeroWidthSpace"
"Zeta"
"Zfr"
"Zopf"
"Zscr"
"aacute"
"abreve"
"ac"
"acE"
"acd"
"acirc"
"acute"
"acy"
"aelig"
"af"
"afr"
"agrave"
"alefsym"
"aleph"
"alpha"
"amacr"
"amalg"
"amp"
"and"
"andand"
"andd"
"andslope"
"andv"
"ang"
"ange"
"angle"
"angmsd"
"angmsdaa"
"angmsdab"
"angmsdac"
"angmsdad"
"angmsdae"
"angmsdaf"
"angmsdag"
"angmsdah"
"angrt"
"angrtvb"
"angrtvbd"
"angsph"
"angst"
"angzarr"
"aogon"
"aopf"
"ap"
"apE"
"apacir"
"ape"
"apid"
"apos"
"approx"
"approxeq"
"aring"
"ascr"
"ast"
"asymp"
"asympeq"
"atilde"
"auml"
"awconint"
"awint"
"bNot"
"backcong"
"backepsilon"
"backprime"
"backsim"
"backsimeq"
"barvee"
"barwed"
"barwedge"
"bbrk"
"bbrktbrk"
"bcong"
"bcy"
"bdquo"
"becaus"
"because"
"bemptyv"
"bepsi"
"bernou"
"beta"
"beth"
"between"
"bfr"
"bigcap"
"bigcirc"
"bigcup"
"bigodot"
"bigoplus"
"bigotimes"
"bigsqcup"
"bigstar"
"bigtriangledown"
"bigtriangleup"
"biguplus"
"bigvee"
"bigwedge"
"bkarow"
"blacklozenge"
"blacksquare"
"blacktriangle"
"blacktriangledown"
"blacktriangleleft"
"blacktriangleright"
"blank"
"blk12"
"blk14"
"blk34"
"block"
"bne"
"bnequiv"
"bnot"
"bopf"
"bot"
"bottom"
"bowtie"
"boxDL"
"boxDR"
"boxDl"
"boxDr"
"boxH"
"boxHD"
"boxHU"
"boxHd"
"boxHu"
"boxUL"
"boxUR"
"boxUl"
"boxUr"
"boxV"
"boxVH"
"boxVL"
"boxVR"
"boxVh"
"boxVl"
"boxVr"
"boxbox"
"boxdL"
"boxdR"
"boxdl"
"boxdr"
"boxh"
"boxhD"
"boxhU"
"boxhd"
"boxhu"
"boxminus"
"boxplus"
"boxtimes"
"boxuL"
"boxuR"
"boxul"
"boxur"
"boxv"
"boxvH"
"boxvL"
"boxvR"
"boxvh"
"boxvl"
"boxvr"
"bprime"
"breve"
"brvbar"
"bscr"
"bsemi"
"bsim"
"bsime"
"bsol"
"bsolb"
"bsolhsub"
"bull"
"bullet"
"bump"
"bumpE"
"bumpe"
"bumpeq"
"cacute"
"cap"
"capand"
"capbrcup"
"capcap"
"capcup"
"capdot"
"caps"
"caret"
"caron"
"ccaps"
"ccaron"
"ccedil"
"ccirc"
"ccups"
"ccupssm"
"cdot"
"cedil"
"cemptyv"
"cent"
"centerdot"
"cfr"
"chcy"
"check"
"checkmark"
"chi"
"cir"
"cirE"
"circ"
"circeq"
"circlearrowleft"
"circlearrowright"
"circledR"
"circledS"
"circledast"
"circledcirc"
"circleddash"
"cire"
"cirfnint"
"cirmid"
"cirscir"
"clubs"
"clubsuit"
"colon"
"colone"
"coloneq"
"comma"
"commat"
"comp"
"compfn"
"complement"
"complexes"
"cong"
"congdot"
"conint"
"copf"
"coprod"
"copy"
"copysr"
"crarr"
"cross"
"cscr"
"csub"
"csube"
"csup"
"csupe"
"ctdot"
"cudarrl"
"cudarrr"
"cuepr"
"cuesc"
"cularr"
"cularrp"
"cup"
"cupbrcap"
"cupcap"
"cupcup"
"cupdot"
"cupor"
"cups"
"curarr"
"curarrm"
"curlyeqprec"
"curlyeqsucc"
"curlyvee"
"curlywedge"
"curren"
"curvearrowleft"
"curvearrowright"
"cuvee"
"cuwed"
"cwconint"
"cwint"
"cylcty"
"dArr"
"dHar"
"dagger"
"daleth"
"darr"
"dash"
"dashv"
"dbkarow"
"dblac"
"dcaron"
"dcy"
"dd"
"ddagger"
"ddarr"
"ddotseq"
"deg"
"delta"
"demptyv"
"dfisht"
"dfr"
"dharl"
"dharr"
"diam"
"diamond"
"diamondsuit"
"diams"
"die"
"digamma"
"disin"
"div"
"divide"
"divideontimes"
"divonx"
"djcy"
"dlcorn"
"dlcrop"
"dollar"
"dopf"
"dot"
"doteq"
"doteqdot"
"dotminus"
"dotplus"
"dotsquare"
"doublebarwedge"
"downarrow"
"downdownarrows"
"downharpoonleft"
"downharpoonright"
"drbkarow"
"drcorn"
"drcrop"
"dscr"
"dscy"
"dsol"
"dstrok"
"dtdot"
"dtri"
"dtrif"
"duarr"
"duhar"
"dwangle"
"dzcy"
"dzigrarr"
"eDDot"
"eDot"
"eacute"
"easter"
"ecaron"
"ecir"
"ecirc"
"ecolon"
"ecy"
"edot"
"ee"
"efDot"
"efr"
"eg"
"egrave"
"egs"
"egsdot"
"el"
"elinters"
"ell"
"els"
"elsdot"
"emacr"
"empty"
"emptyset"
"emptyv"
"emsp"
"emsp13"
"emsp14"
"eng"
"ensp"
"eogon"
"eopf"
"epar"
"eparsl"
"eplus"
"epsi"
"epsilon"
"epsiv"
"eqcirc"
"eqcolon"
"eqsim"
"eqslantgtr"
"eqslantless"
"equals"
"equest"
"equiv"
"equivDD"
"eqvparsl"
"erDot"
"erarr"
"escr"
"esdot"
"esim"
"eta"
"eth"
"euml"
"euro"
"excl"
"exist"
"expectation"
"exponentiale"
"fallingdotseq"
"fcy"
"female"
"ffilig"
"fflig"
"ffllig"
"ffr"
"filig"
"fjlig"
"flat"
"fllig"
"fltns"
"fnof"
"fopf"
"forall"
"fork"
"forkv"
"fpartint"
"frac12"
"frac13"
"frac14"
"frac15"
"frac16"
"frac18"
"frac23"
"frac25"
"frac34"
"frac35"
"frac38"
"frac45"
"frac56"
"frac58"
"frac78"
"frasl"
"frown"
"fscr"
"gE"
"gEl"
"gacute"
"gamma"
"gammad"
"gap"
"gbreve"
"gcirc"
"gcy"
"gdot"
"ge"
"gel"
"geq"
"geqq"
"geqslant"
"ges"
"gescc"
"gesdot"
"gesdoto"
"gesdotol"
"gesl"
"gesles"
"gfr"
"gg"
"ggg"
"gimel"
"gjcy"
"gl"
"glE"
"gla"
"glj"
"gnE"
"gnap"
"gnapprox"
"gne"
"gneq"
"gneqq"
"gnsim"
"gopf"
"grave"
"gscr"
"gsim"
"gsime"
"gsiml"
"gt"
"gtcc"
"gtcir"
"gtdot"
"gtlPar"
"gtquest"
"gtrapprox"
"gtrarr"
"gtrdot"
"gtreqless"
"gtreqqless"
"gtrless"
"gtrsim"
"gvertneqq"
"gvnE"
"hArr"
"hairsp"
"half"
"hamilt"
"hardcy"
"harr"
"harrcir"
"harrw"
"hbar"
"hcirc"
"hearts"
"heartsuit"
"hellip"
"hercon"
"hfr"
"hksearow"
"hkswarow"
"hoarr"
"homtht"
"hookleftarrow"
"hookrightarrow"
"hopf"
"horbar"
"hscr"
"hslash"
"hstrok"
"hybull"
"hyphen"
"iacute"
"ic"
"icirc"
"icy"
"iecy"
"iexcl"
"iff"
"ifr"
"igrave"
"ii"
"iiiint"
"iiint"
"iinfin"
"iiota"
"ijlig"
"imacr"
"image"
"imagline"
"imagpart"
"imath"
"imof"
"imped"
"in"
"incare"
"infin"
"infintie"
"inodot"
"int"
"intcal"
"integers"
"intercal"
"intlarhk"
"intprod"
"iocy"
"iogon"
"iopf"
"iota"
"iprod"
"iquest"
"iscr"
"isin"
"isinE"
"isindot"
"isins"
"isinsv"
"isinv"
"it"
"itilde"
"iukcy"
"iuml"
"jcirc"
"jcy"
"jfr"
"jmath"
"jopf"
"jscr"
"jsercy"
"jukcy"
"kappa"
"kappav"
"kcedil"
"kcy"
"kfr"
"kgreen"
"khcy"
"kjcy"
"kopf"
"kscr"
"lAarr"
"lArr"
"lAtail"
"lBarr"
"lE"
"lEg"
"lHar"
"lacute"
"laemptyv"
"lagran"
"lambda"
"lang"
"langd"
"langle"
"lap"
"laquo"
"larr"
"larrb"
"larrbfs"
"larrfs"
"larrhk"
"larrlp"
"larrpl"
"larrsim"
"larrtl"
"lat"
"latail"
"late"
"lates"
"lbarr"
"lbbrk"
"lbrace"
"lbrack"
"lbrke"
"lbrksld"
"lbrkslu"
"lcaron"
"lcedil"
"lceil"
"lcub"
"lcy"
"ldca"
"ldquo"
"ldquor"
"ldrdhar"
"ldrushar"
"ldsh"
"le"
"leftarrow"
"leftarrowtail"
"leftharpoondown"
"leftharpoonup"
"leftleftarrows"
"leftrightarrow"
"leftrightarrows"
"leftrightharpoons"
"leftrightsquigarrow"
"leftthreetimes"
"leg"
"leq"
"leqq"
"leqslant"
"les"
"lescc"
"lesdot"
"lesdoto"
"lesdotor"
"lesg"
"lesges"
"lessapprox"
"lessdot"
"lesseqgtr"
"lesseqqgtr"
"lessgtr"
"lesssim"
"lfisht"
"lfloor"
"lfr"
"lg"
"lgE"
"lhard"
"lharu"
"lharul"
"lhblk"
"ljcy"
"ll"
"llarr"
"llcorner"
"llhard"
"lltri"
"lmidot"
"lmoust"
"lmoustache"
"lnE"
"lnap"
"lnapprox"
"lne"
"lneq"
"lneqq"
"lnsim"
"loang"
"loarr"
"lobrk"
"longleftarrow"
"longleftrightarrow"
"longmapsto"
"longrightarrow"
"looparrowleft"
"looparrowright"
"lopar"
"lopf"
"loplus"
"lotimes"
"lowast"
"lowbar"
"loz"
"lozenge"
"lozf"
"lpar"
"lparlt"
"lrarr"
"lrcorner"
"lrhar"
"lrhard"
"lrm"
"lrtri"
"lsaquo"
"lscr"
"lsh"
"lsim"
"lsime"
"lsimg"
"lsqb"
"lsquo"
"lsquor"
"lstrok"
"lt"
"ltcc"
"ltcir"
"ltdot"
"lthree"
"ltimes"
"ltlarr"
"ltquest"
"ltrPar"
"ltri"
"ltrie"
"ltrif"
"lurdshar"
"luruhar"
"lvertneqq"
"lvnE"
"mDDot"
"macr"
"male"
"malt"
"maltese"
"map"
"mapsto"
"mapstodown"
"mapstoleft"
"mapstoup"
"marker"
"mcomma"
"mcy"
"mdash"
"measuredangle"
"mfr"
"mho"
"micro"
"mid"
"midast"
"midcir"
"middot"
"minus"
"minusb"
"minusd"
"minusdu"
"mlcp"
"mldr"
"mnplus"
"models"
"mopf"
"mp"
"mscr"
"mstpos"
"mu"
"multimap"
"mumap"
"nGg"
"nGt"
"nGtv"
"nLeftarrow"
"nLeftrightarrow"
"nLl"
"nLt"
"nLtv"
"nRightarrow"
"nVDash"
"nVdash"
"nabla"
"nacute"
"nang"
"nap"
"napE"
"napid"
"napos"
"napprox"
"natur"
"natural"
"naturals"
"nbsp"
"nbump"
"nbumpe"
"ncap"
"ncaron"
"ncedil"
"ncong"
"ncongdot"
"ncup"
"ncy"
"ndash"
"ne"
"neArr"
"nearhk"
"nearr"
"nearrow"
"nedot"
"nequiv"
"nesear"
"nesim"
"nexist"
"nexists"
"nfr"
"ngE"
"nge"
"ngeq"
"ngeqq"
"ngeqslant"
"nges"
"ngsim"
"ngt"
"ngtr"
"nhArr"
"nharr"
"nhpar"
"ni"
"nis"
"nisd"
"niv"
"njcy"
"nlArr"
"nlE"
"nlarr"
"nldr"
"nle"
"nleftarrow"
"nleftrightarrow"
"nleq"
"nleqq"
"nleqslant"
"nles"
"nless"
"nlsim"
"nlt"
"nltri"
"nltrie"
"nmid"
"nopf"
"not"
"notin"
"notinE"
"notindot"
"notinva"
"notinvb"
"notinvc"
"notni"
"notniva"
"notnivb"
"notnivc"
"npar"
"nparallel"
"nparsl"
"npart"
"npolint"
"npr"
"nprcue"
"npre"
"nprec"
"npreceq"
"nrArr"
"nrarr"
"nrarrc"
"nrarrw"
"nrightarrow"
"nrtri"
"nrtrie"
"nsc"
"nsccue"
"nsce"
"nscr"
"nshortmid"
"nshortparallel"
"nsim"
"nsime"
"nsimeq"
"nsmid"
"nspar"
"nsqsube"
"nsqsupe"
"nsub"
"nsubE"
"nsube"
"nsubset"
"nsubseteq"
"nsubseteqq"
"nsucc"
"nsucceq"
"nsup"
"nsupE"
"nsupe"
"nsupset"
"nsupseteq"
"nsupseteqq"
"ntgl"
"ntilde"
"ntlg"
"ntriangleleft"
"ntrianglelefteq"
"ntriangleright"
"ntrianglerighteq"
"nu"
"num"
"numero"
"numsp"
"nvDash"
"nvHarr"
"nvap"
"nvdash"
"nvge"
"nvgt"
"nvinfin"
"nvlArr"
"nvle"
"nvlt"
"nvltrie"
"nvrArr"
"nvrtrie"
"nvsim"
"nwArr"
"nwarhk"
"nwarr"
"nwarrow"
"nwnear"
"oS"
"oacute"
"oast"
"ocir"
"ocirc"
"ocy"
"odash"
"odblac"
"odiv"
"odot"
"odsold"
"oelig"
"ofcir"
"ofr"
"ogon"
"ograve"
"ogt"
"ohbar"
"ohm"
"oint"
"olarr"
"olcir"
"olcross"
"oline"
"olt"
"omacr"
"omega"
"omicron"
"omid"
"ominus"
"oopf"
"opar"
"operp"
"oplus"
"or"
"orarr"
"ord"
"order"
"orderof"
"ordf"
"ordm"
"origof"
"oror"
"orslope"
"orv"
"oscr"
"oslash"
"osol"
"otilde"
"otimes"
"otimesas"
"ouml"
"ovbar"
"par"
"para"
"parallel"
"parsim"
"parsl"
"part"
"pcy"
"percnt"
"period"
"permil"
"perp"
"pertenk"
"pfr"
"phi"
"phiv"
"phmmat"
"phone"
"pi"
"pitchfork"
"piv"
"planck"
"planckh"
"plankv"
"plus"
"plusacir"
"plusb"
"pluscir"
"plusdo"
"plusdu"
"pluse"
"plusmn"
"plussim"
"plustwo"
"pm"
"pointint"
"popf"
"pound"
"pr"
"prE"
"prap"
"prcue"
"pre"
"prec"
"precapprox"
"preccurlyeq"
"preceq"
"precnapprox"
"precneqq"
"precnsim"
"precsim"
"prime"
"primes"
"prnE"
"prnap"
"prnsim"
"prod"
"profalar"
"profline"
"profsurf"
"prop"
"propto"
"prsim"
"prurel"
"pscr"
"psi"
"puncsp"
"qfr"
"qint"
"qopf"
"qprime"
"qscr"
"quaternions"
"quatint"
"quest"
"questeq"
"quot"
"rAarr"
"rArr"
"rAtail"
"rBarr"
"rHar"
"race"
"racute"
"radic"
"raemptyv"
"rang"
"rangd"
"range"
"rangle"
"raquo"
"rarr"
"rarrap"
"rarrb"
"rarrbfs"
"rarrc"
"rarrfs"
"rarrhk"
"rarrlp"
"rarrpl"
"rarrsim"
"rarrtl"
"rarrw"
"ratail"
"ratio"
"rationals"
"rbarr"
"rbbrk"
"rbrace"
"rbrack"
"rbrke"
"rbrksld"
"rbrkslu"
"rcaron"
"rcedil"
"rceil"
"rcub"
"rcy"
"rdca"
"rdldhar"
"rdquo"
"rdquor"
"rdsh"
"real"
"realine"
"realpart"
"reals"
"rect"
"reg"
"rfisht"
"rfloor"
"rfr"
"rhard"
"rharu"
"rharul"
"rho"
"rhov"
"rightarrow"
"rightarrowtail"
"rightharpoondown"
"rightharpoonup"
"rightleftarrows"
"rightleftharpoons"
"rightrightarrows"
"rightsquigarrow"
"rightthreetimes"
"ring"
"risingdotseq"
"rlarr"
"rlhar"
"rlm"
"rmoust"
"rmoustache"
"rnmid"
"roang"
"roarr"
"robrk"
"ropar"
"ropf"
"roplus"
"rotimes"
"rpar"
"rpargt"
"rppolint"
"rrarr"
"rsaquo"
"rscr"
"rsh"
"rsqb"
"rsquo"
"rsquor"
"rthree"
"rtimes"
"rtri"
"rtrie"
"rtrif"
"rtriltri"
"ruluhar"
"rx"
"sacute"
"sbquo"
"sc"
"scE"
"scap"
"scaron"
"sccue"
"sce"
"scedil"
"scirc"
"scnE"
"scnap"
"scnsim"
"scpolint"
"scsim"
"scy"
"sdot"
"sdotb"
"sdote"
"seArr"
"searhk"
"searr"
"searrow"
"sect"
"semi"
"seswar"
"setminus"
"setmn"
"sext"
"sfr"
"sfrown"
"sharp"
"shchcy"
"shcy"
"shortmid"
"shortparallel"
"shy"
"sigma"
"sigmaf"
"sigmav"
"sim"
"simdot"
"sime"
"simeq"
"simg"
"simgE"
"siml"
"simlE"
"simne"
"simplus"
"simrarr"
"slarr"
"smallsetminus"
"smashp"
"smeparsl"
"smid"
"smile"
"smt"
"smte"
"smtes"
"softcy"
"sol"
"solb"
"solbar"
"sopf"
"spades"
"spadesuit"
"spar"
"sqcap"
"sqcaps"
"sqcup"
"sqcups"
"sqsub"
"sqsube"
"sqsubset"
"sqsubseteq"
"sqsup"
"sqsupe"
"sqsupset"
"sqsupseteq"
"squ"
"square"
"squarf"
"squf"
"srarr"
"sscr"
"ssetmn"
"ssmile"
"sstarf"
"star"
"starf"
"straightepsilon"
"straightphi"
"strns"
"sub"
"subE"
"subdot"
"sube"
"subedot"
"submult"
"subnE"
"subne"
"subplus"
"subrarr"
"subset"
"subseteq"
"subseteqq"
"subsetneq"
"subsetneqq"
"subsim"
"subsub"
"subsup"
"succ"
"succapprox"
"succcurlyeq"
"succeq"
"succnapprox"
"succneqq"
"succnsim"
"succsim"
"sum"
"sung"
"sup"
"sup1"
"sup2"
"sup3"
"supE"
"supdot"
"supdsub"
"supe"
"supedot"
"suphsol"
"suphsub"
"suplarr"
"supmult"
"supnE"
"supne"
"supplus"
"supset"
"supseteq"
"supseteqq"
"supsetneq"
"supsetneqq"
"supsim"
"supsub"
"supsup"
"swArr"
"swarhk"
"swarr"
"swarrow"
"swnwar"
"szlig"
"target"
"tau"
"tbrk"
"tcaron"
"tcedil"
"tcy"
"tdot"
"telrec"
"tfr"
"there4"
"therefore"
"theta"
"thetasym"
"thetav"
"thickapprox"
"thicksim"
"thinsp"
"thkap"
"thksim"
"thorn"
"tilde"
"times"
"timesb"
"timesbar"
"timesd"
"tint"
"toea"
"top"
"topbot"
"topcir"
"topf"
"topfork"
"tosa"
"tprime"
"trade"
"triangle"
"triangledown"
"triangleleft"
"trianglelefteq"
"triangleq"
"triangleright"
"trianglerighteq"
"tridot"
"trie"
"triminus"
"triplus"
"trisb"
"tritime"
"trpezium"
"tscr"
"tscy"
"tshcy"
"tstrok"
"twixt"
"twoheadleftarrow"
"twoheadrightarrow"
"uArr"
"uHar"
"uacute"
"uarr"
"ubrcy"
"ubreve"
"ucirc"
"ucy"
"udarr"
"udblac"
"udhar"
"ufisht"
"ufr"
"ugrave"
"uharl"
"uharr"
"uhblk"
"ulcorn"
"ulcorner"
"ulcrop"
"ultri"
"umacr"
"uml"
"uogon"
"uopf"
"uparrow"
"updownarrow"
"upharpoonleft"
"upharpoonright"
"uplus"
"upsi"
"upsih"
"upsilon"
"upuparrows"
"urcorn"
"urcorner"
"urcrop"
"uring"
"urtri"
"uscr"
"utdot"
"utilde"
"utri"
"utrif"
"uuarr"
"uuml"
"uwangle"
"vArr"
"vBar"
"vBarv"
"vDash"
"vangrt"
"varepsilon"
"varkappa"
"varnothing"
"varphi"
"varpi"
"varpropto"
"varr"
"varrho"
"varsigma"
"varsubsetneq"
"varsubsetneqq"
"varsupsetneq"
"varsupsetneqq"
"vartheta"
"vartriangleleft"
"vartriangleright"
"vcy"
"vdash"
"vee"
"veebar"
"veeeq"
"vellip"
"verbar"
"vert"
"vfr"
"vltri"
"vnsub"
"vnsup"
"vopf"
"vprop"
"vrtri"
"vscr"
"vsubnE"
"vsubne"
"vsupnE"
"vsupne"
"vzigzag"
"wcirc"
"wedbar"
"wedge"
"wedgeq"
"weierp"
"wfr"
"wopf"
"wp"
"wr"
"wreath"
"wscr"
"xcap"
"xcirc"
"xcup"
"xdtri"
"xfr"
"xhArr"
"xharr"
"xi"
"xlArr"
"xlarr"
"xmap"
"xnis"
"xodot"
"xopf"
"xoplus"
"xotime"
"xrArr"
"xrarr"
"xscr"
"xsqcup"
"xuplus"
"xutri"
"xvee"
"xwedge"
"yacute"
"yacy"
"ycirc"
"ycy"
"yen"
"yfr"
"yicy"
"yopf"
"yscr"
"yucy"
"yuml"
"zacute"
"zcaron"
"zcy"
"zdot"
"zeetrf"
"zeta"
"zfr"
"zhcy"
"zigrarr"
"zopf"
"zscr"
"zwj"
"zwnj"))
(define codepoints
#((198)
(38)
(193)
(258)
(194)
(1040)
(120068)
(192)
(913)
(256)
(10835)
(260)
(120120)
(8289)
(197)
(119964)
(8788)
(195)
(196)
(8726)
(10983)
(8966)
(1041)
(8757)
(8492)
(914)
(120069)
(120121)
(728)
(8492)
(8782)
(1063)
(169)
(262)
(8914)
(8517)
(8493)
(268)
(199)
(264)
(8752)
(266)
(184)
(183)
(8493)
(935)
(8857)
(8854)
(8853)
(8855)
(8754)
(8221)
(8217)
(8759)
(10868)
(8801)
(8751)
(8750)
(8450)
(8720)
(8755)
(10799)
(119966)
(8915)
(8781)
(8517)
(10513)
(1026)
(1029)
(1039)
(8225)
(8609)
(10980)
(270)
(1044)
(8711)
(916)
(120071)
(180)
(729)
(733)
(96)
(732)
(8900)
(8518)
(120123)
(168)
(8412)
(8784)
(8751)
(168)
(8659)
(8656)
(8660)
(10980)
(10232)
(10234)
(10233)
(8658)
(8872)
(8657)
(8661)
(8741)
(8595)
(10515)
(8693)
(785)
(10576)
(10590)
(8637)
(10582)
(10591)
(8641)
(10583)
(8868)
(8615)
(8659)
(119967)
(272)
(330)
(208)
(201)
(282)
(202)
(1069)
(278)
(120072)
(200)
(8712)
(274)
(9723)
(9643)
(280)
(120124)
(917)
(10869)
(8770)
(8652)
(8496)
(10867)
(919)
(203)
(8707)
(8519)
(1060)
(120073)
(9724)
(9642)
(120125)
(8704)
(8497)
(8497)
(1027)
(62)
(915)
(988)
(286)
(290)
(284)
(1043)
(288)
(120074)
(8921)
(120126)
(8805)
(8923)
(8807)
(10914)
(8823)
(10878)
(8819)
(119970)
(8811)
(1066)
(711)
(94)
(292)
(8460)
(8459)
(8461)
(9472)
(8459)
(294)
(8782)
(8783)
(1045)
(306)
(1025)
(205)
(206)
(1048)
(304)
(8465)
(204)
(8465)
(298)
(8520)
(8658)
(8748)
(8747)
(8898)
(8291)
(8290)
(302)
(120128)
(921)
(8464)
(296)
(1030)
(207)
(308)
(1049)
(120077)
(120129)
(119973)
(1032)
(1028)
(1061)
(1036)
(922)
(310)
(1050)
(120078)
(120130)
(119974)
(1033)
(60)
(313)
(923)
(10218)
(8466)
(8606)
(317)
(315)
(1051)
(10216)
(8592)
(8676)
(8646)
(8968)
(10214)
(10593)
(8643)
(10585)
(8970)
(8596)
(10574)
(8867)
(8612)
(10586)
(8882)
(10703)
(8884)
(10577)
(10592)
(8639)
(10584)
(8636)
(10578)
(8656)
(8660)
(8922)
(8806)
(8822)
(10913)
(10877)
(8818)
(120079)
(8920)
(8666)
(319)
(10229)
(10231)
(10230)
(10232)
(10234)
(10233)
(120131)
(8601)
(8600)
(8466)
(8624)
(321)
(8810)
(10501)
(1052)
(8287)
(8499)
(120080)
(8723)
(120132)
(8499)
(924)
(1034)
(323)
(327)
(325)
(1053)
(8203)
(8203)
(8203)
(8203)
(8811)
(8810)
(10)
(120081)
(8288)
(160)
(8469)
(10988)
(8802)
(8813)
(8742)
(8713)
(8800)
(8770 824)
(8708)
(8815)
(8817)
(8807 824)
(8811 824)
(8825)
(10878 824)
(8821)
(8782 824)
(8783 824)
(8938)
(10703 824)
(8940)
(8814)
(8816)
(8824)
(8810 824)
(10877 824)
(8820)
(10914 824)
(10913 824)
(8832)
(10927 824)
(8928)
(8716)
(8939)
(10704 824)
(8941)
(8847 824)
(8930)
(8848 824)
(8931)
(8834 8402)
(8840)
(8833)
(10928 824)
(8929)
(8831 824)
(8835 8402)
(8841)
(8769)
(8772)
(8775)
(8777)
(8740)
(119977)
(209)
(925)
(338)
(211)
(212)
(1054)
(336)
(120082)
(210)
(332)
(937)
(927)
(120134)
(8220)
(8216)
(10836)
(119978)
(216)
(213)
(10807)
(214)
(8254)
(9182)
(9140)
(9180)
(8706)
(1055)
(120083)
(934)
(928)
(177)
(8460)
(8473)
(10939)
(8826)
(10927)
(8828)
(8830)
(8243)
(8719)
(8759)
(8733)
(119979)
(936)
(34)
(120084)
(8474)
(119980)
(10512)
(174)
(340)
(10219)
(8608)
(10518)
(344)
(342)
(1056)
(8476)
(8715)
(8651)
(10607)
(8476)
(929)
(10217)
(8594)
(8677)
(8644)
(8969)
(10215)
(10589)
(8642)
(10581)
(8971)
(8866)
(8614)
(10587)
(8883)
(10704)
(8885)
(10575)
(10588)
(8638)
(10580)
(8640)
(10579)
(8658)
(8477)
(10608)
(8667)
(8475)
(8625)
(10740)
(1065)
(1064)
(1068)
(346)
(10940)
(352)
(350)
(348)
(1057)
(120086)
(8595)
(8592)
(8594)
(8593)
(931)
(8728)
(120138)
(8730)
(9633)
(8851)
(8847)
(8849)
(8848)
(8850)
(8852)
(119982)
(8902)
(8912)
(8912)
(8838)
(8827)
(10928)
(8829)
(8831)
(8715)
(8721)
(8913)
(8835)
(8839)
(8913)
(222)
(8482)
(1035)
(1062)
(9)
(932)
(356)
(354)
(1058)
(120087)
(8756)
(920)
(8287 8202)
(8201)
(8764)
(8771)
(8773)
(8776)
(120139)
(8411)
(119983)
(358)
(218)
(8607)
(10569)
(1038)
(364)
(219)
(1059)
(368)
(120088)
(217)
(362)
(95)
(9183)
(9141)
(9181)
(8899)
(8846)
(370)
(120140)
(8593)
(10514)
(8645)
(8597)
(10606)
(8869)
(8613)
(8657)
(8661)
(8598)
(8599)
(978)
(933)
(366)
(119984)
(360)
(220)
(8875)
(10987)
(1042)
(8873)
(10982)
(8897)
(8214)
(8214)
(8739)
(124)
(10072)
(8768)
(8202)
(120089)
(120141)
(119985)
(8874)
(372)
(8896)
(120090)
(120142)
(119986)
(120091)
(926)
(120143)
(119987)
(1071)
(1031)
(1070)
(221)
(374)
(1067)
(120092)
(120144)
(119988)
(376)
(1046)
(377)
(381)
(1047)
(379)
(8203)
(918)
(8488)
(8484)
(119989)
(225)
(259)
(8766)
(8766 819)
(8767)
(226)
(180)
(1072)
(230)
(8289)
(120094)
(224)
(8501)
(8501)
(945)
(257)
(10815)
(38)
(8743)
(10837)
(10844)
(10840)
(10842)
(8736)
(10660)
(8736)
(8737)
(10664)
(10665)
(10666)
(10667)
(10668)
(10669)
(10670)
(10671)
(8735)
(8894)
(10653)
(8738)
(197)
(9084)
(261)
(120146)
(8776)
(10864)
(10863)
(8778)
(8779)
(39)
(8776)
(8778)
(229)
(119990)
(42)
(8776)
(8781)
(227)
(228)
(8755)
(10769)
(10989)
(8780)
(1014)
(8245)
(8765)
(8909)
(8893)
(8965)
(8965)
(9141)
(9142)
(8780)
(1073)
(8222)
(8757)
(8757)
(10672)
(1014)
(8492)
(946)
(8502)
(8812)
(120095)
(8898)
(9711)
(8899)
(10752)
(10753)
(10754)
(10758)
(9733)
(9661)
(9651)
(10756)
(8897)
(8896)
(10509)
(10731)
(9642)
(9652)
(9662)
(9666)
(9656)
(9251)
(9618)
(9617)
(9619)
(9608)
(61 8421)
(8801 8421)
(8976)
(120147)
(8869)
(8869)
(8904)
(9559)
(9556)
(9558)
(9555)
(9552)
(9574)
(9577)
(9572)
(9575)
(9565)
(9562)
(9564)
(9561)
(9553)
(9580)
(9571)
(9568)
(9579)
(9570)
(9567)
(10697)
(9557)
(9554)
(9488)
(9484)
(9472)
(9573)
(9576)
(9516)
(9524)
(8863)
(8862)
(8864)
(9563)
(9560)
(9496)
(9492)
(9474)
(9578)
(9569)
(9566)
(9532)
(9508)
(9500)
(8245)
(728)
(166)
(119991)
(8271)
(8765)
(8909)
(92)
(10693)
(10184)
(8226)
(8226)
(8782)
(10926)
(8783)
(8783)
(263)
(8745)
(10820)
(10825)
(10827)
(10823)
(10816)
(8745 65024)
(8257)
(711)
(10829)
(269)
(231)
(265)
(10828)
(10832)
(267)
(184)
(10674)
(162)
(183)
(120096)
(1095)
(10003)
(10003)
(967)
(9675)
(10691)
(710)
(8791)
(8634)
(8635)
(174)
(9416)
(8859)
(8858)
(8861)
(8791)
(10768)
(10991)
(10690)
(9827)
(9827)
(58)
(8788)
(8788)
(44)
(64)
(8705)
(8728)
(8705)
(8450)
(8773)
(10861)
(8750)
(120148)
(8720)
(169)
(8471)
(8629)
(10007)
(119992)
(10959)
(10961)
(10960)
(10962)
(8943)
(10552)
(10549)
(8926)
(8927)
(8630)
(10557)
(8746)
(10824)
(10822)
(10826)
(8845)
(10821)
(8746 65024)
(8631)
(10556)
(8926)
(8927)
(8910)
(8911)
(164)
(8630)
(8631)
(8910)
(8911)
(8754)
(8753)
(9005)
(8659)
(10597)
(8224)
(8504)
(8595)
(8208)
(8867)
(10511)
(733)
(271)
(1076)
(8518)
(8225)
(8650)
(10871)
(176)
(948)
(10673)
(10623)
(120097)
(8643)
(8642)
(8900)
(8900)
(9830)
(9830)
(168)
(989)
(8946)
(247)
(247)
(8903)
(8903)
(1106)
(8990)
(8973)
(36)
(120149)
(729)
(8784)
(8785)
(8760)
(8724)
(8865)
(8966)
(8595)
(8650)
(8643)
(8642)
(10512)
(8991)
(8972)
(119993)
(1109)
(10742)
(273)
(8945)
(9663)
(9662)
(8693)
(10607)
(10662)
(1119)
(10239)
(10871)
(8785)
(233)
(10862)
(283)
(8790)
(234)
(8789)
(1101)
(279)
(8519)
(8786)
(120098)
(10906)
(232)
(10902)
(10904)
(10905)
(9191)
(8467)
(10901)
(10903)
(275)
(8709)
(8709)
(8709)
(8195)
(8196)
(8197)
(331)
(8194)
(281)
(120150)
(8917)
(10723)
(10865)
(949)
(949)
(1013)
(8790)
(8789)
(8770)
(10902)
(10901)
(61)
(8799)
(8801)
(10872)
(10725)
(8787)
(10609)
(8495)
(8784)
(8770)
(951)
(240)
(235)
(8364)
(33)
(8707)
(8496)
(8519)
(8786)
(1092)
(9792)
(64259)
(64256)
(64260)
(120099)
(64257)
(102 106)
(9837)
(64258)
(9649)
(402)
(120151)
(8704)
(8916)
(10969)
(10765)
(189)
(8531)
(188)
(8533)
(8537)
(8539)
(8532)
(8534)
(190)
(8535)
(8540)
(8536)
(8538)
(8541)
(8542)
(8260)
(8994)
(119995)
(8807)
(10892)
(501)
(947)
(989)
(10886)
(287)
(285)
(1075)
(289)
(8805)
(8923)
(8805)
(8807)
(10878)
(10878)
(10921)
(10880)
(10882)
(10884)
(8923 65024)
(10900)
(120100)
(8811)
(8921)
(8503)
(1107)
(8823)
(10898)
(10917)
(10916)
(8809)
(10890)
(10890)
(10888)
(10888)
(8809)
(8935)
(120152)
(96)
(8458)
(8819)
(10894)
(10896)
(62)
(10919)
(10874)
(8919)
(10645)
(10876)
(10886)
(10616)
(8919)
(8923)
(10892)
(8823)
(8819)
(8809 65024)
(8809 65024)
(8660)
(8202)
(189)
(8459)
(1098)
(8596)
(10568)
(8621)
(8463)
(293)
(9829)
(9829)
(8230)
(8889)
(120101)
(10533)
(10534)
(8703)
(8763)
(8617)
(8618)
(120153)
(8213)
(119997)
(8463)
(295)
(8259)
(8208)
(237)
(8291)
(238)
(1080)
(1077)
(161)
(8660)
(120102)
(236)
(8520)
(10764)
(8749)
(10716)
(8489)
(307)
(299)
(8465)
(8464)
(8465)
(305)
(8887)
(437)
(8712)
(8453)
(8734)
(10717)
(305)
(8747)
(8890)
(8484)
(8890)
(10775)
(10812)
(1105)
(303)
(120154)
(953)
(10812)
(191)
(119998)
(8712)
(8953)
(8949)
(8948)
(8947)
(8712)
(8290)
(297)
(1110)
(239)
(309)
(1081)
(120103)
(567)
(120155)
(119999)
(1112)
(1108)
(954)
(1008)
(311)
(1082)
(120104)
(312)
(1093)
(1116)
(120156)
(120000)
(8666)
(8656)
(10523)
(10510)
(8806)
(10891)
(10594)
(314)
(10676)
(8466)
(955)
(10216)
(10641)
(10216)
(10885)
(171)
(8592)
(8676)
(10527)
(10525)
(8617)
(8619)
(10553)
(10611)
(8610)
(10923)
(10521)
(10925)
(10925 65024)
(10508)
(10098)
(123)
(91)
(10635)
(10639)
(10637)
(318)
(316)
(8968)
(123)
(1083)
(10550)
(8220)
(8222)
(10599)
(10571)
(8626)
(8804)
(8592)
(8610)
(8637)
(8636)
(8647)
(8596)
(8646)
(8651)
(8621)
(8907)
(8922)
(8804)
(8806)
(10877)
(10877)
(10920)
(10879)
(10881)
(10883)
(8922 65024)
(10899)
(10885)
(8918)
(8922)
(10891)
(8822)
(8818)
(10620)
(8970)
(120105)
(8822)
(10897)
(8637)
(8636)
(10602)
(9604)
(1113)
(8810)
(8647)
(8990)
(10603)
(9722)
(320)
(9136)
(9136)
(8808)
(10889)
(10889)
(10887)
(10887)
(8808)
(8934)
(10220)
(8701)
(10214)
(10229)
(10231)
(10236)
(10230)
(8619)
(8620)
(10629)
(120157)
(10797)
(10804)
(8727)
(95)
(9674)
(9674)
(10731)
(40)
(10643)
(8646)
(8991)
(8651)
(10605)
(8206)
(8895)
(8249)
(120001)
(8624)
(8818)
(10893)
(10895)
(91)
(8216)
(8218)
(322)
(60)
(10918)
(10873)
(8918)
(8907)
(8905)
(10614)
(10875)
(10646)
(9667)
(8884)
(9666)
(10570)
(10598)
(8808 65024)
(8808 65024)
(8762)
(175)
(9794)
(10016)
(10016)
(8614)
(8614)
(8615)
(8612)
(8613)
(9646)
(10793)
(1084)
(8212)
(8737)
(120106)
(8487)
(181)
(8739)
(42)
(10992)
(183)
(8722)
(8863)
(8760)
(10794)
(10971)
(8230)
(8723)
(8871)
(120158)
(8723)
(120002)
(8766)
(956)
(8888)
(8888)
(8921 824)
(8811 8402)
(8811 824)
(8653)
(8654)
(8920 824)
(8810 8402)
(8810 824)
(8655)
(8879)
(8878)
(8711)
(324)
(8736 8402)
(8777)
(10864 824)
(8779 824)
(329)
(8777)
(9838)
(9838)
(8469)
(160)
(8782 824)
(8783 824)
(10819)
(328)
(326)
(8775)
(10861 824)
(10818)
(1085)
(8211)
(8800)
(8663)
(10532)
(8599)
(8599)
(8784 824)
(8802)
(10536)
(8770 824)
(8708)
(8708)
(120107)
(8807 824)
(8817)
(8817)
(8807 824)
(10878 824)
(10878 824)
(8821)
(8815)
(8815)
(8654)
(8622)
(10994)
(8715)
(8956)
(8954)
(8715)
(1114)
(8653)
(8806 824)
(8602)
(8229)
(8816)
(8602)
(8622)
(8816)
(8806 824)
(10877 824)
(10877 824)
(8814)
(8820)
(8814)
(8938)
(8940)
(8740)
(120159)
(172)
(8713)
(8953 824)
(8949 824)
(8713)
(8951)
(8950)
(8716)
(8716)
(8958)
(8957)
(8742)
(8742)
(11005 8421)
(8706 824)
(10772)
(8832)
(8928)
(10927 824)
(8832)
(10927 824)
(8655)
(8603)
(10547 824)
(8605 824)
(8603)
(8939)
(8941)
(8833)
(8929)
(10928 824)
(120003)
(8740)
(8742)
(8769)
(8772)
(8772)
(8740)
(8742)
(8930)
(8931)
(8836)
(10949 824)
(8840)
(8834 8402)
(8840)
(10949 824)
(8833)
(10928 824)
(8837)
(10950 824)
(8841)
(8835 8402)
(8841)
(10950 824)
(8825)
(241)
(8824)
(8938)
(8940)
(8939)
(8941)
(957)
(35)
(8470)
(8199)
(8877)
(10500)
(8781 8402)
(8876)
(8805 8402)
(62 8402)
(10718)
(10498)
(8804 8402)
(60 8402)
(8884 8402)
(10499)
(8885 8402)
(8764 8402)
(8662)
(10531)
(8598)
(8598)
(10535)
(9416)
(243)
(8859)
(8858)
(244)
(1086)
(8861)
(337)
(10808)
(8857)
(10684)
(339)
(10687)
(120108)
(731)
(242)
(10689)
(10677)
(937)
(8750)
(8634)
(10686)
(10683)
(8254)
(10688)
(333)
(969)
(959)
(10678)
(8854)
(120160)
(10679)
(10681)
(8853)
(8744)
(8635)
(10845)
(8500)
(8500)
(170)
(186)
(8886)
(10838)
(10839)
(10843)
(8500)
(248)
(8856)
(245)
(8855)
(10806)
(246)
(9021)
(8741)
(182)
(8741)
(10995)
(11005)
(8706)
(1087)
(37)
(46)
(8240)
(8869)
(8241)
(120109)
(966)
(981)
(8499)
(9742)
(960)
(8916)
(982)
(8463)
(8462)
(8463)
(43)
(10787)
(8862)
(10786)
(8724)
(10789)
(10866)
(177)
(10790)
(10791)
(177)
(10773)
(120161)
(163)
(8826)
(10931)
(10935)
(8828)
(10927)
(8826)
(10935)
(8828)
(10927)
(10937)
(10933)
(8936)
(8830)
(8242)
(8473)
(10933)
(10937)
(8936)
(8719)
(9006)
(8978)
(8979)
(8733)
(8733)
(8830)
(8880)
(120005)
(968)
(8200)
(120110)
(10764)
(120162)
(8279)
(120006)
(8461)
(10774)
(63)
(8799)
(34)
(8667)
(8658)
(10524)
(10511)
(10596)
(8765 817)
(341)
(8730)
(10675)
(10217)
(10642)
(10661)
(10217)
(187)
(8594)
(10613)
(8677)
(10528)
(10547)
(10526)
(8618)
(8620)
(10565)
(10612)
(8611)
(8605)
(10522)
(8758)
(8474)
(10509)
(10099)
(125)
(93)
(10636)
(10638)
(10640)
(345)
(343)
(8969)
(125)
(1088)
(10551)
(10601)
(8221)
(8221)
(8627)
(8476)
(8475)
(8476)
(8477)
(9645)
(174)
(10621)
(8971)
(120111)
(8641)
(8640)
(10604)
(961)
(1009)
(8594)
(8611)
(8641)
(8640)
(8644)
(8652)
(8649)
(8605)
(8908)
(730)
(8787)
(8644)
(8652)
(8207)
(9137)
(9137)
(10990)
(10221)
(8702)
(10215)
(10630)
(120163)
(10798)
(10805)
(41)
(10644)
(10770)
(8649)
(8250)
(120007)
(8625)
(93)
(8217)
(8217)
(8908)
(8906)
(9657)
(8885)
(9656)
(10702)
(10600)
(8478)
(347)
(8218)
(8827)
(10932)
(10936)
(353)
(8829)
(10928)
(351)
(349)
(10934)
(10938)
(8937)
(10771)
(8831)
(1089)
(8901)
(8865)
(10854)
(8664)
(10533)
(8600)
(8600)
(167)
(59)
(10537)
(8726)
(8726)
(10038)
(120112)
(8994)
(9839)
(1097)
(1096)
(8739)
(8741)
(173)
(963)
(962)
(962)
(8764)
(10858)
(8771)
(8771)
(10910)
(10912)
(10909)
(10911)
(8774)
(10788)
(10610)
(8592)
(8726)
(10803)
(10724)
(8739)
(8995)
(10922)
(10924)
(10924 65024)
(1100)
(47)
(10692)
(9023)
(120164)
(9824)
(9824)
(8741)
(8851)
(8851 65024)
(8852)
(8852 65024)
(8847)
(8849)
(8847)
(8849)
(8848)
(8850)
(8848)
(8850)
(9633)
(9633)
(9642)
(9642)
(8594)
(120008)
(8726)
(8995)
(8902)
(9734)
(9733)
(1013)
(981)
(175)
(8834)
(10949)
(10941)
(8838)
(10947)
(10945)
(10955)
(8842)
(10943)
(10617)
(8834)
(8838)
(10949)
(8842)
(10955)
(10951)
(10965)
(10963)
(8827)
(10936)
(8829)
(10928)
(10938)
(10934)
(8937)
(8831)
(8721)
(9834)
(8835)
(185)
(178)
(179)
(10950)
(10942)
(10968)
(8839)
(10948)
(10185)
(10967)
(10619)
(10946)
(10956)
(8843)
(10944)
(8835)
(8839)
(10950)
(8843)
(10956)
(10952)
(10964)
(10966)
(8665)
(10534)
(8601)
(8601)
(10538)
(223)
(8982)
(964)
(9140)
(357)
(355)
(1090)
(8411)
(8981)
(120113)
(8756)
(8756)
(952)
(977)
(977)
(8776)
(8764)
(8201)
(8776)
(8764)
(254)
(732)
(215)
(8864)
(10801)
(10800)
(8749)
(10536)
(8868)
(9014)
(10993)
(120165)
(10970)
(10537)
(8244)
(8482)
(9653)
(9663)
(9667)
(8884)
(8796)
(9657)
(8885)
(9708)
(8796)
(10810)
(10809)
(10701)
(10811)
(9186)
(120009)
(1094)
(1115)
(359)
(8812)
(8606)
(8608)
(8657)
(10595)
(250)
(8593)
(1118)
(365)
(251)
(1091)
(8645)
(369)
(10606)
(10622)
(120114)
(249)
(8639)
(8638)
(9600)
(8988)
(8988)
(8975)
(9720)
(363)
(168)
(371)
(120166)
(8593)
(8597)
(8639)
(8638)
(8846)
(965)
(978)
(965)
(8648)
(8989)
(8989)
(8974)
(367)
(9721)
(120010)
(8944)
(361)
(9653)
(9652)
(8648)
(252)
(10663)
(8661)
(10984)
(10985)
(8872)
(10652)
(1013)
(1008)
(8709)
(981)
(982)
(8733)
(8597)
(1009)
(962)
(8842 65024)
(10955 65024)
(8843 65024)
(10956 65024)
(977)
(8882)
(8883)
(1074)
(8866)
(8744)
(8891)
(8794)
(8942)
(124)
(124)
(120115)
(8882)
(8834 8402)
(8835 8402)
(120167)
(8733)
(8883)
(120011)
(10955 65024)
(8842 65024)
(10956 65024)
(8843 65024)
(10650)
(373)
(10847)
(8743)
(8793)
(8472)
(120116)
(120168)
(8472)
(8768)
(8768)
(120012)
(8898)
(9711)
(8899)
(9661)
(120117)
(10234)
(10231)
(958)
(10232)
(10229)
(10236)
(8955)
(10752)
(120169)
(10753)
(10754)
(10233)
(10230)
(120013)
(10758)
(10756)
(9651)
(8897)
(8896)
(253)
(1103)
(375)
(1099)
(165)
(120118)
(1111)
(120170)
(120014)
(1102)
(255)
(378)
(382)
(1079)
(380)
(8488)
(950)
(120119)
(1078)
(8669)
(120171)
(120015)
(8205)
(8204)))
(define (string-cmp str1 str2)
(cond ((string str1 str2) -1)
((string>? str1 str2) 1)
(else 0)))
(define (entity->codepoints entity)
(let ((index (vector-binary-search entities entity string-cmp)))
(and index (vector-ref codepoints index))))
guile-commonmark-0.1.2+20240812/commonmark/common.scm 0000644 0001750 0001750 00000010330 13652433030 021631 0 ustar frankie frankie ;; Copyright (C) 2016 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark common)
#:use-module (ice-9 regex)
#:use-module (commonmark entities)
#:export (ascii-punctuation-characters
escaped-characters
control-characters
regular-characters
in-parens-no-space
link-destination
link-title
link-label
re-entity-or-numeric
remove-quotes
entity->string
unescape-string))
;; ']' needs to be the first character after an openning '[' to be able
;; to match ']'
(define ascii-punctuation-characters "]!\"#$%&'()*+,-./:;<=>?@[\\^_`{|}~")
(define escaped-characters (string-append "\\\\[" ascii-punctuation-characters "]"))
;; can't use range as it is not portable
(define control-characters "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19")
(define regular-characters (string-append "[^" control-characters " ()\\\\]"))
(define in-parens-no-space (string-append "\\((" regular-characters "|" escaped-characters "|\\\\)*\\)"))
(define link-destination (string-append "((" regular-characters "+|"
escaped-characters "|"
"[\\][^() \t\v\f\r\n]|"
in-parens-no-space ")+)"))
(define link-title (string-append "((\"(" escaped-characters "|[^\"])*\"|"
"'(" escaped-characters "|[^'])*'|"
"\\((" escaped-characters "|[^)])*\\)))"))
(define link-label (string-append "\\[(([^][]|"
escaped-characters
"){1,1000})\\]"))
(define decimal-numeric "#[0-9]{1,8}")
(define hexadecimal-numeric "#x[0-9a-f]{1,8}")
(define entity "[a-z][a-z0-9]{1,31}")
(define entity-or-numeric (string-append "&(" decimal-numeric
"|" hexadecimal-numeric
"|" entity ");"))
(define re-entity-or-numeric (make-regexp (string-append "^" entity-or-numeric) regexp/icase))
(define re-escaped-or-entity (make-regexp (string-append escaped-characters
"|" entity-or-numeric) regexp/icase))
(define (remove-quotes str)
(substring str 1 (- (string-length str) 1)))
(define (entity->string str)
(define (decimal? str)
(and (char=? (string-ref str 0) #\#) (not (char-ci=? (string-ref str 1) #\x))))
(define (hexadecimal? str)
(and (char=? (string-ref str 0) #\#) (char-ci=? (string-ref str 1) #\x)))
(define (numeric->string str base)
(let ((ch (false-if-exception (integer->char (string->number str base)))))
(string (if (and ch (not (char=? ch #\nul)))
ch
#\xfffd))))
(cond ((decimal? str) (numeric->string (substring str 1) 10))
((hexadecimal? str) (numeric->string (substring str 2) 16))
(else (let ((codepoints (entity->codepoints str)))
(and codepoints (list->string (map integer->char codepoints)))))))
(define (unescape-string str)
(define (replace m)
(let ((str (match:substring m 0)))
(if (char=? (string-ref str 0) #\\)
(string (string-ref str 1))
(or (and (> (string-length str) 1)
(entity->string (substring str 1 (- (string-length str) 1))))
str))))
(regexp-substitute/global #f re-escaped-or-entity str
'pre replace 'post))
guile-commonmark-0.1.2+20240812/commonmark/inlines.scm 0000644 0001750 0001750 00000057665 13652433030 022030 0 ustar frankie frankie ;; Copyright (C) 2015, 2016 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark inlines)
#:use-module (ice-9 match)
#:use-module (ice-9 regex)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-2)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
#:use-module (commonmark node)
#:use-module (commonmark common)
#:export (parse-inlines))
(define re-start-ticks (make-regexp "^`+"))
(define re-ticks (make-regexp "`+"))
(define re-main (make-regexp "^[^`*_\\\n[!<&]+"))
(define re-link-destination-brackets (make-regexp (string-append "^<(([^ <>\n\t\\]|"
escaped-characters
")*)>")))
(define re-link-destination (make-regexp link-destination))
(define re-link-title (make-regexp link-title))
(define re-link-label (make-regexp link-label))
(define re-autolink (make-regexp (string-append "^<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^ \t\n<>"
control-characters "]*)>")))
(define re-email-autolink (make-regexp
(string-append "^<([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@"
"[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?"
"(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>")))
(define (start-ticks? text)
(regexp-exec re-start-ticks (text-value text) (text-position text)))
(define (end-ticks? text)
(regexp-exec re-ticks (text-value text) (text-position text)))
(define (normal-text? text)
(regexp-exec re-main (text-value text) (text-position text)))
(define (link-destination-brackets? text)
(regexp-exec re-link-destination-brackets (text-value text) (text-position text)))
(define (link-destination-normal? text)
(regexp-exec re-link-destination (text-value text) (text-position text)))
(define (link-destination? text)
(or (link-destination-brackets? text)
(link-destination-normal? text)))
(define (link-title? text)
(regexp-exec re-link-title (text-value text) (text-position text)))
(define (link-label? text)
(regexp-exec re-link-label (text-value text) (text-position text)))
(define (autolink? text)
(regexp-exec re-autolink (text-value text) (text-position text)))
(define (email-autolink? text)
(regexp-exec re-email-autolink (text-value text) (text-position text)))
(define (entity-or-numeric? text)
(regexp-exec re-entity-or-numeric (text-value text) (text-position text)))
(define (match-length match)
(string-length (match:substring match 0)))
(define (make-text text position)
(cons text position))
(define (text-value text)
(car text))
(define (text-position text)
(cdr text))
(define (text-move text position)
(make-text (text-value text) position))
(define (text-advance text increment)
(make-text (text-value text) (+ (text-position text) increment)))
(define (text-advance-skip text char-pred)
(make-text (text-value text) (or (string-skip (text-value text) char-pred (text-position text))
(text-position text))))
(define (text-substring text start end)
(substring (text-value text) start end))
(define (text-char text)
(string-ref (text-value text) (text-position text)))
(define (text-length text)
(string-length (text-value text)))
(define (text-end? text)
(>= (text-position text) (string-length (text-value text))))
(define-record-type
(make-delim-stack delims nodes)
delim-stack?
(delims delim-stack-delims)
(nodes delim-stack-nodes))
(define (make-empty-delim-stack)
(make-delim-stack '() '()))
(define (delim-stack-empty? delim-stack)
(null? (delim-stack-delims delim-stack)))
(define (delim-stack-push delim-stack delim nodes)
(match delim-stack
(($ delims ns)
(make-delim-stack (cons delim delims) (cons nodes ns)))))
(define (delim-stack-pop delim-stack)
(match delim-stack
(($ delims nodes)
(make-delim-stack (cdr delims) (cdr nodes)))))
(define (delim-stack-peek delim-stack)
(match delim-stack
(($ delims nodes)
(values (car delims) (car nodes)))))
(define (delim-stack-replace-delim delim-stack delim)
(match delim-stack
(($ delims nodes)
(make-delim-stack (cons delim (cdr delims)) nodes))))
(define-record-type
(make-delimiter ch count open close)
delimiter?
(ch delimiter-ch)
(count delimiter-count)
(open delimiter-open?)
(close delimiter-close?))
(define (whitespace? text position)
(or (not position) (char-whitespace? (string-ref text position))))
(define (char-punctuation? ch)
(char-set-contains? char-set:punctuation ch))
(define (punctuation? text position)
(and position (char-punctuation? (string-ref text position))))
(define (left-flanking? whitespace-after punctuation-after whitespace-before punctuation-before)
(and (not whitespace-after)
(or (not punctuation-after) whitespace-before punctuation-before)))
(define (right-flanking? whitespace-after punctuation-after whitespace-before punctuation-before)
(and (not whitespace-before)
(or (not punctuation-before) whitespace-after punctuation-after)))
(define (scan-delim text)
(define (count-delim delim-end position)
(- (or delim-end (text-length text)) position))
(let* ((ch (text-char text))
(position (text-position text))
(text (text-value text))
(delim-end (string-skip text ch position))
(delim-start (string-skip-right text ch 0 position))
(whitespace-before (whitespace? text delim-start))
(whitespace-after (whitespace? text delim-end))
(punctuation-before (punctuation? text delim-start))
(punctuation-after (punctuation? text delim-end))
(left (left-flanking? whitespace-after punctuation-after whitespace-before punctuation-before))
(right (right-flanking? whitespace-after punctuation-after whitespace-before punctuation-before)))
(case ch
((#\*) (make-delimiter ch (count-delim delim-end position) left right))
((#\_) (make-delimiter ch (count-delim delim-end position)
(and left (or (not right) punctuation-before))
(and right (or (not left) punctuation-after)))))))
(define (match? open-delim close-delim)
(eq? (delimiter-ch open-delim) (delimiter-ch close-delim)))
(define (matching-opening? delim-stack delim)
(find (cut match? <> delim) (delim-stack-delims delim-stack)))
(define (remake-delimiter count delim)
(make-delimiter (delimiter-ch delim) count (delimiter-open? delim) (delimiter-close? delim)))
(define (match-delim opening-delim closing-delim)
(let ((open-count (delimiter-count opening-delim))
(close-count (delimiter-count closing-delim)))
(cond ((or (= open-count close-count 1) (= open-count close-count 2))
(list #f #f))
((>= open-count 2 close-count)
(list (remake-delimiter (- open-count close-count) opening-delim) #f))
((<= open-count 2 close-count)
(list #f (remake-delimiter (- close-count open-count) closing-delim)))
((odd? close-count)
(list (remake-delimiter (- open-count 1) opening-delim)
(remake-delimiter (- close-count 1) closing-delim)))
(else (list (remake-delimiter (- open-count 2) opening-delim)
(remake-delimiter (- close-count 2) closing-delim))))))
(define (make-reference-lookup document)
(let ((references (node-get-data document 'link-references)))
(if references
(lambda (link-label) (assoc-ref references (string-map char-downcase link-label)))
(const #f))))
;; Node -> Node
;; parses the inline text of paragraphs and heading nodes
(define (parse-inlines node)
(let ((ref-proc (make-reference-lookup node)))
(define (parse-inner node)
(cond ((not (node? node)) node)
((or (paragraph-node? node) (heading-node? node)) (parse-inline node ref-proc))
(else (make-node (node-type node) (node-data node) (map parse-inner (node-children node))))))
(parse-inner node)))
(define (emphasis-type delim)
(case (delimiter-count delim)
((1) 'em)
(else 'strong)))
(define (delim->text delim)
(make-text-node (make-string (delimiter-count delim) (delimiter-ch delim))))
(define (parse-emphasis text nodes delim-stack ref-proc)
(define (parse-matching-delim delim matching-delim)
(let loop ((ds delim-stack)
(ns nodes))
(let-values (((d n) (delim-stack-peek ds)))
(if (eq? d matching-delim)
(match (match-delim matching-delim delim)
((#f #f)
(parse-char (text-advance text (delimiter-count delim))
(cons (make-emphasis-node ns (emphasis-type delim)) n)
(delim-stack-pop ds) ref-proc))
((od #f)
(parse-char (text-advance text (delimiter-count delim))
(list (make-emphasis-node ns (emphasis-type delim)))
(delim-stack-replace-delim ds od) ref-proc))
((#f cd)
(parse-char (text-advance text (delimiter-count matching-delim))
(cons (make-emphasis-node ns (emphasis-type matching-delim)) n)
(delim-stack-pop ds) ref-proc))
((od cd)
(let ((difference (- (delimiter-count delim) (delimiter-count cd))))
(parse-char (text-advance text difference)
(list (make-emphasis-node ns (if (= 1 difference) 'em 'strong)))
(delim-stack-replace-delim ds od) ref-proc))))
(loop (delim-stack-pop ds) (append ns (cons (delim->text d) n)))))))
(let ((delim (scan-delim text)))
(cond ((and (delimiter-close? delim) (delimiter-open? delim)) (let ((matching-delim (matching-opening? delim-stack delim)))
(if matching-delim
(parse-matching-delim delim matching-delim)
(parse-char (text-advance text (delimiter-count delim))
'()
(delim-stack-push delim-stack delim nodes) ref-proc))))
((delimiter-close? delim)
(let ((matching-delim (matching-opening? delim-stack delim)))
(if matching-delim
(parse-matching-delim delim matching-delim)
(parse-char (text-advance text (delimiter-count delim))
(cons (delim->text delim) nodes)
delim-stack ref-proc))))
((delimiter-open? delim)
(parse-char (text-advance text (delimiter-count delim))
'()
(delim-stack-push delim-stack delim nodes) ref-proc))
(else (parse-char (text-advance text (delimiter-count delim))
(cons (delim->text delim) nodes)
delim-stack ref-proc)))))
(define (ascii-punctuation-characters? ch)
(define ascii-punc-set (string->char-set ascii-punctuation-characters))
(char-set-contains? ascii-punc-set ch))
(define* (blank-trailing-space? node #:optional (offset 1))
(let ((str (last-child node)))
(and (<= offset (string-length str))
(case (string-ref str (- (string-length str) offset))
((#\space) #t)
(else #f)))))
(define (remove-trailing-space nodes)
(let* ((str (last-child (car nodes)))
(new-str (string-trim-right str #\space)))
(if (> (string-length new-str) 0)
(cons (make-text-node new-str) (cdr nodes))
(cdr nodes))))
(define (parse-newline text nodes delim-stack ref-proc)
(let ((new-text (text-advance-skip (text-advance text 1) #\space)))
(if (and (not (null? nodes)) (text-node? (car nodes)) (blank-trailing-space? (car nodes)))
(parse-char new-text
(cons (if (blank-trailing-space? (car nodes) 2)
(make-hardbreak-node)
(make-softbreak-node))
(remove-trailing-space nodes))
delim-stack ref-proc)
(parse-char new-text
(cons (make-softbreak-node) nodes)
delim-stack ref-proc))))
(define (parse-backslash text nodes delim-stack ref-proc)
(let* ((next-ch-text (text-advance text 1))
(next-ch (and (not (text-end? next-ch-text)) (text-char next-ch-text))))
(cond ((eq? next-ch #\newline)
(parse-char (text-advance-skip (text-advance next-ch-text 1) #\space)
(cons (make-hardbreak-node) nodes)
delim-stack ref-proc))
((and next-ch (ascii-punctuation-characters? next-ch))
(parse-char (text-advance next-ch-text 1)
(cons (make-text-node (string next-ch)) nodes)
delim-stack ref-proc))
(else (parse-char next-ch-text (cons (make-text-node "\\") nodes)
delim-stack ref-proc)))))
(define (parse-ticks text)
(let ((start-ticks (start-ticks? text)))
(let loop ((end-ticks (end-ticks? (text-move text (match:end start-ticks 0)))))
(cond ((not end-ticks)
(values (match:end start-ticks 0)
(make-text-node (match:substring start-ticks 0))))
((= (match-length start-ticks) (match-length end-ticks))
(values (match:end end-ticks 0)
(make-code-span-node (text-substring text (match:end start-ticks 0)
(match:start end-ticks 0)))))
(else (loop (end-ticks? (text-move text (match:end end-ticks 0)))))))))
(define (parse-code-span text nodes delim-stack ref-proc)
(let-values (((pos node) (parse-ticks text)))
(parse-char (text-move text pos) (cons node nodes)
delim-stack ref-proc)))
(define* (link-text? text ref-proc #:optional (ignore-links #f))
(and (eq? (text-char text) #\[)
(let loop ((text (text-advance text 1))
(open-bracket-count 1))
(and (not (text-end? text))
(case (text-char text)
((#\!) (let ((next-text (text-advance text 1)))
(if (and (not (text-end? next-text)) (eq? (text-char next-text) #\[))
(loop (text-advance next-text 1) (+ open-bracket-count 1))
(loop next-text open-bracket-count))))
((#\[) (and (or ignore-links (not (link? text ref-proc)))
(loop (text-advance text 1) (+ open-bracket-count 1))))
((#\]) (if (= open-bracket-count 1)
(text-advance text 1)
(loop (text-advance text 1) (- open-bracket-count 1))))
((#\`) (loop (text-move text (parse-ticks text)) open-bracket-count))
((#\<) (let-values (((autolink autolink-text) (parse-autolink text)))
(loop (if autolink autolink-text (text-advance autolink-text 1))
open-bracket-count)))
((#\\) (loop (text-advance text 2) open-bracket-count))
(else (loop (text-advance text 1) open-bracket-count)))))))
(define (make-link-parser link-text? make-node)
(lambda (text ref-proc)
(define (link-label label-end)
(text-substring text (+ (text-position text) 1) (- (text-position label-end) 1)))
(define* (make-link link-text #:optional (dest #f) (title #f))
(let* ((link-text (link-label link-text))
(link-text-nodes (parse-char (make-text link-text 0) '() (make-empty-delim-stack) ref-proc)))
(make-node link-text-nodes
(unescape-string (or dest ""))
(and title (unescape-string (remove-quotes title))))))
(define (parse-title link-text dest-match after-space whitespace)
(let ((title-match (link-title? after-space)))
(cond ((and title-match whitespace)
(let* ((new-text (text-move after-space (match:end title-match 0)))
(after-space (text-advance-skip new-text char-set:whitespace)))
(if (and (not (text-end? after-space)) (char=? #\) (text-char after-space)))
(values (make-link link-text (match:substring dest-match 1)
(match:substring title-match 1))
(text-advance after-space 1))
(values #f text))))
((text-end? after-space)
(values #f text))
((char=? (text-char after-space) #\))
(values (make-link link-text (match:substring dest-match 1))
(text-advance after-space 1)))
(else (values #f text)))))
(define (inline? link-text)
(let* ((after-space (text-advance-skip (text-advance link-text 1) char-set:whitespace))
(dest-match (link-destination? after-space)))
(cond (dest-match
(let* ((new-text (text-move link-text (match:end dest-match 0)))
(whitespace (and (not (text-end? new-text)) (char-whitespace? (text-char new-text))))
(after-space (text-advance-skip new-text char-set:whitespace)))
(parse-title link-text dest-match after-space whitespace)))
((text-end? after-space)
(values #f text))
((char=? (text-char after-space) #\))
(values (make-link link-text) (text-advance after-space 1)))
(else (parse-title link-text #f after-space #t)))))
(define (full-reference? link-text)
(let ((label-match (link-label? link-text)))
(cond (label-match
(let* ((label (match:substring label-match 1))
(reference (ref-proc label)))
(if reference
(values (make-link link-text (car reference) (cadr reference))
(text-move link-text (match:end label-match 0)))
(values #f text))))
((char=? #\] (text-char (text-advance link-text 1)))
(let* ((label (link-label link-text))
(reference (ref-proc label)))
(if reference
(values (make-link link-text (car reference) (cadr reference))
(text-advance link-text 2))
(values #f text))))
(else (shortcut-reference? link-text)))))
(define (shortcut-reference? link-text)
(let* ((label (link-label link-text))
(reference (ref-proc label)))
(if reference
(values (make-link link-text (car reference) (cadr reference)) link-text)
(values #f text))))
(let ((link-text (link-text? text ref-proc)))
(cond ((and link-text (not (text-end? link-text)) (char=? #\( (text-char link-text)))
(inline? link-text))
((and link-text (not (text-end? link-text)) (char=? #\[ (text-char link-text)))
(full-reference? link-text))
(link-text (shortcut-reference? link-text))
(else (values #f text))))))
(define link? (make-link-parser
(lambda (text ref-proc)
(link-text? text ref-proc))
make-link-node))
(define image? (make-link-parser
(lambda (text ref-proc)
(and (not (text-end? text)) (link-text? text ref-proc #t)))
make-image-node))
(define (parse-image text nodes delim-stack ref-proc)
(let-values (((image text) (image? (text-advance text 1) ref-proc)))
(if image
(parse-char text (cons image nodes) delim-stack ref-proc)
(parse-char text (cons (make-text-node "!") nodes) delim-stack ref-proc))))
(define (parse-link text nodes delim-stack ref-proc)
(let-values (((link text) (link? text ref-proc)))
(if link
(parse-char text (cons link nodes) delim-stack ref-proc)
(parse-char (text-advance text 1) (cons (make-text-node "[") nodes) delim-stack ref-proc))))
(define (parse-autolink text)
(let ((autolink-match (autolink? text)))
(if autolink-match
(values (make-link-node (list (make-text-node (match:substring autolink-match 1)))
(match:substring autolink-match 1) #f)
(text-move text (match:end autolink-match 0)))
(let ((email-match (email-autolink? text)))
(if email-match
(values (make-link-node (list (make-text-node (match:substring email-match 1)))
(string-append "mailto:" (match:substring email-match 1)) #f)
(text-move text (match:end email-match 0)))
(values #f text))))))
(define (parse-autolink-or-html text nodes delim-stack ref-proc)
(let-values (((autolink text) (parse-autolink text)))
(if autolink
(parse-char text (cons autolink nodes) delim-stack ref-proc)
(parse-char (text-advance text 1) (cons (make-text-node "<") nodes) delim-stack ref-proc))))
(define (parse-entity-numeric text nodes delim-stack ref-proc)
(let ((entity-match (entity-or-numeric? text)))
(if entity-match
(let ((str (entity->string (match:substring entity-match 1))))
(if str
(parse-char (text-move text (match:end entity-match 0))
(cons (make-text-node str) nodes)
delim-stack ref-proc)
(parse-char (text-advance text 1) (cons (make-text-node "&") nodes)
delim-stack ref-proc)))
(parse-char (text-advance text 1) (cons (make-text-node "&") nodes)
delim-stack ref-proc))))
(define (parse-normal-text text nodes delim-stack ref-proc)
(let ((normal-text (normal-text? text)))
(parse-char (text-move text (match:end normal-text 0))
(cons (make-text-node (match:substring normal-text 0)) nodes)
delim-stack ref-proc)))
(define (pop-remaining-delim nodes delim-stack)
(if (delim-stack-empty? delim-stack)
(if (and (not (null? nodes)) (text-node? (car nodes))) (remove-trailing-space nodes) nodes)
(let-values (((d n) (delim-stack-peek delim-stack)))
(pop-remaining-delim (append nodes (cons (delim->text d) n))
(delim-stack-pop delim-stack)))))
(define (parse-char text nodes delim-stack ref-proc)
(if (text-end? text)
(pop-remaining-delim nodes delim-stack)
(case (text-char text)
((#\newline) (parse-newline text nodes delim-stack ref-proc))
((#\\) (parse-backslash text nodes delim-stack ref-proc))
((#\`) (parse-code-span text nodes delim-stack ref-proc))
((#\* #\_) (parse-emphasis text nodes delim-stack ref-proc))
((#\[) (parse-link text nodes delim-stack ref-proc))
((#\!) (parse-image text nodes delim-stack ref-proc))
((#\&) (parse-entity-numeric text nodes delim-stack ref-proc))
((#\<) (parse-autolink-or-html text nodes delim-stack ref-proc))
(else (parse-normal-text text nodes delim-stack ref-proc)))))
(define (parse-inline node ref-proc)
(let ((text (last-child (last-child node))))
(make-node (node-type node) (node-data node) (parse-char (make-text text 0) '()
(make-empty-delim-stack)
ref-proc))))
guile-commonmark-0.1.2+20240812/m4/ 0000755 0001750 0001750 00000000000 13652433030 016015 5 ustar frankie frankie guile-commonmark-0.1.2+20240812/m4/guile.m4 0000644 0001750 0001750 00000036365 13652433030 017401 0 ustar frankie frankie ## Autoconf macros for working with Guile.
##
## Copyright (C) 1998,2001, 2006, 2010, 2012, 2013, 2014 Free Software Foundation, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public License
## as published by the Free Software Foundation; either version 3 of
## the License, or (at your option) any later version.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
# serial 10
## Index
## -----
##
## GUILE_PKG -- find Guile development files
## GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
## GUILE_FLAGS -- set flags for compiling and linking with Guile
## GUILE_SITE_DIR -- find path to Guile "site" directories
## GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
## GUILE_MODULE_CHECK -- check feature of a Guile Scheme module
## GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module
## GUILE_MODULE_REQUIRED -- fail if a Guile Scheme module is unavailable
## GUILE_MODULE_EXPORTS -- check if a module exports a variable
## GUILE_MODULE_REQUIRED_EXPORT -- fail if a module doesn't export a variable
## Code
## ----
## NOTE: Comments preceding an AC_DEFUN (starting from "Usage:") are massaged
## into doc/ref/autoconf-macros.texi (see Makefile.am in that directory).
# GUILE_PKG -- find Guile development files
#
# Usage: GUILE_PKG([VERSIONS])
#
# This macro runs the @code{pkg-config} tool to find development files
# for an available version of Guile.
#
# By default, this macro will search for the latest stable version of
# Guile (e.g. 3.0), falling back to the previous stable version
# (e.g. 2.2) if it is available. If no guile-@var{VERSION}.pc file is
# found, an error is signalled. The found version is stored in
# @var{GUILE_EFFECTIVE_VERSION}.
#
# If @code{GUILE_PROGS} was already invoked, this macro ensures that the
# development files have the same effective version as the Guile
# program.
#
# @var{GUILE_EFFECTIVE_VERSION} is marked for substitution, as by
# @code{AC_SUBST}.
#
AC_DEFUN([GUILE_PKG],
[PKG_PROG_PKG_CONFIG
_guile_versions_to_search="m4_default([$1], [3.0 2.2 2.0])"
if test -n "$GUILE_EFFECTIVE_VERSION"; then
_guile_tmp=""
for v in $_guile_versions_to_search; do
if test "$v" = "$GUILE_EFFECTIVE_VERSION"; then
_guile_tmp=$v
fi
done
if test -z "$_guile_tmp"; then
AC_MSG_FAILURE([searching for guile development files for versions $_guile_versions_to_search, but previously found $GUILE version $GUILE_EFFECTIVE_VERSION])
fi
_guile_versions_to_search=$GUILE_EFFECTIVE_VERSION
fi
GUILE_EFFECTIVE_VERSION=""
_guile_errors=""
for v in $_guile_versions_to_search; do
if test -z "$GUILE_EFFECTIVE_VERSION"; then
AC_MSG_NOTICE([checking for guile $v])
PKG_CHECK_EXISTS([guile-$v], [GUILE_EFFECTIVE_VERSION=$v], [])
fi
done
if test -z "$GUILE_EFFECTIVE_VERSION"; then
AC_MSG_ERROR([
No Guile development packages were found.
Please verify that you have Guile installed. If you installed Guile
from a binary distribution, please verify that you have also installed
the development packages. If you installed it yourself, you might need
to adjust your PKG_CONFIG_PATH; see the pkg-config man page for more.
])
fi
AC_MSG_NOTICE([found guile $GUILE_EFFECTIVE_VERSION])
AC_SUBST([GUILE_EFFECTIVE_VERSION])
])
# GUILE_FLAGS -- set flags for compiling and linking with Guile
#
# Usage: GUILE_FLAGS
#
# This macro runs the @code{pkg-config} tool to find out how to compile
# and link programs against Guile. It sets four variables:
# @var{GUILE_CFLAGS}, @var{GUILE_LDFLAGS}, @var{GUILE_LIBS}, and
# @var{GUILE_LTLIBS}.
#
# @var{GUILE_CFLAGS}: flags to pass to a C or C++ compiler to build code that
# uses Guile header files. This is almost always just one or more @code{-I}
# flags.
#
# @var{GUILE_LDFLAGS}: flags to pass to the compiler to link a program
# against Guile. This includes @code{-lguile-@var{VERSION}} for the
# Guile library itself, and may also include one or more @code{-L} flag
# to tell the compiler where to find the libraries. But it does not
# include flags that influence the program's runtime search path for
# libraries, and will therefore lead to a program that fails to start,
# unless all necessary libraries are installed in a standard location
# such as @file{/usr/lib}.
#
# @var{GUILE_LIBS} and @var{GUILE_LTLIBS}: flags to pass to the compiler or to
# libtool, respectively, to link a program against Guile. It includes flags
# that augment the program's runtime search path for libraries, so that shared
# libraries will be found at the location where they were during linking, even
# in non-standard locations. @var{GUILE_LIBS} is to be used when linking the
# program directly with the compiler, whereas @var{GUILE_LTLIBS} is to be used
# when linking the program is done through libtool.
#
# The variables are marked for substitution, as by @code{AC_SUBST}.
#
AC_DEFUN([GUILE_FLAGS],
[AC_REQUIRE([GUILE_PKG])
PKG_CHECK_MODULES(GUILE, [guile-$GUILE_EFFECTIVE_VERSION])
dnl GUILE_CFLAGS and GUILE_LIBS are already defined and AC_SUBST'd by
dnl PKG_CHECK_MODULES. But GUILE_LIBS to pkg-config is GUILE_LDFLAGS
dnl to us.
GUILE_LDFLAGS=$GUILE_LIBS
dnl Determine the platform dependent parameters needed to use rpath.
dnl AC_LIB_LINKFLAGS_FROM_LIBS is defined in gnulib/m4/lib-link.m4 and needs
dnl the file gnulib/build-aux/config.rpath.
AC_LIB_LINKFLAGS_FROM_LIBS([GUILE_LIBS], [$GUILE_LDFLAGS], [])
GUILE_LIBS="$GUILE_LDFLAGS $GUILE_LIBS"
AC_LIB_LINKFLAGS_FROM_LIBS([GUILE_LTLIBS], [$GUILE_LDFLAGS], [yes])
GUILE_LTLIBS="$GUILE_LDFLAGS $GUILE_LTLIBS"
AC_SUBST([GUILE_EFFECTIVE_VERSION])
AC_SUBST([GUILE_CFLAGS])
AC_SUBST([GUILE_LDFLAGS])
AC_SUBST([GUILE_LIBS])
AC_SUBST([GUILE_LTLIBS])
])
# GUILE_SITE_DIR -- find path to Guile site directories
#
# Usage: GUILE_SITE_DIR
#
# This looks for Guile's "site" directories. The variable @var{GUILE_SITE} will
# be set to Guile's "site" directory for Scheme source files (usually something
# like PREFIX/share/guile/site). @var{GUILE_SITE_CCACHE} will be set to the
# directory for compiled Scheme files also known as @code{.go} files
# (usually something like
# PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/site-ccache).
# @var{GUILE_EXTENSION} will be set to the directory for compiled C extensions
# (usually something like
# PREFIX/lib/guile/@var{GUILE_EFFECTIVE_VERSION}/extensions). The latter two
# are set to blank if the particular version of Guile does not support
# them. Note that this macro will run the macros @code{GUILE_PKG} and
# @code{GUILE_PROGS} if they have not already been run.
#
# The variables are marked for substitution, as by @code{AC_SUBST}.
#
AC_DEFUN([GUILE_SITE_DIR],
[AC_REQUIRE([GUILE_PKG])
AC_REQUIRE([GUILE_PROGS])
AC_MSG_CHECKING(for Guile site directory)
GUILE_SITE=`$PKG_CONFIG --print-errors --variable=sitedir guile-$GUILE_EFFECTIVE_VERSION`
AC_MSG_RESULT($GUILE_SITE)
if test "$GUILE_SITE" = ""; then
AC_MSG_FAILURE(sitedir not found)
fi
AC_SUBST(GUILE_SITE)
AC_MSG_CHECKING([for Guile site-ccache directory using pkgconfig])
GUILE_SITE_CCACHE=`$PKG_CONFIG --variable=siteccachedir guile-$GUILE_EFFECTIVE_VERSION`
if test "$GUILE_SITE_CCACHE" = ""; then
AC_MSG_RESULT(no)
AC_MSG_CHECKING([for Guile site-ccache directory using interpreter])
GUILE_SITE_CCACHE=`$GUILE -c "(display (if (defined? '%site-ccache-dir) (%site-ccache-dir) \"\"))"`
if test $? != "0" -o "$GUILE_SITE_CCACHE" = ""; then
AC_MSG_RESULT(no)
GUILE_SITE_CCACHE=""
AC_MSG_WARN([siteccachedir not found])
fi
fi
AC_MSG_RESULT($GUILE_SITE_CCACHE)
AC_SUBST([GUILE_SITE_CCACHE])
AC_MSG_CHECKING(for Guile extensions directory)
GUILE_EXTENSION=`$PKG_CONFIG --print-errors --variable=extensiondir guile-$GUILE_EFFECTIVE_VERSION`
AC_MSG_RESULT($GUILE_EXTENSION)
if test "$GUILE_EXTENSION" = ""; then
GUILE_EXTENSION=""
AC_MSG_WARN(extensiondir not found)
fi
AC_SUBST(GUILE_EXTENSION)
])
# GUILE_PROGS -- set paths to Guile interpreter, config and tool programs
#
# Usage: GUILE_PROGS([VERSION])
#
# This macro looks for programs @code{guile} and @code{guild}, setting
# variables @var{GUILE} and @var{GUILD} to their paths, respectively.
# The macro will attempt to find @code{guile} with the suffix of
# @code{-X.Y}, followed by looking for it with the suffix @code{X.Y}, and
# then fall back to looking for @code{guile} with no suffix. If
# @code{guile} is still not found, signal an error. The suffix, if any,
# that was required to find @code{guile} will be used for @code{guild}
# as well.
#
# By default, this macro will search for the latest stable version of
# Guile (e.g. 3.0). x.y or x.y.z versions can be specified. If an older
# version is found, the macro will signal an error.
#
# The effective version of the found @code{guile} is set to
# @var{GUILE_EFFECTIVE_VERSION}. This macro ensures that the effective
# version is compatible with the result of a previous invocation of
# @code{GUILE_FLAGS}, if any.
#
# As a legacy interface, it also looks for @code{guile-config} and
# @code{guile-tools}, setting @var{GUILE_CONFIG} and @var{GUILE_TOOLS}.
#
# The variables are marked for substitution, as by @code{AC_SUBST}.
#
AC_DEFUN([GUILE_PROGS],
[_guile_required_version="m4_default([$1], [$GUILE_EFFECTIVE_VERSION])"
if test -z "$_guile_required_version"; then
_guile_required_version=3.0
fi
_guile_candidates=guile
_tmp=
for v in `echo "$_guile_required_version" | tr . ' '`; do
if test -n "$_tmp"; then _tmp=$_tmp.; fi
_tmp=$_tmp$v
_guile_candidates="guile-$_tmp guile$_tmp $_guile_candidates"
done
AC_PATH_PROGS(GUILE,[$_guile_candidates])
if test -z "$GUILE"; then
AC_MSG_ERROR([guile required but not found])
fi
_guile_suffix=`echo "$GUILE" | sed -e 's,^.*/guile\(.*\)$,\1,'`
_guile_effective_version=`$GUILE -c "(display (effective-version))"`
if test -z "$GUILE_EFFECTIVE_VERSION"; then
GUILE_EFFECTIVE_VERSION=$_guile_effective_version
elif test "$GUILE_EFFECTIVE_VERSION" != "$_guile_effective_version"; then
AC_MSG_ERROR([found development files for Guile $GUILE_EFFECTIVE_VERSION, but $GUILE has effective version $_guile_effective_version])
fi
_guile_major_version=`$GUILE -c "(display (major-version))"`
_guile_minor_version=`$GUILE -c "(display (minor-version))"`
_guile_micro_version=`$GUILE -c "(display (micro-version))"`
_guile_prog_version="$_guile_major_version.$_guile_minor_version.$_guile_micro_version"
AC_MSG_CHECKING([for Guile version >= $_guile_required_version])
_major_version=`echo $_guile_required_version | cut -d . -f 1`
_minor_version=`echo $_guile_required_version | cut -d . -f 2`
_micro_version=`echo $_guile_required_version | cut -d . -f 3`
if test "$_guile_major_version" -gt "$_major_version"; then
true
elif test "$_guile_major_version" -eq "$_major_version"; then
if test "$_guile_minor_version" -gt "$_minor_version"; then
true
elif test "$_guile_minor_version" -eq "$_minor_version"; then
if test -n "$_micro_version"; then
if test "$_guile_micro_version" -lt "$_micro_version"; then
AC_MSG_ERROR([Guile $_guile_required_version required, but $_guile_prog_version found])
fi
fi
elif test "$GUILE_EFFECTIVE_VERSION" = "$_major_version.$_minor_version" -a -z "$_micro_version"; then
# Allow prereleases that have the right effective version.
true
else
as_fn_error $? "Guile $_guile_required_version required, but $_guile_prog_version found" "$LINENO" 5
fi
elif test "$GUILE_EFFECTIVE_VERSION" = "$_major_version.$_minor_version" -a -z "$_micro_version"; then
# Allow prereleases that have the right effective version.
true
else
AC_MSG_ERROR([Guile $_guile_required_version required, but $_guile_prog_version found])
fi
AC_MSG_RESULT([$_guile_prog_version])
AC_PATH_PROG(GUILD,[guild$_guile_suffix])
AC_SUBST(GUILD)
AC_PATH_PROG(GUILE_CONFIG,[guile-config$_guile_suffix])
AC_SUBST(GUILE_CONFIG)
if test -n "$GUILD"; then
GUILE_TOOLS=$GUILD
else
AC_PATH_PROG(GUILE_TOOLS,[guile-tools$_guile_suffix])
fi
AC_SUBST(GUILE_TOOLS)
])
# GUILE_CHECK -- evaluate Guile Scheme code and capture the return value
#
# Usage: GUILE_CHECK_RETVAL(var,check)
#
# @var{var} is a shell variable name to be set to the return value.
# @var{check} is a Guile Scheme expression, evaluated with "$GUILE -c", and
# returning either 0 or non-#f to indicate the check passed.
# Non-0 number or #f indicates failure.
# Avoid using the character "#" since that confuses autoconf.
#
AC_DEFUN([GUILE_CHECK],
[AC_REQUIRE([GUILE_PROGS])
$GUILE -c "$2" > /dev/null 2>&1
$1=$?
])
# GUILE_MODULE_CHECK -- check feature of a Guile Scheme module
#
# Usage: GUILE_MODULE_CHECK(var,module,featuretest,description)
#
# @var{var} is a shell variable name to be set to "yes" or "no".
# @var{module} is a list of symbols, like: (ice-9 common-list).
# @var{featuretest} is an expression acceptable to GUILE_CHECK, q.v.
# @var{description} is a present-tense verb phrase (passed to AC_MSG_CHECKING).
#
AC_DEFUN([GUILE_MODULE_CHECK],
[AC_MSG_CHECKING([if $2 $4])
GUILE_CHECK($1,(use-modules $2) (exit ((lambda () $3))))
if test "$$1" = "0" ; then $1=yes ; else $1=no ; fi
AC_MSG_RESULT($$1)
])
# GUILE_MODULE_AVAILABLE -- check availability of a Guile Scheme module
#
# Usage: GUILE_MODULE_AVAILABLE(var,module)
#
# @var{var} is a shell variable name to be set to "yes" or "no".
# @var{module} is a list of symbols, like: (ice-9 common-list).
#
AC_DEFUN([GUILE_MODULE_AVAILABLE],
[GUILE_MODULE_CHECK($1,$2,0,is available)
])
# GUILE_MODULE_REQUIRED -- fail if a Guile Scheme module is unavailable
#
# Usage: GUILE_MODULE_REQUIRED(symlist)
#
# @var{symlist} is a list of symbols, WITHOUT surrounding parens,
# like: ice-9 common-list.
#
AC_DEFUN([GUILE_MODULE_REQUIRED],
[GUILE_MODULE_AVAILABLE(ac_guile_module_required, ($1))
if test "$ac_guile_module_required" = "no" ; then
AC_MSG_ERROR([required guile module not found: ($1)])
fi
])
# GUILE_MODULE_EXPORTS -- check if a module exports a variable
#
# Usage: GUILE_MODULE_EXPORTS(var,module,modvar)
#
# @var{var} is a shell variable to be set to "yes" or "no".
# @var{module} is a list of symbols, like: (ice-9 common-list).
# @var{modvar} is the Guile Scheme variable to check.
#
AC_DEFUN([GUILE_MODULE_EXPORTS],
[GUILE_MODULE_CHECK($1,$2,$3,exports `$3')
])
# GUILE_MODULE_REQUIRED_EXPORT -- fail if a module doesn't export a variable
#
# Usage: GUILE_MODULE_REQUIRED_EXPORT(module,modvar)
#
# @var{module} is a list of symbols, like: (ice-9 common-list).
# @var{modvar} is the Guile Scheme variable to check.
#
AC_DEFUN([GUILE_MODULE_REQUIRED_EXPORT],
[GUILE_MODULE_EXPORTS(guile_module_required_export,$1,$2)
if test "$guile_module_required_export" = "no" ; then
AC_MSG_ERROR([module $1 does not export $2; required])
fi
])
## guile.m4 ends here
guile-commonmark-0.1.2+20240812/README.md 0000644 0001750 0001750 00000003124 13652433030 016754 0 ustar frankie frankie guile-commonmark
================
guile-commonmark is a library for parsing [CommonMark](http://commonmark.org/),
a fully specified variant of Markdown.
Example
-------
```scheme
(use-modules (commonmark sxml)
(sxml simple))
(define doc
"A CommonMark document
=============
1. here is a list
2. with another item
this is some code
A regular paragraph")
;; Parses the CommonMark.
(define doc-sxml (commonmark->sxml doc))
;; Writes to the current output port
(sxml->xml doc-sxml)
```
Requirements
------------
- [GNU Guile](https://www.gnu.org/software/guile/) >= 2.0.11
- [pkg-config](http://www.freedesktop.org/wiki/Software/pkg-config)
Installation
------------
Download the latest tarball and run:
```sh
./configure
make
sudo make install
```
This will install guile-commonmark with the prefix `/usr/local/`. This
is not in the default load path for GNU Guile. You may choose to
change the prefix to your GNU Guile's location with `./configure
--prefix=/usr` or add `/usr/local/` to GNU Guile's load path in your
`.profile` or `.bash_profile` like this (replacing 2.2 with your GNU
Guile version):
```sh
export GUILE_LOAD_PATH="/usr/local/share/guile/site/2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/2.2/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_COMPILED_LOAD_PATH"
```
To build from git requires Autoconf and Automake.
```sh
./bootstrap
./configure
make
make install
```
To install from a recent version of git using Guix.
```sh
guix package -f guix.scm
```
License
-------
LGPLv3 or later. See COPYING.LESSER and COPYING
guile-commonmark-0.1.2+20240812/.gitignore 0000644 0001750 0001750 00000000175 13652433030 017470 0 ustar frankie frankie *~
*.go
*.log
*.trs
aclocal.m4
autom4te.cache/
build-aux/
Makefile
Makefile.in
config.status
configure
pre-inst-env
test-env
guile-commonmark-0.1.2+20240812/commonmark.scm 0000644 0001750 0001750 00000001576 13652433030 020355 0 ustar frankie frankie ;; Copyright (C) 2015-2016, 2020 Erik Edrosa
;;
;; This file is part of guile-commonmark
;;
;; guile-commonmark is free software: you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation, either version 3 of
;; the License, or (at your option) any later version.
;;
;; guile-commonmark is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU Lesser General Public License for more details.
;;
;; You should have received a copy of the GNU Lesser General Public License
;; along with guile-commonmark. If not, see .
(define-module (commonmark)
#:use-module (commonmark sxml)
#:re-export (commonmark->sxml))