summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.in59
-rw-r--r--test/README21
-rw-r--r--test/file-organization.org4
-rw-r--r--test/infra/Dockerfile.emba28
-rw-r--r--test/infra/gitlab-ci.yml127
-rw-r--r--test/lisp/auth-source-pass-tests.el24
-rw-r--r--test/lisp/auth-source-tests.el4
-rw-r--r--test/lisp/autorevert-tests.el14
-rw-r--r--test/lisp/calc/calc-tests.el103
-rw-r--r--test/lisp/calculator-tests.el51
-rw-r--r--test/lisp/calendar/cal-french-tests.el113
-rw-r--r--test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american2
-rw-r--r--test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european2
-rw-r--r--test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso2
-rw-r--r--test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american2
-rw-r--r--test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european2
-rw-r--r--test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso2
-rw-r--r--test/lisp/calendar/icalendar-tests.el114
-rw-r--r--test/lisp/calendar/iso8601-tests.el10
-rw-r--r--test/lisp/calendar/parse-time-tests.el2
-rw-r--r--test/lisp/cedet/cedet-files-tests.el54
-rw-r--r--test/lisp/cedet/semantic-utest-c.el1
-rw-r--r--test/lisp/cedet/semantic-utest-fmt.el127
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/test.mk (renamed from test/manual/cedet/tests/test.mk)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/test.srt (renamed from test/manual/cedet/tests/test.srt)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/test.texi (renamed from test/manual/cedet/tests/test.texi)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testdoublens.cpp (renamed from test/manual/cedet/tests/testdoublens.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testdoublens.hpp (renamed from test/manual/cedet/tests/testdoublens.hpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testfriends.cpp (renamed from test/manual/cedet/tests/testfriends.cpp)1
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testjavacomp.java (renamed from test/manual/cedet/tests/testjavacomp.java)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testlocalvars.cpp (renamed from test/manual/cedet/tests/testlocalvars.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testnsp.cpp (renamed from test/manual/cedet/tests/testnsp.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c (renamed from test/manual/cedet/tests/testsppcomplete.c)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp (renamed from test/manual/cedet/tests/teststruct.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testsubclass.cpp (renamed from test/manual/cedet/tests/testsubclass.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testsubclass.hh (renamed from test/manual/cedet/tests/testsubclass.hh)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testtemplates.cpp (renamed from test/manual/cedet/tests/testtemplates.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testtypedefs.cpp (renamed from test/manual/cedet/tests/testtypedefs.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testusing.cpp (renamed from test/manual/cedet/tests/testusing.cpp)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testusing.hh (renamed from test/manual/cedet/tests/testusing.hh)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testvarnames.c (renamed from test/manual/cedet/tests/testvarnames.c)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testvarnames.java (renamed from test/manual/cedet/tests/testvarnames.java)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia-resources/testwisent.wy (renamed from test/manual/cedet/tests/testwisent.wy)0
-rw-r--r--test/lisp/cedet/semantic-utest-ia.el71
-rw-r--r--test/lisp/cedet/semantic-utest.el2
-rw-r--r--test/lisp/cedet/semantic/bovine/gcc-tests.el129
-rw-r--r--test/lisp/cedet/semantic/format-resources/test-fmt.cpp (renamed from test/manual/cedet/tests/test-fmt.cpp)0
-rw-r--r--test/lisp/cedet/semantic/format-resources/test-fmt.el (renamed from test/manual/cedet/tests/test-fmt.el)4
-rw-r--r--test/lisp/cedet/semantic/format-tests.el95
-rw-r--r--test/lisp/cedet/semantic/fw-tests.el45
-rw-r--r--test/lisp/cedet/srecode-utest-template.el2
-rw-r--r--test/lisp/cedet/srecode/document-tests.el80
-rw-r--r--test/lisp/cedet/srecode/fields-tests.el (renamed from test/manual/cedet/srecode-tests.el)94
-rw-r--r--test/lisp/comint-tests.el1
-rw-r--r--test/lisp/cus-edit-tests.el4
-rw-r--r--test/lisp/custom-resources/custom--test-theme.el6
-rw-r--r--test/lisp/custom-tests.el275
-rw-r--r--test/lisp/descr-text-tests.el2
-rw-r--r--test/lisp/dired-x-tests.el13
-rw-r--r--test/lisp/dom-tests.el10
-rw-r--r--test/lisp/electric-tests.el137
-rw-r--r--test/lisp/emacs-lisp/bindat-tests.el134
-rw-r--r--test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el9
-rw-r--r--test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el6
-rw-r--r--test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el5
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el472
-rw-r--r--test/lisp/emacs-lisp/cconv-tests.el9
-rw-r--r--test/lisp/emacs-lisp/check-declare-tests.el10
-rw-r--r--test/lisp/emacs-lisp/checkdoc-tests.el44
-rw-r--r--test/lisp/emacs-lisp/cl-extra-tests.el22
-rw-r--r--test/lisp/emacs-lisp/cl-generic-tests.el21
-rw-r--r--test/lisp/emacs-lisp/cl-lib-tests.el22
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el63
-rw-r--r--test/lisp/emacs-lisp/comp-cstr-tests.el233
-rw-r--r--test/lisp/emacs-lisp/copyright-tests.el4
-rw-r--r--test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el42
-rw-r--r--test/lisp/emacs-lisp/edebug-tests.el153
-rw-r--r--test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el2
-rw-r--r--test/lisp/emacs-lisp/eieio-tests/eieio-tests.el18
-rw-r--r--test/lisp/emacs-lisp/ert-tests.el24
-rw-r--r--test/lisp/emacs-lisp/ert-x-tests.el22
-rw-r--r--test/lisp/emacs-lisp/generator-tests.el3
-rw-r--r--test/lisp/emacs-lisp/lisp-mnt-tests.el36
-rw-r--r--test/lisp/emacs-lisp/lisp-mode-tests.el2
-rw-r--r--test/lisp/emacs-lisp/lisp-tests.el2
-rw-r--r--test/lisp/emacs-lisp/macroexp-resources/m1.el36
-rw-r--r--test/lisp/emacs-lisp/macroexp-resources/m2.el33
-rw-r--r--test/lisp/emacs-lisp/macroexp-tests.el72
-rw-r--r--test/lisp/emacs-lisp/map-tests.el529
-rw-r--r--test/lisp/emacs-lisp/memory-report-tests.el16
-rw-r--r--test/lisp/emacs-lisp/package-tests.el68
-rw-r--r--test/lisp/emacs-lisp/pcase-tests.el84
-rw-r--r--test/lisp/emacs-lisp/rx-tests.el36
-rw-r--r--test/lisp/emacs-lisp/seq-tests.el24
-rw-r--r--test/lisp/emacs-lisp/shortdoc-tests.el45
-rw-r--r--test/lisp/emacs-lisp/subr-x-tests.el7
-rw-r--r--test/lisp/emacs-lisp/testcover-resources/testcases.el22
-rw-r--r--test/lisp/emacs-lisp/testcover-tests.el22
-rw-r--r--test/lisp/epg-config-tests.el47
-rw-r--r--test/lisp/erc/erc-tests.el64
-rw-r--r--test/lisp/eshell/em-hist-tests.el2
-rw-r--r--test/lisp/eshell/em-ls-tests.el2
-rw-r--r--test/lisp/eshell/esh-opt-tests.el2
-rw-r--r--test/lisp/eshell/eshell-tests.el2
-rw-r--r--test/lisp/ffap-tests.el19
-rw-r--r--test/lisp/filenotify-tests.el257
-rw-r--r--test/lisp/files-resources/.dir-locals.el5
-rw-r--r--test/lisp/files-resources/auto-test.zot11
-rw-r--r--test/lisp/files-resources/auto-test.zot21
-rw-r--r--test/lisp/files-resources/auto-test.zot31
-rw-r--r--test/lisp/files-resources/whatever.quux2
-rw-r--r--test/lisp/files-tests.el176
-rw-r--r--test/lisp/gnus/gnus-search-tests.el12
-rw-r--r--test/lisp/gnus/gnus-util-tests.el45
-rw-r--r--test/lisp/gnus/message-tests.el31
-rw-r--r--test/lisp/gnus/mm-decode-tests.el6
-rw-r--r--test/lisp/gnus/mml-sec-tests.el9
-rw-r--r--test/lisp/gnus/nnrss-tests.el16
-rw-r--r--test/lisp/help-fns-tests.el4
-rw-r--r--test/lisp/help-tests.el29
-rw-r--r--test/lisp/image-tests.el16
-rw-r--r--test/lisp/info-xref-tests.el2
-rw-r--r--test/lisp/international/mule-util-resources/utf-8.txt2
-rw-r--r--test/lisp/international/mule-util-tests.el40
-rw-r--r--test/lisp/international/ucs-normalize-tests.el2
-rw-r--r--test/lisp/json-tests.el195
-rw-r--r--test/lisp/jsonrpc-tests.el2
-rw-r--r--test/lisp/kmacro-tests.el2
-rw-r--r--test/lisp/loadhist-tests.el57
-rw-r--r--test/lisp/lpr-tests.el41
-rw-r--r--test/lisp/mail/mail-parse-tests.el54
-rw-r--r--test/lisp/mail/mail-utils-tests.el104
-rw-r--r--test/lisp/minibuffer-tests.el208
-rw-r--r--test/lisp/net/netrc-resources/netrc-folding6
-rw-r--r--test/lisp/net/netrc-tests.el7
-rw-r--r--test/lisp/net/network-stream-tests.el3
-rw-r--r--test/lisp/net/nsm-tests.el2
-rw-r--r--test/lisp/net/ntlm-resources/authinfo1
-rw-r--r--test/lisp/net/ntlm-tests.el368
-rw-r--r--test/lisp/net/puny-tests.el6
-rw-r--r--test/lisp/net/sasl-scram-rfc-tests.el2
-rw-r--r--test/lisp/net/shr-tests.el2
-rw-r--r--test/lisp/net/socks-tests.el291
-rw-r--r--test/lisp/net/tramp-archive-tests.el120
-rw-r--r--test/lisp/net/tramp-tests.el542
-rw-r--r--test/lisp/nxml/nxml-mode-tests.el2
-rw-r--r--test/lisp/nxml/xsd-regexp-tests.el2
-rw-r--r--test/lisp/obsolete/cl-tests.el22
-rw-r--r--test/lisp/obsolete/inversion-tests.el81
-rw-r--r--test/lisp/play/cookie1-resources/cookies8
-rw-r--r--test/lisp/play/cookie1-tests.el40
-rw-r--r--test/lisp/progmodes/compile-tests.el47
-rw-r--r--test/lisp/progmodes/cperl-mode-resources/cperl-bug-22355.pl14
-rw-r--r--test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl10
-rw-r--r--test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl21
-rw-r--r--test/lisp/progmodes/cperl-mode-resources/grammar.pl158
-rw-r--r--test/lisp/progmodes/cperl-mode-tests.el260
-rw-r--r--test/lisp/progmodes/elisp-mode-tests.el19
-rw-r--r--test/lisp/progmodes/executable-tests.el51
-rw-r--r--test/lisp/progmodes/f90-tests.el3
-rw-r--r--test/lisp/progmodes/grep-tests.el69
-rw-r--r--test/lisp/progmodes/octave-tests.el49
-rw-r--r--test/lisp/progmodes/perl-mode-tests.el9
-rw-r--r--test/lisp/progmodes/project-tests.el110
-rw-r--r--test/lisp/progmodes/python-tests.el24
-rw-r--r--test/lisp/progmodes/ruby-mode-tests.el53
-rw-r--r--test/lisp/progmodes/xref-resources/file1.txt2
-rw-r--r--test/lisp/progmodes/xref-resources/file3.txt1
-rw-r--r--test/lisp/progmodes/xref-tests.el68
-rw-r--r--test/lisp/replace-tests.el20
-rw-r--r--test/lisp/shadowfile-tests.el22
-rw-r--r--test/lisp/shell-tests.el19
-rw-r--r--test/lisp/simple-tests.el136
-rw-r--r--test/lisp/so-long-tests/so-long-tests-helpers.el32
-rw-r--r--test/lisp/so-long-tests/so-long-tests.el265
-rw-r--r--test/lisp/so-long-tests/spelling-tests.el2
-rw-r--r--test/lisp/subr-tests.el67
-rw-r--r--test/lisp/term-tests.el2
-rw-r--r--test/lisp/textmodes/css-mode-tests.el12
-rw-r--r--test/lisp/textmodes/dns-mode-tests.el21
-rw-r--r--test/lisp/textmodes/fill-tests.el2
-rw-r--r--test/lisp/textmodes/sgml-mode-tests.el27
-rw-r--r--test/lisp/textmodes/tildify-tests.el2
-rw-r--r--test/lisp/thingatpt-tests.el35
-rw-r--r--test/lisp/thumbs-tests.el34
-rw-r--r--test/lisp/time-stamp-tests.el453
-rw-r--r--test/lisp/time-tests.el1
-rw-r--r--test/lisp/vc/diff-mode-tests.el154
-rw-r--r--test/lisp/vc/vc-bzr-tests.el2
-rw-r--r--test/lisp/wdired-tests.el4
-rw-r--r--test/lisp/xml-tests.el2
-rw-r--r--test/manual/biditest.el6
-rw-r--r--test/manual/cedet/cedet-utests.el150
-rw-r--r--test/manual/cedet/ede-tests.el14
-rw-r--r--test/manual/cedet/semantic-tests.el143
-rw-r--r--test/manual/cedet/tests/test.el5
-rw-r--r--test/manual/etags/CTAGS.good99
-rw-r--r--test/manual/etags/ETAGS.good_11562
-rw-r--r--test/manual/etags/ETAGS.good_21631
-rw-r--r--test/manual/etags/ETAGS.good_31582
-rw-r--r--test/manual/etags/ETAGS.good_41888
-rw-r--r--test/manual/etags/ETAGS.good_51977
-rw-r--r--test/manual/etags/ETAGS.good_61977
-rw-r--r--test/manual/etags/Makefile4
-rw-r--r--test/manual/etags/README60
-rw-r--r--test/manual/etags/el-src/TAGTEST.EL2
-rw-r--r--test/manual/etags/merc-src/accumulator.m1962
-rw-r--r--test/manual/etags/rs-src/test.rs14
-rw-r--r--test/manual/image-circular-tests.el2
-rw-r--r--test/manual/image-size-tests.el5
-rw-r--r--test/manual/image-transforms-tests.el2
-rw-r--r--test/manual/indent/scheme.scm23
-rw-r--r--test/manual/indent/scss-mode.scss6
-rw-r--r--test/manual/redisplay-testsuite.el2
-rw-r--r--test/manual/scroll-tests.el2
-rw-r--r--test/misc/test-custom-deps.el42
-rw-r--r--test/misc/test-custom-libs.el48
-rw-r--r--test/misc/test-custom-noloads.el45
-rw-r--r--test/misc/test-custom-opts.el39
-rw-r--r--test/src/buffer-tests.el65
-rw-r--r--test/src/character-tests.el45
-rw-r--r--test/src/coding-tests.el4
-rw-r--r--test/src/comp-resources/comp-test-45603.el28
-rw-r--r--test/src/comp-resources/comp-test-funcs-dyn.el50
-rw-r--r--test/src/comp-resources/comp-test-funcs.el710
-rw-r--r--test/src/comp-resources/comp-test-pure.el40
-rw-r--r--test/src/comp-tests.el1443
-rw-r--r--test/src/data-tests.el23
-rw-r--r--test/src/editfns-tests.el6
-rw-r--r--test/src/emacs-module-resources/mod-test.c4
-rw-r--r--test/src/emacs-module-tests.el6
-rw-r--r--test/src/emacs-tests.el263
-rw-r--r--test/src/fileio-tests.el24
-rw-r--r--test/src/filelock-tests.el183
-rw-r--r--test/src/fns-tests.el22
-rw-r--r--test/src/font-tests.el25
-rw-r--r--test/src/indent-tests.el22
-rw-r--r--test/src/json-tests.el30
-rw-r--r--test/src/keyboard-tests.el39
-rw-r--r--test/src/keymap-tests.el58
-rw-r--r--test/src/lread-tests.el67
-rw-r--r--test/src/process-tests.el55
-rw-r--r--test/src/search-tests.el42
-rw-r--r--test/src/syntax-tests.el11
-rw-r--r--test/src/thread-tests.el8
-rw-r--r--test/src/timefns-tests.el2
-rw-r--r--test/src/undo-tests.el2
247 files changed, 18959 insertions, 7046 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index f907602a622..a3412d6b53a 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -32,6 +32,7 @@ SHELL = @SHELL@
srcdir = @srcdir@
abs_top_srcdir=@abs_top_srcdir@
+top_builddir = @top_builddir@
VPATH = $(srcdir)
FIND_DELETE = @FIND_DELETE@
@@ -46,30 +47,20 @@ SO = @MODULES_SUFFIX@
SEPCHAR = @SEPCHAR@
+HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
-# 'make' verbosity.
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+REPLACE_FREE = @REPLACE_FREE@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-
-AM_V_ELC = $(am__v_ELC_@AM_V@)
-am__v_ELC_ = $(am__v_ELC_@AM_DEFAULT_V@)
-am__v_ELC_0 = @echo " ELC " $@;
-am__v_ELC_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 =
+-include ${top_builddir}/src/verbose.mk
+# Load any GNU ELPA dependencies that are present, for optional tests.
+GNU_ELPA_DIRECTORY ?= $(srcdir)/../../elpa
+# Keep elpa_dependencies dependency-ordered.
+elpa_dependencies = \
+ url-http-ntlm/url-http-ntlm.el \
+ web-server/web-server.el
+elpa_els = $(addprefix $(GNU_ELPA_DIRECTORY)/packages/,$(elpa_dependencies))
+elpa_opts = $(foreach el,$(elpa_els),$(and $(wildcard $(el)),-L $(dir $(el)) -l $(el)))
# We never change directory before running Emacs, so a relative file
# name is fine, and makes life easier. If we need to change
@@ -81,7 +72,7 @@ EMACS_EXTRAOPT=
# Command line flags for Emacs.
# Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
# but we might as well be explicit.
-EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT)
+EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(elpa_opts) $(EMACS_EXTRAOPT)
# Prevent any settings in the user environment causing problems.
unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS
@@ -105,7 +96,7 @@ export TEST_LOAD_EL ?= \
$(if $(findstring $(MAKECMDGOALS), all check check-maybe),no,yes)
# Additional settings for ert.
-ert_opts =
+ert_opts += $(elpa_opts)
# Maximum length of lines in ert backtraces; nil for no limit.
# (if empty, use the default ert-batch-backtrace-right-margin).
@@ -131,6 +122,8 @@ emacs = LANG=C EMACSLOADPATH= \
# Set HOME to a nonexistent directory to prevent tests from accessing
# it accidentally (e.g., popping up a gnupg dialog if ~/.authinfo.gpg
# exists, or writing to ~/.bzr.log when running bzr commands).
+# NOTE if the '/nonexistent' name is changed `normal-top-level' in
+# startup.el must be updated too.
TEST_HOME = /nonexistent
test_module_dir := src/emacs-module-resources
@@ -139,9 +132,15 @@ test_module_dir := src/emacs-module-resources
all: check
+ifeq ($(HAVE_NATIVE_COMP),yes)
SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable)))
SELECTOR_EXPENSIVE = (not (tag :unstable))
SELECTOR_ALL = t
+else
+SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable) (tag :nativecomp)))
+SELECTOR_EXPENSIVE = (not (or (tag :unstable) (tag :nativecomp)))
+SELECTOR_ALL = (not (tag :nativecomp))
+endif
ifdef SELECTOR
SELECTOR_ACTUAL=$(SELECTOR)
else ifndef MAKECMDGOALS
@@ -164,7 +163,7 @@ endif
WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; }
## On Hydra or Emba, always show logs for certain problematic tests.
ifdef EMACS_HYDRA_CI
-lisp/net/tramp-tests.log \
+lisp/net/tramp-tests.log lisp/electric-tests.log \
: WRITE_LOG = 2>&1 | tee $@
endif
ifdef EMACS_EMBA_CI
@@ -248,13 +247,13 @@ endef
$(foreach test,${TESTS},$(eval $(call test_template,${test})))
## Get the tests for only a specific directory.
-SUBDIRS = $(sort $(shell find lib-src lisp src -type d ! -path "*resources*" -print))
+SUBDIRS = $(sort $(shell cd ${srcdir} && find lib-src lisp misc src -type d ! -path "*resources*" -print))
define subdir_template
.PHONY: check-$(subst /,-,$(1))
check-$(subst /,-,$(1)):
@${MAKE} check LOGFILES="$(patsubst %.el,%.log, \
- $(patsubst $(srcdir)/%,%,$(wildcard $(1)/*.el)))"
+ $(patsubst $(srcdir)/%,%,$(wildcard ${srcdir}/$(1)/*.el)))"
endef
$(foreach subdir, $(SUBDIRS), $(eval $(call subdir_template,$(subdir))))
@@ -277,6 +276,9 @@ MODULE_CFLAGS = -I../src -I$(srcdir)/../src -I../lib -I$(srcdir)/../lib \
test_module = $(test_module_dir)/mod-test${SO}
src/emacs-module-tests.log src/emacs-module-tests.elc: $(test_module)
+FREE_SOURCE_0 =
+FREE_SOURCE_1 = $(srcdir)/../lib/free.c
+
# In the compilation command, we can't use any object or archive file
# as source because those are not compiled with -fPIC. Therefore we
# use only source files.
@@ -285,10 +287,12 @@ $(test_module): $(test_module:${SO}=.c) ../src/emacs-module.h
$(AM_V_CCLD)$(CC) -shared $(CPPFLAGS) $(MODULE_CFLAGS) $(LDFLAGS) \
-o $@ $< $(LIBGMP) \
$(and $(GMP_H),$(srcdir)/../lib/mini-gmp-gnulib.c) \
- $(if $(OMIT_GNULIB_MODULE_free-posix),,$(srcdir)/../lib/free.c) \
+ $(FREE_SOURCE_$(REPLACE_FREE)) \
$(srcdir)/../lib/timespec.c $(srcdir)/../lib/gettime.c
endif
+src/emacs-tests.log: ../lib-src/seccomp-filter.c
+
## Check that there is no 'automated' subdirectory, which would
## indicate an incomplete merge from an older version of Emacs where
## the tests were arranged differently.
@@ -341,6 +345,7 @@ mostlyclean:
clean:
find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE)
+ rm -f ${srcdir}/lisp/gnus/mml-sec-resources/random_seed
rm -f $(test_module_dir)/*.o $(test_module_dir)/*.so \
$(test_module_dir)/*.dll
diff --git a/test/README b/test/README
index 5f3c10adbe1..97611cf8644 100644
--- a/test/README
+++ b/test/README
@@ -7,6 +7,9 @@ Emacs's functionality. Please help add tests!
See the file file-organization.org for the details of the directory
structure and file-naming conventions.
+For tests in the manual/ subdirectory, look there for separate README
+files, or look for instructions in the test files themselves.
+
Emacs uses ERT, Emacs Lisp Regression Testing, for testing. See (info
"(ert)") or https://www.gnu.org/software/emacs/manual/html_node/ert/
for more information on writing and running tests.
@@ -22,7 +25,10 @@ following tags are recognized:
* :unstable
The test is under development. It shall run on demand only.
-The Makefile in this directory supports the following targets:
+The Makefile sets the environment variable $EMACS_TEST_DIRECTORY,
+which points to this directory. This environment variable does not
+exist when the tests are run outside make. The Makefile supports the
+following targets:
* make check
Run all tests as defined in the directory. Expensive and unstable
@@ -99,6 +105,11 @@ debugging. To do that, use
make TEST_INTERACTIVE=yes ...
+By default, ERT test failure summaries are quite brief in batch
+mode--only the names of the failed tests are listed. If the
+$EMACS_TEST_VERBOSE environment variable is set, the failure summaries
+will also include the data from the failing test.
+
Some of the tests require a remote temporary directory
(autorevert-tests.el, filenotify-tests.el, shadowfile-tests.el and
tramp-tests.el). Per default, a mock-up connection method is used
@@ -106,7 +117,13 @@ tramp-tests.el). Per default, a mock-up connection method is used
to test a real remote connection, set $REMOTE_TEMPORARY_FILE_DIRECTORY
to a suitable value in order to overwrite the default value:
- env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ...
+ env REMOTE_TEMPORARY_FILE_DIRECTORY=/ssh:host:/tmp make ...
+
+Some optional tests require packages from GNU ELPA. By default
+../../elpa will be checked for these packages. If GNU ELPA is checked
+out somewhere else, use
+
+ make GNU_ELPA_DIRECTORY=/path/to/elpa ...
There are also continuous integration tests on
diff --git a/test/file-organization.org b/test/file-organization.org
index 7cf5b88d6d0..d1f92da4324 100644
--- a/test/file-organization.org
+++ b/test/file-organization.org
@@ -43,6 +43,10 @@ Similarly, tests of features implemented in C should reside in
~-tests.el~ added to the base-name of the tested source file. Thus,
tests for ~src/fileio.c~ should be in ~test/src/fileio-tests.el~.
+Some tests do not belong to any one particular file. Such tests
+should be put in the ~misc~ directory and be given a descriptive name
+that does /not/ end with ~-tests.el~.
+
There are also some test materials that cannot be run automatically
(i.e. via ert). These should be placed in ~/test/manual~; they are
not run by the "make check" command and its derivatives.
diff --git a/test/infra/Dockerfile.emba b/test/infra/Dockerfile.emba
index 421264db9c9..9f03482c3fd 100644
--- a/test/infra/Dockerfile.emba
+++ b/test/infra/Dockerfile.emba
@@ -28,7 +28,7 @@ FROM debian:stretch as emacs-base
RUN apt-get update && \
apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
- libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev git \
+ libc-dev gcc g++ make autoconf automake libncurses-dev gnutls-dev git texinfo \
&& rm -rf /var/lib/apt/lists/*
FROM emacs-base as emacs-inotify
@@ -40,21 +40,22 @@ RUN apt-get update && \
COPY . /checkout
WORKDIR /checkout
RUN ./autogen.sh autoconf
-RUN ./configure --without-makeinfo
+RUN ./configure
RUN make -j4 bootstrap
RUN make -j4
FROM emacs-base as emacs-filenotify-gio
RUN apt-get update && \
- apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 libglib2.0-dev libglib2.0-bin libglib2.0-0 \
+ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 \
+ libglib2.0-dev libglib2.0-bin libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
COPY . /checkout
WORKDIR /checkout
RUN ./autogen.sh autoconf
-RUN ./configure --without-makeinfo --with-file-notification=gfile
-RUN make bootstrap
+RUN ./configure --with-file-notification=gfile
+RUN make -j4 bootstrap
RUN make -j4
FROM emacs-base as emacs-gnustep
@@ -66,6 +67,21 @@ RUN apt-get update && \
COPY . /checkout
WORKDIR /checkout
RUN ./autogen.sh autoconf
-RUN ./configure --without-makeinfo --with-ns
+RUN ./configure --with-ns
RUN make bootstrap
RUN make -j4
+
+FROM emacs-base as emacs-native-comp-speed0
+
+RUN apt-get update && \
+ apt-get install -y --no-install-recommends -o=Dpkg::Use-Pty=0 libgccjit-6-dev \
+ && rm -rf /var/lib/apt/lists/*
+
+ARG make_bootstrap_params=""
+
+COPY . /checkout
+WORKDIR /checkout
+RUN ./autogen.sh autoconf
+RUN ./configure --with-nativecomp
+RUN make bootstrap -j2 NATIVE_FULL_AOT=1 BYTE_COMPILE_EXTRA_FLAGS='--eval "(setq comp-speed 0)"'
+RUN make -j4
diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml
index 5a0ab54e4b9..6876a8b11d8 100644
--- a/test/infra/gitlab-ci.yml
+++ b/test/infra/gitlab-ci.yml
@@ -44,6 +44,7 @@ workflow:
variables:
GIT_STRATEGY: fetch
EMACS_EMBA_CI: 1
+ EMACS_TEST_VERBOSE: 1
# # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
# DOCKER_HOST: tcp://docker:2376
# DOCKER_TLS_CERTDIR: "/certs"
@@ -61,6 +62,8 @@ default:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
.job-template:
+ variables:
+ test_name: ${CI_JOB_NAME}-${CI_COMMIT_SHORT_SHA}
rules:
- changes:
- "**/Makefile.in"
@@ -95,14 +98,18 @@ default:
artifacts:
expire_in: 24 hrs
paths: []
- # - "test/**/*.log"
- # - "**/*.log"
# using the variables for each job
script:
- docker pull ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG}
# TODO: with make -j4 several of the tests were failing, for example shadowfile-tests, but passed without it
- 'export PWD=$(pwd)'
- - 'docker run -i --rm -e EMACS_EMBA_CI=${EMACS_EMBA_CI} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"'
+ - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"'
+ after_script:
+ # - docker ps -a
+ # - printenv
+ # - test -n "$(docker ps -aq -f name=${test_name})" && ( docker export ${test_name} | tar -tvf - )
+ - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name}
+ - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}
.build-template:
rules:
@@ -133,6 +140,19 @@ default:
- docker build --pull --target ${target} -t ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} -f test/infra/Dockerfile.emba .
- docker push ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG}
+.test-template:
+ # Do not run fast and normal test jobs when scheduled
+ rules:
+ - if: '$CI_JOB_STAGE =~ "fast|normal" && $CI_PIPELINE_SOURCE == "schedule"'
+ when: never
+ - when: always
+ artifacts:
+ name: ${test_name}
+ public: true
+ expire_in: 1 week
+ paths:
+ - "${test_name}/**/*.log"
+
.gnustep-template:
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
@@ -162,6 +182,21 @@ default:
- test/lisp/autorevert-tests.el
- test/lisp/filenotify-tests.el
+.native-comp-template:
+ rules:
+ - if: '$CI_PIPELINE_SOURCE == "web"'
+ - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ changes:
+ - "**/Makefile.in"
+ - .gitlab-ci.yml
+ - lisp/emacs-lisp/comp.el
+ - lisp/emacs-lisp/comp-cstr.el
+ - src/comp.{h,m}
+ - test/infra/*
+ - test/src/comp-resources/*.el
+ - test/src/comp-tests.el
+ timeout: 8 hours
+
stages:
- prep-images
- build-images
@@ -169,6 +204,8 @@ stages:
- normal
- platform-images
- platforms
+ - native-comp-images
+ - native-comp
- slow
prep-image-base:
@@ -180,62 +217,106 @@ prep-image-base:
build-image-inotify:
stage: build-images
extends: [.job-template, .build-template]
+ needs: [prep-image-base]
variables:
target: emacs-inotify
test-fast-inotify:
stage: fast
- extends: [.job-template]
+ extends: [.job-template, .test-template]
variables:
target: emacs-inotify
make_params: "-C test check"
-build-image-filenotify-gio:
- stage: platform-images
- extends: [.job-template, .build-template, .filenotify-gio-template]
- variables:
- target: emacs-filenotify-gio
-
-build-image-gnustep:
- stage: platform-images
- extends: [.job-template, .build-template, .gnustep-template]
- variables:
- target: emacs-gnustep
-
test-lisp-inotify:
stage: normal
- extends: [.job-template]
+ extends: [.job-template, .test-template]
variables:
target: emacs-inotify
make_params: "-C test check-lisp"
test-lisp-net-inotify:
stage: normal
- extends: [.job-template]
+ extends: [.job-template, .test-template]
variables:
target: emacs-inotify
make_params: "-C test check-lisp-net"
+build-image-filenotify-gio:
+ stage: platform-images
+ extends: [.job-template, .build-template, .filenotify-gio-template]
+ needs: [prep-image-base]
+ variables:
+ target: emacs-filenotify-gio
+
+build-image-gnustep:
+ stage: platform-images
+ extends: [.job-template, .build-template, .gnustep-template]
+ needs: [prep-image-base]
+ variables:
+ target: emacs-gnustep
+
test-filenotify-gio:
# This tests file monitor libraries gfilemonitor and gio.
stage: platforms
- extends: [.job-template, .filenotify-gio-template]
+ needs: [build-image-filenotify-gio]
+ extends: [.job-template, .test-template, .filenotify-gio-template]
variables:
target: emacs-filenotify-gio
- make_params: "-k -C test autorevert-tests filenotify-tests"
+ make_params: "-k -C test autorevert-tests.log filenotify-tests.log"
test-gnustep:
# This tests the GNUstep build process
stage: platforms
+ needs: [build-image-gnustep]
extends: [.job-template, .gnustep-template]
variables:
target: emacs-gnustep
make_params: install
+build-native-bootstrap-speed0:
+ stage: native-comp-images
+ extends: [.job-template, .build-template, .native-comp-template]
+ needs: [prep-image-base]
+ variables:
+ target: emacs-native-comp-speed0
+
+# build-native-bootstrap-speed0:
+# # Test a full native bootstrap
+# # Run for now only speed 0 to limit memory usage and compilation time.
+# stage: native-comp-images
+# # Uncomment the following to run it only when scheduled.
+# # only:
+# # - schedules
+# script:
+# - DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libgccjit-6-dev
+# - ./autogen.sh autoconf
+# - ./configure --with-nativecomp
+# - make bootstrap NATIVE_FULL_AOT=1 BYTE_COMPILE_EXTRA_FLAGS='--eval "(setq comp-speed 0)"' -j2
+# timeout: 8 hours
+
+# build-native-bootstrap-speed1:
+# stage: native-comp-images
+# script:
+# - DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libgccjit-6-dev
+# - ./autogen.sh autoconf
+# - ./configure --with-nativecomp
+# - make bootstrap BYTE_COMPILE_EXTRA_FLAGS='--eval "(setq comp-speed 1)"'
+# timeout: 8 hours
+
+# build-native-bootstrap-speed2:
+# stage: native-comp-images
+# script:
+# - DEBIAN_FRONTEND=noninteractive apt install --no-install-recommends -y -qq -o=Dpkg::Use-Pty=0 libgccjit-6-dev
+# - ./autogen.sh autoconf
+# - ./configure --with-nativecomp
+# - make bootstrap
+# timeout: 8 hours
+
test-all-inotify:
# This tests also file monitor libraries inotify and inotifywatch.
stage: slow
- extends: [.job-template]
+ extends: [.job-template, .test-template]
rules:
# note there's no "changes" section, so this always runs on a schedule
- if: '$CI_PIPELINE_SOURCE == "web"'
@@ -243,3 +324,7 @@ test-all-inotify:
variables:
target: emacs-inotify
make_params: check-expensive
+
+# Local Variables:
+# add-log-current-defun-header-regexp: "^\\([-_.[:alnum:]]+\\)[ \t]*:"
+# End:
diff --git a/test/lisp/auth-source-pass-tests.el b/test/lisp/auth-source-pass-tests.el
index bfbef53db97..d050ac5b695 100644
--- a/test/lisp/auth-source-pass-tests.el
+++ b/test/lisp/auth-source-pass-tests.el
@@ -49,6 +49,12 @@
'(("key1" . "val1")
("key2" . "val2"))))))
+(ert-deftest auth-source-pass-parse-with-colons-in-data ()
+ (let ((content "pass\n--\nkey1 :val1\nkey2: please: keep my space after colon\n\n"))
+ (should (equal (auth-source-pass--parse-data content)
+ '(("key1" . "val1")
+ ("key2" . "please: keep my space after colon"))))))
+
(defvar auth-source-pass--debug-log nil
"Contains a list of all messages passed to `auth-source-do-debug`.")
@@ -424,21 +430,37 @@ HOSTNAME, USER and PORT are passed unchanged to
(auth-source-pass--with-store-find-foo
'(("foo" ("secret" . "foo password")))
(let ((result (auth-source-pass--build-result "foo" 512 "user")))
+ (should (equal (plist-get result :host) "foo"))
(should (equal (plist-get result :port) 512))
(should (equal (plist-get result :user) "user")))))
(ert-deftest auth-source-pass-build-result-return-entry-values ()
(auth-source-pass--with-store-find-foo '(("foo" ("port" . 512) ("user" . "anuser")))
(let ((result (auth-source-pass--build-result "foo" nil nil)))
+ (should (equal (plist-get result :host) "foo"))
(should (equal (plist-get result :port) 512))
(should (equal (plist-get result :user) "anuser")))))
(ert-deftest auth-source-pass-build-result-entry-takes-precedence ()
- (auth-source-pass--with-store-find-foo '(("foo" ("port" . 512) ("user" . "anuser")))
+ (auth-source-pass--with-store-find-foo '(("foo" ("host" . "bar") ("port" . 512) ("user" . "anuser")))
(let ((result (auth-source-pass--build-result "foo" 1024 "anotheruser")))
+ (should (equal (plist-get result :host) "bar"))
(should (equal (plist-get result :port) 512))
(should (equal (plist-get result :user) "anuser")))))
+(ert-deftest auth-source-pass-build-result-with-multiple-hosts ()
+ (auth-source-pass--with-store-find-foo
+ '(("foo" ("secret" . "foo password")))
+ (let ((result (auth-source-pass--build-result '("bar" "foo") 512 "user")))
+ (should (equal (plist-get result :host) "foo"))
+ (should (equal (plist-get result :port) 512))
+ (should (equal (plist-get result :user) "user")))))
+
+(ert-deftest auth-source-pass-build-result-with-multiple-hosts-no-match ()
+ (auth-source-pass--with-store-find-foo
+ '(("foo" ("secret" . "foo password")))
+ (should-not (auth-source-pass--build-result '("bar" "baz") 512 "user"))))
+
(ert-deftest auth-source-pass-can-start-from-auth-source-search ()
(auth-source-pass--with-store '(("gitlab.com" ("user" . "someone")))
(auth-source-pass-enable)
diff --git a/test/lisp/auth-source-tests.el b/test/lisp/auth-source-tests.el
index 4f0d9949af5..1c4bd8d36d4 100644
--- a/test/lisp/auth-source-tests.el
+++ b/test/lisp/auth-source-tests.el
@@ -320,7 +320,9 @@
;; Redefine `read-*' in order to avoid interactive input.
(cl-letf (((symbol-function 'read-passwd) (lambda (_) passwd))
((symbol-function 'read-string)
- (lambda (_prompt _initial _history default) default)))
+ (lambda (_prompt &optional _initial _history default
+ _inherit-input-method)
+ default)))
(setq auth-info
(car (auth-source-search
:max 1 :host host :require '(:user :secret) :create t))))
diff --git a/test/lisp/autorevert-tests.el b/test/lisp/autorevert-tests.el
index 45cf6353960..96169c75d3d 100644
--- a/test/lisp/autorevert-tests.el
+++ b/test/lisp/autorevert-tests.el
@@ -1,4 +1,4 @@
-;;; auto-revert-tests.el --- Tests of auto-revert -*- lexical-binding: t -*-
+;;; autorevert-tests.el --- Tests of auto-revert -*- lexical-binding: t -*-
;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
@@ -133,7 +133,9 @@ This expects `auto-revert--messages' to be bound by
(format-message
"Reverting buffer `%s'\\." (buffer-name buffer))
(or auto-revert--messages ""))))
- (if (with-current-buffer buffer auto-revert-use-notify)
+ (if (and (or file-notify--library
+ (file-remote-p temporary-file-directory))
+ (with-current-buffer buffer auto-revert-use-notify))
(read-event nil nil 0.05)
(sleep-for 0.05)))))
@@ -284,7 +286,7 @@ This expects `auto-revert--messages' to be bound by
;; Repeated unpredictable failures, bug#32645.
;; Unlikely to be hydra-specific?
; (skip-unless (not (getenv "EMACS_HYDRA_CI")))
-
+ :tags '(:unstable)
(with-auto-revert-test
(let ((tmpfile (make-temp-file "auto-revert-test"))
;; Try to catch bug#32645.
@@ -669,6 +671,12 @@ This expects `auto-revert--messages' to be bound by
(auto-revert--deftest-remote auto-revert-test07-auto-revert-several-buffers
"Check autorevert for several buffers visiting the same remote file.")
+;; Mark all tests as unstable on Cygwin (bug#49665).
+(when (eq system-type 'cygwin)
+ (dolist (test (apropos-internal "^auto-revert" #'ert-test-boundp))
+ (setf (ert-test-tags (ert-get-test test))
+ (cons :unstable (ert-test-tags (ert-get-test test))))))
+
(defun auto-revert-test-all (&optional interactive)
"Run all tests for \\[auto-revert]."
(interactive "p")
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el
index bdcf78e020a..13dd228d3b3 100644
--- a/test/lisp/calc/calc-tests.el
+++ b/test/lisp/calc/calc-tests.el
@@ -191,6 +191,33 @@ An existing calc stack is reused, otherwise a new one is created."
(let ((calc-number-radix 36))
(should (equal (math-format-number 12345678901) "36#5,O6A,QT1")))))
+(ert-deftest calc-digit-after-point ()
+ "Test display of trailing 0 after decimal point (bug#47302)."
+ (let ((calc-digit-after-point nil))
+ ;; Integral floats have no digits after the decimal point (default).
+ (should (equal (math-format-number '(float 0 0)) "0."))
+ (should (equal (math-format-number '(float 5 0)) "5."))
+ (should (equal (math-format-number '(float 3 1)) "30."))
+ (should (equal (math-format-number '(float 23 0)) "23."))
+ (should (equal (math-format-number '(float 123 0)) "123."))
+ (should (equal (math-format-number '(float 1 -1)) "0.1"))
+ (should (equal (math-format-number '(float 54 -1)) "5.4"))
+ (should (equal (math-format-number '(float 1 -4)) "1e-4"))
+ (should (equal (math-format-number '(float 1 14)) "1e14"))
+ (should (equal (math-format-number 12) "12")))
+ (let ((calc-digit-after-point t))
+ ;; Integral floats have at least one digit after the decimal point.
+ (should (equal (math-format-number '(float 0 0)) "0.0"))
+ (should (equal (math-format-number '(float 5 0)) "5.0"))
+ (should (equal (math-format-number '(float 3 1)) "30.0"))
+ (should (equal (math-format-number '(float 23 0)) "23.0"))
+ (should (equal (math-format-number '(float 123 0)) "123.0"))
+ (should (equal (math-format-number '(float 1 -1)) "0.1"))
+ (should (equal (math-format-number '(float 54 -1)) "5.4"))
+ (should (equal (math-format-number '(float 1 -4)) "1e-4"))
+ (should (equal (math-format-number '(float 1 14)) "1e14"))
+ (should (equal (math-format-number 12) "12"))))
+
(ert-deftest calc-calendar ()
"Test calendar conversions (bug#36822)."
(should (equal (calcFunc-julian (math-parse-date "2019-07-27")) 2458692))
@@ -707,6 +734,82 @@ An existing calc stack is reused, otherwise a new one is created."
(var c var-c))))))
(calc-set-language nil)))
+(defvar var-g)
+
+;; Test `let'.
+(defmath test1 (x)
+ (let ((x (+ x 1))
+ (y (+ x 3)))
+ (let ((z (+ y 6)))
+ (* x y z g))))
+
+;; Test `let*'.
+(defmath test2 (x)
+ (let* ((y (+ x 1))
+ (z (+ y 3)))
+ (let* ((u (+ z 6)))
+ (* x y z u g))))
+
+;; Test `for'.
+(defmath test3 (x)
+ (let ((s 0))
+ (for ((ii 1 x)
+ (jj 1 ii))
+ (setq s (+ s (* ii jj))))
+ s))
+
+;; Test `for' with non-unit stride.
+(defmath test4 (x)
+ (let ((l nil))
+ (for ((ii 1 x 1)
+ (jj 1 10 ii))
+ (setq l ('cons jj l))) ; Use Lisp `cons', not `calcFunc-cons'.
+ (reverse l)))
+
+;; Test `foreach'.
+(defmath test5 (x)
+ (let ((s 0))
+ (foreach ((a x)
+ (b a))
+ (setq s (+ s b)))
+ s))
+
+;; Test `break'.
+(defmath test6 (x)
+ (let ((a (for ((ii 1 10))
+ (when (= ii x)
+ (break (* ii 2)))))
+ (b (foreach ((e '(9 3 6)))
+ (when (= e x)
+ (break (- e 1))))))
+ (* a b)))
+
+;; Test `return' from `for'.
+(defmath test7 (x)
+ (for ((ii 1 10))
+ (when (= ii x)
+ (return (* ii 2))))
+ 5)
+
+(ert-deftest calc-defmath ()
+ (let ((var-g 17))
+ (should (equal (calcFunc-test1 2) (* 3 5 11 17)))
+ (should (equal (calcFunc-test2 2) (* 2 3 6 12 17))))
+ (should (equal (calcFunc-test3 3)
+ (+ (* 1 1)
+ (* 2 1) (* 2 2)
+ (* 3 1) (* 3 2) (* 3 3))))
+ (should (equal (calcFunc-test4 5)
+ '( 1 2 3 4 5 6 7 8 9 10
+ 1 3 5 7 9
+ 1 4 7 10
+ 1 5 9
+ 1 6)))
+ (should (equal (calcFunc-test5 '((2 3) (5) (7 11 13)))
+ (+ 2 3 5 7 11 13)))
+ (should (equal (calcFunc-test6 3) (* (* 3 2) (- 3 1))))
+ (should (equal (calcFunc-test7 3) (* 3 2))))
+
(provide 'calc-tests)
;;; calc-tests.el ends here
diff --git a/test/lisp/calculator-tests.el b/test/lisp/calculator-tests.el
new file mode 100644
index 00000000000..9551b1a4c61
--- /dev/null
+++ b/test/lisp/calculator-tests.el
@@ -0,0 +1,51 @@
+;;; calculator-tests.el --- Test suite for calculator. -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+(require 'ert)
+(require 'calculator)
+
+(ert-deftest calculator-test-calculator-string-to-number ()
+ (dolist (x '(("" 0.0)
+ ("+" 0.0)
+ ("-" 0.0)
+ ("." 0.0)
+ ("+." 0.0)
+ ("-." -0.0)
+ (".-" 0.0)
+ ("--." 0.0)
+ ("-0.0e" -0.0)
+ ("1e1" 10.0)
+ ("1e+1" 10.0)
+ ("1e-1" 0.1)
+ ("+1e1" 10.0)
+ ("-1e1" -10.0)
+ ("+1e-1" 0.1)
+ ("-1e-1" -0.1)
+ (".1.e1" 0.1)
+ (".1..e1" 0.1)
+ ("1e+1.1" 10.0)
+ ("-2e-1.1" -0.2)))
+ (pcase x
+ (`(,str ,expected)
+ (let ((calculator-input-radix nil))
+ (should (equal (calculator-string-to-number str) expected)))))))
+
+(provide 'calculator-tests)
+;; calculator-tests.el ends here
diff --git a/test/lisp/calendar/cal-french-tests.el b/test/lisp/calendar/cal-french-tests.el
new file mode 100644
index 00000000000..ab62c1e6fc1
--- /dev/null
+++ b/test/lisp/calendar/cal-french-tests.el
@@ -0,0 +1,113 @@
+;;; cal-french-tests.el --- tests for cal-french.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'cal-french)
+
+(defconst cal-french-test-cases
+ '(
+ (1792 9 22 "Primidi 1 Vendémiaire an 1 de la Révolution, jour du Raisin")
+ (1793 10 23 "Duodi 2 Brumaire an 2 de la Révolution, jour du Céleri")
+ (1794 7 27 "Nonidi 9 Thermidor an 2 de la Révolution, jour de la Mûre")
+ (1794 11 23 "Tridi 3 Frimaire an 3 de la Révolution, jour de la Chicorée")
+ (1795 10 5 "Tridi 13 Vendémiaire an 4 de la Révolution, jour du Potiron")
+ (1795 12 25 "Quartidi 4 Nivôse an 4 de la Révolution, jour du Soufre")
+ (1797 1 24 "Quintidi 5 Pluviôse an 5 de la Révolution, jour du Taureau")
+ (1798 2 24 "Sextidi 6 Ventôse an 6 de la Révolution, jour de l'Asaret")
+ (1799 11 9 "Octidi 18 Brumaire an 8 de la Révolution, jour de la Dentelaire")
+ (1801 3 29 "Octidi 8 Germinal an 9 de la Révolution, jour de la Jonquille")
+ (1804 4 30 "Décadi 10 Floréal an 12 de la Révolution, jour du Rateau")
+ (1807 6 1 "Duodi 12 Prairial an 15 de la Révolution, jour de la Bétoine")
+ (1810 7 3 "Quartidi 14 Messidor an 18 de la Révolution, jour de la Lavande")
+ (1813 8 4 "Sextidi 16 Thermidor an 21 de la Révolution, jour de la Guimauve")
+ (1816 9 4 "Octidi 18 Fructidor an 24 de la Révolution, jour du Nerprun")
+ (2000 1 1 "Duodi 12 Nivôse an 208 de la Révolution, jour de l'Argile")
+ (2021 7 11 "Tridi 23 Messidor an 229 de la Révolution, jour du Haricot")
+ (2001 5 11 "Duodi 22 Floréal an 209 de la Révolution, jour de la Fritillaire")
+ (1792 9 22 "Primidi 1 Vendémiaire an 1 de la Révolution, jour du Raisin")
+ (1793 9 21 "Quintidi 5 jour complémentaire an 1 de la Révolution, jour des Récompenses")
+ (1793 9 22 "Primidi 1 Vendémiaire an 2 de la Révolution, jour du Raisin")
+ (1794 9 21 "Quintidi 5 jour complémentaire an 2 de la Révolution, jour des Récompenses")
+ (1794 9 22 "Primidi 1 Vendémiaire an 3 de la Révolution, jour du Raisin")
+ (1795 9 22 "Sextidi 6 jour complémentaire an 3 de la Révolution, jour de la Révolution")
+ (1795 9 23 "Primidi 1 Vendémiaire an 4 de la Révolution, jour du Raisin")
+ (1796 9 21 "Quintidi 5 jour complémentaire an 4 de la Révolution, jour des Récompenses")
+ (1796 9 22 "Primidi 1 Vendémiaire an 5 de la Révolution, jour du Raisin")
+ (1797 9 21 "Quintidi 5 jour complémentaire an 5 de la Révolution, jour des Récompenses")
+ (1797 9 22 "Primidi 1 Vendémiaire an 6 de la Révolution, jour du Raisin")
+ (1799 9 22 "Sextidi 6 jour complémentaire an 7 de la Révolution, jour de la Révolution")
+ (1799 9 23 "Primidi 1 Vendémiaire an 8 de la Révolution, jour du Raisin")
+ (1800 9 22 "Quintidi 5 jour complémentaire an 8 de la Révolution, jour des Récompenses")
+ (1800 9 23 "Primidi 1 Vendémiaire an 9 de la Révolution, jour du Raisin")
+ (1801 9 22 "Quintidi 5 jour complémentaire an 9 de la Révolution, jour des Récompenses")
+ (1801 9 23 "Primidi 1 Vendémiaire an 10 de la Révolution, jour du Raisin")
+ (1823 9 22 "Quintidi 5 jour complémentaire an 31 de la Révolution, jour des Récompenses")
+ (1823 9 23 "Primidi 1 Vendémiaire an 32 de la Révolution, jour du Raisin")
+ (1824 9 22 "Sextidi 6 jour complémentaire an 32 de la Révolution, jour de la Révolution")
+ (1824 9 23 "Primidi 1 Vendémiaire an 33 de la Révolution, jour du Raisin")
+ (1825 9 22 "Quintidi 5 jour complémentaire an 33 de la Révolution, jour des Récompenses")
+ (1825 9 23 "Primidi 1 Vendémiaire an 34 de la Révolution, jour du Raisin")
+ (1892 9 21 "Quintidi 5 jour complémentaire an 100 de la Révolution, jour des Récompenses")
+ (1892 9 22 "Primidi 1 Vendémiaire an 101 de la Révolution, jour du Raisin")
+ (1900 9 22 "Sextidi 6 jour complémentaire an 108 de la Révolution, jour de la Révolution")
+ (1900 9 23 "Primidi 1 Vendémiaire an 109 de la Révolution, jour du Raisin")
+ (1992 9 21 "Quintidi 5 jour complémentaire an 200 de la Révolution, jour des Récompenses")
+ (1992 9 22 "Primidi 1 Vendémiaire an 201 de la Révolution, jour du Raisin")
+ (2000 9 21 "Sextidi 6 jour complémentaire an 208 de la Révolution, jour de la Révolution")
+ (2000 9 22 "Primidi 1 Vendémiaire an 209 de la Révolution, jour du Raisin")
+ (2092 9 20 "Quintidi 5 jour complémentaire an 300 de la Révolution, jour des Récompenses")
+ (2092 9 21 "Primidi 1 Vendémiaire an 301 de la Révolution, jour du Raisin")
+ (2100 9 21 "Sextidi 6 jour complémentaire an 308 de la Révolution, jour de la Révolution")
+ (2100 9 22 "Primidi 1 Vendémiaire an 309 de la Révolution, jour du Raisin")
+ (2192 9 21 "Sextidi 6 jour complémentaire an 400 de la Révolution, jour de la Révolution")
+ (2192 9 22 "Primidi 1 Vendémiaire an 401 de la Révolution, jour du Raisin")
+ (2193 9 21 "Quintidi 5 jour complémentaire an 401 de la Révolution, jour des Récompenses")
+ (2199 9 22 "Primidi 1 Vendémiaire an 408 de la Révolution, jour du Raisin")
+ (2200 9 22 "Sextidi 6 jour complémentaire an 408 de la Révolution, jour de la Révolution")
+ (2791 9 23 "Primidi 1 Vendémiaire an 1000 de la Révolution, jour du Raisin")
+ (2792 9 22 "Primidi 1 Vendémiaire an 1001 de la Révolution, jour du Raisin")
+ (3000 1 1 "Duodi 12 Nivôse an 1208 de la Révolution, jour de l'Argile")
+ (3001 1 1 "Primidi 11 Nivôse an 1209 de la Révolution, jour du Granit")
+ (3791 9 22 "Primidi 1 Vendémiaire an 2000 de la Révolution, jour du Raisin")
+ (3792 9 22 "Primidi 1 Vendémiaire an 2001 de la Révolution, jour du Raisin")
+ (4000 1 1 "Duodi 12 Nivôse an 2208 de la Révolution, jour de l'Argile")
+ (4001 1 1 "Duodi 12 Nivôse an 2209 de la Révolution, jour de l'Argile")
+ (4320 9 10 "Quartidi 24 Fructidor an 2528 de la Révolution, jour du Sorgho")
+ (4320 9 11 "Quintidi 25 Fructidor an 2528 de la Révolution, jour de l'Écrevisse")
+ (4791 9 23 "Primidi 1 Vendémiaire an 3000 de la Révolution, jour du Raisin")
+ (4792 9 22 "Primidi 1 Vendémiaire an 3001 de la Révolution, jour du Raisin")
+ (5000 1 1 "Duodi 12 Nivôse an 3208 de la Révolution, jour de l'Argile")
+ (5001 1 1 "Primidi 11 Nivôse an 3209 de la Révolution, jour du Granit")
+ (5791 9 22 "Primidi 1 Vendémiaire an 4000 de la Révolution, jour du Raisin")
+ (5792 9 21 "Primidi 1 Vendémiaire an 4001 de la Révolution, jour du Raisin")
+ (6000 1 1 "Tridi 13 Nivôse an 4208 de la Révolution, jour de l'Ardoise")
+ (6001 1 1 "Tridi 13 Nivôse an 4209 de la Révolution, jour de l'Ardoise")
+ (6791 9 22 "Primidi 1 Vendémiaire an 5000 de la Révolution, jour du Raisin")
+ (6792 9 21 "Primidi 1 Vendémiaire an 5001 de la Révolution, jour du Raisin")
+ (7791 9 21 "Primidi 1 Vendémiaire an 6000 de la Révolution, jour du Raisin")
+ (7792 9 21 "Primidi 1 Vendémiaire an 6001 de la Révolution, jour du Raisin")
+ ))
+
+(ert-deftest cal-french-tests ()
+ (pcase-dolist (`(,y ,m ,d ,str) cal-french-test-cases)
+ (should (equal (calendar-french-date-string (list m d y)) str))))
+
+(provide 'cal-french-tests)
diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american
index 7b86b554dd4..2f7026a0bde 100644
--- a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american
+++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-american
@@ -1 +1 @@
-&%%(and (diary-anniversary 8 15 2004)) Maria Himmelfahrt
+&%%(diary-anniversary 8 15 2003) Maria Himmelfahrt
diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european
index 3b82ec09fd5..fa652dbb92e 100644
--- a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european
+++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-european
@@ -1 +1 @@
-&%%(and (diary-anniversary 15 8 2004)) Maria Himmelfahrt
+&%%(diary-anniversary 15 8 2003) Maria Himmelfahrt
diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso
index 7fc99478d4e..803dd36de0a 100644
--- a/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso
+++ b/test/lisp/calendar/icalendar-resources/import-rrule-anniversary.diary-iso
@@ -1 +1 @@
-&%%(and (diary-anniversary 2004 8 15)) Maria Himmelfahrt
+&%%(diary-anniversary 2003 8 15) Maria Himmelfahrt
diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american
index a54780b9699..bc485d8a6c4 100644
--- a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american
+++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-american
@@ -1 +1 @@
-&%%(and (diary-anniversary 9 19 2003)) 09:00-11:30 rrule yearly
+&%%(diary-anniversary 9 19 2002) 09:00-11:30 rrule yearly
diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european
index a4bd81d6f2b..42509d42bc8 100644
--- a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european
+++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-european
@@ -1 +1 @@
-&%%(and (diary-anniversary 19 9 2003)) 09:00-11:30 rrule yearly
+&%%(diary-anniversary 19 9 2002) 09:00-11:30 rrule yearly
diff --git a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso
index 65a7abe0344..72fe6e12cbd 100644
--- a/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso
+++ b/test/lisp/calendar/icalendar-resources/import-rrule-yearly.diary-iso
@@ -1 +1 @@
-&%%(and (diary-anniversary 2003 9 19)) 09:00-11:30 rrule yearly
+&%%(diary-anniversary 2002 9 19) 09:00-11:30 rrule yearly
diff --git a/test/lisp/calendar/icalendar-tests.el b/test/lisp/calendar/icalendar-tests.el
index 7993a1fd806..6973f7e5c95 100644
--- a/test/lisp/calendar/icalendar-tests.el
+++ b/test/lisp/calendar/icalendar-tests.el
@@ -1,4 +1,4 @@
-;; icalendar-tests.el --- Test suite for icalendar.el -*- lexical-binding:t -*-
+;;; icalendar-tests.el --- Test suite for icalendar.el -*- lexical-binding:t -*-
;; Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
@@ -87,7 +87,7 @@
(let* ((calendar-date-style 'iso)
result)
(setq result (icalendar--convert-anniversary-to-ical
- "" "%%(diary-anniversary 1964 6 30) g"))
+ "" "%%(diary-anniversary 1963 6 30) g"))
(should (consp result))
(should (string= (concat
"\nDTSTART;VALUE=DATE:19640630"
@@ -353,7 +353,7 @@ END:VTIMEZONE
(let ((calendar-date-style 'iso))
;; numeric iso
(should (string= "20080511"
- (icalendar--datestring-to-isodate "2008 05 11")))
+ (icalendar--datestring-to-isodate "2008 05 11")))
(should (string= "20080531"
(icalendar--datestring-to-isodate "2008 05 31")))
(should (string= "20080602"
@@ -384,7 +384,19 @@ END:VTIMEZONE
(should (string= "20081105"
(icalendar--datestring-to-isodate "05 Nov 2008")))
(should (string= "20081105"
- (icalendar--datestring-to-isodate "2008 Nov 05")))))
+ (icalendar--datestring-to-isodate "2008 Nov 05")))
+
+ ;; non-numeric with day-shift and year-shift
+ (setq calendar-date-style nil) ;not necessary for conversion
+ (should (string= "20210212"
+ (icalendar--datestring-to-isodate "2021 Feb 11" 1)))
+ (should (string= "20210131"
+ (icalendar--datestring-to-isodate "2021 Feb 11" -11)))
+ (should (string= "20200211"
+ (icalendar--datestring-to-isodate "2021 Feb 11" nil -1)))
+ (should (string= "21010211"
+ (icalendar--datestring-to-isodate "2021 Feb 11" nil 80)))
+ ))
(ert-deftest icalendar--first-weekday-of-year ()
"Test method for `icalendar-first-weekday-of-year'."
@@ -569,10 +581,10 @@ END:VEVENT
;; testcase: dtstart is mandatory
(should (null (icalendar--convert-tz-offset
- '((TZOFFSETFROM nil "+0100")
- (TZOFFSETTO nil "+0200")
- (RRULE nil "FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU"))
- t)))
+ '((TZOFFSETFROM nil "+0100")
+ (TZOFFSETTO nil "+0200")
+ (RRULE nil "FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU"))
+ t)))
;; FIXME: rrule and rdate are NOT mandatory! Must fix code
;; before activating these testcases
@@ -830,18 +842,18 @@ SUMMARY:yearly no time
"Perform export test."
;; anniversaries
(icalendar-tests--test-export
- "%%(diary-anniversary 1989 10 3) anniversary no time"
- "%%(diary-anniversary 3 10 1989) anniversary no time"
- "%%(diary-anniversary 10 3 1989) anniversary no time"
+ "%%(diary-anniversary 1988 10 3) anniversary no time"
+ "%%(diary-anniversary 3 10 1988) anniversary no time"
+ "%%(diary-anniversary 10 3 1988) anniversary no time"
"DTSTART;VALUE=DATE:19891003
DTEND;VALUE=DATE:19891004
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
SUMMARY:anniversary no time
")
(icalendar-tests--test-export
- "%%(diary-anniversary 1989 10 3) 19:00-20:00 anniversary with time"
- "%%(diary-anniversary 3 10 1989) 19:00-20:00 anniversary with time"
- "%%(diary-anniversary 10 3 1989) 19:00-20:00 anniversary with time"
+ "%%(diary-anniversary 1988 10 3) 19:00-20:00 anniversary with time"
+ "%%(diary-anniversary 3 10 1988) 19:00-20:00 anniversary with time"
+ "%%(diary-anniversary 10 3 1988) 19:00-20:00 anniversary with time"
"DTSTART;VALUE=DATE-TIME:19891003T190000
DTEND;VALUE=DATE-TIME:19891004T200000
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=10;BYMONTHDAY=03
@@ -891,12 +903,12 @@ SUMMARY:no alarm
"
nil)
- ;; 10 minutes in advance, audio
- (icalendar-tests--test-export
- "2014 Nov 17 19:30 audio alarm"
- "17 Nov 2014 19:30 audio alarm"
- "Nov 17 2014 19:30 audio alarm"
- "DTSTART;VALUE=DATE-TIME:20141117T193000
+ ;; 10 minutes in advance, audio
+ (icalendar-tests--test-export
+ "2014 Nov 17 19:30 audio alarm"
+ "17 Nov 2014 19:30 audio alarm"
+ "Nov 17 2014 19:30 audio alarm"
+ "DTSTART;VALUE=DATE-TIME:20141117T193000
DTEND;VALUE=DATE-TIME:20141117T203000
SUMMARY:audio alarm
BEGIN:VALARM
@@ -904,14 +916,14 @@ ACTION:AUDIO
TRIGGER:-PT10M
END:VALARM
"
- '(10 ((audio))))
+ '(10 ((audio))))
- ;; 20 minutes in advance, display
- (icalendar-tests--test-export
- "2014 Nov 17 19:30 display alarm"
- "17 Nov 2014 19:30 display alarm"
- "Nov 17 2014 19:30 display alarm"
- "DTSTART;VALUE=DATE-TIME:20141117T193000
+ ;; 20 minutes in advance, display
+ (icalendar-tests--test-export
+ "2014 Nov 17 19:30 display alarm"
+ "17 Nov 2014 19:30 display alarm"
+ "Nov 17 2014 19:30 display alarm"
+ "DTSTART;VALUE=DATE-TIME:20141117T193000
DTEND;VALUE=DATE-TIME:20141117T203000
SUMMARY:display alarm
BEGIN:VALARM
@@ -920,14 +932,14 @@ TRIGGER:-PT20M
DESCRIPTION:display alarm
END:VALARM
"
- '(20 ((display))))
+ '(20 ((display))))
- ;; 66 minutes in advance, email
- (icalendar-tests--test-export
- "2014 Nov 17 19:30 email alarm"
- "17 Nov 2014 19:30 email alarm"
- "Nov 17 2014 19:30 email alarm"
- "DTSTART;VALUE=DATE-TIME:20141117T193000
+ ;; 66 minutes in advance, email
+ (icalendar-tests--test-export
+ "2014 Nov 17 19:30 email alarm"
+ "17 Nov 2014 19:30 email alarm"
+ "Nov 17 2014 19:30 email alarm"
+ "DTSTART;VALUE=DATE-TIME:20141117T193000
DTEND;VALUE=DATE-TIME:20141117T203000
SUMMARY:email alarm
BEGIN:VALARM
@@ -939,14 +951,14 @@ ATTENDEE:MAILTO:att.one@email.com
ATTENDEE:MAILTO:att.two@email.com
END:VALARM
"
- '(66 ((email ("att.one@email.com" "att.two@email.com")))))
+ '(66 ((email ("att.one@email.com" "att.two@email.com")))))
- ;; 2 minutes in advance, all alarms
- (icalendar-tests--test-export
- "2014 Nov 17 19:30 all alarms"
- "17 Nov 2014 19:30 all alarms"
- "Nov 17 2014 19:30 all alarms"
- "DTSTART;VALUE=DATE-TIME:20141117T193000
+ ;; 2 minutes in advance, all alarms
+ (icalendar-tests--test-export
+ "2014 Nov 17 19:30 all alarms"
+ "17 Nov 2014 19:30 all alarms"
+ "Nov 17 2014 19:30 all alarms"
+ "DTSTART;VALUE=DATE-TIME:20141117T193000
DTEND;VALUE=DATE-TIME:20141117T203000
SUMMARY:all alarms
BEGIN:VALARM
@@ -967,7 +979,7 @@ TRIGGER:-PT2M
DESCRIPTION:all alarms
END:VALARM
"
- '(2 ((email ("att.one@email.com" "att.two@email.com")) (audio) (display)))))
+ '(2 ((email ("att.one@email.com" "att.two@email.com")) (audio) (display)))))
;; ======================================================================
;; Import tests
@@ -1247,7 +1259,7 @@ Argument INPUT icalendar event string."
(find-file temp-ics)
(goto-char (point-min))
;;(when (re-search-forward "\nUID:.*\n" nil t)
- ;;(replace-match "\n"))
+ ;;(replace-match "\n"))
(let ((cycled (buffer-substring-no-properties (point-min) (point-max))))
(should (string= org-input cycled)))))
;; clean up
@@ -1276,8 +1288,8 @@ DESCRIPTION:beschreibung!
LOCATION:nowhere
ORGANIZER:ulf
")
- (icalendar-tests--test-cycle
- "UID:4711
+ (icalendar-tests--test-cycle
+ "UID:4711
DTSTART;VALUE=DATE:19190909
DTEND;VALUE=DATE:19190910
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=09
@@ -1377,7 +1389,7 @@ SUMMARY:ff")
"
>>> anniversaries:
-%%(diary-anniversary 3 28 1991) aa birthday (%d years old)"
+%%(diary-anniversary 3 28 1990) aa birthday (%d years old)"
"DTSTART;VALUE=DATE:19910328
DTEND;VALUE=DATE:19910329
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=03;BYMONTHDAY=28
@@ -1387,7 +1399,7 @@ SUMMARY:aa birthday (%d years old)
(icalendar-tests--test-export
nil
nil
- "%%(diary-anniversary 5 17 1957) bb birthday (%d years old)"
+ "%%(diary-anniversary 5 17 1956) bb birthday (%d years old)"
"DTSTART;VALUE=DATE:19570517
DTEND;VALUE=DATE:19570518
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=05;BYMONTHDAY=17
@@ -1396,7 +1408,7 @@ SUMMARY:bb birthday (%d years old)")
(icalendar-tests--test-export
nil
nil
- "%%(diary-anniversary 6 8 1997) cc birthday (%d years old)"
+ "%%(diary-anniversary 6 8 1996) cc birthday (%d years old)"
"DTSTART;VALUE=DATE:19970608
DTEND;VALUE=DATE:19970609
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=06;BYMONTHDAY=08
@@ -1405,7 +1417,7 @@ SUMMARY:cc birthday (%d years old)")
(icalendar-tests--test-export
nil
nil
- "%%(diary-anniversary 7 22 1983) dd (%d years ago...!)"
+ "%%(diary-anniversary 7 22 1982) dd (%d years ago...!)"
"DTSTART;VALUE=DATE:19830722
DTEND;VALUE=DATE:19830723
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=07;BYMONTHDAY=22
@@ -1414,7 +1426,7 @@ SUMMARY:dd (%d years ago...!)")
(icalendar-tests--test-export
nil
nil
- "%%(diary-anniversary 8 1 1988) ee birthday (%d years old)"
+ "%%(diary-anniversary 8 1 1987) ee birthday (%d years old)"
"DTSTART;VALUE=DATE:19880801
DTEND;VALUE=DATE:19880802
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=08;BYMONTHDAY=01
@@ -1423,7 +1435,7 @@ SUMMARY:ee birthday (%d years old)")
(icalendar-tests--test-export
nil
nil
- "%%(diary-anniversary 9 21 1957) ff birthday (%d years old)"
+ "%%(diary-anniversary 9 21 1956) ff birthday (%d years old)"
"DTSTART;VALUE=DATE:19570921
DTEND;VALUE=DATE:19570922
RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=09;BYMONTHDAY=21
diff --git a/test/lisp/calendar/iso8601-tests.el b/test/lisp/calendar/iso8601-tests.el
index 618e5b12386..c4d038ab68c 100644
--- a/test/lisp/calendar/iso8601-tests.el
+++ b/test/lisp/calendar/iso8601-tests.el
@@ -183,7 +183,15 @@
(should (equal (iso8601-parse-time "15:27:35.123" t)
'((35123 . 1000) 27 15 nil nil nil nil -1 nil)))
(should (equal (iso8601-parse-time "15:27:35.123456789" t)
- '((35123456789 . 1000000000) 27 15 nil nil nil nil -1 nil))))
+ '((35123456789 . 1000000000) 27 15 nil nil nil nil -1 nil)))
+ (should (equal (iso8601-parse-time "15:27:35.012345678" t)
+ '((35012345678 . 1000000000) 27 15 nil nil nil nil -1 nil)))
+ (should (equal (iso8601-parse-time "15:27:35.00001" t)
+ '((3500001 . 100000) 27 15 nil nil nil nil -1 nil)))
+ (should (equal (iso8601-parse-time "15:27:35.0000100" t)
+ '((3500001 . 100000) 27 15 nil nil nil nil -1 nil)))
+ (should (equal (iso8601-parse-time "15:27:35.0" t)
+ '(35 27 15 nil nil nil nil -1 nil))))
(ert-deftest standard-test-time-of-day-beginning-of-day ()
(should (equal (iso8601-parse-time "000000")
diff --git a/test/lisp/calendar/parse-time-tests.el b/test/lisp/calendar/parse-time-tests.el
index b90fe0bd85b..b706b73570d 100644
--- a/test/lisp/calendar/parse-time-tests.el
+++ b/test/lisp/calendar/parse-time-tests.el
@@ -1,4 +1,4 @@
-;; parse-time-tests.el --- Test suite for parse-time.el -*- lexical-binding:t -*-
+;;; parse-time-tests.el --- Test suite for parse-time.el -*- lexical-binding:t -*-
;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/cedet/cedet-files-tests.el b/test/lisp/cedet/cedet-files-tests.el
new file mode 100644
index 00000000000..5502d424314
--- /dev/null
+++ b/test/lisp/cedet/cedet-files-tests.el
@@ -0,0 +1,54 @@
+;;; cedet-files-tests.el --- Tests for cedet-files.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Moved here from test/manual/cedet/cedet-utests.el
+
+;;; Code:
+
+(require 'ert)
+(require 'cedet-files)
+
+(defvar cedet-files-utest-list
+ '(
+ ( "/home/me/src/myproj/src/foo.c" . "!home!me!src!myproj!src!foo.c" )
+ ( "c:/work/myproj/foo.el" . "!drive_c!work!myproj!foo.el" )
+ ( "//windows/proj/foo.java" . "!!windows!proj!foo.java" )
+ ( "/home/me/proj!bang/foo.c" . "!home!me!proj!!bang!foo.c" )
+ )
+ "List of different file names to test.
+Each entry is a cons cell of ( FNAME . CONVERTED )
+where FNAME is some file name, and CONVERTED is what it should be
+converted into.")
+
+(ert-deftest cedet-files-utest ()
+ "Test out some file name conversions."
+ (interactive)
+ (dolist (FT cedet-files-utest-list)
+ (let ((dir->file (cedet-directory-name-to-file-name (car FT) t))
+ (file->dir (cedet-file-name-to-directory-name (cdr FT) t)))
+ (should (string= (cdr FT) dir->file))
+ (should (string= file->dir (car FT))))))
+
+(provide 'cedet-files-tests)
+
+;;; cedet-files-tests.el ends here
diff --git a/test/lisp/cedet/semantic-utest-c.el b/test/lisp/cedet/semantic-utest-c.el
index a7cbe116c2e..d08c79cad3e 100644
--- a/test/lisp/cedet/semantic-utest-c.el
+++ b/test/lisp/cedet/semantic-utest-c.el
@@ -43,7 +43,6 @@
(defvar semantic-lex-c-nested-namespace-ignore-second)
;;; Code:
-;;;###autoload
(ert-deftest semantic-test-c-preprocessor-simulation ()
"Run parsing test for C from the test directory."
:tags '(:expensive-test)
diff --git a/test/lisp/cedet/semantic-utest-fmt.el b/test/lisp/cedet/semantic-utest-fmt.el
deleted file mode 100644
index d6e5ce7a0fd..00000000000
--- a/test/lisp/cedet/semantic-utest-fmt.el
+++ /dev/null
@@ -1,127 +0,0 @@
-;;; cedet/semantic-utest-fmt.el --- Parsing / Formatting tests -*- lexical-binding:t -*-
-
-;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
-
-;; Author: Eric M. Ludlam <zappo@gnu.org>
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-;;
-;; Unit tests for the formatting feature.
-;;
-;; Using test code from the tests source directory, parse the source
-;; file. After parsing, read the comments for each signature, and
-;; make sure that the semantic-tag-format-* functions in question
-;; created the desired output.
-
-(require 'semantic)
-(require 'semantic/format)
-
-;;; Code:
-
-(defvar cedet-utest-directory
- (let* ((C (file-name-directory (locate-library "cedet")))
- (D (expand-file-name "../../test/manual/cedet/" C)))
- D)
- "Location of test files for this test suite.")
-
-(defvar semantic-fmt-utest-file-list
- '("tests/test-fmt.cpp"
- ;; "tests/test-fmt.el" - add this when elisp is support by dflt in Emacs
- )
- "List of files to run unit tests in.")
-
-(defvar semantic-fmt-utest-error-log-list nil
- "Log errors during testing in this variable.")
-
-(ert-deftest semantic-fmt-utest ()
- "Visit all file entries, and run formatting test.
-Files to visit are in `semantic-fmt-utest-file-list'."
- (save-current-buffer
- (semantic-mode 1)
- (let ((fl semantic-fmt-utest-file-list)
- (fname nil)
- )
-
- (dolist (FILE fl)
-
- (save-current-buffer
- (setq fname (expand-file-name FILE cedet-utest-directory))
-
- ;; Make sure we have the files we think we have.
- (should (file-exists-p fname))
- ;; (error "Cannot find unit test file: %s" fname))
-
- ;; Run the tests.
- (let ((fb (find-buffer-visiting fname))
- (b (semantic-find-file-noselect fname))
- (tags nil))
-
- (save-current-buffer
- (set-buffer b)
- (should (semantic-active-p))
- ;;(error "Cannot open %s for format tests" fname))
-
- ;; This will force a reparse, removing any chance of semanticdb cache
- ;; using stale data.
- (semantic-clear-toplevel-cache)
- ;; Force the reparse
- (setq tags (semantic-fetch-tags))
-
- (save-excursion
- (while tags
- (let* ((T (car tags))
- (start (semantic-tag-end T))
- (end (if (cdr tags)
- (semantic-tag-start (car (cdr tags)))
- (point-max)))
- (TESTS nil)
- )
- (goto-char start)
- ;; Scan the space between tags for all test condition matches.
- (while (re-search-forward "## \\([a-z-]+\\) \"\\([^\n\"]+\\)\"$" end t)
- (push (cons (match-string 1) (match-string 2)) TESTS))
- (setq TESTS (nreverse TESTS))
-
- (dolist (TST TESTS)
- (let* ( ;; For each test, convert CAR into a semantic-format-tag* fcn
- (sym (intern (concat "semantic-format-tag-" (car TST))))
- ;; Convert the desired result from a string syntax to a string.
- (desired (cdr TST))
- ;; What does the fmt function do?
- (actual (funcall sym T))
- )
- (when (not (string= desired actual))
- (should-not (list "Desired" desired
- "Actual" actual
- "Formatter" (car TST))))
- )))
- (setq tags (cdr tags)))
-
- ))
-
- ;; If it wasn't already in memory, whack it.
- (when (and b (not fb))
- (kill-buffer b)))
- ))
-
- )))
-
-
-(provide 'cedet/semantic/fmt-utest)
-
-;;; semantic-fmt-utest.el ends here
diff --git a/test/manual/cedet/tests/test.mk b/test/lisp/cedet/semantic-utest-ia-resources/test.mk
index edea97e7b98..edea97e7b98 100644
--- a/test/manual/cedet/tests/test.mk
+++ b/test/lisp/cedet/semantic-utest-ia-resources/test.mk
diff --git a/test/manual/cedet/tests/test.srt b/test/lisp/cedet/semantic-utest-ia-resources/test.srt
index 38e6f9ed7b7..38e6f9ed7b7 100644
--- a/test/manual/cedet/tests/test.srt
+++ b/test/lisp/cedet/semantic-utest-ia-resources/test.srt
diff --git a/test/manual/cedet/tests/test.texi b/test/lisp/cedet/semantic-utest-ia-resources/test.texi
index 37d303c8b48..37d303c8b48 100644
--- a/test/manual/cedet/tests/test.texi
+++ b/test/lisp/cedet/semantic-utest-ia-resources/test.texi
diff --git a/test/manual/cedet/tests/testdoublens.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testdoublens.cpp
index ea3afc72a69..ea3afc72a69 100644
--- a/test/manual/cedet/tests/testdoublens.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testdoublens.cpp
diff --git a/test/manual/cedet/tests/testdoublens.hpp b/test/lisp/cedet/semantic-utest-ia-resources/testdoublens.hpp
index e8c9b345b28..e8c9b345b28 100644
--- a/test/manual/cedet/tests/testdoublens.hpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testdoublens.hpp
diff --git a/test/manual/cedet/tests/testfriends.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testfriends.cpp
index 20425f93afa..f84ed5a2190 100644
--- a/test/manual/cedet/tests/testfriends.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testfriends.cpp
@@ -35,4 +35,3 @@ int B::testB() {
int B::testAB() { // %1% ( ( "testfriends.cpp" ) ( "B" "B::testAB" ) )
}
-
diff --git a/test/manual/cedet/tests/testjavacomp.java b/test/lisp/cedet/semantic-utest-ia-resources/testjavacomp.java
index bfc016903c8..bfc016903c8 100644
--- a/test/manual/cedet/tests/testjavacomp.java
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testjavacomp.java
diff --git a/test/manual/cedet/tests/testlocalvars.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testlocalvars.cpp
index 9d2329a0fa8..9d2329a0fa8 100644
--- a/test/manual/cedet/tests/testlocalvars.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testlocalvars.cpp
diff --git a/test/manual/cedet/tests/testnsp.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testnsp.cpp
index db1603cead2..db1603cead2 100644
--- a/test/manual/cedet/tests/testnsp.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testnsp.cpp
diff --git a/test/manual/cedet/tests/testsppcomplete.c b/test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c
index 084d6a8687d..084d6a8687d 100644
--- a/test/manual/cedet/tests/testsppcomplete.c
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c
diff --git a/test/manual/cedet/tests/teststruct.cpp b/test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp
index 6659b5557b8..6659b5557b8 100644
--- a/test/manual/cedet/tests/teststruct.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/teststruct.cpp
diff --git a/test/manual/cedet/tests/testsubclass.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testsubclass.cpp
index 409950cce2f..409950cce2f 100644
--- a/test/manual/cedet/tests/testsubclass.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testsubclass.cpp
diff --git a/test/manual/cedet/tests/testsubclass.hh b/test/lisp/cedet/semantic-utest-ia-resources/testsubclass.hh
index 5d795b32b10..5d795b32b10 100644
--- a/test/manual/cedet/tests/testsubclass.hh
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testsubclass.hh
diff --git a/test/manual/cedet/tests/testtemplates.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testtemplates.cpp
index ed7a057df0b..ed7a057df0b 100644
--- a/test/manual/cedet/tests/testtemplates.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testtemplates.cpp
diff --git a/test/manual/cedet/tests/testtypedefs.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testtypedefs.cpp
index c82535f9581..c82535f9581 100644
--- a/test/manual/cedet/tests/testtypedefs.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testtypedefs.cpp
diff --git a/test/manual/cedet/tests/testusing.cpp b/test/lisp/cedet/semantic-utest-ia-resources/testusing.cpp
index 6f6c8542633..6f6c8542633 100644
--- a/test/manual/cedet/tests/testusing.cpp
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testusing.cpp
diff --git a/test/manual/cedet/tests/testusing.hh b/test/lisp/cedet/semantic-utest-ia-resources/testusing.hh
index d3b690f8542..d3b690f8542 100644
--- a/test/manual/cedet/tests/testusing.hh
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testusing.hh
diff --git a/test/manual/cedet/tests/testvarnames.c b/test/lisp/cedet/semantic-utest-ia-resources/testvarnames.c
index e796eb285c6..e796eb285c6 100644
--- a/test/manual/cedet/tests/testvarnames.c
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testvarnames.c
diff --git a/test/manual/cedet/tests/testvarnames.java b/test/lisp/cedet/semantic-utest-ia-resources/testvarnames.java
index 7ed9785fc07..7ed9785fc07 100644
--- a/test/manual/cedet/tests/testvarnames.java
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testvarnames.java
diff --git a/test/manual/cedet/tests/testwisent.wy b/test/lisp/cedet/semantic-utest-ia-resources/testwisent.wy
index 49eb5780f4b..49eb5780f4b 100644
--- a/test/manual/cedet/tests/testwisent.wy
+++ b/test/lisp/cedet/semantic-utest-ia-resources/testwisent.wy
diff --git a/test/lisp/cedet/semantic-utest-ia.el b/test/lisp/cedet/semantic-utest-ia.el
index 7210f66b0a7..122c431d472 100644
--- a/test/lisp/cedet/semantic-utest-ia.el
+++ b/test/lisp/cedet/semantic-utest-ia.el
@@ -30,121 +30,94 @@
;; (Replace // with contents of comment-start for the language being tested.)
;;; Code:
+(require 'ert)
+(require 'ert-x)
(require 'semantic)
(require 'semantic/analyze)
(require 'semantic/analyze/refs)
(require 'semantic/symref)
(require 'semantic/symref/filter)
-(defvar cedet-utest-directory
- (let* ((C (file-name-directory (locate-library "cedet")))
- (D (expand-file-name "../../test/manual/cedet/" C)))
- D)
- "Location of test files for this test suite.")
-
-(defvar semantic-utest-test-directory (expand-file-name "tests" cedet-utest-directory)
- "Location of test files.")
-
(ert-deftest semantic-utest-ia-doublens.cpp ()
- (let ((tst (expand-file-name "testdoublens.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testdoublens.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-subclass.cpp ()
- (let ((tst (expand-file-name "testsubclass.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testsubclass.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-typedefs.cpp ()
- (let ((tst (expand-file-name "testtypedefs.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testtypedefs.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-struct.cpp ()
- (let ((tst (expand-file-name "teststruct.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "teststruct.cpp")))
(should-not (semantic-ia-utest tst))))
;;(ert-deftest semantic-utest-ia-union.cpp ()
-;; (let ((tst (expand-file-name "testunion.cpp" semantic-utest-test-directory)))
-;; (should (file-exists-p tst))
+;; (let ((tst (ert-resource-file "testunion.cpp")))
;; (should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-templates.cpp ()
- (let ((tst (expand-file-name "testtemplates.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testtemplates.cpp")))
(should-not (semantic-ia-utest tst))))
;;(ert-deftest semantic-utest-ia-friends.cpp ()
-;; (let ((tst (expand-file-name "testfriends.cpp" semantic-utest-test-directory)))
-;; (should (file-exists-p tst))
+;; (let ((tst (ert-resource-file "testfriends.cpp")))
;; (should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-using.cpp ()
- (let ((tst (expand-file-name "testusing.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testusing.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-nsp.cpp ()
(skip-unless (executable-find "g++"))
- (let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testnsp.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-localvars.cpp ()
- (let ((tst (expand-file-name "testlocalvars.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testlocalvars.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-namespace.cpp ()
(skip-unless (executable-find "g++"))
- (let ((tst (expand-file-name "testnsp.cpp" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testnsp.cpp")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-sppcomplete.c ()
- (let ((tst (expand-file-name "testsppcomplete.c" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testsppcomplete.c")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-varnames.c ()
- (let ((tst (expand-file-name "testvarnames.c" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testvarnames.c")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-javacomp.java ()
- (let ((tst (expand-file-name "testjavacomp.java" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testjavacomp.java")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-varnames.java ()
- (let ((tst (expand-file-name "testvarnames.java" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testvarnames.java")))
(should-not (semantic-ia-utest tst))))
;;(ert-deftest semantic-utest-ia-f90.f90 ()
-;; (let ((tst (expand-file-name "testf90.f90" semantic-utest-test-directory)))
-;; (should (file-exists-p tst))
+;; (let ((tst (ert-resource-file "testf90.f90")))
;; (should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-wisent.wy ()
- (let ((tst (expand-file-name "testwisent.wy" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "testwisent.wy")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-texi ()
- (let ((tst (expand-file-name "test.texi" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "test.texi")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-make ()
- (let ((tst (expand-file-name "test.mk" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "test.mk")))
(should-not (semantic-ia-utest tst))))
(ert-deftest semantic-utest-ia-srecoder ()
- (let ((tst (expand-file-name "test.srt" semantic-utest-test-directory)))
- (should (file-exists-p tst))
+ (let ((tst (ert-resource-file "test.srt")))
(should-not (semantic-ia-utest tst))))
;;; Core testing utility
diff --git a/test/lisp/cedet/semantic-utest.el b/test/lisp/cedet/semantic-utest.el
index 67de4a5b02d..172ab62f895 100644
--- a/test/lisp/cedet/semantic-utest.el
+++ b/test/lisp/cedet/semantic-utest.el
@@ -1,6 +1,6 @@
;;; semantic-utest.el --- Tests for semantic's parsing system. -*- lexical-binding:t -*-
-;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/test/lisp/cedet/semantic/bovine/gcc-tests.el b/test/lisp/cedet/semantic/bovine/gcc-tests.el
new file mode 100644
index 00000000000..93677d6c871
--- /dev/null
+++ b/test/lisp/cedet/semantic/bovine/gcc-tests.el
@@ -0,0 +1,129 @@
+;;; gcc-tests.el --- Tests for semantic/bovine/gcc.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Moved here from test/manual/cedet/semantic-tests.el
+
+;;; Code:
+
+(require 'ert)
+(require 'semantic/bovine/gcc)
+
+;;; From bovine-gcc:
+
+;; Example output of "gcc -v"
+(defvar semantic-gcc-test-strings
+ '(;; My old box:
+ "Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
+Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
+Thread model: posix
+gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"
+ ;; Alex Ott:
+ "Using built-in specs.
+Target: i486-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.1-9ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
+Thread model: posix
+gcc version 4.3.1 (Ubuntu 4.3.1-9ubuntu1)"
+ ;; My debian box:
+ "Using built-in specs.
+Target: x86_64-unknown-linux-gnu
+Configured with: ../../../sources/gcc/configure --prefix=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3 --with-gmp=/usr/local/gcc/gmp --with-mpfr=/usr/local/gcc/mpfr --enable-languages=c,c++,fortran --with-as=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3/bin/as --with-ld=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3/bin/ld --disable-multilib
+Thread model: posix
+gcc version 4.2.3"
+ ;; My mac:
+ "Using built-in specs.
+Target: i686-apple-darwin8
+Configured with: /private/var/tmp/gcc/gcc-5341.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=pentium-m --with-tune=prescott --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
+Thread model: posix
+gcc version 4.0.1 (Apple Computer, Inc. build 5341)"
+ ;; Ubuntu Intrepid
+ "Using built-in specs.
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)"
+ ;; Red Hat EL4
+ "Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
+Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
+Thread model: posix
+gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)"
+ ;; Red Hat EL5
+ "Using built-in specs.
+Target: x86_64-redhat-linux
+Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
+Thread model: posix
+gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)"
+ ;; David Engster's german gcc on ubuntu 4.3
+ "Es werden eingebaute Spezifikationen verwendet.
+Ziel: i486-linux-gnu
+Konfiguriert mit: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
+Thread-Modell: posix
+gcc-Version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)"
+ ;; Damien Deville bsd
+ "Using built-in specs.
+Target: i386-undermydesk-freebsd
+Configured with: FreeBSD/i386 system compiler
+Thread model: posix
+gcc version 4.2.1 20070719 [FreeBSD]"
+ )
+ "A bunch of sample gcc -v outputs from different machines.")
+
+(defvar semantic-gcc-test-strings-fail
+ '(;; A really old solaris box I found
+ "Reading specs from /usr/local/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
+gcc version 2.95.2 19991024 (release)"
+ )
+ "A bunch of sample gcc -v outputs that fail to provide the info we want.")
+
+(defun semantic-gcc-test-output-parser ()
+ "Test the output parser against some collected strings."
+ (dolist (S semantic-gcc-test-strings)
+ (let* ((fields (semantic-gcc-fields S))
+ (v (cdr (assoc 'version fields)))
+ (h (or (cdr (assoc 'target fields))
+ (cdr (assoc '--target fields))
+ (cdr (assoc '--host fields))))
+ (p (cdr (assoc '--prefix fields))))
+ ;; No longer test for prefixes.
+ (when (not (and v h))
+ (let ((strs (split-string S "\n")))
+ (error "Test failed on %S\nV H P:\n%S %S %S" (car strs) v h p)))))
+ (dolist (S semantic-gcc-test-strings-fail)
+ (let* ((fields (semantic-gcc-fields S))
+ (v (cdr (assoc 'version fields)))
+ (h (or (cdr (assoc '--host fields))
+ (cdr (assoc 'target fields))))
+ (p (cdr (assoc '--prefix fields)))
+ )
+ (when (and v h p)
+ (error "Negative test failed on %S" S)))))
+
+(ert-deftest semantic-gcc-test-output-parser ()
+ (semantic-gcc-test-output-parser))
+
+(ert-deftest semantic-gcc-test-output-parser-this-machine ()
+ "Test the output parser against the machine currently running Emacs."
+ (skip-unless (executable-find "gcc"))
+ (let ((semantic-gcc-test-strings (list (semantic-gcc-query "gcc" "-v"))))
+ (semantic-gcc-test-output-parser)))
+
+;;; gcc-tests.el ends here
diff --git a/test/manual/cedet/tests/test-fmt.cpp b/test/lisp/cedet/semantic/format-resources/test-fmt.cpp
index ab869c1ce00..ab869c1ce00 100644
--- a/test/manual/cedet/tests/test-fmt.cpp
+++ b/test/lisp/cedet/semantic/format-resources/test-fmt.cpp
diff --git a/test/manual/cedet/tests/test-fmt.el b/test/lisp/cedet/semantic/format-resources/test-fmt.el
index 122571323b2..8458a8e6510 100644
--- a/test/manual/cedet/tests/test-fmt.el
+++ b/test/lisp/cedet/semantic/format-resources/test-fmt.el
@@ -1,6 +1,6 @@
-;;; test-fmt.el --- test semantic tag formatting
+;;; test-fmt.el --- test semantic tag formatting -*- lexical-binding: t -*-
-;;; Copyright (C) 2012, 2019-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
diff --git a/test/lisp/cedet/semantic/format-tests.el b/test/lisp/cedet/semantic/format-tests.el
new file mode 100644
index 00000000000..149f408af15
--- /dev/null
+++ b/test/lisp/cedet/semantic/format-tests.el
@@ -0,0 +1,95 @@
+;;; semantic/format-tests.el --- Parsing / Formatting tests -*- lexical-binding:t -*-
+
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Unit tests for the formatting feature.
+;;
+;; Using test code from the tests source directory, parse the source
+;; file. After parsing, read the comments for each signature, and
+;; make sure that the semantic-tag-format-* functions in question
+;; created the desired output.
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'semantic/format)
+
+(defvar semantic-fmt-utest-file-list
+ (list (ert-resource-file "test-fmt.cpp")
+ ;; "tests/test-fmt.el" - add this when elisp is support by dflt in Emacs
+ )
+ "List of files to run unit tests in.")
+
+(ert-deftest semantic-fmt-utest ()
+ "Visit all file entries, and run formatting test. "
+ (save-current-buffer
+ (semantic-mode 1)
+ (dolist (fname semantic-fmt-utest-file-list)
+ (let ((fb (find-buffer-visiting fname))
+ (b (semantic-find-file-noselect fname))
+ (tags nil))
+ (save-current-buffer
+ (set-buffer b)
+ (should (semantic-active-p))
+ ;;(error "Cannot open %s for format tests" fname))
+
+ ;; This will force a reparse, removing any chance of semanticdb cache
+ ;; using stale data.
+ (semantic-clear-toplevel-cache)
+ ;; Force the reparse
+ (setq tags (semantic-fetch-tags))
+
+ (save-excursion
+ (while tags
+ (let* ((T (car tags))
+ (start (semantic-tag-end T))
+ (end (if (cdr tags)
+ (semantic-tag-start (car (cdr tags)))
+ (point-max)))
+ (TESTS nil))
+ (goto-char start)
+ ;; Scan the space between tags for all test condition matches.
+ (while (re-search-forward "## \\([a-z-]+\\) \"\\([^\n\"]+\\)\"$" end t)
+ (push (cons (match-string 1) (match-string 2)) TESTS))
+ (setq TESTS (nreverse TESTS))
+
+ (dolist (TST TESTS)
+ (let* ( ;; For each test, convert CAR into a semantic-format-tag* fcn
+ (sym (intern (concat "semantic-format-tag-" (car TST))))
+ ;; Convert the desired result from a string syntax to a string.
+ (desired (cdr TST))
+ ;; What does the fmt function do?
+ (actual (funcall sym T)))
+ (when (not (string= desired actual))
+ (should-not (list "Desired" desired
+ "Actual" actual
+ "Formatter" (car TST)))))))
+ (setq tags (cdr tags)))))
+
+ ;; If it wasn't already in memory, whack it.
+ (when (and b (not fb))
+ (kill-buffer b))))))
+
+(provide 'format-tests)
+
+;;; format-tests.el ends here
diff --git a/test/lisp/cedet/semantic/fw-tests.el b/test/lisp/cedet/semantic/fw-tests.el
new file mode 100644
index 00000000000..7b1cd21bd1b
--- /dev/null
+++ b/test/lisp/cedet/semantic/fw-tests.el
@@ -0,0 +1,45 @@
+;;; fw-tests.el --- Tests for semantic/fw.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Moved here from test/manual/cedet/semantic-tests.el
+
+;;; Code:
+
+(require 'ert)
+(require 'semantic/fw)
+
+;;; From semantic-fw:
+
+(ert-deftest semantic-test-data-cache ()
+ "Test the data cache."
+ (let ((data '(a b c)))
+ (with-current-buffer (get-buffer-create " *semantic-test-data-cache*")
+ (erase-buffer)
+ (insert "The Moose is Loose")
+ (goto-char (point-min))
+ (semantic-cache-data-to-buffer (current-buffer) (point) (+ (point) 5)
+ data 'moose 'exit-cache-zone)
+ ;; retrieve cached data
+ (should (equal (semantic-get-cache-data 'moose) data)))))
+
+;;; gw-tests.el ends here
diff --git a/test/lisp/cedet/srecode-utest-template.el b/test/lisp/cedet/srecode-utest-template.el
index f97ff18320e..087dcfd8996 100644
--- a/test/lisp/cedet/srecode-utest-template.el
+++ b/test/lisp/cedet/srecode-utest-template.el
@@ -1,4 +1,4 @@
-;;; srecode/test.el --- SRecode Core Template tests. -*- lexical-binding:t -*-
+;;; srecode-utest-template.el --- SRecode Core Template tests. -*- lexical-binding:t -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/cedet/srecode/document-tests.el b/test/lisp/cedet/srecode/document-tests.el
new file mode 100644
index 00000000000..0bc6e10d7a7
--- /dev/null
+++ b/test/lisp/cedet/srecode/document-tests.el
@@ -0,0 +1,80 @@
+;;; document-tests.el --- Tests for srecode/document.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Extracted from srecode-document.el in the CEDET distribution.
+
+;; Converted to ert from test/manual/cedet/srecode-tests.el
+
+;;; Code:
+
+(require 'ert)
+(require 'srecode/document)
+
+;; FIXME: This test fails even before conversion to ert.
+(ert-deftest srecode-document-function-comment-extract-test ()
+ "Test old comment extraction.
+Dump out the extracted dictionary."
+ :tags '(:unstable)
+ (interactive)
+
+ (srecode-load-tables-for-mode major-mode)
+ (srecode-load-tables-for-mode major-mode 'document)
+
+ (should (srecode-table))
+ ;; (error "No template table found for mode %s" major-mode)
+
+ (let* ((temp (srecode-template-get-table (srecode-table)
+ "function-comment"
+ "declaration"
+ 'document))
+ (fcn-in (semantic-current-tag)))
+
+ (should temp)
+ ;; (error "No templates for function comments")
+
+ ;; Try to figure out the tag we want to use.
+ (should fcn-in)
+ (should (semantic-tag-of-class-p fcn-in 'function))
+ ;; (error "No tag of class 'function to insert comment for")
+
+ (let ((lextok (semantic-documentation-comment-preceding-tag fcn-in 'lex)))
+
+ (should lextok)
+ ;; (error "No comment to attempt an extraction")
+
+ (let ((s (semantic-lex-token-start lextok))
+ (e (semantic-lex-token-end lextok))
+ (extract nil))
+
+ (pulse-momentary-highlight-region s e)
+
+ ;; Extract text from the existing comment.
+ (setq extract (srecode-extract temp s e))
+
+ (with-output-to-temp-buffer "*SRECODE DUMP*"
+ (princ "EXTRACTED DICTIONARY FOR ")
+ (princ (semantic-tag-name fcn-in))
+ (princ "\n--------------------------------------------\n")
+ (srecode-dump extract))))))
+
+;;; document-tests.el ends here
diff --git a/test/manual/cedet/srecode-tests.el b/test/lisp/cedet/srecode/fields-tests.el
index ebc3261f817..5f634a5e4ce 100644
--- a/test/manual/cedet/srecode-tests.el
+++ b/test/lisp/cedet/srecode/fields-tests.el
@@ -1,4 +1,4 @@
-;;; srecode-tests.el --- Some tests for CEDET's srecode
+;;; srecode/fields-tests.el --- Tests for srecode/fields.el -*- lexical-binding: t -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
@@ -21,13 +21,15 @@
;;; Commentary:
-;; Extracted from srecode-fields.el and srecode-document.el in the
-;; CEDET distribution.
+;; Extracted from srecode-fields.el in the CEDET distribution.
+
+;; Converted to ert from test/manual/cedet/srecode-tests.el
;;; Code:
;;; From srecode-fields:
+(require 'ert)
(require 'srecode/fields)
(defvar srecode-field-utest-text
@@ -36,13 +38,10 @@
It is filled with some text."
"Text for tests.")
-(defun srecode-field-utest ()
- "Test the srecode field manager."
- (interactive)
- (srecode-field-utest-impl))
-
-(defun srecode-field-utest-impl ()
+;; FIXME: This test fails even before conversion to ert.
+(ert-deftest srecode-field-utest-impl ()
"Implementation of the SRecode field utest."
+ :tags '(:unstable)
(save-excursion
(find-file "/tmp/srecode-field-test.txt")
@@ -131,15 +130,15 @@ It is filled with some text."
;; Various sizes
(mapc (lambda (T)
- (if (string= (object-name-string T) "Test4")
+ (if (string= (eieio-object-name-string T) "Test4")
(progn
(when (not (srecode-empty-region-p T))
(error "Field %s is not empty"
- (object-name T)))
+ (eieio-object-name T)))
)
(when (not (= (srecode-region-size T) 5))
(error "Calculated size of %s was not 5"
- (object-name T)))))
+ (eieio-object-name T)))))
fields)
;; Make sure things stay up after a 'command'.
@@ -151,21 +150,21 @@ It is filled with some text."
(when (not (eq (srecode-overlaid-at-point 'srecode-field)
(nth 0 fields)))
(error "Region Test: Field %s not under point"
- (object-name (nth 0 fields))))
+ (eieio-object-name (nth 0 fields))))
(srecode-field-next)
(when (not (eq (srecode-overlaid-at-point 'srecode-field)
(nth 1 fields)))
(error "Region Test: Field %s not under point"
- (object-name (nth 1 fields))))
+ (eieio-object-name (nth 1 fields))))
(srecode-field-prev)
(when (not (eq (srecode-overlaid-at-point 'srecode-field)
(nth 0 fields)))
(error "Region Test: Field %s not under point"
- (object-name (nth 0 fields))))
+ (eieio-object-name (nth 0 fields))))
;; Move cursor out of the region and have everything cleaned up.
(goto-char 42)
@@ -176,7 +175,7 @@ It is filled with some text."
(mapc (lambda (T)
(when (slot-boundp T 'overlay)
(error "Overlay did not clear off of field %s"
- (object-name T))))
+ (eieio-object-name T))))
fields)
;; End of LET
@@ -187,8 +186,7 @@ It is filled with some text."
(f1 (srecode-field "Test1" :name "TEST" :start 6 :end 8))
(f2 (srecode-field "Test2" :name "TEST" :start 28 :end 30))
(f3 (srecode-field "Test3" :name "NOTTEST" :start 35 :end 40))
- (reg (srecode-template-inserted-region "REG" :start 4 :end 40))
- )
+ (reg (srecode-template-inserted-region "REG" :start 4 :end 40)))
(srecode-overlaid-activate reg)
(when (not (string= (srecode-overlaid-text f1)
@@ -233,62 +231,8 @@ It is filled with some text."
(error "Linkage Test: tail-insert string on dissimilar fields is now the same"))
;; Cleanup
- (srecode-delete reg)
- )
-
- (set-buffer-modified-p nil)
-
- (message " All field tests passed.")
- ))
-
-;;; From srecode-document:
-
-(require 'srecode/document)
-
-(defun srecode-document-function-comment-extract-test ()
- "Test old comment extraction.
-Dump out the extracted dictionary."
- (interactive)
-
- (srecode-load-tables-for-mode major-mode)
- (srecode-load-tables-for-mode major-mode 'document)
-
- (if (not (srecode-table))
- (error "No template table found for mode %s" major-mode))
-
- (let* ((temp (srecode-template-get-table (srecode-table)
- "function-comment"
- "declaration"
- 'document))
- (fcn-in (semantic-current-tag)))
-
- (if (not temp)
- (error "No templates for function comments"))
-
- ;; Try to figure out the tag we want to use.
- (when (or (not fcn-in)
- (not (semantic-tag-of-class-p fcn-in 'function)))
- (error "No tag of class 'function to insert comment for"))
-
- (let ((lextok (semantic-documentation-comment-preceding-tag fcn-in 'lex))
- )
-
- (when (not lextok)
- (error "No comment to attempt an extraction"))
-
- (let ((s (semantic-lex-token-start lextok))
- (e (semantic-lex-token-end lextok))
- (extract nil))
-
- (pulse-momentary-highlight-region s e)
-
- ;; Extract text from the existing comment.
- (setq extract (srecode-extract temp s e))
+ (srecode-delete reg))
- (with-output-to-temp-buffer "*SRECODE DUMP*"
- (princ "EXTRACTED DICTIONARY FOR ")
- (princ (semantic-tag-name fcn-in))
- (princ "\n--------------------------------------------\n")
- (srecode-dump extract))))))
+ (set-buffer-modified-p nil)))
-;;; srecode-tests.el ends here
+;;; srecode/fields-tests.el ends here
diff --git a/test/lisp/comint-tests.el b/test/lisp/comint-tests.el
index de1bc548e18..8a9a41f452f 100644
--- a/test/lisp/comint-tests.el
+++ b/test/lisp/comint-tests.el
@@ -44,6 +44,7 @@
"Password (again):"
"Enter password:"
"Enter Auth Password:" ; OpenVPN (Bug#35724)
+ "Verify password: " ; zip -e zipfile.zip ... (Bug#47209)
"Mot de Passe :" ; localized (Bug#29729)
"Passwort:") ; localized
"List of strings that should match `comint-password-prompt-regexp'.")
diff --git a/test/lisp/cus-edit-tests.el b/test/lisp/cus-edit-tests.el
index 95f62e0d7ea..97b3349000c 100644
--- a/test/lisp/cus-edit-tests.el
+++ b/test/lisp/cus-edit-tests.el
@@ -53,9 +53,9 @@
(customize-apropos "cus-edit-tests")
(should-not (search-forward cus-edit-tests--obsolete-option-tag nil t))))
-(ert-deftest cus-edit-tests-customize-changed-options/hide-obsolete ()
+(ert-deftest cus-edit-tests-customize-changed/hide-obsolete ()
(with-cus-edit-test "*Customize Changed Options*"
- (customize-changed-options "917.2") ; some future version
+ (customize-changed "917.2") ;; Some future version.
(should-not (search-forward cus-edit-tests--obsolete-option-tag nil t))))
(ert-deftest cus-edit-tests-customize-group/hide-obsolete ()
diff --git a/test/lisp/custom-resources/custom--test-theme.el b/test/lisp/custom-resources/custom--test-theme.el
index 4ced98a50bc..36424cdfcc3 100644
--- a/test/lisp/custom-resources/custom--test-theme.el
+++ b/test/lisp/custom-resources/custom--test-theme.el
@@ -1,4 +1,4 @@
-;;; custom--test-theme.el -- A test theme. -*- lexical-binding:t -*-
+;;; custom--test-theme.el --- A test theme. -*- lexical-binding:t -*-
(deftheme custom--test
"A test theme.")
@@ -6,6 +6,8 @@
(custom-theme-set-variables
'custom--test
'(custom--test-user-option 'bar)
- '(custom--test-variable 'bar))
+ '(custom--test-variable 'bar)
+ '(custom--test-bug-21355-before 'before)
+ '(custom--test-bug-21355-after 'after))
(provide-theme 'custom--test)
diff --git a/test/lisp/custom-tests.el b/test/lisp/custom-tests.el
index 10854c71d56..e93c96e1d93 100644
--- a/test/lisp/custom-tests.el
+++ b/test/lisp/custom-tests.el
@@ -24,70 +24,108 @@
(require 'wid-edit)
(require 'cus-edit)
-(require 'seq) ; For `seq-find'.
+
+(defmacro custom-tests--with-temp-dir (&rest body)
+ "Eval BODY with `temporary-file-directory' bound to a fresh directory.
+Ensure the directory is recursively deleted after the fact."
+ (declare (debug t) (indent 0))
+ (let ((dir (make-symbol "dir")))
+ `(let ((,dir (file-name-as-directory (make-temp-file "custom-tests-" t))))
+ (unwind-protect
+ (let ((temporary-file-directory ,dir))
+ ,@body)
+ (delete-directory ,dir t)))))
(ert-deftest custom-theme--load-path ()
"Test `custom-theme--load-path' behavior."
- (let ((tmpdir (file-name-as-directory (make-temp-file "custom-tests-" t))))
- (unwind-protect
- ;; Create all temporary files under the same deletable parent.
- (let ((temporary-file-directory tmpdir))
- ;; Path is empty.
- (let ((custom-theme-load-path ()))
- (should (null (custom-theme--load-path))))
-
- ;; Path comprises non-existent file.
- (let* ((name (make-temp-name tmpdir))
- (custom-theme-load-path (list name)))
- (should (not (file-exists-p name)))
- (should (null (custom-theme--load-path))))
-
- ;; Path comprises existing file.
- (let* ((file (make-temp-file "file"))
- (custom-theme-load-path (list file)))
- (should (file-exists-p file))
- (should (not (file-directory-p file)))
- (should (null (custom-theme--load-path))))
-
- ;; Path comprises existing directory.
- (let* ((dir (make-temp-file "dir" t))
- (custom-theme-load-path (list dir)))
- (should (file-directory-p dir))
- (should (equal (custom-theme--load-path) custom-theme-load-path)))
-
- ;; Expand `custom-theme-directory' path element.
- (let ((custom-theme-load-path '(custom-theme-directory)))
- (let ((custom-theme-directory (make-temp-name tmpdir)))
- (should (not (file-exists-p custom-theme-directory)))
- (should (null (custom-theme--load-path))))
- (let ((custom-theme-directory (make-temp-file "file")))
- (should (file-exists-p custom-theme-directory))
- (should (not (file-directory-p custom-theme-directory)))
- (should (null (custom-theme--load-path))))
- (let ((custom-theme-directory (make-temp-file "dir" t)))
- (should (file-directory-p custom-theme-directory))
- (should (equal (custom-theme--load-path)
- (list custom-theme-directory)))))
-
- ;; Expand t path element.
- (let ((custom-theme-load-path '(t)))
- (let ((data-directory (make-temp-name tmpdir)))
- (should (not (file-exists-p data-directory)))
- (should (null (custom-theme--load-path))))
- (let ((data-directory tmpdir)
- (themedir (expand-file-name "themes" tmpdir)))
- (should (not (file-exists-p themedir)))
- (should (null (custom-theme--load-path)))
- (with-temp-file themedir)
- (should (file-exists-p themedir))
- (should (not (file-directory-p themedir)))
- (should (null (custom-theme--load-path)))
- (delete-file themedir)
- (make-directory themedir)
- (should (file-directory-p themedir))
- (should (equal (custom-theme--load-path) (list themedir))))))
- (when (file-directory-p tmpdir)
- (delete-directory tmpdir t)))))
+ (custom-tests--with-temp-dir
+ ;; Path is empty.
+ (let ((custom-theme-load-path ()))
+ (should (null (custom-theme--load-path))))
+
+ ;; Path comprises non-existent file.
+ (let* ((name (make-temp-name temporary-file-directory))
+ (custom-theme-load-path (list name)))
+ (should (not (file-exists-p name)))
+ (should (null (custom-theme--load-path))))
+
+ ;; Path comprises existing file.
+ (let* ((file (make-temp-file "file"))
+ (custom-theme-load-path (list file)))
+ (should (file-exists-p file))
+ (should (not (file-directory-p file)))
+ (should (null (custom-theme--load-path))))
+
+ ;; Path comprises existing directory.
+ (let* ((dir (make-temp-file "dir" t))
+ (custom-theme-load-path (list dir)))
+ (should (file-directory-p dir))
+ (should (equal (custom-theme--load-path) custom-theme-load-path)))
+
+ ;; Expand `custom-theme-directory' path element.
+ (let ((custom-theme-load-path '(custom-theme-directory)))
+ (let ((custom-theme-directory (make-temp-name temporary-file-directory)))
+ (should (not (file-exists-p custom-theme-directory)))
+ (should (null (custom-theme--load-path))))
+ (let ((custom-theme-directory (make-temp-file "file")))
+ (should (file-exists-p custom-theme-directory))
+ (should (not (file-directory-p custom-theme-directory)))
+ (should (null (custom-theme--load-path))))
+ (let ((custom-theme-directory (make-temp-file "dir" t)))
+ (should (file-directory-p custom-theme-directory))
+ (should (equal (custom-theme--load-path)
+ (list custom-theme-directory)))))
+
+ ;; Expand t path element.
+ (let ((custom-theme-load-path '(t)))
+ (let ((data-directory (make-temp-name temporary-file-directory)))
+ (should (not (file-exists-p data-directory)))
+ (should (null (custom-theme--load-path))))
+ (let ((data-directory temporary-file-directory)
+ (themedir (expand-file-name "themes" temporary-file-directory)))
+ (should (not (file-exists-p themedir)))
+ (should (null (custom-theme--load-path)))
+ (with-temp-file themedir)
+ (should (file-exists-p themedir))
+ (should (not (file-directory-p themedir)))
+ (should (null (custom-theme--load-path)))
+ (delete-file themedir)
+ (make-directory themedir)
+ (should (file-directory-p themedir))
+ (should (equal (custom-theme--load-path) (list themedir)))))))
+
+(ert-deftest custom-tests-require-theme ()
+ "Test `require-theme'."
+ (custom-tests--with-temp-dir
+ (let* ((default-directory temporary-file-directory)
+ (custom-theme-load-path (list default-directory))
+ (load-path ()))
+ ;; Generate some `.el' and `.elc' files.
+ (with-temp-file "custom-tests--a.el"
+ (insert "(provide 'custom-tests--a)"))
+ (make-empty-file "custom-tests--b.el")
+ (with-temp-file "custom-tests--b.elc"
+ (byte-compile-insert-header nil (current-buffer))
+ (insert "(provide 'custom-tests--b)"))
+ (make-empty-file "custom-tests--c.el")
+ (with-temp-file "custom-tests--d.elc"
+ (byte-compile-insert-header nil (current-buffer)))
+ ;; Load them.
+ (dolist (feature '(a b c d e))
+ (should-not (featurep (intern (format "custom-tests--%s" feature)))))
+ (should (eq (require-theme 'custom-tests--a) 'custom-tests--a))
+ (delete-file "custom-tests--a.el")
+ (dolist (feature '(custom-tests--a custom-tests--b))
+ (should (eq (require-theme feature) feature))
+ (should (featurep feature)))
+ (dolist (feature '(custom-tests--c custom-tests--d))
+ (dolist (noerror '(nil t))
+ (let ((err (should-error (require-theme feature noerror))))
+ (should (string-search "failed to provide feature" (cadr err))))))
+ (should-error (require-theme 'custom-tests--e) :type 'file-missing)
+ (should-not (require-theme 'custom-tests--e t))
+ (dolist (feature '(custom-tests--c custom-tests--d custom-tests--e))
+ (should-not (featurep feature))))))
(defcustom custom--test-user-option 'foo
"User option for test."
@@ -145,17 +183,6 @@
(widget-apply field :value-to-internal origvalue)
"bar"))))))
-(defconst custom-test-admin-cus-test
- (expand-file-name "admin/cus-test.el" source-directory))
-
-(declare-function cus-test-opts custom-test-admin-cus-test)
-
-(ert-deftest check-for-wrong-custom-types ()
- :tags '(:expensive-test)
- (skip-unless (file-readable-p custom-test-admin-cus-test))
- (load custom-test-admin-cus-test)
- (should (null (cus-test-opts t))))
-
(ert-deftest custom-test-enable-theme-keeps-settings ()
"Test that enabling a theme doesn't change its settings."
(let* ((custom-theme-load-path `(,(ert-resource-directory)))
@@ -203,4 +230,108 @@
(should (eq (default-value 'custom--test-local-option) 'initial))
(should (eq (default-value 'custom--test-permanent-option) 'initial)))))
+;; The following three tests demonstrate Bug#21355.
+;; In this one, we set an user option for the current session and then
+;; we enable a theme that doesn't have a setting for it, ending up with
+;; a non-nil saved-value property. Since the `caar' of the theme-value
+;; property is user (i.e., the user theme setting is active), we might
+;; save the setting to the custom-file, even though it was meant for the
+;; current session only. So there should be a nil saved-value property
+;; for this test to pass.
+(ert-deftest custom-test-no-saved-value-after-enabling-theme ()
+ "Test that we don't record a saved-value property when we shouldn't."
+ (let ((custom-theme-load-path `(,(ert-resource-directory))))
+ (customize-option 'mark-ring-max)
+ (let* ((field (seq-find (lambda (widget)
+ (eq mark-ring-max (widget-value widget)))
+ widget-field-list))
+ (parent (widget-get field :parent)))
+ ;; Move to the editable widget, modify the value and save it.
+ (goto-char (widget-field-text-end field))
+ (insert "0")
+ (widget-apply parent :custom-set)
+ ;; Just setting for the current session should not store a saved-value
+ ;; property.
+ (should-not (get 'mark-ring-max 'saved-value))
+ ;; Now enable and disable the test theme.
+ (load-theme 'custom--test 'no-confirm)
+ (disable-theme 'custom--test)
+ ;; Since the user customized the option, this is OK.
+ (should (eq (caar (get 'mark-ring-max 'theme-value)) 'user))
+ ;; The saved-value property should still be nil.
+ (should-not (get 'mark-ring-max 'saved-value)))))
+
+;; In this second test, we load a theme that has a setting for the user option
+;; above. We must check that we don't end up with a non-nil saved-value
+;; property and a user setting active in the theme-value property, which
+;; means we might inadvertently save the session setting in the custom-file.
+(defcustom custom--test-bug-21355-before 'foo
+ "User option for `custom-test-no-saved-value-after-enabling-theme-2'."
+ :type 'symbol :group 'emacs)
+
+(ert-deftest custom-test-no-saved-value-after-enabling-theme-2 ()
+ "Test that we don't record a saved-value property when we shouldn't."
+ (let ((custom-theme-load-path `(,(ert-resource-directory))))
+ (customize-option 'custom--test-bug-21355-before)
+ (let* ((field (seq-find
+ (lambda (widget)
+ (eq custom--test-bug-21355-before (widget-value widget)))
+ widget-field-list))
+ (parent (widget-get field :parent)))
+ ;; Move to the editable widget, modify the value and save it.
+ (goto-char (widget-field-text-end field))
+ (insert "bar")
+ (widget-apply parent :custom-set)
+ ;; Just setting for the current session should not store a saved-value
+ ;; property.
+ (should-not (get 'custom--test-bug-21355-before 'saved-value))
+ ;; Now load our test theme, which has a setting for
+ ;; `custom--test-bug-21355-before'.
+ (load-theme 'custom--test 'no-confirm 'no-enable)
+ (enable-theme 'custom--test)
+ ;; Since the user customized the option, this is OK.
+ (should (eq (caar (get 'custom--test-bug-21355-before 'theme-value))
+ 'user))
+ ;; But the saved-value property has to be nil, since the user didn't mark
+ ;; this variable to save for future sessions.
+ (should-not (get 'custom--test-bug-21355-before 'saved-value)))))
+
+(defvar custom--test-bug-21355-after)
+
+;; In this test, we check that stashing a theme value for a not yet defined
+;; option works, but that later on if the user customizes the option for the
+;; current session, we might save the theme setting in the custom file.
+(ert-deftest custom-test-no-saved-value-after-customizing-option ()
+ "Test for a nil saved-value after setting an option for the current session."
+ (let ((custom-theme-load-path `(,(ert-resource-directory))))
+ ;; Check that we correctly stashed the value.
+ (load-theme 'custom--test 'no-confirm 'no-enable)
+ (enable-theme 'custom--test)
+ (should (and (not (boundp 'custom--test-bug-21355-after))
+ (eq (eval
+ (car (get 'custom--test-bug-21355-after 'saved-value)))
+ 'after)))
+ ;; Now Emacs finds the defcustom.
+ (defcustom custom--test-bug-21355-after 'initially "..."
+ :type 'symbol :group 'emacs)
+ ;; And we used the stashed value correctly.
+ (should (and (boundp 'custom--test-bug-21355-after)
+ (eq custom--test-bug-21355-after 'after)))
+ ;; Now customize it.
+ (customize-option 'custom--test-bug-21355-after)
+ (let* ((field (seq-find (lambda (widget)
+ (eq custom--test-bug-21355-after
+ (widget-value widget)))
+ widget-field-list))
+ (parent (widget-get field :parent)))
+ ;; Move to the editable widget, modify the value and save it.
+ (goto-char (widget-field-text-end field))
+ (insert "bar")
+ (widget-apply parent :custom-set)
+ ;; The user customized the variable, so this is OK.
+ (should (eq (caar (get 'custom--test-bug-21355-after 'theme-value))
+ 'user))
+ ;; But it was only for the current session, so this should not happen.
+ (should-not (get 'custom--test-bug-21355-after 'saved-value)))))
+
;;; custom-tests.el ends here
diff --git a/test/lisp/descr-text-tests.el b/test/lisp/descr-text-tests.el
index 6ba455b50d4..2052dc0e38c 100644
--- a/test/lisp/descr-text-tests.el
+++ b/test/lisp/descr-text-tests.el
@@ -1,4 +1,4 @@
-;;; descr-text-test.el --- ERT tests for descr-text.el -*- lexical-binding: t -*-
+;;; descr-text-tests.el --- ERT tests for descr-text.el -*- lexical-binding: t -*-
;; Copyright (C) 2014, 2016-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/dired-x-tests.el b/test/lisp/dired-x-tests.el
index 5b51c997e36..003923d60fa 100644
--- a/test/lisp/dired-x-tests.el
+++ b/test/lisp/dired-x-tests.el
@@ -49,5 +49,18 @@
(sort (dired-get-marked-files 'local) #'string<))))
(delete-directory dir 'recursive))))
+(ert-deftest dired-guess-default ()
+ (let ((dired-guess-shell-alist-user nil)
+ (dired-guess-shell-alist-default
+ '(("\\.png\\'" "display")
+ ("\\.gif\\'" "display" "xloadimage")
+ ("\\.gif\\'" "feh")
+ ("\\.jpe?g\\'" "xloadimage"))))
+ (should (equal (dired-guess-default '("/tmp/foo.png")) "display"))
+ (should (equal (dired-guess-default '("/tmp/foo.gif"))
+ '("display" "xloadimage" "feh")))
+ (should (equal (dired-guess-default '("/tmp/foo.png" "/tmp/foo.txt"))
+ nil))))
+
(provide 'dired-x-tests)
;; dired-x-tests.el ends here
diff --git a/test/lisp/dom-tests.el b/test/lisp/dom-tests.el
index dbe3a15dac1..b55982c1a15 100644
--- a/test/lisp/dom-tests.el
+++ b/test/lisp/dom-tests.el
@@ -5,6 +5,8 @@
;; Author: Simen Heggestøyl <simenheg@gmail.com>
;; Keywords:
+;; This file is part of GNU Emacs.
+
;; GNU Emacs 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
@@ -207,5 +209,13 @@ child results in an error."
(dom-pp node t)
(should (equal (buffer-string) "(\"foo\" nil)")))))
+(ert-deftest dom-test-search ()
+ (let ((dom '(a nil (b nil (c nil)))))
+ (should (equal (dom-search dom (lambda (d) (eq (dom-tag d) 'a)))
+ (list dom)))
+ (should (equal (dom-search dom (lambda (d) (memq (dom-tag d) '(b c))))
+ (list (car (dom-children dom))
+ (car (dom-children (car (dom-children dom)))))))))
+
(provide 'dom-tests)
;;; dom-tests.el ends here
diff --git a/test/lisp/electric-tests.el b/test/lisp/electric-tests.el
index 62a42b7fe44..c5124aca5ee 100644
--- a/test/lisp/electric-tests.el
+++ b/test/lisp/electric-tests.el
@@ -47,10 +47,11 @@
(defmacro save-electric-modes (&rest body)
(declare (indent defun) (debug t))
- `(call-with-saved-electric-modes #'(lambda () ,@body)))
+ `(call-with-saved-electric-modes (lambda () ,@body)))
(defun electric-pair-test-for (fixture where char expected-string
- expected-point mode bindings fixture-fn)
+ expected-point mode bindings
+ fixture-fn &optional doc-string)
(with-temp-buffer
(funcall mode)
(insert fixture)
@@ -63,6 +64,14 @@
(mapcar #'car bindings)
(mapcar #'cdr bindings)
(call-interactively (key-binding `[,last-command-event])))))
+ (when
+ (and doc-string
+ (not
+ (and
+ (equal (buffer-substring-no-properties (point-min) (point-max))
+ expected-string)
+ (equal (point) expected-point))))
+ (message "\n%s\n" doc-string))
(should (equal (buffer-substring-no-properties (point-min) (point-max))
expected-string))
(should (equal (point)
@@ -109,14 +118,9 @@
(fixture (format "%s%s%s" prefix fixture suffix))
(expected-string (format "%s%s%s" prefix expected-string suffix))
(expected-point (+ (length prefix) expected-point))
- (pos (+ (length prefix) pos)))
- `(ert-deftest ,(intern (format "electric-pair-%s-at-point-%s-in-%s%s"
- name
- (1+ pos)
- mode
- extra-desc))
- ()
- ,(format "Electricity test in a `%s' buffer.\n
+ (pos (+ (length prefix) pos))
+ (doc-string
+ (format "Electricity test in a `%s' buffer.\n
Start with point at %d in a %d-char-long buffer
like this one:
@@ -142,8 +146,15 @@ The buffer's contents should %s:
"")
char
(if (string= fixture expected-string) "stay" "become")
- (replace-regexp-in-string "\n" "\\\\n" expected-string)
- expected-point)
+ (string-replace "\n" "\\n" expected-string)
+ expected-point)))
+ `(ert-deftest ,(intern (format "electric-pair-%s-at-point-%s-in-%s%s"
+ name
+ (1+ pos)
+ mode
+ extra-desc))
+ ()
+ ,doc-string
(electric-pair-test-for ,fixture
,(1+ pos)
,char
@@ -151,7 +162,8 @@ The buffer's contents should %s:
,expected-point
',mode
,bindings
- ,fixture-fn)))))
+ ,fixture-fn
+ ,doc-string)))))
(cl-defmacro define-electric-pair-test
(name fixture
@@ -347,7 +359,7 @@ baz\"\""
# \"
#
baz\"\""
- :fixture-fn #'(lambda () (goto-char (point-min)) (search-forward "bar")))
+ :fixture-fn (lambda () (goto-char (point-min)) (search-forward "bar")))
(define-electric-pair-test inhibit-in-mismatched-string-inside-c-comments
"foo\"\"/*
@@ -366,7 +378,7 @@ baz\"\""
\" \"
\"
*/baz\"\""
- :fixture-fn #'(lambda () (goto-char (point-min)) (search-forward "bar")))
+ :fixture-fn (lambda () (goto-char (point-min)) (search-forward "bar")))
;;; More quotes, but now don't bind `electric-pair-text-syntax-table'
@@ -508,8 +520,8 @@ baz\"\""
(define-electric-pair-test js-mode-braces
"" "{" :expected-string "{}" :expected-point 2
:modes '(js-mode)
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)))
(define-electric-pair-test js-mode-braces-with-layout
@@ -517,29 +529,29 @@ baz\"\""
:modes '(js-mode)
:test-in-comments nil
:test-in-strings nil
- :fixture-fn #'(lambda ()
- (electric-layout-mode 1)
- (electric-pair-mode 1)))
+ :fixture-fn (lambda ()
+ (electric-layout-mode 1)
+ (electric-pair-mode 1)))
(define-electric-pair-test js-mode-braces-with-layout-and-indent
"" "{" :expected-string "{\n \n}" :expected-point 7
:modes '(js-mode)
:test-in-comments nil
:test-in-strings nil
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (electric-indent-mode 1)
- (electric-layout-mode 1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (electric-indent-mode 1)
+ (electric-layout-mode 1)))
(define-electric-pair-test js-mode-braces-with-layout-and-indent
"" "{" :expected-string "{\n \n}" :expected-point 7
:modes '(js-mode)
:test-in-comments nil
:test-in-strings nil
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (electric-indent-mode 1)
- (electric-layout-mode 1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (electric-indent-mode 1)
+ (electric-layout-mode 1)))
;;; Backspacing
@@ -575,6 +587,7 @@ baz\"\""
;;; Electric newlines between pairs
;;; TODO: better tests
(ert-deftest electric-pair-open-extra-newline ()
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(save-electric-modes
(with-temp-buffer
(c-mode)
@@ -594,55 +607,55 @@ baz\"\""
;;;
(define-electric-pair-test autowrapping-1
"foo" "(" :expected-string "(foo)" :expected-point 2
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (mark-sexp 1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (mark-sexp 1)))
(define-electric-pair-test autowrapping-2
"foo" ")" :expected-string "(foo)" :expected-point 6
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (mark-sexp 1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (mark-sexp 1)))
(define-electric-pair-test autowrapping-3
"foo" ")" :expected-string "(foo)" :expected-point 6
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (goto-char (point-max))
- (skip-chars-backward "\"")
- (mark-sexp -1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (goto-char (point-max))
+ (skip-chars-backward "\"")
+ (mark-sexp -1)))
(define-electric-pair-test autowrapping-4
"foo" "(" :expected-string "(foo)" :expected-point 2
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (goto-char (point-max))
- (skip-chars-backward "\"")
- (mark-sexp -1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (goto-char (point-max))
+ (skip-chars-backward "\"")
+ (mark-sexp -1)))
(define-electric-pair-test autowrapping-5
"foo" "\"" :expected-string "\"foo\"" :expected-point 2
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (mark-sexp 1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (mark-sexp 1)))
(define-electric-pair-test autowrapping-6
"foo" "\"" :expected-string "\"foo\"" :expected-point 6
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (goto-char (point-max))
- (skip-chars-backward "\"")
- (mark-sexp -1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (goto-char (point-max))
+ (skip-chars-backward "\"")
+ (mark-sexp -1)))
(define-electric-pair-test autowrapping-7
"foo" "\"" :expected-string "``foo''" :expected-point 8
:modes '(tex-mode)
:test-in-comments nil
- :fixture-fn #'(lambda ()
- (electric-pair-mode 1)
- (goto-char (point-max))
- (skip-chars-backward "\"")
- (mark-sexp -1)))
+ :fixture-fn (lambda ()
+ (electric-pair-mode 1)
+ (goto-char (point-max))
+ (skip-chars-backward "\"")
+ (mark-sexp -1)))
;;; Electric quotes
@@ -859,12 +872,14 @@ baz\"\""
(defun electric-layout-for-c-style-du-jour (inserted)
"A function to use in `electric-layout-rules'"
- (when (memq inserted '(?{ ?}))
+ (when (memq inserted '(?\{ ?\}))
(save-excursion
(backward-char 2) (c-point-syntax) (forward-char) ; silly, but needed
(c-brace-newlines (c-point-syntax)))))
(ert-deftest electric-layout-plainer-c-mode-use-c-style ()
+ ;; FIXME hangs since c4d34d2
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode 1)
@@ -878,6 +893,7 @@ baz\"\""
(should (equal (buffer-string) "int main ()\n{\n \n}\n"))))
(ert-deftest electric-layout-int-main-kernel-style ()
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode 1)
@@ -894,6 +910,7 @@ baz\"\""
(ert-deftest electric-layout-control-reindentation ()
"Same as `emacs-lisp-int-main-kernel-style', but checking
Bug#35254."
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode 1)
@@ -912,6 +929,7 @@ Bug#35254."
(should (equal (buffer-string) "int main () {\n\n \n}"))))
(ert-deftest electric-modes-int-main-allman-style ()
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode 1)
@@ -926,6 +944,7 @@ Bug#35254."
(should (equal (buffer-string) "int main ()\n{\n \n}"))))
(ert-deftest electric-pair-mode-newline-between-parens ()
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode -1) ;; ensure e-l-m mode is off
@@ -937,6 +956,7 @@ Bug#35254."
(should (equal (buffer-string) "int main () {\n \n}"))))
(ert-deftest electric-layout-mode-newline-between-parens-without-e-p-m ()
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode 1)
@@ -958,6 +978,7 @@ Bug#35254."
(should (equal (buffer-string) "int main () {\n \n}"))))
(ert-deftest electric-layout-mode-newline-between-parens-without-e-p-m-2 ()
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
(ert-with-test-buffer ()
(plainer-c-mode)
(electric-layout-local-mode 1)
diff --git a/test/lisp/emacs-lisp/bindat-tests.el b/test/lisp/emacs-lisp/bindat-tests.el
index a9a881987c0..911a5f0c7b1 100644
--- a/test/lisp/emacs-lisp/bindat-tests.el
+++ b/test/lisp/emacs-lisp/bindat-tests.el
@@ -1,4 +1,4 @@
-;;; bindat-tests.el --- tests for bindat.el -*- lexical-binding: t; coding: utf-8; -*-
+;;; bindat-tests.el --- tests for bindat.el -*- lexical-binding: t -*-
;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
@@ -23,44 +23,50 @@
(require 'bindat)
(require 'cl-lib)
-(defvar header-bindat-spec
- '((dest-ip ip)
+(bindat-defmacro ip () "An IPv4 address" '(vec 4 byte))
+
+(defconst header-bindat-spec
+ (bindat-type
+ (dest-ip ip)
(src-ip ip)
- (dest-port u16)
- (src-port u16)))
+ (dest-port uint 16)
+ (src-port uint 16)))
-(defvar data-bindat-spec
- '((type u8)
+(defconst data-bindat-spec
+ (bindat-type
+ (type u8)
(opcode u8)
- (length u16r) ;; little endian order
+ (length uintr 16) ;; little endian order
(id strz 8)
- (data vec (length))
- (align 4)))
+ (data vec length)
+ (_ align 4)))
+
-(defvar packet-bindat-spec
- '((header struct header-bindat-spec)
+(defconst packet-bindat-spec
+ (bindat-type
+ (header type header-bindat-spec)
(items u8)
- (fill 3)
- (item repeat (items)
- (struct data-bindat-spec))))
+ (_ fill 3)
+ (item repeat items
+ (_ type data-bindat-spec))))
-(defvar struct-bindat
+(defconst struct-bindat
'((header
(dest-ip . [192 168 1 100])
(src-ip . [192 168 1 101])
(dest-port . 284)
(src-port . 5408))
(items . 2)
- (item ((data . [1 2 3 4 5])
- (id . "ABCDEF")
- (length . 5)
+ (item ((type . 2)
(opcode . 3)
- (type . 2))
- ((data . [6 7 8 9 10 11 12])
- (id . "BCDEFG")
- (length . 7)
+ (length . 5)
+ (id . "ABCDEF")
+ (data . [1 2 3 4 5]))
+ ((type . 1)
(opcode . 4)
- (type . 1)))))
+ (length . 7)
+ (id . "BCDEFG")
+ (data . [6 7 8 9 10 11 12])))))
(ert-deftest bindat-test-pack ()
(should (equal
@@ -74,27 +80,7 @@
(should (equal
(bindat-unpack packet-bindat-spec
(bindat-pack packet-bindat-spec struct-bindat))
- '((item
- ((data .
- [1 2 3 4 5])
- (id . "ABCDEF")
- (length . 5)
- (opcode . 3)
- (type . 2))
- ((data .
- [6 7 8 9 10 11 12])
- (id . "BCDEFG")
- (length . 7)
- (opcode . 4)
- (type . 1)))
- (items . 2)
- (header
- (src-port . 5408)
- (dest-port . 284)
- (src-ip .
- [192 168 1 101])
- (dest-ip .
- [192 168 1 100]))))))
+ struct-bindat)))
(ert-deftest bindat-test-pack/multibyte-string-fails ()
(should-error (bindat-pack nil nil "ö")))
@@ -118,4 +104,62 @@
(should (equal (bindat-ip-to-string [192 168 0 1]) "192.168.0.1"))
(should (equal (bindat-ip-to-string "\300\250\0\1") "192.168.0.1")))
+(defconst bindat-test--int-websocket-type
+ (bindat-type
+ :pack-var value
+ (n1 u8
+ :pack-val (if (< value 126) value (if (< value 65536) 126 127)))
+ (n2 uint (pcase n1 (127 64) (126 16) (_ 0))
+ :pack-val value)
+ :unpack-val (if (< n1 126) n1 n2)))
+
+(ert-deftest bindat-test--pack-val ()
+ ;; This is intended to test the :(un)pack-val feature that offers
+ ;; control over the unpacked representation of the data.
+ (dolist (n '(0 42 125 126 127 128 150 255 5000 65535 65536 8769786876))
+ (should
+ (equal (bindat-unpack bindat-test--int-websocket-type
+ (bindat-pack bindat-test--int-websocket-type n))
+ n))))
+
+(ert-deftest bindat-test--sint ()
+ (dotimes (kind 32)
+ (let ((bitlen (* 8 (/ kind 2)))
+ (r (zerop (% kind 2))))
+ (dotimes (_ 100)
+ (let* ((n (random (ash 1 bitlen)))
+ (i (- n (ash 1 (1- bitlen)))))
+ (should (equal (bindat-unpack
+ (bindat-type sint bitlen r)
+ (bindat-pack (bindat-type sint bitlen r) i))
+ i))
+ (when (>= i 0)
+ (should (equal (bindat-pack
+ (bindat-type if r (uintr bitlen) (uint bitlen)) i)
+ (bindat-pack (bindat-type sint bitlen r) i)))
+ (should (equal (bindat-unpack
+ (bindat-type if r (uintr bitlen) (uint bitlen))
+ (bindat-pack (bindat-type sint bitlen r) i))
+ i))))))))
+
+(defconst bindat-test--LEB128
+ (bindat-type
+ letrec ((loop
+ (struct :pack-var n
+ (head u8
+ :pack-val (+ (logand n 127) (if (> n 127) 128 0)))
+ (tail if (< head 128) (unit 0) loop
+ :pack-val (ash n -7))
+ :unpack-val (+ (logand head 127) (ash tail 7)))))
+ loop))
+
+(ert-deftest bindat-test--recursive ()
+ (dotimes (n 10)
+ (let ((max (ash 1 (* n 10))))
+ (dotimes (_ 10)
+ (let ((n (random max)))
+ (should (equal (bindat-unpack bindat-test--LEB128
+ (bindat-pack bindat-test--LEB128 n))
+ n)))))))
+
;;; bindat-tests.el ends here
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el b/test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el
new file mode 100644
index 00000000000..6997d91b26a
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/bc-test-alpha.el
@@ -0,0 +1,9 @@
+;;; -*- lexical-binding: t -*-
+
+(require 'bc-test-beta)
+
+(defun bc-test-alpha-f (x)
+ (let ((y nil))
+ (list y (bc-test-beta-f x))))
+
+(provide 'bc-test-alpha)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el b/test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el
new file mode 100644
index 00000000000..9205a13d7d5
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/bc-test-beta.el
@@ -0,0 +1,6 @@
+;;; -*- lexical-binding: t -*-
+
+(defsubst bc-test-beta-f (y)
+ y)
+
+(provide 'bc-test-beta)
diff --git a/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el b/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el
new file mode 100644
index 00000000000..3a29128cf3a
--- /dev/null
+++ b/test/lisp/emacs-lisp/bytecomp-resources/warn-callargs-defsubst.el
@@ -0,0 +1,5 @@
+;;; -*- lexical-binding: t -*-
+(defsubst warn-callargs-defsubst-f1 (_x)
+ nil)
+(defun warn-callargs-defsubst-f2 ()
+ (warn-callargs-defsubst-f1 1 2))
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index bc623d3efca..80003c264a2 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -41,7 +41,7 @@
"Identity, but hidden from some optimisations."
x)
-(defconst byte-opt-testsuite-arith-data
+(defconst bytecomp-tests--test-cases
'(
;; some functional tests
(let ((a most-positive-fixnum) (b 1) (c 1.0)) (+ a b c))
@@ -364,17 +364,17 @@
'((a c) (b c) (7 c) (-3 c) (nil nil) (t c) (q c) (r c) (s c)
(t c) (x "a") (x "c") (x c) (x d) (x e)))
- (mapcar (lambda (x) (cond ((member '(a . b) x) 1)
- ((equal x '(c)) 2)))
+ (mapcar (lambda (x) (ignore-errors (cond ((member '(a . b) x) 1)
+ ((equal x '(c)) 2))))
'(((a . b)) a b (c) (d)))
- (mapcar (lambda (x) (cond ((memq '(a . b) x) 1)
- ((equal x '(c)) 2)))
+ (mapcar (lambda (x) (ignore-errors (cond ((memq '(a . b) x) 1)
+ ((equal x '(c)) 2))))
'(((a . b)) a b (c) (d)))
- (mapcar (lambda (x) (cond ((member '(a b) x) 1)
- ((equal x '(c)) 2)))
+ (mapcar (lambda (x) (ignore-errors (cond ((member '(a b) x) 1)
+ ((equal x '(c)) 2))))
'(((a b)) a b (c) (d)))
- (mapcar (lambda (x) (cond ((memq '(a b) x) 1)
- ((equal x '(c)) 2)))
+ (mapcar (lambda (x) (ignore-errors (cond ((memq '(a b) x) 1)
+ ((equal x '(c)) 2))))
'(((a b)) a b (c) (d)))
(assoc 'b '((a 1) (b 2) (c 3)))
@@ -396,7 +396,7 @@
x)
(let ((x 1) (bytecomp-test-var 2) (y 3))
- (list x bytecomp-test-var (bytecomp-get-test-var) y))
+ (list x bytecomp-test-var (bytecomp-test-get-var) y))
(progn
(defvar d)
@@ -430,71 +430,162 @@
(list s x i))
(let ((x 2))
- (list (or (bytecomp-identity 'a) (setq x 3)) x)))
- "List of expression for test.
-Each element will be executed by interpreter and with
-bytecompiled code, and their results compared.")
+ (list (or (bytecomp-test-identity 'a) (setq x 3)) x))
+
+ (mapcar (lambda (b)
+ (let ((a nil))
+ (+ 0
+ (progn
+ (setq a b)
+ (setq b 1)
+ a))))
+ '(10))
+
+ (let* ((x 1)
+ (y (condition-case x
+ (/ 1 0)
+ (arith-error x))))
+ (list x y))
-(defun bytecomp-check-1 (pat)
- "Return non-nil if PAT is the same whether directly evalled or compiled."
- (let ((warning-minimum-log-level :emergency)
- (byte-compile-warnings nil)
- (v0 (condition-case err
- (eval pat)
- (error (list 'bytecomp-check-error (car err)))))
- (v1 (condition-case err
- (funcall (byte-compile (list 'lambda nil pat)))
- (error (list 'bytecomp-check-error (car err))))))
- (equal v0 v1)))
-
-(put 'bytecomp-check-1 'ert-explainer 'bytecomp-explain-1)
-
-(defun bytecomp-explain-1 (pat)
- (let ((v0 (condition-case err
- (eval pat)
- (error (list 'bytecomp-check-error (car err)))))
- (v1 (condition-case err
- (funcall (byte-compile (list 'lambda nil pat)))
- (error (list 'bytecomp-check-error (car err))))))
- (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
- pat v0 v1)))
-
-(ert-deftest bytecomp-tests ()
- "Test the Emacs byte compiler."
- (dolist (pat byte-opt-testsuite-arith-data)
- (should (bytecomp-check-1 pat))))
-
-(defun test-byte-opt-arithmetic (&optional arg)
- "Unit test for byte-opt arithmetic operations.
-Subtests signal errors if something goes wrong."
- (interactive "P")
- (switch-to-buffer (generate-new-buffer "*Font Pase Test*"))
+ (funcall
+ (condition-case x
+ (/ 1 0)
+ (arith-error (prog1 (lambda (y) (+ y x))
+ (setq x 10))))
+ 4)
+
+ ;; No error, no success handler.
+ (condition-case x
+ (list 42)
+ (error (cons 'bad x)))
+ ;; Error, no success handler.
+ (condition-case x
+ (/ 1 0)
+ (error (cons 'bad x)))
+ ;; No error, success handler.
+ (condition-case x
+ (list 42)
+ (error (cons 'bad x))
+ (:success (cons 'good x)))
+ ;; Error, success handler.
+ (condition-case x
+ (/ 1 0)
+ (error (cons 'bad x))
+ (:success (cons 'good x)))
+ ;; Verify that the success code is not subject to the error handlers.
+ (condition-case x
+ (list 42)
+ (error (cons 'bad x))
+ (:success (/ (car x) 0)))
+ ;; Check variable scoping on success.
+ (let ((x 2))
+ (condition-case x
+ (list x)
+ (error (list 'bad x))
+ (:success (list 'good x))))
+ ;; Check variable scoping on failure.
+ (let ((x 2))
+ (condition-case x
+ (/ 1 0)
+ (error (list 'bad x))
+ (:success (list 'good x))))
+ ;; Check capture of mutated result variable.
+ (funcall
+ (condition-case x
+ 3
+ (:success (prog1 (lambda (y) (+ y x))
+ (setq x 10))))
+ 4)
+ ;; Check for-effect context, on error.
+ (let ((f (lambda (x)
+ (condition-case nil
+ (/ 1 0)
+ (error 'bad)
+ (:success 'good))
+ (1+ x))))
+ (funcall f 3))
+ ;; Check for-effect context, on success.
+ (let ((f (lambda (x)
+ (condition-case nil
+ nil
+ (error 'bad)
+ (:success 'good))
+ (1+ x))))
+ (funcall f 3))
+
+ ;; Check `not' in cond switch (bug#49746).
+ (mapcar (lambda (x) (cond ((equal x "a") 1)
+ ((member x '("b" "c")) 2)
+ ((not x) 3)))
+ '("a" "b" "c" "d" nil))
+
+ ;; `let' and `let*' optimisations with body being constant or variable
+ (let* (a
+ (b (progn (setq a (cons 1 a)) 2))
+ (c (1+ b))
+ (d (list a c)))
+ d)
+ (let ((a nil))
+ (let ((b (progn (setq a (cons 1 a)) 2))
+ (c (progn (setq a (cons 3 a))))
+ (d (list a)))
+ d))
+ (let* ((_a 1)
+ (_b 2))
+ 'z)
+ (let ((_a 1)
+ (_b 2))
+ 'z)
+ )
+ "List of expressions for cross-testing interpreted and compiled code.")
+
+(defconst bytecomp-tests--test-cases-lexbind-only
+ `(
+ ;; This would infloop (and exhaust stack) with dynamic binding.
+ (let ((f #'car))
+ (let ((f (lambda (x) (cons (funcall f x) (cdr x)))))
+ (funcall f '(1 . 2))))
+ )
+ "List of expressions for cross-testing interpreted and compiled code.
+These are only tested with lexical binding.")
+
+(defun bytecomp-tests--eval-interpreted (form)
+ "Evaluate FORM using the Lisp interpreter, returning errors as a
+special value."
+ (condition-case err
+ (eval form lexical-binding)
+ (error (list 'bytecomp-check-error (car err)))))
+
+(defun bytecomp-tests--eval-compiled (form)
+ "Evaluate FORM using the Lisp byte-code compiler, returning errors as a
+special value."
(let ((warning-minimum-log-level :emergency)
- (byte-compile-warnings nil)
- (pass-face '((t :foreground "green")))
- (fail-face '((t :foreground "red")))
- (print-escape-nonascii t)
- (print-escape-newlines t)
- (print-quoted t)
- v0 v1)
- (dolist (pat byte-opt-testsuite-arith-data)
- (condition-case err
- (setq v0 (eval pat))
- (error (setq v0 (list 'bytecomp-check-error (car err)))))
- (condition-case err
- (setq v1 (funcall (byte-compile (list 'lambda nil pat))))
- (error (setq v1 (list 'bytecomp-check-error (car err)))))
- (insert (format "%s" pat))
- (indent-to-column 65)
- (if (equal v0 v1)
- (insert (propertize "OK" 'face pass-face))
- (insert (propertize "FAIL\n" 'face fail-face))
- (indent-to-column 55)
- (insert (propertize (format "[%s] vs [%s]" v0 v1)
- 'face fail-face)))
- (insert "\n"))))
+ (byte-compile-warnings nil))
+ (condition-case err
+ (funcall (byte-compile (list 'lambda nil form)))
+ (error (list 'bytecomp-check-error (car err))))))
+
+(ert-deftest bytecomp-tests-lexbind ()
+ "Check that various expressions behave the same when interpreted and
+byte-compiled. Run with lexical binding."
+ (let ((lexical-binding t))
+ (dolist (form (append bytecomp-tests--test-cases-lexbind-only
+ bytecomp-tests--test-cases))
+ (ert-info ((prin1-to-string form) :prefix "form: ")
+ (should (equal (bytecomp-tests--eval-interpreted form)
+ (bytecomp-tests--eval-compiled form)))))))
+
+(ert-deftest bytecomp-tests-dynbind ()
+ "Check that various expressions behave the same when interpreted and
+byte-compiled. Run with dynamic binding."
+ (let ((lexical-binding nil))
+ (dolist (form bytecomp-tests--test-cases)
+ (ert-info ((prin1-to-string form) :prefix "form: ")
+ (should (equal (bytecomp-tests--eval-interpreted form)
+ (bytecomp-tests--eval-compiled form)))))))
(defun test-byte-comp-compile-and-load (compile &rest forms)
+ (declare (indent 1))
(let ((elfile nil)
(elcfile nil))
(unwind-protect
@@ -513,7 +604,6 @@ Subtests signal errors if something goes wrong."
(load elfile nil 'nomessage))
(when elfile (delete-file elfile))
(when elcfile (delete-file elcfile)))))
-(put 'test-byte-comp-compile-and-load 'lisp-indent-function 1)
(ert-deftest test-byte-comp-macro-expansion ()
(test-byte-comp-compile-and-load t
@@ -584,8 +674,8 @@ Subtests signal errors if something goes wrong."
`(with-current-buffer (get-buffer-create "*Compile-Log*")
(let ((inhibit-read-only t)) (erase-buffer))
(byte-compile ,@form)
- (ert-info ((buffer-string) :prefix "buffer: ")
- (should (re-search-forward ,re-warning)))))
+ (ert-info ((prin1-to-string (buffer-string)) :prefix "buffer: ")
+ (should (re-search-forward ,(string-replace " " "[ \n]+" re-warning))))))
(ert-deftest bytecomp-warn-wrong-args ()
(bytecomp--with-warning-test "remq.*3.*2"
@@ -611,12 +701,13 @@ Subtests signal errors if something goes wrong."
(defmacro bytecomp--define-warning-file-test (file re-warning &optional reverse)
`(ert-deftest ,(intern (format "bytecomp/%s" file)) ()
- :expected-result ,(if reverse :failed :passed)
(with-current-buffer (get-buffer-create "*Compile-Log*")
(let ((inhibit-read-only t)) (erase-buffer))
(byte-compile-file ,(ert-resource-file file))
(ert-info ((buffer-string) :prefix "buffer: ")
- (should (re-search-forward ,re-warning))))))
+ (,(if reverse 'should-not 'should)
+ (re-search-forward ,(string-replace " " "[ \n]+" re-warning)
+ nil t))))))
(bytecomp--define-warning-file-test "error-lexical-var-with-add-hook.el"
"add-hook.*lexical var")
@@ -642,6 +733,9 @@ Subtests signal errors if something goes wrong."
(bytecomp--define-warning-file-test "warn-callargs.el"
"with 2 arguments, but accepts only 1")
+(bytecomp--define-warning-file-test "warn-callargs-defsubst.el"
+ "with 2 arguments, but accepts only 1")
+
(bytecomp--define-warning-file-test "warn-defcustom-nogroup.el"
"fails to specify containing group")
@@ -658,10 +752,10 @@ Subtests signal errors if something goes wrong."
"free.*foo")
(bytecomp--define-warning-file-test "warn-free-variable-reference.el"
- "free.*bar")
+ "free variable .bar")
(bytecomp--define-warning-file-test "warn-make-variable-buffer-local.el"
- "make-variable-buffer-local.*not called at toplevel")
+ "make-variable-buffer-local. not called at toplevel")
(bytecomp--define-warning-file-test "warn-interactive-only.el"
"next-line.*interactive use only.*forward-line")
@@ -670,19 +764,19 @@ Subtests signal errors if something goes wrong."
"malformed interactive spec")
(bytecomp--define-warning-file-test "warn-obsolete-defun.el"
- "foo-obsolete.*obsolete function.*99.99")
+ "foo-obsolete. is an obsolete function (as of 99.99)")
(defvar bytecomp--tests-obsolete-var nil)
(make-obsolete-variable 'bytecomp--tests-obsolete-var nil "99.99")
(bytecomp--define-warning-file-test "warn-obsolete-hook.el"
- "bytecomp--tests-obs.*obsolete[^z-a]*99.99")
+ "bytecomp--tests-obsolete-var. is an obsolete variable (as of 99.99)")
(bytecomp--define-warning-file-test "warn-obsolete-variable-same-file.el"
"foo-obs.*obsolete.*99.99" t)
(bytecomp--define-warning-file-test "warn-obsolete-variable.el"
- "bytecomp--tests-obs.*obsolete[^z-a]*99.99")
+ "bytecomp--tests-obsolete-var. is an obsolete variable (as of 99.99)")
(bytecomp--define-warning-file-test "warn-obsolete-variable-bound.el"
"bytecomp--tests-obs.*obsolete.*99.99" t)
@@ -713,64 +807,64 @@ Subtests signal errors if something goes wrong."
(bytecomp--define-warning-file-test
"warn-wide-docstring-autoload.el"
- "autoload.*foox.*wider than.*characters")
+ "autoload .foox. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-custom-declare-variable.el"
- "custom-declare-variable.*foo.*wider than.*characters")
+ "custom-declare-variable .foo. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-defalias.el"
- "defalias.*foo.*wider than.*characters")
+ "defalias .foo. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-defconst.el"
- "defconst.*foo.*wider than.*characters")
+ "defconst .foo-bar. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-define-abbrev-table.el"
- "define-abbrev.*foo.*wider than.*characters")
+ "define-abbrev-table .foo. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-define-obsolete-function-alias.el"
- "defalias.*foo.*wider than.*characters")
+ "defalias .foo. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-define-obsolete-variable-alias.el"
- "defvaralias.*foo.*wider than.*characters")
+ "defvaralias .foo. docstring wider than .* characters")
;; TODO: We don't yet issue warnings for defuns.
(bytecomp--define-warning-file-test
"warn-wide-docstring-defun.el"
- "wider than.*characters" 'reverse)
+ "wider than .* characters" 'reverse)
(bytecomp--define-warning-file-test
"warn-wide-docstring-defvar.el"
- "defvar.*foo.*wider than.*characters")
+ "defvar .foo-bar. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-defvaralias.el"
- "defvaralias.*foo.*wider than.*characters")
+ "defvaralias .foo-bar. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-ignore-fill-column.el"
- "defvar.*foo.*wider than.*characters" 'reverse)
+ "defvar .foo-bar. docstring wider than .* characters" 'reverse)
(bytecomp--define-warning-file-test
"warn-wide-docstring-ignore-override.el"
- "defvar.*foo.*wider than.*characters" 'reverse)
+ "defvar .foo-bar. docstring wider than .* characters" 'reverse)
(bytecomp--define-warning-file-test
"warn-wide-docstring-ignore.el"
- "defvar.*foo.*wider than.*characters" 'reverse)
+ "defvar .foo-bar. docstring wider than .* characters" 'reverse)
(bytecomp--define-warning-file-test
"warn-wide-docstring-multiline-first.el"
- "defvar.*foo.*wider than.*characters")
+ "defvar .foo-bar. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"warn-wide-docstring-multiline.el"
- "defvar.*foo.*wider than.*characters")
+ "defvar .foo-bar. docstring wider than .* characters")
(bytecomp--define-warning-file-test
"nowarn-inline-after-defvar.el"
@@ -813,47 +907,6 @@ Subtests signal errors if something goes wrong."
(defun def () (m))))
(should (equal (funcall 'def) 4)))
-(defconst bytecomp-lexbind-tests
- `(
- (let ((f #'car))
- (let ((f (lambda (x) (cons (funcall f x) (cdr x)))))
- (funcall f '(1 . 2))))
- )
- "List of expression for test.
-Each element will be executed by interpreter and with
-bytecompiled code, and their results compared.")
-
-(defun bytecomp-lexbind-check-1 (pat)
- "Return non-nil if PAT is the same whether directly evalled or compiled."
- (let ((warning-minimum-log-level :emergency)
- (byte-compile-warnings nil)
- (v0 (condition-case err
- (eval pat t)
- (error (list 'bytecomp-check-error (car err)))))
- (v1 (condition-case err
- (funcall (let ((lexical-binding t))
- (byte-compile `(lambda nil ,pat))))
- (error (list 'bytecomp-check-error (car err))))))
- (equal v0 v1)))
-
-(put 'bytecomp-lexbind-check-1 'ert-explainer 'bytecomp-lexbind-explain-1)
-
-(defun bytecomp-lexbind-explain-1 (pat)
- (let ((v0 (condition-case err
- (eval pat t)
- (error (list 'bytecomp-check-error (car err)))))
- (v1 (condition-case err
- (funcall (let ((lexical-binding t))
- (byte-compile (list 'lambda nil pat))))
- (error (list 'bytecomp-check-error (car err))))))
- (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
- pat v0 v1)))
-
-(ert-deftest bytecomp-lexbind-tests ()
- "Test the Emacs byte compiler lexbind handling."
- (dolist (pat bytecomp-lexbind-tests)
- (should (bytecomp-lexbind-check-1 pat))))
-
(defmacro bytecomp-tests--with-temp-file (file-name-var &rest body)
(declare (indent 1))
(cl-check-type file-name-var symbol)
@@ -1168,6 +1221,151 @@ mountpoint (Bug#44631)."
(with-demoted-errors "Error cleaning up directory: %s"
(delete-directory directory :recursive)))))
+(defun bytecomp-tests--get-vars ()
+ (list (ignore-errors (symbol-value 'bytecomp-tests--var1))
+ (ignore-errors (symbol-value 'bytecomp-tests--var2))))
+
+(ert-deftest bytecomp-local-defvar ()
+ "Check that local `defvar' declarations work correctly, both
+interpreted and compiled."
+ (let ((lexical-binding t))
+ (let ((fun '(lambda ()
+ (defvar bytecomp-tests--var1)
+ (let ((bytecomp-tests--var1 'a) ; dynamic
+ (bytecomp-tests--var2 'b)) ; still lexical
+ (ignore bytecomp-tests--var2) ; avoid warning
+ (bytecomp-tests--get-vars)))))
+ (should (listp fun)) ; Guard against overzealous refactoring!
+ (should (equal (funcall (eval fun t)) '(a nil)))
+ (should (equal (funcall (byte-compile fun)) '(a nil)))
+ )
+
+ ;; `progn' does not constitute a lexical scope for `defvar' (bug#46387).
+ (let ((fun '(lambda ()
+ (progn
+ (defvar bytecomp-tests--var1)
+ (defvar bytecomp-tests--var2))
+ (let ((bytecomp-tests--var1 'c)
+ (bytecomp-tests--var2 'd))
+ (bytecomp-tests--get-vars)))))
+ (should (listp fun))
+ (should (equal (funcall (eval fun t)) '(c d)))
+ (should (equal (funcall (byte-compile fun)) '(c d))))))
+
+(ert-deftest bytecomp-reify-function ()
+ "Check that closures that modify their bound variables are
+compiled correctly."
+ (cl-letf ((lexical-binding t)
+ ((symbol-function 'counter) nil))
+ (let ((x 0))
+ (defun counter () (cl-incf x))
+ (should (equal (counter) 1))
+ (should (equal (counter) 2))
+ ;; byte compiling should not cause counter to always return the
+ ;; same value (bug#46834)
+ (byte-compile 'counter)
+ (should (equal (counter) 3))
+ (should (equal (counter) 4)))
+ (let ((x 0))
+ (let ((x 1))
+ (defun counter () x)
+ (should (equal (counter) 1))
+ ;; byte compiling should not cause the outer binding to shadow
+ ;; the inner one (bug#46834)
+ (byte-compile 'counter)
+ (should (equal (counter) 1))))))
+
+(ert-deftest bytecomp-string-vs-docstring ()
+ ;; Don't confuse a string return value for a docstring.
+ (let ((lexical-binding t))
+ (should (equal (funcall (byte-compile '(lambda (x) "foo")) 'dummy) "foo"))))
+
+(ert-deftest bytecomp-condition-case-success ()
+ ;; No error, no success handler.
+ (should (equal (condition-case x
+ (list 42)
+ (error (cons 'bad x)))
+ '(42)))
+ ;; Error, no success handler.
+ (should (equal (condition-case x
+ (/ 1 0)
+ (error (cons 'bad x)))
+ '(bad arith-error)))
+ ;; No error, success handler.
+ (should (equal (condition-case x
+ (list 42)
+ (error (cons 'bad x))
+ (:success (cons 'good x)))
+ '(good 42)))
+ ;; Error, success handler.
+ (should (equal (condition-case x
+ (/ 1 0)
+ (error (cons 'bad x))
+ (:success (cons 'good x)))
+ '(bad arith-error)))
+ ;; Verify that the success code is not subject to the error handlers.
+ (should-error (condition-case x
+ (list 42)
+ (error (cons 'bad x))
+ (:success (/ (car x) 0)))
+ :type 'arith-error)
+ ;; Check variable scoping.
+ (let ((x 2))
+ (should (equal (condition-case x
+ (list x)
+ (error (list 'bad x))
+ (:success (list 'good x)))
+ '(good (2))))
+ (should (equal (condition-case x
+ (/ 1 0)
+ (error (list 'bad x))
+ (:success (list 'good x)))
+ '(bad (arith-error)))))
+ ;; Check capture of mutated result variable.
+ (should (equal (funcall
+ (condition-case x
+ 3
+ (:success (prog1 (lambda (y) (+ y x))
+ (setq x 10))))
+ 4)
+ 14))
+ ;; Check for-effect context, on error.
+ (should (equal (let ((f (lambda (x)
+ (condition-case nil
+ (/ 1 0)
+ (error 'bad)
+ (:success 'good))
+ (1+ x))))
+ (funcall f 3))
+ 4))
+ ;; Check for-effect context, on success.
+ (should (equal (let ((f (lambda (x)
+ (condition-case nil
+ nil
+ (error 'bad)
+ (:success 'good))
+ (1+ x))))
+ (funcall f 3))
+ 4)))
+
+(declare-function bc-test-alpha-f (ert-resource-file "bc-test-alpha.el"))
+
+(ert-deftest bytecomp-defsubst ()
+ ;; Check that lexical variables don't leak into inlined code. See
+ ;; https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg01227.html
+
+ ;; First, remove any trace of the functions and package defined:
+ (fmakunbound 'bc-test-alpha-f)
+ (fmakunbound 'bc-test-beta-f)
+ (setq features (delq 'bc-test-beta features))
+ ;; Byte-compile one file that uses a function from another file that isn't
+ ;; compiled.
+ (let ((file (ert-resource-file "bc-test-alpha.el"))
+ (load-path (cons (ert-resource-directory) load-path)))
+ (byte-compile-file file)
+ (load-file (concat file "c"))
+ (should (equal (bc-test-alpha-f 'a) '(nil a)))))
+
;; Local Variables:
;; no-byte-compile: t
;; End:
diff --git a/test/lisp/emacs-lisp/cconv-tests.el b/test/lisp/emacs-lisp/cconv-tests.el
index 517373386e3..5aeed0cc155 100644
--- a/test/lisp/emacs-lisp/cconv-tests.el
+++ b/test/lisp/emacs-lisp/cconv-tests.el
@@ -182,7 +182,14 @@
(should (eq (cconv-tests-cl-defsubst) 'cl-defsubst-result)))
(ert-deftest cconv-convert-lambda-lifted ()
- "Bug#30872."
+ ;; Verify that lambda-lifting is actually performed at all.
+ (should (equal (cconv-closure-convert
+ '#'(lambda (x) (let ((f #'(lambda () (+ x 1))))
+ (funcall f))))
+ '#'(lambda (x) (let ((f #'(lambda (x) (+ x 1))))
+ (funcall f x)))))
+
+ ;; Bug#30872.
(should
(equal (funcall
(byte-compile
diff --git a/test/lisp/emacs-lisp/check-declare-tests.el b/test/lisp/emacs-lisp/check-declare-tests.el
index 9552bf0e397..276530fb4d3 100644
--- a/test/lisp/emacs-lisp/check-declare-tests.el
+++ b/test/lisp/emacs-lisp/check-declare-tests.el
@@ -106,11 +106,11 @@
(let ((res (buffer-string)))
;; Don't care too much about the format of the output, but
;; check that key information is present.
- (should (string-match-p "foo-file" res))
- (should (string-match-p "foo-fun" res))
- (should (string-match-p "bar-file" res))
- (should (string-match-p "it wasn't" res))
- (should (string-match-p "999" res))))))
+ (should (string-search "foo-file" res))
+ (should (string-search "foo-fun" res))
+ (should (string-search "bar-file" res))
+ (should (string-search "it wasn't" res))
+ (should (string-search "999" res))))))
(provide 'check-declare-tests)
;;; check-declare-tests.el ends here
diff --git a/test/lisp/emacs-lisp/checkdoc-tests.el b/test/lisp/emacs-lisp/checkdoc-tests.el
index cf7baf4ce44..2a1d8b27636 100644
--- a/test/lisp/emacs-lisp/checkdoc-tests.el
+++ b/test/lisp/emacs-lisp/checkdoc-tests.el
@@ -49,52 +49,34 @@
(with-temp-buffer
(emacs-lisp-mode)
;; this method matches if A is the symbol `smthg' and if b is a list:
- (insert "(cl-defmethod foo ((a (eql smthg)) (b list)) \"Return A+B.\")")
+ (insert "(cl-defmethod foo ((a (eql 'smthg)) (b list)) \"Return A+B.\")")
(checkdoc-defun)))
-(ert-deftest checkdoc-cl-defun-with-key-ok ()
- "Checkdoc should be happy with a cl-defun using &key."
+(ert-deftest checkdoc-cl-defmethod-qualified-ok ()
+ "Checkdoc should be happy with a `cl-defmethod' using qualifiers."
(with-temp-buffer
(emacs-lisp-mode)
- (insert "(cl-defun foo (&key a (b 27)) \"Return :A+:B.\")")
+ (insert "(cl-defmethod test :around ((a (eql 'smthg))) \"Return A.\")")
(checkdoc-defun)))
-(ert-deftest checkdoc-cl-defun-with-allow-other-keys-ok ()
- "Checkdoc should be happy with a cl-defun using &allow-other-keys."
+(ert-deftest checkdoc-cl-defmethod-with-extra-qualifier-ok ()
+ "Checkdoc should be happy with a :extra qualified `cl-defmethod'."
(with-temp-buffer
(emacs-lisp-mode)
- (insert "(cl-defun foo (&key a &allow-other-keys) \"Return :A.\")")
- (checkdoc-defun)))
+ (insert "(cl-defmethod foo :extra \"foo\" ((a (eql 'smthg))) \"Return A.\")")
+ (checkdoc-defun))
-(ert-deftest checkdoc-cl-defun-with-default-optional-value-ok ()
- "Checkdoc should be happy with a cl-defun using default values for optional args."
(with-temp-buffer
(emacs-lisp-mode)
- ;; B is optional and equals 1+a if not provided. HAS-BS is non-nil
- ;; if B was provided in the call:
- (insert "(cl-defun foo (a &optional (b (1+ a) has-bs)) \"Return A + B.\")")
+ (insert
+ "(cl-defmethod foo :extra \"foo\" :after ((a (eql 'smthg))) \"Return A.\")")
(checkdoc-defun)))
-(ert-deftest checkdoc-cl-defun-with-destructuring-ok ()
- "Checkdoc should be happy with a cl-defun destructuring its arguments."
+(ert-deftest checkdoc-cl-defmethod-with-extra-qualifier-and-nil-args-ok ()
+ "Checkdoc should be happy with a 0-arity :extra qualified `cl-defmethod'."
(with-temp-buffer
(emacs-lisp-mode)
- (insert "(cl-defun foo ((a b &optional c) d) \"Return A+B+C+D.\")")
- (checkdoc-defun)))
-
-(ert-deftest checkdoc-cl-defmethod-ok ()
- "Checkdoc should be happy with a simple correct cl-defmethod."
- (with-temp-buffer
- (emacs-lisp-mode)
- (insert "(cl-defmethod foo (a) \"Return A.\")")
- (checkdoc-defun)))
-
-(ert-deftest checkdoc-cl-defmethod-with-types-ok ()
- "Checkdoc should be happy with a cl-defmethod using types."
- (with-temp-buffer
- (emacs-lisp-mode)
- ;; this method matches if A is the symbol `smthg' and if b is a list:
- (insert "(cl-defmethod foo ((a (eql smthg)) (b list)) \"Return A+B.\")")
+ (insert "(cl-defmethod foo :extra \"foo\" () \"Return A.\")")
(checkdoc-defun)))
(ert-deftest checkdoc-cl-defun-with-key-ok ()
diff --git a/test/lisp/emacs-lisp/cl-extra-tests.el b/test/lisp/emacs-lisp/cl-extra-tests.el
index f3c308725ac..91f0a1e2014 100644
--- a/test/lisp/emacs-lisp/cl-extra-tests.el
+++ b/test/lisp/emacs-lisp/cl-extra-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Code:
diff --git a/test/lisp/emacs-lisp/cl-generic-tests.el b/test/lisp/emacs-lisp/cl-generic-tests.el
index 4a01623cb88..dd7511e9afe 100644
--- a/test/lisp/emacs-lisp/cl-generic-tests.el
+++ b/test/lisp/emacs-lisp/cl-generic-tests.el
@@ -56,7 +56,14 @@
(should (equal (cl--generic-1 'a nil) '(a)))
(should (equal (cl--generic-1 4 nil) '("quatre" 4)))
(should (equal (cl--generic-1 5 nil) '("cinq" 5)))
- (should (equal (cl--generic-1 6 nil) '("six" a))))
+ (should (equal (cl--generic-1 6 nil) '("six" a)))
+ (defvar cl--generic-fooval 41)
+ (cl-defmethod cl--generic-1 ((_x (eql (+ cl--generic-fooval 1))) _y)
+ "forty-two")
+ (cl-defmethod cl--generic-1 (_x (_y (eql 42)))
+ "FORTY-TWO")
+ (should (equal (cl--generic-1 42 nil) "forty-two"))
+ (should (equal (cl--generic-1 nil 42) "FORTY-TWO")))
(cl-defstruct cl-generic-struct-parent a b)
(cl-defstruct (cl-generic-struct-child1 (:include cl-generic-struct-parent)) c)
@@ -269,9 +276,7 @@ Edebug symbols (Bug#42672)."
(when (memq name instrumented-names)
(error "Duplicate definition of `%s'" name))
(push name instrumented-names)
- (edebug-new-definition name)))
- ;; Make generated symbols reproducible.
- (gensym-counter 10000))
+ (edebug-new-definition name))))
(eval-buffer)
(should (equal
(reverse instrumented-names)
@@ -280,11 +285,11 @@ Edebug symbols (Bug#42672)."
;; FIXME: We'd rather have names such as
;; `cl-defgeneric/edebug/method/1 ((_ number))', but
;; that requires further changes to Edebug.
- (list (intern "cl-generic-:method@10000 ((_ number))")
- (intern "cl-generic-:method@10001 ((_ string))")
- (intern "cl-generic-:method@10002 :around ((_ number))")
+ (list (intern "cl-defgeneric/edebug/method/1 (number)")
+ (intern "cl-defgeneric/edebug/method/1 (string)")
+ (intern "cl-defgeneric/edebug/method/1 :around (number)")
'cl-defgeneric/edebug/method/1
- (intern "cl-generic-:method@10003 ((_ number))")
+ (intern "cl-defgeneric/edebug/method/2 (number)")
'cl-defgeneric/edebug/method/2))))))
(provide 'cl-generic-tests)
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el
index 065ca4fa651..a5ec62b9c42 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index bcd63f73a3c..f4e2e46a019 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@@ -617,11 +617,37 @@ collection clause."
(cl-labels ((len (xs) (if xs (1+ (len (cdr xs))) 0)))
(should (equal (len (make-list 42 t)) 42)))
- ;; Simple tail-recursive function.
- (cl-labels ((len (xs n) (if xs (len (cdr xs) (1+ n)) n)))
- (should (equal (len (make-list 42 t) 0) 42))
- ;; Should not bump into stack depth limits.
- (should (equal (len (make-list 42000 t) 0) 42000)))
+ (let ((list-42 (make-list 42 t))
+ (list-42k (make-list 42000 t)))
+
+ (cl-labels
+ ;; Simple tail-recursive function.
+ ((len (xs n) (if xs (len (cdr xs) (1+ n)) n))
+ ;; Slightly obfuscated version to exercise tail calls from
+ ;; `let', `progn', `and' and `or'.
+ (len2 (xs n) (or (and (not xs) n)
+ (let (n1)
+ (and xs
+ (progn (setq n1 (1+ n))
+ (len2 (cdr xs) n1))))))
+ ;; Tail calls in error and success handlers.
+ (len3 (xs n)
+ (if xs
+ (condition-case k
+ (/ 1 (logand n 1))
+ (arith-error (len3 (cdr xs) (1+ n)))
+ (:success (len3 (cdr xs) (+ n k))))
+ n)))
+ (should (equal (len nil 0) 0))
+ (should (equal (len2 nil 0) 0))
+ (should (equal (len3 nil 0) 0))
+ (should (equal (len list-42 0) 42))
+ (should (equal (len2 list-42 0) 42))
+ (should (equal (len3 list-42 0) 42))
+ ;; Should not bump into stack depth limits.
+ (should (equal (len list-42k 0) 42000))
+ (should (equal (len2 list-42k 0) 42000))
+ (should (equal (len3 list-42k 0) 42000))))
;; Check that non-recursive functions are handled more efficiently.
(should (pcase (macroexpand '(cl-labels ((f (x) (+ x 1))) (f 5)))
@@ -633,4 +659,9 @@ collection clause."
#'len))
(`(function (lambda (,_ ,_) . ,_)) t))))
+(ert-deftest cl-macs--progv ()
+ (should (= (cl-progv '(test test) '(1 2) test) 2))
+ (should (equal (cl-progv '(test1 test2) '(1 2) (list test1 test2))
+ '(1 2))))
+
;;; cl-macs-tests.el ends here
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el b/test/lisp/emacs-lisp/comp-cstr-tests.el
new file mode 100644
index 00000000000..59e1b6982e1
--- /dev/null
+++ b/test/lisp/emacs-lisp/comp-cstr-tests.el
@@ -0,0 +1,233 @@
+;;; comp-cstr-tests.el --- unit tests for src/comp.c -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+;; Author: Andrea Corallo <akrl@sdf.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Unit tests for lisp/emacs-lisp/comp-cstr.el
+
+;;; Code:
+
+(require 'ert)
+(require 'cl-lib)
+(require 'comp-cstr)
+
+(cl-eval-when (compile eval load)
+
+ (defun comp-cstr-test-ts (type-spec)
+ "Create a constraint from TYPE-SPEC and convert it back to type specifier."
+ (let ((comp-ctxt (make-comp-cstr-ctxt)))
+ (comp-cstr-to-type-spec (comp-type-spec-to-cstr type-spec))))
+
+ (defun comp-cstr-typespec-test (number type-spec expected-type-spec)
+ `(ert-deftest ,(intern (concat "comp-cstr-test-" (int-to-string number))) ()
+ (should (equal (comp-cstr-test-ts ',type-spec)
+ ',expected-type-spec))))
+
+ (defconst comp-cstr-typespec-tests-alist
+ `(;; 1
+ (symbol . symbol)
+ ;; 2
+ ((or string array) . array)
+ ;; 3
+ ((or symbol number) . (or number symbol))
+ ;; 4
+ ((or cons atom) . (or atom cons)) ;; SBCL return T
+ ;; 5
+ ((or integer number) . number)
+ ;; 6
+ ((or (or integer symbol) number) . (or number symbol))
+ ;; 7
+ ((or (or integer symbol) (or number list)) . (or list number symbol))
+ ;; 8
+ ((or (or integer number) nil) . number)
+ ;; 9
+ ((member foo) . (member foo))
+ ;; 10
+ ((member foo bar) . (member bar foo))
+ ;; 11
+ ((or (member foo) (member bar)) . (member bar foo))
+ ;; 12
+ ((or (member foo) symbol) . symbol) ;; SBCL return (OR SYMBOL (MEMBER FOO))
+ ;; 13
+ ((or (member foo) number) . (or (member foo) number))
+ ;; 14
+ ((or (integer 1 3) number) . number)
+ ;; 15
+ (integer . integer)
+ ;; 16
+ ((integer 1 2) . (integer 1 2))
+ ;; 17
+ ((or (integer -1 0) (integer 3 4)) . (or (integer -1 0) (integer 3 4)))
+ ;; 18
+ ((or (integer -1 2) (integer 3 4)) . (integer -1 4))
+ ;; 19
+ ((or (integer -1 3) (integer 3 4)) . (integer -1 4))
+ ;; 20
+ ((or (integer -1 4) (integer 3 4)) . (integer -1 4))
+ ;; 21
+ ((or (integer -1 5) (integer 3 4)) . (integer -1 5))
+ ;; 22
+ ((or (integer -1 *) (integer 3 4)) . (integer -1 *))
+ ;; 23
+ ((or (integer -1 2) (integer * 4)) . (integer * 4))
+ ;; 24
+ ((and string array) . string)
+ ;; 25
+ ((and cons atom) . nil)
+ ;; 26
+ ((and (member foo) (member foo bar baz)) . (member foo))
+ ;; 27
+ ((and (member foo) (member bar)) . nil)
+ ;; 28
+ ((and (member foo) symbol) . (member foo))
+ ;; 29
+ ((and (member foo) string) . nil)
+ ;; 30
+ ((and (member foo) (integer 1 2)) . nil)
+ ;; 31
+ ((and (member 1 2) (member 3 2)) . (integer 2 2))
+ ;; 32
+ ((and number (integer 1 2)) . (integer 1 2))
+ ;; 33
+ ((and integer (integer 1 2)) . (integer 1 2))
+ ;; 34
+ ((and (integer -1 0) (integer 3 5)) . nil)
+ ;; 35
+ ((and (integer -1 2) (integer 3 5)) . nil)
+ ;; 36
+ ((and (integer -1 3) (integer 3 5)) . (integer 3 3))
+ ;; 37
+ ((and (integer -1 4) (integer 3 5)) . (integer 3 4))
+ ;; 38
+ ((and (integer -1 5) nil) . nil)
+ ;; 39
+ ((not symbol) . (not symbol))
+ ;; 40
+ ((or (member foo) (not (member foo bar))) . (not (member bar)))
+ ;; 41
+ ((or (member foo bar) (not (member foo))) . t)
+ ;; 42
+ ((or symbol (not sequence)) . (not sequence))
+ ;; 43
+ ((or symbol (not symbol)) . t)
+ ;; 44
+ ((or symbol (not sequence)) . (not sequence))
+ ;; 45 Conservative.
+ ((or vector (not sequence)) . t)
+ ;; 46
+ ((or (integer 1 10) (not (integer * 5))) . (not (integer * 0)))
+ ;; 47
+ ((or symbol (integer 1 10) (not (integer * 5))) . (not (integer * 0)))
+ ;; 48
+ ((or (not symbol) (integer 1 10) (not (integer * 5))) . (not (or symbol (integer * 0))))
+ ;; 49
+ ((or symbol (not (member foo))) . (not (member foo)))
+ ;; 50
+ ((or (not symbol) (not (member foo))) . (not symbol))
+ ;; 51 Conservative.
+ ((or (not (member foo)) string) . (not (member foo)))
+ ;; 52 Conservative.
+ ((or (member foo) (not string)) . (not string))
+ ;; 53
+ ((or (not (integer 1 2)) integer) . t)
+ ;; 54
+ ((or (not (integer 1 2)) (not integer)) . (not integer))
+ ;; 55
+ ((or (integer 1 2) (not integer)) . (not (or (integer * 0) (integer 3 *))))
+ ;; 56
+ ((or number (not (integer 1 2))) . t)
+ ;; 57
+ ((or atom (not (integer 1 2))) . t)
+ ;; 58
+ ((or atom (not (member foo))) . t)
+ ;; 59
+ ((and symbol (not cons)) . symbol)
+ ;; 60
+ ((and symbol (not symbol)) . nil)
+ ;; 61
+ ((and atom (not symbol)) . atom)
+ ;; 62
+ ((and atom (not string)) . (or array sequence atom))
+ ;; 63 Conservative
+ ((and symbol (not (member foo))) . symbol)
+ ;; 64 Conservative
+ ((and symbol (not (member 3))) . symbol)
+ ;; 65
+ ((and (not (member foo)) (integer 1 10)) . (integer 1 10))
+ ;; 66
+ ((and (member foo) (not (integer 1 10))) . (member foo))
+ ;; 67
+ ((and t (not (member foo))) . (not (member foo)))
+ ;; 68
+ ((and integer (not (integer 3 4))) . (or (integer * 2) (integer 5 *)))
+ ;; 69
+ ((and (integer 0 20) (not (integer 5 10))) . (or (integer 0 4) (integer 11 20)))
+ ;; 70
+ ((and (not (member a)) (not (member b))) . (not (member a b)))
+ ;; 71
+ ((and (not boolean) (not (member b))) . (not (or (member b) boolean)))
+ ;; 72
+ ((and t (integer 1 1)) . (integer 1 1))
+ ;; 73
+ ((not (integer -1 5)) . (not (integer -1 5)))
+ ;; 74
+ ((and boolean (or number marker)) . nil)
+ ;; 75
+ ((and atom (or number marker)) . (or marker number))
+ ;; 76
+ ((and symbol (or number marker)) . nil)
+ ;; 77
+ ((and (or symbol string) (or number marker)) . nil)
+ ;; 78
+ ((and t t) . t)
+ ;; 79
+ ((and (or marker number) (integer 0 0)) . (integer 0 0))
+ ;; 80
+ ((and t (not t)) . nil)
+ ;; 81
+ ((or (integer 1 1) (not (integer 1 1))) . t)
+ ;; 82
+ ((not t) . nil)
+ ;; 83
+ ((not nil) . t)
+ ;; 84
+ ((or (not string) t) . t)
+ ;; 85
+ ((or (not vector) sequence) . sequence)
+ ;; 86
+ ((or (not symbol) null) . t)
+ ;; 87
+ ((and (or null integer) (not (or null integer))) . nil)
+ ;; 88
+ ((and (or (member a b c)) (not (or (member a b)))) . (member c)))
+ "Alist type specifier -> expected type specifier."))
+
+(defmacro comp-cstr-synthesize-tests ()
+ "Generate all tests from `comp-cstr-typespec-tests-alist'."
+ `(progn
+ ,@(cl-loop
+ for i from 1
+ for (ts . exp-ts) in comp-cstr-typespec-tests-alist
+ append (list (comp-cstr-typespec-test i ts exp-ts)))))
+
+(comp-cstr-synthesize-tests)
+
+;;; comp-cstr-tests.el ends here
diff --git a/test/lisp/emacs-lisp/copyright-tests.el b/test/lisp/emacs-lisp/copyright-tests.el
index 7deb8b53a2e..6bb6e350d17 100644
--- a/test/lisp/emacs-lisp/copyright-tests.el
+++ b/test/lisp/emacs-lisp/copyright-tests.el
@@ -37,8 +37,12 @@
. ";; Copyright (C) 2017, 2019 Free Software Foundation, Inc.")
(";; Copyright (C) 2017-2018 Free Software Foundation, Inc."
. ";; Copyright (C) 2017-2019 Free Software Foundation, Inc.")
+ (";; Copyright (C) 2017–2018 Free Software Foundation, Inc."
+ . ";; Copyright (C) 2017–2019 Free Software Foundation, Inc.")
(";; Copyright (C) 2005-2006, 2015, 2017-2018 Free Software Foundation, Inc."
. ";; Copyright (C) 2005-2006, 2015, 2017-2019 Free Software Foundation, Inc.")
+ (";; Copyright (C) 2005–2006, 2015, 2017–2018 Free Software Foundation, Inc."
+ . ";; Copyright (C) 2005–2006, 2015, 2017–2019 Free Software Foundation, Inc.")
(";; copyright '18 FSF"
. ";; copyright '18, '19 FSF")))
diff --git a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
index a3010f9e354..9257f167d67 100644
--- a/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
+++ b/test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
@@ -6,18 +6,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 <https://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@@ -62,12 +62,12 @@
(defun edebug-test-code-format-vector-node (node)
!start!(concat "["
- (apply 'concat (mapcar 'edebug-test-code-format-node node))!apply!
+ (apply #'concat (mapcar #'edebug-test-code-format-node node))!apply!
"]"))
(defun edebug-test-code-format-list-node (node)
!start!(concat "{"
- (apply 'concat (mapcar 'edebug-test-code-format-node node))!apply!
+ (apply #'concat (mapcar #'edebug-test-code-format-node node))!apply!
"}"))
(defun edebug-test-code-format-node (node)
@@ -137,5 +137,21 @@
,(cons func args))))
(wrap + 1 x)))
+(defun edebug-test-code-cl-flet1 ()
+ (cl-flet
+ ;; This `&rest' sexp head should not collide with
+ ;; the Edebug spec elem of the same name.
+ ((f (&rest x) x)
+ (gate (x) (+ x 5)))
+ ;; This call to `gate' shouldn't collide with the Edebug spec elem
+ ;; of the same name.
+ (message "Hi %s" (gate 7))))
+
+(defun edebug-test-code-use-gv-expander (x)
+ (declare (gv-expander
+ (lambda (do)
+ (funcall do `(car ,x) (lambda (v) `(setcar ,x ,v))))))
+ (car x))
+
(provide 'edebug-test-code)
;;; edebug-test-code.el ends here
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index d60a6cb3d50..2f45050e2eb 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -6,18 +6,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 <https://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@@ -219,16 +219,16 @@ index."
(with-current-buffer (find-file-noselect edebug-tests-temp-file)
(setq saved-local-map overriding-local-map)
(setq overriding-local-map edebug-tests-keymap)
- (add-hook 'post-command-hook 'edebug-tests-post-command))
+ (add-hook 'post-command-hook #'edebug-tests-post-command))
(advice-add 'exit-recursive-edit
- :around 'edebug-tests-preserve-keyboard-macro-state)
+ :around #'edebug-tests-preserve-keyboard-macro-state)
(unwind-protect
(kmacro-call-macro nil nil nil kbdmac)
(advice-remove 'exit-recursive-edit
- 'edebug-tests-preserve-keyboard-macro-state)
+ #'edebug-tests-preserve-keyboard-macro-state)
(with-current-buffer (find-file-noselect edebug-tests-temp-file)
(setq overriding-local-map saved-local-map)
- (remove-hook 'post-command-hook 'edebug-tests-post-command)))))
+ (remove-hook 'post-command-hook #'edebug-tests-post-command)))))
(defun edebug-tests-preserve-keyboard-macro-state (orig &rest args)
"Call ORIG with ARGS preserving the value of `executing-kbd-macro'.
@@ -857,12 +857,14 @@ test and possibly others should be updated."
(ert-deftest edebug-tests-trivial-backquote ()
"Edebug can instrument a trivial backquote expression (Bug#23651)."
(edebug-tests-with-normal-env
- (read-only-mode -1)
- (delete-region (point-min) (point-max))
- (insert "`1")
- (read-only-mode)
+ (let ((inhibit-read-only t))
+ (delete-region (point-min) (point-max))
+ (insert "`1"))
(edebug-eval-defun nil)
- (should (string-match-p (regexp-quote "1 (#o1, #x1, ?\\C-a)")
+ ;; `eval-defun' outputs its message to the echo area in a rather
+ ;; funny way, so the "1" and the " (#o1, #x1, ?\C-a)" end up placed
+ ;; there in separate pieces (via `print' rather than via `message').
+ (should (string-match-p (regexp-quote " (#o1, #x1, ?\\C-a)")
edebug-tests-messages))
(setq edebug-tests-messages "")
@@ -912,13 +914,17 @@ test and possibly others should be updated."
(ert-deftest edebug-tests-cl-macrolet ()
"Edebug can instrument `cl-macrolet' expressions. (Bug#29919)"
(edebug-tests-with-normal-env
- (edebug-tests-setup-@ "use-cl-macrolet" '(10) t)
+ (edebug-tests-locate-def "use-cl-macrolet")
(edebug-tests-run-kbd-macro
- "@ SPC SPC"
+ "C-u C-M-x SPC"
(edebug-tests-should-be-at "use-cl-macrolet" "func")
- (edebug-tests-should-match-result-in-messages "+")
- "g"
- (should (equal edebug-tests-@-result "The result of applying + to (1 x) is 11")))))
+ (edebug-tests-should-match-result-in-messages "+"))
+ (let ((edebug-initial-mode 'Go-nonstop))
+ (edebug-tests-setup-@ "use-cl-macrolet" '(10) t))
+ (edebug-tests-run-kbd-macro
+ "@ SPC g"
+ (should (equal edebug-tests-@-result "The result of applying + to (1 x) is 11"))
+ )))
(ert-deftest edebug-tests-backtrace-goto-source ()
"Edebug can jump to instrumented source from its *Edebug-Backtrace* buffer."
@@ -951,8 +957,41 @@ primary ones (Bug#42671)."
(should
(equal
defined-symbols
- (list (intern "edebug-cl-defmethod-qualifier :around ((_ number))")
- (intern "edebug-cl-defmethod-qualifier ((_ number))")))))))
+ (list (intern "edebug-cl-defmethod-qualifier :around (number)")
+ (intern "edebug-cl-defmethod-qualifier (number)")))))))
+
+(ert-deftest edebug-tests--conflicting-internal-names ()
+ "Check conflicts between form's head symbols and Edebug spec elements."
+ (edebug-tests-with-normal-env
+ (edebug-tests-setup-@ "cl-flet1" '(10) t)))
+
+(ert-deftest edebug-tests-gv-expander ()
+ "Edebug can instrument `gv-expander' expressions."
+ (edebug-tests-with-normal-env
+ (edebug-tests-setup-@ "use-gv-expander" nil t)
+ (should (equal
+ (catch 'text
+ (run-at-time 0 nil
+ (lambda () (throw 'text (buffer-substring (point) (+ (point) 5)))))
+ (eval '(setf (edebug-test-code-use-gv-expander (cons 'a 'b)) 3) t))
+ "(func"))))
+
+(defun edebug-tests--read (form spec)
+ (with-temp-buffer
+ (print form (current-buffer))
+ (goto-char (point-min))
+ (cl-letf ((edebug-all-forms t)
+ ((get (car form) 'edebug-form-spec) spec))
+ (edebug--read nil (current-buffer)))))
+
+(ert-deftest edebug-tests--&rest-behavior ()
+ ;; `&rest' is documented to allow the last "repetition" to be aborted early.
+ (should (edebug-tests--read '(dummy x 1 y 2 z)
+ '(&rest symbolp integerp)))
+ ;; `&rest' should notice here that the "symbolp integerp" sequence
+ ;; is not respected.
+ (should-error (edebug-tests--read '(dummy x 1 2 y)
+ '(&rest symbolp integerp))))
(ert-deftest edebug-tests-cl-flet ()
"Check that Edebug can instrument `cl-flet' forms without name
@@ -976,32 +1015,35 @@ clashes (Bug#41853)."
;; Make generated symbols reproducible.
(gensym-counter 10000))
(eval-buffer)
- (should (equal (reverse instrumented-names)
+ ;; Use `format' so as to throw away differences due to
+ ;; interned/uninterned symbols.
+ (should (equal (format "%s" (reverse instrumented-names))
;; The outer definitions come after the inner
;; ones because their body ends later.
- ;; FIXME: There are twice as many inner
- ;; definitions as expected due to Bug#41988.
- ;; Once that bug is fixed, remove the duplicates.
;; FIXME: We'd rather have names such as
;; `edebug-tests-cl-flet-1@inner@cl-flet@10000',
;; but that requires further changes to Edebug.
- '(inner@cl-flet@10000
- inner@cl-flet@10001
- inner@cl-flet@10002
- inner@cl-flet@10003
- edebug-tests-cl-flet-1
- inner@cl-flet@10004
- inner@cl-flet@10005
- edebug-tests-cl-flet-2))))))
+ (format "%s" '(inner@cl-flet@10000
+ inner@cl-flet@10001
+ edebug-tests-cl-flet-1
+ inner@cl-flet@10002
+ edebug-tests-cl-flet-2)))))))
+
+(defmacro edebug-tests--duplicate-symbol-backtrack (arg)
+ "Helper macro that exemplifies Bug#42701.
+ARG is either (FORM) or (FORM IGNORED)."
+ (declare (debug ([&or (form) (form sexp)])))
+ (car arg))
(ert-deftest edebug-tests-duplicate-symbol-backtrack ()
"Check that Edebug doesn't create duplicate symbols when
backtracking (Bug#42701)."
(with-temp-buffer
- (dolist (form '((require 'subr-x)
- (defun edebug-tests-duplicate-symbol-backtrack ()
- (if-let (x (funcall (lambda (y) 1) 2)) 3 4))))
- (print form (current-buffer)))
+ (print '(defun edebug-tests-duplicate-symbol-backtrack ()
+ (edebug-tests--duplicate-symbol-backtrack
+ ;; Passing (FORM IGNORED) forces backtracking.
+ ((lambda () 123) ignored)))
+ (current-buffer))
(let* ((edebug-all-defs t)
(edebug-initial-mode 'Go-nonstop)
(instrumented-names ())
@@ -1026,5 +1068,30 @@ backtracking (Bug#42701)."
"edebug-anon10001"
"edebug-tests-duplicate-symbol-backtrack"))))))
+(defmacro edebug-tests--duplicate-&define (_arg)
+ "Helper macro for the ERT test `edebug-tests-duplicate-&define'.
+The Edebug specification is similar to the one used by `cl-flet'
+previously; see Bug#41988."
+ (declare (debug (&or (&define name function-form) (defun)))))
+
+(ert-deftest edebug-tests-duplicate-&define ()
+ "Check that Edebug doesn't backtrack out of `&define' forms.
+This avoids potential duplicate definitions (Bug#41988)."
+ (with-temp-buffer
+ (print '(defun edebug-tests-duplicate-&define ()
+ (edebug-tests--duplicate-&define
+ (edebug-tests-duplicate-&define-inner () nil)))
+ (current-buffer))
+ (let* ((edebug-all-defs t)
+ (edebug-initial-mode 'Go-nonstop)
+ (instrumented-names ())
+ (edebug-new-definition-function
+ (lambda (name)
+ (when (memq name instrumented-names)
+ (error "Duplicate definition of `%s'" name))
+ (push name instrumented-names)
+ (edebug-new-definition name))))
+ (should-error (eval-buffer) :type 'invalid-read-syntax))))
+
(provide 'edebug-tests)
;;; edebug-tests.el ends here
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
index 285616a7806..9f9bb73133c 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-test-methodinvoke.el
@@ -1,4 +1,4 @@
-;;; eieio-testsinvoke.el -- eieio tests for method invocation -*- lexical-binding:t -*-
+;;; eieio-test-methodinvoke.el --- eieio tests for method invocation -*- lexical-binding:t -*-
;; Copyright (C) 2005, 2008, 2010, 2013-2021 Free Software Foundation,
;; Inc.
diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
index a47fb8053b9..3ec42343443 100644
--- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
+++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el
@@ -1,4 +1,4 @@
-;;; eieio-tests.el -- eieio test routines -*- lexical-binding: t -*-
+;;; eieio-tests.el --- eieio test routines -*- lexical-binding: t -*-
;; Copyright (C) 1999-2003, 2005-2010, 2012-2021 Free Software
;; Foundation, Inc.
@@ -574,7 +574,21 @@ METHOD is the method that was attempting to be called."
(setf (get-slot-3 eitest-t1) 'setf-emu)
(should (eq (get-slot-3 eitest-t1) 'setf-emu))
;; Roll back
- (setf (get-slot-3 eitest-t1) 'emu))
+ (setf (get-slot-3 eitest-t1) 'emu)
+ (defvar eieio-tests-initform-was-evaluated)
+ (defclass eieio-tests-initform-not-evaluated-when-initarg-is-present ()
+ ((slot-with-initarg-and-initform
+ :initarg :slot-with-initarg-and-initform
+ :initform (setf eieio-tests-initform-was-evaluated t))))
+ (setq eieio-tests-initform-was-evaluated nil)
+ (make-instance
+ 'eieio-tests-initform-not-evaluated-when-initarg-is-present)
+ (should eieio-tests-initform-was-evaluated)
+ (setq eieio-tests-initform-was-evaluated nil)
+ (make-instance
+ 'eieio-tests-initform-not-evaluated-when-initarg-is-present
+ :slot-with-initarg-and-initform t)
+ (should-not eieio-tests-initform-was-evaluated))
(defvar eitest-t2 nil)
(ert-deftest eieio-test-26-default-inheritance ()
diff --git a/test/lisp/emacs-lisp/ert-tests.el b/test/lisp/emacs-lisp/ert-tests.el
index 40cb432708e..5c9696105e9 100644
--- a/test/lisp/emacs-lisp/ert-tests.el
+++ b/test/lisp/emacs-lisp/ert-tests.el
@@ -6,18 +6,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@@ -814,7 +814,7 @@ This macro is used to test if macroexpansion in `should' works."
:body (lambda () (should (integerp (ert-fail "Boo"))))))))
(should (ert-test-failed-p result))
(should (equal (ert-test-failed-condition result)
- '(ert-test-failed ("Boo"))))))
+ '(ert-test-failed "Boo")))))
(provide 'ert-tests)
diff --git a/test/lisp/emacs-lisp/ert-x-tests.el b/test/lisp/emacs-lisp/ert-x-tests.el
index f46fa63e4ce..9f40a18d343 100644
--- a/test/lisp/emacs-lisp/ert-x-tests.el
+++ b/test/lisp/emacs-lisp/ert-x-tests.el
@@ -7,18 +7,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/lisp/emacs-lisp/generator-tests.el b/test/lisp/emacs-lisp/generator-tests.el
index ffcd16ad094..a1b9f64fdb1 100644
--- a/test/lisp/emacs-lisp/generator-tests.el
+++ b/test/lisp/emacs-lisp/generator-tests.el
@@ -45,6 +45,7 @@
BODY twice: once using ordinary `eval' and once using
lambda-generators. The test ensures that the two forms produce
identical output."
+ (declare (indent 1))
`(progn
(ert-deftest ,name ()
(should
@@ -62,8 +63,6 @@ identical output."
(let ((cps-inhibit-atomic-optimization t))
(iter-lambda () (iter-yield (progn ,@body)))))))))))
-(put 'cps-testcase 'lisp-indent-function 1)
-
(defvar *cps-test-i* nil)
(defun cps-get-test-i ()
*cps-test-i*)
diff --git a/test/lisp/emacs-lisp/lisp-mnt-tests.el b/test/lisp/emacs-lisp/lisp-mnt-tests.el
new file mode 100644
index 00000000000..84cdc7205f2
--- /dev/null
+++ b/test/lisp/emacs-lisp/lisp-mnt-tests.el
@@ -0,0 +1,36 @@
+;;; lisp-mnt-tests.el --- Tests for lisp-mnt -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 2020-2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'ert)
+(require 'lisp-mnt)
+
+(ert-deftest lm--tests-crack-address ()
+ (should (equal (lm-crack-address
+ "Bob Weiner <rsw@gnu.org>, Mats Lidell <matsl@gnu.org>")
+ '(("Bob Weiner" . "rsw@gnu.org")
+ ("Mats Lidell" . "matsl@gnu.org")))))
+
+(provide 'lisp-mnt-tests)
+;;; lisp-mnt-tests.el ends here
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el
index 85db3a00c8e..e2cecdf6b01 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -2,6 +2,8 @@
;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
+;; This file is part of GNU Emacs.
+
;; GNU Emacs 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
diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el
index fd07011137a..78ecf3ff03d 100644
--- a/test/lisp/emacs-lisp/lisp-tests.el
+++ b/test/lisp/emacs-lisp/lisp-tests.el
@@ -8,6 +8,8 @@
;; Author: Marcin Borkowski <mbork@mbork.pl>
;; Keywords: internal
+;; This file is part of GNU Emacs.
+
;; GNU Emacs 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
diff --git a/test/lisp/emacs-lisp/macroexp-resources/m1.el b/test/lisp/emacs-lisp/macroexp-resources/m1.el
new file mode 100644
index 00000000000..96b5f7091af
--- /dev/null
+++ b/test/lisp/emacs-lisp/macroexp-resources/m1.el
@@ -0,0 +1,36 @@
+;;; m1.el --- Some sample code for macroexp-tests -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords:
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(defconst macroexp--m1-tests-filename (macroexp-file-name))
+
+(eval-when-compile
+ (defconst macroexp--m1-tests-comp-filename (macroexp-file-name)))
+
+(defun macroexp--m1-tests-file-name ()
+ (macroexp--test-get-file-name))
+
+(provide 'm1)
+;;; m1.el ends here
diff --git a/test/lisp/emacs-lisp/macroexp-resources/m2.el b/test/lisp/emacs-lisp/macroexp-resources/m2.el
new file mode 100644
index 00000000000..4f2b96d8ca0
--- /dev/null
+++ b/test/lisp/emacs-lisp/macroexp-resources/m2.el
@@ -0,0 +1,33 @@
+;;; m2.el --- More sample code for macroexp-tests -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords:
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(defconst macroexp--m2-tests-filename (macroexp-file-name))
+
+(byte-compile-file (expand-file-name
+ "m1.el" (file-name-directory macroexp--m2-tests-filename)))
+
+(provide 'm2)
+;;; m2.el ends here
diff --git a/test/lisp/emacs-lisp/macroexp-tests.el b/test/lisp/emacs-lisp/macroexp-tests.el
new file mode 100644
index 00000000000..89d3882d1da
--- /dev/null
+++ b/test/lisp/emacs-lisp/macroexp-tests.el
@@ -0,0 +1,72 @@
+;;; macroexp-tests.el --- Tests for macroexp.el -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
+;; Keywords:
+
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(ert-deftest macroexp--tests-fgrep ()
+ (should (equal (macroexp--fgrep '((x) (y)) '([x] z ((u))))
+ '((x))))
+ (should (equal (macroexp--fgrep '((x) (y)) '#2=([y] ((y #2#))))
+ '((y))))
+ (should (equal (macroexp--fgrep '((x) (y)) '#2=([r] ((a x)) a b c d . #2#))
+ '((x)))))
+
+(defconst macroexp--tests-filename (macroexp-file-name))
+
+(defmacro macroexp--test-get-file-name () (macroexp-file-name))
+
+(ert-deftest macroexp--tests-file-name ()
+ (should (string-match
+ "\\`macroexp-tests.elc?\\'"
+ (file-name-nondirectory macroexp--tests-filename)))
+ (let ((rsrc-dir (expand-file-name
+ "macroexp-resources"
+ (file-name-directory macroexp--tests-filename))))
+ (with-current-buffer
+ (find-file-noselect (expand-file-name "m1.el" rsrc-dir))
+ (defvar macroexp--m1-tests-filename)
+ (declare-function macroexp--m1-tests-file-name "m1" ())
+ ;; `macroexp-file-name' should work with `eval-buffer'.
+ (eval-buffer)
+ (should (equal "m1.el"
+ (file-name-nondirectory macroexp--m1-tests-filename)))
+ (should (equal "m1.el"
+ (file-name-nondirectory (macroexp--m1-tests-file-name))))
+ (search-forward "macroexp--m1-tests-filename")
+ (makunbound 'macroexp--m1-tests-filename)
+ ;; `macroexp-file-name' should also work with `eval-defun'.
+ (eval-defun nil)
+ (should (equal "m1.el"
+ (file-name-nondirectory macroexp--m1-tests-filename))))
+
+ ;; Test the case where we load a file which byte-compiles another.
+ (defvar macroexp--m1-tests-comp-filename)
+ (makunbound 'macroexp--m1-tests-comp-filename)
+ (load (expand-file-name "m2.el" rsrc-dir))
+ (should (equal "m1.el"
+ (file-name-nondirectory macroexp--m1-tests-comp-filename)))))
+
+
+(provide 'macroexp-tests)
+;;; macroexp-tests.el ends here
diff --git a/test/lisp/emacs-lisp/map-tests.el b/test/lisp/emacs-lisp/map-tests.el
index 9a2cd42a211..658ed2e7119 100644
--- a/test/lisp/emacs-lisp/map-tests.el
+++ b/test/lisp/emacs-lisp/map-tests.el
@@ -22,7 +22,7 @@
;;; Commentary:
-;; Tests for map.el
+;; Tests for map.el.
;;; Code:
@@ -30,12 +30,10 @@
(require 'map)
(defmacro with-maps-do (var &rest body)
- "Successively bind VAR to an alist, vector and hash-table.
+ "Successively bind VAR to an alist, plist, vector, and hash-table.
Each map is built from the following alist data:
-'((0 . 3) (1 . 4) (2 . 5)).
-Evaluate BODY for each created map.
-
-\(fn (var map) body)"
+ \\='((0 . 3) (1 . 4) (2 . 5)).
+Evaluate BODY for each created map."
(declare (indent 1) (debug (symbolp body)))
(let ((alist (make-symbol "alist"))
(plist (make-symbol "plist"))
@@ -53,43 +51,62 @@ Evaluate BODY for each created map.
(dolist (,var (list ,alist ,plist ,vec ,ht))
,@body))))
+(defmacro with-empty-maps-do (var &rest body)
+ "Like `with-maps-do', but with empty maps."
+ (declare (indent 1) (debug (symbolp body)))
+ `(dolist (,var (list (list) (vector) (make-hash-table)))
+ ,@body))
+
+(ert-deftest test-map-plist-p ()
+ "Test `map--plist-p'."
+ (with-empty-maps-do map
+ (should-not (map--plist-p map)))
+ (should-not (map--plist-p ""))
+ (should-not (map--plist-p '((()))))
+ (should (map--plist-p '(:a)))
+ (should (map--plist-p '(a)))
+ (should (map--plist-p '(nil)))
+ (should (map--plist-p '(""))))
+
(ert-deftest test-map-elt ()
(with-maps-do map
(should (= 3 (map-elt map 0)))
(should (= 4 (map-elt map 1)))
(should (= 5 (map-elt map 2)))
- (should (null (map-elt map -1)))
- (should (null (map-elt map 4)))))
+ (should-not (map-elt map -1))
+ (should-not (map-elt map 4))
+ (should-not (map-elt map 0.1))))
(ert-deftest test-map-elt-default ()
(with-maps-do map
- (should (= 5 (map-elt map 7 5)))))
+ (should (= 5 (map-elt map 7 5)))
+ (should (= 5 (map-elt map 0.1 5))))
+ (with-empty-maps-do map
+ (should (= 5 (map-elt map 0 5)))))
(ert-deftest test-map-elt-testfn ()
(let ((map (list (cons "a" 1) (cons "b" 2)))
;; Make sure to use a non-eq "a", even when compiled.
(noneq-key (string ?a)))
(should-not (map-elt map noneq-key))
- (should (map-elt map noneq-key nil 'equal))))
+ (should (map-elt map noneq-key nil #'equal))))
(ert-deftest test-map-elt-with-nil-value ()
- (should (null (map-elt '((a . 1)
- (b))
- 'b
- '2))))
+ (should-not (map-elt '((a . 1) (b)) 'b 2)))
(ert-deftest test-map-put! ()
(with-maps-do map
(setf (map-elt map 2) 'hello)
(should (eq (map-elt map 2) 'hello)))
(with-maps-do map
- (map-put map 2 'hello)
+ (with-suppressed-warnings ((obsolete map-put))
+ (map-put map 2 'hello))
(should (eq (map-elt map 2) 'hello)))
(with-maps-do map
(map-put! map 2 'hello)
(should (eq (map-elt map 2) 'hello))
(if (not (or (hash-table-p map)
- (and (listp map) (not (listp (car map)))))) ;plist!
+ (map--plist-p map)))
(should-error (map-put! map 5 'value)
;; For vectors, it could arguably signal
;; map-not-inplace as well, but it currently doesn't.
@@ -97,49 +114,88 @@ Evaluate BODY for each created map.
'map-not-inplace
'error))
(map-put! map 5 'value)
- (should (eq (map-elt map 5) 'value))))
- (let ((ht (make-hash-table)))
- (setf (map-elt ht 2) 'a)
- (should (eq (map-elt ht 2)
- 'a)))
- (let ((alist '((0 . a) (1 . b) (2 . c))))
- (setf (map-elt alist 2) 'a)
- (should (eq (map-elt alist 2)
- 'a)))
- (let ((vec [3 4 5]))
- (should-error (setf (map-elt vec 3) 6))))
+ (should (eq (map-elt map 5) 'value)))))
+
+(ert-deftest test-map-put!-new-keys ()
+ "Test `map-put!' with new keys."
+ (with-maps-do map
+ (let ((size (map-length map)))
+ (if (arrayp map)
+ (progn
+ (should-error (setf (map-elt map 'k) 'v))
+ (should-error (setf (map-elt map size) 'v)))
+ (setf (map-elt map 'k) 'v)
+ (should (eq (map-elt map 'k) 'v))
+ (setf (map-elt map size) 'v)
+ (should (eq (map-elt map size) 'v))))))
(ert-deftest test-map-put-alist-new-key ()
"Regression test for Bug#23105."
- (let ((alist '((0 . a))))
- (map-put alist 2 'b)
- (should (eq (map-elt alist 2)
- 'b))))
+ (let ((alist (list (cons 0 'a))))
+ (with-suppressed-warnings ((obsolete map-put))
+ (map-put alist 2 'b))
+ (should (eq (map-elt alist 2) 'b))))
(ert-deftest test-map-put-testfn-alist ()
(let ((alist (list (cons "a" 1) (cons "b" 2)))
;; Make sure to use a non-eq "a", even when compiled.
(noneq-key (string ?a)))
- (map-put alist noneq-key 3 #'equal)
- (should-not (cddr alist))
- (map-put alist noneq-key 9 #'eql)
- (should (cddr alist))))
+ (with-suppressed-warnings ((obsolete map-put))
+ (map-put alist noneq-key 3 #'equal)
+ (should-not (cddr alist))
+ (map-put alist noneq-key 9 #'eql)
+ (should (cddr alist)))))
(ert-deftest test-map-put-return-value ()
(let ((ht (make-hash-table)))
- (should (eq (map-put ht 'a 'hello) 'hello))))
+ (with-suppressed-warnings ((obsolete map-put))
+ (should (eq (map-put ht 'a 'hello) 'hello)))))
+
+(ert-deftest test-map-insert-empty ()
+ "Test `map-insert' on empty maps."
+ (with-empty-maps-do map
+ (if (arrayp map)
+ (should-error (map-insert map 0 6))
+ (let ((new (map-insert map 0 6)))
+ (should-not (eq map new))
+ (should-not (map-pairs map))
+ (should (= (map-elt new 0) 6))))))
+
+(ert-deftest test-map-insert ()
+ "Test `map-insert'."
+ (with-maps-do map
+ (let ((pairs (map-pairs map))
+ (size (map-length map))
+ (new (map-insert map 0 6)))
+ (should-not (eq map new))
+ (should (equal (map-pairs map) pairs))
+ (should (= (map-elt new 0) 6))
+ (if (arrayp map)
+ (should-error (map-insert map size 7))
+ (setq new (map-insert map size 7))
+ (should-not (eq map new))
+ (should (equal (map-pairs map) pairs))
+ (should (= (map-elt new size) 7))))))
(ert-deftest test-map-delete ()
(with-maps-do map
- (map-delete map 1)
- (should (null (map-elt map 1))))
+ (should (map-elt map 1))
+ (should (eq map (map-delete map 1)))
+ (should-not (map-elt map 1)))
+ (with-maps-do map
+ (should-not (map-elt map -2))
+ (should (eq map (map-delete map -2)))
+ (should-not (map-elt map -2)))
(with-maps-do map
- (map-delete map -2)
- (should (null (map-elt map -2)))))
+ ;; Check for OBOE.
+ (let ((key (map-length map)))
+ (should-not (map-elt map key))
+ (should (eq map (map-delete map key)))
+ (should-not (map-elt map key)))))
-(ert-deftest test-map-delete-return-value ()
- (let ((ht (make-hash-table)))
- (should (eq (map-delete ht 'a) ht))))
+(ert-deftest test-map-delete-empty ()
+ (with-empty-maps-do map
+ (should (eq map (map-delete map t)))))
(ert-deftest test-map-nested-elt ()
(let ((vec [a b [c d [e f]]]))
@@ -149,8 +205,9 @@ Evaluate BODY for each created map.
(d . 3)
(e . ((f . 4)
(g . 5))))))))
- (should (eq (map-nested-elt alist '(b e f))
- 4)))
+ (should (eq (map-nested-elt alist '(b e f)) 4)))
+ (let ((plist '(a 1 b (c 2 d 3 e (f 4 g 5)))))
+ (should (eq (map-nested-elt plist '(b e f)) 4)))
(let ((ht (make-hash-table)))
(setf (map-elt ht 'a) 1)
(setf (map-elt ht 'b) (make-hash-table))
@@ -160,221 +217,266 @@ Evaluate BODY for each created map.
(ert-deftest test-map-nested-elt-default ()
(let ((vec [a b [c d]]))
- (should (null (map-nested-elt vec '(2 3))))
- (should (null (map-nested-elt vec '(2 1 1))))
+ (should-not (map-nested-elt vec '(2 3)))
+ (should-not (map-nested-elt vec '(2 1 1)))
(should (= 4 (map-nested-elt vec '(2 1 1) 4)))))
(ert-deftest test-mapp ()
- (should (mapp nil))
- (should (mapp '((a . b) (c . d))))
- (should (mapp '(a b c d)))
- (should (mapp []))
- (should (mapp [1 2 3]))
- (should (mapp (make-hash-table)))
+ (with-empty-maps-do map
+ (should (mapp map)))
+ (with-maps-do map
+ (should (mapp map)))
+ (should (mapp ""))
(should (mapp "hello"))
- (should (not (mapp 1)))
- (should (not (mapp 'hello))))
+ (should-not (mapp 1))
+ (should-not (mapp 'hello)))
(ert-deftest test-map-keys ()
(with-maps-do map
(should (equal (map-keys map) '(0 1 2))))
- (should (null (map-keys nil)))
- (should (null (map-keys []))))
+ (with-empty-maps-do map
+ (should-not (map-keys map))))
(ert-deftest test-map-values ()
(with-maps-do map
- (should (equal (map-values map) '(3 4 5)))))
+ (should (equal (map-values map) '(3 4 5))))
+ (with-empty-maps-do map
+ (should-not (map-values map))))
(ert-deftest test-map-pairs ()
(with-maps-do map
- (should (equal (map-pairs map) '((0 . 3)
- (1 . 4)
- (2 . 5))))))
+ (should (equal (map-pairs map)
+ '((0 . 3)
+ (1 . 4)
+ (2 . 5)))))
+ (with-empty-maps-do map
+ (should-not (map-pairs map))))
(ert-deftest test-map-length ()
- (let ((ht (make-hash-table)))
- (puthash 'a 1 ht)
- (puthash 'b 2 ht)
- (puthash 'c 3 ht)
- (puthash 'd 4 ht)
- (should (= 0 (map-length nil)))
- (should (= 0 (map-length [])))
- (should (= 0 (map-length (make-hash-table))))
- (should (= 5 (map-length [0 1 2 3 4])))
- (should (= 2 (map-length '((a . 1) (b . 2)))))
- (should (= 4 (map-length ht)))))
+ (with-empty-maps-do map
+ (should (zerop (map-length map))))
+ (with-maps-do map
+ (should (= 3 (map-length map))))
+ (should (= 1 (map-length '(nil 1))))
+ (should (= 2 (map-length '(nil 1 t 2))))
+ (should (= 2 (map-length '((a . 1) (b . 2)))))
+ (should (= 5 (map-length [0 1 2 3 4])))
+ (should (= 4 (map-length #s(hash-table data (a 1 b 2 c 3 d 4))))))
(ert-deftest test-map-copy ()
(with-maps-do map
(let ((copy (map-copy map)))
- (should (equal (map-keys map) (map-keys copy)))
- (should (equal (map-values map) (map-values copy)))
- (should (not (eq map copy))))))
+ (should (equal (map-pairs map) (map-pairs copy)))
+ (should-not (eq map copy))
+ (map-put! map 0 0)
+ (should-not (equal (map-pairs map) (map-pairs copy)))))
+ (with-empty-maps-do map
+ (should-not (map-pairs (map-copy map)))))
+
+(ert-deftest test-map-copy-alist ()
+ "Test use of `copy-alist' for alists."
+ (let* ((cons (list 'a 1 2))
+ (alist (list cons))
+ (copy (map-copy alist)))
+ (setcar cons 'b)
+ (should (equal alist '((b 1 2))))
+ (should (equal copy '((a 1 2))))
+ (setcar (cdr cons) 0)
+ (should (equal alist '((b 0 2))))
+ (should (equal copy '((a 0 2))))
+ (setcdr cons 3)
+ (should (equal alist '((b . 3))))
+ (should (equal copy '((a 0 2))))))
(ert-deftest test-map-apply ()
- (with-maps-do map
- (should (equal (map-apply (lambda (k v) (cons (int-to-string k) v))
- map)
- '(("0" . 3) ("1" . 4) ("2" . 5)))))
- (let ((vec [a b c]))
- (should (equal (map-apply (lambda (k v) (cons (1+ k) v))
- vec)
- '((1 . a)
- (2 . b)
- (3 . c))))))
+ (let ((fn (lambda (k v) (cons (number-to-string k) v))))
+ (with-maps-do map
+ (should (equal (map-apply fn map)
+ '(("0" . 3) ("1" . 4) ("2" . 5)))))
+ (with-empty-maps-do map
+ (should-not (map-apply fn map)))))
(ert-deftest test-map-do ()
- (with-maps-do map
- (let ((result nil))
- (map-do (lambda (k v)
- (push (list (int-to-string k) v) result))
- map)
- (should (equal result '(("2" 5) ("1" 4) ("0" 3)))))))
+ (let* (res
+ (fn (lambda (k v)
+ (push (list (number-to-string k) v) res))))
+ (with-empty-maps-do map
+ (should-not (map-do fn map))
+ (should-not res))
+ (with-maps-do map
+ (setq res nil)
+ (should-not (map-do fn map))
+ (should (equal res '(("2" 5) ("1" 4) ("0" 3)))))))
(ert-deftest test-map-keys-apply ()
(with-maps-do map
- (should (equal (map-keys-apply (lambda (k) (int-to-string k))
- map)
- '("0" "1" "2"))))
- (let ((vec [a b c]))
- (should (equal (map-keys-apply (lambda (k) (1+ k))
- vec)
- '(1 2 3)))))
+ (should (equal (map-keys-apply #'1+ map) '(1 2 3))))
+ (with-empty-maps-do map
+ (let (ks)
+ (should-not (map-keys-apply (lambda (k) (push k ks)) map))
+ (should-not ks))))
(ert-deftest test-map-values-apply ()
(with-maps-do map
- (should (equal (map-values-apply (lambda (v) (1+ v))
- map)
- '(4 5 6))))
- (let ((vec [a b c]))
- (should (equal (map-values-apply (lambda (v) (symbol-name v))
- vec)
- '("a" "b" "c")))))
+ (should (equal (map-values-apply #'1+ map) '(4 5 6))))
+ (with-empty-maps-do map
+ (let (vs)
+ (should-not (map-values-apply (lambda (v) (push v vs)) map))
+ (should-not vs))))
(ert-deftest test-map-filter ()
(with-maps-do map
- (should (equal (map-keys (map-filter (lambda (_k v)
- (<= 4 v))
- map))
- '(1 2)))
- (should (null (map-filter (lambda (k _v)
- (eq 'd k))
- map))))
- (should (null (map-filter (lambda (_k v)
- (eq 3 v))
- [1 2 4 5])))
- (should (equal (map-filter (lambda (k _v)
- (eq 3 k))
- [1 2 4 5])
- '((3 . 5)))))
+ (should (equal (map-filter (lambda (_k v) (> v 3)) map)
+ '((1 . 4) (2 . 5))))
+ (should (equal (map-filter #'always map) (map-pairs map)))
+ (should-not (map-filter #'ignore map)))
+ (with-empty-maps-do map
+ (should-not (map-filter #'always map))
+ (should-not (map-filter #'ignore map))))
(ert-deftest test-map-remove ()
(with-maps-do map
- (should (equal (map-keys (map-remove (lambda (_k v)
- (>= v 4))
- map))
- '(0)))
- (should (equal (map-keys (map-remove (lambda (k _v)
- (eq 'd k))
- map))
- (map-keys map))))
- (should (equal (map-remove (lambda (_k v)
- (eq 3 v))
- [1 2 4 5])
- '((0 . 1)
- (1 . 2)
- (2 . 4)
- (3 . 5))))
- (should (null (map-remove (lambda (k _v)
- (>= k 0))
- [1 2 4 5]))))
+ (should (equal (map-remove (lambda (_k v) (> v 3)) map)
+ '((0 . 3))))
+ (should (equal (map-remove #'ignore map) (map-pairs map)))
+ (should-not (map-remove #'always map)))
+ (with-empty-maps-do map
+ (should-not (map-remove #'always map))
+ (should-not (map-remove #'ignore map))))
(ert-deftest test-map-empty-p ()
- (should (map-empty-p nil))
- (should (not (map-empty-p '((a . b) (c . d)))))
- (should (map-empty-p []))
- (should (not (map-empty-p [1 2 3])))
- (should (map-empty-p (make-hash-table)))
- (should (not (map-empty-p "hello")))
- (should (map-empty-p "")))
+ (with-empty-maps-do map
+ (should (map-empty-p map)))
+ (should (map-empty-p ""))
+ (should-not (map-empty-p '((a . b) (c . d))))
+ (should-not (map-empty-p [1 2 3]))
+ (should-not (map-empty-p "hello")))
(ert-deftest test-map-contains-key ()
- (should (map-contains-key '((a . 1) (b . 2)) 'a))
- (should (not (map-contains-key '((a . 1) (b . 2)) 'c)))
- (should (map-contains-key '(("a" . 1)) "a"))
- (should (not (map-contains-key '(("a" . 1)) "a" #'eq)))
- (should (map-contains-key [a b c] 2))
- (should (not (map-contains-key [a b c] 3))))
+ (with-empty-maps-do map
+ (should-not (map-contains-key map -1))
+ (should-not (map-contains-key map 0))
+ (should-not (map-contains-key map 1))
+ (should-not (map-contains-key map (map-length map))))
+ (with-maps-do map
+ (should-not (map-contains-key map -1))
+ (should (map-contains-key map 0))
+ (should (map-contains-key map 1))
+ (should-not (map-contains-key map (map-length map)))))
+
+(ert-deftest test-map-contains-key-testfn ()
+ "Test `map-contains-key' under different equalities."
+ (let ((key (string ?a))
+ (plist '("a" 1 a 2))
+ (alist '(("a" . 1) (a . 2))))
+ (should (map-contains-key alist 'a))
+ (should (map-contains-key plist 'a))
+ (should (map-contains-key alist 'a #'eq))
+ (should (map-contains-key plist 'a #'eq))
+ (should (map-contains-key alist key))
+ (should-not (map-contains-key plist key))
+ (should-not (map-contains-key alist key #'eq))
+ (should-not (map-contains-key plist key #'eq))))
(ert-deftest test-map-some ()
(with-maps-do map
- (should (map-some (lambda (k _v)
- (eq 1 k))
- map))
- (should-not (map-some (lambda (k _v)
- (eq 'd k))
- map)))
- (let ((vec [a b c]))
- (should (map-some (lambda (k _v)
- (> k 1))
- vec))
- (should-not (map-some (lambda (k _v)
- (> k 3))
- vec))))
+ (should (eq (map-some (lambda (k _v) (and (= k 1) 'found)) map)
+ 'found))
+ (should-not (map-some #'ignore map)))
+ (with-empty-maps-do map
+ (should-not (map-some #'always map))
+ (should-not (map-some #'ignore map))))
(ert-deftest test-map-every-p ()
(with-maps-do map
- (should (map-every-p (lambda (k _v)
- k)
- map))
- (should (not (map-every-p (lambda (_k _v)
- nil)
- map))))
- (let ((vec [a b c]))
- (should (map-every-p (lambda (k _v)
- (>= k 0))
- vec))
- (should (not (map-every-p (lambda (k _v)
- (> k 3))
- vec)))))
+ (should (map-every-p #'always map))
+ (should-not (map-every-p #'ignore map))
+ (should-not (map-every-p (lambda (k _v) (zerop k)) map)))
+ (with-empty-maps-do map
+ (should (map-every-p #'always map))
+ (should (map-every-p #'ignore map))
+ (should (map-every-p (lambda (k _v) (zerop k)) map))))
(ert-deftest test-map-into ()
- (let* ((alist '((a . 1) (b . 2)))
+ (let* ((plist '(a 1 b 2))
+ (alist '((a . 1) (b . 2)))
(ht (map-into alist 'hash-table))
(ht2 (map-into alist '(hash-table :test equal))))
(should (hash-table-p ht))
- (should (equal (map-into (map-into alist 'hash-table) 'list)
- alist))
- (should (listp (map-into ht 'list)))
- (should (equal (map-keys (map-into (map-into ht 'list) 'hash-table))
- (map-keys ht)))
- (should (equal (map-values (map-into (map-into ht 'list) 'hash-table))
- (map-values ht)))
+ (should (equal (map-into ht 'list) alist))
+ (should (equal (map-pairs (map-into (map-into ht 'list) 'hash-table))
+ (map-pairs ht)))
(should (equal (map-into ht 'alist) (map-into ht2 'alist)))
- (should (eq (hash-table-test ht2) 'equal))
- (should (null (map-into nil 'list)))
- (should (map-empty-p (map-into nil 'hash-table)))
- (should-error (map-into [1 2 3] 'string))))
+ (should (equal (map-into alist 'list) alist))
+ (should (equal (map-into alist 'alist) alist))
+ (should (equal (map-into alist 'plist) plist))
+ (should (equal (map-into plist 'alist) alist))
+ (should (equal (map-into plist 'plist) plist)))
+ (should-error (map-into [1 2 3] 'string) :type 'cl-no-applicable-method))
+
+(ert-deftest test-map-into-hash-test ()
+ "Test `map-into' with different hash-table test functions."
+ (should (eq (hash-table-test (map-into () 'hash-table)) #'equal))
+ (should (eq (hash-table-test (map-into () '(hash-table))) #'eql))
+ (should (eq (hash-table-test (map-into () '(hash-table :test eq))) #'eq))
+ (should (eq (hash-table-test (map-into () '(hash-table :test eql))) #'eql))
+ (should (eq (hash-table-test (map-into () '(hash-table :test equal)))
+ #'equal)))
+
+(ert-deftest test-map-into-empty ()
+ "Test `map-into' with empty maps."
+ (with-empty-maps-do map
+ (should-not (map-into map 'list))
+ (should-not (map-into map 'alist))
+ (should-not (map-into map 'plist))
+ (should (map-empty-p (map-into map 'hash-table)))))
(ert-deftest test-map-let ()
(map-let (foo bar baz) '((foo . 1) (bar . 2))
(should (= foo 1))
(should (= bar 2))
- (should (null baz)))
+ (should-not baz))
(map-let (('foo a)
('bar b)
('baz c))
'((foo . 1) (bar . 2))
(should (= a 1))
(should (= b 2))
- (should (null c))))
+ (should-not c)))
+
+(ert-deftest test-map-merge ()
+ "Test `map-merge'."
+ (should (equal (sort (map-merge 'list '(a 1) '((b . 2) (c . 3))
+ #s(hash-table data (c 4)))
+ (lambda (x y) (string< (car x) (car y))))
+ '((a . 1) (b . 2) (c . 4))))
+ (should (equal (map-merge 'list () '(:a 1)) '((:a . 1))))
+ (should (equal (map-merge 'alist () '(:a 1)) '((:a . 1))))
+ (should (equal (map-merge 'plist () '(:a 1)) '(:a 1))))
(ert-deftest test-map-merge-with ()
- (should (equal (map-merge-with 'list #'+
- '((1 . 2))
- '((1 . 3) (2 . 4))
- '((1 . 1) (2 . 5) (3 . 0)))
- '((3 . 0) (2 . 9) (1 . 6)))))
+ (should (equal (sort (map-merge-with 'list #'+
+ '((1 . 2))
+ '((1 . 3) (2 . 4))
+ '((1 . 1) (2 . 5) (3 . 0)))
+ #'car-less-than-car)
+ '((1 . 6) (2 . 9) (3 . 0))))
+ (should (equal (map-merge-with 'list #'+ () '(:a 1)) '((:a . 1))))
+ (should (equal (map-merge-with 'alist #'+ () '(:a 1)) '((:a . 1))))
+ (should (equal (map-merge-with 'plist #'+ () '(:a 1)) '(:a 1))))
+
+(ert-deftest test-map-merge-empty ()
+ "Test merging of empty maps."
+ (should-not (map-merge 'list))
+ (should-not (map-merge 'alist))
+ (should-not (map-merge 'plist))
+ (should-not (map-merge-with 'list #'+))
+ (should-not (map-merge-with 'alist #'+))
+ (should-not (map-merge-with 'plist #'+))
+ (should (map-empty-p (map-merge 'hash-table)))
+ (should (map-empty-p (map-merge-with 'hash-table #'+)))
+ (should-error (map-merge 'array) :type 'cl-no-applicable-method)
+ (should-error (map-merge-with 'array #'+) :type 'cl-no-applicable-method))
(ert-deftest test-map-plist-pcase ()
(let ((plist '(:one 1 :two 2)))
@@ -382,5 +484,42 @@ Evaluate BODY for each created map.
(list one two))
'(1 2)))))
+(ert-deftest test-map-setf-alist-insert-key ()
+ (let ((alist))
+ (should (equal (setf (map-elt alist 'key) 'value)
+ 'value))
+ (should (equal alist '((key . value))))))
+
+(ert-deftest test-map-setf-alist-overwrite-key ()
+ (let ((alist '((key . value1))))
+ (should (equal (setf (map-elt alist 'key) 'value2)
+ 'value2))
+ (should (equal alist '((key . value2))))))
+
+(ert-deftest test-map-setf-plist-insert-key ()
+ (let ((plist '(key value)))
+ (should (equal (setf (map-elt plist 'key2) 'value2)
+ 'value2))
+ (should (equal plist '(key value key2 value2)))))
+
+(ert-deftest test-map-setf-plist-overwrite-key ()
+ (let ((plist '(key value)))
+ (should (equal (setf (map-elt plist 'key) 'value2)
+ 'value2))
+ (should (equal plist '(key value2)))))
+
+(ert-deftest test-hash-table-setf-insert-key ()
+ (let ((ht (make-hash-table)))
+ (should (equal (setf (map-elt ht 'key) 'value)
+ 'value))
+ (should (equal (map-elt ht 'key) 'value))))
+
+(ert-deftest test-hash-table-setf-overwrite-key ()
+ (let ((ht (make-hash-table)))
+ (puthash 'key 'value1 ht)
+ (should (equal (setf (map-elt ht 'key) 'value2)
+ 'value2))
+ (should (equal (map-elt ht 'key) 'value2))))
+
(provide 'map-tests)
;;; map-tests.el ends here
diff --git a/test/lisp/emacs-lisp/memory-report-tests.el b/test/lisp/emacs-lisp/memory-report-tests.el
index da5f4f5700f..0c0297b5fce 100644
--- a/test/lisp/emacs-lisp/memory-report-tests.el
+++ b/test/lisp/emacs-lisp/memory-report-tests.el
@@ -45,6 +45,7 @@
(should (equal (memory-report-object-size (list 'foo)) 16))
+ (should (equal (memory-report-object-size (vector 1 2 3)) 64))
(should (equal (memory-report-object-size (vector 1 2 3 4)) 80))
(should (equal (memory-report-object-size "") 32))
@@ -52,6 +53,21 @@
(should (equal (memory-report-object-size (propertize "a" 'face 'foo))
81)))
+(ert-deftest memory-report-sizes-vectors ()
+ (should (= (memory-report--object-size
+ (make-hash-table :test #'eq)
+ ["long string that should be at least 40 bytes"])
+ 108))
+ (let ((string "long string that should be at least 40 bytes"))
+ (should (= (memory-report--object-size
+ (make-hash-table :test #'eq)
+ (vector string))
+ 108))
+ (should (= (memory-report--object-size
+ (make-hash-table :test #'eq)
+ (vector string string))
+ 124))))
+
(provide 'memory-report-tests)
;;; memory-report-tests.el ends here
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
index 67d647d3b9e..29435799555 100644
--- a/test/lisp/emacs-lisp/package-tests.el
+++ b/test/lisp/emacs-lisp/package-tests.el
@@ -263,6 +263,74 @@ Must called from within a `tar-mode' buffer."
(should (file-exists-p autoloads-file))
(should-not (get-file-buffer autoloads-file)))))
+(ert-deftest package-test-install-file ()
+ "Install files with `package-install-file'."
+ (with-package-test (:basedir (ert-resource-directory))
+ (package-initialize)
+ (let* ((pkg-el "simple-single-1.3.el")
+ (source-file (expand-file-name pkg-el (ert-resource-directory))))
+ (should-not (package-installed-p 'simple-single))
+ (package-install-file source-file)
+ (should (package-installed-p 'simple-single))
+ (package-delete (cadr (assq 'simple-single package-alist)))
+ (should-not (package-installed-p 'simple-single)))
+
+ (let* ((pkg-el "multi-file-0.2.3.tar")
+ (source-file (expand-file-name pkg-el (ert-resource-directory))))
+ (package-initialize)
+ (should-not (package-installed-p 'multie-file))
+ (package-install-file source-file)
+ (should (package-installed-p 'multi-file))
+ (package-delete (cadr (assq 'multi-file package-alist))))
+ ))
+
+(ert-deftest package-test-install-file-EOLs ()
+ "Install same file multiple time with `package-install-file'
+but with a different end of line convention (bug#48137)."
+ (with-package-test (:basedir (ert-resource-directory))
+ (package-initialize)
+ (let* ((pkg-el "simple-single-1.3.el")
+ (source-file (expand-file-name pkg-el (ert-resource-directory))))
+
+ (with-temp-buffer
+ (insert-file-contents source-file)
+
+ (let (hashes)
+ (dolist (coding '(unix dos mac) hashes)
+ (let* ((eol-file (expand-file-name pkg-el package-test-user-dir)))
+ ;; save package with this EOL convention.
+ (set-buffer-file-coding-system coding)
+ (write-region (point-min) (point-max) eol-file)
+
+ (should-not (package-installed-p 'simple-single))
+ (package-install-file eol-file)
+ (should (package-installed-p 'simple-single))
+
+ ;; check the package file has been installed unmodified.
+ (let ((eol-hash (with-temp-buffer
+ (insert-file-contents-literally eol-file)
+ (buffer-hash))))
+ ;; also perform an additional check that the package
+ ;; file created with this EOL convention is different
+ ;; than all the others created so far.
+ (should-not (member eol-hash hashes))
+ (setq hashes (cons eol-hash hashes))
+
+ (let* ((descr (cadr (assq 'simple-single package-alist)))
+ (pkg-dir (package-desc-dir descr))
+ (dest-file (expand-file-name "simple-single.el" pkg-dir ))
+ (dest-hash (with-temp-buffer
+ (insert-file-contents-literally dest-file)
+ (buffer-hash))))
+
+ (should (string= dest-hash eol-hash))))
+
+ (package-delete (cadr (assq 'simple-single package-alist)))
+ (should-not (package-installed-p 'simple-single))
+ (delete-file eol-file)
+ (should-not (file-exists-p eol-file))
+ )))))))
+
(ert-deftest package-test-install-dependency ()
"Install a package which includes a dependency."
(with-package-test ()
diff --git a/test/lisp/emacs-lisp/pcase-tests.el b/test/lisp/emacs-lisp/pcase-tests.el
index e6f4c097504..7ad01e7aef7 100644
--- a/test/lisp/emacs-lisp/pcase-tests.el
+++ b/test/lisp/emacs-lisp/pcase-tests.el
@@ -75,8 +75,86 @@
(ert-deftest pcase-tests-vectors ()
(should (equal (pcase [1 2] (`[,x] 1) (`[,x ,y] (+ x y))) 3)))
-;; Local Variables:
-;; no-byte-compile: t
-;; End:
+(ert-deftest pcase-tests-bug14773 ()
+ (let ((f (lambda (x)
+ (pcase 'dummy
+ ((and (let var x) (guard var)) 'left)
+ ((and (let var (not x)) (guard var)) 'right)))))
+ (should (equal (funcall f t) 'left))
+ (should (equal (funcall f nil) 'right))))
+
+(ert-deftest pcase-tests-bug46786 ()
+ (let ((self 'outer))
+ (ignore self)
+ (should (equal (cl-macrolet ((show-self () `(list 'self self)))
+ (pcase-let ((`(,self ,_self2) '(inner "2")))
+ (show-self)))
+ '(self inner)))))
+
+(ert-deftest pcase-tests-or-vars ()
+ (let ((f (lambda (v)
+ (pcase v
+ ((or (and 'b1 (let x1 4) (let x2 5))
+ (and 'b2 (let y1 8) (let y2 9)))
+ (list x1 x2 y1 y2))))))
+ (should (equal (funcall f 'b1) '(4 5 nil nil)))
+ (should (equal (funcall f 'b2) '(nil nil 8 9)))))
+
+(ert-deftest pcase-tests-cl-type ()
+ (should (equal (pcase 1
+ ((cl-type integer) 'integer))
+ 'integer))
+ (should (equal (pcase 1
+ ((cl-type (integer 0 2)) 'integer-0<=n<=2))
+ 'integer-0<=n<=2))
+ (should-error (pcase 1
+ ((cl-type notatype) 'integer))))
+
+(ert-deftest pcase-tests-setq ()
+ (should (equal (let (a b)
+ (pcase-setq `((,a) (,b)) '((1) (2)))
+ (list a b))
+ (list 1 2)))
+
+ (should (equal (list nil nil)
+ (let ((a 'unset)
+ (b 'unset))
+ (pcase-setq `(head ,a ,b) nil)
+ (list a b))))
+
+ (should (equal (let (a b)
+ (pcase-setq `[,a ,b] [1 2])
+ (list a b))
+ '(1 2)))
+
+ (should-error (let (a b)
+ (pcase-setq `[,a ,b] nil)
+ (list a b)))
+
+ (should (equal (let (a b)
+ (pcase-setq a 1 b 2)
+ (list a b))
+ '(1 2)))
+
+ (should (= (let (a)
+ (pcase-setq a 1 `(,a) '(2))
+ a)
+ 2))
+
+ (should (equal (let (array list-item array-copy)
+ (pcase-setq (or `(,list-item) array) [1 2 3]
+ array-copy array
+ ;; This re-sets `array' to nil.
+ (or `(,list-item) array) '(4))
+ (list array array-copy list-item))
+ '(nil [1 2 3] 4)))
+
+ (let ((a nil))
+ (should-error (pcase-setq a 1 b)
+ :type '(wrong-number-of-arguments))
+ (should (eq a nil)))
+
+ (should-error (pcase-setq a)
+ :type '(wrong-number-of-arguments)))
;;; pcase-tests.el ends here.
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el
index 63d7c7b91ea..4828df0de92 100644
--- a/test/lisp/emacs-lisp/rx-tests.el
+++ b/test/lisp/emacs-lisp/rx-tests.el
@@ -156,6 +156,8 @@
".....")))
(ert-deftest rx-pcase ()
+ (should (equal (pcase "i18n" ((rx (let x (+ digit))) (list 'ok x)))
+ '(ok "18")))
(should (equal (pcase "a 1 2 3 1 1 b"
((rx (let u (+ digit)) space
(let v (+ digit)) space
@@ -164,6 +166,20 @@
(backref 1))
(list u v)))
'("1" "3")))
+ (should (equal (pcase "bz"
+ ((rx "a" (let x nonl)) (list 1 x))
+ (_ 'no))
+ 'no))
+ (should (equal (pcase "az"
+ ((rx "a" (let x nonl)) (list 1 x))
+ ((rx "b" (let x nonl)) (list 2 x))
+ (_ 'no))
+ '(1 "z")))
+ (should (equal (pcase "bz"
+ ((rx "a" (let x nonl)) (list 1 x))
+ ((rx "b" (let x nonl)) (list 2 x))
+ (_ 'no))
+ '(2 "z")))
(let ((k "blue"))
(should (equal (pcase "<blue>"
((rx "<" (literal k) ">") 'ok))
@@ -171,7 +187,23 @@
(should (equal (pcase "abc"
((rx (? (let x alpha)) (?? (let y alnum)) ?c)
(list x y)))
- '("a" "b"))))
+ '("a" "b")))
+ (should (equal (pcase 'not-a-string
+ ((rx nonl) 'wrong)
+ (_ 'correct))
+ 'correct))
+ (should (equal (pcase "PQR"
+ ((and (rx (let a nonl)) (rx ?z))
+ (list 'one a))
+ ((rx (let b ?Q))
+ (list 'two b)))
+ '(two "Q")))
+ (should (equal (pcase-let (((rx ?B (let z nonl)) "ABC"))
+ (list 'ok z))
+ '(ok "C")))
+ (should (equal (pcase-let* (((rx ?E (let z nonl)) "DEF"))
+ (list 'ok z))
+ '(ok "F"))))
(ert-deftest rx-kleene ()
"Test greedy and non-greedy repetition operators."
@@ -388,6 +420,8 @@
(ert-deftest rx-regexp ()
(should (equal (rx (regexp "abc") (regex "[de]"))
"\\(?:abc\\)[de]"))
+ (should (equal (rx "a" (regexp "$"))
+ "a\\(?:$\\)"))
(let ((x "a*"))
(should (equal (rx (regexp x) "b")
"\\(?:a*\\)b"))
diff --git a/test/lisp/emacs-lisp/seq-tests.el b/test/lisp/emacs-lisp/seq-tests.el
index 05c7fbe781e..44e855e2cfa 100644
--- a/test/lisp/emacs-lisp/seq-tests.el
+++ b/test/lisp/emacs-lisp/seq-tests.el
@@ -383,6 +383,30 @@ Evaluate BODY for each created sequence.
(should (null b))
(should (null c)))))
+(ert-deftest test-seq-setq ()
+ (with-test-sequences (seq '(1 2 3 4))
+ (let (a b c d e)
+ (seq-setq (a b c d e) seq)
+ (should (= a 1))
+ (should (= b 2))
+ (should (= c 3))
+ (should (= d 4))
+ (should (null e)))
+ (let (a b others)
+ (seq-setq (a b &rest others) seq)
+ (should (= a 1))
+ (should (= b 2))
+ (should (same-contents-p others (seq-drop seq 2)))))
+ (let ((a)
+ (seq '(1 (2 (3 (4))))))
+ (seq-setq (_ (_ (_ (a)))) seq)
+ (should (= a 4)))
+ (let (seq a b c)
+ (seq-setq (a b c) seq)
+ (should (null a))
+ (should (null b))
+ (should (null c))))
+
(ert-deftest test-seq-min-max ()
(with-test-sequences (seq '(4 5 3 2 0 4))
(should (= (seq-min seq) 0))
diff --git a/test/lisp/emacs-lisp/shortdoc-tests.el b/test/lisp/emacs-lisp/shortdoc-tests.el
new file mode 100644
index 00000000000..3bb3185649b
--- /dev/null
+++ b/test/lisp/emacs-lisp/shortdoc-tests.el
@@ -0,0 +1,45 @@
+;;; shortdoc-tests.el --- tests for shortdoc.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+(require 'ert)
+(require 'shortdoc)
+
+(defun shortdoc-tests--tree-contains (tree fun)
+ "Whether TREE contains a call to FUN."
+ (and (proper-list-p tree)
+ (or (eq (car tree) fun)
+ (cl-some (lambda (x) (shortdoc-tests--tree-contains x fun)) tree))))
+
+(ert-deftest shortdoc-examples ()
+ "Check that each example actually contains the corresponding form."
+ (dolist (group shortdoc--groups)
+ (dolist (item group)
+ (when (consp item)
+ (let ((fun (car item))
+ (props (cdr item)))
+ (while props
+ (when (memq (car props) '(:eval :no-eval :no-eval* :no-value))
+ (let* ((example (cadr props))
+ (expr (cond
+ ((consp example) example)
+ ((stringp example) (read example)))))
+ (should (shortdoc-tests--tree-contains expr fun))))
+ (setq props (cddr props))))))))
+
+(provide 'shortdoc-tests)
diff --git a/test/lisp/emacs-lisp/subr-x-tests.el b/test/lisp/emacs-lisp/subr-x-tests.el
index 112f3c1dac1..ef04cde3867 100644
--- a/test/lisp/emacs-lisp/subr-x-tests.el
+++ b/test/lisp/emacs-lisp/subr-x-tests.el
@@ -607,18 +607,21 @@
(should (equal (string-limit "foó" 4 nil 'utf-8) "fo\303\263"))
(should (equal (string-limit "foóa" 4 nil 'utf-8) "fo\303\263"))
(should (equal (string-limit "foóá" 4 nil 'utf-8) "fo\303\263"))
+ (should (equal (string-limit "foóá" 4 nil 'utf-8-with-signature)
+ "fo\303\263"))
(should (equal (string-limit "foóa" 4 nil 'iso-8859-1) "fo\363a"))
(should (equal (string-limit "foóá" 4 nil 'iso-8859-1) "fo\363\341"))
- (should (equal (string-limit "foóá" 4 nil 'utf-16) "\376\377\000f"))
+ (should (equal (string-limit "foóá" 4 nil 'utf-16) "\000f\000o"))
(should (equal (string-limit "foó" 10 t 'utf-8) "fo\303\263"))
(should (equal (string-limit "foó" 3 t 'utf-8) "o\303\263"))
(should (equal (string-limit "foó" 4 t 'utf-8) "fo\303\263"))
(should (equal (string-limit "foóa" 4 t 'utf-8) "o\303\263a"))
(should (equal (string-limit "foóá" 4 t 'utf-8) "\303\263\303\241"))
+ (should (equal (string-limit "foóá" 2 t 'utf-8-with-signature) "\303\241"))
(should (equal (string-limit "foóa" 4 t 'iso-8859-1) "fo\363a"))
(should (equal (string-limit "foóá" 4 t 'iso-8859-1) "fo\363\341"))
- (should (equal (string-limit "foóá" 4 t 'utf-16) "\376\377\000\341")))
+ (should (equal (string-limit "foóá" 4 t 'utf-16) "\000\363\000\341")))
(ert-deftest subr-string-lines ()
(should (equal (string-lines "foo") '("foo")))
diff --git a/test/lisp/emacs-lisp/testcover-resources/testcases.el b/test/lisp/emacs-lisp/testcover-resources/testcases.el
index 5dbf2272b1a..7ced257c6f9 100644
--- a/test/lisp/emacs-lisp/testcover-resources/testcases.el
+++ b/test/lisp/emacs-lisp/testcover-resources/testcases.el
@@ -6,18 +6,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/lisp/emacs-lisp/testcover-tests.el b/test/lisp/emacs-lisp/testcover-tests.el
index 9f0312d85ff..7854e33e77d 100644
--- a/test/lisp/emacs-lisp/testcover-tests.el
+++ b/test/lisp/emacs-lisp/testcover-tests.el
@@ -6,18 +6,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/lisp/epg-config-tests.el b/test/lisp/epg-config-tests.el
new file mode 100644
index 00000000000..fba61e573c3
--- /dev/null
+++ b/test/lisp/epg-config-tests.el
@@ -0,0 +1,47 @@
+;;; epg-config-tests.el --- Test suite for epg.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'epg-config)
+
+(ert-deftest epg-config-test-epg-find-configuration ()
+ (skip-unless (executable-find "gpg2"))
+ (should (assq 'version (epg-find-configuration 'OpenPGP))))
+
+(ert-deftest epg-config-test-epg-find-configuration/unknown-protocol ()
+ (should-error (epg-find-configuration 'does-not-exist)))
+
+(ert-deftest epg-config-test-epg-check-configuration ()
+ (should (epg-check-configuration '((version . "1.0")) "0.9"))
+ (should (epg-check-configuration '((version . "1.0")) "1.0"))
+ (should-error (epg-check-configuration '((version . "1.0")) "1.1"))
+ (should-error (epg-check-configuration '((version . "1.0")) 'foo))
+ (should-error (epg-check-configuration '((version . "1.0")) "foo")))
+
+(ert-deftest epg-config-test-epg-required-version-p ()
+ (skip-unless (executable-find "gpg2"))
+ (should (epg-required-version-p 'OpenPGP "1.0")))
+
+(provide 'epg-config-tests)
+
+;;; epg-config-tests.el ends here
diff --git a/test/lisp/erc/erc-tests.el b/test/lisp/erc/erc-tests.el
index 26e14b98e91..d13397274aa 100644
--- a/test/lisp/erc/erc-tests.el
+++ b/test/lisp/erc/erc-tests.el
@@ -23,6 +23,7 @@
(require 'ert)
(require 'erc)
+(require 'erc-ring)
(ert-deftest erc--read-time-period ()
(cl-letf (((symbol-function 'read-string) (lambda (&rest _) "")))
@@ -45,3 +46,66 @@
(cl-letf (((symbol-function 'read-string) (lambda (&rest _) "1d")))
(should (equal (erc--read-time-period "foo: ") 86400))))
+
+(ert-deftest erc-ring-previous-command-base-case ()
+ (ert-info ("Create ring when nonexistent and do nothing")
+ (let (erc-input-ring
+ erc-input-ring-index)
+ (erc-previous-command)
+ (should (ring-p erc-input-ring))
+ (should (zerop (ring-length erc-input-ring)))
+ (should-not erc-input-ring-index)))
+ (should-not erc-input-ring))
+
+(ert-deftest erc-ring-previous-command ()
+ (with-current-buffer (get-buffer-create "*#fake*")
+ (erc-mode)
+ (insert "\n\n")
+ (setq erc-input-marker (make-marker) ; these are all local
+ erc-insert-marker (make-marker)
+ erc-send-completed-hook nil)
+ (set-marker erc-insert-marker (point-max))
+ (erc-display-prompt)
+ (should (= (point) erc-input-marker))
+ (add-hook 'erc-pre-send-functions #'erc-add-to-input-ring nil t)
+ ;;
+ (cl-letf (((symbol-function 'erc-process-input-line)
+ (lambda (&rest _)
+ (insert-before-markers
+ (erc-display-message-highlight 'notice "echo: one\n"))))
+ ((symbol-function 'erc-command-no-process-p)
+ (lambda (&rest _) t)))
+ (ert-info ("Create ring, populate, recall")
+ (insert "/one")
+ (erc-send-current-line)
+ (should (ring-p erc-input-ring))
+ (should (zerop (ring-member erc-input-ring "/one"))) ; equal
+ (should (save-excursion (forward-line -1) (goto-char (point-at-bol))
+ (looking-at-p "[*]+ echo: one")))
+ (should-not erc-input-ring-index)
+ (erc-bol)
+ (should (looking-at "$"))
+ (erc-previous-command)
+ (erc-bol)
+ (should (looking-at "/one"))
+ (should (zerop erc-input-ring-index)))
+ (ert-info ("Back to one")
+ (should (= (ring-length erc-input-ring) (1+ erc-input-ring-index)))
+ (erc-previous-command)
+ (should-not erc-input-ring-index)
+ (erc-bol)
+ (should (looking-at "$"))
+ (should (equal (ring-ref erc-input-ring 0) "/one")))
+ (ert-info ("Swap input after prompt with previous (#bug46339)")
+ (insert "abc")
+ (erc-previous-command)
+ (should (= 1 erc-input-ring-index))
+ (erc-bol)
+ (should (looking-at "/one"))
+ (should (equal (ring-ref erc-input-ring 0) "abc"))
+ (should (equal (ring-ref erc-input-ring 1) "/one"))
+ (erc-next-command)
+ (erc-bol)
+ (should (looking-at "abc")))))
+ (when noninteractive
+ (kill-buffer "*#fake*")))
diff --git a/test/lisp/eshell/em-hist-tests.el b/test/lisp/eshell/em-hist-tests.el
index ec65397fd63..31967a61c3c 100644
--- a/test/lisp/eshell/em-hist-tests.el
+++ b/test/lisp/eshell/em-hist-tests.el
@@ -1,4 +1,4 @@
-;;; tests/em-hist-tests.el --- em-hist test suite -*- lexical-binding:t -*-
+;;; em-hist-tests.el --- em-hist test suite -*- lexical-binding:t -*-
;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/eshell/em-ls-tests.el b/test/lisp/eshell/em-ls-tests.el
index fc2cd9c8e14..5d1742b76fd 100644
--- a/test/lisp/eshell/em-ls-tests.el
+++ b/test/lisp/eshell/em-ls-tests.el
@@ -1,4 +1,4 @@
-;;; tests/em-ls-tests.el --- em-ls test suite -*- lexical-binding:t -*-
+;;; em-ls-tests.el --- em-ls test suite -*- lexical-binding:t -*-
;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/eshell/esh-opt-tests.el b/test/lisp/eshell/esh-opt-tests.el
index 0c99da64b2e..e2a0ea59d1c 100644
--- a/test/lisp/eshell/esh-opt-tests.el
+++ b/test/lisp/eshell/esh-opt-tests.el
@@ -1,4 +1,4 @@
-;;; tests/esh-opt-tests.el --- esh-opt test suite -*- lexical-binding:t -*-
+;;; esh-opt-tests.el --- esh-opt test suite -*- lexical-binding:t -*-
;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index 4dac7024f41..4f0cc9b6785 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -1,4 +1,4 @@
-;;; tests/eshell-tests.el --- Eshell test suite -*- lexical-binding:t -*-
+;;; eshell-tests.el --- Eshell test suite -*- lexical-binding:t -*-
;; Copyright (C) 1999-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el
index 3ceb392d7fb..f8113bffc1a 100644
--- a/test/lisp/ffap-tests.el
+++ b/test/lisp/ffap-tests.el
@@ -123,6 +123,25 @@ left alone when opening a URL in an external browser."
(save-excursion (insert "type="))
(ffap-guess-file-name-at-point))))
+(ert-deftest ffap-ido-mode ()
+ (require 'ido)
+ (with-temp-buffer
+ (let ((ido-mode t)
+ (read-file-name-function read-file-name-function)
+ (read-buffer-function read-buffer-function))
+ ;; Says ert-deftest:
+ ;; Macros in BODY are expanded when the test is defined, not when it
+ ;; is run. If a macro (possibly with side effects) is to be tested,
+ ;; it has to be wrapped in `(eval (quote ...))'.
+ (eval (quote (ido-everywhere)))
+ (let ((read-file-name-function (lambda (&rest args)
+ (expand-file-name
+ (nth 4 args)
+ (nth 1 args)))))
+ (save-excursion (insert "ffap-tests.el"))
+ (let (kill-buffer-query-functions)
+ (kill-buffer (call-interactively #'find-file-at-point)))))))
+
(provide 'ffap-tests)
;;; ffap-tests.el ends here
diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el
index d73b072661a..6125069c6b3 100644
--- a/test/lisp/filenotify-tests.el
+++ b/test/lisp/filenotify-tests.el
@@ -107,19 +107,20 @@ There are different timeouts for local and remote file notification libraries."
(cond
;; gio/gpollfilemonitor.c declares POLL_TIME_SECS 5. So we must
;; wait at least this time in the GPollFileMonitor case. A
- ;; similar timeout seems to be needed in the GFamFileMonitor case,
- ;; at least on cygwin.
- ((memq (file-notify--test-monitor) '(GFamFileMonitor GPollFileMonitor)) 7)
- ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe") 1)
+ ;; similar timeout seems to be needed in the
+ ;; GFam{File,Directory}Monitor case. So we use a large timeout
+ ;; for any monitor.
+ ((file-notify--test-monitor) 7)
((file-remote-p temporary-file-directory) 0.1)
(t 0.01))))
(defun file-notify--test-timeout ()
"Timeout to wait for arriving a bunch of events, in seconds."
(cond
- ((file-remote-p temporary-file-directory) 6)
+ ((file-remote-p temporary-file-directory) 20)
+ ((eq system-type 'cygwin) 10)
+ ((getenv "EMACS_EMBA_CI") 10)
((string-equal (file-notify--test-library) "w32notify") 4)
- ((eq system-type 'cygwin) 6)
(t 3)))
(defmacro file-notify--test-wait-for-events (timeout until)
@@ -199,7 +200,10 @@ Return nil when any other file notification watch is still active."
(setq file-notify-debug nil
password-cache-expiry nil
- tramp-verbose 0)
+ tramp-verbose 0
+ ;; When the remote user id is 0, Tramp refuses unsafe temporary files.
+ tramp-allow-unsafe-temporary-files
+ (or tramp-allow-unsafe-temporary-files noninteractive))
;; This should happen on hydra only.
(when (getenv "EMACS_HYDRA_CI")
@@ -256,24 +260,37 @@ remote host, or nil."
(defun file-notify--test-monitor ()
"The used monitor for the test, as a symbol.
-This returns only for the local case and gfilenotify; otherwise it is nil.
-`file-notify--test-desc' must be a valid watch descriptor."
+This returns only for (local) gfilenotify or (remote) gio library;
+otherwise it is nil. `file-notify--test-desc' must be a valid
+watch descriptor."
;; We cache the result, because after `file-notify-rm-watch',
;; `gfile-monitor-name' does not return a proper result anymore.
- ;; But we still need this information.
- ;; So far, we know the monitors GFamFileMonitor, GFenFileMonitor,
- ;; GInotifyFileMonitor, GKqueueFileMonitor and GPollFileMonitor.
- (or (cdr (assq file-notify--test-desc file-notify--test-monitors))
- (progn
- (add-to-list
- 'file-notify--test-monitors
- (cons file-notify--test-desc
- (if (file-remote-p temporary-file-directory)
- (tramp-get-connection-property
- file-notify--test-desc "gio-file-monitor" nil)
- (and (functionp 'gfile-monitor-name)
- (gfile-monitor-name file-notify--test-desc)))))
- (cdr (assq file-notify--test-desc file-notify--test-monitors)))))
+ ;; But we still need this information. So far, we know the monitors
+ ;; GFamFileMonitor (gfilenotify on cygwin), GFamDirectoryMonitor
+ ;; (gfilenotify on Solaris), GInotifyFileMonitor (gfilenotify and
+ ;; gio on GNU/Linux), GKqueueFileMonitor (gfilenotify and gio on
+ ;; FreeBSD) and GPollFileMonitor (gio on cygwin).
+ (when file-notify--test-desc
+ (or (alist-get file-notify--test-desc file-notify--test-monitors)
+ (when (member (file-notify--test-library) '("gfilenotify" "gio"))
+ (add-to-list
+ 'file-notify--test-monitors
+ (cons file-notify--test-desc
+ (if (file-remote-p temporary-file-directory)
+ ;; `file-notify--test-desc' is the connection process.
+ (progn
+ (while (not (tramp-connection-property-p
+ file-notify--test-desc "gio-file-monitor"))
+ (accept-process-output file-notify--test-desc 0))
+ (tramp-get-connection-property
+ file-notify--test-desc "gio-file-monitor" nil))
+ (and (functionp 'gfile-monitor-name)
+ (gfile-monitor-name file-notify--test-desc)))))
+ ;; If we don't know the monitor, there are good chances the
+ ;; test will fail. We let it fail already here, in order to
+ ;; know the real reason.
+ (should (alist-get file-notify--test-desc file-notify--test-monitors)))
+ (alist-get file-notify--test-desc file-notify--test-monitors))))
(defmacro file-notify--deftest-remote (test docstring &optional unstable)
"Define ert `TEST-remote' for remote files.
@@ -484,6 +501,9 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
(file-notify-add-watch
file-notify--test-tmpfile
'(change) #'second-callback)))
+ ;; `file-notify-rm-watch' confuses `file-notify--test-monitor'.
+ ;; Initialize it in time.
+ (file-notify--test-monitor)
;; Remove first watch.
(file-notify-rm-watch file-notify--test-desc)
;; Only the second callback shall run.
@@ -547,6 +567,10 @@ and the event to `file-notify--test-events'."
file-notify--test-results
(append file-notify--test-results `(,result))))))
+(defun file-notify--test-event-actions ()
+ "Helper function to return retrieved actions, as list."
+ (mapcar #'file-notify--test-event-action file-notify--test-events))
+
(defun file-notify--test-with-actions-check (actions)
"Check whether received actions match one of the ACTIONS alternatives."
(let (result)
@@ -555,22 +579,25 @@ and the event to `file-notify--test-events'."
(or result
(if (eq (car elt) :random)
(equal (sort (cdr elt) 'string-lessp)
- (sort (mapcar #'file-notify--test-event-action
- file-notify--test-events)
+ (sort (file-notify--test-event-actions)
'string-lessp))
- (equal elt (mapcar #'file-notify--test-event-action
- file-notify--test-events))))))))
+ (equal elt (file-notify--test-event-actions))))))
+ ;; Do not report result in case we debug. Write messages instead.
+ (if file-notify-debug
+ (prog1 t
+ (if result
+ (message "Success\n%s" (file-notify--test-event-actions))
+ (message (file-notify--test-with-actions-explainer actions))))
+ result)))
(defun file-notify--test-with-actions-explainer (actions)
"Explain why `file-notify--test-with-actions-check' fails."
(if (null (cdr actions))
(format "Received actions do not match expected actions\n%s\n%s"
- (mapcar #'file-notify--test-event-action file-notify--test-events)
- (car actions))
+ (file-notify--test-event-actions) (car actions))
(format
"Received actions do not match any sequence of expected actions\n%s\n%s"
- (mapcar #'file-notify--test-event-action file-notify--test-events)
- actions)))
+ (file-notify--test-event-actions) actions)))
(put 'file-notify--test-with-actions-check 'ert-explainer
'file-notify--test-with-actions-explainer)
@@ -592,6 +619,9 @@ delivered."
(mapcar
(lambda (x) (length (if (eq (car x) :random) (cdr x) x)))
actions)))
+ ;; Don't stop while debugging.
+ (while-no-input-ignore-events
+ (cons 'file-notify while-no-input-ignore-events))
create-lockfiles)
;; Flush pending actions.
(file-notify--test-read-event)
@@ -632,16 +662,11 @@ delivered."
'(change) #'file-notify--test-event-handler)))
(file-notify--test-with-actions
(cond
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `created' event reliably.
- ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
- '((deleted stopped)
- (created deleted stopped)))
- ;; cygwin does not raise a `changed' event.
- ((eq system-type 'cygwin)
- '(created deleted stopped))
- ;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ;; GFam{File,Directory}Monitor, GKqueueFileMonitor and
+ ;; GPollFileMonitor do not report the `changed' event.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor
+ GKqueueFileMonitor GPollFileMonitor))
'(created deleted stopped))
(t '(created changed deleted stopped)))
(write-region
@@ -668,13 +693,14 @@ delivered."
'(change) #'file-notify--test-event-handler)))
(file-notify--test-with-actions
(cond
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `changed' event reliably.
- ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
+ ;; GFam{File,Directory}Monitor and GPollFileMonitor do
+ ;; not detect the `changed' event reliably.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
'((deleted stopped)
(changed deleted stopped)))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(deleted stopped))
;; There could be one or two `changed' events.
(t '((changed deleted stopped)
@@ -709,25 +735,22 @@ delivered."
;; events for the watched directory.
((string-equal (file-notify--test-library) "w32notify")
'(created changed deleted))
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `created' event reliably.
- ((string-equal
- (file-notify--test-library) "gvfs-monitor-dir.exe")
- '((deleted stopped)
- (created deleted stopped)))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed deleted))
;; There are two `deleted' events, for the file and for
- ;; the directory. Except for cygwin and kqueue. And
- ;; cygwin does not raise a `changed' event.
- ((eq system-type 'cygwin)
+ ;; the directory. Except for
+ ;; GFam{File,Directory}Monitor, GPollFileMonitor and
+ ;; kqueue. And GFam{File,Directory}Monitor and
+ ;; GPollFileMonitordo not raise a `changed' event.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed deleted stopped))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(created deleted deleted stopped))
(t '(created changed deleted deleted stopped)))
(write-region
@@ -762,15 +785,12 @@ delivered."
'(created changed created changed
changed changed changed
deleted deleted))
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `created' event reliably.
- ((string-equal
- (file-notify--test-library) "gvfs-monitor-dir.exe")
- '((deleted stopped)
- (created created deleted stopped)))
;; There are three `deleted' events, for two files and
- ;; for the directory. Except for cygwin and kqueue.
- ((eq system-type 'cygwin)
+ ;; for the directory. Except for
+ ;; GFam{File,Directory}Monitor, GPollFileMonitor and
+ ;; kqueue.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
'(created created changed changed deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed created changed deleted stopped))
@@ -779,7 +799,7 @@ delivered."
((getenv "EMACS_EMBA_CI")
'(created changed created changed deleted deleted))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(created created deleted deleted deleted stopped))
(t '(created changed created changed
deleted deleted deleted stopped)))
@@ -819,26 +839,23 @@ delivered."
;; events for the watched directory.
((string-equal (file-notify--test-library) "w32notify")
'(created changed renamed deleted))
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `created' event reliably.
- ((string-equal
- (file-notify--test-library) "gvfs-monitor-dir.exe")
- '((deleted stopped)
- (created deleted stopped)))
;; On emba, `deleted' and `stopped' events of the
;; directory are not detected.
((getenv "EMACS_EMBA_CI")
'(created changed renamed deleted))
;; There are two `deleted' events, for the file and for
- ;; the directory. Except for cygwin and kqueue. And
- ;; cygwin raises `created' and `deleted' events instead
- ;; of a `renamed' event.
- ((eq system-type 'cygwin)
+ ;; the directory. Except for
+ ;; GFam{File,Directory}Monitor, GPollfileMonitor and
+ ;; kqueue. And GFam{File,Directory}Monitor and
+ ;; GPollFileMonitor raise `created' and `deleted' events
+ ;; instead of a `renamed' event.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
'(created created deleted deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed renamed deleted stopped))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(created renamed deleted deleted stopped))
(t '(created changed renamed deleted deleted stopped)))
(write-region
@@ -857,8 +874,8 @@ delivered."
(file-notify--test-cleanup))
(unwind-protect
- ;; Check attribute change. Does not work for cygwin.
- (unless (eq system-type 'cygwin)
+ ;; Check attribute change.
+ (progn
(setq file-notify--test-tmpfile (file-notify--test-make-temp-name))
(write-region
"any text" nil file-notify--test-tmpfile nil 'no-message)
@@ -876,12 +893,21 @@ delivered."
((string-equal (file-notify--test-library) "w32notify")
'((changed changed)
(changed changed changed changed)))
- ;; GKqueueFileMonitor does not report the `attribute-changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil)
- ;; For kqueue and in the remote case, `write-region'
- ;; raises also an `attribute-changed' event.
- ((or (string-equal (file-notify--test-library) "kqueue")
- (file-remote-p temporary-file-directory))
+ ;; GFam{File,Directory}Monitor, GKqueueFileMonitor and
+ ;; GPollFileMonitor do not report the `attribute-changed'
+ ;; event.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor
+ GKqueueFileMonitor GPollFileMonitor))
+ '())
+ ;; For GInotifyFileMonitor,`write-region' raises
+ ;; also an `attribute-changed' event on gio.
+ ((and (string-equal (file-notify--test-library) "gio")
+ (eq (file-notify--test-monitor) 'GInotifyFileMonitor))
+ '(attribute-changed attribute-changed attribute-changed))
+ ;; For kqueue, `write-region' raises also an
+ ;; `attribute-changed' event.
+ ((string-equal (file-notify--test-library) "kqueue")
'(attribute-changed attribute-changed attribute-changed))
(t '(attribute-changed attribute-changed)))
(write-region
@@ -901,7 +927,7 @@ delivered."
(file-notify--test-cleanup)))
(file-notify--deftest-remote file-notify-test03-events
- "Check file creation/change/removal notifications for remote files.")
+ "Check file creation/change/removal notifications for remote files." t)
(require 'autorevert)
(setq auto-revert-notify-exclude-dir-regexp "nothing-to-be-excluded"
@@ -946,7 +972,7 @@ delivered."
;; GKqueueFileMonitor does not report the `changed' event.
(skip-unless
- (not (equal (file-notify--test-monitor) 'GKqueueFileMonitor)))
+ (not (eq (file-notify--test-monitor) 'GKqueueFileMonitor)))
;; Check, that file notification has been used.
(should auto-revert-mode)
@@ -1046,13 +1072,14 @@ delivered."
(should (file-notify-valid-p file-notify--test-desc))
(file-notify--test-with-actions
(cond
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `changed' event reliably.
- ((string-equal (file-notify--test-library) "gvfs-monitor-dir.exe")
+ ;; GFam{File,Directory}Monitor do not
+ ;; detect the `changed' event reliably.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor))
'((deleted stopped)
(changed deleted stopped)))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(deleted stopped))
;; There could be one or two `changed' events.
(t '((changed deleted stopped)
@@ -1090,21 +1117,18 @@ delivered."
;; events for the watched directory.
((string-equal (file-notify--test-library) "w32notify")
'(created changed deleted))
- ;; gvfs-monitor-dir on cygwin does not detect the
- ;; `created' event reliably.
- ((string-equal
- (file-notify--test-library) "gvfs-monitor-dir.exe")
- '((deleted stopped)
- (created deleted stopped)))
;; There are two `deleted' events, for the file and for
- ;; the directory. Except for cygwin and kqueue. And
- ;; cygwin does not raise a `changed' event.
- ((eq system-type 'cygwin)
+ ;; the directory. Except for
+ ;; GFam{File,Directory}Monitor, GPollFileMonitor and
+ ;; kqueue. And GFam{File,Directory}Monitor and
+ ;; GPollfileMonitor do not raise a `changed' event.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
'(created deleted stopped))
((string-equal (file-notify--test-library) "kqueue")
'(created changed deleted stopped))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(created deleted deleted stopped))
(t '(created changed deleted deleted stopped)))
(write-region
@@ -1205,7 +1229,7 @@ delivered."
file-notify--test-tmpfile
'(change) #'file-notify--test-event-handler)))
(unwind-protect
- (let ((n 1000)
+ (let ((n 10);00)
source-file-list target-file-list
(default-directory file-notify--test-tmpfile))
(dotimes (i n)
@@ -1234,9 +1258,11 @@ delivered."
(dotimes (_i n)
(setq r (append '(deleted renamed) r)))
r))
- ;; cygwin fires `changed' and `deleted' events, sometimes
- ;; in random order.
- ((eq system-type 'cygwin)
+ ;; GFam{File,Directory}Monitor and GPollFileMonitor fire
+ ;; `changed' and `deleted' events, sometimes in random
+ ;; order.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
(let (r)
(dotimes (_i n)
(setq r (append '(changed deleted) r)))
@@ -1285,7 +1311,7 @@ delivered."
(file-notify--test-with-actions
(cond
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor) nil)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor) '())
;; There could be one or two `changed' events.
(t '((changed)
(changed changed))))
@@ -1323,11 +1349,13 @@ delivered."
(should (file-notify-valid-p file-notify--test-desc))
(file-notify--test-with-actions
(cond
- ;; On cygwin we only get the `changed' event.
- ((eq system-type 'cygwin)
- '(changed))
+ ;; GFam{File,Directory}Monitor and GPollFileMonitor
+ ;; report only the `changed' event.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
+ '(changed))
;; GKqueueFileMonitor does not report the `changed' event.
- ((equal (file-notify--test-monitor) 'GKqueueFileMonitor)
+ ((eq (file-notify--test-monitor) 'GKqueueFileMonitor)
'(renamed created))
(t '(renamed created changed)))
;; The file is renamed when creating a backup. It shall
@@ -1398,7 +1426,7 @@ the file watch."
(should (file-notify-valid-p file-notify--test-desc1))
(should (file-notify-valid-p file-notify--test-desc2))
(should-not (equal file-notify--test-desc1 file-notify--test-desc2))
- (let ((n 100))
+ (let ((n 10));0))
;; Run the test.
(file-notify--test-with-actions
;; There could be one or two `changed' events.
@@ -1455,10 +1483,13 @@ the file watch."
;; Now we delete the directory.
(file-notify--test-with-actions
(cond
- ;; In kqueue and for cygwin, just one `deleted' event for
- ;; the directory is received.
- ((or (eq system-type 'cygwin)
- (string-equal (file-notify--test-library) "kqueue"))
+ ;; GFam{File,Directory}Monitor, GPollFileMonitor and
+ ;; kqueue raise just one `deleted' event for the
+ ;; directory.
+ ((memq (file-notify--test-monitor)
+ '(GFamFileMonitor GFamDirectoryMonitor GPollFileMonitor))
+ '(deleted stopped))
+ ((string-equal (file-notify--test-library) "kqueue")
'(deleted stopped))
(t (append
;; The directory monitor raises a `deleted' event for
diff --git a/test/lisp/files-resources/.dir-locals.el b/test/lisp/files-resources/.dir-locals.el
new file mode 100644
index 00000000000..84393aa54d5
--- /dev/null
+++ b/test/lisp/files-resources/.dir-locals.el
@@ -0,0 +1,5 @@
+;; This is used by files-tests.el.
+((auto-mode-alist . (("\\.quux\\'" . tcl-mode)
+ ("\\.zot1\\'" . foobar)
+ ("\\.zot2\\'" . (lambda ()))
+ ("\\.zot3\\'" . dired-mode))))
diff --git a/test/lisp/files-resources/auto-test.zot1 b/test/lisp/files-resources/auto-test.zot1
new file mode 100644
index 00000000000..80acfcc9f7a
--- /dev/null
+++ b/test/lisp/files-resources/auto-test.zot1
@@ -0,0 +1 @@
+zot1
diff --git a/test/lisp/files-resources/auto-test.zot2 b/test/lisp/files-resources/auto-test.zot2
new file mode 100644
index 00000000000..975fc765513
--- /dev/null
+++ b/test/lisp/files-resources/auto-test.zot2
@@ -0,0 +1 @@
+zot2
diff --git a/test/lisp/files-resources/auto-test.zot3 b/test/lisp/files-resources/auto-test.zot3
new file mode 100644
index 00000000000..faa07151606
--- /dev/null
+++ b/test/lisp/files-resources/auto-test.zot3
@@ -0,0 +1 @@
+zot3
diff --git a/test/lisp/files-resources/whatever.quux b/test/lisp/files-resources/whatever.quux
new file mode 100644
index 00000000000..595583b911e
--- /dev/null
+++ b/test/lisp/files-resources/whatever.quux
@@ -0,0 +1,2 @@
+# Used by files-test.el.
+# Due to .dir-locals.el this should end up in Tcl mode.
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 149cc689ae9..fb24b98595b 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -151,6 +151,19 @@ form.")
(dolist (subtest (cdr test))
(should (file-test--do-local-variables-test str subtest)))))))
+(ert-deftest files-tests-permanent-local-variables ()
+ (let ((enable-local-variables nil))
+ (with-temp-buffer
+ (insert ";;; test-test.el --- tests -*- lexical-binding: t; -*-\n\n")
+ (hack-local-variables)
+ (should (eq lexical-binding t))))
+ (let ((enable-local-variables nil)
+ (permanently-enabled-local-variables nil))
+ (with-temp-buffer
+ (insert ";;; test-test.el --- tests -*- lexical-binding: t; -*-\n\n")
+ (hack-local-variables)
+ (should (eq lexical-binding nil)))))
+
(defvar files-test-bug-18141-file
(ert-resource-file "files-bug18141.el.gz")
"Test file for bug#18141.")
@@ -192,14 +205,37 @@ form.")
(ert-deftest files-tests-bug-21454 ()
"Test for https://debbugs.gnu.org/21454 ."
(let ((input-result
- '(("/foo/bar//baz/:/bar/foo/baz//" nil ("/foo/bar/baz/" "/bar/foo/baz/"))
- ("/foo/bar/:/bar/qux/:/qux/foo" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("//foo/bar/:/bar/qux/:/qux/foo/" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo/bar/:/bar/qux/:/qux/foo/" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo//bar/:/bar/qux/:/qux/foo/" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo//bar/:/bar/qux/:/qux/foo" nil ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
- ("/foo/bar" "$FOO/baz/:/qux/foo/" ("/foo/bar/baz/" "/qux/foo/"))
- ("//foo/bar/" "$FOO/baz/:/qux/foo/" ("/foo/bar/baz/" "/qux/foo/"))))
+ (if (memq system-type '(windows-nt ms-dos))
+ '(("/foo/bar//baz/;/bar/foo/baz//" nil
+ ("/foo/bar//baz/" "/bar/foo/baz//"))
+ ("x:/foo/bar/;y:/bar/qux/;z:/qux/foo" nil
+ ("x:/foo/bar/" "y:/bar/qux/" "z:/qux/foo/"))
+ ("x://foo/bar/;y:/bar/qux/;z:/qux/foo/" nil
+ ("x://foo/bar/" "y:/bar/qux/" "z:/qux/foo/"))
+ ("x:/foo/bar/;y:/bar/qux/;z:/qux/foo/" nil
+ ("x:/foo/bar/" "y:/bar/qux/" "z:/qux/foo/"))
+ ("x:/foo//bar/;y:/bar/qux/;z:/qux/foo/" nil
+ ("x:/foo//bar/" "y:/bar/qux/" "z:/qux/foo/"))
+ ("x:/foo//bar/;y:/bar/qux/;z:/qux/foo" nil
+ ("x:/foo//bar/" "y:/bar/qux/" "z:/qux/foo/"))
+ ("x:/foo/bar" "$FOO/baz/;z:/qux/foo/"
+ ("x:/foo/bar/baz/" "z:/qux/foo/"))
+ ("//foo/bar/" "$FOO/baz/;/qux/foo/"
+ ("/foo/bar//baz/" "/qux/foo/")))
+ '(("/foo/bar//baz/:/bar/foo/baz//" nil
+ ("/foo/bar//baz/" "/bar/foo/baz//"))
+ ("/foo/bar/:/bar/qux/:/qux/foo" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("//foo/bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo/bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo/" nil
+ ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo//bar/:/bar/qux/:/qux/foo" nil
+ ("/foo//bar/" "/bar/qux/" "/qux/foo/"))
+ ("/foo/bar" "$FOO/baz/:/qux/foo/" ("/foo/bar/baz/" "/qux/foo/"))
+ ("//foo/bar/" "$FOO/baz/:/qux/foo/" ("/foo/bar//baz/" "/qux/foo/")))))
(foo-env (getenv "FOO"))
(bar-env (getenv "BAR")))
(unwind-protect
@@ -279,12 +315,17 @@ be $HOME."
(file-name-unquote temporary-file-directory))))))
(ert-deftest files-tests-file-name-non-special--subprocess ()
- "Check that Bug#25949 is fixed."
- (skip-unless (executable-find "true"))
- (let ((default-directory (file-name-quote temporary-file-directory)))
- (should (zerop (process-file "true")))
- (should (processp (start-file-process "foo" nil "true")))
- (should (zerop (shell-command "true")))))
+ "Check that Bug#25949 and Bug#48177 are fixed."
+ (skip-unless (and (executable-find "true") (file-exists-p null-device)
+ ;; These systems cannot set date of the null device.
+ (not (memq system-type '(windows-nt ms-dos)))))
+ (let ((default-directory (file-name-quote temporary-file-directory))
+ (true (file-name-quote (executable-find "true")))
+ (null (file-name-quote null-device)))
+ (should (zerop (process-file true null `((:file ,null) ,null))))
+ (should (processp (start-file-process "foo" nil true)))
+ (should (zerop (shell-command true)))
+ (should (processp (make-process :name "foo" :command `(,true))))))
(defmacro files-tests--with-advice (symbol where function &rest body)
(declare (indent 3))
@@ -569,7 +610,7 @@ unquoted file names."
(ert-deftest files-tests-file-name-non-special-dired-compress-handler ()
;; `dired-compress-file' can get confused by filenames with ":" in
;; them, which causes this to fail on `windows-nt' systems.
- (when (string-match-p ":" (expand-file-name temporary-file-directory))
+ (when (string-search ":" (expand-file-name temporary-file-directory))
(ert-skip "FIXME: `dired-compress-file' unreliable when filenames contain `:'."))
(files-tests--with-temp-non-special (tmpfile nospecial)
(let ((compressed (dired-compress-file nospecial)))
@@ -692,9 +733,8 @@ unquoted file names."
(file (file-name-nondirectory tmpfile))
(nospecial-file (file-name-nondirectory nospecial)))
(should-not (string-equal file nospecial-file))
- (should-not (equal (file-name-all-completions
- nospecial-file nospecial-tempdir)
- (file-name-all-completions file tmpdir)))
+ (should (equal (file-name-all-completions nospecial-file nospecial-tempdir)
+ (file-name-all-completions file tmpdir)))
(should (equal (file-name-all-completions file nospecial-tempdir)
(file-name-all-completions file tmpdir)))
(should (equal (file-name-all-completions nospecial-file tmpdir)
@@ -736,8 +776,8 @@ unquoted file names."
(file (file-name-nondirectory tmpfile))
(nospecial-file (file-name-nondirectory nospecial)))
(should-not (string-equal file nospecial-file))
- (should-not (equal (file-name-completion nospecial-file nospecial-tempdir)
- (file-name-completion file tmpdir)))
+ (should (equal (file-name-completion nospecial-file nospecial-tempdir)
+ (file-name-completion file tmpdir)))
(should (equal (file-name-completion file nospecial-tempdir)
(file-name-completion file tmpdir)))
(should (equal (file-name-completion nospecial-file tmpdir)
@@ -857,10 +897,15 @@ unquoted file names."
(find-backup-file-name tmpfile)))))))
(ert-deftest files-tests-file-name-non-special-get-file-buffer ()
+ ;; Make sure these buffers don't exist.
(files-tests--with-temp-non-special (tmpfile nospecial)
- (should-not (get-file-buffer nospecial)))
+ (let ((fbuf (get-file-buffer nospecial)))
+ (if fbuf (kill-buffer fbuf))
+ (should-not (get-file-buffer nospecial))))
(files-tests--with-temp-non-special-and-file-name-handler (tmpfile nospecial)
- (should-not (get-file-buffer nospecial))))
+ (let ((fbuf (get-file-buffer nospecial)))
+ (if fbuf (kill-buffer fbuf))
+ (should-not (get-file-buffer nospecial)))))
(ert-deftest files-tests-file-name-non-special-insert-directory ()
(files-tests--with-temp-non-special (tmpdir nospecial-dir t)
@@ -906,6 +951,55 @@ unquoted file names."
(make-auto-save-file-name)
(kill-buffer)))))))
+(ert-deftest files-test-auto-save-name-default ()
+ (with-temp-buffer
+ (let ((auto-save-file-name-transforms nil)
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (setq buffer-file-name "/tmp/foo.txt")
+ (should (equal (substring (make-auto-save-file-name) name-start)
+ "/tmp/#foo.txt#")))))
+
+(ert-deftest files-test-auto-save-name-transform ()
+ (with-temp-buffer
+ (setq buffer-file-name "/tmp/foo.txt")
+ (let ((auto-save-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" nil)))
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (should (equal (substring (make-auto-save-file-name) name-start)
+ "/var/tmp/#foo.txt#")))))
+
+(ert-deftest files-test-auto-save-name-unique ()
+ (with-temp-buffer
+ (setq buffer-file-name "/tmp/foo.txt")
+ (let ((auto-save-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" t)))
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (should (equal (substring (make-auto-save-file-name) name-start)
+ "/var/tmp/#!tmp!foo.txt#")))
+ (let ((auto-save-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" sha1)))
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (should (equal (substring (make-auto-save-file-name) name-start)
+ "/var/tmp/#b57c5a04f429a83305859d3350ecdab8315a9037#")))))
+
+(ert-deftest files-test-lock-name-default ()
+ (let ((lock-file-name-transforms nil)
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (should (equal (substring (make-lock-file-name "/tmp/foo.txt") name-start)
+ "/tmp/.#foo.txt"))))
+
+(ert-deftest files-test-lock-name-unique ()
+ (let ((lock-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" t)))
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (should (equal (substring (make-lock-file-name "/tmp/foo.txt") name-start)
+ "/var/tmp/.#!tmp!foo.txt")))
+ (let ((lock-file-name-transforms
+ '(("\\`/.*/\\([^/]+\\)\\'" "/var/tmp/\\1" sha1)))
+ (name-start (if (memq system-type '(windows-nt ms-dos)) 2 nil)))
+ (should (equal (substring (make-lock-file-name "/tmp/foo.txt") name-start)
+ "/var/tmp/.#b57c5a04f429a83305859d3350ecdab8315a9037"))))
+
(ert-deftest files-tests-file-name-non-special-make-directory ()
(files-tests--with-temp-non-special (tmpdir nospecial-dir t)
(let ((default-directory nospecial-dir))
@@ -1363,8 +1457,13 @@ See <https://debbugs.gnu.org/36401>."
(should (not (eq major-mode 'text-mode))))))
(ert-deftest files-colon-path ()
- (should (equal (parse-colon-path "/foo//bar/baz")
- '("/foo/bar/baz/"))))
+ (if (memq system-type '(windows-nt ms-dos))
+ (should (equal (parse-colon-path "x:/foo//bar/baz")
+ '("x:/foo//bar/baz/")))
+ (should (equal (parse-colon-path "/foo//bar/baz")
+ '("/foo//bar/baz/"))))
+ (should (equal (parse-colon-path (concat "." path-separator "/tmp"))
+ '("./" "/tmp/"))))
(ert-deftest files-test-magic-mode-alist-doctype ()
"Test that DOCTYPE and variants put files in mhtml-mode."
@@ -1432,5 +1531,34 @@ The door of all subtleties!
(buffer-substring (point-min) (point-max))
nil nil)))))
+(ert-deftest files-tests-file-name-with-extension-good ()
+ "Test that `file-name-with-extension' succeeds with reasonable input."
+ (should (string= (file-name-with-extension "Jack" "css") "Jack.css"))
+ (should (string= (file-name-with-extension "Jack" ".css") "Jack.css"))
+ (should (string= (file-name-with-extension "Jack.scss" "css") "Jack.css"))
+ (should (string= (file-name-with-extension "/path/to/Jack.md" "org") "/path/to/Jack.org")))
+
+(ert-deftest files-tests-file-name-with-extension-bad ()
+ "Test that `file-name-with-extension' fails on malformed input."
+ (should-error (file-name-with-extension nil nil))
+ (should-error (file-name-with-extension "Jack" nil))
+ (should-error (file-name-with-extension nil "css"))
+ (should-error (file-name-with-extension "" ""))
+ (should-error (file-name-with-extension "" "css"))
+ (should-error (file-name-with-extension "Jack" ""))
+ (should-error (file-name-with-extension "Jack" "."))
+ (should-error (file-name-with-extension "/is/a/directory/" "css")))
+
+(ert-deftest files-test-dir-locals-auto-mode-alist ()
+ "Test an `auto-mode-alist' entry in `.dir-locals.el'"
+ (find-file (ert-resource-file "whatever.quux"))
+ (should (eq major-mode 'tcl-mode))
+ (find-file (ert-resource-file "auto-test.zot1"))
+ (should (eq major-mode 'fundamental-mode))
+ (find-file (ert-resource-file "auto-test.zot2"))
+ (should (eq major-mode 'fundamental-mode))
+ (find-file (ert-resource-file "auto-test.zot3"))
+ (should (eq major-mode 'fundamental-mode)))
+
(provide 'files-tests)
;;; files-tests.el ends here
diff --git a/test/lisp/gnus/gnus-search-tests.el b/test/lisp/gnus/gnus-search-tests.el
index 63469f8d518..6148da65621 100644
--- a/test/lisp/gnus/gnus-search-tests.el
+++ b/test/lisp/gnus/gnus-search-tests.el
@@ -5,18 +5,20 @@
;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
;; Keywords:
-;; This program is free software; you can redistribute it and/or modify
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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,
+;; GNU Emacs 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 <http://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
@@ -47,7 +49,9 @@
(default-value 'gnus-search-expandable-keys))
(pairs
'(("su" . "subject")
- ("sin" . "since"))))
+ ("sin" . "since")
+ ("body" . "body")
+ ("list-id" . "list-id"))))
(dolist (p pairs)
(should (equal (gnus-search-query-expand-key (car p))
(cdr p))))
diff --git a/test/lisp/gnus/gnus-util-tests.el b/test/lisp/gnus/gnus-util-tests.el
index 7f64b96303f..f8d30f6373e 100644
--- a/test/lisp/gnus/gnus-util-tests.el
+++ b/test/lisp/gnus/gnus-util-tests.el
@@ -3,12 +3,12 @@
;; Author: Jens Lechtenbörger <jens.lechtenboerger@fsfe.org>
-;; This file is not part of GNU Emacs.
+;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -132,41 +132,4 @@
(should (equal '("1") (gnus-setdiff '(2 "1" 2) '(2))))
(should (equal '("1" "1") (gnus-setdiff '(2 "1" 2 "1") '(2)))))
-(ert-deftest gnus-base64-repad ()
- (should-error (gnus-base64-repad 1)
- :type 'wrong-type-argument)
-
- ;; RFC4648 test vectors
- (should (equal "" (gnus-base64-repad "")))
- (should (equal "Zg==" (gnus-base64-repad "Zg==")))
- (should (equal "Zm8=" (gnus-base64-repad "Zm8=")))
- (should (equal "Zm9v" (gnus-base64-repad "Zm9v")))
- (should (equal "Zm9vYg==" (gnus-base64-repad "Zm9vYg==")))
- (should (equal "Zm9vYmE=" (gnus-base64-repad "Zm9vYmE=")))
- (should (equal "Zm9vYmFy" (gnus-base64-repad "Zm9vYmFy")))
-
- (should (equal "Zm8=" (gnus-base64-repad "Zm8")))
- (should (equal "Zg==" (gnus-base64-repad "Zg")))
- (should (equal "Zg==" (gnus-base64-repad "Zg====")))
-
- (should-error (gnus-base64-repad " ")
- :type 'error)
- (should-error (gnus-base64-repad "Zg== ")
- :type 'error)
- (should-error (gnus-base64-repad "Z?\x00g==")
- :type 'error)
- ;; line-length
- (should-error (gnus-base64-repad "Zg====" nil 4)
- :type 'error)
- ;; reject-newlines
- (should-error (gnus-base64-repad "Zm9v\r\nYmFy" t)
- :type 'error)
- (should (equal "Zm9vYmFy" (gnus-base64-repad "Zm9vYmFy" t)))
- (should (equal "Zm9vYmFy" (gnus-base64-repad "Zm9v\r\nYmFy")))
- (should (equal "Zm9vYmFy" (gnus-base64-repad "Zm9v\r\nYmFy\n")))
- (should (equal "Zm9vYmFy" (gnus-base64-repad "Zm9v\r\n YmFy\r\n")))
- (should (equal "Zm9vYmFy" (gnus-base64-repad "Zm9v \r\n\tYmFy")))
- (should-error (gnus-base64-repad "Zm9v\r\nYmFy" nil 3)
- :type 'error))
-
;;; gnustest-gnus-util.el ends here
diff --git a/test/lisp/gnus/message-tests.el b/test/lisp/gnus/message-tests.el
index 8650053b682..b4f2b7f675d 100644
--- a/test/lisp/gnus/message-tests.el
+++ b/test/lisp/gnus/message-tests.el
@@ -1,4 +1,4 @@
-;;; message-mode-tests.el --- Tests for message-mode -*- lexical-binding: t; -*-
+;;; message-tests.el --- Tests for message-mode -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
@@ -154,6 +154,35 @@
"\"larsi@gnus.org\" <larsi@gnus.org>")
"larsi@gnus.org")))
+(ert-deftest message-replace-header ()
+ (with-temp-buffer
+ (save-excursion
+ (insert "From: dang@gnus.org
+To: user1,
+ user2
+Cc: user3,
+ user4
+--text follows this line--
+Hello.
+"))
+ (save-excursion
+ (message-replace-header "From" "ding@gnus.org")
+ (should (cl-search "ding" (message-field-value "From"))))
+ (save-excursion
+ (message-replace-header "From" "dong@gnus.org" "To")
+ (should (cl-search "dong" (message-field-value "From")))
+ (should (re-search-forward "From:"))
+ (should-error (re-search-forward "To:"))
+ (should (re-search-forward "Cc:")))
+ (save-excursion
+ (message-replace-header "From" "dang@gnus.org" (split-string "To Cc"))
+ (should (cl-search "dang" (message-field-value "From")))
+ (should (re-search-forward "From:"))
+ (should-error (re-search-forward "To:"))
+ ;; That this isn't so is probably a bug from 1997.
+ ;; (should-error (re-search-forward "Cc:"))
+ )))
+
(provide 'message-mode-tests)
;;; message-mode-tests.el ends here
diff --git a/test/lisp/gnus/mm-decode-tests.el b/test/lisp/gnus/mm-decode-tests.el
index 7d059cb3f87..586097aaf31 100644
--- a/test/lisp/gnus/mm-decode-tests.el
+++ b/test/lisp/gnus/mm-decode-tests.el
@@ -4,10 +4,10 @@
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/test/lisp/gnus/mml-sec-tests.el b/test/lisp/gnus/mml-sec-tests.el
index b743187030f..a7ed7d3975b 100644
--- a/test/lisp/gnus/mml-sec-tests.el
+++ b/test/lisp/gnus/mml-sec-tests.el
@@ -1,14 +1,15 @@
;;; mml-sec-tests.el --- Tests mml-sec.el, see README-mml-secure.txt. -*- lexical-binding:t -*-
+
;; Copyright (C) 2015, 2020-2021 Free Software Foundation, Inc.
;; Author: Jens Lechtenbörger <jens.lechtenboerger@fsfe.org>
-;; This file is not part of GNU Emacs.
+;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/test/lisp/gnus/nnrss-tests.el b/test/lisp/gnus/nnrss-tests.el
index 9821ec76fb4..92b7dacf180 100644
--- a/test/lisp/gnus/nnrss-tests.el
+++ b/test/lisp/gnus/nnrss-tests.el
@@ -26,4 +26,20 @@
(should (equal (nnrss-normalize-date "2004-09-17T05:09:49.001+00:00")
"Fri, 17 Sep 2004 05:09:49 +0000")))
+(defconst test-nnrss-xml
+ '((rss
+ ((version . "2.0")
+ (xmlns:dc . "http://purl.org/dc/elements/1.1/"))
+ (channel
+ ((xmlns:content . "http://purl.org/rss/1.0/modules/content/"))))))
+
+(ert-deftest test-nnrss-namespace-top ()
+ (should (equal (nnrss-get-namespace-prefix
+ test-nnrss-xml "http://purl.org/dc/elements/1.1/")
+ "dc:")))
+(ert-deftest test-nnrss-namespace-inner ()
+ (should (equal (nnrss-get-namespace-prefix
+ test-nnrss-xml "http://purl.org/rss/1.0/modules/content/")
+ "content:")))
+
;;; nnrss-tests.el ends here
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el
index 80d90daaf91..513a0c2daea 100644
--- a/test/lisp/help-fns-tests.el
+++ b/test/lisp/help-fns-tests.el
@@ -62,7 +62,9 @@ Return first line of the output of (describe-function-1 FUNC)."
(should (string-match regexp result))))
(ert-deftest help-fns-test-lisp-defun ()
- (let ((regexp "a compiled Lisp function in .+subr\\.el")
+ (let ((regexp (if (featurep 'native-compile)
+ "a native compiled Lisp function in .+subr\\.el"
+ "a compiled Lisp function in .+subr\\.el"))
(result (help-fns-tests--describe-function 'last)))
(should (string-match regexp result))))
diff --git a/test/lisp/help-tests.el b/test/lisp/help-tests.el
index 8034764741c..871417da3d2 100644
--- a/test/lisp/help-tests.el
+++ b/test/lisp/help-tests.el
@@ -26,6 +26,7 @@
(require 'ert)
(eval-when-compile (require 'cl-lib))
+(require 'text-property-search) ; for `text-property-search-forward'
(ert-deftest help-split-fundoc-SECTION ()
"Test new optional arg SECTION."
@@ -60,9 +61,8 @@
(defmacro with-substitute-command-keys-test (&rest body)
`(cl-flet* ((test
(lambda (orig result)
- (should (equal-including-properties
- (substitute-command-keys orig)
- result))))
+ (should (equal (substitute-command-keys orig)
+ result))))
(test-re
(lambda (orig regexp)
(should (string-match (concat "^" regexp "$")
@@ -110,14 +110,19 @@ C-<tab> file-cache-minibuffer-complete
<prior> switch-to-completions
<up> previous-line-or-history-element
+M-g Prefix Command
M-v switch-to-completions
+M-g ESC Prefix Command
+
M-< minibuffer-beginning-of-buffer
M-n next-history-element
M-p previous-history-element
M-r previous-matching-history-element
M-s next-matching-history-element
+M-g M-c switch-to-completions
+
")))
(ert-deftest help-tests-substitute-command-keys/keymap-change ()
@@ -222,6 +227,24 @@ M-s next-matching-history-element
(define-minor-mode help-tests-minor-mode
"Minor mode for testing shadowing.")
+(ert-deftest help-tests-substitute-command-keys/add-key-face ()
+ (should (equal (substitute-command-keys "\\[next-line]")
+ (propertize "C-n"
+ 'face 'help-key-binding
+ 'font-lock-face 'help-key-binding))))
+
+(ert-deftest help-tests-substitute-command-keys/add-key-face-listing ()
+ (with-temp-buffer
+ (insert (substitute-command-keys "\\{help-tests-minor-mode-map}"))
+ (goto-char (point-min))
+ (text-property-search-forward 'face 'help-key-binding)
+ (should (looking-at "C-e"))
+ ;; Don't fontify trailing whitespace.
+ (should-not (get-text-property (+ (point) 3) 'face))
+ (text-property-search-forward 'face 'help-key-binding)
+ (should (looking-at "x"))
+ (should-not (get-text-property (+ (point) 1) 'face))))
+
(ert-deftest help-tests-substitute-command-keys/test-mode ()
(with-substitute-command-keys-test
(with-temp-buffer
diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el
index ab7585ca050..aa8600609c4 100644
--- a/test/lisp/image-tests.el
+++ b/test/lisp/image-tests.el
@@ -25,7 +25,7 @@
(require 'cl-lib))
(defconst image-tests--emacs-images-directory
- (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY"))
+ (expand-file-name "images" data-directory)
"Directory containing Emacs images.")
(ert-deftest image--set-property ()
@@ -48,6 +48,20 @@
(setf (image-property image :width) nil)
(should (equal image '(image)))))
+(ert-deftest image-find-image ()
+ (find-image '((:type xpm :file "undo.xpm")))
+ (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center))))
+
+(ert-deftest image-type-from-file-name ()
+ (should (eq (image-type-from-file-name "foo.jpg") 'jpeg))
+ (should (eq (image-type-from-file-name "foo.png") 'png)))
+
+(ert-deftest image-type/from-filename ()
+ ;; On emba, `image-types' and `image-load-path' do not exist.
+ (skip-unless (and (bound-and-true-p image-types)
+ (bound-and-true-p image-load-path)))
+ (should (eq (image-type "foo.jpg") 'jpeg)))
+
(ert-deftest image-type-from-file-header-test ()
"Test image-type-from-file-header."
(should (eq (if (image-type-available-p 'svg) 'svg)
diff --git a/test/lisp/info-xref-tests.el b/test/lisp/info-xref-tests.el
index 95af21fb591..ecba86146f1 100644
--- a/test/lisp/info-xref-tests.el
+++ b/test/lisp/info-xref-tests.el
@@ -1,4 +1,4 @@
-;;; info-xref.el --- tests for info-xref.el -*- lexical-binding:t -*-
+;;; info-xref-tests.el --- tests for info-xref.el -*- lexical-binding:t -*-
;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/international/mule-util-resources/utf-8.txt b/test/lisp/international/mule-util-resources/utf-8.txt
new file mode 100644
index 00000000000..385bbb4ba80
--- /dev/null
+++ b/test/lisp/international/mule-util-resources/utf-8.txt
@@ -0,0 +1,2 @@
+Thís is a test line 1.
+Line 2.
diff --git a/test/lisp/international/mule-util-tests.el b/test/lisp/international/mule-util-tests.el
index 6518be66dbe..0fcff9d02dd 100644
--- a/test/lisp/international/mule-util-tests.el
+++ b/test/lisp/international/mule-util-tests.el
@@ -22,6 +22,7 @@
;;; Code:
(require 'ert)
+(require 'ert-x)
(require 'mule-util)
(defconst mule-util-test-truncate-data
@@ -82,4 +83,43 @@
(dotimes (i (length mule-util-test-truncate-data))
(mule-util-test-truncate-create i))
+(ert-deftest filepos/bufferpos-tests-utf-8 ()
+ (let ((coding-system-for-read 'utf-8-unix))
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "utf-8.txt"))
+ (should (eq buffer-file-coding-system 'utf-8-unix))
+ ;; First line is "Thís is a test line 1.".
+ ;; Bytes start counting at 0; chars at 1.
+ (should (= (filepos-to-bufferpos 1 'exact) 2))
+ (should (= (bufferpos-to-filepos 2 'exact) 1))
+ ;; After non-ASCII.
+ (should (= (filepos-to-bufferpos 4 'exact) 4))
+ (should (= (bufferpos-to-filepos 4 'exact) 4)))))
+
+(ert-deftest filepos/bufferpos-tests-binary ()
+ (let ((coding-system-for-read 'binary))
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "utf-8.txt"))
+ (should (eq buffer-file-coding-system 'no-conversion))
+ ;; First line is "Thís is a test line 1.".
+ ;; Bytes start counting at 0; chars at 1.
+ (should (= (filepos-to-bufferpos 1 'exact) 2))
+ (should (= (bufferpos-to-filepos 2 'exact) 1))
+ ;; After non-ASCII.
+ (should (= (filepos-to-bufferpos 4 'exact) 5))
+ (should (= (bufferpos-to-filepos 5 'exact) 4)))))
+
+(ert-deftest filepos/bufferpos-tests-undecided ()
+ (let ((coding-system-for-read 'binary))
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "utf-8.txt"))
+ (setq buffer-file-coding-system 'undecided)
+ (should-error (filepos-to-bufferpos 1 'exact))
+ (should-error (bufferpos-to-filepos 2 'exact))
+ (should (= (filepos-to-bufferpos 1 'approximate) 2))
+ (should (= (bufferpos-to-filepos 2 'approximate) 1))
+ ;; After non-ASCII.
+ (should (= (filepos-to-bufferpos 4 'approximate) 5))
+ (should (= (bufferpos-to-filepos 5 'approximate) 4)))))
+
;;; mule-util-tests.el ends here
diff --git a/test/lisp/international/ucs-normalize-tests.el b/test/lisp/international/ucs-normalize-tests.el
index a2da73767bc..51f4ed3a80e 100644
--- a/test/lisp/international/ucs-normalize-tests.el
+++ b/test/lisp/international/ucs-normalize-tests.el
@@ -1,4 +1,4 @@
-;;; ucs-normalize --- tests for international/ucs-normalize.el -*- lexical-binding: t -*-
+;;; ucs-normalize-tests.el --- tests for international/ucs-normalize.el -*- lexical-binding: t -*-
;; Copyright (C) 2002-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/json-tests.el b/test/lisp/json-tests.el
index 11b61d8b47e..f400fb064a6 100644
--- a/test/lisp/json-tests.el
+++ b/test/lisp/json-tests.el
@@ -329,13 +329,13 @@ Point is moved to beginning of the buffer."
(should (equal (read str) res)))))))
(ert-deftest test-json-encode-number ()
- (should (equal (json-encode-number 0) "0"))
- (should (equal (json-encode-number -0) "0"))
- (should (equal (json-encode-number 3) "3"))
- (should (equal (json-encode-number -5) "-5"))
- (should (equal (json-encode-number 123.456) "123.456"))
+ (should (equal (json-encode 0) "0"))
+ (should (equal (json-encode -0) "0"))
+ (should (equal (json-encode 3) "3"))
+ (should (equal (json-encode -5) "-5"))
+ (should (equal (json-encode 123.456) "123.456"))
(let ((bignum (1+ most-positive-fixnum)))
- (should (equal (json-encode-number bignum)
+ (should (equal (json-encode bignum)
(number-to-string bignum)))))
;;; Strings
@@ -404,6 +404,8 @@ Point is moved to beginning of the buffer."
(should (equal (json-read-string) "abcαβγ")))
(json-tests--with-temp-buffer "\"\\nasd\\u0444\\u044b\\u0432fgh\\t\""
(should (equal (json-read-string) "\nasdфывfgh\t")))
+ (json-tests--with-temp-buffer "\"abc\uFFFFαβγ𝔸𝐁𝖢\\\"\\\\\""
+ (should (equal (json-read-string) "abc\uFFFFαβγ𝔸𝐁𝖢\"\\")))
;; Bug#24784
(json-tests--with-temp-buffer "\"\\uD834\\uDD1E\""
(should (equal (json-read-string) "\U0001D11E")))
@@ -418,21 +420,37 @@ Point is moved to beginning of the buffer."
(should (equal (json-encode-string "foo") "\"foo\""))
(should (equal (json-encode-string "a\n\fb") "\"a\\n\\fb\""))
(should (equal (json-encode-string "\nasdфыв\u001f\u007ffgh\t")
- "\"\\nasdфыв\\u001f\u007ffgh\\t\"")))
+ "\"\\nasdфыв\\u001f\u007ffgh\\t\""))
+ ;; Bug#43549.
+ (should (equal (json-encode-string (propertize "foo" 'read-only t))
+ "\"foo\""))
+ (should (equal (json-encode-string "a\0b") "\"a\\u0000b\""))
+ (should (equal (json-encode-string "abc\uFFFFαβγ𝔸𝐁𝖢\"\\")
+ "\"abc\uFFFFαβγ𝔸𝐁𝖢\\\"\\\\\"")))
(ert-deftest test-json-encode-key ()
- (should (equal (json-encode-key "") "\"\""))
- (should (equal (json-encode-key '##) "\"\""))
- (should (equal (json-encode-key :) "\"\""))
- (should (equal (json-encode-key "foo") "\"foo\""))
- (should (equal (json-encode-key 'foo) "\"foo\""))
- (should (equal (json-encode-key :foo) "\"foo\""))
- (should (equal (should-error (json-encode-key 5))
- '(json-key-format 5)))
- (should (equal (should-error (json-encode-key ["foo"]))
- '(json-key-format ["foo"])))
- (should (equal (should-error (json-encode-key '("foo")))
- '(json-key-format ("foo")))))
+ (with-suppressed-warnings ((obsolete json-encode-key))
+ (should (equal (json-encode-key '##) "\"\""))
+ (should (equal (json-encode-key :) "\"\""))
+ (should (equal (json-encode-key "") "\"\""))
+ (should (equal (json-encode-key 'a) "\"a\""))
+ (should (equal (json-encode-key :a) "\"a\""))
+ (should (equal (json-encode-key "a") "\"a\""))
+ (should (equal (json-encode-key t) "\"t\""))
+ (should (equal (json-encode-key :t) "\"t\""))
+ (should (equal (json-encode-key "t") "\"t\""))
+ (should (equal (json-encode-key nil) "\"nil\""))
+ (should (equal (json-encode-key :nil) "\"nil\""))
+ (should (equal (json-encode-key "nil") "\"nil\""))
+ (should (equal (json-encode-key ":a") "\":a\""))
+ (should (equal (json-encode-key ":t") "\":t\""))
+ (should (equal (json-encode-key ":nil") "\":nil\""))
+ (should (equal (should-error (json-encode-key 5))
+ '(json-key-format 5)))
+ (should (equal (should-error (json-encode-key ["foo"]))
+ '(json-key-format ["foo"])))
+ (should (equal (should-error (json-encode-key '("foo")))
+ '(json-key-format ("foo"))))))
;;; Objects
@@ -569,12 +587,32 @@ Point is moved to beginning of the buffer."
(ert-deftest test-json-encode-hash-table ()
(let ((json-encoding-object-sort-predicate nil)
(json-encoding-pretty-print nil))
- (should (equal (json-encode-hash-table #s(hash-table)) "{}"))
- (should (equal (json-encode-hash-table #s(hash-table data (a 1)))
+ (should (equal (json-encode #s(hash-table)) "{}"))
+ (should (equal (json-encode #s(hash-table data (a 1))) "{\"a\":1}"))
+ (should (equal (json-encode #s(hash-table data (t 1))) "{\"t\":1}"))
+ (should (equal (json-encode #s(hash-table data (nil 1))) "{\"nil\":1}"))
+ (should (equal (json-encode #s(hash-table data (:a 1))) "{\"a\":1}"))
+ (should (equal (json-encode #s(hash-table data (:t 1))) "{\"t\":1}"))
+ (should (equal (json-encode #s(hash-table data (:nil 1))) "{\"nil\":1}"))
+ (should (equal (json-encode #s(hash-table test equal data ("a" 1)))
"{\"a\":1}"))
- (should (member (json-encode-hash-table #s(hash-table data (b 2 a 1)))
+ (should (equal (json-encode #s(hash-table test equal data ("t" 1)))
+ "{\"t\":1}"))
+ (should (equal (json-encode #s(hash-table test equal data ("nil" 1)))
+ "{\"nil\":1}"))
+ (should (equal (json-encode #s(hash-table test equal data (":a" 1)))
+ "{\":a\":1}"))
+ (should (equal (json-encode #s(hash-table test equal data (":t" 1)))
+ "{\":t\":1}"))
+ (should (equal (json-encode #s(hash-table test equal data (":nil" 1)))
+ "{\":nil\":1}"))
+ (should (member (json-encode #s(hash-table data (t 2 :nil 1)))
+ '("{\"nil\":1,\"t\":2}" "{\"t\":2,\"nil\":1}")))
+ (should (member (json-encode #s(hash-table test equal data (:t 2 ":t" 1)))
+ '("{\":t\":1,\"t\":2}" "{\"t\":2,\":t\":1}")))
+ (should (member (json-encode #s(hash-table data (b 2 a 1)))
'("{\"a\":1,\"b\":2}" "{\"b\":2,\"a\":1}")))
- (should (member (json-encode-hash-table #s(hash-table data (c 3 b 2 a 1)))
+ (should (member (json-encode #s(hash-table data (c 3 b 2 a 1)))
'("{\"a\":1,\"b\":2,\"c\":3}"
"{\"a\":1,\"c\":3,\"b\":2}"
"{\"b\":2,\"a\":1,\"c\":3}"
@@ -587,13 +625,12 @@ Point is moved to beginning of the buffer."
(json-encoding-pretty-print t)
(json-encoding-default-indentation " ")
(json-encoding-lisp-style-closings nil))
- (should (equal (json-encode-hash-table #s(hash-table)) "{}"))
- (should (equal (json-encode-hash-table #s(hash-table data (a 1)))
- "{\n \"a\": 1\n}"))
- (should (member (json-encode-hash-table #s(hash-table data (b 2 a 1)))
+ (should (equal (json-encode #s(hash-table)) "{}"))
+ (should (equal (json-encode #s(hash-table data (a 1))) "{\n \"a\": 1\n}"))
+ (should (member (json-encode #s(hash-table data (b 2 a 1)))
'("{\n \"a\": 1,\n \"b\": 2\n}"
"{\n \"b\": 2,\n \"a\": 1\n}")))
- (should (member (json-encode-hash-table #s(hash-table data (c 3 b 2 a 1)))
+ (should (member (json-encode #s(hash-table data (c 3 b 2 a 1)))
'("{\n \"a\": 1,\n \"b\": 2,\n \"c\": 3\n}"
"{\n \"a\": 1,\n \"c\": 3,\n \"b\": 2\n}"
"{\n \"b\": 2,\n \"a\": 1,\n \"c\": 3\n}"
@@ -606,13 +643,12 @@ Point is moved to beginning of the buffer."
(json-encoding-pretty-print t)
(json-encoding-default-indentation " ")
(json-encoding-lisp-style-closings t))
- (should (equal (json-encode-hash-table #s(hash-table)) "{}"))
- (should (equal (json-encode-hash-table #s(hash-table data (a 1)))
- "{\n \"a\": 1}"))
- (should (member (json-encode-hash-table #s(hash-table data (b 2 a 1)))
+ (should (equal (json-encode #s(hash-table)) "{}"))
+ (should (equal (json-encode #s(hash-table data (a 1))) "{\n \"a\": 1}"))
+ (should (member (json-encode #s(hash-table data (b 2 a 1)))
'("{\n \"a\": 1,\n \"b\": 2}"
"{\n \"b\": 2,\n \"a\": 1}")))
- (should (member (json-encode-hash-table #s(hash-table data (c 3 b 2 a 1)))
+ (should (member (json-encode #s(hash-table data (c 3 b 2 a 1)))
'("{\n \"a\": 1,\n \"b\": 2,\n \"c\": 3}"
"{\n \"a\": 1,\n \"c\": 3,\n \"b\": 2}"
"{\n \"b\": 2,\n \"a\": 1,\n \"c\": 3}"
@@ -630,7 +666,7 @@ Point is moved to beginning of the buffer."
(#s(hash-table data (c 3 b 2 a 1))
. "{\"a\":1,\"b\":2,\"c\":3}")))
(let ((copy (map-pairs in)))
- (should (equal (json-encode-hash-table in) out))
+ (should (equal (json-encode in) out))
;; Ensure sorting isn't destructive.
(should (seq-set-equal-p (map-pairs in) copy))))))
@@ -638,7 +674,16 @@ Point is moved to beginning of the buffer."
(let ((json-encoding-object-sort-predicate nil)
(json-encoding-pretty-print nil))
(should (equal (json-encode-alist ()) "{}"))
- (should (equal (json-encode-alist '((a . 1))) "{\"a\":1}"))
+ (should (equal (json-encode-alist '((a . 1) (t . 2) (nil . 3)))
+ "{\"a\":1,\"t\":2,\"nil\":3}"))
+ (should (equal (json-encode-alist '((:a . 1) (:t . 2) (:nil . 3)))
+ "{\"a\":1,\"t\":2,\"nil\":3}"))
+ (should (equal (json-encode-alist '(("a" . 1) ("t" . 2) ("nil" . 3)))
+ "{\"a\":1,\"t\":2,\"nil\":3}"))
+ (should (equal (json-encode-alist '((":a" . 1) (":t" . 2) (":nil" . 3)))
+ "{\":a\":1,\":t\":2,\":nil\":3}"))
+ (should (equal (json-encode-alist '((t . 1) (:nil . 2) (":nil" . 3)))
+ "{\"t\":1,\"nil\":2,\":nil\":3}"))
(should (equal (json-encode-alist '((b . 2) (a . 1))) "{\"b\":2,\"a\":1}"))
(should (equal (json-encode-alist '((c . 3) (b . 2) (a . 1)))
"{\"c\":3,\"b\":2,\"a\":1}"))))
@@ -687,8 +732,14 @@ Point is moved to beginning of the buffer."
(should (equal (json-encode-plist ()) "{}"))
(should (equal (json-encode-plist '(:a 1)) "{\"a\":1}"))
(should (equal (json-encode-plist '(:b 2 :a 1)) "{\"b\":2,\"a\":1}"))
- (should (equal (json-encode-plist '(:c 3 :b 2 :a 1))
- "{\"c\":3,\"b\":2,\"a\":1}"))))
+ (should (equal (json-encode-plist '(":d" 4 "c" 3 b 2 :a 1))
+ "{\":d\":4,\"c\":3,\"b\":2,\"a\":1}"))
+ (should (equal (json-encode-plist '(nil 2 t 1))
+ "{\"nil\":2,\"t\":1}"))
+ (should (equal (json-encode-plist '(:nil 2 :t 1))
+ "{\"nil\":2,\"t\":1}"))
+ (should (equal (json-encode-plist '(":nil" 4 "nil" 3 ":t" 2 "t" 1))
+ "{\":nil\":4,\"nil\":3,\":t\":2,\"t\":1}"))))
(ert-deftest test-json-encode-plist-pretty ()
(let ((json-encoding-object-sort-predicate nil)
@@ -728,38 +779,42 @@ Point is moved to beginning of the buffer."
(should (equal in copy))))))
(ert-deftest test-json-encode-list ()
+ "Test `json-encode-list' or its more moral equivalents."
(let ((json-encoding-object-sort-predicate nil)
(json-encoding-pretty-print nil))
- (should (equal (json-encode-list ()) "{}"))
- (should (equal (json-encode-list '(a)) "[\"a\"]"))
- (should (equal (json-encode-list '(:a)) "[\"a\"]"))
- (should (equal (json-encode-list '("a")) "[\"a\"]"))
- (should (equal (json-encode-list '(a 1)) "[\"a\",1]"))
- (should (equal (json-encode-list '("a" 1)) "[\"a\",1]"))
- (should (equal (json-encode-list '(:a 1)) "{\"a\":1}"))
- (should (equal (json-encode-list '((a . 1))) "{\"a\":1}"))
- (should (equal (json-encode-list '((:a . 1))) "{\"a\":1}"))
- (should (equal (json-encode-list '(:b 2 :a)) "[\"b\",2,\"a\"]"))
- (should (equal (json-encode-list '(4 3 2 1)) "[4,3,2,1]"))
- (should (equal (json-encode-list '(b 2 a 1)) "[\"b\",2,\"a\",1]"))
- (should (equal (json-encode-list '(:b 2 :a 1)) "{\"b\":2,\"a\":1}"))
- (should (equal (json-encode-list '((b . 2) (a . 1))) "{\"b\":2,\"a\":1}"))
- (should (equal (json-encode-list '((:b . 2) (:a . 1)))
+ ;; Trick `json-encode' into using `json--print-list'.
+ (let ((json-null (list nil)))
+ (should (equal (json-encode ()) "{}")))
+ (should (equal (json-encode '(a)) "[\"a\"]"))
+ (should (equal (json-encode '(:a)) "[\"a\"]"))
+ (should (equal (json-encode '("a")) "[\"a\"]"))
+ (should (equal (json-encode '(a 1)) "[\"a\",1]"))
+ (should (equal (json-encode '("a" 1)) "[\"a\",1]"))
+ (should (equal (json-encode '(:a 1)) "{\"a\":1}"))
+ (should (equal (json-encode '((a . 1))) "{\"a\":1}"))
+ (should (equal (json-encode '((:a . 1))) "{\"a\":1}"))
+ (should (equal (json-encode '(:b 2 :a)) "[\"b\",2,\"a\"]"))
+ (should (equal (json-encode '(4 3 2 1)) "[4,3,2,1]"))
+ (should (equal (json-encode '(b 2 a 1)) "[\"b\",2,\"a\",1]"))
+ (should (equal (json-encode '(:b 2 :a 1)) "{\"b\":2,\"a\":1}"))
+ (should (equal (json-encode '((b . 2) (a . 1))) "{\"b\":2,\"a\":1}"))
+ (should (equal (json-encode '((:b . 2) (:a . 1)))
"{\"b\":2,\"a\":1}"))
- (should (equal (json-encode-list '((a) 1)) "[[\"a\"],1]"))
- (should (equal (json-encode-list '((:a) 1)) "[[\"a\"],1]"))
- (should (equal (json-encode-list '(("a") 1)) "[[\"a\"],1]"))
- (should (equal (json-encode-list '((a 1) 2)) "[[\"a\",1],2]"))
- (should (equal (json-encode-list '((:a 1) 2)) "[{\"a\":1},2]"))
- (should (equal (json-encode-list '(((a . 1)) 2)) "[{\"a\":1},2]"))
- (should (equal (json-encode-list '(:a 1 :b (2))) "{\"a\":1,\"b\":[2]}"))
- (should (equal (json-encode-list '((a . 1) (b 2))) "{\"a\":1,\"b\":[2]}"))
- (should-error (json-encode-list '(a . 1)) :type 'wrong-type-argument)
- (should-error (json-encode-list '((a . 1) 2)) :type 'wrong-type-argument)
- (should (equal (should-error (json-encode-list []))
- '(json-error [])))
- (should (equal (should-error (json-encode-list [a]))
- '(json-error [a])))))
+ (should (equal (json-encode '((a) 1)) "[[\"a\"],1]"))
+ (should (equal (json-encode '((:a) 1)) "[[\"a\"],1]"))
+ (should (equal (json-encode '(("a") 1)) "[[\"a\"],1]"))
+ (should (equal (json-encode '((a 1) 2)) "[[\"a\",1],2]"))
+ (should (equal (json-encode '((:a 1) 2)) "[{\"a\":1},2]"))
+ (should (equal (json-encode '(((a . 1)) 2)) "[{\"a\":1},2]"))
+ (should (equal (json-encode '(:a 1 :b (2))) "{\"a\":1,\"b\":[2]}"))
+ (should (equal (json-encode '((a . 1) (b 2))) "{\"a\":1,\"b\":[2]}"))
+ (should-error (json-encode '(a . 1)) :type 'wrong-type-argument)
+ (should-error (json-encode '((a . 1) 2)) :type 'wrong-type-argument)
+ (with-suppressed-warnings ((obsolete json-encode-list))
+ (should (equal (should-error (json-encode-list []))
+ '(json-error [])))
+ (should (equal (should-error (json-encode-list [a]))
+ '(json-error [a]))))))
;;; Arrays
@@ -950,7 +1005,13 @@ nil, ORIGINAL should stay unchanged by pretty-printing."
;; Nested array.
(json-tests-equal-pretty-print
"{\"key\":[1,2]}"
- "{\n \"key\": [\n 1,\n 2\n ]\n}"))
+ "{\n \"key\": [\n 1,\n 2\n ]\n}")
+ ;; Confusable keys (bug#24252, bug#42545).
+ (json-tests-equal-pretty-print
+ (concat "{\"t\":1,\"nil\":2,\":t\":3,\":nil\":4,"
+ "\"null\":5,\":json-null\":6,\":json-false\":7}")
+ (concat "{\n \"t\": 1,\n \"nil\": 2,\n \":t\": 3,\n \":nil\": 4,"
+ "\n \"null\": 5,\n \":json-null\": 6,\n \":json-false\": 7\n}")))
(ert-deftest test-json-pretty-print-array ()
;; Empty.
diff --git a/test/lisp/jsonrpc-tests.el b/test/lisp/jsonrpc-tests.el
index ea340c370d1..92306d1c7e5 100644
--- a/test/lisp/jsonrpc-tests.el
+++ b/test/lisp/jsonrpc-tests.el
@@ -244,7 +244,7 @@
:timeout 1)
;; Wait another 0.5 secs just in case the success handlers of
;; one of these last two requests didn't quite have a chance to
- ;; run (Emacs 25.2 apparentely needs this).
+ ;; run (Emacs 25.2 apparently needs this).
(accept-process-output nil 0.5)
(should second-deferred-went-through-p)
(should (eq 1 n-deferred-1))
diff --git a/test/lisp/kmacro-tests.el b/test/lisp/kmacro-tests.el
index c8910720763..8736f7fd2dc 100644
--- a/test/lisp/kmacro-tests.el
+++ b/test/lisp/kmacro-tests.el
@@ -519,7 +519,7 @@ This is a regression test for: Bug#3412, Bug#11817."
(should (eq saved-binding (key-binding "\C-a")))))
(kmacro-tests-deftest kmacro-tests-name-or-bind-to-key-when-no-macro ()
- "Bind to key, symbol or register fails when when no macro exists."
+ "Bind to key, symbol or register fails when no macro exists."
(should-error (kmacro-bind-to-key nil))
(should-error (kmacro-name-last-macro 'kmacro-tests-symbol-for-test))
(should-error (kmacro-to-register)))
diff --git a/test/lisp/loadhist-tests.el b/test/lisp/loadhist-tests.el
new file mode 100644
index 00000000000..b29796da42d
--- /dev/null
+++ b/test/lisp/loadhist-tests.el
@@ -0,0 +1,57 @@
+;;; loadhist-tests.el --- Tests for loadhist.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Kangas <stefankangas@gmail.com>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'loadhist)
+
+(ert-deftest loadhist-tests-feature-symbols ()
+ (should (equal (file-name-base (car (feature-symbols 'loadhist))) "loadhist"))
+ (should-not (feature-symbols 'non-existent-feature)))
+
+(ert-deftest loadhist-tests-feature-file ()
+ (should (equal (file-name-base (feature-file 'loadhist)) "loadhist"))
+ (should-error (feature-file 'non-existent-feature)))
+
+(ert-deftest loadhist-tests-file-loadhist-lookup ()
+ ;; This should probably be extended...
+ (should (listp (file-loadhist-lookup "loadhist"))))
+
+(ert-deftest loadhist-tests-file-provides ()
+ (should (eq (car (file-provides "loadhist")) 'loadhist)))
+
+(ert-deftest loadhist-tests-file-requires ()
+ (should-not (file-requires "loadhist")))
+
+(ert-deftest loadhist-tests-file-dependents ()
+ (require 'dired-x)
+ (let ((deps (file-dependents "dired")))
+ (should (member "dired-x" (mapcar #'file-name-base deps)))))
+
+(ert-deftest loadhist-tests-unload-feature ()
+ (require 'dired-x)
+ (should-error (unload-feature 'dired))
+ (unload-feature 'dired-x))
+
+;;; loadhist-tests.el ends here
diff --git a/test/lisp/lpr-tests.el b/test/lisp/lpr-tests.el
new file mode 100644
index 00000000000..bc31982a11d
--- /dev/null
+++ b/test/lisp/lpr-tests.el
@@ -0,0 +1,41 @@
+;;; lpr-tests.el --- Tests for lpr.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'lpr)
+
+(ert-deftest lpr-test-printify-region ()
+ (with-temp-buffer
+ (insert "foo\^@-\^h\^k\^n-\^_\177bar")
+ (printify-region (point-min) (point-max))
+ (should (equal (buffer-string) "foo\\^@-\\^H\\^K\\^N-\\^_\\7fbar"))))
+
+(ert-deftest lpr-test-lpr-eval-switch ()
+ (should (equal (lpr-eval-switch "foo") "foo"))
+ (should (equal (lpr-eval-switch (lambda () "foo")) "foo"))
+ (let ((v "foo"))
+ (should (equal (lpr-eval-switch v) "foo")))
+ (should (equal (lpr-eval-switch (list #'identity "foo")) "foo"))
+ (should (equal (lpr-eval-switch 1) nil)))
+
+;;; lpr-tests.el ends here
diff --git a/test/lisp/mail/mail-parse-tests.el b/test/lisp/mail/mail-parse-tests.el
new file mode 100644
index 00000000000..70de92df45a
--- /dev/null
+++ b/test/lisp/mail/mail-parse-tests.el
@@ -0,0 +1,54 @@
+;;; mail-parse-tests.el --- tests for mail-parse.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'mail-parse)
+(require 'subr-x)
+
+(ert-deftest test-mail-header-parse-address-lax ()
+ (should (equal (mail-header-parse-address-lax
+ "Lars Ingebrigtsen <larsi@gnus.org>")
+ '("larsi@gnus.org" . "Lars Ingebrigtsen")))
+ (should (equal (mail-header-parse-address-lax
+ "Lars Ingebrigtsen larsi@gnus.org>")
+ '("larsi@gnus.org" . "Lars Ingebrigtsen")))
+ (should (equal (mail-header-parse-address-lax
+ "Lars Ingebrigtsen larsi@gnus.org")
+ '("larsi@gnus.org" . "Lars Ingebrigtsen")))
+ (should (equal (mail-header-parse-address-lax
+ "larsi@gnus.org (Lars Ingebrigtsen)")
+ '("larsi@gnus.org " . "Lars Ingebrigtsen")))
+ (should (equal (mail-header-parse-address-lax "larsi@gnus.org")
+ '("larsi@gnus.org")))
+ (should (equal (mail-header-parse-address-lax "foo")
+ nil)))
+
+(ert-deftest test-mail-header-parse-addresses-lax ()
+ (should (equal (mail-header-parse-addresses-lax
+ "Bob Weiner <rsw@gnu.org>, Mats Lidell <matsl@gnu.org>")
+ '(("rsw@gnu.org" . "Bob Weiner")
+ ("matsl@gnu.org" . "Mats Lidell")))))
+
+(provide 'mail-parse-tests)
+
+;;; mail-parse-tests.el ends here
diff --git a/test/lisp/mail/mail-utils-tests.el b/test/lisp/mail/mail-utils-tests.el
new file mode 100644
index 00000000000..5b54f2440c7
--- /dev/null
+++ b/test/lisp/mail/mail-utils-tests.el
@@ -0,0 +1,104 @@
+;;; mail-utils-tests.el --- tests for mail-utils.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Author: Stefan Kangas <stefankangas@gmail.com>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'sasl)
+(require 'mail-utils)
+
+(ert-deftest mail-utils-tests-mail-quote-printable ()
+ (should (equal (mail-quote-printable "abc") "abc"))
+ (should (equal (mail-quote-printable "åäö") "=E5=E4=F6"))
+ (should (equal (mail-quote-printable "åäö" t) "=?ISO-8859-1?Q?=E5=E4=F6?=")))
+
+(ert-deftest mail-utils-tests-mail-quote-printable-region ()
+ (with-temp-buffer
+ (insert "?=\"\"")
+ (mail-quote-printable-region (point-min) (point-max))
+ (should (equal (buffer-string) "=3F=3D=22=22")))
+ (with-temp-buffer
+ (insert "x")
+ (mail-quote-printable-region (point-min) (point-max) t)
+ (should (equal (buffer-string) "=?=?ISO-8859-1?Q?x"))))
+
+(ert-deftest mail-utils-tests-mail-unquote-printable ()
+ (should (equal (mail-unquote-printable "=E5=E4=F6") "åäö"))
+ (should (equal (mail-unquote-printable "=?ISO-8859-1?Q?=E5=E4=F6?=" t) "åäö")))
+
+(ert-deftest mail-utils-tests-mail-unquote-printable-region ()
+ (with-temp-buffer
+ (insert "=E5=E4=F6")
+ (mail-unquote-printable-region (point-min) (point-max))
+ (should (equal (buffer-string) "åäö")))
+ (with-temp-buffer
+ (insert "=?ISO-8859-1?Q?=E5=E4=F6?=")
+ (mail-unquote-printable-region (point-min) (point-max) t)
+ (should (equal (buffer-string) "åäö"))))
+
+(ert-deftest mail-utils-tests-mail-strip-quoted-names ()
+ (should (equal (mail-strip-quoted-names
+ "\"foo\" <foo@example.org>, bar@example.org")
+ "foo@example.org, bar@example.org")))
+
+(ert-deftest mail-utils-tests-mail-dont-reply-to ()
+ (let ((mail-dont-reply-to-names "foo@example.org"))
+ (should (equal (mail-dont-reply-to "foo@example.org, bar@example.org")
+ "bar@example.org"))))
+
+
+(ert-deftest mail-utils-tests-mail-fetch-field ()
+ (with-temp-buffer
+ (insert "Foo: bar\nBaz: zut")
+ (should (equal (mail-fetch-field "Foo") "bar"))))
+
+(ert-deftest mail-utils-tests-mail-parse-comma-list ()
+ (with-temp-buffer
+ (insert "foo@example.org,bar@example.org,baz@example.org")
+ (goto-char (point-min))
+ (should (equal (mail-parse-comma-list)
+ '("baz@example.org" "bar@example.org" "foo@example.org")))))
+
+(ert-deftest mail-utils-tests-mail-comma-list-regexp ()
+ (should (equal (mail-comma-list-regexp
+ "foo@example.org,bar@example.org,baz@example.org")
+ "foo@example.org\\|bar@example.org\\|baz@example.org")))
+
+(ert-deftest mail-utils-tests-mail-rfc822-time-zone ()
+ (should (stringp (mail-rfc822-time-zone (current-time)))))
+
+(ert-deftest mail-utils-test-mail-rfc822-date/contains-year ()
+ (should (string-match (rx " 20" digit digit " ")
+ (mail-rfc822-date))))
+
+(ert-deftest mail-utils-test-mail-mbox-from ()
+ (with-temp-buffer
+ (insert "Subject: Hello
+From: jrh@example.org
+To: emacs-devel@gnu.org
+Date: Sun, 07 Feb 2021 22:46:37 -0500")
+ (should (equal (mail-mbox-from)
+ "From jrh@example.org Sun Feb 7 22:46:37 2021\n"))))
+
+(provide 'mail-utils-tests)
+;;; mail-utils-tests.el ends here
diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el
index 7349b191caf..c3ba8f9a926 100644
--- a/test/lisp/minibuffer-tests.el
+++ b/test/lisp/minibuffer-tests.el
@@ -83,7 +83,12 @@
(let* ((origtable '("A-hello" "A-there"))
(subvtable (completion-table-subvert origtable "B" "A")))
(should (equal (try-completion "B-hel" subvtable)
- "B-hello"))))
+ "B-hello"))
+ (should (equal (all-completions "B-hel" subvtable) '("-hello")))
+ (should (test-completion "B-hello" subvtable))
+ (should (equal (completion-boundaries "B-hel" subvtable
+ nil "suffix")
+ '(1 . 6)))))
(ert-deftest completion-table-test-quoting ()
(let ((process-environment
@@ -125,5 +130,206 @@
'(("completion1" "prefix1" #("suffix1" 0 7 (face shadow)))))
(should (equal (get-text-property 19 'face) 'shadow))))
+(ert-deftest completion-pcm--optimize-pattern ()
+ (should (equal (completion-pcm--optimize-pattern '("buf" point "f"))
+ '("buf" point "f")))
+ (should (equal (completion-pcm--optimize-pattern '(any "" any))
+ '(any))))
+
+(defun test-completion-all-sorted-completions (base def history-var history-list)
+ (with-temp-buffer
+ (insert base)
+ (cl-letf (((symbol-function #'minibufferp) (lambda (&rest _) t)))
+ (let ((completion-styles '(basic))
+ (completion-category-defaults nil)
+ (completion-category-overrides nil)
+ (minibuffer-history-variable history-var)
+ (minibuffer-history history-list)
+ (minibuffer-default def)
+ (minibuffer-completion-table
+ (lambda (str pred action)
+ (pcase action
+ (`(boundaries . ,_) `(boundaries ,(length base) . 0))
+ (_ (complete-with-action
+ action
+ '("epsilon" "alpha" "gamma" "beta" "delta")
+ (substring str (length base)) pred))))))
+ (completion-all-sorted-completions)))))
+
+(ert-deftest completion-all-sorted-completions ()
+ ;; No base, disabled history, no default
+ (should (equal (test-completion-all-sorted-completions
+ "" nil t nil)
+ `("beta" "alpha" "delta" "gamma" "epsilon" . 0)))
+ ;; No base, disabled history, default string
+ (should (equal (test-completion-all-sorted-completions
+ "" "gamma" t nil)
+ `("gamma" "beta" "alpha" "delta" "epsilon" . 0)))
+ ;; No base, empty history, default string
+ (should (equal (test-completion-all-sorted-completions
+ "" "gamma" 'minibuffer-history nil)
+ `("gamma" "beta" "alpha" "delta" "epsilon" . 0)))
+ ;; No base, empty history, default list
+ (should (equal (test-completion-all-sorted-completions
+ "" '("gamma" "zeta") 'minibuffer-history nil)
+ `("gamma" "beta" "alpha" "delta" "epsilon" . 0)))
+ ;; No base, history, default string
+ (should (equal (test-completion-all-sorted-completions
+ "" "gamma" 'minibuffer-history '("other" "epsilon" "delta"))
+ `("gamma" "epsilon" "delta" "beta" "alpha" . 0)))
+ ;; Base, history, default string
+ (should (equal (test-completion-all-sorted-completions
+ "base/" "base/gamma" 'minibuffer-history
+ '("some/alpha" "base/epsilon" "base/delta"))
+ `("gamma" "epsilon" "delta" "beta" "alpha" . 5)))
+ ;; Base, history, default string
+ (should (equal (test-completion-all-sorted-completions
+ "base/" "gamma" 'minibuffer-history
+ '("some/alpha" "base/epsilon" "base/delta"))
+ `("epsilon" "delta" "beta" "alpha" "gamma" . 5))))
+
+(defun completion--pcm-score (comp)
+ "Get `completion-score' from COMP."
+ (get-text-property 0 'completion-score comp))
+
+(defun completion--pcm-first-difference-pos (comp)
+ "Get `completions-first-difference' from COMP."
+ (cl-loop for pos = (next-single-property-change 0 'face comp)
+ then (next-single-property-change pos 'face comp)
+ while pos
+ when (eq (get-text-property pos 'face comp)
+ 'completions-first-difference)
+ return pos))
+
+(ert-deftest completion-pcm-test-1 ()
+ ;; Point is at end, this does not match anything
+ (should (null
+ (completion-pcm-all-completions
+ "foo" '("hello" "world" "barfoobar") nil 3))))
+
+(ert-deftest completion-pcm-test-2 ()
+ ;; Point is at beginning, this matches "barfoobar"
+ (should (equal
+ (car (completion-pcm-all-completions
+ "foo" '("hello" "world" "barfoobar") nil 0))
+ "barfoobar")))
+
+(ert-deftest completion-pcm-test-3 ()
+ ;; Full match!
+ (should (eql
+ (completion--pcm-score
+ (car (completion-pcm-all-completions
+ "R" '("R" "hello") nil 1)))
+ 1.0)))
+
+(ert-deftest completion-pcm-test-4 ()
+ ;; One fourth of a match and no match due to point being at the end
+ (should (eql
+ (completion--pcm-score
+ (car (completion-pcm-all-completions
+ "RO" '("RaOb") nil 1)))
+ (/ 1.0 4.0)))
+ (should (null
+ (completion-pcm-all-completions
+ "RO" '("RaOb") nil 2))))
+
+(ert-deftest completion-pcm-test-5 ()
+ ;; Since point is at the beginning, there is nothing that can really
+ ;; be typed anymore
+ (should (null
+ (completion--pcm-first-difference-pos
+ (car (completion-pcm-all-completions
+ "f" '("few" "many") nil 0))))))
+
+(ert-deftest completion-pcm-test-6 ()
+ ;; Wildcards and delimiters work
+ (should (equal
+ (car (completion-pcm-all-completions
+ "li-pac*" '("list-packages") nil 7))
+ "list-packages"))
+ (should (null
+ (car (completion-pcm-all-completions
+ "li-pac*" '("do-not-list-packages") nil 7)))))
+
+(ert-deftest completion-substring-test-1 ()
+ ;; One third of a match!
+ (should (equal
+ (car (completion-substring-all-completions
+ "foo" '("hello" "world" "barfoobar") nil 3))
+ "barfoobar"))
+ (should (eql
+ (completion--pcm-score
+ (car (completion-substring-all-completions
+ "foo" '("hello" "world" "barfoobar") nil 3)))
+ (/ 1.0 3.0))))
+
+(ert-deftest completion-substring-test-2 ()
+ ;; Full match!
+ (should (eql
+ (completion--pcm-score
+ (car (completion-substring-all-completions
+ "R" '("R" "hello") nil 1)))
+ 1.0)))
+
+(ert-deftest completion-substring-test-3 ()
+ ;; Substring match
+ (should (equal
+ (car (completion-substring-all-completions
+ "custgroup" '("customize-group") nil 4))
+ "customize-group"))
+ (should (null
+ (car (completion-substring-all-completions
+ "custgroup" '("customize-group") nil 5)))))
+
+(ert-deftest completion-substring-test-4 ()
+ ;; `completions-first-difference' should be at the right place
+ (should (eql
+ (completion--pcm-first-difference-pos
+ (car (completion-substring-all-completions
+ "jab" '("dabjobstabby" "many") nil 1)))
+ 4))
+ (should (null
+ (completion--pcm-first-difference-pos
+ (car (completion-substring-all-completions
+ "jab" '("dabjabstabby" "many") nil 1)))))
+ (should (equal
+ (completion--pcm-first-difference-pos
+ (car (completion-substring-all-completions
+ "jab" '("dabjabstabby" "many") nil 3)))
+ 6)))
+
+(ert-deftest completion-flex-test-1 ()
+ ;; Fuzzy match
+ (should (equal
+ (car (completion-flex-all-completions
+ "foo" '("hello" "world" "fabrobazo") nil 3))
+ "fabrobazo")))
+
+(ert-deftest completion-flex-test-2 ()
+ ;; Full match!
+ (should (eql
+ (completion--pcm-score
+ (car (completion-flex-all-completions
+ "R" '("R" "hello") nil 1)))
+ 1.0)))
+
+(ert-deftest completion-flex-test-3 ()
+ ;; Another fuzzy match, but more of a "substring" one
+ (should (equal
+ (car (completion-flex-all-completions
+ "custgroup" '("customize-group-other-window") nil 4))
+ "customize-group-other-window"))
+ ;; `completions-first-difference' should be at the right place
+ (should (equal
+ (completion--pcm-first-difference-pos
+ (car (completion-flex-all-completions
+ "custgroup" '("customize-group-other-window") nil 4)))
+ 4))
+ (should (equal
+ (completion--pcm-first-difference-pos
+ (car (completion-flex-all-completions
+ "custgroup" '("customize-group-other-window") nil 9)))
+ 15)))
+
(provide 'minibuffer-tests)
;;; minibuffer-tests.el ends here
diff --git a/test/lisp/net/netrc-resources/netrc-folding b/test/lisp/net/netrc-resources/netrc-folding
new file mode 100644
index 00000000000..85e5e324cdf
--- /dev/null
+++ b/test/lisp/net/netrc-resources/netrc-folding
@@ -0,0 +1,6 @@
+# Foo
+machine XM login XL password XP
+
+machine YM
+ login YL
+ password YP
diff --git a/test/lisp/net/netrc-tests.el b/test/lisp/net/netrc-tests.el
index 1328b191494..f75328a59f7 100644
--- a/test/lisp/net/netrc-tests.el
+++ b/test/lisp/net/netrc-tests.el
@@ -48,6 +48,13 @@
(should (equal (netrc-credentials "ftp.example.org")
'("jrh" "*baz*")))))
+(ert-deftest test-netrc-credentials ()
+ (let ((netrc-file (ert-resource-file "netrc-folding")))
+ (should
+ (equal (netrc-parse netrc-file)
+ '((("machine" . "XM") ("login" . "XL") ("password" . "XP"))
+ (("machine" . "YM")) (("login" . "YL")) (("password" . "YP")))))))
+
(provide 'netrc-tests)
;;; netrc-tests.el ends here
diff --git a/test/lisp/net/network-stream-tests.el b/test/lisp/net/network-stream-tests.el
index e0a06a28eec..4a0b23dd26f 100644
--- a/test/lisp/net/network-stream-tests.el
+++ b/test/lisp/net/network-stream-tests.el
@@ -128,7 +128,7 @@
(when prev
(setq string (concat prev string))
(process-put proc 'previous-string nil)))
- (if (and (not (string-match "\n" string))
+ (if (and (not (string-search "\n" string))
(> (length string) 0))
(process-put proc 'previous-string string))
(let ((command (split-string string)))
@@ -307,6 +307,7 @@
:name "bar"
:buffer (generate-new-buffer "*foo*")
:nowait t
+ :family 'ipv4
:tls-parameters
(cons 'gnutls-x509pki
(gnutls-boot-parameters
diff --git a/test/lisp/net/nsm-tests.el b/test/lisp/net/nsm-tests.el
index ff453319b37..1a35ec34cb9 100644
--- a/test/lisp/net/nsm-tests.el
+++ b/test/lisp/net/nsm-tests.el
@@ -1,4 +1,4 @@
-;;; network-stream-tests.el --- tests for network security manager -*- lexical-binding: t; -*-
+;;; nsm-tests.el --- tests for network security manager -*- lexical-binding: t; -*-
;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/net/ntlm-resources/authinfo b/test/lisp/net/ntlm-resources/authinfo
new file mode 100644
index 00000000000..698391e9313
--- /dev/null
+++ b/test/lisp/net/ntlm-resources/authinfo
@@ -0,0 +1 @@
+machine localhost port http user ntlm password ntlm
diff --git a/test/lisp/net/ntlm-tests.el b/test/lisp/net/ntlm-tests.el
index 6408ac13349..2420b3b48a9 100644
--- a/test/lisp/net/ntlm-tests.el
+++ b/test/lisp/net/ntlm-tests.el
@@ -17,11 +17,26 @@
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+;;; Commentary:
+
+;; Run this with `NTLM_TESTS_VERBOSE=1' to get verbose debugging.
+
+;;; Code:
+
(require 'ert)
+(require 'ert-x)
(require 'ntlm)
+(defsubst ntlm-tests-message (format-string &rest arguments)
+ "Print a message conditional on an environment variable being set.
+FORMAT-STRING and ARGUMENTS are passed to the message function."
+ (when (getenv "NTLM_TESTS_VERBOSE")
+ (apply #'message (concat "ntlm-tests: " format-string) arguments)))
+
+
;; This is the Lisp bignum implementation of `ntlm--time-to-timestamp',
;; for reference.
+
(defun ntlm-tests--time-to-timestamp (time)
"Convert TIME to an NTLMv2 timestamp.
Return a unibyte string representing the number of tenths of a
@@ -49,4 +64,357 @@ signed integer. TIME must be on the form (HIGH LOW USEC PSEC)."
(should (equal (ntlm--time-to-timestamp time)
(ntlm-tests--time-to-timestamp time)))))
+(defvar ntlm-tests--username-oem "ntlm"
+ "The username for NTLM authentication tests, in OEM string encoding.")
+(defvar ntlm-tests--username-unicode
+ (ntlm-ascii2unicode ntlm-tests--username-oem
+ (length ntlm-tests--username-oem))
+ "The username for NTLM authentication tests, in Unicode string encoding.")
+
+(defvar ntlm-tests--password "ntlm"
+ "The password used for NTLM authentication tests.")
+
+(defvar ntlm-tests--client-supports-unicode nil
+ "Non-nil if client supports Unicode strings.
+If client only supports OEM strings, nil.")
+
+(defvar ntlm-tests--challenge nil "The global random challenge.")
+
+(defun ntlm-server-build-type-2 ()
+ "Return an NTLM Type 2 message as a string.
+This string will be returned from the NTLM server to the NTLM client."
+ (let ((target (if ntlm-tests--client-supports-unicode
+ (ntlm-ascii2unicode "DOMAIN" (length "DOMAIN"))
+ "DOMAIN"))
+ (target-information ntlm-tests--password)
+ ;; Flag byte 1 flags.
+ (_negotiate-unicode 1)
+ (negotiate-oem 2)
+ (request-target 4)
+ ;; Flag byte 2 flags.
+ (negotiate-ntlm 2)
+ (_negotiate-local-call 4)
+ (_negotiate-always-sign 8)
+ ;; Flag byte 3 flags.
+ (_target-type-domain 1)
+ (_target-type-server 2)
+ (target-type-share 4)
+ (_negotiate-ntlm2-key 8)
+ (negotiate-target-information 128)
+ ;; Flag byte 4 flags, unused.
+ (_negotiate-128 32)
+ (_negotiate-56 128))
+ (concat
+ ;; Signature.
+ "NTLMSSP" (unibyte-string 0)
+ ;; Type 2.
+ (unibyte-string 2 0 0 0)
+ ;; Target length
+ (unibyte-string (length target) 0)
+ ;; Target allocated space.
+ (unibyte-string (length target) 0)
+ ;; Target offset.
+ (unibyte-string 48 0 0 0)
+ ;; Flags.
+ ;; Flag byte 1.
+ ;; Tell the client that this test server only supports OEM
+ ;; strings. This test server will handle Unicode strings
+ ;; anyway though.
+ (unibyte-string (logior negotiate-oem request-target))
+ ;; Flag byte 2.
+ (unibyte-string negotiate-ntlm)
+ ;; Flag byte 3.
+ (unibyte-string (logior negotiate-target-information target-type-share))
+ ;; Flag byte 4. Not sure what 2 means here.
+ (unibyte-string 2)
+ ;; Challenge. Set this to (unibyte-string 1 2 3 4 5 6 7 8)
+ ;; instead of (ntlm-generate-nonce) to hold constant for
+ ;; debugging.
+ (setq ntlm-tests--challenge (ntlm-generate-nonce))
+ ;; Context.
+ (make-string 8 0)
+ (unibyte-string (length target-information) 0)
+ (unibyte-string (length target-information) 0)
+ (unibyte-string 54 0 0 0)
+ target
+ target-information)))
+
+(defun ntlm-server-hash (challenge blob username password)
+ "Hash CHALLENGE, BLOB, USERNAME and PASSWORD for a Type 3 check."
+ (hmac-md5 (concat challenge blob)
+ (hmac-md5 (concat
+ (upcase
+ ;; This calculation always uses
+ ;; Unicode username, even when the
+ ;; server only supports OEM strings.
+ (ntlm-ascii2unicode username (length username))) "")
+ (cadr (ntlm-get-password-hashes password)))))
+
+(defun ntlm-server-check-authorization (authorization-string)
+ "Return t if AUTHORIZATION-STRING correctly authenticates the user."
+ (let* ((binary (base64-decode-string
+ (caddr (split-string authorization-string " "))))
+ (_lm-response-length (md4-unpack-int16 (substring binary 12 14)))
+ (_lm-response-offset
+ (cdr (md4-unpack-int32 (substring binary 16 20))))
+ (ntlm-response-length (md4-unpack-int16 (substring binary 20 22)))
+ (ntlm-response-offset
+ (cdr (md4-unpack-int32 (substring binary 24 28))))
+ (ntlm-hash
+ (substring binary ntlm-response-offset (+ ntlm-response-offset 16)))
+ (username-length (md4-unpack-int16 (substring binary 36 38)))
+ (username-offset (cdr (md4-unpack-int32 (substring binary 40 44))))
+ (username (substring binary username-offset
+ (+ username-offset username-length))))
+ (if (equal ntlm-response-length 24)
+ (let* ((expected
+ (ntlm-smb-owf-encrypt
+ (cadr (ntlm-get-password-hashes ntlm-tests--password))
+ ntlm-tests--challenge))
+ (received (substring binary ntlm-response-offset
+ (+ ntlm-response-offset
+ ntlm-response-length))))
+ (ntlm-tests-message "Got NTLMv1 response:")
+ (ntlm-tests-message "Expected hash: ===%S===" expected)
+ (ntlm-tests-message "Got hash: ===%S===" received)
+ (ntlm-tests-message "Expected username: ===%S==="
+ ntlm-tests--username-oem)
+ (ntlm-tests-message "Got username: ===%S===" username)
+ (and (or (equal username ntlm-tests--username-oem)
+ (equal username ntlm-tests--username-unicode))
+ (equal expected received)))
+ (let* ((ntlm-response-blob
+ (substring binary (+ ntlm-response-offset 16)
+ (+ (+ ntlm-response-offset 16)
+ (- ntlm-response-length 16))))
+ (_ntlm-timestamp (substring ntlm-response-blob 8 16))
+ (_ntlm-nonce (substring ntlm-response-blob 16 24))
+ (_target-length (md4-unpack-int16 (substring binary 28 30)))
+ (_target-offset
+ (cdr (md4-unpack-int32 (substring binary 32 36))))
+ (_workstation-length (md4-unpack-int16 (substring binary 44 46)))
+ (_workstation-offset
+ (cdr (md4-unpack-int32 (substring binary 48 52)))))
+ (cond
+ ;; This test server claims to only support OEM strings,
+ ;; but also checks Unicode strings.
+ ((or (equal username ntlm-tests--username-oem)
+ (equal username ntlm-tests--username-unicode))
+ (let* ((password ntlm-tests--password)
+ (ntlm-hash-from-type-3 (ntlm-server-hash
+ ntlm-tests--challenge
+ ntlm-response-blob
+ ;; Always -oem since
+ ;; `ntlm-server-hash'
+ ;; always converts it to
+ ;; Unicode.
+ ntlm-tests--username-oem
+ password)))
+ (ntlm-tests-message "Got NTLMv2 response:")
+ (ntlm-tests-message "Expected hash: ==%S==" ntlm-hash)
+ (ntlm-tests-message "Got hash: ==%S==" ntlm-hash-from-type-3)
+ (ntlm-tests-message "Expected username: ===%S==="
+ ntlm-tests--username-oem)
+ (ntlm-tests-message " or username: ===%S==="
+ ntlm-tests--username-unicode)
+ (ntlm-tests-message "Got username: ===%S===" username)
+ (equal ntlm-hash ntlm-hash-from-type-3)))
+ (t
+ nil))))))
+
+(require 'eieio)
+(require 'cl-lib)
+
+;; Silence some byte-compiler warnings that occur when
+;; web-server/web-server.el is not found.
+(declare-function ws-send nil)
+(declare-function ws-parse-request nil)
+(declare-function ws-start nil)
+(declare-function ws-stop-all nil)
+
+(require 'web-server nil t)
+(require 'url-http-ntlm nil t)
+
+(defun ntlm-server-do-token (request _process)
+ "Process an NTLM client's REQUEST.
+PROCESS is unused."
+ (with-slots (process headers) request
+ (let* ((header-alist (cdr headers))
+ (authorization-header (assoc ':AUTHORIZATION header-alist))
+ (authorization-string (cdr authorization-header)))
+ (if (and (stringp authorization-string)
+ (string-match "NTLM " authorization-string))
+ (let* ((challenge (substring authorization-string (match-end 0)))
+ (binary (base64-decode-string challenge))
+ (type (aref binary 8))
+ ;; Flag byte 1 flags.
+ (negotiate-unicode 1)
+ (negotiate-oem 2)
+ (flags-byte-1 (aref binary 12))
+ (client-supports-unicode
+ (not (zerop (logand flags-byte-1 negotiate-unicode))))
+ (client-supports-oem
+ (not (zerop (logand flags-byte-1 negotiate-oem))))
+ (connection-header (assoc ':CONNECTION header-alist))
+ (_keep-alive
+ (when connection-header (cdr connection-header)))
+ (response
+ (cl-case type
+ (1
+ ;; Return Type 2 message.
+ (when (and (not client-supports-unicode)
+ (not client-supports-oem))
+ (warn (concat
+ "Weird client supports neither Unicode"
+ " nor OEM strings, using OEM.")))
+ (setq ntlm-tests--client-supports-unicode
+ client-supports-unicode)
+ (concat
+ "HTTP/1.1 401 Unauthorized\r\n"
+ "WWW-Authenticate: NTLM "
+ (base64-encode-string
+ (ntlm-server-build-type-2) t) "\r\n"
+ "WWW-Authenticate: Negotiate\r\n"
+ "WWW-Authenticate: Basic realm=\"domain\"\r\n"
+ "Content-Length: 0\r\n\r\n"))
+ (3
+ (if (ntlm-server-check-authorization
+ authorization-string)
+ "HTTP/1.1 200 OK\r\n\r\nAuthenticated.\r\n"
+ (progn
+ (if process
+ (set-process-filter process nil)
+ (error "Type 3 message found first?"))
+ (concat "HTTP/1.1 401 Unauthorized\r\n\r\n"
+ "Access Denied.\r\n")))))))
+ (if response
+ (ws-send process response)
+ (when process
+ (set-process-filter process nil)))
+ (when (equal type 3)
+ (set-process-filter process nil)
+ (process-send-eof process)))
+ (progn
+ ;; Did not get NTLM anything.
+ (set-process-filter process nil)
+ (process-send-eof process)
+ (concat "HTTP/1.1 401 Unauthorized\r\n\r\n"
+ "Access Denied.\r\n"))))))
+
+(defun ntlm-server-filter (process string)
+ "Read from PROCESS a STRING and treat it as a request from an NTLM client."
+ (let ((request (make-instance 'ws-request
+ :process process :pending string)))
+ (if (ws-parse-request request)
+ (ntlm-server-do-token request process)
+ (error "Failed to parse request"))))
+
+(defun ntlm-server-handler (request)
+ "Handle an HTTP REQUEST."
+ (with-slots (process headers) request
+ (let* ((header-alist (cdr headers))
+ (authorization-header (assoc ':AUTHORIZATION header-alist))
+ (connection-header (assoc ':CONNECTION header-alist))
+ (keep-alive (when connection-header (cdr connection-header)))
+ (response (concat
+ "HTTP/1.1 401 Unauthorized\r\n"
+ "WWW-Authenticate: Negotiate\r\n"
+ "WWW-Authenticate: NTLM\r\n"
+ "WWW-Authenticate: Basic realm=\"domain\"\r\n"
+ "Content-Length: 0\r\n\r\n")))
+ (if (null authorization-header)
+ ;; Tell client to use NTLM. Firefox will create a new
+ ;; connection.
+ (progn
+ (process-send-string process response)
+ (process-send-eof process))
+ (progn
+ (ntlm-server-do-token request nil)
+ (set-process-filter process #'ntlm-server-filter)
+ (if (equal (upcase keep-alive) "KEEP-ALIVE")
+ :keep-alive
+ (error "NTLM server expects keep-alive connection header")))))))
+
+(defun ntlm-server-start ()
+ "Start an NTLM server on port 8080 for testing."
+ (ws-start 'ntlm-server-handler 8080))
+
+(defun ntlm-server-stop ()
+ "Stop the NTLM server."
+ (ws-stop-all))
+
+(defvar ntlm-tests--result-buffer nil "Final NTLM result buffer.")
+
+(require 'url)
+
+(defun ntlm-tests--url-retrieve-internal-around (original &rest arguments)
+ "Save the result buffer from a `url-retrieve-internal' to a global variable.
+ORIGINAL is the original `url-retrieve-internal' function and
+ARGUMENTS are passed to it."
+ (setq ntlm-tests--result-buffer (apply original arguments)))
+
+(defun ntlm-tests--authenticate ()
+ "Authenticate using credentials from the authinfo resource file."
+ (setq ntlm-tests--result-buffer nil)
+ (let ((auth-sources (list (ert-resource-file "authinfo")))
+ (auth-source-do-cache nil)
+ (auth-source-debug (when (getenv "NTLM_TESTS_VERBOSE") 'trivia)))
+ (ntlm-tests-message "Using auth-sources: %S" auth-sources)
+ (url-retrieve-synchronously "http://localhost:8080"))
+ (sleep-for 0.1)
+ (ntlm-tests-message "Results are in: %S" ntlm-tests--result-buffer)
+ (with-current-buffer ntlm-tests--result-buffer
+ (buffer-string)))
+
+(defun ntlm-tests--start-server-authenticate-stop-server ()
+ "Start an NTLM server, authenticate against it, then stop the server."
+ (advice-add #'url-retrieve-internal
+ :around #'ntlm-tests--url-retrieve-internal-around)
+ (ntlm-server-stop)
+ (ntlm-server-start)
+ (let ((result (ntlm-tests--authenticate)))
+ (advice-remove #'url-retrieve-internal
+ #'ntlm-tests--url-retrieve-internal-around)
+ (ntlm-server-stop)
+ result))
+
+(defvar ntlm-tests--successful-result
+ (concat "HTTP/1.1 200 OK\n\nAuthenticated." (unibyte-string 13) "\n")
+ "Expected result of successful NTLM authentication.")
+
+(require 'find-func)
+(defun ntlm-tests--ensure-ws-parse-ntlm-support ()
+ "Ensure NTLM special-case in `ws-parse'."
+ (let* ((hit (find-function-search-for-symbol
+ 'ws-parse nil (locate-file "web-server.el" load-path)))
+ (buffer (car hit))
+ (position (cdr hit)))
+ (with-current-buffer buffer
+ (goto-char position)
+ (search-forward-regexp
+ ":NTLM" (save-excursion (forward-sexp) (point)) t))))
+
+(require 'lisp-mnt)
+(defvar ntlm-tests--dependencies-present
+ (and (featurep 'url-http-ntlm)
+ (version<= "2.0.4"
+ (lm-version (locate-file "url-http-ntlm.el" load-path)))
+ (featurep 'web-server)
+ (ntlm-tests--ensure-ws-parse-ntlm-support))
+ "Non-nil if GNU ELPA test dependencies were loaded.")
+
+(ert-deftest ntlm-authentication ()
+ "Check ntlm.el's implementation of NTLM authentication over HTTP."
+ (skip-unless ntlm-tests--dependencies-present)
+ (should (equal (ntlm-tests--start-server-authenticate-stop-server)
+ ntlm-tests--successful-result)))
+
+(ert-deftest ntlm-authentication-old-compatibility-level ()
+ (skip-unless ntlm-tests--dependencies-present)
+ (setq ntlm-compatibility-level 0)
+ (should (equal (ntlm-tests--start-server-authenticate-stop-server)
+ ntlm-tests--successful-result)))
+
(provide 'ntlm-tests)
+
+;;; ntlm-tests.el ends here
diff --git a/test/lisp/net/puny-tests.el b/test/lisp/net/puny-tests.el
index b37168f5ca7..28c0d49cbee 100644
--- a/test/lisp/net/puny-tests.el
+++ b/test/lisp/net/puny-tests.el
@@ -39,10 +39,12 @@
(should (string= (puny-decode-string "xn--9dbdkw") "חנוך")))
(ert-deftest puny-test-encode-domain ()
- (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se")))
+ (should (string= (puny-encode-domain "åäö.se") "xn--4cab6c.se"))
+ (should (string= (puny-encode-domain "яндекс.рф") "xn--d1acpjx3f.xn--p1ai")))
(ert-deftest puny-test-decode-domain ()
- (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se")))
+ (should (string= (puny-decode-domain "xn--4cab6c.se") "åäö.se"))
+ (should (string= (puny-decode-domain "xn--d1acpjx3f.xn--p1ai") "яндекс.рф")))
(ert-deftest puny-highly-restrictive-domain-p ()
(should (puny-highly-restrictive-domain-p "foo.bar.org"))
diff --git a/test/lisp/net/sasl-scram-rfc-tests.el b/test/lisp/net/sasl-scram-rfc-tests.el
index 3e9879a49d4..dfd4cf0e7ac 100644
--- a/test/lisp/net/sasl-scram-rfc-tests.el
+++ b/test/lisp/net/sasl-scram-rfc-tests.el
@@ -4,6 +4,8 @@
;; Author: Magnus Henoch <magnus.henoch@gmail.com>
+;; This file is part of GNU Emacs.
+
;; GNU Emacs 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
diff --git a/test/lisp/net/shr-tests.el b/test/lisp/net/shr-tests.el
index a06e31a4f88..ed532af657a 100644
--- a/test/lisp/net/shr-tests.el
+++ b/test/lisp/net/shr-tests.el
@@ -1,4 +1,4 @@
-;;; network-stream-tests.el --- tests for network processes -*- lexical-binding: t; -*-
+;;; shr-tests.el --- tests for shr.el -*- lexical-binding: t; -*-
;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/net/socks-tests.el b/test/lisp/net/socks-tests.el
index b378ed2964e..71bdd74890a 100644
--- a/test/lisp/net/socks-tests.el
+++ b/test/lisp/net/socks-tests.el
@@ -21,68 +21,151 @@
;;; Code:
+(require 'ert)
(require 'socks)
(require 'url-http)
-(defvar socks-tests-canned-server-port nil)
+(ert-deftest socks-tests-auth-registration-and-suite-offer ()
+ (ert-info ("Default favors user/pass auth")
+ (should (equal socks-authentication-methods
+ '((2 "Username/Password" . socks-username/password-auth)
+ (0 "No authentication" . identity))))
+ (should (equal "\2\0\2" (socks-build-auth-list)))) ; length [offer ...]
+ (let (socks-authentication-methods)
+ (ert-info ("Empty selection/no methods offered")
+ (should (equal "\0" (socks-build-auth-list))))
+ (ert-info ("Simulate library defaults")
+ (socks-register-authentication-method 0 "No authentication"
+ 'identity)
+ (should (equal socks-authentication-methods
+ '((0 "No authentication" . identity))))
+ (should (equal "\1\0" (socks-build-auth-list)))
+ (socks-register-authentication-method 2 "Username/Password"
+ 'socks-username/password-auth)
+ (should (equal socks-authentication-methods
+ '((2 "Username/Password" . socks-username/password-auth)
+ (0 "No authentication" . identity))))
+ (should (equal "\2\0\2" (socks-build-auth-list))))
+ (ert-info ("Removal")
+ (socks-unregister-authentication-method 2)
+ (should (equal socks-authentication-methods
+ '((0 "No authentication" . identity))))
+ (should (equal "\1\0" (socks-build-auth-list)))
+ (socks-unregister-authentication-method 0)
+ (should-not socks-authentication-methods)
+ (should (equal "\0" (socks-build-auth-list))))))
-(defun socks-tests-canned-server-create (verbatim patterns)
- "Create a fake SOCKS server and return the process.
+(ert-deftest socks-tests-filter-response-parsing-v4 ()
+ "Ensure new chunks added on right (Bug#45162)."
+ (let* ((buf (generate-new-buffer "*test-socks-filter*"))
+ (proc (start-process "test-socks-filter" buf "sleep" "1")))
+ (process-put proc 'socks t)
+ (process-put proc 'socks-state socks-state-waiting)
+ (process-put proc 'socks-server-protocol 4)
+ (ert-info ("Receive initial incomplete segment")
+ (socks-filter proc (concat [0 90 0 0 93 184 216]))
+ ;; From example.com: OK status ^ ^ msg start
+ (ert-info ("State still set to waiting")
+ (should (eq (process-get proc 'socks-state) socks-state-waiting)))
+ (ert-info ("Response field is nil because processing incomplete")
+ (should-not (process-get proc 'socks-response)))
+ (ert-info ("Scratch field holds stashed partial payload")
+ (should (string= (concat [0 90 0 0 93 184 216])
+ (process-get proc 'socks-scratch)))))
+ (ert-info ("Last part arrives")
+ (socks-filter proc "\42") ; ?\" 34
+ (ert-info ("State transitions to complete (length check passes)")
+ (should (eq (process-get proc 'socks-state) socks-state-connected)))
+ (ert-info ("Scratch and response fields hold stash w. last chunk")
+ (should (string= (concat [0 90 0 0 93 184 216 34])
+ (process-get proc 'socks-response)))
+ (should (string= (process-get proc 'socks-response)
+ (process-get proc 'socks-scratch)))))
+ (delete-process proc)
+ (kill-buffer buf)))
-`VERBATIM' and `PATTERNS' are dotted alists containing responses.
-Requests are tried in order. On failure, an error is raised."
- (let* ((buf (generate-new-buffer "*canned-socks-server*"))
+(ert-deftest socks-tests-filter-response-parsing-v5 ()
+ "Ensure new chunks added on right (Bug#45162)."
+ (let* ((buf (generate-new-buffer "*test-socks-filter*"))
+ (proc (start-process "test-socks-filter" buf "sleep" "1")))
+ (process-put proc 'socks t)
+ (process-put proc 'socks-state socks-state-waiting)
+ (process-put proc 'socks-server-protocol 5)
+ (ert-info ("Receive initial incomplete segment")
+ ;; From fedora.org: 2605:bc80:3010:600:dead:beef:cafe:fed9
+ ;; 5004 ~~> Version Status (OK) NOOP Addr-Type (4 -> IPv6)
+ (socks-filter proc "\5\0\0\4\x26\x05\xbc\x80\x30\x10\x00\x60")
+ (ert-info ("State still waiting and response emtpy")
+ (should (eq (process-get proc 'socks-state) socks-state-waiting))
+ (should-not (process-get proc 'socks-response)))
+ (ert-info ("Scratch field holds partial payload of pending msg")
+ (should (string= "\5\0\0\4\x26\x05\xbc\x80\x30\x10\x00\x60"
+ (process-get proc 'socks-scratch)))))
+ (ert-info ("Middle chunk arrives")
+ (socks-filter proc "\xde\xad\xbe\xef\xca\xfe\xfe\xd9")
+ (ert-info ("State and response fields still untouched")
+ (should (eq (process-get proc 'socks-state) socks-state-waiting))
+ (should-not (process-get proc 'socks-response)))
+ (ert-info ("Scratch contains new arrival appended (on RHS)")
+ (should (string= (concat "\5\0\0\4"
+ "\x26\x05\xbc\x80\x30\x10\x00\x60"
+ "\xde\xad\xbe\xef\xca\xfe\xfe\xd9")
+ (process-get proc 'socks-scratch)))))
+ (ert-info ("Final part arrives (port number)")
+ (socks-filter proc "\0\0")
+ (ert-info ("State transitions to complete")
+ (should (eq (process-get proc 'socks-state) socks-state-connected)))
+ (ert-info ("Scratch and response fields show last chunk appended")
+ (should (string= (concat "\5\0\0\4"
+ "\x26\x05\xbc\x80\x30\x10\x00\x60"
+ "\xde\xad\xbe\xef\xca\xfe\xfe\xd9"
+ "\0\0")
+ (process-get proc 'socks-scratch)))
+ (should (string= (process-get proc 'socks-response)
+ (process-get proc 'socks-scratch)))))
+ (delete-process proc)
+ (kill-buffer buf)))
+
+(defvar socks-tests-canned-server-patterns nil
+ "Alist containing request/response cons pairs to be tried in order.
+Vectors must match verbatim. Strings are considered regex patterns.")
+
+(defun socks-tests-canned-server-create ()
+ "Create and return a fake SOCKS server."
+ (let* ((port (nth 2 socks-server))
+ (name (format "socks-server:%d" port))
+ (pats socks-tests-canned-server-patterns)
(filt (lambda (proc line)
- (let ((resp (or (assoc-default line verbatim
- (lambda (k s) ; s is line
- (string= (concat k) s)))
- (assoc-default line patterns
- (lambda (p s)
- (string-match-p p s))))))
- (unless resp
+ (pcase-let ((`(,pat . ,resp) (pop pats)))
+ (unless (or (and (vectorp pat) (equal pat (vconcat line)))
+ (string-match-p pat line))
(error "Unknown request: %s" line))
(let ((print-escape-control-characters t))
- (princ (format "<- %s\n" (prin1-to-string line)) buf)
- (princ (format "-> %s\n" (prin1-to-string resp)) buf))
+ (message "[%s] <- %s" name (prin1-to-string line))
+ (message "[%s] -> %s" name (prin1-to-string resp)))
(process-send-string proc (concat resp)))))
- (srv (make-network-process :server 1
- :buffer buf
- :filter filt
- :name "server"
- :family 'ipv4
- :host 'local
- :service socks-tests-canned-server-port)))
- (set-process-query-on-exit-flag srv nil)
- (princ (format "[%s] Listening on localhost:10080\n" srv) buf)
- srv))
-
-;; Add ([5 3 0 1 2] . [5 2]) to the `verbatim' list below to validate
-;; against curl 7.71 with the following options:
-;; $ curl --verbose -U foo:bar --proxy socks5h://127.0.0.1:10080 example.com
-;;
-;; If later implementing version 4a, try these:
-;; [4 1 0 80 0 0 0 1 0 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0] . [0 90 0 0 0 0 0 0]
-;; $ curl --verbose --proxy socks4a://127.0.0.1:10080 example.com
+ (serv (make-network-process :server 1
+ :buffer (get-buffer-create name)
+ :filter filt
+ :name name
+ :family 'ipv4
+ :host 'local
+ :coding 'binary
+ :service port)))
+ (set-process-query-on-exit-flag serv nil)
+ serv))
-(ert-deftest socks-tests-auth-filter-url-http ()
- "Verify correct handling of SOCKS5 user/pass authentication."
- (let* ((socks-server '("server" "127.0.0.1" 10080 5))
- (socks-username "foo")
- (socks-password "bar")
- (url-gateway-method 'socks)
+(defvar socks-tests--hello-world-http-request-pattern
+ (cons "^GET /" (concat "HTTP/1.1 200 OK\r\n"
+ "Content-Type: text/plain\r\n"
+ "Content-Length: 13\r\n\r\n"
+ "Hello World!\n")))
+
+(defun socks-tests-perform-hello-world-http-request ()
+ "Start canned server, validate hello-world response, and finalize."
+ (let* ((url-gateway-method 'socks)
(url (url-generic-parse-url "http://example.com"))
- (verbatim '(([5 2 0 2] . [5 2])
- ([1 3 ?f ?o ?o 3 ?b ?a ?r] . [1 0])
- ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
- . [5 0 0 1 0 0 0 0 0 0])))
- (patterns
- `(("^GET /" . ,(concat "HTTP/1.1 200 OK\r\n"
- "Content-Type: text/plain; charset=UTF-8\r\n"
- "Content-Length: 13\r\n\r\n"
- "Hello World!\n"))))
- (socks-tests-canned-server-port 10080)
- (server (socks-tests-canned-server-create verbatim patterns))
- (tries 10)
+ (server (socks-tests-canned-server-create))
;;
done
;;
@@ -90,14 +173,112 @@ Requests are tried in order. On failure, an error is raised."
(goto-char (point-min))
(should (search-forward "Hello World" nil t))
(setq done t)))
- (buf (url-http url cb '(nil))))
- (ert-info ("Connect to HTTP endpoint over SOCKS5 with USER/PASS method")
- (while (and (not done) (< 0 (cl-decf tries))) ; cl-lib via url-http
- (sleep-for 0.1)))
+ (inhibit-message noninteractive)
+ (buf (url-http url cb '(nil)))
+ (proc (get-buffer-process buf))
+ (attempts 10))
+ (while (and (not done) (< 0 (cl-decf attempts)))
+ (sleep-for 0.1))
(should done)
(delete-process server)
+ (delete-process proc) ; otherwise seems client proc is sometimes reused
(kill-buffer (process-buffer server))
(kill-buffer buf)
(ignore url-gateway-method)))
+;; Unlike curl, socks.el includes the ID field (but otherwise matches):
+;; $ curl --proxy socks4://127.0.0.1:1080 example.com
+
+(ert-deftest socks-tests-v4-basic ()
+ "Show correct preparation of SOCKS4 connect command (Bug#46342)."
+ (let ((socks-server '("server" "127.0.0.1" 10079 4))
+ (url-user-agent "Test/4-basic")
+ (socks-tests-canned-server-patterns
+ `(([4 1 0 80 93 184 216 34 ?f ?o ?o 0] . [0 90 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern))
+ socks-nslookup-program)
+ (ert-info ("Make HTTP request over SOCKS4")
+ (cl-letf (((symbol-function 'socks-nslookup-host)
+ (lambda (host)
+ (should (equal host "example.com"))
+ (list 93 184 216 34)))
+ ((symbol-function 'user-full-name)
+ (lambda () "foo")))
+ (socks-tests-perform-hello-world-http-request)))))
+
+;; Replace first pattern below with ([5 3 0 1 2] . [5 2]) to validate
+;; against curl 7.71 with the following options:
+;; $ curl --verbose -U foo:bar --proxy socks5h://127.0.0.1:10080 example.com
+
+(ert-deftest socks-tests-v5-auth-user-pass ()
+ "Verify correct handling of SOCKS5 user/pass authentication."
+ (should (assq 2 socks-authentication-methods))
+ (let ((socks-server '("server" "127.0.0.1" 10080 5))
+ (socks-username "foo")
+ (socks-password "bar")
+ (url-user-agent "Test/auth-user-pass")
+ (socks-tests-canned-server-patterns
+ `(([5 2 0 2] . [5 2])
+ ([1 3 ?f ?o ?o 3 ?b ?a ?r] . [1 0])
+ ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
+ . [5 0 0 1 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern)))
+ (ert-info ("Make HTTP request over SOCKS5 with USER/PASS auth method")
+ (socks-tests-perform-hello-world-http-request))))
+
+;; Services (like Tor) may be configured without auth but for some
+;; reason still prefer the user/pass method over none when offered both.
+;; Given this library's defaults, the scenario below is possible.
+;;
+;; FYI: RFC 1929 doesn't say that a username or password is required
+;; but notes that the length of both fields should be at least one.
+;; However, both socks.el and curl send zero-length fields (though
+;; curl drops the user part too when the password is empty).
+;;
+;; From Tor's docs /socks-extensions.txt, 1.1 Extent of support:
+;; > We allow username/password fields of this message to be empty ...
+;; line 41 in blob 5fd1f828f3e9d014f7b65fa3bd1d33c39e4129e2
+;; https://gitweb.torproject.org/torspec.git/tree/socks-extensions.txt
+;;
+;; To verify against curl 7.71, swap out the first two pattern pairs
+;; with ([5 3 0 1 2] . [5 2]) and ([1 0 0] . [1 0]), then run:
+;; $ curl verbose -U "foo:" --proxy socks5h://127.0.0.1:10081 example.com
+
+(ert-deftest socks-tests-v5-auth-user-pass-blank ()
+ "Verify correct SOCKS5 user/pass authentication with empty pass."
+ (should (assq 2 socks-authentication-methods))
+ (let ((socks-server '("server" "127.0.0.1" 10081 5))
+ (socks-username "foo") ; defaults to (user-login-name)
+ (socks-password "") ; simulate user hitting enter when prompted
+ (url-user-agent "Test/auth-user-pass-blank")
+ (socks-tests-canned-server-patterns
+ `(([5 2 0 2] . [5 2])
+ ([1 3 ?f ?o ?o 0] . [1 0])
+ ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
+ . [5 0 0 1 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern)))
+ (ert-info ("Make HTTP request over SOCKS5 with USER/PASS auth method")
+ (socks-tests-perform-hello-world-http-request))))
+
+;; Swap out ([5 2 0 1] . [5 0]) with the first pattern below to validate
+;; against curl 7.71 with the following options:
+;; $ curl --verbose --proxy socks5h://127.0.0.1:10082 example.com
+
+(ert-deftest socks-tests-v5-auth-none ()
+ "Verify correct handling of SOCKS5 when auth method 0 requested."
+ (let ((socks-server '("server" "127.0.0.1" 10082 5))
+ (socks-authentication-methods (append socks-authentication-methods
+ nil))
+ (url-user-agent "Test/auth-none")
+ (socks-tests-canned-server-patterns
+ `(([5 1 0] . [5 0])
+ ([5 1 0 3 11 ?e ?x ?a ?m ?p ?l ?e ?. ?c ?o ?m 0 80]
+ . [5 0 0 1 0 0 0 0 0 0])
+ ,socks-tests--hello-world-http-request-pattern)))
+ (socks-unregister-authentication-method 2)
+ (should-not (assq 2 socks-authentication-methods))
+ (ert-info ("Make HTTP request over SOCKS5 with no auth method")
+ (socks-tests-perform-hello-world-http-request)))
+ (should (assq 2 socks-authentication-methods)))
+
;;; socks-tests.el ends here
diff --git a/test/lisp/net/tramp-archive-tests.el b/test/lisp/net/tramp-archive-tests.el
index 6a6b56f4a1d..aac1b13bd0e 100644
--- a/test/lisp/net/tramp-archive-tests.el
+++ b/test/lisp/net/tramp-archive-tests.el
@@ -292,15 +292,26 @@ variables, so we check the Emacs version directly."
"Check `expand-file-name'."
(should
(string-equal
- (expand-file-name "/foo.tar/path/./file") "/foo.tar/path/file"))
+ (expand-file-name (concat tramp-archive-test-archive "path/./file"))
+ (concat tramp-archive-test-archive "path/file")))
(should
- (string-equal (expand-file-name "/foo.tar/path/../file") "/foo.tar/file"))
+ (string-equal
+ (expand-file-name (concat tramp-archive-test-archive "path/../file"))
+ (concat tramp-archive-test-archive "file")))
;; `expand-file-name' does not care "~/" in archive file names.
(should
- (string-equal (expand-file-name "/foo.tar/~/file") "/foo.tar/~/file"))
+ (string-equal
+ (expand-file-name (concat tramp-archive-test-archive "~/file"))
+ (concat tramp-archive-test-archive "~/file")))
;; `expand-file-name' does not care file archive boundaries.
- (should (string-equal (expand-file-name "/foo.tar/./file") "/foo.tar/file"))
- (should (string-equal (expand-file-name "/foo.tar/../file") "/file")))
+ (should
+ (string-equal
+ (expand-file-name (concat tramp-archive-test-archive "./file"))
+ (concat tramp-archive-test-archive "file")))
+ (should
+ (string-equal
+ (expand-file-name (concat tramp-archive-test-archive "../file"))
+ (concat (ert-resource-directory) "file"))))
;; This test is inspired by Bug#30293.
(ert-deftest tramp-archive-test05-expand-file-name-non-archive-directory ()
@@ -325,38 +336,59 @@ This checks also `file-name-as-directory', `file-name-directory',
(should
(string-equal
- (directory-file-name "/foo.tar/path/to/file") "/foo.tar/path/to/file"))
+ (directory-file-name (concat tramp-archive-test-archive "path/to/file"))
+ (concat tramp-archive-test-archive "path/to/file")))
(should
(string-equal
- (directory-file-name "/foo.tar/path/to/file/") "/foo.tar/path/to/file"))
+ (directory-file-name (concat tramp-archive-test-archive "path/to/file/"))
+ (concat tramp-archive-test-archive "path/to/file")))
;; `directory-file-name' does not leave file archive boundaries.
- (should (string-equal (directory-file-name "/foo.tar/") "/foo.tar/"))
+ (should
+ (string-equal
+ (directory-file-name tramp-archive-test-archive) tramp-archive-test-archive))
(should
(string-equal
- (file-name-as-directory "/foo.tar/path/to/file") "/foo.tar/path/to/file/"))
+ (file-name-as-directory (concat tramp-archive-test-archive "path/to/file"))
+ (concat tramp-archive-test-archive "path/to/file/")))
(should
(string-equal
- (file-name-as-directory "/foo.tar/path/to/file/") "/foo.tar/path/to/file/"))
- (should (string-equal (file-name-as-directory "/foo.tar/") "/foo.tar/"))
- (should (string-equal (file-name-as-directory "/foo.tar") "/foo.tar/"))
+ (file-name-as-directory (concat tramp-archive-test-archive "path/to/file/"))
+ (concat tramp-archive-test-archive "path/to/file/")))
+ (should
+ (string-equal
+ (file-name-as-directory tramp-archive-test-archive)
+ tramp-archive-test-archive))
+ (should
+ (string-equal
+ (file-name-as-directory tramp-archive-test-file-archive)
+ tramp-archive-test-archive))
(should
(string-equal
- (file-name-directory "/foo.tar/path/to/file") "/foo.tar/path/to/"))
+ (file-name-directory (concat tramp-archive-test-archive "path/to/file"))
+ (concat tramp-archive-test-archive "path/to/")))
(should
(string-equal
- (file-name-directory "/foo.tar/path/to/file/") "/foo.tar/path/to/file/"))
- (should (string-equal (file-name-directory "/foo.tar/") "/foo.tar/"))
+ (file-name-directory (concat tramp-archive-test-archive "path/to/file/"))
+ (concat tramp-archive-test-archive "path/to/file/")))
+ (should
+ (string-equal
+ (file-name-directory tramp-archive-test-archive) tramp-archive-test-archive))
(should
- (string-equal (file-name-nondirectory "/foo.tar/path/to/file") "file"))
+ (string-equal
+ (file-name-nondirectory (concat tramp-archive-test-archive "path/to/file"))
+ "file"))
(should
- (string-equal (file-name-nondirectory "/foo.tar/path/to/file/") ""))
- (should (string-equal (file-name-nondirectory "/foo.tar/") ""))
+ (string-equal
+ (file-name-nondirectory (concat tramp-archive-test-archive "path/to/file/"))
+ ""))
+ (should (string-equal (file-name-nondirectory tramp-archive-test-archive) ""))
(should-not
- (unhandled-file-name-directory "/foo.tar/path/to/file")))
+ (unhandled-file-name-directory
+ (concat tramp-archive-test-archive "path/to/file"))))
(ert-deftest tramp-archive-test07-file-exists-p ()
"Check `file-exist-p', `write-region' and `delete-file'."
@@ -824,7 +856,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(tramp-archive-cleanup-hash))))
;; The functions were introduced in Emacs 26.1.
-(ert-deftest tramp-archive-test39-make-nearby-temp-file ()
+(ert-deftest tramp-archive-test40-make-nearby-temp-file ()
"Check `make-nearby-temp-file' and `temporary-file-directory'."
(skip-unless tramp-archive-enabled)
;; Since Emacs 26.1.
@@ -861,7 +893,7 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(delete-directory tmp-file)
(should-not (file-exists-p tmp-file))))
-(ert-deftest tramp-archive-test42-file-system-info ()
+(ert-deftest tramp-archive-test43-file-system-info ()
"Check that `file-system-info' returns proper values."
(skip-unless tramp-archive-enabled)
;; Since Emacs 27.1.
@@ -887,27 +919,35 @@ This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
;; tramp-archive is neither loaded at Emacs startup, nor when
;; loading a file like "/mock::foo" (which loads Tramp).
- (let ((default-directory (expand-file-name temporary-file-directory))
- (code
+ (let ((code
"(progn \
- (message \"tramp-archive loaded: %%s %%s\" \
- (featurep 'tramp) (featurep 'tramp-archive)) \
+ (message \"tramp-archive loaded: %%s\" \
+ (featurep 'tramp-archive)) \
(file-attributes %S \"/\") \
- (message \"tramp-archive loaded: %%s %%s\" \
- (featurep 'tramp) (featurep 'tramp-archive)))"))
- (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo")))
- (should
- (string-match
- (format
- "tramp-archive loaded: nil nil[[:ascii:]]+tramp-archive loaded: t %s"
- (tramp-archive-file-name-p file))
- (shell-command-to-string
- (format
- "%s -batch -Q -L %s --eval %s"
- (shell-quote-argument
- (expand-file-name invocation-name invocation-directory))
- (mapconcat #'shell-quote-argument load-path " -L ")
- (shell-quote-argument (format code file)))))))))
+ (message \"tramp-archive loaded: %%s\" \
+ (featurep 'tramp-archive)))"))
+ (dolist (default-directory
+ `(,temporary-file-directory
+ ;; Starting Emacs in a directory which has
+ ;; `tramp-archive-file-name-regexp' syntax is
+ ;; supported only with Emacs > 27.2 (sigh!).
+ ;; (Bug#48476)
+ ,(file-name-as-directory tramp-archive-test-directory)))
+ (dolist (file `("/mock::foo" ,(concat tramp-archive-test-archive "foo")))
+ (should
+ (string-match
+ (format
+ "tramp-archive loaded: %s[[:ascii:]]+tramp-archive loaded: %s"
+ (tramp-archive-file-name-p default-directory)
+ (or (tramp-archive-file-name-p default-directory)
+ (tramp-archive-file-name-p file)))
+ (shell-command-to-string
+ (format
+ "%s -batch -Q -L %s --eval %s"
+ (shell-quote-argument
+ (expand-file-name invocation-name invocation-directory))
+ (mapconcat #'shell-quote-argument load-path " -L ")
+ (shell-quote-argument (format code file))))))))))
(ert-deftest tramp-archive-test45-delay-load ()
"Check that `tramp-archive' is loaded lazily, only when needed."
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index f4883923f6a..3008861f22b 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -33,7 +33,7 @@
;; remote host, set this environment variable to "/dev/null" or
;; whatever is appropriate on your system.
-;; For slow remote connections, `tramp-test43-asynchronous-requests'
+;; For slow remote connections, `tramp-test44-asynchronous-requests'
;; might be too heavy. Setting $REMOTE_PARALLEL_PROCESSES to a proper
;; value less than 10 could help.
@@ -59,9 +59,12 @@
(declare-function tramp-get-remote-perl "tramp-sh")
(declare-function tramp-get-remote-stat "tramp-sh")
(declare-function tramp-list-tramp-buffers "tramp-cmds")
+(declare-function tramp-method-out-of-band-p "tramp-sh")
(declare-function tramp-smb-get-localname "tramp-smb")
(defvar ange-ftp-make-backup-files)
(defvar auto-save-file-name-transforms)
+(defvar lock-file-name-transforms)
+(defvar remote-file-name-inhibit-locks)
(defvar tramp-connection-properties)
(defvar tramp-copy-size-limit)
(defvar tramp-display-escape-sequence-regexp)
@@ -121,6 +124,7 @@
(setq auth-source-save-behavior nil
password-cache-expiry nil
remote-file-name-inhibit-cache nil
+ tramp-allow-unsafe-temporary-files t
tramp-cache-read-persistent-data t ;; For auth-sources.
tramp-copy-size-limit nil
tramp-persistency-file-name nil
@@ -178,6 +182,11 @@ The temporary file is not created."
"Whether `tramp--test-instrument-test-case' run.
This shall used dynamically bound only.")
+;; When `tramp-verbose' is greater than 10, and you want to trace
+;; other functions as well, do something like
+;; (let ((tramp-trace-functions '(file-name-non-special)))
+;; (tramp--test-instrument-test-case 11
+;; ...))
(defmacro tramp--test-instrument-test-case (verbose &rest body)
"Run BODY with `tramp-verbose' equal VERBOSE.
Print the content of the Tramp connection and debug buffers, if
@@ -186,31 +195,22 @@ is greater than 10.
`should-error' is not handled properly. BODY shall not contain a timeout."
(declare (indent 1) (debug (natnump body)))
`(let* ((tramp-verbose (max (or ,verbose 0) (or tramp-verbose 0)))
- (trace-buffer
- (when (> tramp-verbose 10) (generate-new-buffer " *temp*")))
+ (trace-buffer (tramp-trace-buffer-name tramp-test-vec))
(debug-ignored-errors
(append
'("^make-symbolic-link not supported$"
"^error with add-name-to-file")
debug-ignored-errors))
inhibit-message)
- (when trace-buffer
- (dolist (elt (all-completions "tramp-" obarray 'functionp))
- (trace-function-background (intern elt))))
(unwind-protect
(let ((tramp--test-instrument-test-case-p t)) ,@body)
;; Unwind forms.
- (when trace-buffer
- (untrace-all))
(when (and (null tramp--test-instrument-test-case-p) (> tramp-verbose 3))
- (dolist
- (buf (if trace-buffer
- (cons (get-buffer trace-buffer) (tramp-list-tramp-buffers))
- (tramp-list-tramp-buffers)))
+ (untrace-all)
+ (dolist (buf (tramp-list-tramp-buffers))
(with-current-buffer buf
- (message ";; %s\n%s" buf (buffer-string)))))
- (when trace-buffer
- (kill-buffer trace-buffer)))))
+ (message ";; %s\n%s" buf (buffer-string)))
+ (kill-buffer buf))))))
(defsubst tramp--test-message (fmt-string &rest arguments)
"Emit a message into ERT *Messages*."
@@ -232,6 +232,16 @@ is greater than 10.
"%s %f sec"
,message (float-time (time-subtract (current-time) start))))))
+;; `always' is introduced with Emacs 28.1.
+(defalias 'tramp--test-always
+ (if (fboundp 'always)
+ #'always
+ (lambda (&rest _arguments)
+ "Do nothing and return t.
+This function accepts any number of ARGUMENTS, but ignores them.
+Also see `ignore'."
+ t)))
+
(ert-deftest tramp-test00-availability ()
"Test availability of Tramp functions."
:expected-result (if (tramp--test-enabled) :passed :failed)
@@ -2182,6 +2192,16 @@ is greater than 10.
(expand-file-name ".." "./"))
(concat (file-remote-p tramp-test-temporary-file-directory) "/"))))
+(ert-deftest tramp-test05-expand-file-name-top ()
+ "Check `expand-file-name'."
+ (skip-unless (tramp--test-enabled))
+ (skip-unless (not (tramp--test-ange-ftp-p)))
+
+ (let ((dir (concat (file-remote-p tramp-test-temporary-file-directory) "/")))
+ (dolist (local '("." ".."))
+ (should (string-equal (expand-file-name local dir) dir))
+ (should (string-equal (expand-file-name (concat dir local)) dir)))))
+
(ert-deftest tramp-test06-directory-file-name ()
"Check `directory-file-name'.
This checks also `file-name-as-directory', `file-name-directory',
@@ -2446,10 +2466,13 @@ This checks also `file-name-as-directory', `file-name-directory',
"^\\'")
tramp--test-messages))))))))
+ ;; We do not test lockname here. See
+ ;; `tramp-test39-make-lock-file-name'.
+
;; Do not overwrite if excluded.
- (cl-letf (((symbol-function #'y-or-n-p) (lambda (_prompt) t))
+ (cl-letf (((symbol-function #'y-or-n-p) #'tramp--test-always)
;; Ange-FTP.
- ((symbol-function 'yes-or-no-p) (lambda (_prompt) t)))
+ ((symbol-function 'yes-or-no-p) #'tramp--test-always))
(write-region "foo" nil tmp-name nil nil nil 'mustbenew))
;; `mustbenew' is passed to Tramp since Emacs 26.1.
(when (tramp--test-emacs26-p)
@@ -2814,9 +2837,9 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
(should (file-exists-p (expand-file-name "bla" tmp-name2)))
(should-error
(delete-directory tmp-name1 nil 'trash)
- ;; tramp-rclone.el calls the local `delete-directory'.
- ;; This raises another error.
- :type (if (tramp--test-rclone-p) 'error 'file-error))
+ ;; tramp-rclone.el and tramp-sshfs.el call the local
+ ;; `delete-directory'. This raises another error.
+ :type (if (tramp--test-fuse-p) 'error 'file-error))
(delete-directory tmp-name1 'recursive 'trash)
(should-not (file-directory-p tmp-name1))
(should
@@ -3244,8 +3267,8 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
(ignore-errors (delete-directory tmp-name1 'recursive))))))
;; Method "smb" supports `make-symbolic-link' only if the remote host
-;; has CIFS capabilities. tramp-adb.el, tramp-gvfs.el and
-;; tramp-rclone.el do not support symbolic links at all.
+;; has CIFS capabilities. tramp-adb.el, tramp-gvfs.el, tramp-rclone.el
+;; and tramp-sshfs.el do not support symbolic links at all.
(defmacro tramp--test-ignore-make-symbolic-link-error (&rest body)
"Run BODY, ignoring \"make-symbolic-link not supported\" file error."
(declare (indent defun) (debug (body)))
@@ -3526,7 +3549,7 @@ They might differ only in time attributes or directory size."
This tests also `file-executable-p', `file-writable-p' and `set-file-modes'."
(skip-unless (tramp--test-enabled))
(skip-unless
- (or (tramp--test-sh-p) (tramp--test-sudoedit-p)
+ (or (tramp--test-sh-p) (tramp--test-sshfs-p) (tramp--test-sudoedit-p)
;; Not all tramp-gvfs.el methods support changing the file mode.
(and
(tramp--test-gvfs-p)
@@ -3663,7 +3686,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(should-error
(make-symbolic-link tmp-name1 tmp-name2 0)
:type 'file-already-exists)))
- (cl-letf (((symbol-function #'yes-or-no-p) (lambda (_prompt) t)))
+ (cl-letf (((symbol-function #'yes-or-no-p) #'tramp--test-always))
(make-symbolic-link tmp-name1 tmp-name2 0)
(should
(string-equal
@@ -3739,7 +3762,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(should-error
(add-name-to-file tmp-name1 tmp-name2 0)
:type 'file-already-exists))
- (cl-letf (((symbol-function #'yes-or-no-p) (lambda (_prompt) t)))
+ (cl-letf (((symbol-function #'yes-or-no-p) #'tramp--test-always))
(add-name-to-file tmp-name1 tmp-name2 0)
(should (file-regular-p tmp-name2)))
(add-name-to-file tmp-name1 tmp-name2 'ok-if-already-exists)
@@ -4073,7 +4096,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(write-region "foo" nil tmp-name1)
(should (file-exists-p tmp-name1))
(should (file-selinux-context tmp-name1))
- (copy-file tmp-name1 tmp-name2)
+ (copy-file tmp-name1 tmp-name2 nil nil nil 'preserve-permissions)
(should (file-selinux-context tmp-name2))
(should
(equal
@@ -4357,11 +4380,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(and (featurep 'tramp-test-load) (unload-feature 'tramp-test-load))
(delete-file tmp-name))))))
+(defun tramp--test-shell-file-name ()
+ "Return default remote shell."
+ (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh"))
+
(ert-deftest tramp-test28-process-file ()
"Check `process-file'."
:tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
- (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
+ (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
@@ -4378,25 +4405,27 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
(should-not (zerop (process-file "binary-does-not-exist")))
;; Return exit code.
(should (= 42 (process-file
- (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh")
+ (tramp--test-shell-file-name)
nil nil nil "-c" "exit 42")))
;; Return exit code in case the process is interrupted,
;; and there's no indication for a signal describing string.
- (let (process-file-return-signal-string)
- (should
- (= (+ 128 2)
- (process-file
- (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh")
- nil nil nil "-c" "kill -2 $$"))))
+ (unless (tramp--test-sshfs-p)
+ (let (process-file-return-signal-string)
+ (should
+ (= (+ 128 2)
+ (process-file
+ (tramp--test-shell-file-name)
+ nil nil nil "-c" "kill -2 $$")))))
;; Return string in case the process is interrupted and
;; there's an indication for a signal describing string.
- (let ((process-file-return-signal-string t))
- (should
- (string-match-p
- "Interrupt\\|Signal 2"
- (process-file
- (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh")
- nil nil nil "-c" "kill -2 $$"))))
+ (unless (tramp--test-sshfs-p)
+ (let ((process-file-return-signal-string t))
+ (should
+ (string-match-p
+ "Interrupt\\|Signal 2"
+ (process-file
+ (tramp--test-shell-file-name)
+ nil nil nil "-c" "kill -2 $$")))))
(with-temp-buffer
(write-region "foo" nil tmp-name)
@@ -4440,7 +4469,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
"Check `start-file-process'."
:tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
- (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
+ (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
@@ -4531,7 +4560,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'."
If UNSTABLE is non-nil, the test is tagged as `:unstable'."
(declare (indent 1))
;; `make-process' supports file name handlers since Emacs 27.
- (when (let ((file-name-handler-alist '(("" . (lambda (&rest _) t)))))
+ (when (let ((file-name-handler-alist '(("" . #'tramp--test-always))))
(ignore-errors (make-process :file-handler t)))
`(ert-deftest ,(intern (concat (symbol-name test) "-direct-async")) ()
,docstring
@@ -4547,7 +4576,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
;; `file-truename' does it by side-effect. Suppress
;; `tramp--test-enabled', in order to keep the connection.
;; Suppress "Process ... finished" messages.
- (cl-letf (((symbol-function #'tramp--test-enabled) (lambda nil t))
+ (cl-letf (((symbol-function #'tramp--test-enabled) #'tramp--test-always)
((symbol-function #'internal-default-process-sentinel)
#'ignore))
(file-truename tramp-test-temporary-file-directory)
@@ -4560,15 +4589,14 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
"Check `make-process'."
:tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
- (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
+ (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
;; `make-process' supports file name handlers since Emacs 27.
(skip-unless (tramp--test-emacs27-p))
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
(let ((default-directory tramp-test-temporary-file-directory)
- (tmp-name1 (tramp--test-make-temp-name nil quoted))
- (tmp-name2 (tramp--test-make-temp-name 'local quoted))
+ (tmp-name (tramp--test-make-temp-name nil quoted))
kill-buffer-query-functions proc)
(with-no-warnings (should-not (make-process)))
@@ -4596,13 +4624,13 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
;; Simple process using a file.
(unwind-protect
(with-temp-buffer
- (write-region "foo" nil tmp-name1)
- (should (file-exists-p tmp-name1))
+ (write-region "foo" nil tmp-name)
+ (should (file-exists-p tmp-name))
(setq proc
(with-no-warnings
(make-process
:name "test2" :buffer (current-buffer)
- :command `("cat" ,(file-name-nondirectory tmp-name1))
+ :command `("cat" ,(file-name-nondirectory tmp-name))
:file-handler t)))
(should (processp proc))
;; Read output.
@@ -4614,7 +4642,7 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
;; Cleanup.
(ignore-errors
(delete-process proc)
- (delete-file tmp-name1)))
+ (delete-file tmp-name)))
;; Process filter.
(unwind-protect
@@ -4678,11 +4706,17 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
:stderr stderr
:file-handler t)))
(should (processp proc))
- ;; Read stderr.
+ ;; Read output.
(with-timeout (10 (tramp--test-timeout-handler))
(while (accept-process-output proc 0 nil t)))
- (delete-process proc)
+ ;; Read stderr.
(with-current-buffer stderr
+ (with-timeout (10 (tramp--test-timeout-handler))
+ (while (not (string-match-p
+ "No such file or directory" (buffer-string)))
+ (while (accept-process-output
+ (get-buffer-process stderr) 0 nil t))))
+ (delete-process proc)
(should
(string-match-p
"cat:.* No such file or directory" (buffer-string)))))
@@ -4693,30 +4727,67 @@ If UNSTABLE is non-nil, the test is tagged as `:unstable'."
;; Process with stderr file.
(unless (tramp-direct-async-process-p)
- (dolist (tmpfile `(,tmp-name1 ,tmp-name2))
+ (unwind-protect
+ (with-temp-buffer
+ (setq proc
+ (with-no-warnings
+ (make-process
+ :name "test6" :buffer (current-buffer)
+ :command '("cat" "/does-not-exist")
+ :stderr tmp-name
+ :file-handler t)))
+ (should (processp proc))
+ ;; Read stderr.
+ (with-timeout (10 (tramp--test-timeout-handler))
+ (while (accept-process-output proc nil nil t)))
+ (delete-process proc)
+ (with-temp-buffer
+ (insert-file-contents tmp-name)
+ (should
+ (string-match-p
+ "cat:.* No such file or directory" (buffer-string)))))
+
+ ;; Cleanup.
+ (ignore-errors (delete-process proc))
+ (ignore-errors (delete-file tmp-name))))
+
+ ;; Process connection type.
+ (when (and (tramp--test-sh-p)
+ ;; `executable-find' has changed the number of
+ ;; parameters in Emacs 27.1, so we use `apply' for
+ ;; older Emacsen.
+ (ignore-errors
+ (with-no-warnings
+ (apply #'executable-find '("hexdump" remote)))))
+ (dolist (connection-type '(nil pipe t pty))
(unwind-protect
(with-temp-buffer
(setq proc
(with-no-warnings
(make-process
- :name "test6" :buffer (current-buffer)
- :command '("cat" "/does-not-exist")
- :stderr tmpfile
+ :name (format "test7-%s" connection-type)
+ :buffer (current-buffer)
+ :connection-type connection-type
+ :command '("hexdump" "-v" "-e" "/1 \"%02X\n\"")
:file-handler t)))
(should (processp proc))
- ;; Read stderr.
+ (should (equal (process-status proc) 'run))
+ (process-send-string proc "foo\r\n")
+ (process-send-eof proc)
+ ;; Read output.
(with-timeout (10 (tramp--test-timeout-handler))
- (while (accept-process-output proc nil nil t)))
- (delete-process proc)
- (with-temp-buffer
- (insert-file-contents tmpfile)
- (should
- (string-match-p
- "cat:.* No such file or directory" (buffer-string)))))
+ (while (< (- (point-max) (point-min))
+ (length "66\n6F\n6F\n0D\n0A\n"))
+ (while (accept-process-output proc 0 nil t))))
+ (should
+ (string-match-p
+ (if (memq connection-type '(nil pipe))
+ "66\n6F\n6F\n0D\n0A\n"
+ "66\n6F\n6F\n0A\n0A\n")
+ (buffer-string))))
;; Cleanup.
- (ignore-errors (delete-process proc))
- (ignore-errors (delete-file tmpfile))))))))
+ (ignore-errors (delete-process proc))))))))
(tramp--test--deftest-direct-async-process tramp-test30-make-process
"Check direct async `make-process'.")
@@ -4788,7 +4859,7 @@ INPUT, if non-nil, is a string sent to the process."
;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for
;; remote processes in Emacs. That doesn't work for tramp-adb.el.
(skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
- (tramp--test-sh-p)))
+ (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
@@ -4887,7 +4958,7 @@ INPUT, if non-nil, is a string sent to the process."
:tags '(:expensive-test :unstable)
(skip-unless (tramp--test-enabled))
(skip-unless nil)
- (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
+ (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
;; Prior Emacs 27, `shell-command-dont-erase-buffer' wasn't working properly.
(skip-unless (tramp--test-emacs27-p))
@@ -5092,8 +5163,10 @@ INPUT, if non-nil, is a string sent to the process."
(string-match-p
(regexp-quote envvar)
;; We must remove PS1, the output is truncated otherwise.
+ ;; We must suppress "_=VAR...".
(funcall
- this-shell-command-to-string "printenv | grep -v PS1")))))))))
+ this-shell-command-to-string
+ "printenv | grep -v PS1 | grep -v _=")))))))))
(tramp--test--deftest-direct-async-process tramp-test33-environment-variables
"Check that remote processes set / unset environment variables properly.
@@ -5210,7 +5283,7 @@ Use direct async.")
;; Prior Emacs 27, `shell-file-name' was hard coded as "/bin/sh" for
;; remote processes in Emacs. That doesn't work for tramp-adb.el.
(skip-unless (or (and (tramp--test-adb-p) (tramp--test-emacs27-p))
- (tramp--test-sh-p)))
+ (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
;; Since Emacs 26.1.
(skip-unless (and (fboundp 'connection-local-set-profile-variables)
@@ -5232,8 +5305,7 @@ Use direct async.")
(with-no-warnings
(connection-local-set-profile-variables
'remote-sh
- `((explicit-shell-file-name
- . ,(if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh"))
+ `((explicit-shell-file-name . ,(tramp--test-shell-file-name))
(explicit-sh-args . ("-c" "echo foo"))))
(connection-local-set-profiles
`(:application tramp
@@ -5267,7 +5339,7 @@ Use direct async.")
(ert-deftest tramp-test35-exec-path ()
"Check `exec-path' and `executable-find'."
(skip-unless (tramp--test-enabled))
- (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p)))
+ (skip-unless (or (tramp--test-adb-p) (tramp--test-sh-p) (tramp--test-sshfs-p)))
(skip-unless (not (tramp--test-crypt-p)))
;; Since Emacs 27.1.
(skip-unless (fboundp 'exec-path))
@@ -5451,7 +5523,8 @@ Use direct async.")
(dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
- (tmp-name2 (tramp--test-make-temp-name nil quoted)))
+ (tmp-name2 (tramp--test-make-temp-name nil quoted))
+ tramp-allow-unsafe-temporary-files)
(unwind-protect
(progn
@@ -5535,11 +5608,37 @@ Use direct async.")
("]" . "_r"))
(tramp-compat-file-name-unquote tmp-name1)))
tmp-name2)))
- (should (file-directory-p tmp-name2))))))
+ (should (file-directory-p tmp-name2)))))
+
+ ;; Create temporary file. This shall check for sensible
+ ;; files, owned by root.
+ (let ((tramp-auto-save-directory temporary-file-directory))
+ (write-region "foo" nil tmp-name1)
+ (when (zerop (or (tramp-compat-file-attribute-user-id
+ (file-attributes tmp-name1))
+ tramp-unknown-id-integer))
+ (with-temp-buffer
+ (setq buffer-file-name tmp-name1)
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (let ((tramp-allow-unsafe-temporary-files t))
+ (should (stringp (make-auto-save-file-name))))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'yes-or-no-p) #'ignore))
+ (should-error
+ (make-auto-save-file-name)
+ :type 'file-error))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'yes-or-no-p)
+ #'tramp--test-always))
+ (should (stringp (make-auto-save-file-name))))))))
;; Cleanup.
(ignore-errors (delete-file tmp-name1))
- (ignore-errors (delete-directory tmp-name2 'recursive))))))
+ (ignore-errors (delete-directory tmp-name2 'recursive))
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)))))
(ert-deftest tramp-test38-find-backup-file-name ()
"Check `find-backup-file-name'."
@@ -5549,6 +5648,7 @@ Use direct async.")
(let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name nil quoted))
(ange-ftp-make-backup-files t)
+ tramp-allow-unsafe-temporary-files
;; These settings are not used by Tramp, so we ignore them.
version-control delete-old-versions
(kept-old-versions (default-toplevel-value 'kept-old-versions))
@@ -5653,10 +5753,175 @@ Use direct async.")
(should (file-directory-p tmp-name2))))
;; Cleanup.
- (ignore-errors (delete-directory tmp-name2 'recursive))))))
+ (ignore-errors (delete-directory tmp-name2 'recursive)))
+
+ (unwind-protect
+ ;; Create temporary file. This shall check for sensible
+ ;; files, owned by root.
+ (let ((backup-directory-alist `(("." . ,temporary-file-directory)))
+ tramp-backup-directory-alist)
+ (write-region "foo" nil tmp-name1)
+ (when (zerop (or (tramp-compat-file-attribute-user-id
+ (file-attributes tmp-name1))
+ tramp-unknown-id-integer))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (let ((tramp-allow-unsafe-temporary-files t))
+ (should (stringp (car (find-backup-file-name tmp-name1)))))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'yes-or-no-p) #'ignore))
+ (should-error
+ (find-backup-file-name tmp-name1)
+ :type 'file-error))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'yes-or-no-p)
+ #'tramp--test-always))
+ (should (stringp (car (find-backup-file-name tmp-name1)))))))
+
+ ;; Cleanup.
+ (ignore-errors (delete-file tmp-name1))
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)))))
+
+;; The functions were introduced in Emacs 28.1.
+(ert-deftest tramp-test39-make-lock-file-name ()
+ "Check `make-lock-file-name', `lock-file', `unlock-file' and `file-locked-p'."
+ (skip-unless (tramp--test-enabled))
+ (skip-unless (not (tramp--test-ange-ftp-p)))
+ ;; Since Emacs 28.1.
+ (skip-unless (and (fboundp 'lock-file) (fboundp 'unlock-file)))
+ (skip-unless (and (fboundp 'file-locked-p) (fboundp 'make-lock-file-name)))
+
+ ;; `lock-file', `unlock-file', `file-locked-p' and
+ ;; `make-lock-file-name' exists since Emacs 28.1. We don't want to
+ ;; see compiler warnings for older Emacsen.
+ (dolist (quoted (if (tramp--test-expensive-test) '(nil t) '(nil)))
+ (let ((tmp-name1 (tramp--test-make-temp-name nil quoted))
+ (tmp-name2 (tramp--test-make-temp-name nil quoted))
+ (remote-file-name-inhibit-cache t)
+ (remote-file-name-inhibit-locks nil)
+ (create-lockfiles t)
+ tramp-allow-unsafe-temporary-files
+ (inhibit-message t)
+ ;; tramp-rclone.el and tramp-sshfs.el cache the mounted files.
+ (tramp-cleanup-connection-hook
+ (append
+ (and (tramp--test-fuse-p) '(tramp-fuse-unmount))
+ tramp-cleanup-connection-hook))
+ auto-save-default
+ noninteractive)
+
+ (unwind-protect
+ (progn
+ ;; A simple file lock.
+ (should-not (with-no-warnings (file-locked-p tmp-name1)))
+ (with-no-warnings (lock-file tmp-name1))
+ (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+ ;; If it is locked already, nothing changes.
+ (with-no-warnings (lock-file tmp-name1))
+ (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+ ;; `save-buffer' removes the lock.
+ (with-temp-buffer
+ (set-visited-file-name tmp-name1)
+ (insert "foo")
+ (save-buffer))
+ (should-not (with-no-warnings (file-locked-p tmp-name1)))
+ (with-no-warnings (lock-file tmp-name1))
+ (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+ ;; A new connection changes process id, and also the
+ ;; lockname contents.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+ (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
+
+ ;; When `remote-file-name-inhibit-locks' is set, nothing happens.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+ (let ((remote-file-name-inhibit-locks t))
+ (with-no-warnings (lock-file tmp-name1))
+ (should-not (with-no-warnings (file-locked-p tmp-name1))))
+
+ ;; When `lock-file-name-transforms' is set, another lock
+ ;; file is used.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+ (let ((lock-file-name-transforms `((".*" ,tmp-name2))))
+ (should
+ (string-equal
+ (with-no-warnings (make-lock-file-name tmp-name1))
+ (with-no-warnings (make-lock-file-name tmp-name2))))
+ (with-no-warnings (lock-file tmp-name1))
+ (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+ (with-no-warnings (unlock-file tmp-name1))
+ (should-not (with-no-warnings (file-locked-p tmp-name1))))
+
+ ;; Steal the file lock.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?s)))
+ (with-no-warnings (lock-file tmp-name1)))
+ (should (eq (with-no-warnings (file-locked-p tmp-name1)) t))
+
+ ;; Ignore the file lock.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?p)))
+ (with-no-warnings (lock-file tmp-name1)))
+ (should (stringp (with-no-warnings (file-locked-p tmp-name1))))
+
+ ;; Quit the file lock machinery.
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'read-char) (lambda (&rest _args) ?q)))
+ (with-no-warnings
+ (should-error
+ (lock-file tmp-name1)
+ :type 'file-locked))
+ ;; The same for `write-region'.
+ (should-error
+ (write-region "foo" nil tmp-name1)
+ :type 'file-locked)
+ (should-error
+ (write-region "foo" nil tmp-name1 nil nil tmp-name1)
+ :type 'file-locked)
+ ;; The same for `set-visited-file-name'.
+ (with-temp-buffer
+ (should-error
+ (set-visited-file-name tmp-name1)
+ :type 'file-locked)))
+ (should (stringp (with-no-warnings (file-locked-p tmp-name1)))))
+
+ ;; Cleanup.
+ (ignore-errors (delete-file tmp-name1))
+ (with-no-warnings (unlock-file tmp-name1))
+ (with-no-warnings (unlock-file tmp-name2))
+ (should-not (with-no-warnings (file-locked-p tmp-name1)))
+ (should-not (with-no-warnings (file-locked-p tmp-name2))))
+
+ (unwind-protect
+ ;; Create temporary file. This shall check for sensible
+ ;; files, owned by root.
+ (let ((lock-file-name-transforms auto-save-file-name-transforms))
+ (write-region "foo" nil tmp-name1)
+ (when (zerop (or (tramp-compat-file-attribute-user-id
+ (file-attributes tmp-name1))
+ tramp-unknown-id-integer))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'yes-or-no-p) #'ignore))
+ (should-error
+ (write-region "foo" nil tmp-name1)
+ :type 'file-error))
+ (tramp-cleanup-connection
+ tramp-test-vec 'keep-debug 'keep-password)
+ (cl-letf (((symbol-function #'yes-or-no-p)
+ #'tramp--test-always))
+ (write-region "foo" nil tmp-name1))))
+
+ ;; Cleanup.
+ (ignore-errors (delete-file tmp-name1))
+ (tramp-cleanup-connection tramp-test-vec 'keep-debug 'keep-password)))))
;; The functions were introduced in Emacs 26.1.
-(ert-deftest tramp-test39-make-nearby-temp-file ()
+(ert-deftest tramp-test40-make-nearby-temp-file ()
"Check `make-nearby-temp-file' and `temporary-file-directory'."
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-ange-ftp-p)))
@@ -5739,6 +6004,10 @@ This does not support globbing characters in file names (yet)."
(string-match-p
"ftp$" (file-remote-p tramp-test-temporary-file-directory 'method)))
+(defun tramp--test-fuse-p ()
+ "Check, whether an FUSE file system isused."
+ (or (tramp--test-rclone-p) (tramp--test-sshfs-p)))
+
(defun tramp--test-gdrive-p ()
"Check, whether the gdrive method is used."
(string-equal
@@ -5807,6 +6076,11 @@ Additionally, ls does not support \"--dired\"."
"^\\(afp\\|davs?\\|smb\\)$"
(file-remote-p tramp-test-temporary-file-directory 'method))))
+(defun tramp--test-sshfs-p ()
+ "Check, whether the remote host is offered by sshfs.
+This requires restrictions of file name syntax."
+ (tramp-sshfs-file-name-p tramp-test-temporary-file-directory))
+
(defun tramp--test-sudoedit-p ()
"Check, whether the sudoedit method is used."
(tramp-sudoedit-file-name-p tramp-test-temporary-file-directory))
@@ -5815,18 +6089,11 @@ Additionally, ls does not support \"--dired\"."
"Check, whether the locale host runs MS Windows."
(eq system-type 'windows-nt))
-(defun tramp--test-windows-nt-and-batch-p ()
- "Check, whether the locale host runs MS Windows in batch mode.
-This does not support special characters."
- (and (eq system-type 'windows-nt) noninteractive))
-
-(defun tramp--test-windows-nt-and-pscp-psftp-p ()
- "Check, whether the locale host runs MS Windows, and ps{cp,ftp} is used.
+(defun tramp--test-windows-nt-and-out-of-band-p ()
+ "Check, whether the locale host runs MS Windows and an out-of-band method.
This does not support utf8 based file transfer."
(and (eq system-type 'windows-nt)
- (string-match-p
- (regexp-opt '("pscp" "psftp"))
- (file-remote-p tramp-test-temporary-file-directory 'method))))
+ (tramp-method-out-of-band-p tramp-test-vec 1)))
(defun tramp--test-windows-nt-or-smb-p ()
"Check, whether the locale or remote host runs MS Windows.
@@ -5851,7 +6118,9 @@ This requires restrictions of file name syntax."
(file-truename tramp-test-temporary-file-directory))
(tmp-name1 (tramp--test-make-temp-name nil quoted))
(tmp-name2 (tramp--test-make-temp-name 'local quoted))
- (files (delq nil files))
+ (files
+ (delq
+ nil (mapcar (lambda (x) (unless (string-empty-p x) x)) files)))
(process-environment process-environment)
(sorted-files (sort (copy-sequence files) #'string-lessp))
buffer)
@@ -5861,6 +6130,7 @@ This requires restrictions of file name syntax."
(make-directory tmp-name2)
(dolist (elt files)
+ ;(tramp--test-message "'%s'" elt)
(let* ((file1 (expand-file-name elt tmp-name1))
(file2 (expand-file-name elt tmp-name2))
(file3 (expand-file-name (concat elt "foo") tmp-name1)))
@@ -6028,7 +6298,7 @@ This requires restrictions of file name syntax."
(ignore-errors (delete-directory tmp-name2 'recursive))))))
(defun tramp--test-special-characters ()
- "Perform the test in `tramp-test40-special-characters*'."
+ "Perform the test in `tramp-test41-special-characters*'."
;; Newlines, slashes and backslashes in file names are not
;; supported. So we don't test. And we don't test the tab
;; character on Windows or Cygwin, because the backslash is
@@ -6050,9 +6320,9 @@ This requires restrictions of file name syntax."
"\tfoo bar baz\t")
(t " foo\tbar baz\t"))
"@foo@bar@baz@"
- "$foo$bar$$baz$"
+ (unless (tramp--test-windows-nt-and-out-of-band-p) "$foo$bar$$baz$")
"-foo-bar-baz-"
- "%foo%bar%baz%"
+ (unless (tramp--test-windows-nt-and-out-of-band-p) "%foo%bar%baz%")
"&foo&bar&baz&"
(unless (or (tramp--test-ftp-p)
(tramp--test-gvfs-p)
@@ -6066,9 +6336,10 @@ This requires restrictions of file name syntax."
"'foo'bar'baz'"
"'foo\"bar'baz\"")
"#foo~bar#baz~"
- (if (or (tramp--test-gvfs-p) (tramp--test-windows-nt-or-smb-p))
- "!foo!bar!baz!"
- "!foo|bar!baz|")
+ (unless (tramp--test-windows-nt-and-out-of-band-p)
+ (if (or (tramp--test-gvfs-p) (tramp--test-windows-nt-or-smb-p))
+ "!foo!bar!baz!"
+ "!foo|bar!baz|"))
(if (or (tramp--test-gvfs-p)
(tramp--test-rclone-p)
(tramp--test-windows-nt-or-smb-p))
@@ -6085,24 +6356,21 @@ This requires restrictions of file name syntax."
files (list (mapconcat #'identity files ""))))))
;; These tests are inspired by Bug#17238.
-(ert-deftest tramp-test40-special-characters ()
+(ert-deftest tramp-test41-special-characters ()
"Check special characters in file names."
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
(skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
(tramp--test-special-characters))
-(ert-deftest tramp-test40-special-characters-with-stat ()
+(ert-deftest tramp-test41-special-characters-with-stat ()
"Check special characters in file names.
Use the `stat' command."
:tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
- (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
;; We cannot use `tramp-test-vec', because this fails during compilation.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-stat v)))
@@ -6114,15 +6382,13 @@ Use the `stat' command."
tramp-connection-properties)))
(tramp--test-special-characters)))
-(ert-deftest tramp-test40-special-characters-with-perl ()
+(ert-deftest tramp-test41-special-characters-with-perl ()
"Check special characters in file names.
Use the `perl' command."
:tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
- (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
;; We cannot use `tramp-test-vec', because this fails during compilation.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-perl v)))
@@ -6137,15 +6403,13 @@ Use the `perl' command."
tramp-connection-properties)))
(tramp--test-special-characters)))
-(ert-deftest tramp-test40-special-characters-with-ls ()
+(ert-deftest tramp-test41-special-characters-with-ls ()
"Check special characters in file names.
Use the `ls' command."
:tags '(:expensive-test)
(skip-unless (tramp--test-enabled))
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
- (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
(let ((tramp-connection-properties
(append
@@ -6160,7 +6424,7 @@ Use the `ls' command."
(tramp--test-special-characters)))
(defun tramp--test-utf8 ()
- "Perform the test in `tramp-test41-utf8*'."
+ "Perform the test in `tramp-test42-utf8*'."
(let* ((utf8 (if (and (eq system-type 'darwin)
(memq 'utf-8-hfs (coding-system-list)))
'utf-8-hfs 'utf-8))
@@ -6201,17 +6465,17 @@ Use the `ls' command."
x ""))
(not (string-empty-p x))
;; ?\n and ?/ shouldn't be part of any file name. ?\t,
- ;; ?. and ?? do not work for "smb" method.
- (replace-regexp-in-string "[\t\n/.?]" "" x)))
+ ;; ?. and ?? do not work for "smb" method. " " does not
+ ;; work at begin or end of the string for MS Windows.
+ (replace-regexp-in-string "[ \t\n/.?]" "" x)))
language-info-alist)))))))
-(ert-deftest tramp-test41-utf8 ()
+(ert-deftest tramp-test42-utf8 ()
"Check UTF8 encoding in file names and file contents."
(skip-unless (tramp--test-enabled))
(skip-unless (not (tramp--test-docker-p)))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+ (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p)))
(skip-unless (not (tramp--test-ksh-p)))
(skip-unless (not (tramp--test-gdrive-p)))
(skip-unless (not (tramp--test-crypt-p)))
@@ -6219,7 +6483,7 @@ Use the `ls' command."
(tramp--test-utf8))
-(ert-deftest tramp-test41-utf8-with-stat ()
+(ert-deftest tramp-test42-utf8-with-stat ()
"Check UTF8 encoding in file names and file contents.
Use the `stat' command."
:tags '(:expensive-test)
@@ -6227,11 +6491,9 @@ Use the `stat' command."
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-docker-p)))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+ (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p)))
(skip-unless (not (tramp--test-ksh-p)))
(skip-unless (not (tramp--test-crypt-p)))
- (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
;; We cannot use `tramp-test-vec', because this fails during compilation.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-stat v)))
@@ -6243,7 +6505,7 @@ Use the `stat' command."
tramp-connection-properties)))
(tramp--test-utf8)))
-(ert-deftest tramp-test41-utf8-with-perl ()
+(ert-deftest tramp-test42-utf8-with-perl ()
"Check UTF8 encoding in file names and file contents.
Use the `perl' command."
:tags '(:expensive-test)
@@ -6251,11 +6513,9 @@ Use the `perl' command."
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-docker-p)))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+ (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p)))
(skip-unless (not (tramp--test-ksh-p)))
(skip-unless (not (tramp--test-crypt-p)))
- (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
;; We cannot use `tramp-test-vec', because this fails during compilation.
(with-parsed-tramp-file-name tramp-test-temporary-file-directory nil
(skip-unless (tramp-get-remote-perl v)))
@@ -6270,7 +6530,7 @@ Use the `perl' command."
tramp-connection-properties)))
(tramp--test-utf8)))
-(ert-deftest tramp-test41-utf8-with-ls ()
+(ert-deftest tramp-test42-utf8-with-ls ()
"Check UTF8 encoding in file names and file contents.
Use the `ls' command."
:tags '(:expensive-test)
@@ -6278,11 +6538,9 @@ Use the `ls' command."
(skip-unless (tramp--test-sh-p))
(skip-unless (not (tramp--test-docker-p)))
(skip-unless (not (tramp--test-rsync-p)))
- (skip-unless (not (tramp--test-windows-nt-and-batch-p)))
- (skip-unless (not (tramp--test-windows-nt-and-pscp-psftp-p)))
+ (skip-unless (not (tramp--test-windows-nt-and-out-of-band-p)))
(skip-unless (not (tramp--test-ksh-p)))
(skip-unless (not (tramp--test-crypt-p)))
- (skip-unless (or (tramp--test-emacs26-p) (not (tramp--test-rclone-p))))
(let ((tramp-connection-properties
(append
@@ -6296,7 +6554,7 @@ Use the `ls' command."
tramp-connection-properties)))
(tramp--test-utf8)))
-(ert-deftest tramp-test42-file-system-info ()
+(ert-deftest tramp-test43-file-system-info ()
"Check that `file-system-info' returns proper values."
(skip-unless (tramp--test-enabled))
;; Since Emacs 27.1.
@@ -6313,16 +6571,17 @@ Use the `ls' command."
(numberp (nth 1 fsi))
(numberp (nth 2 fsi))))))
-;; `tramp-test43-asynchronous-requests' could be blocked. So we set a
+;; `tramp-test44-asynchronous-requests' could be blocked. So we set a
;; timeout of 300 seconds, and we send a SIGUSR1 signal after 300
;; seconds. Similar check is performed in the timer function.
(defconst tramp--test-asynchronous-requests-timeout 300
- "Timeout for `tramp-test43-asynchronous-requests'.")
+ "Timeout for `tramp-test44-asynchronous-requests'.")
(defmacro tramp--test-with-proper-process-name-and-buffer (proc &rest body)
"Set \"process-name\" and \"process-buffer\" connection properties.
The values are derived from PROC. Run BODY.
This is needed in timer functions as well as process filters and sentinels."
+ ;; FIXME: For tramp-sshfs.el, `processp' does not work.
(declare (indent 1) (debug (processp body)))
`(let* ((v (tramp-get-connection-property ,proc "vector" nil))
(pname (tramp-get-connection-property v "process-name" nil))
@@ -6352,7 +6611,7 @@ This is needed in timer functions as well as process filters and sentinels."
(tramp-flush-connection-property v "process-buffer")))))
;; This test is inspired by Bug#16928.
-(ert-deftest tramp-test43-asynchronous-requests ()
+(ert-deftest tramp-test44-asynchronous-requests ()
"Check parallel asynchronous requests.
Such requests could arrive from timers, process filters and
process sentinels. They shall not disturb each other."
@@ -6372,7 +6631,7 @@ process sentinels. They shall not disturb each other."
(define-key special-event-map [sigusr1] #'tramp--test-timeout-handler)
(let* (;; For the watchdog.
(default-directory (expand-file-name temporary-file-directory))
- (shell-file-name (if (tramp--test-adb-p) "/system/bin/sh" "/bin/sh"))
+ (shell-file-name (tramp--test-shell-file-name))
;; It doesn't work on w32 systems.
(watchdog
(start-process-shell-command
@@ -6552,11 +6811,11 @@ process sentinels. They shall not disturb each other."
(ignore-errors (cancel-timer timer))
(ignore-errors (delete-directory tmp-name 'recursive))))))
-;; (tramp--test--deftest-direct-async-process tramp-test43-asynchronous-requests
+;; (tramp--test--deftest-direct-async-process tramp-test44-asynchronous-requests
;; "Check parallel direct asynchronous requests." 'unstable)
;; This test is inspired by Bug#29163.
-(ert-deftest tramp-test44-auto-load ()
+(ert-deftest tramp-test45-auto-load ()
"Check that Tramp autoloads properly."
;; If we use another syntax but `default', Tramp is already loaded
;; due to the `tramp-change-syntax' call.
@@ -6581,7 +6840,7 @@ process sentinels. They shall not disturb each other."
(mapconcat #'shell-quote-argument load-path " -L ")
(shell-quote-argument code)))))))
-(ert-deftest tramp-test44-delay-load ()
+(ert-deftest tramp-test45-delay-load ()
"Check that Tramp is loaded lazily, only when needed."
;; The autoloaded Tramp objects are different since Emacs 26.1. We
;; cannot test older Emacsen, therefore.
@@ -6614,7 +6873,7 @@ process sentinels. They shall not disturb each other."
(mapconcat #'shell-quote-argument load-path " -L ")
(shell-quote-argument (format code tm)))))))))
-(ert-deftest tramp-test44-recursive-load ()
+(ert-deftest tramp-test45-recursive-load ()
"Check that Tramp does not fail due to recursive load."
(skip-unless (tramp--test-enabled))
@@ -6638,7 +6897,7 @@ process sentinels. They shall not disturb each other."
(mapconcat #'shell-quote-argument load-path " -L ")
(shell-quote-argument code))))))))
-(ert-deftest tramp-test44-remote-load-path ()
+(ert-deftest tramp-test45-remote-load-path ()
"Check that Tramp autoloads its packages with remote `load-path'."
;; The autoloaded Tramp objects are different since Emacs 26.1. We
;; cannot test older Emacsen, therefore.
@@ -6667,7 +6926,7 @@ process sentinels. They shall not disturb each other."
(mapconcat #'shell-quote-argument load-path " -L ")
(shell-quote-argument code)))))))
-(ert-deftest tramp-test45-unload ()
+(ert-deftest tramp-test46-unload ()
"Check that Tramp and its subpackages unload completely.
Since it unloads Tramp, it shall be the last test to run."
:tags '(:expensive-test)
@@ -6730,8 +6989,8 @@ Since it unloads Tramp, it shall be the last test to run."
If INTERACTIVE is non-nil, the tests are run interactively."
(interactive "p")
(funcall
- (if interactive
- #'ert-run-tests-interactively #'ert-run-tests-batch) "^tramp"))
+ (if interactive #'ert-run-tests-interactively #'ert-run-tests-batch)
+ "^tramp"))
;; TODO:
@@ -6747,9 +7006,10 @@ If INTERACTIVE is non-nil, the tests are run interactively."
;; * Work on skipped tests. Make a comment, when it is impossible.
;; * Revisit expensive tests, once problems in `tramp-error' are solved.
;; * Fix `tramp-test06-directory-file-name' for `ftp'.
-;; * Implement `tramp-test31-interrupt-process' for `adb' and for
-;; direct async processes.
-;; * Fix `tramp-test44-threads'.
+;; * Implement `tramp-test31-interrupt-process' for `adb', `sshfs' and
+;; for direct async processes.
+;; * Check, why direct async processes do not work for
+;; `tramp-test44-asynchronous-requests'.
(provide 'tramp-tests)
diff --git a/test/lisp/nxml/nxml-mode-tests.el b/test/lisp/nxml/nxml-mode-tests.el
index 4baab1f7600..7824691333e 100644
--- a/test/lisp/nxml/nxml-mode-tests.el
+++ b/test/lisp/nxml/nxml-mode-tests.el
@@ -2,6 +2,8 @@
;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
+;; This file is part of GNU Emacs.
+
;; GNU Emacs 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
diff --git a/test/lisp/nxml/xsd-regexp-tests.el b/test/lisp/nxml/xsd-regexp-tests.el
index 4dbc8999247..2194602dbec 100644
--- a/test/lisp/nxml/xsd-regexp-tests.el
+++ b/test/lisp/nxml/xsd-regexp-tests.el
@@ -2,6 +2,8 @@
;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
+;; This file is part of GNU Emacs.
+
;; GNU Emacs 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
diff --git a/test/lisp/obsolete/cl-tests.el b/test/lisp/obsolete/cl-tests.el
index 4a5f4f872b6..0e02e1ca1bc 100644
--- a/test/lisp/obsolete/cl-tests.el
+++ b/test/lisp/obsolete/cl-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/lisp/obsolete/inversion-tests.el b/test/lisp/obsolete/inversion-tests.el
new file mode 100644
index 00000000000..c8b45d67ea1
--- /dev/null
+++ b/test/lisp/obsolete/inversion-tests.el
@@ -0,0 +1,81 @@
+;;; inversion-tests.el --- Tests for inversion.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <zappo@gnu.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Moved here from test/manual/cedet/cedet-utests.el
+
+;;; Code:
+
+(require 'inversion)
+(require 'ert)
+
+(ert-deftest inversion-unit-test ()
+ "Test inversion to make sure it can identify different version strings."
+ (interactive)
+ (let ((c1 (inversion-package-version 'inversion))
+ (c1i (inversion-package-incompatibility-version 'inversion))
+ (c2 (inversion-decode-version "1.3alpha2"))
+ (c3 (inversion-decode-version "1.3beta4"))
+ (c4 (inversion-decode-version "1.3 beta5"))
+ (c5 (inversion-decode-version "1.3.4"))
+ (c6 (inversion-decode-version "2.3alpha"))
+ (c7 (inversion-decode-version "1.3"))
+ (c8 (inversion-decode-version "1.3pre1"))
+ (c9 (inversion-decode-version "2.4 (patch 2)"))
+ (c10 (inversion-decode-version "2.4 (patch 3)"))
+ (c11 (inversion-decode-version "2.4.2.1"))
+ (c12 (inversion-decode-version "2.4.2.2")))
+ (should (inversion-= c1 c1))
+ (should (inversion-< c1i c1))
+ (should (inversion-< c2 c3))
+ (should (inversion-< c3 c4))
+ (should (inversion-< c4 c5))
+ (should (inversion-< c5 c6))
+ (should (inversion-< c2 c4))
+ (should (inversion-< c2 c5))
+ (should (inversion-< c2 c6))
+ (should (inversion-< c3 c5))
+ (should (inversion-< c3 c6))
+ (should (inversion-< c7 c6))
+ (should (inversion-< c4 c7))
+ (should (inversion-< c2 c7))
+ (should (inversion-< c8 c6))
+ (should (inversion-< c8 c7))
+ (should (inversion-< c4 c8))
+ (should (inversion-< c2 c8))
+ (should (inversion-< c9 c10))
+ (should (inversion-< c10 c11))
+ (should (inversion-< c11 c12))
+ ;; Negatives
+ (should-not (inversion-< c3 c2))
+ (should-not (inversion-< c4 c3))
+ (should-not (inversion-< c5 c4))
+ (should-not (inversion-< c6 c5))
+ (should-not (inversion-< c7 c2))
+ (should-not (inversion-< c7 c8))
+ (should-not (inversion-< c12 c11))
+ ;; Test the tester on inversion
+ (should-not (inversion-test 'inversion inversion-version))
+ (should (stringp (inversion-test 'inversion "0.0.0")))
+ (should (stringp (inversion-test 'inversion "1000.0")))))
+
+;;; inversion-tests.el ends here
diff --git a/test/lisp/play/cookie1-resources/cookies b/test/lisp/play/cookie1-resources/cookies
new file mode 100644
index 00000000000..7bf569fa7d6
--- /dev/null
+++ b/test/lisp/play/cookie1-resources/cookies
@@ -0,0 +1,8 @@
+This fortune intentionally left blank.
+%
+This fortune intentionally not included.
+%
+This fortune intentionally says nothing.
+%
+This fortune is false.
+%
diff --git a/test/lisp/play/cookie1-tests.el b/test/lisp/play/cookie1-tests.el
new file mode 100644
index 00000000000..75dea4e5ef0
--- /dev/null
+++ b/test/lisp/play/cookie1-tests.el
@@ -0,0 +1,40 @@
+;;; cookie1-tests.el --- Tests for cookie1.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'cookie1)
+
+(ert-deftest cookie1-tests-cookie ()
+ (let ((fortune-file (ert-resource-file "cookies")))
+ (should (string-match "\\`This fortune"
+ (cookie fortune-file)))))
+
+(ert-deftest cookie1-testss-cookie-apropos ()
+ (let ((fortune-file (ert-resource-file "cookies")))
+ (should (string-match "\\`This fortune"
+ (car (cookie-apropos "false" fortune-file))))
+ (should (= (length (cookie-apropos "false" fortune-file)) 1))))
+
+(provide 'fortune-tests)
+;;; fortune-tests.el ends here
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index da6a1e641c7..2a3bb3dafae 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -31,9 +31,6 @@
(require 'compile)
(defconst compile-tests--test-regexps-data
- ;; The computed column numbers are zero-indexed, so subtract 1 from
- ;; what's reported in the string. The end column numbers are for
- ;; the character after, so it matches what's reported in the string.
'(;; absoft
(absoft
"Error on line 3 of t.f: Execution error unclassifiable statement"
@@ -61,7 +58,7 @@
(ant "[javac] /src/DataBaseTestCase.java:49: warning: finally clause cannot complete normally"
13 nil 49 "/src/DataBaseTestCase.java" 1)
(ant "[jikes] foo.java:3:5:7:9: blah blah"
- 14 (5 . 10) (3 . 7) "foo.java" 2)
+ 14 (5 . 9) (3 . 7) "foo.java" 2)
(ant "[javac] c:/cygwin/Test.java:12: error: foo: bar"
9 nil 12 "c:/cygwin/Test.java" 2)
(ant "[javac] c:\\cygwin\\Test.java:87: error: foo: bar"
@@ -86,10 +83,10 @@
;; caml
(python-tracebacks-and-caml
"File \"foobar.ml\", lines 5-8, characters 20-155: blah blah"
- 1 (20 . 156) (5 . 8) "foobar.ml")
+ 1 (20 . 155) (5 . 8) "foobar.ml")
(python-tracebacks-and-caml
"File \"F:\\ocaml\\sorting.ml\", line 65, characters 2-145:\nWarning 26: unused variable equ."
- 1 (2 . 146) 65 "F:\\ocaml\\sorting.ml")
+ 1 (2 . 145) 65 "F:\\ocaml\\sorting.ml")
(python-tracebacks-and-caml
"File \"/usr/share/gdesklets/display/TargetGauge.py\", line 41, in add_children"
1 nil 41 "/usr/share/gdesklets/display/TargetGauge.py")
@@ -231,12 +228,12 @@
(gnu "foo.c:8.23: note: message" 1 23 8 "foo.c")
(gnu "foo.c:8.23: info: message" 1 23 8 "foo.c")
(gnu "foo.c:8:23:information: message" 1 23 8 "foo.c")
- (gnu "foo.c:8.23-45: Informational: message" 1 (23 . 46) (8 . nil) "foo.c")
+ (gnu "foo.c:8.23-45: Informational: message" 1 (23 . 45) (8 . nil) "foo.c")
(gnu "foo.c:8-23: message" 1 nil (8 . 23) "foo.c")
;; The next one is not in the GNU standards AFAICS.
;; Here we seem to interpret it as LINE1-LINE2.COL2.
- (gnu "foo.c:8-45.3: message" 1 (nil . 4) (8 . 45) "foo.c")
- (gnu "foo.c:8.23-9.1: message" 1 (23 . 2) (8 . 9) "foo.c")
+ (gnu "foo.c:8-45.3: message" 1 (nil . 3) (8 . 45) "foo.c")
+ (gnu "foo.c:8.23-9.1: message" 1 (23 . 1) (8 . 9) "foo.c")
(gnu "jade:dbcommon.dsl:133:17:E: missing argument for function call"
1 17 133 "dbcommon.dsl")
(gnu "G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found."
@@ -472,8 +469,11 @@ can only work with the NUL byte to disambiguate colons.")
(when file
(should (equal (caar (compilation--loc->file-struct loc)) file)))
(when end-col
+ ;; The computed END-COL is exclusive; subtract one to get the
+ ;; number in the error message.
(should (equal
- (car (cadr (nth 2 (compilation--loc->file-struct loc))))
+ (1- (car (cadr
+ (nth 2 (compilation--loc->file-struct loc)))))
end-col)))
(should (equal (car (nth 2 (compilation--loc->file-struct loc)))
(or end-line line)))
@@ -515,4 +515,31 @@ The test data is in `compile-tests--grep-regexp-testcases'."
(compile--test-error-line testcase))
(should (eq compilation-num-errors-found 8))))
+(ert-deftest compile-test-functions ()
+ "Test rules using functions instead of regexp group numbers."
+ (let* ((file-fun (lambda () '("my-file")))
+ (line-start-fun (lambda () 123))
+ (line-end-fun (lambda () 134))
+ (col-start-fun (lambda () 39))
+ (col-end-fun (lambda () 24))
+ (compilation-error-regexp-alist-alist
+ `((my-rule
+ ,(rx bol "My error message")
+ ,file-fun
+ (,line-start-fun . ,line-end-fun)
+ (,col-start-fun . ,col-end-fun))))
+ (compilation-error-regexp-alist '(my-rule)))
+ (with-temp-buffer
+ (font-lock-mode -1)
+ (let ((compilation-num-errors-found 0)
+ (compilation-num-warnings-found 0)
+ (compilation-num-infos-found 0))
+ (compile--test-error-line
+ '(my-rule
+ "My error message"
+ 1 (39 . 24) (123 . 134) "my-file" 2))
+ (should (eq compilation-num-errors-found 1))
+ (should (eq compilation-num-warnings-found 0))
+ (should (eq compilation-num-infos-found 0))))))
+
;;; compile-tests.el ends here
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-22355.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-22355.pl
new file mode 100644
index 00000000000..f54d55241df
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-22355.pl
@@ -0,0 +1,14 @@
+# The source file contains non-ASCII characters, supposed to be saved
+# in UTF-8 encoding. Tell Perl about that, just in case.
+use utf8;
+
+# Following code is the example from the report Bug#22355 which needed
+# attention in perl-mode.
+
+printf qq
+{<?xml version="1.0" encoding="UTF-8"?>
+<kml xmlns="http://www.opengis.net/kml/2.2">
+ <Document>
+ <Folder><name>台灣 %s 廣播電台</name>
+ <description><![CDATA[http://radioscanningtw.wikia.com/wiki/台描:地圖 %d-%02d-%02d]]></description>
+}, uc( substr( $ARGV[0], 0, 2 ) ), $year + 1900, $mon + 1, $mday;
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl
new file mode 100644
index 00000000000..1db639c6aa2
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-23992.pl
@@ -0,0 +1,10 @@
+# Test file for Bug#23992
+#
+# The "||" case is directly from the report,
+# the "&&" case has been added for symmetry.
+
+s/LEFT/L/g || s/RIGHT/R/g || s/aVALUE\D+//g;
+s/LEFT/L/g||s/RIGHT/R/g||s/aVALUE\D+//g;
+
+s/LEFT/L/g && s/RIGHT/R/g && s/aVALUE\D+//g;
+s/LEFT/L/g&&s/RIGHT/R/g&&s/aVALUE\D+//g;
diff --git a/test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl
new file mode 100644
index 00000000000..0987b4e02c0
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/cperl-bug-25098.pl
@@ -0,0 +1,21 @@
+# Code from the bug report Bug#25098
+
+my $good = XML::LibXML->load_xml( string => q{<div class="clearfix">});
+my $bad = XML::LibXML->load_xml( string =>q{<div class="clearfix">});
+
+# Related: Method calls are no quotelike operators. That's why you
+# can't just add '>' to the character class.
+
+my $method_call = $object->q(argument);
+
+# Also related, still not fontified correctly:
+#
+# my $method_call = $object -> q (argument);
+#
+# perl-mode interprets the method call as a quotelike op (because it
+# is preceded by a space).
+# cperl-mode gets the argument right, but marks q as a quotelike op.
+#
+# my $greater = 2>q/1/;
+#
+# perl-mode doesn't identify this as a quotelike op.
diff --git a/test/lisp/progmodes/cperl-mode-resources/grammar.pl b/test/lisp/progmodes/cperl-mode-resources/grammar.pl
new file mode 100644
index 00000000000..c05fd7efc2a
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-resources/grammar.pl
@@ -0,0 +1,158 @@
+use 5.024;
+use strict;
+use warnings;
+
+sub outside {
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}'";
+}
+
+package Package;
+
+=head1 NAME
+
+grammar - A Test resource for regular expressions
+
+=head1 SYNOPSIS
+
+A Perl file showing a variety of declarations
+
+=head1 DESCRIPTION
+
+This file offers several syntactical constructs for packages,
+subroutines, and POD to test the imenu capabilities of CPerl mode.
+
+Perl offers syntactical variations for package and subroutine
+declarations. Packages may, or may not, have a version and may, or
+may not, have a block of code attached to them. Subroutines can have
+old-style prototypes, attributes, and signatures which are still
+experimental but widely accepted.
+
+Various Extensions and future Perl versions will probably add new
+keywords for "class" and "method", both with syntactical extras of
+their own.
+
+This test file tries to keep up with them.
+
+=head2 Details
+
+The code is supposed to identify and exclude false positives,
+e.g. declarations in a string or in POD, as well as POD in a string.
+These should not go into the imenu index.
+
+=cut
+
+our $VERSION = 3.1415;
+say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+
+sub in_package {
+ # Special test for POD: A line which looks like POD, but actually
+ # is part of a multiline string. In the case shown here, the
+ # semicolon is not part of the string, but POD headings go to the
+ # end of the line. The code needs to distinguish between a POD
+ # heading "This Is Not A Pod/;" and a multiline string.
+ my $not_a_pod = q/Another false positive:
+
+=head1 This Is Not A Pod/;
+
+}
+
+sub Shoved::elsewhere {
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', sub Shoved::elsewhere";
+}
+
+sub prototyped ($$) {
+ ...;
+}
+
+package Versioned::Package 0.07;
+say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+
+sub versioned {
+ # This sub is in package Versioned::Package
+ say "sub 'versioned' in package '", __PACKAGE__, "'";
+}
+
+versioned();
+
+my $false_positives = <<'EOH';
+The following declarations are not supposed to be recorded for imenu.
+They are in a HERE-doc, which is a generic comment in CPerl mode.
+
+package Don::T::Report::This;
+sub this_is_no_sub {
+ my $self = shuffle;
+}
+
+And this is not a POD heading:
+
+=head1 Not a POD heading, just a string.
+
+EOH
+
+package Block {
+ our $VERSION = 2.7182;
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+
+ sub attr:lvalue {
+ say "sub 'attr' in package '", __PACKAGE__, "'";
+ }
+
+ attr();
+
+ package Block::Inner {
+ # This hopefully doesn't happen too often.
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+ }
+
+ # Now check that we're back to package "Block"
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+}
+
+sub outer {
+ # This is in package Versioned::Package
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+}
+
+outer();
+
+package Versioned::Block 42 {
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+
+ my sub lexical {
+ say "sub 'lexical' in package '", __PACKAGE__, "'";
+ }
+
+ lexical();
+
+ use experimental 'signatures';
+ sub signatured :prototype($@) ($self,@rest)
+ {
+ ...;
+ }
+}
+
+# After all is said and done, we're back in package Versioned::Package.
+say "We're in package '", __PACKAGE__, "' now.";
+say "Now try to call a subroutine which went out of scope:";
+eval { lexical() };
+say $@ if $@;
+
+# Now back to Package. This must not appear separately in the
+# hierarchy list.
+package Package;
+
+our sub in_package_again {
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+}
+
+
+package :: {
+ # This is just a weird, but legal, package name.
+ say "Line @{[__LINE__]}: package '@{[__PACKAGE__]}', version $VERSION";
+
+ in_package_again(); # weird, but calls the sub from above
+}
+
+Shoved::elsewhere();
+
+1;
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
index 943c454445c..4d2bac6ee47 100644
--- a/test/lisp/progmodes/cperl-mode-tests.el
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -1,4 +1,4 @@
-;;; cperl-mode-tests --- Test for cperl-mode -*- lexical-binding: t -*-
+;;; cperl-mode-tests.el --- Test for cperl-mode -*- lexical-binding: t -*-
;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
@@ -37,7 +37,7 @@
;;; Utilities
(defun cperl-test-ppss (text regexp)
- "Return the `syntax-ppss' of the first character matched by REGEXP in TEXT."
+ "Return the `syntax-ppss' after the last character matched by REGEXP in TEXT."
(interactive)
(with-temp-buffer
(insert text)
@@ -135,6 +135,28 @@ point in the distant past, and is still broken in perl-mode. "
(should (equal (nth 3 (syntax-ppss)) nil))
(should (equal (nth 4 (syntax-ppss)) t))))))
+(ert-deftest cperl-test-fontify-declarations ()
+ "Test that declarations and package usage use consistent fontification."
+ (with-temp-buffer
+ (funcall cperl-test-mode)
+ (insert "package Foo::Bar;\n")
+ (insert "use Fee::Fie::Foe::Foo\n;")
+ (insert "my $xyzzy = 'PLUGH';\n")
+ (goto-char (point-min))
+ (font-lock-ensure)
+ (search-forward "Bar")
+ (should (equal (get-text-property (match-beginning 0) 'face)
+ 'font-lock-function-name-face))
+ (search-forward "use") ; This was buggy in perl-mode
+ (should (equal (get-text-property (match-beginning 0) 'face)
+ 'font-lock-keyword-face))
+ (search-forward "my")
+ (should (equal (get-text-property (match-beginning 0) 'face)
+ 'font-lock-keyword-face))))
+
+(defvar perl-continued-statement-offset)
+(defvar perl-indent-level)
+
(ert-deftest cperl-test-heredocs ()
"Test that HERE-docs are fontified with the appropriate face."
(require 'perl-mode)
@@ -166,6 +188,101 @@ point in the distant past, and is still broken in perl-mode. "
(if (match-beginning 3) 0
perl-indent-level)))))))
+;;; Grammar based tests: unit tests
+
+(defun cperl-test--validate-regexp (regexp valid &optional invalid)
+ "Runs tests for elements of VALID and INVALID lists against REGEXP.
+Tests with elements from VALID must match, tests with elements
+from INVALID must not match. The match string must be equal to
+the whole string."
+ (funcall cperl-test-mode)
+ (dolist (string valid)
+ (should (string-match regexp string))
+ (should (string= (match-string 0 string) string)))
+ (when invalid
+ (dolist (string invalid)
+ (should-not
+ (and (string-match regexp string)
+ (string= (match-string 0 string) string))))))
+
+(ert-deftest cperl-test-ws-regexp ()
+ "Tests capture of very simple regular expressions (yawn)."
+ (let ((valid
+ '(" " "\t" "\n"))
+ (invalid
+ '("a" " " "")))
+ (cperl-test--validate-regexp cperl--ws-regexp
+ valid invalid)))
+
+(ert-deftest cperl-test-ws-or-comment-regexp ()
+ "Tests sequences of whitespace and comment lines."
+ (let ((valid
+ `(" " "\t#\n" "\n# \n"
+ ,(concat "# comment\n" "# comment\n" "\n" "#comment\n")))
+ (invalid
+ '("=head1 NAME\n" )))
+ (cperl-test--validate-regexp cperl--ws-or-comment-regexp
+ valid invalid)))
+
+(ert-deftest cperl-test-version-regexp ()
+ "Tests the regexp for recommended syntax of versions in Perl."
+ (let ((valid
+ '("1" "1.1" "1.1_1" "5.032001"
+ "v120.100.103"))
+ (invalid
+ '("alpha" "0." ".123" "1E2"
+ "v1.1" ; a "v" version string needs at least 3 components
+ ;; bad examples from "Version numbers should be boring"
+ ;; by xdg AKA David A. Golden
+ "1.20alpha" "2.34beta2" "2.00R3")))
+ (cperl-test--validate-regexp cperl--version-regexp
+ valid invalid)))
+
+(ert-deftest cperl-test-package-regexp ()
+ "Tests the regular expression of Perl package names with versions.
+Also includes valid cases with whitespace in strange places."
+ (let ((valid
+ '("package Foo"
+ "package Foo::Bar"
+ "package Foo::Bar v1.2.3"
+ "package Foo::Bar::Baz 1.1"
+ "package \nFoo::Bar\n 1.00"))
+ (invalid
+ '("package Foo;" ; semicolon must not be included
+ "package Foo 1.1 {" ; nor the opening brace
+ "packageFoo" ; not a package declaration
+ "package Foo1.1" ; invalid package name
+ "class O3D::Sphere"))) ; class not yet supported
+ (cperl-test--validate-regexp cperl--package-regexp
+ valid invalid)))
+
+;;; Function test: Building an index for imenu
+
+(ert-deftest cperl-test-imenu-index ()
+ "Test index creation for imenu.
+This test relies on the specific layout of the index alist as
+created by CPerl mode, so skip it for Perl mode."
+ (skip-unless (eq cperl-test-mode #'cperl-mode))
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "grammar.pl"))
+ (cperl-mode)
+ (let ((index (cperl-imenu--create-perl-index))
+ current-list)
+ (setq current-list (assoc-string "+Unsorted List+..." index))
+ (should current-list)
+ (let ((expected '("(main)::outside"
+ "Package::in_package"
+ "Shoved::elsewhere"
+ "Package::prototyped"
+ "Versioned::Package::versioned"
+ "Block::attr"
+ "Versioned::Package::outer"
+ "lexical"
+ "Versioned::Block::signatured"
+ "Package::in_package_again")))
+ (dolist (sub expected)
+ (should (assoc-string sub index)))))))
+
;;; Tests for issues reported in the Bug Tracker
(defun cperl-test--run-bug-10483 ()
@@ -260,6 +377,55 @@ documentation it does the right thing anyway."
(cperl-indent-command)
(forward-line 1))))
+(ert-deftest cperl-test-bug-22355 ()
+ "Verify that substitutions are fontified directly after \"|&\".
+Regular expressions are strings in both perl-mode and cperl-mode."
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "cperl-bug-22355.pl"))
+ (funcall cperl-test-mode)
+ (goto-char (point-min))
+ ;; Just check for the start of the string
+ (search-forward "{")
+ (should (nth 3 (syntax-ppss)))))
+
+(ert-deftest cperl-test-bug-23992 ()
+ "Verify that substitutions are fontified directly after \"|&\".
+Regular expressions are strings in both perl-mode and cperl-mode."
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "cperl-bug-23992.pl"))
+ (funcall cperl-test-mode)
+ (goto-char (point-min))
+ ;; "or" operator, with spaces
+ (search-forward "RIGHT")
+ (should (nth 3 (syntax-ppss)))
+ ;; "or" operator, without spaces
+ (search-forward "RIGHT")
+ (should (nth 3 (syntax-ppss)))
+ ;; "and" operator, with spaces
+ (search-forward "RIGHT")
+ (should (nth 3 (syntax-ppss)))
+ ;; "and" operator, without spaces
+ (search-forward "RIGHT")
+ (should (nth 3 (syntax-ppss)))))
+
+(ert-deftest cperl-test-bug-25098 ()
+ "Verify that a quotelike operator is recognized after a fat comma \"=>\".
+Related, check that calling a method named q is not mistaken as a
+quotelike operator."
+ (with-temp-buffer
+ (insert-file-contents (ert-resource-file "cperl-bug-25098.pl"))
+ (funcall cperl-test-mode)
+ (goto-char (point-min))
+ ;; good example from the bug report, with a space
+ (search-forward "q{")
+ (should (nth 3 (syntax-ppss)))
+ ;; bad (but now fixed) example from the bug report, without space
+ (search-forward "q{")
+ (should (nth 3 (syntax-ppss)))
+ ;; calling a method "q" (parens instead of braces to make it valid)
+ (search-forward "q(")
+ (should-not (nth 3 (syntax-ppss)))))
+
(ert-deftest cperl-test-bug-28650 ()
"Verify that regular expressions are recognized after 'return'.
The test uses the syntax property \"inside a string\" for the
@@ -331,14 +497,14 @@ If seen as regular expression, then the slash is displayed using
font-lock-constant-face. If seen as a division, then it doesn't
have a face property."
:tags '(:fontification)
- ;; The next two Perl expressions have divisions. Perl "punctuation"
- ;; operators don't get a face.
+ ;; The next two Perl expressions have divisions. The slash does not
+ ;; start a string.
(let ((code "{ $a++ / $b }"))
(should (equal (nth 8 (cperl-test-ppss code "/")) nil)))
(let ((code "{ $a-- / $b }"))
(should (equal (nth 8 (cperl-test-ppss code "/")) nil)))
- ;; The next two Perl expressions have regular expressions. The
- ;; delimiter of a RE is fontified with font-lock-constant-face.
+ ;; The next two Perl expressions have regular expressions. The slash
+ ;; starts a string.
(let ((code "{ $a+ / $b } # /"))
(should (equal (nth 8 (cperl-test-ppss code "/")) 7)))
(let ((code "{ $a- / $b } # /"))
@@ -352,4 +518,86 @@ have a face property."
;; The yadda-yadda operator should not be in a string.
(should (equal (nth 8 (cperl-test-ppss code "\\.")) nil))))
+(ert-deftest cperl-test-bug-47112 ()
+ "Check that in a bareword starting with a quote-like operator
+followed by an underscore is not interpreted as that quote-like
+operator. Also check that a quote-like operator followed by a
+colon (which is, like ?_, a symbol in CPerl mode) _is_ identified
+as that quote like operator."
+ (with-temp-buffer
+ (funcall cperl-test-mode)
+ (insert "sub y_max { q:bar:; y _bar_foo_; }")
+ (goto-char (point-min))
+ (syntax-propertize (point-max))
+ (font-lock-ensure)
+ (search-forward "max")
+ (should (equal (get-text-property (match-beginning 0) 'face)
+ 'font-lock-function-name-face))
+ (search-forward "bar")
+ (should (equal (get-text-property (match-beginning 0) 'face)
+ 'font-lock-string-face))
+ ; perl-mode doesn't highlight
+ (when (eq cperl-test-mode #'cperl-mode)
+ (search-forward "_")
+ (should (equal (get-text-property (match-beginning 0) 'face)
+ (if (eq cperl-test-mode #'cperl-mode)
+ 'font-lock-constant-face
+ font-lock-string-face))))))
+
+(ert-deftest cperl-test-hyperactive-electric-else ()
+ "Demonstrate cperl-electric-else behavior.
+If `cperl-electric-keywords' is true, keywords like \"else\" and
+\"continue\" are expanded by a following empty block, with the
+cursor in the appropriate position to write that block. This,
+however, must not happen when the keyword occurs in a variable
+\"$else\" or \"$continue\"."
+ (skip-unless (eq cperl-test-mode #'cperl-mode))
+ ;; `self-insert-command' takes a second argument only since Emacs 27
+ (skip-unless (not (< emacs-major-version 27)))
+ (with-temp-buffer
+ (setq cperl-electric-keywords t)
+ (cperl-mode)
+ (insert "continue")
+ (self-insert-command 1 ?\ )
+ (indent-region (point-min) (point-max))
+ (goto-char (point-min))
+ ;; cperl-mode creates a block here
+ (should (search-forward-regexp "continue {\n[[:blank:]]+\n}")))
+ (with-temp-buffer
+ (setq cperl-electric-keywords t)
+ (cperl-mode)
+ (insert "$continue")
+ (self-insert-command 1 ?\ )
+ (indent-region (point-min) (point-max))
+ (goto-char (point-min))
+ ;; No block should have been created here
+ (should-not (search-forward-regexp "{" nil t))))
+
+(ert-deftest cperl-test-bug-47598 ()
+ "Check that a file test followed by ? is no longer interpreted
+as a regex."
+ ;; Testing the text from the bug report
+ (with-temp-buffer
+ (insert "my $f = -f ? 'file'\n")
+ (insert " : -l ? [readlink]\n")
+ (insert " : -d ? 'dir'\n")
+ (insert " : 'unknown';\n")
+ (funcall cperl-test-mode)
+ ;; Perl mode doesn't highlight file tests as functions, so we
+ ;; can't test for the function's face. But we can verify that the
+ ;; function is not a string.
+ (goto-char (point-min))
+ (search-forward "?")
+ (should-not (nth 3 (syntax-ppss (point)))))
+ ;; Testing the actual targets for the regexp: m?foo? (still valid)
+ ;; and ?foo? (invalid since Perl 5.22)
+ (with-temp-buffer
+ (insert "m?foo?;")
+ (funcall cperl-test-mode)
+ (should (nth 3 (syntax-ppss 3))))
+ (with-temp-buffer
+ (insert " ?foo?;")
+ (funcall cperl-test-mode)
+ (should-not (nth 3 (syntax-ppss 3)))))
+
;;; cperl-mode-tests.el ends here
diff --git a/test/lisp/progmodes/elisp-mode-tests.el b/test/lisp/progmodes/elisp-mode-tests.el
index badcad670c2..f47d54e59c0 100644
--- a/test/lisp/progmodes/elisp-mode-tests.el
+++ b/test/lisp/progmodes/elisp-mode-tests.el
@@ -398,18 +398,21 @@ to (xref-elisp-test-descr-to-target xref)."
"(cl-defstruct (xref-elisp-location")
))
+(require 'em-xtra)
+(require 'find-dired)
(xref-elisp-deftest find-defs-defalias-defun-el
- (elisp--xref-find-definitions 'Buffer-menu-sort)
+ (elisp--xref-find-definitions 'eshell/ff)
(list
- (xref-make "(defalias Buffer-menu-sort)"
+ (xref-make "(defalias eshell/ff)"
(xref-make-elisp-location
- 'Buffer-menu-sort 'defalias
- (expand-file-name "../../../lisp/buff-menu.elc" emacs-test-dir)))
- (xref-make "(defun tabulated-list-sort)"
+ 'eshell/ff 'defalias
+ (expand-file-name "../../../lisp/eshell/em-xtra.elc"
+ emacs-test-dir)))
+ (xref-make "(defun find-name-dired)"
(xref-make-elisp-location
- 'tabulated-list-sort nil
- (expand-file-name "../../../lisp/emacs-lisp/tabulated-list.el" emacs-test-dir)))
- ))
+ 'find-name-dired nil
+ (expand-file-name "../../../lisp/find-dired.el"
+ emacs-test-dir)))))
;; FIXME: defconst
diff --git a/test/lisp/progmodes/executable-tests.el b/test/lisp/progmodes/executable-tests.el
new file mode 100644
index 00000000000..4f0fa699f72
--- /dev/null
+++ b/test/lisp/progmodes/executable-tests.el
@@ -0,0 +1,51 @@
+;;; executable-tests.el --- Tests for executable.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'executable)
+
+(ert-deftest executable-tests-set-magic ()
+ (with-temp-buffer
+ (insert "#!/foo/bar")
+ (executable-set-magic "/bin/bash" nil t t)
+ (should (equal (buffer-string) "#!/bin/bash"))))
+
+(ert-deftest executable-tests-set-magic/with-argument ()
+ (with-temp-buffer
+ (insert "#!/foo/bar")
+ (executable-set-magic "/bin/bash" "--norc" t t)
+ (should (equal (buffer-string) "#!/bin/bash --norc"))))
+
+(ert-deftest executable-tests-set-magic/executable-insert-nil ()
+ (let ((executable-insert nil))
+ (with-temp-buffer
+ (insert "#!/foo/bar")
+ (executable-set-magic "/bin/bash" nil t nil)
+ (should (equal (buffer-string) "#!/foo/bar"))))
+ (let ((executable-insert nil))
+ (with-temp-buffer
+ (insert "#!/foo/bar")
+ (executable-set-magic "/bin/bash" nil t t)
+ (should (equal (buffer-string) "#!/bin/bash")))))
+
+;;; executable-tests.el ends here
diff --git a/test/lisp/progmodes/f90-tests.el b/test/lisp/progmodes/f90-tests.el
index b3d12229d8f..330eab38c41 100644
--- a/test/lisp/progmodes/f90-tests.el
+++ b/test/lisp/progmodes/f90-tests.el
@@ -22,9 +22,6 @@
;;; Commentary:
-;; This file does not have "test" in the name, because it lives under
-;; a test/ directory, so that would be superfluous.
-
;;; Code:
(require 'ert)
diff --git a/test/lisp/progmodes/grep-tests.el b/test/lisp/progmodes/grep-tests.el
new file mode 100644
index 00000000000..205982238f2
--- /dev/null
+++ b/test/lisp/progmodes/grep-tests.el
@@ -0,0 +1,69 @@
+;;; grep-tests.el --- Test suite for grep.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'grep)
+
+(defconst grep-tests--ellipsis (if (char-displayable-p ?…) "[…]" "[...]")
+ "The form that the ellipsis takes in `grep-find-abbreviate-properties'.")
+
+(defun grep-tests--get-rgrep-abbreviation ()
+ "Get the `display' property of the excessive part of the rgrep command."
+ (with-temp-buffer
+ (grep-compute-defaults)
+ (insert (rgrep-default-command "search" "*" nil))
+ (grep-mode)
+ (font-lock-mode)
+ (font-lock-ensure)
+ (goto-char (point-min))
+ (re-search-forward "find ")
+ (get-text-property (point) 'display)))
+
+(defun grep-tests--check-rgrep-abbreviation ()
+ "Check that the excessive part of the rgrep command is abbreviated iff
+`grep-find-abbreviate' is non-nil."
+ (let ((grep-find-abbreviate t))
+ (should (equal (grep-tests--get-rgrep-abbreviation)
+ grep-tests--ellipsis)))
+ (let ((grep-find-abbreviate nil))
+ (should-not (grep-tests--get-rgrep-abbreviation))))
+
+(ert-deftest grep-tests--rgrep-abbreviate-properties-gnu-linux ()
+ (let ((system-type 'gnu/linux))
+ (grep-tests--check-rgrep-abbreviation)))
+
+(ert-deftest grep-tests--rgrep-abbreviate-properties-darwin ()
+ (let ((system-type 'darwin))
+ (grep-tests--check-rgrep-abbreviation)))
+
+(ert-deftest grep-tests--rgrep-abbreviate-properties-windows-nt-dos-semantics ()
+ (let ((system-type 'windows-nt))
+ (cl-letf (((symbol-function 'w32-shell-dos-semantics) #'always))
+ (grep-tests--check-rgrep-abbreviation))))
+
+(ert-deftest grep-tests--rgrep-abbreviate-properties-windows-nt-sh-semantics ()
+ (let ((system-type 'windows-nt))
+ (cl-letf (((symbol-function 'w32-shell-dos-semantics) #'ignore))
+ (grep-tests--check-rgrep-abbreviation))))
+
+;;; grep-tests.el ends here
diff --git a/test/lisp/progmodes/octave-tests.el b/test/lisp/progmodes/octave-tests.el
new file mode 100644
index 00000000000..e28fe73b836
--- /dev/null
+++ b/test/lisp/progmodes/octave-tests.el
@@ -0,0 +1,49 @@
+;;; octave-tests.el --- Test suite for octave.el -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+(require 'octave)
+
+(defun octave-test--indent (string)
+ (with-temp-buffer
+ (octave-mode)
+ (insert string)
+ (indent-region (point-min) (point-max))
+ (buffer-string)))
+
+(ert-deftest octave-tests--continuation-indentation ()
+ (should
+ (equal (octave-test--indent "a = b + a * \\
+c;
+")
+ "a = b + a * \\
+ c;
+"))
+ (should (equal (octave-test--indent "a = \\
+b;
+")
+ "a = \\
+ b;
+")))
+
+;;; octave-tests.el ends here
diff --git a/test/lisp/progmodes/perl-mode-tests.el b/test/lisp/progmodes/perl-mode-tests.el
index 9f6800ccd63..3f4af5e1f61 100644
--- a/test/lisp/progmodes/perl-mode-tests.el
+++ b/test/lisp/progmodes/perl-mode-tests.el
@@ -1,4 +1,4 @@
-;;; perl-mode-tests --- Test for perl-mode -*- lexical-binding: t -*-
+;;; perl-mode-tests.el --- Test for perl-mode -*- lexical-binding: t -*-
;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
@@ -21,6 +21,13 @@
(require 'perl-mode)
+(ert-deftest perl-test-lock ()
+ (with-temp-buffer
+ (perl-mode)
+ (insert "$package = foo;")
+ (font-lock-ensure (point-min) (point-max))
+ (should (equal (get-text-property 4 'face) 'font-lock-variable-name-face))))
+
;;;; Re-use cperl-mode tests
(defvar cperl-test-mode)
diff --git a/test/lisp/progmodes/project-tests.el b/test/lisp/progmodes/project-tests.el
new file mode 100644
index 00000000000..68460a9fa5b
--- /dev/null
+++ b/test/lisp/progmodes/project-tests.el
@@ -0,0 +1,110 @@
+;;; project-tests.el --- tests for project.el -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; Keywords:
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Unit tests for progmodes/project.el.
+
+;;; Code:
+
+(require 'project)
+
+(require 'cl-lib)
+(require 'ert)
+(require 'grep)
+(require 'xref)
+
+(defmacro project-tests--with-temporary-directory (var &rest body)
+ "Create a new temporary directory.
+Bind VAR to the name of the directory, and evaluate BODY. Delete
+the directory after BODY exits."
+ (declare (debug (symbolp body)) (indent 1))
+ (cl-check-type var symbol)
+ (let ((directory (make-symbol "directory")))
+ `(let ((,directory (make-temp-file "project-tests-" :directory)))
+ (unwind-protect
+ (let ((,var ,directory))
+ ,@body)
+ (delete-directory ,directory :recursive)))))
+
+(ert-deftest project/quoted-directory ()
+ "Check that `project-files' and `project-find-regexp' deal with
+quoted directory names (Bug#47799)."
+ (skip-unless (executable-find find-program))
+ (skip-unless (executable-find "xargs"))
+ (skip-unless (executable-find "grep"))
+ (project-tests--with-temporary-directory directory
+ (let ((default-directory directory)
+ (project-current-inhibit-prompt t)
+ (project-find-functions nil)
+ (project-list-file
+ (expand-file-name "projects" directory))
+ (project (cons 'transient (file-name-quote directory)))
+ (file (expand-file-name "file" directory)))
+ (add-hook 'project-find-functions (lambda (_dir) project))
+ (should (eq (project-current) project))
+ (write-region "contents" nil file nil nil nil 'excl)
+ (should (equal (project-files project)
+ (list (file-name-quote file))))
+ (let* ((references nil)
+ (xref-search-program 'grep)
+ (xref-show-xrefs-function
+ (lambda (fetcher _display)
+ (push (funcall fetcher) references))))
+ (project-find-regexp "tent")
+ (pcase references
+ (`((,item))
+ ;; FIXME: Shouldn't `xref-match-item' be a subclass of
+ ;; `xref-item'?
+ (should (cl-typep item '(or xref-item xref-match-item)))
+ (should (file-equal-p
+ (xref-location-group (xref-item-location item))
+ file)))
+ (otherwise
+ (ert-fail (format-message "Unexpected references: %S"
+ otherwise))))))))
+
+(cl-defstruct project-tests--trivial root ignores)
+
+(cl-defmethod project-root ((project project-tests--trivial))
+ (project-tests--trivial-root project))
+
+(cl-defmethod project-ignores ((project project-tests--trivial) _dir)
+ (project-tests--trivial-ignores project))
+
+(ert-deftest project-ignores ()
+ "Check that `project-files' correctly ignores the files
+returned by `project-ignores' if the root directory is a
+directory name (Bug#48471)."
+ (skip-unless (executable-find find-program))
+ (project-tests--with-temporary-directory dir
+ (make-empty-file (expand-file-name "some-file" dir))
+ (make-empty-file (expand-file-name "ignored-file" dir))
+ (let* ((project (make-project-tests--trivial
+ :root (file-name-as-directory dir)
+ :ignores '("./ignored-file")))
+ (files (project-files project))
+ (relative-files
+ (cl-loop for file in files
+ collect (file-relative-name file dir))))
+ (should (equal relative-files '("some-file"))))))
+
+;;; project-tests.el ends here
diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el
index 3e653cb568a..1af579bb7a4 100644
--- a/test/lisp/progmodes/python-tests.el
+++ b/test/lisp/progmodes/python-tests.el
@@ -5432,6 +5432,30 @@ buffer with overlapping strings."
(run-python nil nil 'show)
(should (eq buffer (current-buffer)))))
+(ert-deftest python-tests--fill-long-first-line ()
+ (should
+ (equal
+ (with-temp-buffer
+ (insert "def asdf():
+ \"\"\"123 123 123 123 123 123 123 123 123 123 123 123 123 SHOULDBEWRAPPED 123 123 123 123
+
+ \"\"\"
+ a = 1
+")
+ (python-mode)
+ (goto-char (point-min))
+ (forward-line 1)
+ (end-of-line)
+ (fill-paragraph)
+ (buffer-substring-no-properties (point-min) (point-max)))
+ "def asdf():
+ \"\"\"123 123 123 123 123 123 123 123 123 123 123 123 123
+ SHOULDBEWRAPPED 123 123 123 123
+
+ \"\"\"
+ a = 1
+")))
+
(provide 'python-tests)
;; Local Variables:
diff --git a/test/lisp/progmodes/ruby-mode-tests.el b/test/lisp/progmodes/ruby-mode-tests.el
index 42a011c8bcd..8bdfdc310f3 100644
--- a/test/lisp/progmodes/ruby-mode-tests.el
+++ b/test/lisp/progmodes/ruby-mode-tests.el
@@ -32,6 +32,13 @@
(ruby-mode)
,@body))
+(defmacro ruby-with-temp-file (contents &rest body)
+ `(ruby-with-temp-buffer ,contents
+ (set-visited-file-name "ruby-mode-tests")
+ ,@body
+ (set-buffer-modified-p nil)
+ (delete-file buffer-file-name)))
+
(defun ruby-should-indent (content column)
"Assert indentation COLUMN on the last line of CONTENT."
(ruby-with-temp-buffer content
@@ -844,6 +851,52 @@ VALUES-PLIST is a list with alternating index and value elements."
(ruby--insert-coding-comment "utf-8")
(should (string= "# encoding: utf-8\n\n" (buffer-string))))))
+(ert-deftest ruby--set-encoding-when-ascii ()
+ (ruby-with-temp-file "ascii"
+ (let ((ruby-encoding-magic-comment-style 'ruby)
+ (ruby-insert-encoding-magic-comment t))
+ (setq save-buffer-coding-system 'us-ascii)
+ (ruby-mode-set-encoding)
+ (should (string= "ascii" (buffer-string))))))
+
+(ert-deftest ruby--set-encoding-when-utf8 ()
+ (ruby-with-temp-file "💎"
+ (let ((ruby-encoding-magic-comment-style 'ruby)
+ (ruby-insert-encoding-magic-comment t))
+ (setq save-buffer-coding-system 'utf-8)
+ (ruby-mode-set-encoding)
+ (should (string= "💎" (buffer-string))))))
+
+(ert-deftest ruby--set-encoding-when-latin-15 ()
+ (ruby-with-temp-file "Ⓡ"
+ (let ((ruby-encoding-magic-comment-style 'ruby)
+ (ruby-insert-encoding-magic-comment t))
+ (setq save-buffer-coding-system 'iso-8859-15)
+ (ruby-mode-set-encoding)
+ (should (string= "# coding: iso-8859-15\nⓇ" (buffer-string))))))
+
+(ert-deftest ruby-imenu-with-private-modifier ()
+ (ruby-with-temp-buffer
+ (ruby-test-string
+ "class Blub
+ | def hi
+ | 'Hi!'
+ | end
+ |
+ | def bye
+ | 'Bye!'
+ | end
+ |
+ | private def hiding
+ | 'You can't see me'
+ | end
+ |end")
+ (should (equal (mapcar #'car (ruby-imenu-create-index))
+ '("Blub"
+ "Blub#hi"
+ "Blub#bye"
+ "Blub#hiding")))))
+
(ert-deftest ruby--indent/converted-from-manual-test ()
:tags '(:expensive-test)
;; Converted from manual test.
diff --git a/test/lisp/progmodes/xref-resources/file1.txt b/test/lisp/progmodes/xref-resources/file1.txt
index 5d7cc544443..85b92f11566 100644
--- a/test/lisp/progmodes/xref-resources/file1.txt
+++ b/test/lisp/progmodes/xref-resources/file1.txt
@@ -1,2 +1,2 @@
-foo foo
+ foo foo
bar
diff --git a/test/lisp/progmodes/xref-resources/file3.txt b/test/lisp/progmodes/xref-resources/file3.txt
new file mode 100644
index 00000000000..6283185910d
--- /dev/null
+++ b/test/lisp/progmodes/xref-resources/file3.txt
@@ -0,0 +1 @@
+ match some words match more match ends here
diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el
index b4b5e4db5d6..d29452243b2 100644
--- a/test/lisp/progmodes/xref-tests.el
+++ b/test/lisp/progmodes/xref-tests.el
@@ -59,15 +59,33 @@
(should (string-match-p "file1\\.txt\\'" (xref-location-group (nth 1 locs))))
(should (equal 1 (xref-location-line (nth 0 locs))))
(should (equal 1 (xref-location-line (nth 1 locs))))
- (should (equal 0 (xref-location-column (nth 0 locs))))
- (should (equal 4 (xref-location-column (nth 1 locs))))))
+ (should (equal 1 (xref-file-location-column (nth 0 locs))))
+ (should (equal 5 (xref-file-location-column (nth 1 locs))))))
(ert-deftest xref-matches-in-directory-finds-an-empty-line-regexp-match ()
(let ((locs (xref-tests--locations-in-data-dir "^$")))
(should (= 1 (length locs)))
(should (string-match-p "file2\\.txt\\'" (xref-location-group (nth 0 locs))))
(should (equal 1 (xref-location-line (nth 0 locs))))
- (should (equal 0 (xref-location-column (nth 0 locs))))))
+ (should (equal 0 (xref-file-location-column (nth 0 locs))))))
+
+(ert-deftest xref-matches-in-files-includes-matches-from-all-the-files ()
+ (let ((matches (xref-matches-in-files "bar"
+ (directory-files xref-tests--data-dir t
+ "\\`[^.]"))))
+ (should (= 2 (length matches)))
+ (should (cl-every
+ (lambda (match) (equal (xref-item-summary match) "bar"))
+ matches))))
+
+(ert-deftest xref-matches-in-files-trims-summary-for-matches-on-same-line ()
+ (let ((matches (xref-matches-in-files "match"
+ (directory-files xref-tests--data-dir t
+ "\\`[^.]"))))
+ (should (= 3 (length matches)))
+ (should
+ (equal (mapcar #'xref-item-summary matches)
+ '(" match some words " "match more " "match ends here")))))
(ert-deftest xref--buf-pairs-iterator-groups-markers-by-buffers-1 ()
(let* ((xrefs (xref-tests--matches-in-data-dir "foo"))
@@ -99,18 +117,14 @@
(should (null (marker-position (cdr (nth 0 (cdr cons2))))))))
(ert-deftest xref--xref-file-name-display-is-abs ()
- (let ((xref-file-name-display 'abs)
- ;; Some older BSD find versions can produce '//' in the output.
- (expected (list
- (concat xref-tests--data-dir "/?file1.txt")
- (concat xref-tests--data-dir "/?file2.txt")))
- (actual (delete-dups
- (mapcar 'xref-location-group
- (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))))
- (should (and (= (length expected) (length actual))
- (cl-every (lambda (e1 e2)
- (string-match-p e1 e2))
- expected actual)))))
+ (let ((xref-file-name-display 'abs))
+ (should (equal
+ (delete-dups
+ (mapcar 'xref-location-group
+ (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+ (list
+ (concat xref-tests--data-dir "file1.txt")
+ (concat xref-tests--data-dir "file2.txt"))))))
(ert-deftest xref--xref-file-name-display-is-nondirectory ()
(let ((xref-file-name-display 'nondirectory))
@@ -125,16 +139,14 @@
(let* ((data-parent-dir
(file-name-directory (directory-file-name xref-tests--data-dir)))
(project-find-functions
- #'(lambda (_) (cons 'transient data-parent-dir)))
- (xref-file-name-display 'project-relative)
- ;; Some older BSD find versions can produce '//' in the output.
- (expected (list
- "xref-resources//?file1.txt"
- "xref-resources//?file2.txt"))
- (actual (delete-dups
- (mapcar 'xref-location-group
- (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))))
- (should (and (= (length expected) (length actual))
- (cl-every (lambda (e1 e2)
- (string-match-p e1 e2))
- expected actual)))))
+ (lambda (_) (cons 'transient data-parent-dir)))
+ (xref-file-name-display 'project-relative))
+ (should (equal
+ (delete-dups
+ (mapcar 'xref-location-group
+ (xref-tests--locations-in-data-dir "\\(bar\\|foo\\)")))
+ (list
+ "xref-resources/file1.txt"
+ "xref-resources/file2.txt")))))
+
+;;; xref-tests.el ends here
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el
index 2db570c97dd..7f62a417a02 100644
--- a/test/lisp/replace-tests.el
+++ b/test/lisp/replace-tests.el
@@ -465,7 +465,12 @@ Return the last evalled form in BODY."
;; isearch-lazy-highlight-new-loop and sit-for (bug#36328)
((symbol-function 'replace-highlight)
(lambda (&rest _args)
- (string-match "[A-Z ]" "ForestGreen"))))
+ (string-match "[A-Z ]" "ForestGreen")))
+ ;; Override `sit-for' and `ding' so that we don't have
+ ;; to wait and listen to bells when running the test.
+ ((symbol-function 'sit-for)
+ (lambda (&rest _args) (redisplay)))
+ ((symbol-function 'ding) 'ignore))
(perform-replace ,from ,to t replace-tests-perform-replace-regexp-flag nil))
,@body))))
@@ -584,7 +589,7 @@ bound to HIGHLIGHT-LOCUS."
(replace-tests-with-highlighted-occurrence highlight-locus
(occur-mode-display-occurrence)
(with-current-buffer (marker-buffer
- (get-text-property (point) 'occur-target))
+ (caar (get-text-property (point) 'occur-target)))
(should (funcall check-overlays has-overlay)))))))
(ert-deftest replace-regexp-bug45973 ()
@@ -601,4 +606,15 @@ bound to HIGHLIGHT-LOCUS."
(if (match-string 2) "R" "L")))
(should (equal (buffer-string) after)))))
+(ert-deftest test-count-matches ()
+ (with-temp-buffer
+ (insert "oooooooooo")
+ (goto-char (point-min))
+ (should (= (count-matches "oo") 5))
+ (should (= (count-matches "o+") 1)))
+ (with-temp-buffer
+ (insert "o\n\n\n\no\n\n")
+ (goto-char (point-min))
+ (should (= (count-matches "^$") 4))))
+
;;; replace-tests.el ends here
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 0c2d7123dd7..c571dc3e14b 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -69,8 +69,14 @@
(format "/mock::%s" temporary-file-directory)))
"Temporary directory for Tramp tests.")
-(setq password-cache-expiry nil
- shadow-debug (getenv "EMACS_HYDRA_CI")
+(setq auth-source-save-behavior nil
+ password-cache-expiry nil
+ shadow-debug (or (getenv "EMACS_HYDRA_CI") (getenv "EMACS_EMBA_CI"))
+ ;; When the remote user id is 0, Tramp refuses unsafe temporary files.
+ tramp-allow-unsafe-temporary-files
+ (or tramp-allow-unsafe-temporary-files noninteractive)
+ tramp-cache-read-persistent-data t ;; For auth-sources.
+ tramp-persistency-file-name nil
tramp-verbose 0
;; On macOS, `temporary-file-directory' is a symlinked directory.
temporary-file-directory (file-truename temporary-file-directory)
@@ -117,8 +123,8 @@
(ignore-errors (delete-file shadow-info-file))
(ignore-errors (delete-file shadow-todo-file))
;; Reset variables.
+ (shadow-invalidate-hashtable)
(setq shadow-info-buffer nil
- shadow-hashtable nil
shadow-todo-buffer nil
shadow-files-to-copy nil))
@@ -640,7 +646,9 @@ guaranteed by the originator of a cluster definition."
(expand-file-name
"shadowfile-tests"
shadow-test-remote-temporary-file-directory))
- mocked-input `(,cluster1 ,file1 ,cluster2 ,file2 ,(kbd "RET")))
+ mocked-input
+ `(,cluster1 ,file1 ,cluster2 ,file2
+ ,primary ,file1 ,(kbd "RET")))
(with-temp-buffer
(set-visited-file-name file1)
(call-interactively #'shadow-define-literal-group)
@@ -654,7 +662,9 @@ guaranteed by the originator of a cluster definition."
(should (member (format "/%s:%s" cluster1 (file-local-name file1))
(car shadow-literal-groups)))
(should (member (format "/%s:%s" cluster2 (file-local-name file2))
- (car shadow-literal-groups))))
+ (car shadow-literal-groups)))
+ ;; Bug#49596.
+ (should (member (concat primary file1) (car shadow-literal-groups))))
;; Cleanup.
(shadow--tests-cleanup))))
@@ -729,6 +739,7 @@ guaranteed by the originator of a cluster definition."
(skip-unless (file-writable-p shadow-test-remote-temporary-file-directory))
(let ((backup-inhibited t)
+ create-lockfiles
(shadow-info-file shadow-test-info-file)
(shadow-todo-file shadow-test-todo-file)
(shadow-inhibit-message t)
@@ -874,6 +885,7 @@ guaranteed by the originator of a cluster definition."
(skip-unless (file-writable-p shadow-test-remote-temporary-file-directory))
(let ((backup-inhibited t)
+ create-lockfiles
(shadow-info-file shadow-test-info-file)
(shadow-todo-file shadow-test-todo-file)
(shadow-inhibit-message t)
diff --git a/test/lisp/shell-tests.el b/test/lisp/shell-tests.el
index d918de771b7..223a18590b1 100644
--- a/test/lisp/shell-tests.el
+++ b/test/lisp/shell-tests.el
@@ -45,4 +45,23 @@
(should (equal (shell--parse-pcomplete-arguments)
'(("cd" "ba" "") 1 4 7)))))
+(ert-deftest shell-tests-split-string ()
+ (should (equal (split-string-shell-command "ls /tmp")
+ '("ls" "/tmp")))
+ (should (equal (split-string-shell-command "ls '/tmp/foo bar'")
+ '("ls" "/tmp/foo bar")))
+ (should (equal (split-string-shell-command "ls \"/tmp/foo bar\"")
+ '("ls" "/tmp/foo bar")))
+ (should (equal (split-string-shell-command "ls /tmp/'foo bar'")
+ '("ls" "/tmp/foo bar")))
+ (should (equal (split-string-shell-command "ls /tmp/'foo\"bar'")
+ '("ls" "/tmp/foo\"bar")))
+ (should (equal (split-string-shell-command "ls /tmp/\"foo''bar\"")
+ '("ls" "/tmp/foo''bar")))
+ (should (equal (split-string-shell-command "ls /tmp/'foo\\ bar'")
+ '("ls" "/tmp/foo\\ bar")))
+ (unless (memq system-type '(windows-nt ms-dos))
+ (should (equal (split-string-shell-command "ls /tmp/foo\\ bar")
+ '("ls" "/tmp/foo bar")))))
+
;;; shell-tests.el ends here
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index b4007a6c3f3..3ece61290bc 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -1,4 +1,4 @@
-;;; simple-test.el --- Tests for simple.el -*- lexical-binding: t; -*-
+;;; simple-tests.el --- Tests for simple.el -*- lexical-binding: t; -*-
;; Copyright (C) 2015-2021 Free Software Foundation, Inc.
@@ -67,6 +67,11 @@
(insert (propertize "\nbar\nbaz\nzut" 'invisible t))
(should (= (count-lines (point-min) (point-max) t) 2))))
+(ert-deftest simple-text-count-lines-non-ascii ()
+ (with-temp-buffer
+ (insert "あ\nい\nう\nえ\nお\n")
+ (should (= (count-lines (point) (point)) 0))))
+
;;; `transpose-sexps'
(defmacro simple-test--transpositions (&rest body)
@@ -460,8 +465,124 @@ See bug#35036."
(simple-tests--exec '(backward-char undo-redo undo-redo))
(should (equal (buffer-string) "abc"))
(simple-tests--exec '(backward-char undo-redo undo-redo))
+ (should (equal (buffer-string) "abcde"))))
+
+(ert-deftest simple-tests--undo-in-region ()
+ ;; Test undo/redo in region.
+ (with-temp-buffer
+ ;; Enable `transient-mark-mode' so `region-active-p' works as
+ ;; expected. `region-active-p' is used to determine whether to
+ ;; perform regional undo in `undo'.
+ (transient-mark-mode)
+ (buffer-enable-undo)
+ (dolist (x '("a" "b" "c" "d" "e"))
+ (insert x)
+ (undo-boundary))
+ (should (equal (buffer-string) "abcde"))
+ ;; The test does this: activate region, `undo', break the undo
+ ;; chain (by deactivating and reactivating the region), then
+ ;; `undo-only'. There used to be a bug in
+ ;; `undo-make-selective-list' that makes `undo-only' error out in
+ ;; that case, which is fixed by in the same commit as this change.
+ (simple-tests--exec '(move-beginning-of-line
+ push-mark-command
+ forward-char
+ forward-char
+ undo))
+ (should (equal (buffer-string) "acde"))
+ (simple-tests--exec '(move-beginning-of-line
+ push-mark-command
+ forward-char
+ forward-char
+ undo-only))
(should (equal (buffer-string) "abcde"))
- ))
+ ;; Rest are simple redo in region tests.
+ (simple-tests--exec '(undo-redo))
+ (should (equal (buffer-string) "acde"))
+ (simple-tests--exec '(undo-redo))
+ (should (equal (buffer-string) "abcde"))))
+
+(defun simple-tests--sans-leading-nil (lst)
+ "Return LST sans the leading nils."
+ (while (and (consp lst) (null (car lst)))
+ (setq lst (cdr lst)))
+ lst)
+
+(ert-deftest simple-tests--undo-equiv-table ()
+ (with-temp-buffer
+ (buffer-enable-undo)
+ (transient-mark-mode)
+ (let ((ul-hash-table (make-hash-table :test #'equal)))
+ (dolist (x '("a" "b" "c"))
+ (insert x)
+ (puthash x (simple-tests--sans-leading-nil buffer-undo-list)
+ ul-hash-table)
+ (undo-boundary))
+ (should (equal (buffer-string) "abc"))
+ ;; Tests mappings in `undo-equiv-table'.
+ (simple-tests--exec '(undo))
+ (should (equal (buffer-string) "ab"))
+ (should (eq (gethash (simple-tests--sans-leading-nil
+ buffer-undo-list)
+ undo-equiv-table)
+ (gethash "b" ul-hash-table)))
+ (simple-tests--exec '(backward-char undo))
+ (should (equal (buffer-string) "abc"))
+ (should (eq (gethash (simple-tests--sans-leading-nil
+ buffer-undo-list)
+ undo-equiv-table)
+ (gethash "c" ul-hash-table)))
+ ;; Undo in region should map to 'undo-in-region.
+ (simple-tests--exec '(backward-char
+ push-mark-command
+ move-end-of-line
+ undo))
+ (should (equal (buffer-string) "ab"))
+ (should (eq (gethash (simple-tests--sans-leading-nil
+ buffer-undo-list)
+ undo-equiv-table)
+ 'undo-in-region))
+ ;; The undo that undoes to the beginning should map to t.
+ (deactivate-mark 'force)
+ (simple-tests--exec '(backward-char
+ undo undo undo
+ undo undo undo))
+ (should (equal (buffer-string) ""))
+ (should (eq (gethash (simple-tests--sans-leading-nil
+ buffer-undo-list)
+ undo-equiv-table)
+ t))
+ ;; Erroneous nil undo should map to 'empty.
+ (insert "a")
+ (undo-boundary)
+ (push nil buffer-undo-list)
+ (simple-tests--exec '(backward-char undo))
+ (should (equal (buffer-string) "a"))
+ (should (eq (gethash (simple-tests--sans-leading-nil
+ buffer-undo-list)
+ undo-equiv-table)
+ 'empty))
+ ;; But if the previous record is a redo record, its mapping
+ ;; shouldn't change.
+ (insert "e")
+ (undo-boundary)
+ (should (equal (buffer-string) "ea"))
+ (puthash "e" (simple-tests--sans-leading-nil buffer-undo-list)
+ ul-hash-table)
+ (insert "a")
+ (undo-boundary)
+ (simple-tests--exec '(backward-char undo))
+ (should (equal (buffer-string) "ea"))
+ (push nil buffer-undo-list)
+ (simple-tests--exec '(forward-char undo))
+ ;; Buffer content should change since we just undid a nil
+ ;; record.
+ (should (equal (buffer-string) "ea"))
+ ;; The previous redo record shouldn't map to empty.
+ (should (equal (gethash (simple-tests--sans-leading-nil
+ buffer-undo-list)
+ undo-equiv-table)
+ (gethash "e" ul-hash-table))))))
;;; undo auto-boundary tests
(ert-deftest undo-auto-boundary-timer ()
@@ -838,6 +959,17 @@ See Bug#21722."
(with-shell-command-dont-erase-buffer str output-buffer-is-current
(should (= (point) (alist-get shell-command-dont-erase-buffer expected-point)))))))
+(ert-deftest test-undo-region ()
+ (with-temp-buffer
+ (insert "This is a test\n")
+ (goto-char (point-min))
+ (setq buffer-undo-list nil)
+ (downcase-word 1)
+ (should (= (length (delq nil (undo-make-selective-list 1 9))) 2))
+ (should (= (length (delq nil (undo-make-selective-list 4 9))) 1))
+ ;; FIXME this is the off-by-one error case.
+ ;;(should (= (length (delq nil (undo-make-selective-list 5 9))) 0))
+ (should (= (length (delq nil (undo-make-selective-list 6 9))) 0))))
(provide 'simple-test)
;;; simple-test.el ends here
diff --git a/test/lisp/so-long-tests/so-long-tests-helpers.el b/test/lisp/so-long-tests/so-long-tests-helpers.el
index ab4d9c6c137..dd2331e6e4a 100644
--- a/test/lisp/so-long-tests/so-long-tests-helpers.el
+++ b/test/lisp/so-long-tests/so-long-tests-helpers.el
@@ -43,7 +43,8 @@
(cl-case action
('so-long-mode
(should (eq major-mode 'so-long-mode))
- (so-long-tests-assert-overrides))
+ (so-long-tests-assert-overrides)
+ (so-long-tests-assert-preserved))
('so-long-minor-mode
(should (eq so-long-minor-mode t))
(so-long-tests-assert-overrides))
@@ -62,7 +63,8 @@
(cl-case action
('so-long-mode
(should-not (eq major-mode 'so-long-mode))
- (so-long-tests-assert-overrides-reverted))
+ (so-long-tests-assert-overrides-reverted)
+ (so-long-tests-assert-preserved))
('so-long-minor-mode
(should-not (eq so-long-minor-mode t))
(so-long-tests-assert-overrides-reverted))
@@ -90,6 +92,17 @@
(when (boundp (car ovar))
(should (equal (symbol-value (car ovar)) (cdr ovar))))))
+(defun so-long-tests-assert-preserved ()
+ "Assert that preserved modes and variables have their expected values."
+ (dolist (var so-long-mode-preserved-variables)
+ (when (boundp var)
+ (should (equal (symbol-value var)
+ (alist-get var so-long-tests-memory)))))
+ (dolist (mode so-long-mode-preserved-minor-modes)
+ (when (boundp mode)
+ (should (equal (symbol-value mode)
+ (alist-get mode so-long-tests-memory))))))
+
(defun so-long-tests-remember ()
"Remember the original states of modes and variables.
@@ -107,7 +120,22 @@ state against this remembered state."
(dolist (mode so-long-minor-modes)
(when (boundp mode)
(push (cons mode (symbol-value mode))
+ so-long-tests-memory)))
+ (dolist (var so-long-mode-preserved-variables)
+ (when (boundp var)
+ (push (cons var (symbol-value var))
+ so-long-tests-memory)))
+ (dolist (mode so-long-mode-preserved-minor-modes)
+ (when (boundp mode)
+ (push (cons mode (symbol-value mode))
so-long-tests-memory))))
+(defun so-long-tests-predicates ()
+ "Return the list of testable predicate functions."
+ (if (fboundp 'buffer-line-statistics)
+ '(so-long-statistics-excessive-p
+ so-long-detected-long-line-p)
+ '(so-long-detected-long-line-p)))
+
(provide 'so-long-tests-helpers)
;;; so-long-tests-helpers.el ends here
diff --git a/test/lisp/so-long-tests/so-long-tests.el b/test/lisp/so-long-tests/so-long-tests.el
index a6d8721ffc8..8e4597c946c 100644
--- a/test/lisp/so-long-tests/so-long-tests.el
+++ b/test/lisp/so-long-tests/so-long-tests.el
@@ -57,101 +57,131 @@
(declare-function so-long-tests-assert-active "so-long-tests-helpers")
(declare-function so-long-tests-assert-reverted "so-long-tests-helpers")
(declare-function so-long-tests-assert-and-revert "so-long-tests-helpers")
+(declare-function so-long-tests-predicates "so-long-tests-helpers")
-;; Enable the automated behavior for all tests.
+;; Enable the automated behaviour for all tests.
(global-so-long-mode 1)
(ert-deftest so-long-tests-threshold-under ()
"Under line length threshold."
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (insert (make-string (1- so-long-threshold) ?x))
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode))))
+ (dolist (so-long-predicate (so-long-tests-predicates))
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1- so-long-threshold) ?x))
+ (normal-mode)
+ (should (eq major-mode 'emacs-lisp-mode)))))
(ert-deftest so-long-tests-threshold-at ()
"At line length threshold."
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (insert (make-string (1- so-long-threshold) ?x))
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode))))
+ (dolist (so-long-predicate (so-long-tests-predicates))
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1- so-long-threshold) ?x))
+ (normal-mode)
+ (should (eq major-mode 'emacs-lisp-mode)))))
(ert-deftest so-long-tests-threshold-over ()
"Over line length threshold."
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (normal-mode)
- (so-long-tests-remember)
- (insert (make-string (1+ so-long-threshold) ?x))
- (normal-mode)
- (so-long-tests-assert-and-revert 'so-long-mode)))
+ (dolist (so-long-predicate (so-long-tests-predicates))
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (normal-mode)
+ (so-long-tests-remember)
+ (insert (make-string (1+ so-long-threshold) ?x))
+ (normal-mode)
+ (so-long-tests-assert-and-revert 'so-long-mode))))
(ert-deftest so-long-tests-skip-comments ()
"Skip leading shebang, whitespace, and comments."
- ;; Long comment, no newline.
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (insert (make-string (1+ so-long-threshold) ?\;))
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode)))
- ;; Long comment, with newline.
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (insert (make-string (1+ so-long-threshold) ?\;))
- (insert "\n")
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode)))
- ;; Long comment, with short text following.
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (insert (make-string (1+ so-long-threshold) ?\;))
- (insert "\n")
- (insert (make-string so-long-threshold ?x))
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode)))
- ;; Long comment, with long text following.
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- (insert (make-string (1+ so-long-threshold) ?\;))
- (insert "\n")
- (insert (make-string (1+ so-long-threshold) ?x))
- (normal-mode)
- (should (eq major-mode 'so-long-mode))))
+ ;; Only for `so-long-detected-long-line-p' -- comments are not
+ ;; treated differently when using `so-long-statistics-excessive-p'.
+ (dolist (so-long-predicate (so-long-tests-predicates))
+ ;; Long comment, no newline.
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1+ so-long-threshold) ?\;))
+ (normal-mode)
+ (should (eq major-mode
+ (cond ((eq so-long-predicate #'so-long-detected-long-line-p)
+ 'emacs-lisp-mode)
+ ((eq so-long-predicate #'so-long-statistics-excessive-p)
+ 'so-long-mode)))))
+ ;; Long comment, with newline.
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1+ so-long-threshold) ?\;))
+ (insert "\n")
+ (normal-mode)
+ (should (eq major-mode
+ (cond ((eq so-long-predicate #'so-long-detected-long-line-p)
+ 'emacs-lisp-mode)
+ ((eq so-long-predicate #'so-long-statistics-excessive-p)
+ 'so-long-mode)))))
+ ;; Long comment, with short text following.
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1+ so-long-threshold) ?\;))
+ (insert "\n")
+ (insert (make-string so-long-threshold ?x))
+ (normal-mode)
+ (should (eq major-mode
+ (cond ((eq so-long-predicate #'so-long-detected-long-line-p)
+ 'emacs-lisp-mode)
+ ((eq so-long-predicate #'so-long-statistics-excessive-p)
+ 'so-long-mode)))))
+ ;; Long comment, with long text following.
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1+ so-long-threshold) ?\;))
+ (insert "\n")
+ (insert (make-string (1+ so-long-threshold) ?x))
+ (normal-mode)
+ (should (eq major-mode 'so-long-mode)))))
(ert-deftest so-long-tests-max-lines ()
"Give up after `so-long-max-lines'."
- (with-temp-buffer
- (display-buffer (current-buffer))
- (insert "#!emacs\n")
- ;; Insert exactly `so-long-max-lines' non-comment lines, followed
- ;; by a long line.
- (dotimes (_ so-long-max-lines)
- (insert "x\n"))
- (insert (make-string (1+ so-long-threshold) ?x))
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode))
- ;; If `so-long-max-lines' is nil, don't give up the search.
- (let ((so-long-max-lines nil))
- (normal-mode)
- (should (eq major-mode 'so-long-mode)))
- ;; If `so-long-skip-leading-comments' is nil, all lines are
- ;; counted, and so the shebang line counts, which makes the
- ;; long line one line further away.
- (let ((so-long-skip-leading-comments nil)
- (so-long-max-lines (1+ so-long-max-lines)))
+ ;; Only for `so-long-detected-long-line-p' -- the whole buffer is
+ ;; 'seen' when using `so-long-statistics-excessive-p'.
+ (dolist (so-long-predicate (so-long-tests-predicates))
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ ;; Insert exactly `so-long-max-lines' non-comment lines, followed
+ ;; by a long line.
+ (dotimes (_ so-long-max-lines)
+ (insert "x\n"))
+ (insert (make-string (1+ so-long-threshold) ?x))
(normal-mode)
- (should (eq major-mode 'emacs-lisp-mode))
- (let ((so-long-max-lines (1+ so-long-max-lines)))
+ (should (eq major-mode
+ (cond ((eq so-long-predicate #'so-long-detected-long-line-p)
+ 'emacs-lisp-mode)
+ ((eq so-long-predicate #'so-long-statistics-excessive-p)
+ 'so-long-mode))))
+ ;; If `so-long-max-lines' is nil, don't give up the search.
+ (let ((so-long-max-lines nil))
(normal-mode)
- (should (eq major-mode 'so-long-mode))))))
+ (should (eq major-mode 'so-long-mode)))
+ ;; If `so-long-skip-leading-comments' is nil, all lines are
+ ;; counted, and so the shebang line counts, which makes the
+ ;; long line one line further away.
+ (let ((so-long-skip-leading-comments nil)
+ (so-long-max-lines (1+ so-long-max-lines)))
+ (normal-mode)
+ (should (eq major-mode
+ (cond ((eq so-long-predicate #'so-long-detected-long-line-p)
+ 'emacs-lisp-mode)
+ ((eq so-long-predicate #'so-long-statistics-excessive-p)
+ 'so-long-mode))))
+ (let ((so-long-max-lines (1+ so-long-max-lines)))
+ (normal-mode)
+ (should (eq major-mode 'so-long-mode)))))))
(ert-deftest so-long-tests-invisible-buffer-function ()
"Call `so-long-invisible-buffer-function' in invisible buffers."
@@ -180,7 +210,7 @@
;; From Emacs 27 the `display-buffer' call is insufficient.
;; The various 'window change functions' are now invoked by the
;; redisplay, and redisplay does nothing at all in batch mode,
- ;; so we cannot test under this revised behavior. Refer to:
+ ;; so we cannot test under this revised behaviour. Refer to:
;; https://lists.gnu.org/r/emacs-devel/2019-10/msg00971.html
;; For interactive (non-batch) test runs, calling `redisplay'
;; does do the trick; so do that first.
@@ -195,7 +225,9 @@
;; Emacs adds the framework necessary to make `redisplay' work
;; in batch mode.
(unless (eq so-long--active t)
- (run-window-configuration-change-hook))))
+ (with-suppressed-warnings
+ ((obsolete run-window-configuration-change-hook))
+ (run-window-configuration-change-hook)))))
(so-long-tests-assert-and-revert 'so-long-mode))
;; `so-long-invisible-buffer-function' is `nil'.
(with-temp-buffer
@@ -230,7 +262,9 @@
(redisplay)
(when noninteractive
(unless (eq so-long--active t)
- (run-window-configuration-change-hook))))
+ (with-suppressed-warnings
+ ((obsolete run-window-configuration-change-hook))
+ (run-window-configuration-change-hook)))))
(should (eq major-mode 'emacs-lisp-mode))))
(ert-deftest so-long-tests-actions ()
@@ -323,20 +357,76 @@
(normal-mode)
(should (eq major-mode 'so-long-mode)))))
+(ert-deftest so-long-tests-preserved-variables-and-modes ()
+ "Preserved variables and minor modes when using `so-long-mode'."
+ ;; Test the user options `so-long-mode-preserved-variables' and
+ ;; `so-long-mode-preserved-minor-modes'. The minor mode `view-mode'
+ ;; is 'preserved' by default (using both options).
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (normal-mode)
+ ;; We enable `view-mode' before triggering `so-long'.
+ (insert (make-string (1+ so-long-threshold) ?x))
+ (view-mode 1)
+ (should (eq view-mode t))
+ (should (eq buffer-read-only t))
+ (so-long-tests-remember)
+ (let ((so-long-action 'so-long-mode)
+ (menu (so-long-menu)))
+ (so-long)
+ (so-long-tests-assert-active 'so-long-mode)
+ (should (eq view-mode t))
+ (should (eq buffer-read-only t))
+ ;; Revert.
+ (funcall (lookup-key menu [so-long-revert]))
+ (so-long-tests-assert-reverted 'so-long-mode)
+ (should (eq view-mode t))
+ (should (eq buffer-read-only t))
+ ;; Disable `view-mode'. Note that without the preserved
+ ;; variables, the conflict between how `view-mode' and `so-long'
+ ;; each deal with the buffer's original `buffer-read-only' value
+ ;; would lead to a situation whereby the buffer would still be
+ ;; read-only after `view-mode' had been disabled.
+ (view-mode 0)
+ (should (eq view-mode nil))
+ (should (eq buffer-read-only nil))))
+ ;; Without `view-mode'.
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (normal-mode)
+ (insert (make-string (1+ so-long-threshold) ?x))
+ (should (eq view-mode nil))
+ (so-long-tests-remember)
+ (let ((so-long-action 'so-long-mode)
+ (menu (so-long-menu)))
+ (so-long)
+ (so-long-tests-assert-active 'so-long-mode)
+ (should (eq view-mode nil))
+ ;; Revert.
+ (funcall (lookup-key menu [so-long-revert]))
+ (so-long-tests-assert-reverted 'so-long-mode)
+ (should (eq view-mode nil)))))
+
(ert-deftest so-long-tests-predicate ()
"Custom predicate function."
;; Test the `so-long-predicate' user option.
+ ;; Always true. Trigger when we normally wouldn't.
(with-temp-buffer
(display-buffer (current-buffer))
(insert "#!emacs\n")
- ;; Always false.
- (let ((so-long-predicate #'ignore))
- (normal-mode)
- (should (eq major-mode 'emacs-lisp-mode)))
- ;; Always true.
(let ((so-long-predicate (lambda () t)))
(normal-mode)
- (should (eq major-mode 'so-long-mode)))))
+ (should (eq major-mode 'so-long-mode))))
+ ;; Always false. Don't trigger when we normally would.
+ (with-temp-buffer
+ (display-buffer (current-buffer))
+ (insert "#!emacs\n")
+ (insert (make-string (1+ so-long-threshold) ?x))
+ (let ((so-long-predicate #'ignore))
+ (normal-mode)
+ (should (eq major-mode 'emacs-lisp-mode)))))
(ert-deftest so-long-tests-file-local-action ()
"File-local action."
@@ -405,7 +495,10 @@
(insert ,local-vars)
(normal-mode)
;; Remember the `emacs-lisp-mode' state. The other cases
- ;; will validate the 'reverted' state against this.
+ ;; will validate the 'reverted' state against this. (Note
+ ;; that we haven't displayed the buffer, and therefore only
+ ;; `so-long-invisible-buffer-function' has acted, so we are
+ ;; still remembering the 'before' state.)
(so-long-tests-remember)
(should (eq major-mode 'emacs-lisp-mode)))
;; Downgrade the action from major mode to minor mode.
diff --git a/test/lisp/so-long-tests/spelling-tests.el b/test/lisp/so-long-tests/spelling-tests.el
index 0be8555bdd2..f778b646635 100644
--- a/test/lisp/so-long-tests/spelling-tests.el
+++ b/test/lisp/so-long-tests/spelling-tests.el
@@ -57,7 +57,7 @@
(unwind-protect
(cl-letf (((symbol-function 'ispell-command-loop)
(lambda (_miss _guess word _start _end)
- (message "Unrecognized word: %s." word)
+ (message "Unrecognised word: %s." word)
(throw 'mistake t))))
(catch 'mistake
(find-library "so-long")
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el
index fc5a1eba6d8..21b8a27858e 100644
--- a/test/lisp/subr-tests.el
+++ b/test/lisp/subr-tests.el
@@ -78,10 +78,14 @@
(ert-deftest subr-test-define-prefix-command ()
(define-prefix-command 'foo-prefix-map)
+ (defvar foo-prefix-map)
+ (declare-function foo-prefix-map "subr-tests")
(should (keymapp foo-prefix-map))
(should (fboundp #'foo-prefix-map))
;; With optional argument.
(define-prefix-command 'bar-prefix 'bar-prefix-map)
+ (defvar bar-prefix-map)
+ (declare-function bar-prefix "subr-tests")
(should (keymapp bar-prefix-map))
(should (fboundp #'bar-prefix))
;; Returns the symbol.
@@ -378,7 +382,7 @@ cf. Bug#25477."
"Test for https://debbugs.gnu.org/22027 ."
(let ((default "foo") res)
(cl-letf (((symbol-function 'read-string)
- (lambda (_prompt _init _hist def) def)))
+ (lambda (_prompt &optional _init _hist def _inher-input) def)))
(setq res (read-passwd "pass: " 'confirm (mapconcat #'string default "")))
(should (string= default res)))))
@@ -473,7 +477,7 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
(add-hook 'subr-tests--hook 'f7 90)
(add-hook 'subr-tests--hook 'f8 t)
(should (equal subr-tests--hook '(f5 f6 f2 f1 f4 f3 f7 f8)))
- ;; Make sue `nil' is equivalent to 0.
+ ;; Make sure `nil' is equivalent to 0.
(add-hook 'subr-tests--hook 'f9 0)
(add-hook 'subr-tests--hook 'f10)
(should (equal subr-tests--hook '(f5 f10 f9 f6 f2 f1 f4 f3 f7 f8)))
@@ -531,7 +535,8 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
(should (equal (string-replace "a" "aa" "aaa") "aaaaaa"))
(should (equal (string-replace "abc" "defg" "abc") "defg"))
- (should-error (string-replace "" "x" "abc")))
+ (should (equal (should-error (string-replace "" "x" "abc"))
+ '(wrong-length-argument 0))))
(ert-deftest subr-replace-regexp-in-string ()
(should (equal (replace-regexp-in-string "a+" "xy" "abaabbabaaba")
@@ -679,5 +684,61 @@ See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19350."
(should (>= (length (apropos-internal "^help" #'commandp)) 15))
(should-not (apropos-internal "^next-line$" #'keymapp)))
+
+(ert-deftest test-buffer-local-boundp ()
+ (let ((buf (generate-new-buffer "boundp")))
+ (with-current-buffer buf
+ (setq-local test-boundp t))
+ (setq test-global-boundp t)
+ (should (buffer-local-boundp 'test-boundp buf))
+ (should-not (buffer-local-boundp 'test-not-boundp buf))
+ (should (buffer-local-boundp 'test-global-boundp buf))))
+
+(ert-deftest test-replace-string-in-region ()
+ (with-temp-buffer
+ (insert "foo bar zot foobar")
+ (should (= (replace-string-in-region "foo" "new" (point-min) (point-max))
+ 2))
+ (should (equal (buffer-string) "new bar zot newbar")))
+
+ (with-temp-buffer
+ (insert "foo bar zot foobar")
+ (should (= (replace-string-in-region "foo" "new" (point-min) 14)
+ 1))
+ (should (equal (buffer-string) "new bar zot foobar")))
+
+ (with-temp-buffer
+ (insert "foo bar zot foobar")
+ (should-error (replace-string-in-region "foo" "new" (point-min) 30)))
+
+ (with-temp-buffer
+ (insert "Foo bar zot foobar")
+ (should (= (replace-string-in-region "Foo" "new" (point-min))
+ 1))
+ (should (equal (buffer-string) "new bar zot foobar"))))
+
+(ert-deftest test-replace-regexp-in-region ()
+ (with-temp-buffer
+ (insert "foo bar zot foobar")
+ (should (= (replace-regexp-in-region "fo+" "new" (point-min) (point-max))
+ 2))
+ (should (equal (buffer-string) "new bar zot newbar")))
+
+ (with-temp-buffer
+ (insert "foo bar zot foobar")
+ (should (= (replace-regexp-in-region "fo+" "new" (point-min) 14)
+ 1))
+ (should (equal (buffer-string) "new bar zot foobar")))
+
+ (with-temp-buffer
+ (insert "foo bar zot foobar")
+ (should-error (replace-regexp-in-region "fo+" "new" (point-min) 30)))
+
+ (with-temp-buffer
+ (insert "Foo bar zot foobar")
+ (should (= (replace-regexp-in-region "Fo+" "new" (point-min))
+ 1))
+ (should (equal (buffer-string) "new bar zot foobar"))))
+
(provide 'subr-tests)
;;; subr-tests.el ends here
diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el
index 503cb5d7aab..50ac370b5b5 100644
--- a/test/lisp/term-tests.el
+++ b/test/lisp/term-tests.el
@@ -56,7 +56,7 @@
first line\r
next line\r\n"))
(should (equal (term-test-screen-from-input 40 12 str)
- (replace-regexp-in-string "\r" "" str)))))
+ (string-replace "\r" "" str)))))
(ert-deftest term-carriage-return ()
(skip-unless (not (memq system-type '(windows-nt ms-dos))))
diff --git a/test/lisp/textmodes/css-mode-tests.el b/test/lisp/textmodes/css-mode-tests.el
index 97f5abf1156..abf85dbff43 100644
--- a/test/lisp/textmodes/css-mode-tests.el
+++ b/test/lisp/textmodes/css-mode-tests.el
@@ -143,20 +143,20 @@
(css-mode)
(insert "body:a")
(let ((completions (css-mode-tests--completions)))
- (should (member "active" completions))
- (should-not (member "disabled" completions))
+ (should (member ":active" completions))
+ (should-not (member ":disabled" completions))
;; Don't include pseudo-elements
- (should-not (member "after" completions)))))
+ (should-not (member "::after" completions)))))
(ert-deftest css-test-complete-pseudo-element ()
(with-temp-buffer
(css-mode)
(insert "body::a")
(let ((completions (css-mode-tests--completions)))
- (should (member "after" completions))
- (should-not (member "disabled" completions))
+ (should (member "::after" completions))
+ (should-not (member "::disabled" completions))
;; Don't include pseudo-classes
- (should-not (member "active" completions)))))
+ (should-not (member ":active" completions)))))
(ert-deftest css-test-complete-at-rule ()
(with-temp-buffer
diff --git a/test/lisp/textmodes/dns-mode-tests.el b/test/lisp/textmodes/dns-mode-tests.el
index 694d683d546..8bc48732c62 100644
--- a/test/lisp/textmodes/dns-mode-tests.el
+++ b/test/lisp/textmodes/dns-mode-tests.el
@@ -25,6 +25,27 @@
(require 'ert)
(require 'dns-mode)
+(ert-deftest dns-mode-tests-dns-mode-soa-increment-serial ()
+ (with-temp-buffer
+ (insert "$TTL 86400
+@ IN SOA ns.icann.org. noc.dns.icann.org. (
+ 2015080302 ;Serial
+ 7200 ;Refresh
+ 3600 ;Retry
+ 1209600 ;Expire
+ 3600 ;Negative response caching TTL\n)")
+ (dns-mode-soa-increment-serial)
+ ;; Number is updated from 2015080302 to the current date
+ ;; (actually, just ensure the year part is later than 2020).
+ (should (string-match "\\$TTL 86400
+@ IN SOA ns.icann.org. noc.dns.icann.org. (
+ 20[2-9][0-9]+ ;Serial
+ 7200 ;Refresh
+ 3600 ;Retry
+ 1209600 ;Expire
+ 3600 ;Negative response caching TTL\n)"
+ (buffer-string)))))
+
;;; IPv6 reverse zones
(ert-deftest dns-mode-ipv6-conversion ()
(let ((address "2001:db8::42"))
diff --git a/test/lisp/textmodes/fill-tests.el b/test/lisp/textmodes/fill-tests.el
index 21efe620999..a4c7f447b59 100644
--- a/test/lisp/textmodes/fill-tests.el
+++ b/test/lisp/textmodes/fill-tests.el
@@ -1,4 +1,4 @@
-;;; fill-test.el --- ERT tests for fill.el -*- lexical-binding: t -*-
+;;; fill-tests.el --- ERT tests for fill.el -*- lexical-binding: t -*-
;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/textmodes/sgml-mode-tests.el b/test/lisp/textmodes/sgml-mode-tests.el
index 697c96c78e5..b4c0186aace 100644
--- a/test/lisp/textmodes/sgml-mode-tests.el
+++ b/test/lisp/textmodes/sgml-mode-tests.el
@@ -204,5 +204,32 @@ The point is set to the beginning of the buffer."
(should (= 1 (- (car (syntax-ppss (1- (point-max))))
(car (syntax-ppss (point-max))))))))
+(ert-deftest sgml-test-brackets ()
+ "Test fontification of apostrophe preceded by paired-bracket character."
+ (let (brackets)
+ (map-char-table
+ (lambda (key value)
+ (setq brackets (cons (list
+ (if (consp key)
+ (list (car key) (cdr key))
+ key)
+ value)
+ brackets)))
+ (unicode-property-table-internal 'paired-bracket))
+ (setq brackets (delete-dups (flatten-tree brackets)))
+ (setq brackets (append brackets (list ?$ ?% ?& ?* ?+ ?/)))
+ (with-temp-buffer
+ (while brackets
+ (let ((char (string (pop brackets))))
+ (insert (concat "<p>" char "'s</p>\n"))))
+ (html-mode)
+ (font-lock-ensure (point-min) (point-max))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (goto-char (next-single-char-property-change (point) 'face))
+ (let ((val (get-text-property (point) 'face)))
+ (when val
+ (should-not (eq val 'font-lock-string-face))))))))
+
(provide 'sgml-mode-tests)
;;; sgml-mode-tests.el ends here
diff --git a/test/lisp/textmodes/tildify-tests.el b/test/lisp/textmodes/tildify-tests.el
index 59c23943304..3ee3cd6fb17 100644
--- a/test/lisp/textmodes/tildify-tests.el
+++ b/test/lisp/textmodes/tildify-tests.el
@@ -1,4 +1,4 @@
-;;; tildify-test.el --- ERT tests for tildify.el -*- lexical-binding: t -*-
+;;; tildify-tests.el --- ERT tests for tildify.el -*- lexical-binding: t -*-
;; Copyright (C) 2014-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index 62a27f09cbd..fba6f21d5dc 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -1,4 +1,4 @@
-;;; thingatpt.el --- tests for thing-at-point. -*- lexical-binding:t -*-
+;;; thingatpt-tests.el --- tests for thing-at-point. -*- lexical-binding:t -*-
;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
@@ -190,4 +190,37 @@ position to retrieve THING.")
(goto-char 2)
(should (eq (symbol-at-point) nil))))
+(defun test--number (number pos)
+ (with-temp-buffer
+ (insert (format "%s\n" number))
+ (goto-char (point-min))
+ (forward-char pos)
+ (number-at-point)))
+
+(ert-deftest test-numbers-none ()
+ (should (equal (test--number "foo" 0) nil)))
+
+(ert-deftest test-numbers-decimal ()
+ (should (equal (test--number "42" 0) 42))
+ (should (equal (test--number "42" 1) 42))
+ (should (equal (test--number "42" 2) 42)))
+
+(ert-deftest test-numbers-hex-lisp ()
+ (should (equal (test--number "#x42" 0) 66))
+ (should (equal (test--number "#x42" 1) 66))
+ (should (equal (test--number "#x42" 2) 66))
+ (should (equal (test--number "#xf00" 0) 3840))
+ (should (equal (test--number "#xf00" 1) 3840))
+ (should (equal (test--number "#xf00" 2) 3840))
+ (should (equal (test--number "#xf00" 3) 3840)))
+
+(ert-deftest test-numbers-hex-c ()
+ (should (equal (test--number "0x42" 0) 66))
+ (should (equal (test--number "0x42" 1) 66))
+ (should (equal (test--number "0x42" 2) 66))
+ (should (equal (test--number "0xf00" 0) 3840))
+ (should (equal (test--number "0xf00" 1) 3840))
+ (should (equal (test--number "0xf00" 2) 3840))
+ (should (equal (test--number "0xf00" 3) 3840)))
+
;;; thingatpt.el ends here
diff --git a/test/lisp/thumbs-tests.el b/test/lisp/thumbs-tests.el
new file mode 100644
index 00000000000..ee096138453
--- /dev/null
+++ b/test/lisp/thumbs-tests.el
@@ -0,0 +1,34 @@
+;;; thumbs-tests.el --- tests for thumbs.el -*- lexical-binding: t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+(require 'thumbs)
+
+(ert-deftest thumbs-tests-thumbsdir/create-if-missing ()
+ (let ((thumbs-thumbsdir (make-temp-file "thumbs-test" t)))
+ (unwind-protect
+ (progn
+ (delete-directory thumbs-thumbsdir)
+ (should (file-directory-p (thumbs-thumbsdir))))
+ (delete-directory thumbs-thumbsdir))))
+
+(provide 'thumbs-tests)
+;;; thumbs-tests.el ends here
diff --git a/test/lisp/time-stamp-tests.el b/test/lisp/time-stamp-tests.el
index 4ae3c1917dd..4e6fbbba923 100644
--- a/test/lisp/time-stamp-tests.el
+++ b/test/lisp/time-stamp-tests.el
@@ -486,7 +486,10 @@
"Test time-stamp format %Y."
(with-time-stamp-test-env
;; implemented since 1997, documented since 2019
- (should (equal (time-stamp-string "%Y" ref-time1) "2006"))))
+ (should (equal (time-stamp-string "%Y" ref-time1) "2006"))
+ ;; numbers do not truncate
+ (should (equal (time-stamp-string "%2Y" ref-time1) "2006"))
+ (should (equal (time-stamp-string "%02Y" ref-time1) "2006"))))
(ert-deftest time-stamp-format-am-pm ()
"Test time-stamp formats for AM and PM strings."
@@ -522,7 +525,7 @@
(should (equal (time-stamp-string "%#Z" ref-time1) utc-abbr)))))
(ert-deftest time-stamp-format-time-zone-offset ()
- "Test time-stamp format %z."
+ "Tests time-stamp legacy format %z and spot tests of new offset format %5z."
(with-time-stamp-test-env
(let ((utc-abbr (format-time-string "%#Z" ref-time1 t)))
;; documented 1995-2019, warned since 2019, will change
@@ -537,10 +540,12 @@
(let ((time-stamp-time-zone "CET-1"))
(should (equal (time-stamp-string "%5z" ref-time1) "+0100")))
;; implemented since 2019, verify that these don't warn
+ ;; See also the "formatz" tests below, which since 2021 test more
+ ;; variants with more offsets.
(should (equal (time-stamp-string "%-z" ref-time1) "+00"))
- (should (equal (time-stamp-string "%_z" ref-time1) "+0000"))
(should (equal (time-stamp-string "%:z" ref-time1) "+00:00"))
(should (equal (time-stamp-string "%::z" ref-time1) "+00:00:00"))
+ (should (equal (time-stamp-string "%9::z" ref-time1) "+00:00:00"))
(should (equal (time-stamp-string "%:::z" ref-time1) "+00"))))
(ert-deftest time-stamp-format-non-date-conversions ()
@@ -586,6 +591,9 @@
(should (equal (time-stamp-string "%(st(u)ff)B" ref-time3) May))
;; escaped parens do not change the nesting level
(should (equal (time-stamp-string "%(st\\)u\\(ff)B" ref-time3) May))
+ ;; incorrectly nested parens do not crash us
+ (should-not (equal (time-stamp-string "%(stuffB" ref-time3) May))
+ (should-not (equal (time-stamp-string "%)B" ref-time3) May))
;; not all punctuation is allowed
(should-not (equal (time-stamp-string "%&B" ref-time3) May)))))
@@ -594,6 +602,41 @@
(with-time-stamp-test-env
(should (equal (time-stamp-string "No percent" ref-time1) "No percent"))))
+(ert-deftest time-stamp-format-multiple-conversions ()
+ "Tests that multiple %-conversions are independent."
+ (with-time-stamp-test-env
+ (let ((Mon (format-time-string "%a" ref-time1 t))
+ (MON (format-time-string "%^a" ref-time1 t))
+ (Monday (format-time-string "%A" ref-time1 t)))
+ ;; change-case flag is independent
+ (should (equal (time-stamp-string "%a.%#a.%a" ref-time1)
+ (concat Mon "." MON "." Mon)))
+ ;; up-case flag is independent
+ (should (equal (time-stamp-string "%a.%^a.%a" ref-time1)
+ (concat Mon "." MON "." Mon)))
+ ;; underscore flag is independent
+ (should (equal (time-stamp-string "%_d.%d.%_d" ref-time1) " 2.02. 2"))
+ (should (equal (time-stamp-string "%_7z.%7z.%_7z" ref-time1)
+ "+000000.+0000 .+000000"))
+ ;; minus flag is independent
+ (should (equal (time-stamp-string "%d.%-d.%d" ref-time1) "02.2.02"))
+ (should (equal (time-stamp-string "%3z.%-3z.%3z" ref-time1)
+ "+0000.+00.+0000"))
+ ;; 0 flag is independent
+ (should (equal (time-stamp-string "%2d.%02d.%2d" ref-time1) " 2.02. 2"))
+ (should (equal (time-stamp-string "%6:::z.%06:::z.%6:::z" ref-time1)
+ "+00 .+00:00.+00 "))
+ ;; field width is independent
+ (should (equal
+ (time-stamp-string "%6Y.%Y.%6Y" ref-time1) " 2006.2006. 2006"))
+ ;; colon modifier is independent
+ (should (equal (time-stamp-string "%a.%:a.%a" ref-time1)
+ (concat Mon "." Monday "." Mon)))
+ (should (equal (time-stamp-string "%5z.%5::z.%5z" ref-time1)
+ "+0000.+00:00:00.+0000"))
+ ;; format letter is independent
+ (should (equal (time-stamp-string "%H:%M" ref-time1) "15:04")))))
+
(ert-deftest time-stamp-format-string-width ()
"Test time-stamp string width modifiers."
(with-time-stamp-test-env
@@ -657,4 +700,408 @@
(should (safe-local-variable-p 'time-stamp-pattern "a string"))
(should-not (safe-local-variable-p 'time-stamp-pattern 17)))
+;;;; Setup for tests of time offset formatting with %z
+
+(defun formatz (format zone)
+ "Uses time FORMAT string to format the offset of ZONE, returning the result.
+FORMAT is \"%z\" or a variation.
+ZONE is as the ZONE argument of the `format-time-string' function."
+ (with-time-stamp-test-env
+ (let ((time-stamp-time-zone zone))
+ ;; Call your favorite time formatter here.
+ ;; For narrower-scope unit testing,
+ ;; instead of calling time-stamp-string here,
+ ;; we could directly call (format-time-offset format zone)
+ (time-stamp-string format)
+ )))
+
+(defun format-time-offset (format offset-secs)
+ "Uses FORMAT to format the time zone represented by OFFSET-SECS.
+FORMAT must be \"%z\", possibly with a flag and padding.
+This function is a wrapper around `time-stamp-formatz-from-parsed-options'
+and is used for testing."
+ ;; This wrapper adds a simple regexp-based parser that handles only
+ ;; %z and variants. In normal use, time-stamp-formatz-from-parsed-options
+ ;; is called from a parser that handles all time string formats.
+ (string-match
+ "\\`\\([^%]*\\)%\\([-_]?\\)\\(0?\\)\\([1-9][0-9]*\\)?\\([EO]?\\)\\(:*\\)\\([^a-zA-Z]+\\)?z\\(.*\\)"
+ format)
+ (let ((leading-string (match-string 1 format))
+ (flag-minimize (seq-find (lambda (x) (eq x ?-))
+ (match-string 2 format)))
+ (flag-pad-with-spaces (seq-find (lambda (x) (eq x ?_))
+ (match-string 2 format)))
+ (flag-pad-with-zeros (equal (match-string 3 format) "0"))
+ (field-width (string-to-number (or (match-string 4 format) "")))
+ (colon-count (length (match-string 6 format)))
+ (garbage (match-string 7 format))
+ (trailing-string (match-string 8 format)))
+ (concat leading-string
+ (if garbage
+ ""
+ (time-stamp-formatz-from-parsed-options flag-minimize
+ flag-pad-with-spaces
+ flag-pad-with-zeros
+ colon-count
+ field-width
+ offset-secs))
+ trailing-string)))
+
+(defun fz-make+zone (h &optional m s)
+ "Creates a non-negative offset."
+ (let ((m (or m 0))
+ (s (or s 0)))
+ (+ (* 3600 h) (* 60 m) s)))
+
+(defun fz-make-zone (h &optional m s)
+ "Creates a negative offset. The arguments are all non-negative."
+ (- (fz-make+zone h m s)))
+
+(defmacro formatz-should-equal (zone expect)
+ "Formats ZONE and compares it to EXPECT.
+Uses the free variables `form-string' and `pattern-mod'.
+The functions in `pattern-mod' are composed left to right."
+ `(let ((result ,expect))
+ (dolist (fn pattern-mod)
+ (setq result (funcall fn result)))
+ (should (equal (formatz form-string ,zone) result))))
+
+;; These test cases have zeros in all places (first, last, none, both)
+;; for hours, minutes, and seconds.
+
+(defun formatz-hours-exact-helper (form-string pattern-mod)
+ "Tests format %z with whole hours."
+ (formatz-should-equal (fz-make+zone 0) "+00") ;0 sign always +, both digits
+ (formatz-should-equal (fz-make+zone 10) "+10")
+ (formatz-should-equal (fz-make-zone 10) "-10")
+ (formatz-should-equal (fz-make+zone 2) "+02")
+ (formatz-should-equal (fz-make-zone 2) "-02")
+ (formatz-should-equal (fz-make+zone 13) "+13")
+ (formatz-should-equal (fz-make-zone 13) "-13")
+ )
+
+(defun formatz-nonzero-minutes-helper (form-string pattern-mod)
+ "Tests format %z with whole minutes."
+ (formatz-should-equal (fz-make+zone 0 30) "+00:30") ;has hours even though 0
+ (formatz-should-equal (fz-make-zone 0 30) "-00:30")
+ (formatz-should-equal (fz-make+zone 0 4) "+00:04")
+ (formatz-should-equal (fz-make-zone 0 4) "-00:04")
+ (formatz-should-equal (fz-make+zone 8 40) "+08:40")
+ (formatz-should-equal (fz-make-zone 8 40) "-08:40")
+ (formatz-should-equal (fz-make+zone 0 15) "+00:15")
+ (formatz-should-equal (fz-make-zone 0 15) "-00:15")
+ (formatz-should-equal (fz-make+zone 11 30) "+11:30")
+ (formatz-should-equal (fz-make-zone 11 30) "-11:30")
+ (formatz-should-equal (fz-make+zone 3 17) "+03:17")
+ (formatz-should-equal (fz-make-zone 3 17) "-03:17")
+ (formatz-should-equal (fz-make+zone 12 45) "+12:45")
+ (formatz-should-equal (fz-make-zone 12 45) "-12:45")
+ )
+
+(defun formatz-nonzero-seconds-helper (form-string pattern-mod)
+ "Tests format %z with non-0 seconds."
+ ;; non-0 seconds are always included
+ (formatz-should-equal (fz-make+zone 0 0 50) "+00:00:50")
+ (formatz-should-equal (fz-make-zone 0 0 50) "-00:00:50")
+ (formatz-should-equal (fz-make+zone 0 0 06) "+00:00:06")
+ (formatz-should-equal (fz-make-zone 0 0 06) "-00:00:06")
+ (formatz-should-equal (fz-make+zone 0 7 50) "+00:07:50")
+ (formatz-should-equal (fz-make-zone 0 7 50) "-00:07:50")
+ (formatz-should-equal (fz-make+zone 0 0 16) "+00:00:16")
+ (formatz-should-equal (fz-make-zone 0 0 16) "-00:00:16")
+ (formatz-should-equal (fz-make+zone 0 12 36) "+00:12:36")
+ (formatz-should-equal (fz-make-zone 0 12 36) "-00:12:36")
+ (formatz-should-equal (fz-make+zone 0 3 45) "+00:03:45")
+ (formatz-should-equal (fz-make-zone 0 3 45) "-00:03:45")
+ (formatz-should-equal (fz-make+zone 8 45 30) "+08:45:30")
+ (formatz-should-equal (fz-make-zone 8 45 30) "-08:45:30")
+ (formatz-should-equal (fz-make+zone 0 11 45) "+00:11:45")
+ (formatz-should-equal (fz-make-zone 0 11 45) "-00:11:45")
+ (formatz-should-equal (fz-make+zone 3 20 15) "+03:20:15")
+ (formatz-should-equal (fz-make-zone 3 20 15) "-03:20:15")
+ (formatz-should-equal (fz-make+zone 11 14 30) "+11:14:30")
+ (formatz-should-equal (fz-make-zone 11 14 30) "-11:14:30")
+ (formatz-should-equal (fz-make+zone 12 30 49) "+12:30:49")
+ (formatz-should-equal (fz-make-zone 12 30 49) "-12:30:49")
+ (formatz-should-equal (fz-make+zone 12 0 34) "+12:00:34")
+ (formatz-should-equal (fz-make-zone 12 0 34) "-12:00:34")
+ )
+
+(defun formatz-hours-big-helper (form-string pattern-mod)
+ "Tests format %z with hours that don't fit in two digits."
+ (formatz-should-equal (fz-make+zone 101) "+101:00")
+ (formatz-should-equal (fz-make+zone 123 10) "+123:10")
+ (formatz-should-equal (fz-make-zone 123 10) "-123:10")
+ (formatz-should-equal (fz-make+zone 123 2) "+123:02")
+ (formatz-should-equal (fz-make-zone 123 2) "-123:02")
+ )
+
+(defun formatz-seconds-big-helper (form-string pattern-mod)
+ "Tests format %z with hours greater than 99 and non-zero seconds."
+ (formatz-should-equal (fz-make+zone 123 0 30) "+123:00:30")
+ (formatz-should-equal (fz-make-zone 123 0 30) "-123:00:30")
+ (formatz-should-equal (fz-make+zone 120 0 4) "+120:00:04")
+ (formatz-should-equal (fz-make-zone 120 0 4) "-120:00:04")
+ )
+
+;; Functions that modify the expected output string, so that we can
+;; use the above test cases for multiple formats.
+
+(defun formatz-mod-del-colons (string)
+ "Returns STRING with any colons removed."
+ (string-replace ":" "" string))
+
+(defun formatz-mod-add-00 (string)
+ "Returns STRING with \"00\" appended."
+ (concat string "00"))
+
+(defun formatz-mod-add-colon00 (string)
+ "Returns STRING with \":00\" appended."
+ (concat string ":00"))
+
+(defun formatz-mod-pad-r10 (string)
+ "Returns STRING padded on the right to 10 characters."
+ (concat string (make-string (- 10 (length string)) ?\s)))
+
+(defun formatz-mod-pad-r12 (string)
+ "Returns STRING padded on the right to 12 characters."
+ (concat string (make-string (- 12 (length string)) ?\s)))
+
+;; Convenience macro for generating groups of test cases.
+
+(defmacro formatz-generate-tests
+ (form-strings hour-mod mins-mod secs-mod big-mod secbig-mod)
+ "Defines ert-deftest tests for time formats FORM-STRINGS.
+FORM-STRINGS is a list of formats, each \"%z\" or some variation thereof.
+
+Each of the remaining arguments is an unquoted list of the form
+(SAMPLE-OUTPUT . MODIFIERS). SAMPLE-OUTPUT is the result of the
+FORM-STRINGS for a particular offset, detailed below for each argument.
+The remaining elements of the list, the MODIFIERS, are the names of
+functions to modify the expected results for sets of tests.
+The MODIFIERS do not modify the SAMPLE-OUTPUT.
+
+The one, literal sample output is given in the call to this macro
+to provide a visual check at the call site that the format
+behaves as expected.
+
+HOUR-MOD is the result for offset 0 and modifiers for the other
+expected results for whole hours.
+MINS-MOD is the result for offset +30 minutes and modifiers for the
+other expected results for whole minutes.
+SECS-MOD is the result for offset +30 seconds and modifiers for the
+other expected results for offsets with non-zero seconds.
+BIG-MOD is the result for offset +100 hours and modifiers for the other
+expected results for hours greater than 99 with a whole number of minutes.
+SECBIG-MOD is the result for offset +100 hours 30 seconds and modifiers for
+the other expected results for hours greater than 99 with non-zero seconds."
+ (declare (indent 1))
+ ;; Generate a form to create a list of tests to define. When this
+ ;; macro is called, the form is evaluated, thus defining the tests.
+ (let ((ert-test-list '(list)))
+ (dolist (form-string form-strings ert-test-list)
+ (nconc
+ ert-test-list
+ (list
+ `(ert-deftest ,(intern (concat "formatz-" form-string "-hhmm")) ()
+ ,(concat "Tests time-stamp format " form-string
+ " with whole hours or minutes.")
+ (should (equal (formatz ,form-string (fz-make+zone 0))
+ ,(car hour-mod)))
+ (formatz-hours-exact-helper ,form-string ',(cdr hour-mod))
+ (should (equal (formatz ,form-string (fz-make+zone 0 30))
+ ,(car mins-mod)))
+ (formatz-nonzero-minutes-helper ,form-string ',(cdr mins-mod)))
+ `(ert-deftest ,(intern (concat "formatz-" form-string "-seconds")) ()
+ ,(concat "Tests time-stamp format " form-string
+ " with offsets that have non-zero seconds.")
+ (should (equal (formatz ,form-string (fz-make+zone 0 0 30))
+ ,(car secs-mod)))
+ (formatz-nonzero-seconds-helper ,form-string ',(cdr secs-mod)))
+ `(ert-deftest ,(intern (concat "formatz-" form-string "-threedigit")) ()
+ ,(concat "Tests time-stamp format " form-string
+ " with offsets that are 100 hours or greater.")
+ (should (equal (formatz ,form-string (fz-make+zone 100))
+ ,(car big-mod)))
+ (formatz-hours-big-helper ,form-string ',(cdr big-mod))
+ (should (equal (formatz ,form-string (fz-make+zone 100 0 30))
+ ,(car secbig-mod)))
+ (formatz-seconds-big-helper ,form-string ',(cdr secbig-mod)))
+ )))))
+
+;;;; The actual test cases for %z
+
+;;; %z formats without colons.
+
+;; Option character "-" (minus) minimizes; it removes "00" minutes.
+(formatz-generate-tests ("%-z" "%-3z")
+ ("+00")
+ ("+0030" formatz-mod-del-colons)
+ ("+000030" formatz-mod-del-colons)
+ ("+100:00")
+ ("+100:00:30"))
+;; Tests that minus with padding pads with spaces.
+(formatz-generate-tests ("%-12z")
+ ("+00 " formatz-mod-pad-r12)
+ ("+0030 " formatz-mod-del-colons formatz-mod-pad-r12)
+ ("+000030 " formatz-mod-del-colons formatz-mod-pad-r12)
+ ("+100:00 " formatz-mod-pad-r12)
+ ("+100:00:30 " formatz-mod-pad-r12))
+;; Tests that 0 after other digits becomes padding of ten, not zero flag.
+(formatz-generate-tests ("%-10z")
+ ("+00 " formatz-mod-pad-r10)
+ ("+0030 " formatz-mod-del-colons formatz-mod-pad-r10)
+ ("+000030 " formatz-mod-del-colons formatz-mod-pad-r10)
+ ("+100:00 " formatz-mod-pad-r10)
+ ("+100:00:30"))
+
+;; Although time-stamp doesn't call us for %z, we do want to spot-check
+;; it here, to verify the implementation we will eventually use.
+;; The legacy exception for %z in time-stamp will need to remain
+;; through at least 2024 and Emacs 28.
+(ert-deftest formatz-%z-spotcheck ()
+ "Spot-checks internal implementation of time-stamp format %z."
+ (should (equal (format-time-offset "%z" (fz-make+zone 0)) "+0000"))
+ (should (equal (format-time-offset "%z" (fz-make+zone 0 30)) "+0030"))
+ (should (equal (format-time-offset "%z" (fz-make+zone 0 0 30)) "+000030"))
+ (should (equal (format-time-offset "%z" (fz-make+zone 100)) "+100:00"))
+ (should (equal (format-time-offset "%z" (fz-make+zone 100 0 30)) "+100:00:30"))
+ )
+
+;; Basic %z outputs 4 digits.
+;; Small padding values do not extend the result.
+(formatz-generate-tests (;; We don't check %z here because time-stamp
+ ;; has a legacy behavior for it.
+ ;;"%z"
+ "%5z" "%0z" "%05z")
+ ("+0000" formatz-mod-add-00)
+ ("+0030" formatz-mod-del-colons)
+ ("+000030" formatz-mod-del-colons)
+ ("+100:00")
+ ("+100:00:30"))
+
+;; Tests that padding adds spaces.
+(formatz-generate-tests ("%12z")
+ ("+0000 " formatz-mod-add-00 formatz-mod-pad-r12)
+ ("+0030 " formatz-mod-del-colons formatz-mod-pad-r12)
+ ("+000030 " formatz-mod-del-colons formatz-mod-pad-r12)
+ ("+100:00 " formatz-mod-pad-r12)
+ ("+100:00:30 " formatz-mod-pad-r12))
+
+;; Requiring 0-padding to 6 adds seconds (only) as needed.
+(formatz-generate-tests ("%06z")
+ ("+000000" formatz-mod-add-00 formatz-mod-add-00)
+ ("+003000" formatz-mod-del-colons formatz-mod-add-00)
+ ("+000030" formatz-mod-del-colons)
+ ("+100:00")
+ ("+100:00:30"))
+
+;; Option character "_" always adds seconds.
+(formatz-generate-tests ("%_z" "%_7z")
+ ("+000000" formatz-mod-add-00 formatz-mod-add-00)
+ ("+003000" formatz-mod-del-colons formatz-mod-add-00)
+ ("+000030" formatz-mod-del-colons)
+ ("+100:00:00" formatz-mod-add-colon00)
+ ("+100:00:30"))
+
+;; Enough 0-padding adds seconds, then adds spaces.
+(formatz-generate-tests ("%012z" "%_12z")
+ ("+000000 " formatz-mod-add-00 formatz-mod-add-00 formatz-mod-pad-r12)
+ ("+003000 " formatz-mod-del-colons formatz-mod-add-00 formatz-mod-pad-r12)
+ ("+000030 " formatz-mod-del-colons formatz-mod-pad-r12)
+ ("+100:00:00 " formatz-mod-add-colon00 formatz-mod-pad-r12)
+ ("+100:00:30 " formatz-mod-pad-r12))
+
+;;; %z formats with colons
+
+;; Three colons can output hours only,
+;; like %-z, but uses colons with non-zero minutes and seconds.
+(formatz-generate-tests ("%:::z" "%0:::z"
+ "%3:::z" "%03:::z")
+ ("+00")
+ ("+00:30")
+ ("+00:00:30")
+ ("+100:00")
+ ("+100:00:30"))
+
+;; Padding with three colons adds spaces
+(formatz-generate-tests ("%12:::z")
+ ("+00 " formatz-mod-pad-r12)
+ ("+00:30 " formatz-mod-pad-r12)
+ ("+00:00:30 " formatz-mod-pad-r12)
+ ("+100:00 " formatz-mod-pad-r12)
+ ("+100:00:30 " formatz-mod-pad-r12))
+;; Tests that 0 after other digits becomes padding of ten, not zero flag.
+(formatz-generate-tests ("%10:::z")
+ ("+00 " formatz-mod-pad-r10)
+ ("+00:30 " formatz-mod-pad-r10)
+ ("+00:00:30 " formatz-mod-pad-r10)
+ ("+100:00 " formatz-mod-pad-r10)
+ ("+100:00:30"))
+
+;; One colon outputs minutes, like %z but with colon.
+(formatz-generate-tests ("%:z" "%6:z" "%0:z" "%06:z" "%06:::z")
+ ("+00:00" formatz-mod-add-colon00)
+ ("+00:30")
+ ("+00:00:30")
+ ("+100:00")
+ ("+100:00:30"))
+
+;; Padding with one colon adds spaces
+(formatz-generate-tests ("%12:z")
+ ("+00:00 " formatz-mod-add-colon00 formatz-mod-pad-r12)
+ ("+00:30 " formatz-mod-pad-r12)
+ ("+00:00:30 " formatz-mod-pad-r12)
+ ("+100:00 " formatz-mod-pad-r12)
+ ("+100:00:30 " formatz-mod-pad-r12))
+
+;; Requiring 0-padding to 7 adds seconds (only) as needed.
+(formatz-generate-tests ("%07:z" "%07:::z")
+ ("+00:00:00" formatz-mod-add-colon00 formatz-mod-add-colon00)
+ ("+00:30:00" formatz-mod-add-colon00)
+ ("+00:00:30")
+ ("+100:00")
+ ("+100:00:30"))
+
+;; Two colons outputs HH:MM:SS, like %_z but with colons.
+(formatz-generate-tests ("%::z" "%9::z" "%0::z" "%09::z")
+ ("+00:00:00" formatz-mod-add-colon00 formatz-mod-add-colon00)
+ ("+00:30:00" formatz-mod-add-colon00)
+ ("+00:00:30")
+ ("+100:00:00" formatz-mod-add-colon00)
+ ("+100:00:30"))
+
+;; Enough padding adds minutes and seconds, then adds spaces.
+(formatz-generate-tests ("%012:z" "%012::z" "%12::z" "%012:::z")
+ ("+00:00:00 " formatz-mod-add-colon00 formatz-mod-add-colon00
+ formatz-mod-pad-r12)
+ ("+00:30:00 " formatz-mod-add-colon00 formatz-mod-pad-r12)
+ ("+00:00:30 " formatz-mod-pad-r12)
+ ("+100:00:00 " formatz-mod-add-colon00 formatz-mod-pad-r12)
+ ("+100:00:30 " formatz-mod-pad-r12))
+
+;;; Illegal %z formats
+
+(ert-deftest formatz-illegal-options ()
+ "Tests that illegal/nonsensical/ambiguous %z formats don't produce output."
+ ;; multiple options
+ (should (equal "" (formatz "%_-z" 0)))
+ (should (equal "" (formatz "%-_z" 0)))
+ (should (equal "" (formatz "%_0z" 0)))
+ (should (equal "" (formatz "%0_z" 0)))
+ (should (equal "" (formatz "%0-z" 0)))
+ (should (equal "" (formatz "%-0z" 0)))
+ ;; inconsistent to both minimize and require mins or secs
+ (should (equal "" (formatz "%-:z" 0)))
+ (should (equal "" (formatz "%-::z" 0)))
+ ;; consistent, but redundant
+ (should (equal "" (formatz "%-:::z" 0)))
+ (should (equal "" (formatz "%_::z" 0)))
+ ;; inconsistent to both pre-expand and default to hours or mins
+ (should (equal "" (formatz "%_:::z" 0)))
+ (should (equal "" (formatz "%_:z" 0)))
+ ;; options that don't make sense with %z
+ (should (equal "" (formatz "%#z" 0)))
+ )
+
;;; time-stamp-tests.el ends here
diff --git a/test/lisp/time-tests.el b/test/lisp/time-tests.el
index 3cf8b540cbc..88b7638d91d 100644
--- a/test/lisp/time-tests.el
+++ b/test/lisp/time-tests.el
@@ -50,6 +50,7 @@
(? (| "AM" "PM"))
" " (+ (| digit "."))
(? " Mail")
+ " "
string-end)
display-time-string))))
diff --git a/test/lisp/vc/diff-mode-tests.el b/test/lisp/vc/diff-mode-tests.el
index f4e5c89afb4..fefe50d5173 100644
--- a/test/lisp/vc/diff-mode-tests.el
+++ b/test/lisp/vc/diff-mode-tests.el
@@ -203,6 +203,148 @@ youthfulness
(kill-buffer buf2)
(delete-directory temp-dir 'recursive))))))
+(ert-deftest diff-mode-test-hunk-text-no-newline ()
+ "Check output of `diff-hunk-text' with no newline at end of file."
+
+ ;; First check unified change/remove/add cases with newline
+ (let ((hunk "\
+@@ -1 +1 @@
+-foo
++bar
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo
+"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar
+")))
+
+ (let ((hunk "\
+@@ -1 +0,0 @@
+-foo
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo
+"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+")))
+
+ (let ((hunk "\
+@@ -0,0 +1 @@
++bar
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar
+")))
+
+ ;; Check unified change/remove cases with no newline in old file
+ (let ((hunk "\
+@@ -1 +1 @@
+-foo
+\\ No newline at end of file
++bar
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar
+")))
+
+ (let ((hunk "\
+@@ -1 +0,0 @@
+-foo
+\\ No newline at end of file
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+")))
+
+ ;; Check unified change/add cases with no newline in new file
+ (let ((hunk "\
+@@ -1 +1 @@
+-foo
++bar
+\\ No newline at end of file
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo
+"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar")))
+
+ (let ((hunk "\
+@@ -0,0 +1 @@
++bar
+\\ No newline at end of file
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar")))
+
+ ;; Check unified change case with no newline in both old/new file
+ (let ((hunk "\
+@@ -1 +1 @@
+-foo
+\\ No newline at end of file
++bar
+\\ No newline at end of file
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar")))
+
+ ;; Check context-after unified change case with no newline in both old/new file
+ (let ((hunk "\
+@@ -1,2 +1,2 @@
+-foo
++bar
+ baz
+\\ No newline at end of file
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo
+baz"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar
+baz")))
+
+ (let ((hunk "\
+@@ -1,2 +1,2 @@
+-foo
+-baz
+\\ No newline at end of file
++bar
++baz
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo
+baz"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar
+baz
+")))
+
+ (let ((hunk "\
+@@ -1,2 +1,2 @@
+-foo
+-baz
++bar
++baz
+\\ No newline at end of file
+"))
+ (should (equal (diff-hunk-text hunk nil nil) "\
+foo
+baz
+"))
+ (should (equal (diff-hunk-text hunk t nil) "\
+bar
+baz"))))
+
(ert-deftest diff-mode-test-font-lock ()
"Check font-locking of diff hunks."
;; See comments in diff-hunk-file-names about nonascii.
@@ -326,4 +468,16 @@ youthfulness
(114 131 (diff-mode syntax face font-lock-string-face))
(134 140 (diff-mode syntax face font-lock-keyword-face))))))))
+(ert-deftest test-hunk-file-names ()
+ (with-temp-buffer
+ (insert "diff -c /tmp/ange-ftp13518wvE.el /tmp/ange-ftp1351895K.el\n")
+ (goto-char (point-min))
+ (should (equal (diff-hunk-file-names)
+ '("/tmp/ange-ftp1351895K.el" "/tmp/ange-ftp13518wvE.el"))))
+ (with-temp-buffer
+ (insert "diff -c -L /ftp:slbhao:/home/albinus/src/tramp/lisp/tramp.el -L /ftp:slbhao:/home/albinus/src/emacs/lisp/net/tramp.el /tmp/ange-ftp13518wvE.el /tmp/ange-ftp1351895K.el\n")
+ (goto-char (point-min))
+ (should (equal (diff-hunk-file-names)
+ '("/tmp/ange-ftp1351895K.el" "/tmp/ange-ftp13518wvE.el")))))
+
(provide 'diff-mode-tests)
diff --git a/test/lisp/vc/vc-bzr-tests.el b/test/lisp/vc/vc-bzr-tests.el
index aeab51ec261..b02dce8f707 100644
--- a/test/lisp/vc/vc-bzr-tests.el
+++ b/test/lisp/vc/vc-bzr-tests.el
@@ -1,4 +1,4 @@
-;;; vc-bzr.el --- tests for vc/vc-bzr.el -*- lexical-binding: t -*-
+;;; vc-bzr-tests.el --- tests for vc/vc-bzr.el -*- lexical-binding: t -*-
;; Copyright (C) 2011-2021 Free Software Foundation, Inc.
diff --git a/test/lisp/wdired-tests.el b/test/lisp/wdired-tests.el
index ba276e24d96..96a01fc2c7b 100644
--- a/test/lisp/wdired-tests.el
+++ b/test/lisp/wdired-tests.el
@@ -31,7 +31,7 @@ Partially modifying a file name should succeed."
(let* ((test-dir (make-temp-file "test-dir-" t))
(test-file (concat (file-name-as-directory test-dir) "foo.c"))
(replace "bar")
- (new-file (replace-regexp-in-string "foo" replace test-file))
+ (new-file (string-replace "foo" replace test-file))
(wdired-use-interactive-rename t))
(write-region "" nil test-file nil 'silent)
(advice-add 'dired-query ; Don't ask confirmation to overwrite a file.
@@ -109,7 +109,7 @@ wdired-mode."
(let* ((test-dir (make-temp-file "test-dir-" t))
(test-file (concat (file-name-as-directory test-dir) "foo.c"))
(replace "bar")
- (new-file (replace-regexp-in-string "foo" replace test-file)))
+ (new-file (string-replace "foo" replace test-file)))
(write-region "" nil test-file nil 'silent)
(let ((buf (find-file-noselect test-dir)))
(unwind-protect
diff --git a/test/lisp/xml-tests.el b/test/lisp/xml-tests.el
index cd3e1138f4b..b00b58acfc5 100644
--- a/test/lisp/xml-tests.el
+++ b/test/lisp/xml-tests.el
@@ -1,4 +1,4 @@
-;;; xml-parse-tests.el --- Test suite for XML parsing. -*- lexical-binding:t -*-
+;;; xml-tests.el --- Test suite for XML parsing. -*- lexical-binding:t -*-
;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
diff --git a/test/manual/biditest.el b/test/manual/biditest.el
index dc78ef55b03..a77fc158807 100644
--- a/test/manual/biditest.el
+++ b/test/manual/biditest.el
@@ -1,4 +1,4 @@
-;;; biditest.el --- test bidi reordering in GNU Emacs display engine.
+;;; biditest.el --- test bidi reordering in GNU Emacs display engine. -*- lexical-binding: t; -*-
;; Copyright (C) 2013-2021 Free Software Foundation, Inc.
@@ -54,7 +54,7 @@ The resulting file should be viewed with `inhibit-bidi-mirroring' set to t."
(resolved-paragraph (match-string 3))
;; FIXME: Should compare LEVELS with what the display
;; engine actually produced.
- (levels (match-string 4))
+ ;;(levels (match-string 4))
(indices (match-string 5)))
(setq codes (split-string codes " ")
indices (split-string indices " "))
@@ -120,4 +120,4 @@ BidiCharacterTest.txt file."
(interactive)
(message "%s" (bidi-resolved-levels)))
-(define-key global-map [f8] 'bidi-levels)
+(define-key global-map [f8] #'bidi-levels)
diff --git a/test/manual/cedet/cedet-utests.el b/test/manual/cedet/cedet-utests.el
index 7805fce2d12..d68b5b8c090 100644
--- a/test/manual/cedet/cedet-utests.el
+++ b/test/manual/cedet/cedet-utests.el
@@ -1,4 +1,4 @@
-;;; cedet-utests.el --- Run all unit tests in the CEDET suite.
+;;; cedet-utests.el --- Run all unit tests in the CEDET suite. -*- lexical-binding: t; -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
@@ -26,7 +26,6 @@
;; into one command.
(require 'cedet)
-(require 'inversion)
(defvar cedet-utest-directory
(let* ((C (file-name-directory (locate-library "cedet")))
@@ -36,7 +35,6 @@
(defvar cedet-utest-libs '("ede-tests"
"semantic-tests"
- "srecode-tests"
)
"List of test srcs that need to be loaded.")
@@ -48,7 +46,7 @@
;;
;; Test inversion
- ("inversion" . inversion-unit-test)
+ ;; ("inversion" . inversion-unit-test) ; moved to automated suite
;; EZ Image dumping.
("ezimage associations" . ezimage-image-association-dump)
@@ -60,7 +58,7 @@
("pulse interactive test" . (lambda () (pulse-test t)))
;; Files
- ("cedet file conversion" . cedet-files-utest)
+ ;; ("cedet file conversion" . cedet-files-utest) ; moved to automated suite
;;
;; EIEIO
@@ -100,14 +98,14 @@
(message " ** Skipping test in noninteractive mode.")
(semantic-test-throw-on-input))))
- ;;("semantic: gcc: output parse test" . semantic-gcc-test-output-parser)
+ ;;("semantic: gcc: output parse test" . semantic-gcc-test-output-parser) ; moved to automated suite
;;
;; SRECODE
;;
;; TODO - fix the fields test
- ;;("srecode: fields" . srecode-field-utest)
+ ;;("srecode: fields" . srecode-field-utest) ; moved to automated suite
;;("srecode: templates" . srecode-utest-template-output)
("srecode: show maps" . srecode-get-maps)
;;("srecode: getset" . srecode-utest-getset-output)
@@ -122,9 +120,9 @@
EXIT-ON-ERROR causes the test suite to exit on an error, instead
of just logging the error."
(interactive)
- (if (or (not (featurep 'semantic/db-mode))
- (not (semanticdb-minor-mode-p)))
- (error "CEDET Tests require semantic-mode to be enabled"))
+ (unless (and (fboundp 'semanticdb-minor-mode-p)
+ (semanticdb-minor-mode-p))
+ (error "CEDET Tests require semantic-mode to be enabled"))
(dolist (L cedet-utest-libs)
(load-file (expand-file-name (concat L ".el") cedet-utest-directory)))
(cedet-utest-log-setup "ALL TESTS")
@@ -172,6 +170,8 @@ of just logging the error."
(declare (obsolete nil "27.1"))
noninteractive)
+(defvar srecode-map-save-file)
+
;;;###autoload
(defun cedet-utest-batch ()
"Run the CEDET unit test in BATCH mode."
@@ -180,6 +180,7 @@ of just logging the error."
(condition-case err
(when (catch 'cedet-utest-exit-on-error
;; Get basic semantic features up.
+ ;; FIXME: I can't see any such function in our code!
(semantic-load-enable-minimum-features)
;; Disables all caches related to semantic DB so all
;; tests run as if we have bootstrapped CEDET for the
@@ -233,8 +234,7 @@ Optional argument TITLE is the title of this testing session."
(setq cedet-utest-frame (make-frame cedet-utest-frame-parameters)))
(when (or (not cedet-utest-buffer) (not (buffer-live-p cedet-utest-buffer)))
(setq cedet-utest-buffer (get-buffer-create "*CEDET utest log*")))
- (save-excursion
- (set-buffer cedet-utest-buffer)
+ (with-current-buffer cedet-utest-buffer
(setq cedet-utest-last-log-item nil)
(when (not cedet-running-master-tests)
(erase-buffer))
@@ -256,7 +256,7 @@ Argument START and END bound the time being calculated."
(- (car (cdr end)) (car (cdr start)))
(/ (- (car (cdr (cdr end))) (car (cdr (cdr start)))) 1000000.0)))
-(defun cedet-utest-log-shutdown (title &optional errorcondition)
+(defun cedet-utest-log-shutdown (title &optional _errorcondition)
"Shut-down a larger test suite.
TITLE is the section that is done.
ERRORCONDITION is some error that may have occurred during testing."
@@ -276,8 +276,7 @@ ERRORCONDITION is some error that may have occurred during testing."
(message " Elapsed Time %.2f Seconds\n"
(cedet-utest-elapsed-time startime endtime)))
- (save-excursion
- (set-buffer cedet-utest-buffer)
+ (with-current-buffer cedet-utest-buffer
(goto-char (point-max))
(insert "\n>> Test Suite " title " ended at @ "
(format-time-string "%c" endtime) "\n"
@@ -307,12 +306,11 @@ ERRORCONDITION is some error that may have occurred during testing."
"Hook run after the current log command was run."
(if noninteractive
(message "")
- (save-excursion
- (set-buffer cedet-utest-buffer)
+ (with-current-buffer cedet-utest-buffer
(goto-char (point-max))
(insert "\n\n")))
(setq cedet-utest-last-log-item nil)
- (remove-hook 'post-command-hook 'cedet-utest-post-command-hook)
+ (remove-hook 'post-command-hook #'cedet-utest-post-command-hook)
)
(defun cedet-utest-add-log-item-start (item)
@@ -320,12 +318,11 @@ ERRORCONDITION is some error that may have occurred during testing."
(unless (equal item cedet-utest-last-log-item)
(setq cedet-utest-last-log-item item)
;; This next line makes sure we clear out status during logging.
- (add-hook 'post-command-hook 'cedet-utest-post-command-hook)
+ (add-hook 'post-command-hook #'cedet-utest-post-command-hook)
(if noninteractive
(message " - Running %s ..." item)
- (save-excursion
- (set-buffer cedet-utest-buffer)
+ (with-current-buffer cedet-utest-buffer
(goto-char (point-max))
(when (not (bolp)) (insert "\n"))
(insert "Running " item " ... ")
@@ -345,8 +342,7 @@ Optional argument PRECR indicates to prefix the done msg w/ a newline."
(message " * %s {%s}" (or err "done") notes)
(message " * %s" (or err "done")))
;; Interactive-mode - insert into the buffer.
- (save-excursion
- (set-buffer cedet-utest-buffer)
+ (with-current-buffer cedet-utest-buffer
(goto-char (point-max))
(when precr (insert "\n"))
(if err
@@ -376,126 +372,36 @@ Optional argument PRECR indicates to prefix the done msg w/ a newline."
(cedet-utest-add-log-item-start testname)
))
-(defun cedet-utest-log(format &rest args)
+(defun cedet-utest-log (format &rest args)
"Log the text string FORMAT.
The rest of the ARGS are used to fill in FORMAT with `format'."
(if noninteractive
- (apply 'message format args)
- (save-excursion
- (set-buffer cedet-utest-buffer)
+ (apply #'message format args)
+ (with-current-buffer cedet-utest-buffer
(goto-char (point-max))
(when (not (bolp)) (insert "\n"))
- (insert (apply 'format format args))
+ (insert (apply #'format format args))
(insert "\n")
(sit-for 0)
))
(cedet-utest-show-log-end)
)
-;;; Inversion tests
-
-(defun inversion-unit-test ()
- "Test inversion to make sure it can identify different version strings."
- (interactive)
- (let ((c1 (inversion-package-version 'inversion))
- (c1i (inversion-package-incompatibility-version 'inversion))
- (c2 (inversion-decode-version "1.3alpha2"))
- (c3 (inversion-decode-version "1.3beta4"))
- (c4 (inversion-decode-version "1.3 beta5"))
- (c5 (inversion-decode-version "1.3.4"))
- (c6 (inversion-decode-version "2.3alpha"))
- (c7 (inversion-decode-version "1.3"))
- (c8 (inversion-decode-version "1.3pre1"))
- (c9 (inversion-decode-version "2.4 (patch 2)"))
- (c10 (inversion-decode-version "2.4 (patch 3)"))
- (c11 (inversion-decode-version "2.4.2.1"))
- (c12 (inversion-decode-version "2.4.2.2"))
- )
- (if (not (and
- (inversion-= c1 c1)
- (inversion-< c1i c1)
- (inversion-< c2 c3)
- (inversion-< c3 c4)
- (inversion-< c4 c5)
- (inversion-< c5 c6)
- (inversion-< c2 c4)
- (inversion-< c2 c5)
- (inversion-< c2 c6)
- (inversion-< c3 c5)
- (inversion-< c3 c6)
- (inversion-< c7 c6)
- (inversion-< c4 c7)
- (inversion-< c2 c7)
- (inversion-< c8 c6)
- (inversion-< c8 c7)
- (inversion-< c4 c8)
- (inversion-< c2 c8)
- (inversion-< c9 c10)
- (inversion-< c10 c11)
- (inversion-< c11 c12)
- ;; Negatives
- (not (inversion-< c3 c2))
- (not (inversion-< c4 c3))
- (not (inversion-< c5 c4))
- (not (inversion-< c6 c5))
- (not (inversion-< c7 c2))
- (not (inversion-< c7 c8))
- (not (inversion-< c12 c11))
- ;; Test the tester on inversion
- (not (inversion-test 'inversion inversion-version))
- ;; Test that we throw an error
- (inversion-test 'inversion "0.0.0")
- (inversion-test 'inversion "1000.0")
- ))
- (error "Inversion tests failed")
- (message "Inversion tests passed."))))
-
-;;; cedet-files unit test
-
-(defvar cedet-files-utest-list
- '(
- ( "/home/me/src/myproj/src/foo.c" . "!home!me!src!myproj!src!foo.c" )
- ( "c:/work/myproj/foo.el" . "!drive_c!work!myproj!foo.el" )
- ( "//windows/proj/foo.java" . "!!windows!proj!foo.java" )
- ( "/home/me/proj!bang/foo.c" . "!home!me!proj!!bang!foo.c" )
- )
- "List of different file names to test.
-Each entry is a cons cell of ( FNAME . CONVERTED )
-where FNAME is some file name, and CONVERTED is what it should be
-converted into.")
-
-(defun cedet-files-utest ()
- "Test out some file name conversions."
- (interactive)
- (let ((idx 0))
- (dolist (FT cedet-files-utest-list)
-
- (setq idx (+ idx 1))
-
- (let ((dir->file (cedet-directory-name-to-file-name (car FT) t))
- (file->dir (cedet-file-name-to-directory-name (cdr FT) t))
- )
-
- (unless (string= (cdr FT) dir->file)
- (error "Failed: %d. Found: %S Wanted: %S"
- idx dir->file (cdr FT))
- )
-
- (unless (string= file->dir (car FT))
- (error "Failed: %d. Found: %S Wanted: %S"
- idx file->dir (car FT)))))))
-
;;; pulse test
(defun pulse-test (&optional no-error)
"Test the lightening function for pulsing a line.
When optional NO-ERROR don't throw an error if we can't run tests."
(interactive)
- (if (or (not pulse-flag) (not (pulse-available-p)))
+ (if (not (and (bound-and-true-p pulse-flag)
+ (fboundp 'pulse-available-p)
+ (pulse-available-p)))
(if no-error
nil
(error (concat "Pulse test only works on versions of Emacs"
" that support pulsing")))
+ (declare-function pulse-momentary-highlight-overlay
+ "pulse.el" (o &optional face))
;; Run the tests
(when (called-interactively-p 'interactive)
(message "<Press a key> Pulse one line.")
diff --git a/test/manual/cedet/ede-tests.el b/test/manual/cedet/ede-tests.el
index eb3132398a6..2af50860c60 100644
--- a/test/manual/cedet/ede-tests.el
+++ b/test/manual/cedet/ede-tests.el
@@ -1,4 +1,4 @@
-;;; ede-tests.el --- Some tests for the Emacs Development Environment
+;;; ede-tests.el --- Some tests for the Emacs Development Environment -*- lexical-binding: t -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
@@ -42,8 +42,7 @@ The search is done with the current EDE root."
(ede-toplevel)))))
(data-debug-new-buffer "*EDE Locate ADEBUG*")
(ede-locate-file-in-project loc file)
- (data-debug-insert-object-slots loc "]"))
- )
+ (data-debug-insert-object-slots loc "]")))
(defun ede-locate-test-global (file)
"Test EDE Locate on FILE using GNU Global type.
@@ -55,8 +54,7 @@ The search is done with the current EDE root."
(ede-toplevel)))))
(data-debug-new-buffer "*EDE Locate ADEBUG*")
(ede-locate-file-in-project loc file)
- (data-debug-insert-object-slots loc "]"))
- )
+ (data-debug-insert-object-slots loc "]")))
(defun ede-locate-test-idutils (file)
"Test EDE Locate on FILE using ID Utils type.
@@ -68,8 +66,7 @@ The search is done with the current EDE root."
(ede-toplevel)))))
(data-debug-new-buffer "*EDE Locate ADEBUG*")
(ede-locate-file-in-project loc file)
- (data-debug-insert-object-slots loc "]"))
- )
+ (data-debug-insert-object-slots loc "]")))
(defun ede-locate-test-cscope (file)
"Test EDE Locate on FILE using CScope type.
@@ -81,7 +78,6 @@ The search is done with the current EDE root."
(ede-toplevel)))))
(data-debug-new-buffer "*EDE Locate ADEBUG*")
(ede-locate-file-in-project loc file)
- (data-debug-insert-object-slots loc "]"))
- )
+ (data-debug-insert-object-slots loc "]")))
;;; ede-test.el ends here
diff --git a/test/manual/cedet/semantic-tests.el b/test/manual/cedet/semantic-tests.el
index 716bcc7abed..1561c18dd68 100644
--- a/test/manual/cedet/semantic-tests.el
+++ b/test/manual/cedet/semantic-tests.el
@@ -1,6 +1,6 @@
-;;; semantic-utest.el --- Miscellaneous Semantic tests.
+;;; semantic-tests.el --- Miscellaneous Semantic tests. -*- lexical-binding: t; -*-
-;;; Copyright (C) 2003-2004, 2007-2021 Free Software Foundation, Inc.
+;; Copyright (C) 2003-2021 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <zappo@gnu.org>
@@ -64,10 +64,12 @@ run the test again")))
"Find the first loaded ebrowse table, and dump out the contents."
(interactive)
(let ((db semanticdb-database-list)
- (ab nil))
+ ;; (ab nil)
+ )
(while db
(when (semanticdb-project-database-ebrowse-p (car db))
- (setq ab (data-debug-new-buffer "*EBROWSE Database*"))
+ ;; (setq ab
+ (data-debug-new-buffer "*EBROWSE Database*") ;;)
(data-debug-insert-thing (car db) "*" "")
(setq db nil)
)
@@ -100,7 +102,7 @@ If optional arg STANDARDFILE is non-nil, use a standard file w/ global enabled."
(set-buffer (find-file-noselect semanticdb-test-gnu-global-startfile)))
(semanticdb-enable-gnu-global-in-buffer))))
- (let* ((db (semanticdb-project-database-global "global"))
+ (let* ((db (semanticdb-project-database-global)) ;; "global"
(tab (semanticdb-file-table db (buffer-file-name)))
(result (semanticdb-deep-find-tags-for-completion-method tab searchfor))
)
@@ -127,8 +129,7 @@ Optional argument ARG specifies not to use color."
(princ (car fns))
(princ ":\n ")
(let ((s (funcall (car fns) tag par (not arg))))
- (save-excursion
- (set-buffer "*format-tag*")
+ (with-current-buffer "*format-tag*"
(goto-char (point-max))
(insert s)))
(setq fns (cdr fns))))
@@ -138,21 +139,6 @@ Optional argument ARG specifies not to use color."
(require 'semantic/fw)
-(defun semantic-test-data-cache ()
- "Test the data cache."
- (interactive)
- (let ((data '(a b c)))
- (save-excursion
- (set-buffer (get-buffer-create " *semantic-test-data-cache*"))
- (erase-buffer)
- (insert "The Moose is Loose")
- (goto-char (point-min))
- (semantic-cache-data-to-buffer (current-buffer) (point) (+ (point) 5)
- data 'moose 'exit-cache-zone)
- (if (equal (semantic-get-cache-data 'moose) data)
- (message "Successfully retrieved cached data.")
- (error "Failed to retrieve cached data")))))
-
(defun semantic-test-throw-on-input ()
"Test that throw on input will work."
(interactive)
@@ -178,7 +164,7 @@ Optional argument ARG specifies not to use color."
"Test `semantic-idle-scheduler-work-parse-neighboring-files' and time it."
(interactive)
(let ((start (current-time))
- (junk (semantic-idle-scheduler-work-parse-neighboring-files)))
+ (_junk (semantic-idle-scheduler-work-parse-neighboring-files)))
(message "Work took %.2f seconds." (semantic-elapsed-time start nil))))
;;; From semantic-lex:
@@ -225,6 +211,8 @@ Analyze the area between BEG and END."
(semantic-lex-spp-table-write-slot-value
(semantic-lex-spp-save-table))))
+(defvar cedet-utest-directory) ;From test/manual/cedet/cedet-utests.el?
+
(defun semantic-lex-spp-write-utest ()
"Unit test using the test spp file to test the slot write fcn."
(interactive)
@@ -273,7 +261,7 @@ tag that contains point, and return that."
(Lcount 0))
(when (semantic-tag-p target)
(semantic-symref-hits-in-region
- target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
+ target (lambda (_start _end _prefix) (setq Lcount (1+ Lcount)))
(semantic-tag-start tag)
(semantic-tag-end tag))
(when (called-interactively-p 'interactive)
@@ -281,110 +269,3 @@ tag that contains point, and return that."
Lcount (semantic-tag-name target)
(semantic-elapsed-time start nil)))
Lcount)))
-
-;;; From bovine-gcc:
-
-(require 'semantic/bovine/gcc)
-
-;; Example output of "gcc -v"
-(defvar semantic-gcc-test-strings
- '(;; My old box:
- "Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
-Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
-Thread model: posix
-gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"
- ;; Alex Ott:
- "Using built-in specs.
-Target: i486-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.1-9ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
-Thread model: posix
-gcc version 4.3.1 (Ubuntu 4.3.1-9ubuntu1)"
- ;; My debian box:
- "Using built-in specs.
-Target: x86_64-unknown-linux-gnu
-Configured with: ../../../sources/gcc/configure --prefix=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3 --with-gmp=/usr/local/gcc/gmp --with-mpfr=/usr/local/gcc/mpfr --enable-languages=c,c++,fortran --with-as=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3/bin/as --with-ld=/usr/local/glibc-2.3.6/x86_64/apps/gcc-4.2.3/bin/ld --disable-multilib
-Thread model: posix
-gcc version 4.2.3"
- ;; My mac:
- "Using built-in specs.
-Target: i686-apple-darwin8
-Configured with: /private/var/tmp/gcc/gcc-5341.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=pentium-m --with-tune=prescott --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
-Thread model: posix
-gcc version 4.0.1 (Apple Computer, Inc. build 5341)"
- ;; Ubuntu Intrepid
- "Using built-in specs.
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)"
- ;; Red Hat EL4
- "Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
-Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
-Thread model: posix
-gcc version 3.4.6 20060404 (Red Hat 3.4.6-10)"
- ;; Red Hat EL5
- "Using built-in specs.
-Target: x86_64-redhat-linux
-Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
-Thread model: posix
-gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)"
- ;; David Engster's german gcc on ubuntu 4.3
- "Es werden eingebaute Spezifikationen verwendet.
-Ziel: i486-linux-gnu
-Konfiguriert mit: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
-Thread-Modell: posix
-gcc-Version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)"
- ;; Damien Deville bsd
- "Using built-in specs.
-Target: i386-undermydesk-freebsd
-Configured with: FreeBSD/i386 system compiler
-Thread model: posix
-gcc version 4.2.1 20070719 [FreeBSD]"
- )
- "A bunch of sample gcc -v outputs from different machines.")
-
-(defvar semantic-gcc-test-strings-fail
- '(;; A really old solaris box I found
- "Reading specs from /usr/local/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.6/2.95.2/specs
-gcc version 2.95.2 19991024 (release)"
- )
- "A bunch of sample gcc -v outputs that fail to provide the info we want.")
-
-(defun semantic-gcc-test-output-parser ()
- "Test the output parser against some collected strings."
- (interactive)
- (let ((fail nil))
- (dolist (S semantic-gcc-test-strings)
- (let* ((fields (semantic-gcc-fields S))
- (v (cdr (assoc 'version fields)))
- (h (or (cdr (assoc 'target fields))
- (cdr (assoc '--target fields))
- (cdr (assoc '--host fields))))
- (p (cdr (assoc '--prefix fields)))
- )
- ;; No longer test for prefixes.
- (when (not (and v h))
- (let ((strs (split-string S "\n")))
- (message "Test failed on %S\nV H P:\n%S %S %S" (car strs) v h p))
- (setq fail t))
- ))
- (dolist (S semantic-gcc-test-strings-fail)
- (let* ((fields (semantic-gcc-fields S))
- (v (cdr (assoc 'version fields)))
- (h (or (cdr (assoc '--host fields))
- (cdr (assoc 'target fields))))
- (p (cdr (assoc '--prefix fields)))
- )
- (when (and v h p)
- (message "Negative test failed on %S" S)
- (setq fail t))
- ))
- (if (not fail) (message "Tests passed."))
- ))
-
-(defun semantic-gcc-test-output-parser-this-machine ()
- "Test the output parser against the machine currently running Emacs."
- (interactive)
- (let ((semantic-gcc-test-strings (list (semantic-gcc-query "gcc" "-v"))))
- (semantic-gcc-test-output-parser))
- )
diff --git a/test/manual/cedet/tests/test.el b/test/manual/cedet/tests/test.el
index 3bc945d89f8..d1d0d1602f4 100644
--- a/test/manual/cedet/tests/test.el
+++ b/test/manual/cedet/tests/test.el
@@ -1,4 +1,4 @@
-;;; test.el --- Unit test file for Semantic Emacs Lisp support.
+;;; test.el --- Unit test file for Semantic Emacs Lisp support. -*- lexical-binding: t -*-
;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
@@ -153,7 +153,4 @@
(defvar-mode-local emacs-lisp-mode a-mode-local-def
"some value")
-
-;;; Provide
-;;
(provide 'test)
diff --git a/test/manual/etags/CTAGS.good b/test/manual/etags/CTAGS.good
index 5e582434a62..84a56b23cfa 100644
--- a/test/manual/etags/CTAGS.good
+++ b/test/manual/etags/CTAGS.good
@@ -759,6 +759,7 @@ Install_Abort_Handler/p ada-src/2ataspri.ads /^ procedure Install_Abort_Handle
Install_Error_Handler/p ada-src/2ataspri.adb /^ procedure Install_Error_Handler (Handler : Syst/
Install_Error_Handler/p ada-src/2ataspri.ads /^ procedure Install_Error_Handler (Handler : Syst/
Invoking gzip tex-src/gzip.texi /^@node Invoking gzip, Advanced usage, Sample, Top$/
+IpAddrKind rs-src/test.rs 3
IsControlChar pas-src/common.pas /^function IsControlChar; (*($/
IsControlCharName pas-src/common.pas /^function IsControlCharName($/
Is_Set/f ada-src/2ataspri.adb /^ function Is_Set (Cell : in TAS_Cell) return Bo/
@@ -984,6 +985,7 @@ MoveLayerBottom lua-src/allegro.lua /^function MoveLayerBottom ()$/
MoveLayerTop lua-src/allegro.lua /^function MoveLayerTop ()$/
Mtest.go go-src/test.go 1
Mtest.go go-src/test.go /^func main() {$/
+Mtest.rs rs-src/test.rs /^fn main() {$/
Mtest1.go go-src/test1.go 1
Mtest1.go go-src/test1.go /^func main() {$/
Mx.cc cp-src/x.cc /^main(int argc, char *argv[])$/
@@ -1153,7 +1155,6 @@ Python_help c-src/etags.c 660
Python_suffixes c-src/etags.c 658
QUIT c-src/emacs/src/lisp.h 3101
QUITP c-src/emacs/src/lisp.h 3112
-Qpre_abbrev_expand_hook c-src/abbrev.c 83
RANGED_INTEGERP c-src/emacs/src/lisp.h /^RANGED_INTEGERP (intmax_t lo, Lisp_Object x, intma/
RCSid objc-src/PackInsp.m 30
READABLE_EVENTS_DO_TIMERS_NOW c-src/emacs/src/keyboard.c 346
@@ -1498,7 +1499,6 @@ Vglobal_abbrev_table c-src/abbrev.c 48
Vlast_abbrev c-src/abbrev.c 70
Vlast_abbrev_text c-src/abbrev.c 75
Vlispy_mouse_stem c-src/emacs/src/keyboard.c 5172
-Vpre_abbrev_expand_hook c-src/abbrev.c 83
WAIT_READING_MAX c-src/emacs/src/lisp.h 4281
WAIT_READING_MAX c-src/emacs/src/lisp.h 4283
WARNINGS make-src/Makefile /^WARNINGS=-pedantic -Wall -Wpointer-arith -Winline /
@@ -1732,7 +1732,6 @@ Z c-src/h.h 100
\1 c-src/abbrev.c /^ DEFVAR_PER_BUFFER ("local-abbrev-table", &curren/
\1 c-src/abbrev.c /^ DEFVAR_BOOL ("abbrevs-changed", &abbrevs_changed/
\1 c-src/abbrev.c /^ DEFVAR_BOOL ("abbrev-all-caps", &abbrev_all_caps/
-\1 c-src/abbrev.c /^ DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abb/
\1 c-src/emacs/src/keyboard.c /^ DEFVAR_LISP ("internal--top-level-message", Vint/
\1 c-src/emacs/src/keyboard.c /^ DEFVAR_LISP ("last-command-event", last_command_/
\1 c-src/emacs/src/keyboard.c /^ DEFVAR_LISP ("last-nonmenu-event", last_nonmenu_/
@@ -2462,8 +2461,47 @@ abs/f ada-src/etags-test-for.ada /^ function "abs" (Right : Complex) return
absolute_dirname c-src/etags.c /^absolute_dirname (char *file, char *dir)$/
absolute_filename c-src/etags.c /^absolute_filename (char *file, char *dir)$/
abt cp-src/c.C 55
+acc_pred_info merc-src/accumulator.m /^:- pred acc_pred_info(list(mer_type)::in, list(pro/
+acc_proc_info merc-src/accumulator.m /^:- pred acc_proc_info(list(prog_var)::in, prog_var/
+acc_unification merc-src/accumulator.m /^:- pred acc_unification(pair(prog_var)::in, hlds_g/
+acc_var_subst_init merc-src/accumulator.m /^:- pred acc_var_subst_init(list(prog_var)::in,$/
accent_key_syms c-src/emacs/src/keyboard.c 4625
access_keymap_keyremap c-src/emacs/src/keyboard.c /^access_keymap_keyremap (Lisp_Object map, Lisp_Obje/
+accu_assoc merc-src/accumulator.m /^:- pred accu_assoc(module_info::in, vartypes::in, /
+accu_assoc merc-src/accumulator.m /^:- type accu_assoc$/
+accu_base merc-src/accumulator.m /^:- type accu_base$/
+accu_before merc-src/accumulator.m /^:- pred accu_before(module_info::in, vartypes::in,/
+accu_case merc-src/accumulator.m /^:- type accu_case$/
+accu_construct merc-src/accumulator.m /^:- pred accu_construct(module_info::in, vartypes::/
+accu_construct_assoc merc-src/accumulator.m /^:- pred accu_construct_assoc(module_info::in, vart/
+accu_create_goal merc-src/accumulator.m /^:- pred accu_create_goal(accu_goal_id::in, list(pr/
+accu_divide_base_case merc-src/accumulator.m /^:- pred accu_divide_base_case(module_info::in, var/
+accu_goal_id merc-src/accumulator.m /^:- type accu_goal_id$/
+accu_goal_list merc-src/accumulator.m /^:- func accu_goal_list(list(accu_goal_id), accu_go/
+accu_goal_store merc-src/accumulator.m /^:- type accu_goal_store == goal_store(accu_goal_id/
+accu_has_heuristic merc-src/accumulator.m /^:- pred accu_has_heuristic(module_name::in, string/
+accu_heuristic merc-src/accumulator.m /^:- pred accu_heuristic(module_name::in, string::in/
+accu_is_associative merc-src/accumulator.m /^:- pred accu_is_associative(module_info::in, pred_/
+accu_is_update merc-src/accumulator.m /^:- pred accu_is_update(module_info::in, pred_id::i/
+accu_process_assoc_set merc-src/accumulator.m /^:- pred accu_process_assoc_set(module_info::in, ac/
+accu_process_update_set merc-src/accumulator.m /^:- pred accu_process_update_set(module_info::in, a/
+accu_related merc-src/accumulator.m /^:- pred accu_related(module_info::in, vartypes::in/
+accu_rename merc-src/accumulator.m /^:- func accu_rename(list(accu_goal_id), accu_subst/
+accu_sets merc-src/accumulator.m /^:- type accu_sets$/
+accu_sets_init merc-src/accumulator.m /^:- pred accu_sets_init(accu_sets::out) is det.$/
+accu_stage1 merc-src/accumulator.m /^:- pred accu_stage1(module_info::in, vartypes::in,/
+accu_stage1_2 merc-src/accumulator.m /^:- pred accu_stage1_2(module_info::in, vartypes::i/
+accu_stage2 merc-src/accumulator.m /^:- pred accu_stage2(module_info::in, proc_info::in/
+accu_stage3 merc-src/accumulator.m /^:- pred accu_stage3(accu_goal_id::in, list(prog_va/
+accu_standardize merc-src/accumulator.m /^:- pred accu_standardize(hlds_goal::in, hlds_goal:/
+accu_store merc-src/accumulator.m /^:- pred accu_store(accu_case::in, hlds_goal::in,$/
+accu_subst merc-src/accumulator.m /^:- type accu_subst == map(prog_var, prog_var).$/
+accu_substs merc-src/accumulator.m /^:- type accu_substs$/
+accu_substs_init merc-src/accumulator.m /^:- pred accu_substs_init(list(prog_var)::in, prog_/
+accu_top_level merc-src/accumulator.m /^:- pred accu_top_level(top_level::in, hlds_goal::i/
+accu_transform_proc merc-src/accumulator.m /^:- pred accu_transform_proc(pred_proc_id::in, pred/
+accu_update merc-src/accumulator.m /^:- pred accu_update(module_info::in, vartypes::in,/
+accu_warning merc-src/accumulator.m /^:- type accu_warning$/
act prol-src/natded.prolog /^act(OutForm,OutSyn,Ws):-$/
action prol-src/natded.prolog /^action(KeyVals):-$/
active_maps c-src/emacs/src/keyboard.c /^active_maps (Lisp_Object first_event)$/
@@ -2535,6 +2573,8 @@ assemby-code-word forth-src/test-forth.fth /^code assemby-code-word ( dunno what
assert c-src/etags.c 135
assert c-src/etags.c /^# define assert(x) ((void) 0)$/
assign_neighbor cp-src/clheir.hpp /^ void assign_neighbor(int direction, location */
+assoc_list merc-src/accumulator.m /^:- import_module assoc_list.$/
+associativity_assertion merc-src/accumulator.m /^:- pred associativity_assertion(module_info::in, l/
at_end c-src/etags.c 249
at_filename c-src/etags.c 247
at_language c-src/etags.c 245
@@ -2568,6 +2608,8 @@ bas_syn prol-src/natded.prolog /^bas_syn(n(_)).$/
base c-src/emacs/src/lisp.h 2188
base cp-src/c.C /^double base (void) const { return rng_base; }$/
base cp-src/Range.h /^ double base (void) const { return rng_base; }$/
+base_case_ids merc-src/accumulator.m /^:- func base_case_ids(accu_goal_store) = list(accu/
+base_case_ids_set merc-src/accumulator.m /^:- func base_case_ids_set(accu_goal_store) = set(a/
baz= ruby-src/test1.ru /^ :baz,$/
bb c.c 275
bbb c.c 251
@@ -2605,6 +2647,7 @@ bodyindent tex-src/texinfo.tex /^\\exdentamount=\\defbodyindent$/
bodyindent tex-src/texinfo.tex /^\\advance\\leftskip by \\defbodyindent \\advance \\righ/
bodyindent tex-src/texinfo.tex /^\\exdentamount=\\defbodyindent$/
bool c.c 222
+bool merc-src/accumulator.m /^:- import_module bool.$/
bool_header_size c-src/emacs/src/lisp.h 1472
bool_vector_bitref c-src/emacs/src/lisp.h /^bool_vector_bitref (Lisp_Object a, EMACS_INT i)$/
bool_vector_bytes c-src/emacs/src/lisp.h /^bool_vector_bytes (EMACS_INT size)$/
@@ -2646,6 +2689,7 @@ c_ext c-src/etags.c 2271
caccacacca c.c /^caccacacca (a,b,c,d,e,f,g)$/
cacheLRUEntry_s c.c 172
cacheLRUEntry_t c.c 177
+calculate_goal_info merc-src/accumulator.m /^:- pred calculate_goal_info(hlds_goal_expr::in, hl/
calloc c-src/emacs/src/gmalloc.c 66
calloc c-src/emacs/src/gmalloc.c 70
calloc c-src/emacs/src/gmalloc.c /^calloc (size_t nmemb, size_t size)$/
@@ -2666,6 +2710,8 @@ cgrep html-src/software.html /^cgrep$/
chain c-src/emacs/src/lisp.h 1162
chain c-src/emacs/src/lisp.h 2206
chain c-src/emacs/src/lisp.h 2396
+chain_subst merc-src/accumulator.m /^:- func chain_subst(accu_subst, accu_subst) = accu/
+chain_subst_2 merc-src/accumulator.m /^:- pred chain_subst_2(list(A)::in, map(A, B)::in, /
char_bits c-src/emacs/src/lisp.h 2443
char_table_specials c-src/emacs/src/lisp.h 1692
charpos c-src/emacs/src/lisp.h 2011
@@ -2708,6 +2754,7 @@ command_loop_1 c-src/emacs/src/keyboard.c /^command_loop_1 (void)$/
command_loop_2 c-src/emacs/src/keyboard.c /^command_loop_2 (Lisp_Object ignore)$/
command_loop_level c-src/emacs/src/keyboard.c 195
comment php-src/lce_functions.php /^ function comment($line, $class)$/
+commutativity_assertion merc-src/accumulator.m /^:- pred commutativity_assertion(module_info::in,li/
compile_empty prol-src/natded.prolog /^compile_empty:-$/
compile_lex prol-src/natded.prolog /^compile_lex(File):-$/
complete prol-src/natded.prolog /^complete(Cat):-$/
@@ -2741,6 +2788,13 @@ create-bar forth-src/test-forth.fth /^: create-bar foo ;$/
createPOEntries php-src/lce_functions.php /^ function createPOEntries()$/
createWidgets pyt-src/server.py /^ def createWidgets(self, host):$/
createWidgets pyt-src/server.py /^ def createWidgets(self):$/
+create_acc_call merc-src/accumulator.m /^:- func create_acc_call(hlds_goal::in(goal_plain_c/
+create_acc_goal merc-src/accumulator.m /^:- pred create_acc_goal(hlds_goal::in, accu_substs/
+create_new_base_goals merc-src/accumulator.m /^:- func create_new_base_goals(set(accu_goal_id), a/
+create_new_orig_recursive_goals merc-src/accumulator.m /^:- func create_new_orig_recursive_goals(set(accu_g/
+create_new_recursive_goals merc-src/accumulator.m /^:- func create_new_recursive_goals(set(accu_goal_i/
+create_new_var merc-src/accumulator.m /^:- pred create_new_var(prog_var::in, string::in, p/
+create_orig_goal merc-src/accumulator.m /^:- pred create_orig_goal(hlds_goal::in, accu_subst/
cscInitTime cp-src/c.C 7
cscSegmentationTime cp-src/c.C 8
cstack c-src/etags.c 2523
@@ -3048,6 +3102,7 @@ foperator c-src/etags.c 2411
force_auto_save_soon c-src/emacs/src/keyboard.c /^force_auto_save_soon (void)$/
force_explicit_name c-src/etags.c 265
force_quit_count c-src/emacs/src/keyboard.c 10387
+foreign_export merc-src/accumulator.m /^:- pragma foreign_export("C", unravel_univ(in, out/
formatSize objc-src/PackInsp.m /^-(const char *)formatSize:(const char *)size inBuf/
found c-src/emacs/src/lisp.h 2344
fracas html-src/software.html /^Fracas$/
@@ -3105,6 +3160,8 @@ gcpro c-src/emacs/src/lisp.h 3042
gcpro c-src/emacs/src/lisp.h 3132
gen_help_event c-src/emacs/src/keyboard.c /^gen_help_event (Lisp_Object help, Lisp_Object fram/
genalgorithm html-src/algrthms.html /^Generating the Data<\/font><\/i><\/b>$/
+generate_warning merc-src/accumulator.m /^:- pred generate_warning(module_info::in, prog_var/
+generate_warnings merc-src/accumulator.m /^:- pred generate_warnings(module_info::in, prog_va/
generic_object cp-src/clheir.cpp /^generic_object::generic_object(void)$/
generic_object cp-src/clheir.hpp 13
getArchs objc-src/PackInsp.m /^-(void)getArchs$/
@@ -3173,6 +3230,7 @@ help_char_p c-src/emacs/src/keyboard.c /^help_char_p (Lisp_Object c)$/
help_form_saved_window_configs c-src/emacs/src/keyboard.c 2156
helpwin pyt-src/server.py /^def helpwin(helpdict):$/
hide_cursor cp-src/screen.cpp /^void hide_cursor(void)$/
+hlds merc-src/accumulator.m /^:- import_module hlds.$/
htmltreelist prol-src/natded.prolog /^htmltreelist([]).$/
hybrid_aligned_alloc c-src/emacs/src/gmalloc.c /^hybrid_aligned_alloc (size_t alignment, size_t siz/
hybrid_calloc c-src/emacs/src/gmalloc.c /^hybrid_calloc (size_t nmemb, size_t size)$/
@@ -3192,12 +3250,16 @@ ialpage tex-src/texinfo.tex /^ \\dimen@=\\pageheight \\advance\\dimen@ by-\\ht\
ialpage tex-src/texinfo.tex /^ \\availdimen@=\\pageheight \\advance\\availdimen@ by/
ialpage tex-src/texinfo.tex /^ \\dimen@=\\pageheight \\advance\\dimen@ by-\\ht\\pa/
ialpage= tex-src/texinfo.tex /^ \\output={\\global\\setbox\\partialpage=$/
+identify_goal_type merc-src/accumulator.m /^:- pred identify_goal_type(pred_id::in, proc_id::i/
+identify_out_and_out_prime merc-src/accumulator.m /^:- pred identify_out_and_out_prime(module_info::in/
+identify_recursive_calls merc-src/accumulator.m /^:- pred identify_recursive_calls(pred_id::in, proc/
idx c-src/emacs/src/lisp.h 3150
ignore_case c-src/etags.c 266
ignore_mouse_drag_p c-src/emacs/src/keyboard.c 1256
ill=\relax tex-src/texinfo.tex /^\\let\\refill=\\relax$/
immediate_quit c-src/emacs/src/keyboard.c 174
impatto html-src/softwarelibero.html /^Impatto pratico del software libero$/
+implementation merc-src/accumulator.m /^:- implementation.$/
in_word_set c-src/etags.c /^in_word_set (register const char *str, register un/
inattribute c-src/etags.c 2400
inc cp-src/Range.h /^ double inc (void) const { return rng_inc; }$/
@@ -3221,6 +3283,7 @@ inita c.c /^static void inita () {}$/
initb c.c /^static void initb () {}$/
initial_kboard c-src/emacs/src/keyboard.c 84
initialize-new-tags-table el-src/emacs/lisp/progmodes/etags.el /^(defun initialize-new-tags-table ()$/
+initialize_goal_store merc-src/accumulator.m /^:- func initialize_goal_store(list(hlds_goal), ins/
initialize_random_junk y-src/cccp.y /^initialize_random_junk ()$/
input-pending-p c-src/emacs/src/keyboard.c /^DEFUN ("input-pending-p", Finput_pending_p, Sinput/
input_available_clear_time c-src/emacs/src/keyboard.c 324
@@ -3236,6 +3299,7 @@ instance_method_exclamation! ruby-src/test.rb /^ def instance_method_excl
instance_method_question? ruby-src/test.rb /^ def instance_method_question?$/
instr y-src/parse.y 81
instruct c-src/etags.c 2527
+int merc-src/accumulator.m /^:- import_module int.$/
intNumber go-src/test1.go 13
integer c-src/emacs/src/lisp.h 2127
integer y-src/cccp.y 112
@@ -3244,6 +3308,7 @@ integertonmstr pas-src/common.pas /^function integertonmstr; (* (TheInteger : in
intensity1 f-src/entry.for /^ & intensity1(efv,fv,svin,svquad,sfpv,maxp,val/
intensity1 f-src/entry.strange_suffix /^ & intensity1(efv,fv,svin,svquad,sfpv,maxp,val/
intensity1 f-src/entry.strange /^ & intensity1(efv,fv,svin,svquad,sfpv,maxp,val/
+interface merc-src/accumulator.m /^:- interface.$/
interface_locate c-src/c.c /^interface_locate(void)$/
intern c-src/emacs/src/lisp.h /^intern (const char *str)$/
intern_c_string c-src/emacs/src/lisp.h /^intern_c_string (const char *str)$/
@@ -3258,6 +3323,7 @@ intoken c-src/etags.c /^#define intoken(c) (_itk[CHAR (c)]) \/* c can be in/
intspec c-src/emacs/src/lisp.h 1688
intvar c-src/emacs/src/lisp.h 2277
invalidate_nodes c-src/etags.c /^invalidate_nodes (fdesc *badfdp, node **npp)$/
+io merc-src/accumulator.m /^:- import_module io.$/
ipc3dCSC19 cp-src/c.C 6
ipc3dChannelType cp-src/c.C 1
ipc3dIslandHierarchy cp-src/c.C 1
@@ -3267,6 +3333,7 @@ irregular_location cp-src/clheir.hpp /^ irregular_location(double xi, double
isComment php-src/lce_functions.php /^ function isComment($class)$/
isHoliday cp-src/functions.cpp /^bool isHoliday ( Date d ){$/
isLeap cp-src/functions.cpp /^bool isLeap ( int year ){$/
+is_associative_construction merc-src/accumulator.m /^:- pred is_associative_construction(module_info::i/
is_curly_brace_form c-src/h.h 54
is_explicit c-src/h.h 49
is_func c-src/etags.c 221
@@ -3275,6 +3342,7 @@ is_idchar y-src/cccp.y 948
is_idstart y-src/cccp.y 950
is_muldiv_operation cp-src/c.C /^is_muldiv_operation(pc)$/
is_ordset prol-src/ordsets.prolog /^is_ordset(X) :- var(X), !, fail.$/
+is_recursive_case merc-src/accumulator.m /^:- pred is_recursive_case(list(hlds_goal)::in, pre/
iso_lispy_function_keys c-src/emacs/src/keyboard.c 5151
isoperator prol-src/natded.prolog /^isoperator(Char):-$/
isoptab prol-src/natded.prolog /^isoptab('%').$/
@@ -3371,6 +3439,7 @@ letter: tex-src/texinfo.tex /^\\xdef\\thischapter{Appendix \\appendixletter: \\n
level c-src/emacs/src/lisp.h 3153
lex prol-src/natded.prolog /^lex(W,SynOut,Sem):-$/
lexptr y-src/cccp.y 332
+libs merc-src/accumulator.m /^:- import_module libs.$/
licenze html-src/softwarelibero.html /^Licenze d'uso di un programma$/
limit cp-src/Range.h /^ double limit (void) const { return rng_limit; }$/
line c-src/etags.c 2493
@@ -3428,6 +3497,7 @@ lispy_modifier_list c-src/emacs/src/keyboard.c /^lispy_modifier_list (int modifi
lispy_multimedia_keys c-src/emacs/src/keyboard.c 4962
lispy_wheel_names c-src/emacs/src/keyboard.c 5174
list c-src/emacs/src/gmalloc.c 186
+list merc-src/accumulator.m /^:- import_module list.$/
list-tags el-src/emacs/lisp/progmodes/etags.el /^(defun list-tags (file &optional _next-match)$/
list-tags-function el-src/emacs/lisp/progmodes/etags.el /^(defvar list-tags-function nil$/
list2i c-src/emacs/src/lisp.h /^list2i (EMACS_INT x, EMACS_INT y)$/
@@ -3444,6 +3514,7 @@ local_if_set c-src/emacs/src/lisp.h 2338
location cp-src/clheir.hpp 33
location cp-src/clheir.hpp /^ location() { }$/
lookup y-src/cccp.y /^lookup (name, len, hash)$/
+lookup_call merc-src/accumulator.m /^:- pred lookup_call(accu_goal_store::in, accu_goal/
lowcase c-src/etags.c /^#define lowcase(c) tolower (CHAR (c))$/
lucid_event_type_list_p c-src/emacs/src/keyboard.c /^lucid_event_type_list_p (Lisp_Object object)$/
mabort c-src/emacs/src/gmalloc.c /^mabort (enum mcheck_status status)$/
@@ -3489,6 +3560,7 @@ mallochook c-src/emacs/src/gmalloc.c /^mallochook (size_t size)$/
man manpage make-src/Makefile /^man manpage: etags.1.man$/
mao c-src/h.h 101
map c-src/emacs/src/keyboard.c 8748
+map merc-src/accumulator.m /^:- import_module map.$/
map_word prol-src/natded.prolog /^map_word([[_]|Ws],Exp):-$/
mapping html-src/algrthms.html /^Mapping the Channel Symbols$/
mapsyn prol-src/natded.prolog /^mapsyn(A\/B,AM\/BM):-$/
@@ -3502,15 +3574,18 @@ max_args c-src/emacs/src/lisp.h 1686
max_num_directions cp-src/clheir.hpp 31
max_num_generic_objects cp-src/clheir.cpp 9
maxargs c-src/emacs/src/lisp.h 2831
+maybe merc-src/accumulator.m /^:- import_module maybe.$/
maybe_gc c-src/emacs/src/lisp.h /^maybe_gc (void)$/
mcCSC cp-src/c.C 6
mcheck c-src/emacs/src/gmalloc.c /^mcheck (void (*func) (enum mcheck_status))$/
mcheck_status c-src/emacs/src/gmalloc.c 283
mcheck_used c-src/emacs/src/gmalloc.c 2012
+mdbcomp merc-src/accumulator.m /^:- import_module mdbcomp.$/
me22b lua-src/test.lua /^ local function test.me22b (one)$/
me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/
memalign c-src/emacs/src/gmalloc.c /^memalign (size_t alignment, size_t size)$/
member prol-src/natded.prolog /^member(X,[X|_]).$/
+member_lessthan_goalid merc-src/accumulator.m /^:- pred member_lessthan_goalid(accu_goal_store::in/
memclear c-src/emacs/src/lisp.h /^memclear (void *p, ptrdiff_t nbytes)$/
menu_bar_item c-src/emacs/src/keyboard.c /^menu_bar_item (Lisp_Object key, Lisp_Object item, /
menu_bar_items c-src/emacs/src/keyboard.c /^menu_bar_items (Lisp_Object old)$/
@@ -3781,6 +3856,7 @@ pMu c-src/emacs/src/lisp.h 151
pMu c-src/emacs/src/lisp.h 156
p_next c-src/etags.c 258
pagesize c-src/emacs/src/gmalloc.c 1703
+pair merc-src/accumulator.m /^:- import_module pair.$/
parent c-src/emacs/src/keyboard.c 8745
parent c-src/emacs/src/lisp.h 1590
parse prol-src/natded.prolog /^parse(Ws,Cat):-$/
@@ -3798,6 +3874,7 @@ parse_return y-src/parse.y 74
parse_return_error y-src/cccp.y 70
parse_solitary_modifier c-src/emacs/src/keyboard.c /^parse_solitary_modifier (Lisp_Object symbol)$/
parse_tool_bar_item c-src/emacs/src/keyboard.c /^parse_tool_bar_item (Lisp_Object key, Lisp_Object /
+parse_tree merc-src/accumulator.m /^:- import_module parse_tree.$/
pat c-src/etags.c 262
pattern c-src/etags.c 260
pdlcount c-src/emacs/src/lisp.h 3046
@@ -3990,6 +4067,7 @@ removeexp prol-src/natded.prolog /^removeexp(E,E,'NIL'):-!.$/
reorder_modifiers c-src/emacs/src/keyboard.c /^reorder_modifiers (Lisp_Object symbol)$/
request c.c /^request request (a, b)$/
requeued_events_pending_p c-src/emacs/src/keyboard.c /^requeued_events_pending_p (void)$/
+require merc-src/accumulator.m /^:- import_module require.$/
required_argument c-src/getopt.h 90
reset-this-command-lengths c-src/emacs/src/keyboard.c /^DEFUN ("reset-this-command-lengths", Freset_this_c/
restore_getcjmp c-src/emacs/src/keyboard.c /^restore_getcjmp (sys_jmp_buf temp)$/
@@ -4062,6 +4140,7 @@ separator_names c-src/emacs/src/keyboard.c 7372
serializeToVars php-src/lce_functions.php /^ function serializeToVars($prefix)$/
serializeToVars php-src/lce_functions.php /^ function serializeToVars($prefix)$/
set cp-src/conway.hpp /^ void set(void) { alive = 1; }$/
+set merc-src/accumulator.m /^:- import_module set.$/
set-input-interrupt-mode c-src/emacs/src/keyboard.c /^DEFUN ("set-input-interrupt-mode", Fset_input_inte/
set-input-meta-mode c-src/emacs/src/keyboard.c /^DEFUN ("set-input-meta-mode", Fset_input_meta_mode/
set-input-mode c-src/emacs/src/keyboard.c /^DEFUN ("set-input-mode", Fset_input_mode, Sset_inp/
@@ -4089,11 +4168,14 @@ set_sub_char_table_contents c-src/emacs/src/lisp.h /^set_sub_char_table_contents
set_symbol_function c-src/emacs/src/lisp.h /^set_symbol_function (Lisp_Object sym, Lisp_Object /
set_symbol_next c-src/emacs/src/lisp.h /^set_symbol_next (Lisp_Object sym, struct Lisp_Symb/
set_symbol_plist c-src/emacs/src/lisp.h /^set_symbol_plist (Lisp_Object sym, Lisp_Object pli/
+set_upto merc-src/accumulator.m /^:- func set_upto(accu_case, int) = set(accu_goal_i/
set_waiting_for_input c-src/emacs/src/keyboard.c /^set_waiting_for_input (struct timespec *time_to_cl/
setref tex-src/texinfo.tex /^\\expandafter\\expandafter\\expandafter\\appendixsetre/
setup cp-src/c.C 5
shift cp-src/functions.cpp /^void Date::shift ( void ){\/\/Shift this date to pre/
shouldLoad objc-src/PackInsp.m /^-(BOOL)shouldLoad$/
+should_attempt_accu_transform merc-src/accumulator.m /^:- pred should_attempt_accu_transform(module_info:/
+should_attempt_accu_transform_2 merc-src/accumulator.m /^:- pred should_attempt_accu_transform_2(module_inf/
should_see_this_array_type cp-src/c.C 156
should_see_this_function_pointer cp-src/c.C 153
should_see_this_one_enclosed_in_extern_C cp-src/c.C 149
@@ -4123,6 +4205,7 @@ skip_non_spaces c-src/etags.c /^skip_non_spaces (char *cp)$/
skip_spaces c-src/etags.c /^skip_spaces (char *cp)$/
snarf-tag-function el-src/emacs/lisp/progmodes/etags.el /^(defvar snarf-tag-function nil$/
snone c-src/etags.c 2443
+solutions merc-src/accumulator.m /^:- import_module solutions.$/
some_mouse_moved c-src/emacs/src/keyboard.c /^some_mouse_moved (void)$/
space tex-src/texinfo.tex /^ {#2\\labelspace #1}\\dotfill\\doshortpageno{#3}}%/
space tex-src/texinfo.tex /^ \\dosubsubsecentry{#2.#3.#4.#5\\labelspace#1}{#6}}/
@@ -4172,10 +4255,13 @@ step cp-src/conway.hpp /^ void step(void) { alive = next_alive; }$/
step cp-src/clheir.hpp /^ virtual void step(void) { }$/
step_everybody cp-src/clheir.cpp /^void step_everybody(void)$/
stop_polling c-src/emacs/src/keyboard.c /^stop_polling (void)$/
+store_info merc-src/accumulator.m /^:- type store_info$/
store_user_signal_events c-src/emacs/src/keyboard.c /^store_user_signal_events (void)$/
+stored_goal_plain_call merc-src/accumulator.m /^:- inst stored_goal_plain_call for goal_store.stor/
str go-src/test1.go 9
strcaseeq c-src/etags.c /^#define strcaseeq(s,t) (assert ((s)!=NULL && (t)!=/
streq c-src/etags.c /^#define streq(s,t) (assert ((s)!=NULL || (t)!=NULL/
+string merc-src/accumulator.m /^:- import_module string.$/
string_intervals c-src/emacs/src/lisp.h /^string_intervals (Lisp_Object s)$/
stripLine php-src/lce_functions.php /^ function stripLine($line, $class)$/
stripname pas-src/common.pas /^function stripname; (* ($/
@@ -4315,6 +4401,7 @@ tee ruby-src/test1.ru /^ attr_accessor :tee$/
tee= ruby-src/test1.ru /^ attr_accessor :tee$/
temporarily_switch_to_single_kboard c-src/emacs/src/keyboard.c /^temporarily_switch_to_single_kboard (struct frame /
tend c-src/etags.c 2432
+term merc-src/accumulator.m /^:- import_module term.$/
terminate objc-src/Subprocess.m /^- terminate:sender$/
terminateInput objc-src/Subprocess.m /^- terminateInput$/
test c-src/emacs/src/lisp.h 1871
@@ -4326,6 +4413,7 @@ test php-src/ptest.php /^test $/
test-begin scm-src/test.scm /^(define-syntax test-begin$/
test.me22b lua-src/test.lua /^ local function test.me22b (one)$/
test.me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/
+test1 rs-src/test.rs /^fn test1() {$/
test_undefined c-src/emacs/src/keyboard.c /^test_undefined (Lisp_Object binding)$/
texttreelist prol-src/natded.prolog /^texttreelist([]).$/
there-is-a-=-in-the-middle! scm-src/test.scm /^(define (there-is-a-=-in-the-middle!) #t)$/
@@ -4365,6 +4453,7 @@ tool_bar_items c-src/emacs/src/keyboard.c /^tool_bar_items (Lisp_Object reuse, i
tool_bar_items_vector c-src/emacs/src/keyboard.c 7965
toolkit_menubar_in_use c-src/emacs/src/keyboard.c /^toolkit_menubar_in_use (struct frame *f)$/
top-level c-src/emacs/src/keyboard.c /^DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, /
+top_level merc-src/accumulator.m /^:- type top_level$/
top_level_1 c-src/emacs/src/keyboard.c /^top_level_1 (Lisp_Object ignore)$/
top_level_2 c-src/emacs/src/keyboard.c /^top_level_2 (void)$/
total_keys c-src/emacs/src/keyboard.c 97
@@ -4421,12 +4510,15 @@ unblock_input c-src/emacs/src/keyboard.c /^unblock_input (void)$/
unblock_input_to c-src/emacs/src/keyboard.c /^unblock_input_to (int level)$/
unchar c-src/h.h 99
unexpand-abbrev c-src/abbrev.c /^DEFUN ("unexpand-abbrev", Funexpand_abbrev, Sunexp/
+univ merc-src/accumulator.m /^:- import_module univ.$/
+unravel_univ merc-src/accumulator.m /^:- some [T] pred unravel_univ(univ::in, T::out) is/
unread_switch_frame c-src/emacs/src/keyboard.c 204
unsignedp y-src/cccp.y 112
unwind c-src/emacs/src/lisp.h 2962
unwind_int c-src/emacs/src/lisp.h 2972
unwind_ptr c-src/emacs/src/lisp.h 2967
unwind_void c-src/emacs/src/lisp.h 2976
+update_accumulator_pred merc-src/accumulator.m /^:- pred update_accumulator_pred(pred_id::in, proc_/
uprintmax_t c-src/emacs/src/lisp.h 149
uprintmax_t c-src/emacs/src/lisp.h 154
usage perl-src/yagrip.pl /^sub usage {$/
@@ -4458,6 +4550,7 @@ varargs tex-src/texinfo.tex /^\\defvarargs {#3}\\endgroup %$/
varargs tex-src/texinfo.tex /^\\defvarargs {#3}\\endgroup %$/
varargs tex-src/texinfo.tex /^\\defvarargs {#2}\\endgroup %$/
varargs tex-src/texinfo.tex /^\\defvarargs {#2}\\endgroup %$/
+varset merc-src/accumulator.m /^:- import_module varset.$/
vcopy c-src/emacs/src/lisp.h /^vcopy (Lisp_Object v, ptrdiff_t offset, Lisp_Objec/
vectorlike_header c-src/emacs/src/lisp.h 1343
verde cp-src/c.C 40
diff --git a/test/manual/etags/ETAGS.good_1 b/test/manual/etags/ETAGS.good_1
index 3de15514e79..4eae68b5c25 100644
--- a/test/manual/etags/ETAGS.good_1
+++ b/test/manual/etags/ETAGS.good_1
@@ -175,7 +175,7 @@ package body Truc.Bidule Truc.Bidule/b138,2153
protected body Bidule Bidule/b139,2181
protected body Machin_T Machin_T/b146,2281
-c-src/abbrev.c,2072
+c-src/abbrev.c,1957
Lisp_Object Vabbrev_table_name_list;43,1429
Lisp_Object Vglobal_abbrev_table;48,1574
Lisp_Object Vfundamental_mode_abbrev_table;52,1685
@@ -186,33 +186,31 @@ Lisp_Object Vabbrev_start_location_buffer;66,2046
Lisp_Object Vlast_abbrev;70,2155
Lisp_Object Vlast_abbrev_text;75,2324
int last_abbrev_point;79,2414
-Lisp_Object Vpre_abbrev_expand_hook,83,2487
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;83,2487
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,85,2551
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table85,2551
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,92,2743
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table92,2743
-DEFUN ("define-abbrev", Fdefine_abbrev,107,3124
-DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev107,3124
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,149,4443
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev149,4443
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,160,4814
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev160,4814
-DEFUN ("abbrev-symbol", Fabbrev_symbol,174,5282
-DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol174,5282
-DEFUN ("abbrev-expansion", Fabbrev_expansion,202,6246
-DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion202,6246
-DEFUN ("expand-abbrev", Fexpand_abbrev,218,6761
-DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev218,6761
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,389,11682
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev389,11682
-write_abbrev 426,12889
-describe_abbrev 445,13324
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,466,13839
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description466,13839
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,506,14995
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table506,14995
-syms_of_abbrev 540,16072
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,82,2440
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table82,2440
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,89,2632
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table89,2632
+DEFUN ("define-abbrev", Fdefine_abbrev,104,3013
+DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev104,3013
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,146,4332
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev146,4332
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,157,4703
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev157,4703
+DEFUN ("abbrev-symbol", Fabbrev_symbol,171,5171
+DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol171,5171
+DEFUN ("abbrev-expansion", Fabbrev_expansion,199,6135
+DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion199,6135
+DEFUN ("expand-abbrev", Fexpand_abbrev,215,6650
+DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev215,6650
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,383,11495
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev383,11495
+write_abbrev 420,12702
+describe_abbrev 439,13137
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,460,13652
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description460,13652
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,500,14808
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table500,14808
+syms_of_abbrev 534,15885
c-src/torture.c,197
(*tag1 tag118,452
@@ -1039,155 +1037,155 @@ make_lispy_position 5228,157391
toolkit_menubar_in_use 5456,163954
make_scroll_bar_position 5469,164322
make_lispy_event 5485,164968
-make_lispy_movement 6104,183532
-make_lispy_switch_frame 6131,184263
-make_lispy_focus_in 6137,184370
-make_lispy_focus_out 6145,184496
-parse_modifiers_uncached 6163,184946
-#define SINGLE_LETTER_MOD(6185,185466
-#undef SINGLE_LETTER_MOD6212,185907
-#define MULTI_LETTER_MOD(6214,185933
-#undef MULTI_LETTER_MOD6231,186401
-apply_modifiers_uncached 6273,187575
-static const char *const modifier_names[modifier_names6319,189194
-#define NUM_MOD_NAMES 6325,189400
-static Lisp_Object modifier_symbols;6327,189450
-lispy_modifier_list 6331,189587
-#define KEY_TO_CHAR(6353,190253
-parse_modifiers 6356,190329
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191518
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191518
-apply_modifiers 6422,192392
-reorder_modifiers 6491,194721
-modify_event_symbol 6536,196529
-DEFUN ("event-convert-list", Fevent_convert_list,6628,199245
-DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199245
-parse_solitary_modifier 6695,201136
-#define SINGLE_LETTER_MOD(6701,201259
-#define MULTI_LETTER_MOD(6705,201344
-#undef SINGLE_LETTER_MOD6763,202642
-#undef MULTI_LETTER_MOD6764,202667
-lucid_event_type_list_p 6775,202890
-get_input_pending 6814,203961
-record_asynch_buffer_change 6834,204580
-gobble_input 6872,205703
-tty_read_avail_input 6967,208311
-handle_async_input 7149,214040
-process_pending_signals 7165,214360
-unblock_input_to 7177,214646
-unblock_input 7200,215278
-totally_unblock_input 7209,215446
-handle_input_available_signal 7217,215530
-deliver_input_available_signal 7226,215701
-struct user_signal_info7235,215866
-static struct user_signal_info *user_signals user_signals7250,216091
-add_user_signal 7253,216150
-handle_user_signal 7275,216599
-deliver_user_signal 7316,217559
-find_user_signal_name 7322,217660
-store_user_signal_events 7334,217842
-static Lisp_Object menu_bar_one_keymap_changed_items;7363,218417
-static Lisp_Object menu_bar_items_vector;7368,218631
-static int menu_bar_items_index;7369,218673
-static const char *separator_names[separator_names7372,218708
-menu_separator_name_p 7393,219149
-menu_bar_items 7426,219853
-Lisp_Object item_properties;7568,224604
-menu_bar_item 7571,224646
-menu_item_eval_property_1 7647,227176
-eval_dyn 7658,227466
-menu_item_eval_property 7666,227676
-parse_menu_item 7686,228342
-static Lisp_Object tool_bar_items_vector;7965,236337
-static Lisp_Object tool_bar_item_properties;7970,236511
-static int ntool_bar_items;7974,236607
-tool_bar_items 7990,237084
-process_tool_bar_item 8075,239893
-#define PROP(8112,240970
-set_prop 8114,241039
-parse_tool_bar_item 8167,242454
-#undef PROP8379,248845
-init_tool_bar_items 8387,248970
-append_tool_bar_item 8401,249262
-read_char_x_menu_prompt 8443,250772
-read_char_minibuf_menu_prompt 8503,252446
-#define PUSH_C_STR(8527,253015
-follow_key 8726,258554
-active_maps 8733,258696
-typedef struct keyremap8742,259022
-} keyremap;8754,259465
-access_keymap_keyremap 8764,259809
-keyremap_step 8811,261451
-test_undefined 8867,262935
-read_key_sequence 8916,264862
-read_key_sequence_vs 9826,295822
-DEFUN ("read-key-sequence", Fread_key_sequence,9885,297295
-DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297295
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299983
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299983
-detect_input_pending 9950,300489
-detect_input_pending_ignore_squeezables 9959,300655
-detect_input_pending_run_timers 9967,300871
-clear_input_pending 9985,301363
-requeued_events_pending_p 9997,301733
-DEFUN ("input-pending-p", Finput_pending_p,10002,301814
-DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301814
-DEFUN ("recent-keys", Frecent_keys,10024,302597
-DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302597
-DEFUN ("this-command-keys", Fthis_command_keys,10055,303518
-DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303518
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303959
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303959
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304381
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304381
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304956
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304956
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305496
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305496
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306511
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306511
-DEFUN ("recursion-depth", Frecursion_depth,10158,307070
-DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307070
-DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307407
-DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307407
-DEFUN ("discard-input", Fdiscard_input,10203,308448
-DEFUN ("discard-input", Fdiscard_input,discard-input10203,308448
-DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308950
-DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308950
-stuff_buffered_input 10285,311046
-set_waiting_for_input 10323,312017
-clear_waiting_for_input 10337,312391
-handle_interrupt_signal 10351,312755
-deliver_interrupt_signal 10378,313643
-static int volatile force_quit_count;10387,313933
-handle_interrupt 10401,314415
-quit_throw_to_read_char 10541,318712
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319289
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319289
-DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320517
-DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320517
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321433
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321433
-DEFUN ("set-quit-char", Fset_quit_char,10694,322707
-DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322707
-DEFUN ("set-input-mode", Fset_input_mode,10729,323571
-DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323571
-DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324460
-DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324460
-DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325838
-DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325838
-DEFUN ("posn-at-point", Fposn_at_point,10824,327061
-DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327061
-init_kboard 10861,328215
-allocate_kboard 10893,329285
-wipe_kboard 10909,329638
-delete_kboard 10917,329752
-init_keyboard 10942,330282
-struct event_head11021,332697
-static const struct event_head head_table[head_table11027,332748
-syms_of_keyboard 11045,333578
-keys_of_keyboard 11841,367116
-mark_kboards 11916,370435
+make_lispy_movement 6104,183531
+make_lispy_switch_frame 6131,184262
+make_lispy_focus_in 6137,184369
+make_lispy_focus_out 6145,184495
+parse_modifiers_uncached 6163,184945
+#define SINGLE_LETTER_MOD(6185,185465
+#undef SINGLE_LETTER_MOD6212,185906
+#define MULTI_LETTER_MOD(6214,185932
+#undef MULTI_LETTER_MOD6231,186400
+apply_modifiers_uncached 6273,187574
+static const char *const modifier_names[modifier_names6319,189193
+#define NUM_MOD_NAMES 6325,189399
+static Lisp_Object modifier_symbols;6327,189449
+lispy_modifier_list 6331,189586
+#define KEY_TO_CHAR(6353,190252
+parse_modifiers 6356,190328
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191517
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191517
+apply_modifiers 6422,192391
+reorder_modifiers 6491,194720
+modify_event_symbol 6536,196528
+DEFUN ("event-convert-list", Fevent_convert_list,6628,199244
+DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199244
+parse_solitary_modifier 6695,201135
+#define SINGLE_LETTER_MOD(6701,201258
+#define MULTI_LETTER_MOD(6705,201343
+#undef SINGLE_LETTER_MOD6763,202641
+#undef MULTI_LETTER_MOD6764,202666
+lucid_event_type_list_p 6775,202889
+get_input_pending 6814,203960
+record_asynch_buffer_change 6834,204579
+gobble_input 6872,205702
+tty_read_avail_input 6967,208310
+handle_async_input 7149,214039
+process_pending_signals 7165,214359
+unblock_input_to 7177,214645
+unblock_input 7200,215277
+totally_unblock_input 7209,215445
+handle_input_available_signal 7217,215529
+deliver_input_available_signal 7226,215700
+struct user_signal_info7235,215865
+static struct user_signal_info *user_signals user_signals7250,216090
+add_user_signal 7253,216149
+handle_user_signal 7275,216598
+deliver_user_signal 7316,217558
+find_user_signal_name 7322,217659
+store_user_signal_events 7334,217841
+static Lisp_Object menu_bar_one_keymap_changed_items;7363,218416
+static Lisp_Object menu_bar_items_vector;7368,218630
+static int menu_bar_items_index;7369,218672
+static const char *separator_names[separator_names7372,218707
+menu_separator_name_p 7393,219148
+menu_bar_items 7426,219852
+Lisp_Object item_properties;7568,224603
+menu_bar_item 7571,224645
+menu_item_eval_property_1 7647,227175
+eval_dyn 7658,227465
+menu_item_eval_property 7666,227675
+parse_menu_item 7686,228341
+static Lisp_Object tool_bar_items_vector;7965,236336
+static Lisp_Object tool_bar_item_properties;7970,236510
+static int ntool_bar_items;7974,236606
+tool_bar_items 7990,237083
+process_tool_bar_item 8075,239892
+#define PROP(8112,240969
+set_prop 8114,241038
+parse_tool_bar_item 8167,242453
+#undef PROP8379,248844
+init_tool_bar_items 8387,248969
+append_tool_bar_item 8401,249261
+read_char_x_menu_prompt 8443,250771
+read_char_minibuf_menu_prompt 8503,252445
+#define PUSH_C_STR(8527,253014
+follow_key 8726,258553
+active_maps 8733,258695
+typedef struct keyremap8742,259021
+} keyremap;8754,259464
+access_keymap_keyremap 8764,259808
+keyremap_step 8811,261450
+test_undefined 8867,262934
+read_key_sequence 8916,264861
+read_key_sequence_vs 9826,295821
+DEFUN ("read-key-sequence", Fread_key_sequence,9885,297294
+DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297294
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299982
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299982
+detect_input_pending 9950,300488
+detect_input_pending_ignore_squeezables 9959,300654
+detect_input_pending_run_timers 9967,300870
+clear_input_pending 9985,301362
+requeued_events_pending_p 9997,301732
+DEFUN ("input-pending-p", Finput_pending_p,10002,301813
+DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301813
+DEFUN ("recent-keys", Frecent_keys,10024,302596
+DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302596
+DEFUN ("this-command-keys", Fthis_command_keys,10055,303517
+DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303517
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303958
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303958
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304380
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304380
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304955
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304955
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305495
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305495
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306510
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306510
+DEFUN ("recursion-depth", Frecursion_depth,10158,307069
+DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307069
+DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307406
+DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307406
+DEFUN ("discard-input", Fdiscard_input,10203,308447
+DEFUN ("discard-input", Fdiscard_input,discard-input10203,308447
+DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308949
+DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308949
+stuff_buffered_input 10285,311045
+set_waiting_for_input 10323,312016
+clear_waiting_for_input 10337,312390
+handle_interrupt_signal 10351,312754
+deliver_interrupt_signal 10378,313642
+static int volatile force_quit_count;10387,313932
+handle_interrupt 10401,314414
+quit_throw_to_read_char 10541,318711
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319288
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319288
+DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320516
+DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320516
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321432
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321432
+DEFUN ("set-quit-char", Fset_quit_char,10694,322706
+DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322706
+DEFUN ("set-input-mode", Fset_input_mode,10729,323570
+DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323570
+DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324459
+DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324459
+DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325837
+DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325837
+DEFUN ("posn-at-point", Fposn_at_point,10824,327060
+DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327060
+init_kboard 10861,328214
+allocate_kboard 10893,329284
+wipe_kboard 10909,329637
+delete_kboard 10917,329751
+init_keyboard 10942,330281
+struct event_head11021,332696
+static const struct event_head head_table[head_table11027,332747
+syms_of_keyboard 11045,333577
+keys_of_keyboard 11841,367115
+mark_kboards 11916,370434
c-src/emacs/src/lisp.h,20276
#define EMACS_LISP_H22,801
@@ -2143,11 +2141,11 @@ main(37,571
class D 41,622
D(43,659
-el-src/TAGTEST.EL,179
-(foo::defmumble bletch 1,0
-(defun foo==bar foo==bar2,33
-(defalias 'pending-delete-mode pending-delete-mode6,149
-(defalias (quote explicitly-quoted-pending-delete-mode)9,222
+el-src/TAGTEST.EL,181
+(foo::defmumble bletch 3,33
+(defun foo==bar foo==bar4,66
+(defalias 'pending-delete-mode pending-delete-mode8,182
+(defalias (quote explicitly-quoted-pending-delete-mode)11,255
el-src/emacs/lisp/progmodes/etags.el,5069
(defvar tags-file-name 34,1035
@@ -2906,22 +2904,22 @@ ord_add_element(71,1867
ord_del_element(85,2344
ord_disjoint(100,2783
ord_intersect(108,2953
-ord_intersection(126,3552
-ord_intersection3(130,3691
-ord_intersection(150,4531
-ord_intersection4(154,4703
-ord_intersection(176,5664
-ord_intersection2(181,5812
-ord_member(200,6318
-ord_seteq(216,6683
-ord_setproduct(225,6971
-ord_subset(240,7377
-ord_subtract(257,7861
-ord_symdiff(265,8054
-ord_union(288,8887
-ord_union4(303,9352
-ord_union(324,10171
-ord_union_all(329,10313
+ord_intersection(126,3553
+ord_intersection3(130,3692
+ord_intersection(150,4533
+ord_intersection4(154,4705
+ord_intersection(176,5666
+ord_intersection2(181,5814
+ord_member(200,6320
+ord_seteq(216,6685
+ord_setproduct(225,6973
+ord_subset(240,7379
+ord_subtract(257,7863
+ord_symdiff(265,8056
+ord_union(288,8889
+ord_union4(303,9354
+ord_union(324,10173
+ord_union_all(329,10315
prol-src/natded.prolog,2319
expandmng(100,2879
@@ -3136,6 +3134,11 @@ module A9,57
alias_method ( :foo2,foo237,586
A::Constant Constant42,655
+rs-src/test.rs,52
+enum IpAddrKind 3,11
+fn test1(8,48
+fn main(12,88
+
scm-src/test.scm,260
(define hello 1,0
(set! hello 3,32
@@ -3350,533 +3353,628 @@ tex-src/texinfo.tex,30627
\def\vritemindex #1{\vritemindex1068,35482
\def\tablez #1#2#3#4#5#6{\tablez1074,35631
\def\Edescription{\Edescription1077,35689
-\def\itemfont{\itemfont1082,35891
-\def\Etable{\Etable1090,36117
-\def\itemize{\itemize1103,36441
-\def\itemizezzz #1{\itemizezzz1105,36477
-\def\itemizey #1#2{\itemizey1110,36572
-\def#2{1119,36818
-\def\itemcontents{\itemcontents1120,36859
-\def\bullet{\bullet1123,36907
-\def\minus{\minus1124,36934
-\def\frenchspacing{\frenchspacing1128,37042
-\def\splitoff#1#2\endmark{\splitoff1134,37267
-\def\enumerate{\enumerate1140,37497
-\def\enumeratezzz #1{\enumeratezzz1141,37536
-\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37589
- \def\thearg{\thearg1146,37736
- \ifx\thearg\empty \def\thearg{\thearg1147,37755
-\def\numericenumerate{\numericenumerate1184,39089
-\def\lowercaseenumerate{\lowercaseenumerate1190,39219
-\def\uppercaseenumerate{\uppercaseenumerate1203,39566
-\def\startenumeration#1{\startenumeration1219,40056
-\def\alphaenumerate{\alphaenumerate1227,40238
-\def\capsenumerate{\capsenumerate1228,40273
-\def\Ealphaenumerate{\Ealphaenumerate1229,40307
-\def\Ecapsenumerate{\Ecapsenumerate1230,40341
-\def\itemizeitem{\itemizeitem1234,40421
-\def\newindex #1{\newindex1259,41278
-\def\defindex{\defindex1268,41567
-\def\newcodeindex #1{\newcodeindex1272,41675
-\def\defcodeindex{\defcodeindex1279,41935
-\def\synindex #1 #2 {\synindex1283,42115
-\def\syncodeindex #1 #2 {\syncodeindex1292,42455
-\def\doindex#1{\doindex1309,43134
-\def\singleindexer #1{\singleindexer1310,43193
-\def\docodeindex#1{\docodeindex1313,43305
-\def\singlecodeindexer #1{\singlecodeindexer1314,43372
-\def\indexdummies{\indexdummies1316,43430
-\def\_{\_1317,43450
-\def\w{\w1318,43478
-\def\bf{\bf1319,43505
-\def\rm{\rm1320,43534
-\def\sl{\sl1321,43563
-\def\sf{\sf1322,43592
-\def\tt{\tt1323,43620
-\def\gtr{\gtr1324,43648
-\def\less{\less1325,43678
-\def\hat{\hat1326,43710
-\def\char{\char1327,43740
-\def\TeX{\TeX1328,43772
-\def\dots{\dots1329,43802
-\def\copyright{\copyright1330,43835
-\def\tclose##1{\tclose1331,43878
-\def\code##1{\code1332,43923
-\def\samp##1{\samp1333,43964
-\def\t##1{\t1334,44005
-\def\r##1{\r1335,44040
-\def\i##1{\i1336,44075
-\def\b##1{\b1337,44110
-\def\cite##1{\cite1338,44145
-\def\key##1{\key1339,44186
-\def\file##1{\file1340,44225
-\def\var##1{\var1341,44266
-\def\kbd##1{\kbd1342,44305
-\def\indexdummyfont#1{\indexdummyfont1347,44461
-\def\indexdummytex{\indexdummytex1348,44487
-\def\indexdummydots{\indexdummydots1349,44511
-\def\indexnofonts{\indexnofonts1351,44537
-\let\w=\indexdummyfontdummyfont1352,44557
-\let\t=\indexdummyfontdummyfont1353,44580
-\let\r=\indexdummyfontdummyfont1354,44603
-\let\i=\indexdummyfontdummyfont1355,44626
-\let\b=\indexdummyfontdummyfont1356,44649
-\let\emph=\indexdummyfontdummyfont1357,44672
-\let\strong=\indexdummyfontdummyfont1358,44698
-\let\cite=\indexdummyfont=\indexdummyfont1359,44726
-\let\sc=\indexdummyfontdummyfont1360,44752
-\let\tclose=\indexdummyfontdummyfont1364,44924
-\let\code=\indexdummyfontdummyfont1365,44952
-\let\file=\indexdummyfontdummyfont1366,44978
-\let\samp=\indexdummyfontdummyfont1367,45004
-\let\kbd=\indexdummyfontdummyfont1368,45030
-\let\key=\indexdummyfontdummyfont1369,45055
-\let\var=\indexdummyfontdummyfont1370,45080
-\let\TeX=\indexdummytexdummytex1371,45105
-\let\dots=\indexdummydotsdummydots1372,45129
-\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45381
-\def\doind #1#2{\doind1384,45437
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45480
-\def\rawbackslashxx{\rawbackslashxx1389,45620
-{\indexnofontsnofonts1394,45882
-\def\dosubind #1#2#3{\dosubind1405,46193
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46241
-\def\rawbackslashxx{\rawbackslashxx1410,46345
-{\indexnofontsnofonts1414,46499
-\def\findex {\findex1443,47430
-\def\kindex {\kindex1444,47453
-\def\cindex {\cindex1445,47476
-\def\vindex {\vindex1446,47499
-\def\tindex {\tindex1447,47522
-\def\pindex {\pindex1448,47545
-\def\cindexsub {\cindexsub1450,47569
-\def\printindex{\printindex1462,47896
-\def\doprintindex#1{\doprintindex1464,47937
- \def\indexbackslash{\indexbackslash1481,48422
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48461
-\def\initial #1{\initial1517,49533
-\def\entry #1#2{\entry1523,49740
- \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50387
-\def\indexdotfill{\indexdotfill1549,50715
-\def\primary #1{\primary1552,50821
-\def\secondary #1#2{\secondary1556,50903
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50985
-\newbox\partialpageialpage1566,51158
-\def\begindoublecolumns{\begindoublecolumns1572,51316
- \output={\global\setbox\partialpage=ialpage=1573,51352
-\def\enddoublecolumns{\enddoublecolumns1577,51540
-\def\doublecolumnout{\doublecolumnout1580,51625
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51694
-\def\pagesofar{\pagesofar1584,51872
-\def\balancecolumns{\balancecolumns1588,52109
- \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52280
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52541
-\newcount \appendixno \appendixno = `\@no1627,53446
-\def\appendixletter{\appendixletter1628,53487
-\def\opencontents{\opencontents1632,53590
-\def\thischapter{\thischapter1637,53771
-\def\seccheck#1{\seccheck1638,53809
-\def\chapternofonts{\chapternofonts1643,53913
-\def\result{\result1646,53988
-\def\equiv{\equiv1647,54023
-\def\expansion{\expansion1648,54056
-\def\print{\print1649,54097
-\def\TeX{\TeX1650,54130
-\def\dots{\dots1651,54159
-\def\copyright{\copyright1652,54190
-\def\tt{\tt1653,54231
-\def\bf{\bf1654,54258
-\def\w{\w1655,54286
-\def\less{\less1656,54311
-\def\gtr{\gtr1657,54342
-\def\hat{\hat1658,54371
-\def\char{\char1659,54400
-\def\tclose##1{\tclose1660,54431
-\def\code##1{\code1661,54475
-\def\samp##1{\samp1662,54515
-\def\r##1{\r1663,54555
-\def\b##1{\b1664,54589
-\def\key##1{\key1665,54623
-\def\file##1{\file1666,54661
-\def\kbd##1{\kbd1667,54701
-\def\i##1{\i1669,54809
-\def\cite##1{\cite1670,54843
-\def\var##1{\var1671,54883
-\def\emph##1{\emph1672,54921
-\def\dfn##1{\dfn1673,54961
-\def\thischaptername{\thischaptername1676,55002
-\outer\def\chapter{\chapter1677,55041
-\def\chapterzzz #1{\chapterzzz1678,55082
-{\chapternofonts%nofonts%1687,55478
-\global\let\section = \numberedsec=1692,55631
-\global\let\subsection = \numberedsubsec=1693,55666
-\global\let\subsubsection = \numberedsubsubsec=1694,55707
-\outer\def\appendix{\appendix1697,55758
-\def\appendixzzz #1{\appendixzzz1698,55801
-\global\advance \appendixno by 1 \message{no1700,55878
-\chapmacro {#1}{Appendix \appendixletter}letter1701,55947
-\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56040
-{\chapternofonts%nofonts%1705,56112
- {#1}{Appendix \appendixletter}letter1707,56168
-\appendixnoderef %noderef1710,56268
-\global\let\section = \appendixsec=1711,56287
-\global\let\subsection = \appendixsubsec=1712,56322
-\global\let\subsubsection = \appendixsubsubsec=1713,56363
-\outer\def\top{\top1716,56414
-\outer\def\unnumbered{\unnumbered1717,56454
-\def\unnumberedzzz #1{\unnumberedzzz1718,56501
-{\chapternofonts%nofonts%1722,56664
-\global\let\section = \unnumberedsec=1727,56814
-\global\let\subsection = \unnumberedsubsec=1728,56851
-\global\let\subsubsection = \unnumberedsubsubsec=1729,56894
-\outer\def\numberedsec{\numberedsec1732,56947
-\def\seczzz #1{\seczzz1733,56988
-{\chapternofonts%nofonts%1736,57144
-\outer\def\appendixsection{\appendixsection1745,57330
-\outer\def\appendixsec{\appendixsec1746,57387
-\def\appendixsectionzzz #1{\appendixsectionzzz1747,57440
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57552
-{\chapternofonts%nofonts%1750,57620
-{#1}{\appendixletter}letter1752,57676
-\appendixnoderef %noderef1755,57776
-\outer\def\unnumberedsec{\unnumberedsec1759,57816
-\def\unnumberedseczzz #1{\unnumberedseczzz1760,57869
-{\chapternofonts%nofonts%1762,57964
-\outer\def\numberedsubsec{\numberedsubsec1770,58132
-\def\numberedsubseczzz #1{\numberedsubseczzz1771,58187
-{\chapternofonts%nofonts%1774,58366
-\outer\def\appendixsubsec{\appendixsubsec1783,58570
-\def\appendixsubseczzz #1{\appendixsubseczzz1784,58625
-\subsecheading {#1}{\appendixletter}letter1786,58747
-{\chapternofonts%nofonts%1787,58812
-{#1}{\appendixletter}letter1789,58871
-\appendixnoderef %noderef1792,58986
-\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59026
-\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59085
-{\chapternofonts%nofonts%1799,59186
-\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59357
-\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59418
-{\chapternofonts%nofonts%1812,59615
-\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59848
-\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59909
- {\appendixletter}letter1827,60048
-{\chapternofonts%nofonts%1828,60114
- {\appendixletter}letter1830,60179
-\appendixnoderef %noderef1834,60313
-\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60353
-\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60418
-{\chapternofonts%nofonts%1841,60525
-\def\infotop{\infotop1851,60854
-\def\infounnumbered{\infounnumbered1852,60892
-\def\infounnumberedsec{\infounnumberedsec1853,60937
-\def\infounnumberedsubsec{\infounnumberedsubsec1854,60988
-\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61045
-\def\infoappendix{\infoappendix1857,61109
-\def\infoappendixsec{\infoappendixsec1858,61150
-\def\infoappendixsubsec{\infoappendixsubsec1859,61197
-\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61250
-\def\infochapter{\infochapter1862,61310
-\def\infosection{\infosection1863,61349
-\def\infosubsection{\infosubsection1864,61388
-\def\infosubsubsection{\infosubsubsection1865,61433
-\global\let\section = \numberedsec=1870,61670
-\global\let\subsection = \numberedsubsec=1871,61705
-\global\let\subsubsection = \numberedsubsubsec=1872,61746
-\def\majorheading{\majorheading1886,62253
-\def\majorheadingzzz #1{\majorheadingzzz1887,62298
-\def\chapheading{\chapheading1893,62531
-\def\chapheadingzzz #1{\chapheadingzzz1894,62574
-\def\heading{\heading1899,62769
-\def\subheading{\subheading1901,62806
-\def\subsubheading{\subsubheading1903,62849
-\def\dobreak#1#2{\dobreak1910,63126
-\def\setchapterstyle #1 {\setchapterstyle1912,63204
-\def\chapbreak{\chapbreak1919,63459
-\def\chappager{\chappager1920,63509
-\def\chapoddpage{\chapoddpage1921,63547
-\def\setchapternewpage #1 {\setchapternewpage1923,63626
-\def\CHAPPAGoff{\CHAPPAGoff1925,63683
-\def\CHAPPAGon{\CHAPPAGon1929,63777
-\global\def\HEADINGSon{\HEADINGSon1932,63868
-\def\CHAPPAGodd{\CHAPPAGodd1934,63910
-\global\def\HEADINGSon{\HEADINGSon1937,64006
-\def\CHAPFplain{\CHAPFplain1941,64060
-\def\chfplain #1#2{\chfplain1945,64152
-\def\unnchfplain #1{\unnchfplain1956,64375
-\def\unnchfopen #1{\unnchfopen1964,64604
-\def\chfopen #1#2{\chfopen1970,64812
-\def\CHAPFopen{\CHAPFopen1975,64956
-\def\subsecheadingbreak{\subsecheadingbreak1982,65174
-\def\secheadingbreak{\secheadingbreak1985,65303
-\def\secheading #1#2#3{\secheading1993,65585
-\def\plainsecheading #1{\plainsecheading1994,65641
-\def\secheadingi #1{\secheadingi1995,65684
-\def\subsecheading #1#2#3#4{\subsecheading2006,66052
-\def\subsecheadingi #1{\subsecheadingi2007,66119
-\def\subsubsecfonts{\subsubsecfonts2014,66416
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66539
-\def\subsubsecheadingi #1{\subsubsecheadingi2018,66617
-\def\startcontents#1{\startcontents2032,67089
- \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67362
-\outer\def\contents{\contents2049,67721
-\outer\def\summarycontents{\summarycontents2057,67865
- \def\secentry ##1##2##3##4{\secentry2067,68236
- \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68271
- \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68306
- \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68347
- \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68385
- \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68432
-\def\chapentry#1#2#3{\chapentry2085,68866
-\def\shortchapentry#1#2#3{\shortchapentry2088,68983
- {#2\labelspace #1}space2091,69093
-\def\unnumbchapentry#1#2{\unnumbchapentry2094,69147
-\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69194
-\def\secentry#1#2#3#4{\secentry2102,69358
-\def\unnumbsecentry#1#2{\unnumbsecentry2103,69417
-\def\subsecentry#1#2#3#4#5{\subsecentry2106,69478
-\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69548
-\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69622
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69656
-\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69707
-\def\dochapentry#1#2{\dochapentry2123,70081
-\def\dosecentry#1#2{\dosecentry2138,70686
-\def\dosubsecentry#1#2{\dosubsecentry2145,70864
-\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71049
-\def\labelspace{\labelspace2160,71300
-\def\dopageno#1{\dopageno2162,71335
-\def\doshortpageno#1{\doshortpageno2163,71361
-\def\chapentryfonts{\chapentryfonts2165,71393
-\def\secentryfonts{\secentryfonts2166,71428
-\def\point{\point2192,72387
-\def\result{\result2194,72408
-\def\expansion{\expansion2195,72481
-\def\print{\print2196,72552
-\def\equiv{\equiv2198,72619
-\def\error{\error2218,73392
-\def\tex{\tex2224,73621
-\def\@{\@2242,74004
-\gdef\sepspaces{\def {\ }}}\2265,74736
-\def\aboveenvbreak{\aboveenvbreak2268,74818
-\def\afterenvbreak{\afterenvbreak2272,74984
-\def\ctl{\ctl2286,75495
-\def\ctr{\ctr2287,75567
-\def\cbl{\cbl2288,75606
-\def\cbr{\cbr2289,75646
-\def\carttop{\carttop2290,75685
-\def\cartbot{\cartbot2293,75793
-\long\def\cartouche{\cartouche2299,75933
-\def\Ecartouche{\Ecartouche2326,76721
-\def\lisp{\lisp2338,76856
-\def\Elisp{\Elisp2348,77203
-\def\next##1{\next2360,77529
-\def\Eexample{\Eexample2364,77571
-\def\Esmallexample{\Esmallexample2367,77618
-\def\smalllispx{\smalllispx2373,77796
-\def\Esmalllisp{\Esmalllisp2383,78150
-\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78506
-\def\next##1{\next2397,78563
-\def\display{\display2401,78643
-\def\Edisplay{\Edisplay2410,78962
-\def\next##1{\next2422,79273
-\def\format{\format2426,79376
-\def\Eformat{\Eformat2434,79672
-\def\next##1{\next2437,79761
-\def\flushleft{\flushleft2441,79813
-\def\Eflushleft{\Eflushleft2451,80184
-\def\next##1{\next2454,80277
-\def\flushright{\flushright2456,80299
-\def\Eflushright{\Eflushright2466,80671
-\def\next##1{\next2470,80802
-\def\quotation{\quotation2474,80860
-\def\Equotation{\Equotation2480,81052
-\def\setdeffont #1 {\setdeffont2493,81450
-\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81496
-\newskip\defargsindent \defargsindent=50ptargsindent2496,81539
-\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81582
-\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81625
-\def\activeparens{\activeparens2503,81823
-\def\opnr{\opnr2529,83035
-\def\lbrb{\lbrb2530,83100
-\def\defname #1#2{\defname2536,83301
-\advance\dimen2 by -\defbodyindentbodyindent2540,83419
-\advance\dimen3 by -\defbodyindentbodyindent2542,83473
-\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83527
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83669
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83744
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84113
-\advance\leftskip by -\defbodyindentbodyindent2557,84247
-\exdentamount=\defbodyindentbodyindent2558,84284
-\def\defparsebody #1#2#3{\defparsebody2568,84643
-\def#1{2572,84827
-\def#2{2573,84863
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84935
-\exdentamount=\defbodyindentbodyindent2576,85009
-\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85113
-\def#1{2585,85274
-\def#2##1 {2586,85310
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85393
-\exdentamount=\defbodyindentbodyindent2589,85467
-\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85552
-\def#1{2596,85713
-\def#2##1 ##2 {2597,85749
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85849
-\exdentamount=\defbodyindentbodyindent2601,85923
-\def\defvarparsebody #1#2#3{\defvarparsebody2608,86194
-\def#1{2612,86381
-\def#2{2613,86417
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86476
-\exdentamount=\defbodyindentbodyindent2616,86550
-\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86641
-\def#1{2625,86800
-\def#2##1 {2626,86836
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86906
-\exdentamount=\defbodyindentbodyindent2629,86980
-\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87052
-\def#1{2636,87216
-\def#2##1 ##2 {2637,87252
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87339
-\exdentamount=\defbodyindentbodyindent2641,87413
-\def\defunargs #1{\defunargs2664,88173
-\def\deftypefunargs #1{\deftypefunargs2676,88555
-\def\deffn{\deffn2690,88937
-\def\deffnheader #1#2#3{\deffnheader2692,88994
-\begingroup\defname {name2693,89042
-\def\defun{\defun2699,89187
-\def\defunheader #1#2{\defunheader2701,89240
-\begingroup\defname {name2702,89315
-\defunargs {unargs2703,89351
-\def\deftypefun{\deftypefun2709,89499
-\def\deftypefunheader #1#2{\deftypefunheader2712,89621
-\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89730
-\begingroup\defname {name2716,89822
-\deftypefunargs {typefunargs2717,89868
-\def\deftypefn{\deftypefn2723,90039
-\def\deftypefnheader #1#2#3{\deftypefnheader2726,90188
-\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90324
-\begingroup\defname {name2730,90417
-\deftypefunargs {typefunargs2731,90457
-\def\defmac{\defmac2737,90578
-\def\defmacheader #1#2{\defmacheader2739,90635
-\begingroup\defname {name2740,90711
-\defunargs {unargs2741,90744
-\def\defspec{\defspec2747,90868
-\def\defspecheader #1#2{\defspecheader2749,90929
-\begingroup\defname {name2750,91006
-\defunargs {unargs2751,91046
-\def\deffnx #1 {\deffnx2758,91241
-\def\defunx #1 {\defunx2759,91298
-\def\defmacx #1 {\defmacx2760,91355
-\def\defspecx #1 {\defspecx2761,91414
-\def\deftypefnx #1 {\deftypefnx2762,91475
-\def\deftypeunx #1 {\deftypeunx2763,91540
-\def\defop #1 {\defop2769,91686
-\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91721
-\def\defopheader #1#2#3{\defopheader2772,91775
-\begingroup\defname {name2774,91864
-\defunargs {unargs2775,91910
-\def\defmethod{\defmethod2780,91971
-\def\defmethodheader #1#2#3{\defmethodheader2782,92044
-\begingroup\defname {name2784,92132
-\defunargs {unargs2785,92172
-\def\defcv #1 {\defcv2790,92246
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92281
-\def\defcvarheader #1#2#3{\defcvarheader2793,92340
-\begingroup\defname {name2795,92426
-\defvarargs {varargs2796,92472
-\def\defivar{\defivar2801,92545
-\def\defivarheader #1#2#3{\defivarheader2803,92608
-\begingroup\defname {name2805,92694
-\defvarargs {varargs2806,92745
-\def\defopx #1 {\defopx2812,92894
-\def\defmethodx #1 {\defmethodx2813,92951
-\def\defcvx #1 {\defcvx2814,93016
-\def\defivarx #1 {\defivarx2815,93073
-\def\defvarargs #1{\defvarargs2822,93344
-\def\defvr{\defvr2828,93488
-\def\defvrheader #1#2#3{\defvrheader2830,93543
-\begingroup\defname {name2831,93591
-\def\defvar{\defvar2835,93676
-\def\defvarheader #1#2{\defvarheader2837,93736
-\begingroup\defname {name2838,93807
-\defvarargs {varargs2839,93843
-\def\defopt{\defopt2844,93909
-\def\defoptheader #1#2{\defoptheader2846,93969
-\begingroup\defname {name2847,94040
-\defvarargs {varargs2848,94079
-\def\deftypevar{\deftypevar2853,94136
-\def\deftypevarheader #1#2{\deftypevarheader2856,94252
-\begingroup\defname {name2858,94335
-\def\deftypevr{\deftypevr2865,94509
-\def\deftypevrheader #1#2#3{\deftypevrheader2867,94580
-\begingroup\defname {name2868,94632
-\def\defvrx #1 {\defvrx2876,94869
-\def\defvarx #1 {\defvarx2877,94926
-\def\defoptx #1 {\defoptx2878,94985
-\def\deftypevarx #1 {\deftypevarx2879,95044
-\def\deftypevrx #1 {\deftypevrx2880,95111
-\def\deftpargs #1{\deftpargs2885,95260
-\def\deftp{\deftp2889,95340
-\def\deftpheader #1#2#3{\deftpheader2891,95395
-\begingroup\defname {name2892,95443
-\def\deftpx #1 {\deftpx2897,95602
-\def\setref#1{\setref2908,95923
-\def\unnumbsetref#1{\unnumbsetref2913,96037
-\def\appendixsetref#1{\appendixsetref2918,96144
-\def\pxref#1{\pxref2929,96555
-\def\xref#1{\xref2930,96591
-\def\ref#1{\ref2931,96626
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96656
-\def\printedmanual{\printedmanual2933,96699
-\def\printednodename{\printednodename2934,96737
-\def\printednodename{\printednodename2939,96862
-section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97495
-\refx{x2957,97573
-\def\dosetq #1#2{\dosetq2965,97793
-\def\internalsetq #1#2{\internalsetq2973,98051
-\def\Ypagenumber{\Ypagenumber2977,98152
-\def\Ytitle{\Ytitle2979,98178
-\def\Ynothing{\Ynothing2981,98205
-\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98222
-\def\Yappendixletterandtype{\Yappendixletterandtype2992,98538
-\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98568
-\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98623
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98727
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98798
- \def\linenumber{\linenumber3009,99137
-\def\refx#1#2{\refx3015,99321
-\def\xrdef #1#2{\xrdef3037,99947
-\def\readauxfile{\readauxfile3040,100032
-\def\supereject{\supereject3110,101813
-\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102498
-\def\openindices{\openindices3139,102684
-\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102909
-\parindent = \defaultparindentaultparindent3152,102961
-\def\smallbook{\smallbook3175,103685
-\global\def\Esmallexample{\Esmallexample3192,104112
-\def\afourpaper{\afourpaper3196,104203
-\def\finalout{\finalout3224,105011
-\def\normaldoublequote{\normaldoublequote3235,105272
-\def\normaltilde{\normaltilde3236,105298
-\def\normalcaret{\normalcaret3237,105318
-\def\normalunderscore{\normalunderscore3238,105338
-\def\normalverticalbar{\normalverticalbar3239,105363
-\def\normalless{\normalless3240,105389
-\def\normalgreater{\normalgreater3241,105408
-\def\normalplus{\normalplus3242,105430
-\def\ifusingtt#1#2{\ifusingtt3253,105922
-\def\activedoublequote{\activedoublequote3261,106250
-\def~{~3264,106336
-\def^{^3267,106397
-\def_{_3270,106436
-\def\_{\_3272,106510
-\def\lvvmode{\lvvmode3279,106847
-\def|{|3282,106897
-\def<{<3285,106960
-\def>{>3288,107017
-\def+{+3290,107055
-\def\turnoffactive{\turnoffactive3296,107216
-\global\def={=3307,107502
-\def\normalbackslash{\normalbackslash3321,107884
+\def\itemfont{\itemfont1082,35890
+\def\Etable{\Etable1090,36116
+\def\itemize{\itemize1103,36440
+\def\itemizezzz #1{\itemizezzz1105,36476
+\def\itemizey #1#2{\itemizey1110,36571
+\def#2{1119,36817
+\def\itemcontents{\itemcontents1120,36858
+\def\bullet{\bullet1123,36906
+\def\minus{\minus1124,36933
+\def\frenchspacing{\frenchspacing1128,37041
+\def\splitoff#1#2\endmark{\splitoff1134,37266
+\def\enumerate{\enumerate1140,37496
+\def\enumeratezzz #1{\enumeratezzz1141,37535
+\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37588
+ \def\thearg{\thearg1146,37735
+ \ifx\thearg\empty \def\thearg{\thearg1147,37754
+\def\numericenumerate{\numericenumerate1184,39088
+\def\lowercaseenumerate{\lowercaseenumerate1190,39218
+\def\uppercaseenumerate{\uppercaseenumerate1203,39565
+\def\startenumeration#1{\startenumeration1219,40055
+\def\alphaenumerate{\alphaenumerate1227,40237
+\def\capsenumerate{\capsenumerate1228,40272
+\def\Ealphaenumerate{\Ealphaenumerate1229,40306
+\def\Ecapsenumerate{\Ecapsenumerate1230,40340
+\def\itemizeitem{\itemizeitem1234,40420
+\def\newindex #1{\newindex1259,41277
+\def\defindex{\defindex1268,41566
+\def\newcodeindex #1{\newcodeindex1272,41674
+\def\defcodeindex{\defcodeindex1279,41934
+\def\synindex #1 #2 {\synindex1283,42114
+\def\syncodeindex #1 #2 {\syncodeindex1292,42454
+\def\doindex#1{\doindex1309,43133
+\def\singleindexer #1{\singleindexer1310,43192
+\def\docodeindex#1{\docodeindex1313,43304
+\def\singlecodeindexer #1{\singlecodeindexer1314,43371
+\def\indexdummies{\indexdummies1316,43429
+\def\_{\_1317,43449
+\def\w{\w1318,43477
+\def\bf{\bf1319,43504
+\def\rm{\rm1320,43533
+\def\sl{\sl1321,43562
+\def\sf{\sf1322,43591
+\def\tt{\tt1323,43619
+\def\gtr{\gtr1324,43647
+\def\less{\less1325,43677
+\def\hat{\hat1326,43709
+\def\char{\char1327,43739
+\def\TeX{\TeX1328,43771
+\def\dots{\dots1329,43801
+\def\copyright{\copyright1330,43834
+\def\tclose##1{\tclose1331,43877
+\def\code##1{\code1332,43922
+\def\samp##1{\samp1333,43963
+\def\t##1{\t1334,44004
+\def\r##1{\r1335,44039
+\def\i##1{\i1336,44074
+\def\b##1{\b1337,44109
+\def\cite##1{\cite1338,44144
+\def\key##1{\key1339,44185
+\def\file##1{\file1340,44224
+\def\var##1{\var1341,44265
+\def\kbd##1{\kbd1342,44304
+\def\indexdummyfont#1{\indexdummyfont1347,44460
+\def\indexdummytex{\indexdummytex1348,44486
+\def\indexdummydots{\indexdummydots1349,44510
+\def\indexnofonts{\indexnofonts1351,44536
+\let\w=\indexdummyfontdummyfont1352,44556
+\let\t=\indexdummyfontdummyfont1353,44579
+\let\r=\indexdummyfontdummyfont1354,44602
+\let\i=\indexdummyfontdummyfont1355,44625
+\let\b=\indexdummyfontdummyfont1356,44648
+\let\emph=\indexdummyfontdummyfont1357,44671
+\let\strong=\indexdummyfontdummyfont1358,44697
+\let\cite=\indexdummyfont=\indexdummyfont1359,44725
+\let\sc=\indexdummyfontdummyfont1360,44751
+\let\tclose=\indexdummyfontdummyfont1364,44923
+\let\code=\indexdummyfontdummyfont1365,44951
+\let\file=\indexdummyfontdummyfont1366,44977
+\let\samp=\indexdummyfontdummyfont1367,45003
+\let\kbd=\indexdummyfontdummyfont1368,45029
+\let\key=\indexdummyfontdummyfont1369,45054
+\let\var=\indexdummyfontdummyfont1370,45079
+\let\TeX=\indexdummytexdummytex1371,45104
+\let\dots=\indexdummydotsdummydots1372,45128
+\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45380
+\def\doind #1#2{\doind1384,45436
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45479
+\def\rawbackslashxx{\rawbackslashxx1389,45619
+{\indexnofontsnofonts1394,45881
+\def\dosubind #1#2#3{\dosubind1405,46192
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46240
+\def\rawbackslashxx{\rawbackslashxx1410,46344
+{\indexnofontsnofonts1414,46498
+\def\findex {\findex1443,47429
+\def\kindex {\kindex1444,47452
+\def\cindex {\cindex1445,47475
+\def\vindex {\vindex1446,47498
+\def\tindex {\tindex1447,47521
+\def\pindex {\pindex1448,47544
+\def\cindexsub {\cindexsub1450,47568
+\def\printindex{\printindex1462,47895
+\def\doprintindex#1{\doprintindex1464,47936
+ \def\indexbackslash{\indexbackslash1481,48421
+ \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48460
+\def\initial #1{\initial1517,49532
+\def\entry #1#2{\entry1523,49739
+ \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50386
+\def\indexdotfill{\indexdotfill1549,50714
+\def\primary #1{\primary1552,50820
+\def\secondary #1#2{\secondary1556,50902
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50984
+\newbox\partialpageialpage1566,51157
+\def\begindoublecolumns{\begindoublecolumns1572,51315
+ \output={\global\setbox\partialpage=ialpage=1573,51351
+\def\enddoublecolumns{\enddoublecolumns1577,51539
+\def\doublecolumnout{\doublecolumnout1580,51624
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51693
+\def\pagesofar{\pagesofar1584,51871
+\def\balancecolumns{\balancecolumns1588,52108
+ \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52279
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52540
+\newcount \appendixno \appendixno = `\@no1627,53445
+\def\appendixletter{\appendixletter1628,53486
+\def\opencontents{\opencontents1632,53589
+\def\thischapter{\thischapter1637,53770
+\def\seccheck#1{\seccheck1638,53808
+\def\chapternofonts{\chapternofonts1643,53912
+\def\result{\result1646,53987
+\def\equiv{\equiv1647,54022
+\def\expansion{\expansion1648,54055
+\def\print{\print1649,54096
+\def\TeX{\TeX1650,54129
+\def\dots{\dots1651,54158
+\def\copyright{\copyright1652,54189
+\def\tt{\tt1653,54230
+\def\bf{\bf1654,54257
+\def\w{\w1655,54285
+\def\less{\less1656,54310
+\def\gtr{\gtr1657,54341
+\def\hat{\hat1658,54370
+\def\char{\char1659,54399
+\def\tclose##1{\tclose1660,54430
+\def\code##1{\code1661,54474
+\def\samp##1{\samp1662,54514
+\def\r##1{\r1663,54554
+\def\b##1{\b1664,54588
+\def\key##1{\key1665,54622
+\def\file##1{\file1666,54660
+\def\kbd##1{\kbd1667,54700
+\def\i##1{\i1669,54808
+\def\cite##1{\cite1670,54842
+\def\var##1{\var1671,54882
+\def\emph##1{\emph1672,54920
+\def\dfn##1{\dfn1673,54960
+\def\thischaptername{\thischaptername1676,55001
+\outer\def\chapter{\chapter1677,55040
+\def\chapterzzz #1{\chapterzzz1678,55081
+{\chapternofonts%nofonts%1687,55477
+\global\let\section = \numberedsec=1692,55630
+\global\let\subsection = \numberedsubsec=1693,55665
+\global\let\subsubsection = \numberedsubsubsec=1694,55706
+\outer\def\appendix{\appendix1697,55757
+\def\appendixzzz #1{\appendixzzz1698,55800
+\global\advance \appendixno by 1 \message{no1700,55877
+\chapmacro {#1}{Appendix \appendixletter}letter1701,55946
+\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56039
+{\chapternofonts%nofonts%1705,56111
+ {#1}{Appendix \appendixletter}letter1707,56167
+\appendixnoderef %noderef1710,56267
+\global\let\section = \appendixsec=1711,56286
+\global\let\subsection = \appendixsubsec=1712,56321
+\global\let\subsubsection = \appendixsubsubsec=1713,56362
+\outer\def\top{\top1716,56413
+\outer\def\unnumbered{\unnumbered1717,56453
+\def\unnumberedzzz #1{\unnumberedzzz1718,56500
+{\chapternofonts%nofonts%1722,56663
+\global\let\section = \unnumberedsec=1727,56813
+\global\let\subsection = \unnumberedsubsec=1728,56850
+\global\let\subsubsection = \unnumberedsubsubsec=1729,56893
+\outer\def\numberedsec{\numberedsec1732,56946
+\def\seczzz #1{\seczzz1733,56987
+{\chapternofonts%nofonts%1736,57143
+\outer\def\appendixsection{\appendixsection1745,57329
+\outer\def\appendixsec{\appendixsec1746,57386
+\def\appendixsectionzzz #1{\appendixsectionzzz1747,57439
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57551
+{\chapternofonts%nofonts%1750,57619
+{#1}{\appendixletter}letter1752,57675
+\appendixnoderef %noderef1755,57775
+\outer\def\unnumberedsec{\unnumberedsec1759,57815
+\def\unnumberedseczzz #1{\unnumberedseczzz1760,57868
+{\chapternofonts%nofonts%1762,57963
+\outer\def\numberedsubsec{\numberedsubsec1770,58131
+\def\numberedsubseczzz #1{\numberedsubseczzz1771,58186
+{\chapternofonts%nofonts%1774,58365
+\outer\def\appendixsubsec{\appendixsubsec1783,58569
+\def\appendixsubseczzz #1{\appendixsubseczzz1784,58624
+\subsecheading {#1}{\appendixletter}letter1786,58746
+{\chapternofonts%nofonts%1787,58811
+{#1}{\appendixletter}letter1789,58870
+\appendixnoderef %noderef1792,58985
+\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59025
+\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59084
+{\chapternofonts%nofonts%1799,59185
+\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59356
+\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59417
+{\chapternofonts%nofonts%1812,59614
+\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59847
+\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59908
+ {\appendixletter}letter1827,60047
+{\chapternofonts%nofonts%1828,60113
+ {\appendixletter}letter1830,60178
+\appendixnoderef %noderef1834,60312
+\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60352
+\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60417
+{\chapternofonts%nofonts%1841,60524
+\def\infotop{\infotop1851,60853
+\def\infounnumbered{\infounnumbered1852,60891
+\def\infounnumberedsec{\infounnumberedsec1853,60936
+\def\infounnumberedsubsec{\infounnumberedsubsec1854,60987
+\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61044
+\def\infoappendix{\infoappendix1857,61108
+\def\infoappendixsec{\infoappendixsec1858,61149
+\def\infoappendixsubsec{\infoappendixsubsec1859,61196
+\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61249
+\def\infochapter{\infochapter1862,61309
+\def\infosection{\infosection1863,61348
+\def\infosubsection{\infosubsection1864,61387
+\def\infosubsubsection{\infosubsubsection1865,61432
+\global\let\section = \numberedsec=1870,61669
+\global\let\subsection = \numberedsubsec=1871,61704
+\global\let\subsubsection = \numberedsubsubsec=1872,61745
+\def\majorheading{\majorheading1886,62252
+\def\majorheadingzzz #1{\majorheadingzzz1887,62297
+\def\chapheading{\chapheading1893,62530
+\def\chapheadingzzz #1{\chapheadingzzz1894,62573
+\def\heading{\heading1899,62768
+\def\subheading{\subheading1901,62805
+\def\subsubheading{\subsubheading1903,62848
+\def\dobreak#1#2{\dobreak1910,63125
+\def\setchapterstyle #1 {\setchapterstyle1912,63203
+\def\chapbreak{\chapbreak1919,63458
+\def\chappager{\chappager1920,63508
+\def\chapoddpage{\chapoddpage1921,63546
+\def\setchapternewpage #1 {\setchapternewpage1923,63625
+\def\CHAPPAGoff{\CHAPPAGoff1925,63682
+\def\CHAPPAGon{\CHAPPAGon1929,63776
+\global\def\HEADINGSon{\HEADINGSon1932,63867
+\def\CHAPPAGodd{\CHAPPAGodd1934,63909
+\global\def\HEADINGSon{\HEADINGSon1937,64005
+\def\CHAPFplain{\CHAPFplain1941,64059
+\def\chfplain #1#2{\chfplain1945,64151
+\def\unnchfplain #1{\unnchfplain1956,64374
+\def\unnchfopen #1{\unnchfopen1964,64603
+\def\chfopen #1#2{\chfopen1970,64811
+\def\CHAPFopen{\CHAPFopen1975,64955
+\def\subsecheadingbreak{\subsecheadingbreak1982,65173
+\def\secheadingbreak{\secheadingbreak1985,65302
+\def\secheading #1#2#3{\secheading1993,65584
+\def\plainsecheading #1{\plainsecheading1994,65640
+\def\secheadingi #1{\secheadingi1995,65683
+\def\subsecheading #1#2#3#4{\subsecheading2006,66051
+\def\subsecheadingi #1{\subsecheadingi2007,66118
+\def\subsubsecfonts{\subsubsecfonts2014,66415
+\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66538
+\def\subsubsecheadingi #1{\subsubsecheadingi2018,66616
+\def\startcontents#1{\startcontents2032,67088
+ \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67361
+\outer\def\contents{\contents2049,67720
+\outer\def\summarycontents{\summarycontents2057,67864
+ \def\secentry ##1##2##3##4{\secentry2067,68235
+ \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68270
+ \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68305
+ \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68346
+ \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68384
+ \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68431
+\def\chapentry#1#2#3{\chapentry2085,68865
+\def\shortchapentry#1#2#3{\shortchapentry2088,68982
+ {#2\labelspace #1}space2091,69092
+\def\unnumbchapentry#1#2{\unnumbchapentry2094,69146
+\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69193
+\def\secentry#1#2#3#4{\secentry2102,69357
+\def\unnumbsecentry#1#2{\unnumbsecentry2103,69416
+\def\subsecentry#1#2#3#4#5{\subsecentry2106,69477
+\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69547
+\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69621
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69655
+\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69706
+\def\dochapentry#1#2{\dochapentry2123,70080
+\def\dosecentry#1#2{\dosecentry2138,70685
+\def\dosubsecentry#1#2{\dosubsecentry2145,70863
+\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71048
+\def\labelspace{\labelspace2160,71299
+\def\dopageno#1{\dopageno2162,71334
+\def\doshortpageno#1{\doshortpageno2163,71360
+\def\chapentryfonts{\chapentryfonts2165,71392
+\def\secentryfonts{\secentryfonts2166,71427
+\def\point{\point2192,72386
+\def\result{\result2194,72407
+\def\expansion{\expansion2195,72480
+\def\print{\print2196,72551
+\def\equiv{\equiv2198,72618
+\def\error{\error2218,73391
+\def\tex{\tex2224,73620
+\def\@{\@2242,74003
+\gdef\sepspaces{\def {\ }}}\2265,74735
+\def\aboveenvbreak{\aboveenvbreak2268,74817
+\def\afterenvbreak{\afterenvbreak2272,74983
+\def\ctl{\ctl2286,75494
+\def\ctr{\ctr2287,75566
+\def\cbl{\cbl2288,75605
+\def\cbr{\cbr2289,75645
+\def\carttop{\carttop2290,75684
+\def\cartbot{\cartbot2293,75792
+\long\def\cartouche{\cartouche2299,75932
+\def\Ecartouche{\Ecartouche2326,76720
+\def\lisp{\lisp2338,76855
+\def\Elisp{\Elisp2348,77202
+\def\next##1{\next2360,77528
+\def\Eexample{\Eexample2364,77570
+\def\Esmallexample{\Esmallexample2367,77617
+\def\smalllispx{\smalllispx2373,77795
+\def\Esmalllisp{\Esmalllisp2383,78149
+\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78505
+\def\next##1{\next2397,78562
+\def\display{\display2401,78642
+\def\Edisplay{\Edisplay2410,78961
+\def\next##1{\next2422,79272
+\def\format{\format2426,79375
+\def\Eformat{\Eformat2434,79671
+\def\next##1{\next2437,79760
+\def\flushleft{\flushleft2441,79812
+\def\Eflushleft{\Eflushleft2451,80183
+\def\next##1{\next2454,80276
+\def\flushright{\flushright2456,80298
+\def\Eflushright{\Eflushright2466,80670
+\def\next##1{\next2470,80801
+\def\quotation{\quotation2474,80859
+\def\Equotation{\Equotation2480,81051
+\def\setdeffont #1 {\setdeffont2493,81449
+\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81495
+\newskip\defargsindent \defargsindent=50ptargsindent2496,81538
+\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81581
+\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81624
+\def\activeparens{\activeparens2503,81822
+\def\opnr{\opnr2529,83034
+\def\lbrb{\lbrb2530,83099
+\def\defname #1#2{\defname2536,83300
+\advance\dimen2 by -\defbodyindentbodyindent2540,83418
+\advance\dimen3 by -\defbodyindentbodyindent2542,83472
+\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83526
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83668
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83743
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84112
+\advance\leftskip by -\defbodyindentbodyindent2557,84246
+\exdentamount=\defbodyindentbodyindent2558,84283
+\def\defparsebody #1#2#3{\defparsebody2568,84642
+\def#1{2572,84826
+\def#2{2573,84862
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84934
+\exdentamount=\defbodyindentbodyindent2576,85008
+\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85112
+\def#1{2585,85273
+\def#2##1 {2586,85309
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85392
+\exdentamount=\defbodyindentbodyindent2589,85466
+\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85551
+\def#1{2596,85712
+\def#2##1 ##2 {2597,85748
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85848
+\exdentamount=\defbodyindentbodyindent2601,85922
+\def\defvarparsebody #1#2#3{\defvarparsebody2608,86193
+\def#1{2612,86380
+\def#2{2613,86416
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86475
+\exdentamount=\defbodyindentbodyindent2616,86549
+\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86640
+\def#1{2625,86799
+\def#2##1 {2626,86835
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86905
+\exdentamount=\defbodyindentbodyindent2629,86979
+\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87051
+\def#1{2636,87215
+\def#2##1 ##2 {2637,87251
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87338
+\exdentamount=\defbodyindentbodyindent2641,87412
+\def\defunargs #1{\defunargs2664,88172
+\def\deftypefunargs #1{\deftypefunargs2676,88554
+\def\deffn{\deffn2690,88936
+\def\deffnheader #1#2#3{\deffnheader2692,88993
+\begingroup\defname {name2693,89041
+\def\defun{\defun2699,89186
+\def\defunheader #1#2{\defunheader2701,89239
+\begingroup\defname {name2702,89314
+\defunargs {unargs2703,89350
+\def\deftypefun{\deftypefun2709,89498
+\def\deftypefunheader #1#2{\deftypefunheader2712,89620
+\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89729
+\begingroup\defname {name2716,89821
+\deftypefunargs {typefunargs2717,89867
+\def\deftypefn{\deftypefn2723,90038
+\def\deftypefnheader #1#2#3{\deftypefnheader2726,90187
+\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90323
+\begingroup\defname {name2730,90416
+\deftypefunargs {typefunargs2731,90456
+\def\defmac{\defmac2737,90577
+\def\defmacheader #1#2{\defmacheader2739,90634
+\begingroup\defname {name2740,90710
+\defunargs {unargs2741,90743
+\def\defspec{\defspec2747,90867
+\def\defspecheader #1#2{\defspecheader2749,90928
+\begingroup\defname {name2750,91005
+\defunargs {unargs2751,91045
+\def\deffnx #1 {\deffnx2758,91240
+\def\defunx #1 {\defunx2759,91297
+\def\defmacx #1 {\defmacx2760,91354
+\def\defspecx #1 {\defspecx2761,91413
+\def\deftypefnx #1 {\deftypefnx2762,91474
+\def\deftypeunx #1 {\deftypeunx2763,91539
+\def\defop #1 {\defop2769,91685
+\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91720
+\def\defopheader #1#2#3{\defopheader2772,91774
+\begingroup\defname {name2774,91863
+\defunargs {unargs2775,91909
+\def\defmethod{\defmethod2780,91970
+\def\defmethodheader #1#2#3{\defmethodheader2782,92043
+\begingroup\defname {name2784,92131
+\defunargs {unargs2785,92171
+\def\defcv #1 {\defcv2790,92245
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92280
+\def\defcvarheader #1#2#3{\defcvarheader2793,92339
+\begingroup\defname {name2795,92425
+\defvarargs {varargs2796,92471
+\def\defivar{\defivar2801,92544
+\def\defivarheader #1#2#3{\defivarheader2803,92607
+\begingroup\defname {name2805,92693
+\defvarargs {varargs2806,92744
+\def\defopx #1 {\defopx2812,92893
+\def\defmethodx #1 {\defmethodx2813,92950
+\def\defcvx #1 {\defcvx2814,93015
+\def\defivarx #1 {\defivarx2815,93072
+\def\defvarargs #1{\defvarargs2822,93343
+\def\defvr{\defvr2828,93487
+\def\defvrheader #1#2#3{\defvrheader2830,93542
+\begingroup\defname {name2831,93590
+\def\defvar{\defvar2835,93675
+\def\defvarheader #1#2{\defvarheader2837,93735
+\begingroup\defname {name2838,93806
+\defvarargs {varargs2839,93842
+\def\defopt{\defopt2844,93908
+\def\defoptheader #1#2{\defoptheader2846,93968
+\begingroup\defname {name2847,94039
+\defvarargs {varargs2848,94078
+\def\deftypevar{\deftypevar2853,94135
+\def\deftypevarheader #1#2{\deftypevarheader2856,94251
+\begingroup\defname {name2858,94334
+\def\deftypevr{\deftypevr2865,94508
+\def\deftypevrheader #1#2#3{\deftypevrheader2867,94579
+\begingroup\defname {name2868,94631
+\def\defvrx #1 {\defvrx2876,94868
+\def\defvarx #1 {\defvarx2877,94925
+\def\defoptx #1 {\defoptx2878,94984
+\def\deftypevarx #1 {\deftypevarx2879,95043
+\def\deftypevrx #1 {\deftypevrx2880,95110
+\def\deftpargs #1{\deftpargs2885,95259
+\def\deftp{\deftp2889,95339
+\def\deftpheader #1#2#3{\deftpheader2891,95394
+\begingroup\defname {name2892,95442
+\def\deftpx #1 {\deftpx2897,95601
+\def\setref#1{\setref2908,95922
+\def\unnumbsetref#1{\unnumbsetref2913,96036
+\def\appendixsetref#1{\appendixsetref2918,96143
+\def\pxref#1{\pxref2929,96554
+\def\xref#1{\xref2930,96590
+\def\ref#1{\ref2931,96625
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96655
+\def\printedmanual{\printedmanual2933,96698
+\def\printednodename{\printednodename2934,96736
+\def\printednodename{\printednodename2939,96861
+section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97493
+\refx{x2957,97571
+\def\dosetq #1#2{\dosetq2965,97791
+\def\internalsetq #1#2{\internalsetq2973,98049
+\def\Ypagenumber{\Ypagenumber2977,98150
+\def\Ytitle{\Ytitle2979,98176
+\def\Ynothing{\Ynothing2981,98203
+\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98220
+\def\Yappendixletterandtype{\Yappendixletterandtype2992,98536
+\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98566
+\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98621
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98725
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98796
+ \def\linenumber{\linenumber3009,99135
+\def\refx#1#2{\refx3015,99319
+\def\xrdef #1#2{\xrdef3037,99945
+\def\readauxfile{\readauxfile3040,100030
+\def\supereject{\supereject3110,101811
+\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102496
+\def\openindices{\openindices3139,102682
+\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102907
+\parindent = \defaultparindentaultparindent3152,102959
+\def\smallbook{\smallbook3175,103683
+\global\def\Esmallexample{\Esmallexample3192,104110
+\def\afourpaper{\afourpaper3196,104201
+\def\finalout{\finalout3224,105009
+\def\normaldoublequote{\normaldoublequote3235,105270
+\def\normaltilde{\normaltilde3236,105296
+\def\normalcaret{\normalcaret3237,105316
+\def\normalunderscore{\normalunderscore3238,105336
+\def\normalverticalbar{\normalverticalbar3239,105361
+\def\normalless{\normalless3240,105387
+\def\normalgreater{\normalgreater3241,105406
+\def\normalplus{\normalplus3242,105428
+\def\ifusingtt#1#2{\ifusingtt3253,105920
+\def\activedoublequote{\activedoublequote3261,106248
+\def~{~3264,106334
+\def^{^3267,106395
+\def_{_3270,106434
+\def\_{\_3272,106508
+\def\lvvmode{\lvvmode3279,106845
+\def|{|3282,106895
+\def<{<3285,106958
+\def>{>3288,107015
+\def+{+3290,107053
+\def\turnoffactive{\turnoffactive3296,107214
+\global\def={=3307,107500
+\def\normalbackslash{\normalbackslash3321,107882
+
+merc-src/accumulator.m,3228
+:- interface146,5371
+:- import_module hlds148,5386
+:- import_module univ152,5478
+:- pred accu_transform_proc159,5793
+:- implementation166,6115
+:- import_module libs180,6552
+:- import_module mdbcomp184,6681
+:- import_module parse_tree186,6742
+:- import_module assoc_list194,7013
+:- import_module bool195,7042
+:- import_module int196,7065
+:- import_module io197,7087
+:- import_module list198,7108
+:- import_module map199,7131
+:- import_module maybe200,7153
+:- import_module pair201,7177
+:- import_module require202,7200
+:- import_module set203,7226
+:- import_module solutions204,7248
+:- import_module string205,7276
+:- import_module term206,7301
+:- import_module varset207,7324
+:- type top_level213,7499
+:- type accu_goal_id225,7900
+:- type accu_case228,7964
+:- type accu_goal_store234,8091
+:- type accu_subst238,8216
+:- type accu_warning240,8264
+:- pred generate_warnings334,12550
+:- pred generate_warning342,12895
+:- pred should_attempt_accu_transform365,13886
+:- pred should_attempt_accu_transform_2398,15406
+:- pred accu_standardize440,17390
+:- pred identify_goal_type465,18169
+:- pred is_recursive_case549,21175
+:- type store_info560,21713
+:- func initialize_goal_store570,22060
+:- pred accu_store580,22421
+:- pred identify_recursive_calls601,23288
+:- pred identify_out_and_out_prime626,24396
+:- type accu_sets676,26425
+:- pred accu_stage1689,26977
+:- pred accu_stage1_2727,28347
+:- pred accu_sets_init781,30557
+:- func set_upto796,30984
+:- pred accu_before812,31498
+:- pred accu_assoc835,32477
+:- pred accu_construct862,33712
+:- pred accu_construct_assoc896,35307
+:- pred accu_update938,37069
+:- pred member_lessthan_goalid964,38219
+:- type accu_assoc975,38652
+:- pred accu_is_associative986,39138
+:- pred associativity_assertion1014,40263
+:- pred commutativity_assertion1037,41242
+:- pred accu_is_update1057,41952
+:- pred is_associative_construction1078,42802
+:- type accu_substs1095,43480
+:- type accu_base1103,43744
+:- pred accu_stage21124,44605
+:- pred accu_substs_init1179,46957
+:- pred acc_var_subst_init1194,47573
+:- pred create_new_var1207,48147
+:- pred accu_process_assoc_set1223,48862
+:- pred accu_has_heuristic1297,52081
+:- pred accu_heuristic1304,52336
+:- pred accu_process_update_set1318,52906
+:- pred accu_divide_base_case1380,55844
+:- pred accu_related1412,57146
+:- inst stored_goal_plain_call1444,58415
+:- pred lookup_call1449,58601
+:- pred accu_stage31470,59432
+:- pred acc_proc_info1508,61326
+:- pred acc_pred_info1556,63449
+:- pred accu_create_goal1600,65285
+:- func create_acc_call1621,66400
+:- pred create_orig_goal1634,66987
+:- pred create_acc_goal1662,68157
+:- func create_new_orig_recursive_goals1709,70225
+:- func create_new_recursive_goals1723,70918
+:- func create_new_base_goals1738,71717
+:- pred acc_unification1749,72156
+:- pred accu_top_level1766,72896
+:- pred update_accumulator_pred1856,76290
+:- func accu_rename1876,77253
+:- func base_case_ids1889,77784
+:- func base_case_ids_set1898,78048
+:- func accu_goal_list1905,78269
+:- pred calculate_goal_info1916,78680
+:- func chain_subst1932,79319
+:- pred chain_subst_21938,79482
+:- some [T] pred unravel_univ1956,80060
+:- pragma foreign_export1957,80116
c-src/c.c,76
T f(1,0
@@ -3984,13 +4082,13 @@ yyerror FUN1(286,5948
make_list FUN2(293,6028
#define ERROR 304,6228
yylex FUN0(315,6405
-parse_cell_or_range FUN2(587,11771
-#define CK_ABS_R(671,13213
-#define CK_REL_R(675,13292
-#define CK_ABS_C(680,13421
-#define CK_REL_C(684,13500
-#define MAYBEREL(689,13629
-str_to_col FUN1(847,16830
+parse_cell_or_range FUN2(587,11772
+#define CK_ABS_R(671,13214
+#define CK_REL_R(675,13293
+#define CK_ABS_C(680,13422
+#define CK_REL_C(684,13501
+#define MAYBEREL(689,13630
+str_to_col FUN1(847,16831
y-src/parse.c,520
#define YYBISON 4,64
diff --git a/test/manual/etags/ETAGS.good_2 b/test/manual/etags/ETAGS.good_2
index ddb8d19540b..45979d6a763 100644
--- a/test/manual/etags/ETAGS.good_2
+++ b/test/manual/etags/ETAGS.good_2
@@ -175,7 +175,7 @@ package body Truc.Bidule Truc.Bidule/b138,2153
protected body Bidule Bidule/b139,2181
protected body Machin_T Machin_T/b146,2281
-c-src/abbrev.c,2072
+c-src/abbrev.c,1957
Lisp_Object Vabbrev_table_name_list;43,1429
Lisp_Object Vglobal_abbrev_table;48,1574
Lisp_Object Vfundamental_mode_abbrev_table;52,1685
@@ -186,33 +186,31 @@ Lisp_Object Vabbrev_start_location_buffer;66,2046
Lisp_Object Vlast_abbrev;70,2155
Lisp_Object Vlast_abbrev_text;75,2324
int last_abbrev_point;79,2414
-Lisp_Object Vpre_abbrev_expand_hook,83,2487
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;83,2487
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,85,2551
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table85,2551
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,92,2743
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table92,2743
-DEFUN ("define-abbrev", Fdefine_abbrev,107,3124
-DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev107,3124
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,149,4443
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev149,4443
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,160,4814
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev160,4814
-DEFUN ("abbrev-symbol", Fabbrev_symbol,174,5282
-DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol174,5282
-DEFUN ("abbrev-expansion", Fabbrev_expansion,202,6246
-DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion202,6246
-DEFUN ("expand-abbrev", Fexpand_abbrev,218,6761
-DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev218,6761
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,389,11682
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev389,11682
-write_abbrev 426,12889
-describe_abbrev 445,13324
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,466,13839
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description466,13839
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,506,14995
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table506,14995
-syms_of_abbrev 540,16072
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,82,2440
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table82,2440
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,89,2632
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table89,2632
+DEFUN ("define-abbrev", Fdefine_abbrev,104,3013
+DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev104,3013
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,146,4332
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev146,4332
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,157,4703
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev157,4703
+DEFUN ("abbrev-symbol", Fabbrev_symbol,171,5171
+DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol171,5171
+DEFUN ("abbrev-expansion", Fabbrev_expansion,199,6135
+DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion199,6135
+DEFUN ("expand-abbrev", Fexpand_abbrev,215,6650
+DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev215,6650
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,383,11495
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev383,11495
+write_abbrev 420,12702
+describe_abbrev 439,13137
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,460,13652
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description460,13652
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,500,14808
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table500,14808
+syms_of_abbrev 534,15885
c-src/torture.c,197
(*tag1 tag118,452
@@ -1228,160 +1226,160 @@ make_lispy_position 5228,157391
toolkit_menubar_in_use 5456,163954
make_scroll_bar_position 5469,164322
make_lispy_event 5485,164968
-make_lispy_movement 6104,183532
-make_lispy_switch_frame 6131,184263
-make_lispy_focus_in 6137,184370
-make_lispy_focus_out 6145,184496
-parse_modifiers_uncached 6163,184946
-#define SINGLE_LETTER_MOD(6185,185466
-#undef SINGLE_LETTER_MOD6212,185907
-#define MULTI_LETTER_MOD(6214,185933
-#undef MULTI_LETTER_MOD6231,186401
-apply_modifiers_uncached 6273,187575
-static const char *const modifier_names[modifier_names6319,189194
-#define NUM_MOD_NAMES 6325,189400
-static Lisp_Object modifier_symbols;6327,189450
-lispy_modifier_list 6331,189587
-#define KEY_TO_CHAR(6353,190253
-parse_modifiers 6356,190329
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191518
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191518
-apply_modifiers 6422,192392
-reorder_modifiers 6491,194721
-modify_event_symbol 6536,196529
-DEFUN ("event-convert-list", Fevent_convert_list,6628,199245
-DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199245
-parse_solitary_modifier 6695,201136
-#define SINGLE_LETTER_MOD(6701,201259
-#define MULTI_LETTER_MOD(6705,201344
-#undef SINGLE_LETTER_MOD6763,202642
-#undef MULTI_LETTER_MOD6764,202667
-lucid_event_type_list_p 6775,202890
-get_input_pending 6814,203961
-record_asynch_buffer_change 6834,204580
-gobble_input 6872,205703
-tty_read_avail_input 6967,208311
-handle_async_input 7149,214040
-process_pending_signals 7165,214360
-unblock_input_to 7177,214646
-unblock_input 7200,215278
-totally_unblock_input 7209,215446
-handle_input_available_signal 7217,215530
-deliver_input_available_signal 7226,215701
-struct user_signal_info7235,215866
-static struct user_signal_info *user_signals user_signals7250,216091
-add_user_signal 7253,216150
-handle_user_signal 7275,216599
-deliver_user_signal 7316,217559
-find_user_signal_name 7322,217660
-store_user_signal_events 7334,217842
-static void menu_bar_item 7362,218342
-static Lisp_Object menu_bar_one_keymap_changed_items;7363,218417
-static Lisp_Object menu_bar_items_vector;7368,218631
-static int menu_bar_items_index;7369,218673
-static const char *separator_names[separator_names7372,218708
-menu_separator_name_p 7393,219149
-menu_bar_items 7426,219853
-Lisp_Object item_properties;7568,224604
-menu_bar_item 7571,224646
-menu_item_eval_property_1 7647,227176
-eval_dyn 7658,227466
-menu_item_eval_property 7666,227676
-parse_menu_item 7686,228342
-static Lisp_Object tool_bar_items_vector;7965,236337
-static Lisp_Object tool_bar_item_properties;7970,236511
-static int ntool_bar_items;7974,236607
-static void init_tool_bar_items 7978,236665
-static void process_tool_bar_item 7979,236712
-static bool parse_tool_bar_item 7981,236802
-static void append_tool_bar_item 7982,236862
-tool_bar_items 7990,237084
-process_tool_bar_item 8075,239893
-#define PROP(8112,240970
-set_prop 8114,241039
-parse_tool_bar_item 8167,242454
-#undef PROP8379,248845
-init_tool_bar_items 8387,248970
-append_tool_bar_item 8401,249262
-read_char_x_menu_prompt 8443,250772
-read_char_minibuf_menu_prompt 8503,252446
-#define PUSH_C_STR(8527,253015
-follow_key 8726,258554
-active_maps 8733,258696
-typedef struct keyremap8742,259022
-} keyremap;8754,259465
-access_keymap_keyremap 8764,259809
-keyremap_step 8811,261451
-test_undefined 8867,262935
-read_key_sequence 8916,264862
-read_key_sequence_vs 9826,295822
-DEFUN ("read-key-sequence", Fread_key_sequence,9885,297295
-DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297295
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299983
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299983
-detect_input_pending 9950,300489
-detect_input_pending_ignore_squeezables 9959,300655
-detect_input_pending_run_timers 9967,300871
-clear_input_pending 9985,301363
-requeued_events_pending_p 9997,301733
-DEFUN ("input-pending-p", Finput_pending_p,10002,301814
-DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301814
-DEFUN ("recent-keys", Frecent_keys,10024,302597
-DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302597
-DEFUN ("this-command-keys", Fthis_command_keys,10055,303518
-DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303518
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303959
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303959
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304381
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304381
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304956
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304956
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305496
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305496
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306511
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306511
-DEFUN ("recursion-depth", Frecursion_depth,10158,307070
-DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307070
-DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307407
-DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307407
-DEFUN ("discard-input", Fdiscard_input,10203,308448
-DEFUN ("discard-input", Fdiscard_input,discard-input10203,308448
-DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308950
-DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308950
-stuff_buffered_input 10285,311046
-set_waiting_for_input 10323,312017
-clear_waiting_for_input 10337,312391
-handle_interrupt_signal 10351,312755
-deliver_interrupt_signal 10378,313643
-static int volatile force_quit_count;10387,313933
-handle_interrupt 10401,314415
-quit_throw_to_read_char 10541,318712
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319289
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319289
-DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320517
-DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320517
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321433
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321433
-DEFUN ("set-quit-char", Fset_quit_char,10694,322707
-DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322707
-DEFUN ("set-input-mode", Fset_input_mode,10729,323571
-DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323571
-DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324460
-DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324460
-DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325838
-DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325838
-DEFUN ("posn-at-point", Fposn_at_point,10824,327061
-DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327061
-init_kboard 10861,328215
-allocate_kboard 10893,329285
-wipe_kboard 10909,329638
-delete_kboard 10917,329752
-init_keyboard 10942,330282
-struct event_head11021,332697
-static const struct event_head head_table[head_table11027,332748
-syms_of_keyboard 11045,333578
-keys_of_keyboard 11841,367116
-mark_kboards 11916,370435
+make_lispy_movement 6104,183531
+make_lispy_switch_frame 6131,184262
+make_lispy_focus_in 6137,184369
+make_lispy_focus_out 6145,184495
+parse_modifiers_uncached 6163,184945
+#define SINGLE_LETTER_MOD(6185,185465
+#undef SINGLE_LETTER_MOD6212,185906
+#define MULTI_LETTER_MOD(6214,185932
+#undef MULTI_LETTER_MOD6231,186400
+apply_modifiers_uncached 6273,187574
+static const char *const modifier_names[modifier_names6319,189193
+#define NUM_MOD_NAMES 6325,189399
+static Lisp_Object modifier_symbols;6327,189449
+lispy_modifier_list 6331,189586
+#define KEY_TO_CHAR(6353,190252
+parse_modifiers 6356,190328
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191517
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191517
+apply_modifiers 6422,192391
+reorder_modifiers 6491,194720
+modify_event_symbol 6536,196528
+DEFUN ("event-convert-list", Fevent_convert_list,6628,199244
+DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199244
+parse_solitary_modifier 6695,201135
+#define SINGLE_LETTER_MOD(6701,201258
+#define MULTI_LETTER_MOD(6705,201343
+#undef SINGLE_LETTER_MOD6763,202641
+#undef MULTI_LETTER_MOD6764,202666
+lucid_event_type_list_p 6775,202889
+get_input_pending 6814,203960
+record_asynch_buffer_change 6834,204579
+gobble_input 6872,205702
+tty_read_avail_input 6967,208310
+handle_async_input 7149,214039
+process_pending_signals 7165,214359
+unblock_input_to 7177,214645
+unblock_input 7200,215277
+totally_unblock_input 7209,215445
+handle_input_available_signal 7217,215529
+deliver_input_available_signal 7226,215700
+struct user_signal_info7235,215865
+static struct user_signal_info *user_signals user_signals7250,216090
+add_user_signal 7253,216149
+handle_user_signal 7275,216598
+deliver_user_signal 7316,217558
+find_user_signal_name 7322,217659
+store_user_signal_events 7334,217841
+static void menu_bar_item 7362,218341
+static Lisp_Object menu_bar_one_keymap_changed_items;7363,218416
+static Lisp_Object menu_bar_items_vector;7368,218630
+static int menu_bar_items_index;7369,218672
+static const char *separator_names[separator_names7372,218707
+menu_separator_name_p 7393,219148
+menu_bar_items 7426,219852
+Lisp_Object item_properties;7568,224603
+menu_bar_item 7571,224645
+menu_item_eval_property_1 7647,227175
+eval_dyn 7658,227465
+menu_item_eval_property 7666,227675
+parse_menu_item 7686,228341
+static Lisp_Object tool_bar_items_vector;7965,236336
+static Lisp_Object tool_bar_item_properties;7970,236510
+static int ntool_bar_items;7974,236606
+static void init_tool_bar_items 7978,236664
+static void process_tool_bar_item 7979,236711
+static bool parse_tool_bar_item 7981,236801
+static void append_tool_bar_item 7982,236861
+tool_bar_items 7990,237083
+process_tool_bar_item 8075,239892
+#define PROP(8112,240969
+set_prop 8114,241038
+parse_tool_bar_item 8167,242453
+#undef PROP8379,248844
+init_tool_bar_items 8387,248969
+append_tool_bar_item 8401,249261
+read_char_x_menu_prompt 8443,250771
+read_char_minibuf_menu_prompt 8503,252445
+#define PUSH_C_STR(8527,253014
+follow_key 8726,258553
+active_maps 8733,258695
+typedef struct keyremap8742,259021
+} keyremap;8754,259464
+access_keymap_keyremap 8764,259808
+keyremap_step 8811,261450
+test_undefined 8867,262934
+read_key_sequence 8916,264861
+read_key_sequence_vs 9826,295821
+DEFUN ("read-key-sequence", Fread_key_sequence,9885,297294
+DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297294
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299982
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299982
+detect_input_pending 9950,300488
+detect_input_pending_ignore_squeezables 9959,300654
+detect_input_pending_run_timers 9967,300870
+clear_input_pending 9985,301362
+requeued_events_pending_p 9997,301732
+DEFUN ("input-pending-p", Finput_pending_p,10002,301813
+DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301813
+DEFUN ("recent-keys", Frecent_keys,10024,302596
+DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302596
+DEFUN ("this-command-keys", Fthis_command_keys,10055,303517
+DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303517
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303958
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303958
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304380
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304380
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304955
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304955
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305495
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305495
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306510
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306510
+DEFUN ("recursion-depth", Frecursion_depth,10158,307069
+DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307069
+DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307406
+DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307406
+DEFUN ("discard-input", Fdiscard_input,10203,308447
+DEFUN ("discard-input", Fdiscard_input,discard-input10203,308447
+DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308949
+DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308949
+stuff_buffered_input 10285,311045
+set_waiting_for_input 10323,312016
+clear_waiting_for_input 10337,312390
+handle_interrupt_signal 10351,312754
+deliver_interrupt_signal 10378,313642
+static int volatile force_quit_count;10387,313932
+handle_interrupt 10401,314414
+quit_throw_to_read_char 10541,318711
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319288
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319288
+DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320516
+DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320516
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321432
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321432
+DEFUN ("set-quit-char", Fset_quit_char,10694,322706
+DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322706
+DEFUN ("set-input-mode", Fset_input_mode,10729,323570
+DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323570
+DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324459
+DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324459
+DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325837
+DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325837
+DEFUN ("posn-at-point", Fposn_at_point,10824,327060
+DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327060
+init_kboard 10861,328214
+allocate_kboard 10893,329284
+wipe_kboard 10909,329637
+delete_kboard 10917,329751
+init_keyboard 10942,330281
+struct event_head11021,332696
+static const struct event_head head_table[head_table11027,332747
+syms_of_keyboard 11045,333577
+keys_of_keyboard 11841,367115
+mark_kboards 11916,370434
c-src/emacs/src/lisp.h,33840
#define EMACS_LISP_H22,801
@@ -2712,11 +2710,11 @@ main(37,571
class D 41,622
D(43,659
-el-src/TAGTEST.EL,179
-(foo::defmumble bletch 1,0
-(defun foo==bar foo==bar2,33
-(defalias 'pending-delete-mode pending-delete-mode6,149
-(defalias (quote explicitly-quoted-pending-delete-mode)9,222
+el-src/TAGTEST.EL,181
+(foo::defmumble bletch 3,33
+(defun foo==bar foo==bar4,66
+(defalias 'pending-delete-mode pending-delete-mode8,182
+(defalias (quote explicitly-quoted-pending-delete-mode)11,255
el-src/emacs/lisp/progmodes/etags.el,5188
(defvar tags-file-name 34,1035
@@ -3479,22 +3477,22 @@ ord_add_element(71,1867
ord_del_element(85,2344
ord_disjoint(100,2783
ord_intersect(108,2953
-ord_intersection(126,3552
-ord_intersection3(130,3691
-ord_intersection(150,4531
-ord_intersection4(154,4703
-ord_intersection(176,5664
-ord_intersection2(181,5812
-ord_member(200,6318
-ord_seteq(216,6683
-ord_setproduct(225,6971
-ord_subset(240,7377
-ord_subtract(257,7861
-ord_symdiff(265,8054
-ord_union(288,8887
-ord_union4(303,9352
-ord_union(324,10171
-ord_union_all(329,10313
+ord_intersection(126,3553
+ord_intersection3(130,3692
+ord_intersection(150,4533
+ord_intersection4(154,4705
+ord_intersection(176,5666
+ord_intersection2(181,5814
+ord_member(200,6320
+ord_seteq(216,6685
+ord_setproduct(225,6973
+ord_subset(240,7379
+ord_subtract(257,7863
+ord_symdiff(265,8056
+ord_union(288,8889
+ord_union4(303,9354
+ord_union(324,10173
+ord_union_all(329,10315
prol-src/natded.prolog,2319
expandmng(100,2879
@@ -3709,6 +3707,11 @@ module A9,57
alias_method ( :foo2,foo237,586
A::Constant Constant42,655
+rs-src/test.rs,52
+enum IpAddrKind 3,11
+fn test1(8,48
+fn main(12,88
+
scm-src/test.scm,260
(define hello 1,0
(set! hello 3,32
@@ -3923,533 +3926,687 @@ tex-src/texinfo.tex,30627
\def\vritemindex #1{\vritemindex1068,35482
\def\tablez #1#2#3#4#5#6{\tablez1074,35631
\def\Edescription{\Edescription1077,35689
-\def\itemfont{\itemfont1082,35891
-\def\Etable{\Etable1090,36117
-\def\itemize{\itemize1103,36441
-\def\itemizezzz #1{\itemizezzz1105,36477
-\def\itemizey #1#2{\itemizey1110,36572
-\def#2{1119,36818
-\def\itemcontents{\itemcontents1120,36859
-\def\bullet{\bullet1123,36907
-\def\minus{\minus1124,36934
-\def\frenchspacing{\frenchspacing1128,37042
-\def\splitoff#1#2\endmark{\splitoff1134,37267
-\def\enumerate{\enumerate1140,37497
-\def\enumeratezzz #1{\enumeratezzz1141,37536
-\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37589
- \def\thearg{\thearg1146,37736
- \ifx\thearg\empty \def\thearg{\thearg1147,37755
-\def\numericenumerate{\numericenumerate1184,39089
-\def\lowercaseenumerate{\lowercaseenumerate1190,39219
-\def\uppercaseenumerate{\uppercaseenumerate1203,39566
-\def\startenumeration#1{\startenumeration1219,40056
-\def\alphaenumerate{\alphaenumerate1227,40238
-\def\capsenumerate{\capsenumerate1228,40273
-\def\Ealphaenumerate{\Ealphaenumerate1229,40307
-\def\Ecapsenumerate{\Ecapsenumerate1230,40341
-\def\itemizeitem{\itemizeitem1234,40421
-\def\newindex #1{\newindex1259,41278
-\def\defindex{\defindex1268,41567
-\def\newcodeindex #1{\newcodeindex1272,41675
-\def\defcodeindex{\defcodeindex1279,41935
-\def\synindex #1 #2 {\synindex1283,42115
-\def\syncodeindex #1 #2 {\syncodeindex1292,42455
-\def\doindex#1{\doindex1309,43134
-\def\singleindexer #1{\singleindexer1310,43193
-\def\docodeindex#1{\docodeindex1313,43305
-\def\singlecodeindexer #1{\singlecodeindexer1314,43372
-\def\indexdummies{\indexdummies1316,43430
-\def\_{\_1317,43450
-\def\w{\w1318,43478
-\def\bf{\bf1319,43505
-\def\rm{\rm1320,43534
-\def\sl{\sl1321,43563
-\def\sf{\sf1322,43592
-\def\tt{\tt1323,43620
-\def\gtr{\gtr1324,43648
-\def\less{\less1325,43678
-\def\hat{\hat1326,43710
-\def\char{\char1327,43740
-\def\TeX{\TeX1328,43772
-\def\dots{\dots1329,43802
-\def\copyright{\copyright1330,43835
-\def\tclose##1{\tclose1331,43878
-\def\code##1{\code1332,43923
-\def\samp##1{\samp1333,43964
-\def\t##1{\t1334,44005
-\def\r##1{\r1335,44040
-\def\i##1{\i1336,44075
-\def\b##1{\b1337,44110
-\def\cite##1{\cite1338,44145
-\def\key##1{\key1339,44186
-\def\file##1{\file1340,44225
-\def\var##1{\var1341,44266
-\def\kbd##1{\kbd1342,44305
-\def\indexdummyfont#1{\indexdummyfont1347,44461
-\def\indexdummytex{\indexdummytex1348,44487
-\def\indexdummydots{\indexdummydots1349,44511
-\def\indexnofonts{\indexnofonts1351,44537
-\let\w=\indexdummyfontdummyfont1352,44557
-\let\t=\indexdummyfontdummyfont1353,44580
-\let\r=\indexdummyfontdummyfont1354,44603
-\let\i=\indexdummyfontdummyfont1355,44626
-\let\b=\indexdummyfontdummyfont1356,44649
-\let\emph=\indexdummyfontdummyfont1357,44672
-\let\strong=\indexdummyfontdummyfont1358,44698
-\let\cite=\indexdummyfont=\indexdummyfont1359,44726
-\let\sc=\indexdummyfontdummyfont1360,44752
-\let\tclose=\indexdummyfontdummyfont1364,44924
-\let\code=\indexdummyfontdummyfont1365,44952
-\let\file=\indexdummyfontdummyfont1366,44978
-\let\samp=\indexdummyfontdummyfont1367,45004
-\let\kbd=\indexdummyfontdummyfont1368,45030
-\let\key=\indexdummyfontdummyfont1369,45055
-\let\var=\indexdummyfontdummyfont1370,45080
-\let\TeX=\indexdummytexdummytex1371,45105
-\let\dots=\indexdummydotsdummydots1372,45129
-\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45381
-\def\doind #1#2{\doind1384,45437
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45480
-\def\rawbackslashxx{\rawbackslashxx1389,45620
-{\indexnofontsnofonts1394,45882
-\def\dosubind #1#2#3{\dosubind1405,46193
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46241
-\def\rawbackslashxx{\rawbackslashxx1410,46345
-{\indexnofontsnofonts1414,46499
-\def\findex {\findex1443,47430
-\def\kindex {\kindex1444,47453
-\def\cindex {\cindex1445,47476
-\def\vindex {\vindex1446,47499
-\def\tindex {\tindex1447,47522
-\def\pindex {\pindex1448,47545
-\def\cindexsub {\cindexsub1450,47569
-\def\printindex{\printindex1462,47896
-\def\doprintindex#1{\doprintindex1464,47937
- \def\indexbackslash{\indexbackslash1481,48422
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48461
-\def\initial #1{\initial1517,49533
-\def\entry #1#2{\entry1523,49740
- \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50387
-\def\indexdotfill{\indexdotfill1549,50715
-\def\primary #1{\primary1552,50821
-\def\secondary #1#2{\secondary1556,50903
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50985
-\newbox\partialpageialpage1566,51158
-\def\begindoublecolumns{\begindoublecolumns1572,51316
- \output={\global\setbox\partialpage=ialpage=1573,51352
-\def\enddoublecolumns{\enddoublecolumns1577,51540
-\def\doublecolumnout{\doublecolumnout1580,51625
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51694
-\def\pagesofar{\pagesofar1584,51872
-\def\balancecolumns{\balancecolumns1588,52109
- \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52280
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52541
-\newcount \appendixno \appendixno = `\@no1627,53446
-\def\appendixletter{\appendixletter1628,53487
-\def\opencontents{\opencontents1632,53590
-\def\thischapter{\thischapter1637,53771
-\def\seccheck#1{\seccheck1638,53809
-\def\chapternofonts{\chapternofonts1643,53913
-\def\result{\result1646,53988
-\def\equiv{\equiv1647,54023
-\def\expansion{\expansion1648,54056
-\def\print{\print1649,54097
-\def\TeX{\TeX1650,54130
-\def\dots{\dots1651,54159
-\def\copyright{\copyright1652,54190
-\def\tt{\tt1653,54231
-\def\bf{\bf1654,54258
-\def\w{\w1655,54286
-\def\less{\less1656,54311
-\def\gtr{\gtr1657,54342
-\def\hat{\hat1658,54371
-\def\char{\char1659,54400
-\def\tclose##1{\tclose1660,54431
-\def\code##1{\code1661,54475
-\def\samp##1{\samp1662,54515
-\def\r##1{\r1663,54555
-\def\b##1{\b1664,54589
-\def\key##1{\key1665,54623
-\def\file##1{\file1666,54661
-\def\kbd##1{\kbd1667,54701
-\def\i##1{\i1669,54809
-\def\cite##1{\cite1670,54843
-\def\var##1{\var1671,54883
-\def\emph##1{\emph1672,54921
-\def\dfn##1{\dfn1673,54961
-\def\thischaptername{\thischaptername1676,55002
-\outer\def\chapter{\chapter1677,55041
-\def\chapterzzz #1{\chapterzzz1678,55082
-{\chapternofonts%nofonts%1687,55478
-\global\let\section = \numberedsec=1692,55631
-\global\let\subsection = \numberedsubsec=1693,55666
-\global\let\subsubsection = \numberedsubsubsec=1694,55707
-\outer\def\appendix{\appendix1697,55758
-\def\appendixzzz #1{\appendixzzz1698,55801
-\global\advance \appendixno by 1 \message{no1700,55878
-\chapmacro {#1}{Appendix \appendixletter}letter1701,55947
-\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56040
-{\chapternofonts%nofonts%1705,56112
- {#1}{Appendix \appendixletter}letter1707,56168
-\appendixnoderef %noderef1710,56268
-\global\let\section = \appendixsec=1711,56287
-\global\let\subsection = \appendixsubsec=1712,56322
-\global\let\subsubsection = \appendixsubsubsec=1713,56363
-\outer\def\top{\top1716,56414
-\outer\def\unnumbered{\unnumbered1717,56454
-\def\unnumberedzzz #1{\unnumberedzzz1718,56501
-{\chapternofonts%nofonts%1722,56664
-\global\let\section = \unnumberedsec=1727,56814
-\global\let\subsection = \unnumberedsubsec=1728,56851
-\global\let\subsubsection = \unnumberedsubsubsec=1729,56894
-\outer\def\numberedsec{\numberedsec1732,56947
-\def\seczzz #1{\seczzz1733,56988
-{\chapternofonts%nofonts%1736,57144
-\outer\def\appendixsection{\appendixsection1745,57330
-\outer\def\appendixsec{\appendixsec1746,57387
-\def\appendixsectionzzz #1{\appendixsectionzzz1747,57440
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57552
-{\chapternofonts%nofonts%1750,57620
-{#1}{\appendixletter}letter1752,57676
-\appendixnoderef %noderef1755,57776
-\outer\def\unnumberedsec{\unnumberedsec1759,57816
-\def\unnumberedseczzz #1{\unnumberedseczzz1760,57869
-{\chapternofonts%nofonts%1762,57964
-\outer\def\numberedsubsec{\numberedsubsec1770,58132
-\def\numberedsubseczzz #1{\numberedsubseczzz1771,58187
-{\chapternofonts%nofonts%1774,58366
-\outer\def\appendixsubsec{\appendixsubsec1783,58570
-\def\appendixsubseczzz #1{\appendixsubseczzz1784,58625
-\subsecheading {#1}{\appendixletter}letter1786,58747
-{\chapternofonts%nofonts%1787,58812
-{#1}{\appendixletter}letter1789,58871
-\appendixnoderef %noderef1792,58986
-\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59026
-\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59085
-{\chapternofonts%nofonts%1799,59186
-\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59357
-\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59418
-{\chapternofonts%nofonts%1812,59615
-\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59848
-\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59909
- {\appendixletter}letter1827,60048
-{\chapternofonts%nofonts%1828,60114
- {\appendixletter}letter1830,60179
-\appendixnoderef %noderef1834,60313
-\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60353
-\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60418
-{\chapternofonts%nofonts%1841,60525
-\def\infotop{\infotop1851,60854
-\def\infounnumbered{\infounnumbered1852,60892
-\def\infounnumberedsec{\infounnumberedsec1853,60937
-\def\infounnumberedsubsec{\infounnumberedsubsec1854,60988
-\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61045
-\def\infoappendix{\infoappendix1857,61109
-\def\infoappendixsec{\infoappendixsec1858,61150
-\def\infoappendixsubsec{\infoappendixsubsec1859,61197
-\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61250
-\def\infochapter{\infochapter1862,61310
-\def\infosection{\infosection1863,61349
-\def\infosubsection{\infosubsection1864,61388
-\def\infosubsubsection{\infosubsubsection1865,61433
-\global\let\section = \numberedsec=1870,61670
-\global\let\subsection = \numberedsubsec=1871,61705
-\global\let\subsubsection = \numberedsubsubsec=1872,61746
-\def\majorheading{\majorheading1886,62253
-\def\majorheadingzzz #1{\majorheadingzzz1887,62298
-\def\chapheading{\chapheading1893,62531
-\def\chapheadingzzz #1{\chapheadingzzz1894,62574
-\def\heading{\heading1899,62769
-\def\subheading{\subheading1901,62806
-\def\subsubheading{\subsubheading1903,62849
-\def\dobreak#1#2{\dobreak1910,63126
-\def\setchapterstyle #1 {\setchapterstyle1912,63204
-\def\chapbreak{\chapbreak1919,63459
-\def\chappager{\chappager1920,63509
-\def\chapoddpage{\chapoddpage1921,63547
-\def\setchapternewpage #1 {\setchapternewpage1923,63626
-\def\CHAPPAGoff{\CHAPPAGoff1925,63683
-\def\CHAPPAGon{\CHAPPAGon1929,63777
-\global\def\HEADINGSon{\HEADINGSon1932,63868
-\def\CHAPPAGodd{\CHAPPAGodd1934,63910
-\global\def\HEADINGSon{\HEADINGSon1937,64006
-\def\CHAPFplain{\CHAPFplain1941,64060
-\def\chfplain #1#2{\chfplain1945,64152
-\def\unnchfplain #1{\unnchfplain1956,64375
-\def\unnchfopen #1{\unnchfopen1964,64604
-\def\chfopen #1#2{\chfopen1970,64812
-\def\CHAPFopen{\CHAPFopen1975,64956
-\def\subsecheadingbreak{\subsecheadingbreak1982,65174
-\def\secheadingbreak{\secheadingbreak1985,65303
-\def\secheading #1#2#3{\secheading1993,65585
-\def\plainsecheading #1{\plainsecheading1994,65641
-\def\secheadingi #1{\secheadingi1995,65684
-\def\subsecheading #1#2#3#4{\subsecheading2006,66052
-\def\subsecheadingi #1{\subsecheadingi2007,66119
-\def\subsubsecfonts{\subsubsecfonts2014,66416
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66539
-\def\subsubsecheadingi #1{\subsubsecheadingi2018,66617
-\def\startcontents#1{\startcontents2032,67089
- \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67362
-\outer\def\contents{\contents2049,67721
-\outer\def\summarycontents{\summarycontents2057,67865
- \def\secentry ##1##2##3##4{\secentry2067,68236
- \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68271
- \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68306
- \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68347
- \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68385
- \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68432
-\def\chapentry#1#2#3{\chapentry2085,68866
-\def\shortchapentry#1#2#3{\shortchapentry2088,68983
- {#2\labelspace #1}space2091,69093
-\def\unnumbchapentry#1#2{\unnumbchapentry2094,69147
-\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69194
-\def\secentry#1#2#3#4{\secentry2102,69358
-\def\unnumbsecentry#1#2{\unnumbsecentry2103,69417
-\def\subsecentry#1#2#3#4#5{\subsecentry2106,69478
-\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69548
-\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69622
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69656
-\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69707
-\def\dochapentry#1#2{\dochapentry2123,70081
-\def\dosecentry#1#2{\dosecentry2138,70686
-\def\dosubsecentry#1#2{\dosubsecentry2145,70864
-\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71049
-\def\labelspace{\labelspace2160,71300
-\def\dopageno#1{\dopageno2162,71335
-\def\doshortpageno#1{\doshortpageno2163,71361
-\def\chapentryfonts{\chapentryfonts2165,71393
-\def\secentryfonts{\secentryfonts2166,71428
-\def\point{\point2192,72387
-\def\result{\result2194,72408
-\def\expansion{\expansion2195,72481
-\def\print{\print2196,72552
-\def\equiv{\equiv2198,72619
-\def\error{\error2218,73392
-\def\tex{\tex2224,73621
-\def\@{\@2242,74004
-\gdef\sepspaces{\def {\ }}}\2265,74736
-\def\aboveenvbreak{\aboveenvbreak2268,74818
-\def\afterenvbreak{\afterenvbreak2272,74984
-\def\ctl{\ctl2286,75495
-\def\ctr{\ctr2287,75567
-\def\cbl{\cbl2288,75606
-\def\cbr{\cbr2289,75646
-\def\carttop{\carttop2290,75685
-\def\cartbot{\cartbot2293,75793
-\long\def\cartouche{\cartouche2299,75933
-\def\Ecartouche{\Ecartouche2326,76721
-\def\lisp{\lisp2338,76856
-\def\Elisp{\Elisp2348,77203
-\def\next##1{\next2360,77529
-\def\Eexample{\Eexample2364,77571
-\def\Esmallexample{\Esmallexample2367,77618
-\def\smalllispx{\smalllispx2373,77796
-\def\Esmalllisp{\Esmalllisp2383,78150
-\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78506
-\def\next##1{\next2397,78563
-\def\display{\display2401,78643
-\def\Edisplay{\Edisplay2410,78962
-\def\next##1{\next2422,79273
-\def\format{\format2426,79376
-\def\Eformat{\Eformat2434,79672
-\def\next##1{\next2437,79761
-\def\flushleft{\flushleft2441,79813
-\def\Eflushleft{\Eflushleft2451,80184
-\def\next##1{\next2454,80277
-\def\flushright{\flushright2456,80299
-\def\Eflushright{\Eflushright2466,80671
-\def\next##1{\next2470,80802
-\def\quotation{\quotation2474,80860
-\def\Equotation{\Equotation2480,81052
-\def\setdeffont #1 {\setdeffont2493,81450
-\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81496
-\newskip\defargsindent \defargsindent=50ptargsindent2496,81539
-\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81582
-\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81625
-\def\activeparens{\activeparens2503,81823
-\def\opnr{\opnr2529,83035
-\def\lbrb{\lbrb2530,83100
-\def\defname #1#2{\defname2536,83301
-\advance\dimen2 by -\defbodyindentbodyindent2540,83419
-\advance\dimen3 by -\defbodyindentbodyindent2542,83473
-\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83527
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83669
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83744
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84113
-\advance\leftskip by -\defbodyindentbodyindent2557,84247
-\exdentamount=\defbodyindentbodyindent2558,84284
-\def\defparsebody #1#2#3{\defparsebody2568,84643
-\def#1{2572,84827
-\def#2{2573,84863
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84935
-\exdentamount=\defbodyindentbodyindent2576,85009
-\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85113
-\def#1{2585,85274
-\def#2##1 {2586,85310
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85393
-\exdentamount=\defbodyindentbodyindent2589,85467
-\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85552
-\def#1{2596,85713
-\def#2##1 ##2 {2597,85749
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85849
-\exdentamount=\defbodyindentbodyindent2601,85923
-\def\defvarparsebody #1#2#3{\defvarparsebody2608,86194
-\def#1{2612,86381
-\def#2{2613,86417
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86476
-\exdentamount=\defbodyindentbodyindent2616,86550
-\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86641
-\def#1{2625,86800
-\def#2##1 {2626,86836
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86906
-\exdentamount=\defbodyindentbodyindent2629,86980
-\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87052
-\def#1{2636,87216
-\def#2##1 ##2 {2637,87252
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87339
-\exdentamount=\defbodyindentbodyindent2641,87413
-\def\defunargs #1{\defunargs2664,88173
-\def\deftypefunargs #1{\deftypefunargs2676,88555
-\def\deffn{\deffn2690,88937
-\def\deffnheader #1#2#3{\deffnheader2692,88994
-\begingroup\defname {name2693,89042
-\def\defun{\defun2699,89187
-\def\defunheader #1#2{\defunheader2701,89240
-\begingroup\defname {name2702,89315
-\defunargs {unargs2703,89351
-\def\deftypefun{\deftypefun2709,89499
-\def\deftypefunheader #1#2{\deftypefunheader2712,89621
-\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89730
-\begingroup\defname {name2716,89822
-\deftypefunargs {typefunargs2717,89868
-\def\deftypefn{\deftypefn2723,90039
-\def\deftypefnheader #1#2#3{\deftypefnheader2726,90188
-\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90324
-\begingroup\defname {name2730,90417
-\deftypefunargs {typefunargs2731,90457
-\def\defmac{\defmac2737,90578
-\def\defmacheader #1#2{\defmacheader2739,90635
-\begingroup\defname {name2740,90711
-\defunargs {unargs2741,90744
-\def\defspec{\defspec2747,90868
-\def\defspecheader #1#2{\defspecheader2749,90929
-\begingroup\defname {name2750,91006
-\defunargs {unargs2751,91046
-\def\deffnx #1 {\deffnx2758,91241
-\def\defunx #1 {\defunx2759,91298
-\def\defmacx #1 {\defmacx2760,91355
-\def\defspecx #1 {\defspecx2761,91414
-\def\deftypefnx #1 {\deftypefnx2762,91475
-\def\deftypeunx #1 {\deftypeunx2763,91540
-\def\defop #1 {\defop2769,91686
-\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91721
-\def\defopheader #1#2#3{\defopheader2772,91775
-\begingroup\defname {name2774,91864
-\defunargs {unargs2775,91910
-\def\defmethod{\defmethod2780,91971
-\def\defmethodheader #1#2#3{\defmethodheader2782,92044
-\begingroup\defname {name2784,92132
-\defunargs {unargs2785,92172
-\def\defcv #1 {\defcv2790,92246
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92281
-\def\defcvarheader #1#2#3{\defcvarheader2793,92340
-\begingroup\defname {name2795,92426
-\defvarargs {varargs2796,92472
-\def\defivar{\defivar2801,92545
-\def\defivarheader #1#2#3{\defivarheader2803,92608
-\begingroup\defname {name2805,92694
-\defvarargs {varargs2806,92745
-\def\defopx #1 {\defopx2812,92894
-\def\defmethodx #1 {\defmethodx2813,92951
-\def\defcvx #1 {\defcvx2814,93016
-\def\defivarx #1 {\defivarx2815,93073
-\def\defvarargs #1{\defvarargs2822,93344
-\def\defvr{\defvr2828,93488
-\def\defvrheader #1#2#3{\defvrheader2830,93543
-\begingroup\defname {name2831,93591
-\def\defvar{\defvar2835,93676
-\def\defvarheader #1#2{\defvarheader2837,93736
-\begingroup\defname {name2838,93807
-\defvarargs {varargs2839,93843
-\def\defopt{\defopt2844,93909
-\def\defoptheader #1#2{\defoptheader2846,93969
-\begingroup\defname {name2847,94040
-\defvarargs {varargs2848,94079
-\def\deftypevar{\deftypevar2853,94136
-\def\deftypevarheader #1#2{\deftypevarheader2856,94252
-\begingroup\defname {name2858,94335
-\def\deftypevr{\deftypevr2865,94509
-\def\deftypevrheader #1#2#3{\deftypevrheader2867,94580
-\begingroup\defname {name2868,94632
-\def\defvrx #1 {\defvrx2876,94869
-\def\defvarx #1 {\defvarx2877,94926
-\def\defoptx #1 {\defoptx2878,94985
-\def\deftypevarx #1 {\deftypevarx2879,95044
-\def\deftypevrx #1 {\deftypevrx2880,95111
-\def\deftpargs #1{\deftpargs2885,95260
-\def\deftp{\deftp2889,95340
-\def\deftpheader #1#2#3{\deftpheader2891,95395
-\begingroup\defname {name2892,95443
-\def\deftpx #1 {\deftpx2897,95602
-\def\setref#1{\setref2908,95923
-\def\unnumbsetref#1{\unnumbsetref2913,96037
-\def\appendixsetref#1{\appendixsetref2918,96144
-\def\pxref#1{\pxref2929,96555
-\def\xref#1{\xref2930,96591
-\def\ref#1{\ref2931,96626
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96656
-\def\printedmanual{\printedmanual2933,96699
-\def\printednodename{\printednodename2934,96737
-\def\printednodename{\printednodename2939,96862
-section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97495
-\refx{x2957,97573
-\def\dosetq #1#2{\dosetq2965,97793
-\def\internalsetq #1#2{\internalsetq2973,98051
-\def\Ypagenumber{\Ypagenumber2977,98152
-\def\Ytitle{\Ytitle2979,98178
-\def\Ynothing{\Ynothing2981,98205
-\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98222
-\def\Yappendixletterandtype{\Yappendixletterandtype2992,98538
-\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98568
-\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98623
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98727
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98798
- \def\linenumber{\linenumber3009,99137
-\def\refx#1#2{\refx3015,99321
-\def\xrdef #1#2{\xrdef3037,99947
-\def\readauxfile{\readauxfile3040,100032
-\def\supereject{\supereject3110,101813
-\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102498
-\def\openindices{\openindices3139,102684
-\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102909
-\parindent = \defaultparindentaultparindent3152,102961
-\def\smallbook{\smallbook3175,103685
-\global\def\Esmallexample{\Esmallexample3192,104112
-\def\afourpaper{\afourpaper3196,104203
-\def\finalout{\finalout3224,105011
-\def\normaldoublequote{\normaldoublequote3235,105272
-\def\normaltilde{\normaltilde3236,105298
-\def\normalcaret{\normalcaret3237,105318
-\def\normalunderscore{\normalunderscore3238,105338
-\def\normalverticalbar{\normalverticalbar3239,105363
-\def\normalless{\normalless3240,105389
-\def\normalgreater{\normalgreater3241,105408
-\def\normalplus{\normalplus3242,105430
-\def\ifusingtt#1#2{\ifusingtt3253,105922
-\def\activedoublequote{\activedoublequote3261,106250
-\def~{~3264,106336
-\def^{^3267,106397
-\def_{_3270,106436
-\def\_{\_3272,106510
-\def\lvvmode{\lvvmode3279,106847
-\def|{|3282,106897
-\def<{<3285,106960
-\def>{>3288,107017
-\def+{+3290,107055
-\def\turnoffactive{\turnoffactive3296,107216
-\global\def={=3307,107502
-\def\normalbackslash{\normalbackslash3321,107884
+\def\itemfont{\itemfont1082,35890
+\def\Etable{\Etable1090,36116
+\def\itemize{\itemize1103,36440
+\def\itemizezzz #1{\itemizezzz1105,36476
+\def\itemizey #1#2{\itemizey1110,36571
+\def#2{1119,36817
+\def\itemcontents{\itemcontents1120,36858
+\def\bullet{\bullet1123,36906
+\def\minus{\minus1124,36933
+\def\frenchspacing{\frenchspacing1128,37041
+\def\splitoff#1#2\endmark{\splitoff1134,37266
+\def\enumerate{\enumerate1140,37496
+\def\enumeratezzz #1{\enumeratezzz1141,37535
+\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37588
+ \def\thearg{\thearg1146,37735
+ \ifx\thearg\empty \def\thearg{\thearg1147,37754
+\def\numericenumerate{\numericenumerate1184,39088
+\def\lowercaseenumerate{\lowercaseenumerate1190,39218
+\def\uppercaseenumerate{\uppercaseenumerate1203,39565
+\def\startenumeration#1{\startenumeration1219,40055
+\def\alphaenumerate{\alphaenumerate1227,40237
+\def\capsenumerate{\capsenumerate1228,40272
+\def\Ealphaenumerate{\Ealphaenumerate1229,40306
+\def\Ecapsenumerate{\Ecapsenumerate1230,40340
+\def\itemizeitem{\itemizeitem1234,40420
+\def\newindex #1{\newindex1259,41277
+\def\defindex{\defindex1268,41566
+\def\newcodeindex #1{\newcodeindex1272,41674
+\def\defcodeindex{\defcodeindex1279,41934
+\def\synindex #1 #2 {\synindex1283,42114
+\def\syncodeindex #1 #2 {\syncodeindex1292,42454
+\def\doindex#1{\doindex1309,43133
+\def\singleindexer #1{\singleindexer1310,43192
+\def\docodeindex#1{\docodeindex1313,43304
+\def\singlecodeindexer #1{\singlecodeindexer1314,43371
+\def\indexdummies{\indexdummies1316,43429
+\def\_{\_1317,43449
+\def\w{\w1318,43477
+\def\bf{\bf1319,43504
+\def\rm{\rm1320,43533
+\def\sl{\sl1321,43562
+\def\sf{\sf1322,43591
+\def\tt{\tt1323,43619
+\def\gtr{\gtr1324,43647
+\def\less{\less1325,43677
+\def\hat{\hat1326,43709
+\def\char{\char1327,43739
+\def\TeX{\TeX1328,43771
+\def\dots{\dots1329,43801
+\def\copyright{\copyright1330,43834
+\def\tclose##1{\tclose1331,43877
+\def\code##1{\code1332,43922
+\def\samp##1{\samp1333,43963
+\def\t##1{\t1334,44004
+\def\r##1{\r1335,44039
+\def\i##1{\i1336,44074
+\def\b##1{\b1337,44109
+\def\cite##1{\cite1338,44144
+\def\key##1{\key1339,44185
+\def\file##1{\file1340,44224
+\def\var##1{\var1341,44265
+\def\kbd##1{\kbd1342,44304
+\def\indexdummyfont#1{\indexdummyfont1347,44460
+\def\indexdummytex{\indexdummytex1348,44486
+\def\indexdummydots{\indexdummydots1349,44510
+\def\indexnofonts{\indexnofonts1351,44536
+\let\w=\indexdummyfontdummyfont1352,44556
+\let\t=\indexdummyfontdummyfont1353,44579
+\let\r=\indexdummyfontdummyfont1354,44602
+\let\i=\indexdummyfontdummyfont1355,44625
+\let\b=\indexdummyfontdummyfont1356,44648
+\let\emph=\indexdummyfontdummyfont1357,44671
+\let\strong=\indexdummyfontdummyfont1358,44697
+\let\cite=\indexdummyfont=\indexdummyfont1359,44725
+\let\sc=\indexdummyfontdummyfont1360,44751
+\let\tclose=\indexdummyfontdummyfont1364,44923
+\let\code=\indexdummyfontdummyfont1365,44951
+\let\file=\indexdummyfontdummyfont1366,44977
+\let\samp=\indexdummyfontdummyfont1367,45003
+\let\kbd=\indexdummyfontdummyfont1368,45029
+\let\key=\indexdummyfontdummyfont1369,45054
+\let\var=\indexdummyfontdummyfont1370,45079
+\let\TeX=\indexdummytexdummytex1371,45104
+\let\dots=\indexdummydotsdummydots1372,45128
+\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45380
+\def\doind #1#2{\doind1384,45436
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45479
+\def\rawbackslashxx{\rawbackslashxx1389,45619
+{\indexnofontsnofonts1394,45881
+\def\dosubind #1#2#3{\dosubind1405,46192
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46240
+\def\rawbackslashxx{\rawbackslashxx1410,46344
+{\indexnofontsnofonts1414,46498
+\def\findex {\findex1443,47429
+\def\kindex {\kindex1444,47452
+\def\cindex {\cindex1445,47475
+\def\vindex {\vindex1446,47498
+\def\tindex {\tindex1447,47521
+\def\pindex {\pindex1448,47544
+\def\cindexsub {\cindexsub1450,47568
+\def\printindex{\printindex1462,47895
+\def\doprintindex#1{\doprintindex1464,47936
+ \def\indexbackslash{\indexbackslash1481,48421
+ \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48460
+\def\initial #1{\initial1517,49532
+\def\entry #1#2{\entry1523,49739
+ \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50386
+\def\indexdotfill{\indexdotfill1549,50714
+\def\primary #1{\primary1552,50820
+\def\secondary #1#2{\secondary1556,50902
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50984
+\newbox\partialpageialpage1566,51157
+\def\begindoublecolumns{\begindoublecolumns1572,51315
+ \output={\global\setbox\partialpage=ialpage=1573,51351
+\def\enddoublecolumns{\enddoublecolumns1577,51539
+\def\doublecolumnout{\doublecolumnout1580,51624
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51693
+\def\pagesofar{\pagesofar1584,51871
+\def\balancecolumns{\balancecolumns1588,52108
+ \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52279
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52540
+\newcount \appendixno \appendixno = `\@no1627,53445
+\def\appendixletter{\appendixletter1628,53486
+\def\opencontents{\opencontents1632,53589
+\def\thischapter{\thischapter1637,53770
+\def\seccheck#1{\seccheck1638,53808
+\def\chapternofonts{\chapternofonts1643,53912
+\def\result{\result1646,53987
+\def\equiv{\equiv1647,54022
+\def\expansion{\expansion1648,54055
+\def\print{\print1649,54096
+\def\TeX{\TeX1650,54129
+\def\dots{\dots1651,54158
+\def\copyright{\copyright1652,54189
+\def\tt{\tt1653,54230
+\def\bf{\bf1654,54257
+\def\w{\w1655,54285
+\def\less{\less1656,54310
+\def\gtr{\gtr1657,54341
+\def\hat{\hat1658,54370
+\def\char{\char1659,54399
+\def\tclose##1{\tclose1660,54430
+\def\code##1{\code1661,54474
+\def\samp##1{\samp1662,54514
+\def\r##1{\r1663,54554
+\def\b##1{\b1664,54588
+\def\key##1{\key1665,54622
+\def\file##1{\file1666,54660
+\def\kbd##1{\kbd1667,54700
+\def\i##1{\i1669,54808
+\def\cite##1{\cite1670,54842
+\def\var##1{\var1671,54882
+\def\emph##1{\emph1672,54920
+\def\dfn##1{\dfn1673,54960
+\def\thischaptername{\thischaptername1676,55001
+\outer\def\chapter{\chapter1677,55040
+\def\chapterzzz #1{\chapterzzz1678,55081
+{\chapternofonts%nofonts%1687,55477
+\global\let\section = \numberedsec=1692,55630
+\global\let\subsection = \numberedsubsec=1693,55665
+\global\let\subsubsection = \numberedsubsubsec=1694,55706
+\outer\def\appendix{\appendix1697,55757
+\def\appendixzzz #1{\appendixzzz1698,55800
+\global\advance \appendixno by 1 \message{no1700,55877
+\chapmacro {#1}{Appendix \appendixletter}letter1701,55946
+\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56039
+{\chapternofonts%nofonts%1705,56111
+ {#1}{Appendix \appendixletter}letter1707,56167
+\appendixnoderef %noderef1710,56267
+\global\let\section = \appendixsec=1711,56286
+\global\let\subsection = \appendixsubsec=1712,56321
+\global\let\subsubsection = \appendixsubsubsec=1713,56362
+\outer\def\top{\top1716,56413
+\outer\def\unnumbered{\unnumbered1717,56453
+\def\unnumberedzzz #1{\unnumberedzzz1718,56500
+{\chapternofonts%nofonts%1722,56663
+\global\let\section = \unnumberedsec=1727,56813
+\global\let\subsection = \unnumberedsubsec=1728,56850
+\global\let\subsubsection = \unnumberedsubsubsec=1729,56893
+\outer\def\numberedsec{\numberedsec1732,56946
+\def\seczzz #1{\seczzz1733,56987
+{\chapternofonts%nofonts%1736,57143
+\outer\def\appendixsection{\appendixsection1745,57329
+\outer\def\appendixsec{\appendixsec1746,57386
+\def\appendixsectionzzz #1{\appendixsectionzzz1747,57439
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57551
+{\chapternofonts%nofonts%1750,57619
+{#1}{\appendixletter}letter1752,57675
+\appendixnoderef %noderef1755,57775
+\outer\def\unnumberedsec{\unnumberedsec1759,57815
+\def\unnumberedseczzz #1{\unnumberedseczzz1760,57868
+{\chapternofonts%nofonts%1762,57963
+\outer\def\numberedsubsec{\numberedsubsec1770,58131
+\def\numberedsubseczzz #1{\numberedsubseczzz1771,58186
+{\chapternofonts%nofonts%1774,58365
+\outer\def\appendixsubsec{\appendixsubsec1783,58569
+\def\appendixsubseczzz #1{\appendixsubseczzz1784,58624
+\subsecheading {#1}{\appendixletter}letter1786,58746
+{\chapternofonts%nofonts%1787,58811
+{#1}{\appendixletter}letter1789,58870
+\appendixnoderef %noderef1792,58985
+\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59025
+\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59084
+{\chapternofonts%nofonts%1799,59185
+\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59356
+\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59417
+{\chapternofonts%nofonts%1812,59614
+\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59847
+\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59908
+ {\appendixletter}letter1827,60047
+{\chapternofonts%nofonts%1828,60113
+ {\appendixletter}letter1830,60178
+\appendixnoderef %noderef1834,60312
+\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60352
+\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60417
+{\chapternofonts%nofonts%1841,60524
+\def\infotop{\infotop1851,60853
+\def\infounnumbered{\infounnumbered1852,60891
+\def\infounnumberedsec{\infounnumberedsec1853,60936
+\def\infounnumberedsubsec{\infounnumberedsubsec1854,60987
+\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61044
+\def\infoappendix{\infoappendix1857,61108
+\def\infoappendixsec{\infoappendixsec1858,61149
+\def\infoappendixsubsec{\infoappendixsubsec1859,61196
+\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61249
+\def\infochapter{\infochapter1862,61309
+\def\infosection{\infosection1863,61348
+\def\infosubsection{\infosubsection1864,61387
+\def\infosubsubsection{\infosubsubsection1865,61432
+\global\let\section = \numberedsec=1870,61669
+\global\let\subsection = \numberedsubsec=1871,61704
+\global\let\subsubsection = \numberedsubsubsec=1872,61745
+\def\majorheading{\majorheading1886,62252
+\def\majorheadingzzz #1{\majorheadingzzz1887,62297
+\def\chapheading{\chapheading1893,62530
+\def\chapheadingzzz #1{\chapheadingzzz1894,62573
+\def\heading{\heading1899,62768
+\def\subheading{\subheading1901,62805
+\def\subsubheading{\subsubheading1903,62848
+\def\dobreak#1#2{\dobreak1910,63125
+\def\setchapterstyle #1 {\setchapterstyle1912,63203
+\def\chapbreak{\chapbreak1919,63458
+\def\chappager{\chappager1920,63508
+\def\chapoddpage{\chapoddpage1921,63546
+\def\setchapternewpage #1 {\setchapternewpage1923,63625
+\def\CHAPPAGoff{\CHAPPAGoff1925,63682
+\def\CHAPPAGon{\CHAPPAGon1929,63776
+\global\def\HEADINGSon{\HEADINGSon1932,63867
+\def\CHAPPAGodd{\CHAPPAGodd1934,63909
+\global\def\HEADINGSon{\HEADINGSon1937,64005
+\def\CHAPFplain{\CHAPFplain1941,64059
+\def\chfplain #1#2{\chfplain1945,64151
+\def\unnchfplain #1{\unnchfplain1956,64374
+\def\unnchfopen #1{\unnchfopen1964,64603
+\def\chfopen #1#2{\chfopen1970,64811
+\def\CHAPFopen{\CHAPFopen1975,64955
+\def\subsecheadingbreak{\subsecheadingbreak1982,65173
+\def\secheadingbreak{\secheadingbreak1985,65302
+\def\secheading #1#2#3{\secheading1993,65584
+\def\plainsecheading #1{\plainsecheading1994,65640
+\def\secheadingi #1{\secheadingi1995,65683
+\def\subsecheading #1#2#3#4{\subsecheading2006,66051
+\def\subsecheadingi #1{\subsecheadingi2007,66118
+\def\subsubsecfonts{\subsubsecfonts2014,66415
+\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66538
+\def\subsubsecheadingi #1{\subsubsecheadingi2018,66616
+\def\startcontents#1{\startcontents2032,67088
+ \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67361
+\outer\def\contents{\contents2049,67720
+\outer\def\summarycontents{\summarycontents2057,67864
+ \def\secentry ##1##2##3##4{\secentry2067,68235
+ \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68270
+ \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68305
+ \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68346
+ \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68384
+ \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68431
+\def\chapentry#1#2#3{\chapentry2085,68865
+\def\shortchapentry#1#2#3{\shortchapentry2088,68982
+ {#2\labelspace #1}space2091,69092
+\def\unnumbchapentry#1#2{\unnumbchapentry2094,69146
+\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69193
+\def\secentry#1#2#3#4{\secentry2102,69357
+\def\unnumbsecentry#1#2{\unnumbsecentry2103,69416
+\def\subsecentry#1#2#3#4#5{\subsecentry2106,69477
+\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69547
+\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69621
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69655
+\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69706
+\def\dochapentry#1#2{\dochapentry2123,70080
+\def\dosecentry#1#2{\dosecentry2138,70685
+\def\dosubsecentry#1#2{\dosubsecentry2145,70863
+\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71048
+\def\labelspace{\labelspace2160,71299
+\def\dopageno#1{\dopageno2162,71334
+\def\doshortpageno#1{\doshortpageno2163,71360
+\def\chapentryfonts{\chapentryfonts2165,71392
+\def\secentryfonts{\secentryfonts2166,71427
+\def\point{\point2192,72386
+\def\result{\result2194,72407
+\def\expansion{\expansion2195,72480
+\def\print{\print2196,72551
+\def\equiv{\equiv2198,72618
+\def\error{\error2218,73391
+\def\tex{\tex2224,73620
+\def\@{\@2242,74003
+\gdef\sepspaces{\def {\ }}}\2265,74735
+\def\aboveenvbreak{\aboveenvbreak2268,74817
+\def\afterenvbreak{\afterenvbreak2272,74983
+\def\ctl{\ctl2286,75494
+\def\ctr{\ctr2287,75566
+\def\cbl{\cbl2288,75605
+\def\cbr{\cbr2289,75645
+\def\carttop{\carttop2290,75684
+\def\cartbot{\cartbot2293,75792
+\long\def\cartouche{\cartouche2299,75932
+\def\Ecartouche{\Ecartouche2326,76720
+\def\lisp{\lisp2338,76855
+\def\Elisp{\Elisp2348,77202
+\def\next##1{\next2360,77528
+\def\Eexample{\Eexample2364,77570
+\def\Esmallexample{\Esmallexample2367,77617
+\def\smalllispx{\smalllispx2373,77795
+\def\Esmalllisp{\Esmalllisp2383,78149
+\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78505
+\def\next##1{\next2397,78562
+\def\display{\display2401,78642
+\def\Edisplay{\Edisplay2410,78961
+\def\next##1{\next2422,79272
+\def\format{\format2426,79375
+\def\Eformat{\Eformat2434,79671
+\def\next##1{\next2437,79760
+\def\flushleft{\flushleft2441,79812
+\def\Eflushleft{\Eflushleft2451,80183
+\def\next##1{\next2454,80276
+\def\flushright{\flushright2456,80298
+\def\Eflushright{\Eflushright2466,80670
+\def\next##1{\next2470,80801
+\def\quotation{\quotation2474,80859
+\def\Equotation{\Equotation2480,81051
+\def\setdeffont #1 {\setdeffont2493,81449
+\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81495
+\newskip\defargsindent \defargsindent=50ptargsindent2496,81538
+\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81581
+\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81624
+\def\activeparens{\activeparens2503,81822
+\def\opnr{\opnr2529,83034
+\def\lbrb{\lbrb2530,83099
+\def\defname #1#2{\defname2536,83300
+\advance\dimen2 by -\defbodyindentbodyindent2540,83418
+\advance\dimen3 by -\defbodyindentbodyindent2542,83472
+\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83526
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83668
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83743
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84112
+\advance\leftskip by -\defbodyindentbodyindent2557,84246
+\exdentamount=\defbodyindentbodyindent2558,84283
+\def\defparsebody #1#2#3{\defparsebody2568,84642
+\def#1{2572,84826
+\def#2{2573,84862
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84934
+\exdentamount=\defbodyindentbodyindent2576,85008
+\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85112
+\def#1{2585,85273
+\def#2##1 {2586,85309
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85392
+\exdentamount=\defbodyindentbodyindent2589,85466
+\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85551
+\def#1{2596,85712
+\def#2##1 ##2 {2597,85748
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85848
+\exdentamount=\defbodyindentbodyindent2601,85922
+\def\defvarparsebody #1#2#3{\defvarparsebody2608,86193
+\def#1{2612,86380
+\def#2{2613,86416
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86475
+\exdentamount=\defbodyindentbodyindent2616,86549
+\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86640
+\def#1{2625,86799
+\def#2##1 {2626,86835
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86905
+\exdentamount=\defbodyindentbodyindent2629,86979
+\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87051
+\def#1{2636,87215
+\def#2##1 ##2 {2637,87251
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87338
+\exdentamount=\defbodyindentbodyindent2641,87412
+\def\defunargs #1{\defunargs2664,88172
+\def\deftypefunargs #1{\deftypefunargs2676,88554
+\def\deffn{\deffn2690,88936
+\def\deffnheader #1#2#3{\deffnheader2692,88993
+\begingroup\defname {name2693,89041
+\def\defun{\defun2699,89186
+\def\defunheader #1#2{\defunheader2701,89239
+\begingroup\defname {name2702,89314
+\defunargs {unargs2703,89350
+\def\deftypefun{\deftypefun2709,89498
+\def\deftypefunheader #1#2{\deftypefunheader2712,89620
+\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89729
+\begingroup\defname {name2716,89821
+\deftypefunargs {typefunargs2717,89867
+\def\deftypefn{\deftypefn2723,90038
+\def\deftypefnheader #1#2#3{\deftypefnheader2726,90187
+\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90323
+\begingroup\defname {name2730,90416
+\deftypefunargs {typefunargs2731,90456
+\def\defmac{\defmac2737,90577
+\def\defmacheader #1#2{\defmacheader2739,90634
+\begingroup\defname {name2740,90710
+\defunargs {unargs2741,90743
+\def\defspec{\defspec2747,90867
+\def\defspecheader #1#2{\defspecheader2749,90928
+\begingroup\defname {name2750,91005
+\defunargs {unargs2751,91045
+\def\deffnx #1 {\deffnx2758,91240
+\def\defunx #1 {\defunx2759,91297
+\def\defmacx #1 {\defmacx2760,91354
+\def\defspecx #1 {\defspecx2761,91413
+\def\deftypefnx #1 {\deftypefnx2762,91474
+\def\deftypeunx #1 {\deftypeunx2763,91539
+\def\defop #1 {\defop2769,91685
+\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91720
+\def\defopheader #1#2#3{\defopheader2772,91774
+\begingroup\defname {name2774,91863
+\defunargs {unargs2775,91909
+\def\defmethod{\defmethod2780,91970
+\def\defmethodheader #1#2#3{\defmethodheader2782,92043
+\begingroup\defname {name2784,92131
+\defunargs {unargs2785,92171
+\def\defcv #1 {\defcv2790,92245
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92280
+\def\defcvarheader #1#2#3{\defcvarheader2793,92339
+\begingroup\defname {name2795,92425
+\defvarargs {varargs2796,92471
+\def\defivar{\defivar2801,92544
+\def\defivarheader #1#2#3{\defivarheader2803,92607
+\begingroup\defname {name2805,92693
+\defvarargs {varargs2806,92744
+\def\defopx #1 {\defopx2812,92893
+\def\defmethodx #1 {\defmethodx2813,92950
+\def\defcvx #1 {\defcvx2814,93015
+\def\defivarx #1 {\defivarx2815,93072
+\def\defvarargs #1{\defvarargs2822,93343
+\def\defvr{\defvr2828,93487
+\def\defvrheader #1#2#3{\defvrheader2830,93542
+\begingroup\defname {name2831,93590
+\def\defvar{\defvar2835,93675
+\def\defvarheader #1#2{\defvarheader2837,93735
+\begingroup\defname {name2838,93806
+\defvarargs {varargs2839,93842
+\def\defopt{\defopt2844,93908
+\def\defoptheader #1#2{\defoptheader2846,93968
+\begingroup\defname {name2847,94039
+\defvarargs {varargs2848,94078
+\def\deftypevar{\deftypevar2853,94135
+\def\deftypevarheader #1#2{\deftypevarheader2856,94251
+\begingroup\defname {name2858,94334
+\def\deftypevr{\deftypevr2865,94508
+\def\deftypevrheader #1#2#3{\deftypevrheader2867,94579
+\begingroup\defname {name2868,94631
+\def\defvrx #1 {\defvrx2876,94868
+\def\defvarx #1 {\defvarx2877,94925
+\def\defoptx #1 {\defoptx2878,94984
+\def\deftypevarx #1 {\deftypevarx2879,95043
+\def\deftypevrx #1 {\deftypevrx2880,95110
+\def\deftpargs #1{\deftpargs2885,95259
+\def\deftp{\deftp2889,95339
+\def\deftpheader #1#2#3{\deftpheader2891,95394
+\begingroup\defname {name2892,95442
+\def\deftpx #1 {\deftpx2897,95601
+\def\setref#1{\setref2908,95922
+\def\unnumbsetref#1{\unnumbsetref2913,96036
+\def\appendixsetref#1{\appendixsetref2918,96143
+\def\pxref#1{\pxref2929,96554
+\def\xref#1{\xref2930,96590
+\def\ref#1{\ref2931,96625
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96655
+\def\printedmanual{\printedmanual2933,96698
+\def\printednodename{\printednodename2934,96736
+\def\printednodename{\printednodename2939,96861
+section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97493
+\refx{x2957,97571
+\def\dosetq #1#2{\dosetq2965,97791
+\def\internalsetq #1#2{\internalsetq2973,98049
+\def\Ypagenumber{\Ypagenumber2977,98150
+\def\Ytitle{\Ytitle2979,98176
+\def\Ynothing{\Ynothing2981,98203
+\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98220
+\def\Yappendixletterandtype{\Yappendixletterandtype2992,98536
+\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98566
+\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98621
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98725
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98796
+ \def\linenumber{\linenumber3009,99135
+\def\refx#1#2{\refx3015,99319
+\def\xrdef #1#2{\xrdef3037,99945
+\def\readauxfile{\readauxfile3040,100030
+\def\supereject{\supereject3110,101811
+\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102496
+\def\openindices{\openindices3139,102682
+\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102907
+\parindent = \defaultparindentaultparindent3152,102959
+\def\smallbook{\smallbook3175,103683
+\global\def\Esmallexample{\Esmallexample3192,104110
+\def\afourpaper{\afourpaper3196,104201
+\def\finalout{\finalout3224,105009
+\def\normaldoublequote{\normaldoublequote3235,105270
+\def\normaltilde{\normaltilde3236,105296
+\def\normalcaret{\normalcaret3237,105316
+\def\normalunderscore{\normalunderscore3238,105336
+\def\normalverticalbar{\normalverticalbar3239,105361
+\def\normalless{\normalless3240,105387
+\def\normalgreater{\normalgreater3241,105406
+\def\normalplus{\normalplus3242,105428
+\def\ifusingtt#1#2{\ifusingtt3253,105920
+\def\activedoublequote{\activedoublequote3261,106248
+\def~{~3264,106334
+\def^{^3267,106395
+\def_{_3270,106434
+\def\_{\_3272,106508
+\def\lvvmode{\lvvmode3279,106845
+\def|{|3282,106895
+\def<{<3285,106958
+\def>{>3288,107015
+\def+{+3290,107053
+\def\turnoffactive{\turnoffactive3296,107214
+\global\def={=3307,107500
+\def\normalbackslash{\normalbackslash3321,107882
+
+merc-src/accumulator.m,4915
+:- interface146,5371
+:- import_module hlds148,5386
+:- import_module univ152,5478
+:- pred accu_transform_proc159,5793
+:- implementation166,6115
+:- import_module libs180,6552
+:- import_module mdbcomp184,6681
+:- import_module parse_tree186,6742
+:- import_module assoc_list194,7013
+:- import_module bool195,7042
+:- import_module int196,7065
+:- import_module io197,7087
+:- import_module list198,7108
+:- import_module map199,7131
+:- import_module maybe200,7153
+:- import_module pair201,7177
+:- import_module require202,7200
+:- import_module set203,7226
+:- import_module solutions204,7248
+:- import_module string205,7276
+:- import_module term206,7301
+:- import_module varset207,7324
+:- type top_level213,7499
+:- type accu_goal_id225,7900
+:- type accu_case228,7964
+:- type accu_goal_store234,8091
+:- type accu_subst238,8216
+:- type accu_warning240,8264
+accu_transform_proc247,8578
+:- pred generate_warnings334,12550
+generate_warnings337,12669
+:- pred generate_warning342,12895
+generate_warning345,13001
+:- pred should_attempt_accu_transform365,13886
+should_attempt_accu_transform370,14123
+:- pred should_attempt_accu_transform_2398,15406
+should_attempt_accu_transform_2405,15763
+:- pred accu_standardize440,17390
+accu_standardize442,17455
+:- pred identify_goal_type465,18169
+identify_goal_type469,18359
+:- pred is_recursive_case549,21175
+is_recursive_case551,21253
+:- type store_info560,21713
+:- func initialize_goal_store570,22060
+initialize_goal_store573,22166
+:- pred accu_store580,22421
+accu_store584,22576
+:- pred identify_recursive_calls601,23288
+identify_recursive_calls604,23406
+:- pred identify_out_and_out_prime626,24396
+identify_out_and_out_prime631,24631
+:- type accu_sets676,26425
+:- pred accu_stage1689,26977
+accu_stage1693,27155
+:- pred accu_stage1_2727,28347
+accu_stage1_2731,28515
+:- pred accu_sets_init781,30557
+accu_sets_init783,30605
+:- func set_upto796,30984
+set_upto798,31039
+:- pred accu_before812,31498
+accu_before815,31639
+:- pred accu_assoc835,32477
+accu_assoc838,32617
+:- pred accu_construct862,33712
+accu_construct865,33856
+:- pred accu_construct_assoc896,35307
+accu_construct_assoc899,35457
+:- pred accu_update938,37069
+accu_update941,37210
+:- pred member_lessthan_goalid964,38219
+member_lessthan_goalid967,38342
+:- type accu_assoc975,38652
+:- pred accu_is_associative986,39138
+accu_is_associative989,39250
+:- pred associativity_assertion1014,40263
+associativity_assertion1017,40404
+:- pred commutativity_assertion1037,41242
+commutativity_assertion1040,41369
+:- pred accu_is_update1057,41952
+accu_is_update1060,42066
+:- pred is_associative_construction1078,42802
+is_associative_construction1081,42898
+:- type accu_substs1095,43480
+:- type accu_base1103,43744
+:- pred accu_stage21124,44605
+accu_stage21131,44946
+:- pred accu_substs_init1179,46957
+accu_substs_init1182,47097
+:- pred acc_var_subst_init1194,47573
+acc_var_subst_init1198,47718
+:- pred create_new_var1207,48147
+create_new_var1210,48288
+:- pred accu_process_assoc_set1223,48862
+accu_process_assoc_set1229,49150
+:- pred accu_has_heuristic1297,52081
+accu_has_heuristic1299,52161
+:- pred accu_heuristic1304,52336
+accu_heuristic1307,52457
+:- pred accu_process_update_set1318,52906
+accu_process_update_set1325,53221
+:- pred accu_divide_base_case1380,55844
+accu_divide_base_case1385,56059
+:- pred accu_related1412,57146
+accu_related1415,57270
+:- inst stored_goal_plain_call1444,58415
+:- pred lookup_call1449,58601
+lookup_call1452,58715
+:- pred accu_stage31470,59432
+accu_stage31477,59826
+:- pred acc_proc_info1508,61326
+acc_proc_info1512,61485
+:- pred acc_pred_info1556,63449
+acc_pred_info1559,63597
+:- pred accu_create_goal1600,65285
+accu_create_goal1607,65628
+:- func create_acc_call1621,66400
+create_acc_call1625,66569
+:- pred create_orig_goal1634,66987
+create_orig_goal1638,67176
+:- pred create_acc_goal1662,68157
+create_acc_goal1667,68380
+:- func create_new_orig_recursive_goals1709,70225
+create_new_orig_recursive_goals1712,70368
+:- func create_new_recursive_goals1723,70918
+create_new_recursive_goals1727,71108
+:- func create_new_base_goals1738,71717
+create_new_base_goals1741,71831
+:- pred acc_unification1749,72156
+acc_unification1751,72225
+:- pred accu_top_level1766,72896
+accu_top_level1770,73058
+:- pred update_accumulator_pred1856,76290
+update_accumulator_pred1859,76411
+:- func accu_rename1876,77253
+accu_rename1879,77363
+:- func base_case_ids1889,77784
+base_case_ids1891,77846
+:- func base_case_ids_set1898,78048
+base_case_ids_set1900,78113
+:- func accu_goal_list1905,78269
+accu_goal_list1907,78349
+:- pred calculate_goal_info1916,78680
+calculate_goal_info1918,78753
+:- func chain_subst1932,79319
+chain_subst1934,79378
+:- pred chain_subst_21938,79482
+chain_subst_21941,79576
+:- some [T] pred unravel_univ1956,80060
+:- pragma foreign_export1957,80116
+unravel_univ1961,80340
c-src/c.c,76
T f(1,0
@@ -4574,13 +4731,13 @@ extern struct node *yylval;yylval306,6246
unsigned char parse_cell_or_range 309,6291
unsigned char parse_cell_or_range 311,6355
yylex FUN0(315,6405
-parse_cell_or_range FUN2(587,11771
-#define CK_ABS_R(671,13213
-#define CK_REL_R(675,13292
-#define CK_ABS_C(680,13421
-#define CK_REL_C(684,13500
-#define MAYBEREL(689,13629
-str_to_col FUN1(847,16830
+parse_cell_or_range FUN2(587,11772
+#define CK_ABS_R(671,13214
+#define CK_REL_R(675,13293
+#define CK_ABS_C(680,13422
+#define CK_REL_C(684,13501
+#define MAYBEREL(689,13630
+str_to_col FUN1(847,16831
y-src/parse.c,520
#define YYBISON 4,64
diff --git a/test/manual/etags/ETAGS.good_3 b/test/manual/etags/ETAGS.good_3
index 40be768aacb..36edc389617 100644
--- a/test/manual/etags/ETAGS.good_3
+++ b/test/manual/etags/ETAGS.good_3
@@ -175,7 +175,7 @@ package body Truc.Bidule Truc.Bidule/b138,2153
protected body Bidule Bidule/b139,2181
protected body Machin_T Machin_T/b146,2281
-c-src/abbrev.c,2072
+c-src/abbrev.c,1957
Lisp_Object Vabbrev_table_name_list;43,1429
Lisp_Object Vglobal_abbrev_table;48,1574
Lisp_Object Vfundamental_mode_abbrev_table;52,1685
@@ -186,33 +186,31 @@ Lisp_Object Vabbrev_start_location_buffer;66,2046
Lisp_Object Vlast_abbrev;70,2155
Lisp_Object Vlast_abbrev_text;75,2324
int last_abbrev_point;79,2414
-Lisp_Object Vpre_abbrev_expand_hook,83,2487
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;83,2487
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,85,2551
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table85,2551
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,92,2743
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table92,2743
-DEFUN ("define-abbrev", Fdefine_abbrev,107,3124
-DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev107,3124
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,149,4443
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev149,4443
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,160,4814
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev160,4814
-DEFUN ("abbrev-symbol", Fabbrev_symbol,174,5282
-DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol174,5282
-DEFUN ("abbrev-expansion", Fabbrev_expansion,202,6246
-DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion202,6246
-DEFUN ("expand-abbrev", Fexpand_abbrev,218,6761
-DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev218,6761
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,389,11682
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev389,11682
-write_abbrev 426,12889
-describe_abbrev 445,13324
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,466,13839
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description466,13839
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,506,14995
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table506,14995
-syms_of_abbrev 540,16072
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,82,2440
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table82,2440
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,89,2632
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table89,2632
+DEFUN ("define-abbrev", Fdefine_abbrev,104,3013
+DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev104,3013
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,146,4332
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev146,4332
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,157,4703
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev157,4703
+DEFUN ("abbrev-symbol", Fabbrev_symbol,171,5171
+DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol171,5171
+DEFUN ("abbrev-expansion", Fabbrev_expansion,199,6135
+DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion199,6135
+DEFUN ("expand-abbrev", Fexpand_abbrev,215,6650
+DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev215,6650
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,383,11495
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev383,11495
+write_abbrev 420,12702
+describe_abbrev 439,13137
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,460,13652
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description460,13652
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,500,14808
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table500,14808
+syms_of_abbrev 534,15885
c-src/torture.c,197
(*tag1 tag118,452
@@ -1155,165 +1153,165 @@ make_lispy_position 5228,157391
toolkit_menubar_in_use 5456,163954
make_scroll_bar_position 5469,164322
make_lispy_event 5485,164968
-make_lispy_movement 6104,183532
-make_lispy_switch_frame 6131,184263
-make_lispy_focus_in 6137,184370
-make_lispy_focus_out 6145,184496
-parse_modifiers_uncached 6163,184946
-#define SINGLE_LETTER_MOD(6185,185466
-#undef SINGLE_LETTER_MOD6212,185907
-#define MULTI_LETTER_MOD(6214,185933
-#undef MULTI_LETTER_MOD6231,186401
-apply_modifiers_uncached 6273,187575
-static const char *const modifier_names[modifier_names6319,189194
-#define NUM_MOD_NAMES 6325,189400
-static Lisp_Object modifier_symbols;6327,189450
-lispy_modifier_list 6331,189587
-#define KEY_TO_CHAR(6353,190253
-parse_modifiers 6356,190329
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191518
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191518
-apply_modifiers 6422,192392
-reorder_modifiers 6491,194721
-modify_event_symbol 6536,196529
-DEFUN ("event-convert-list", Fevent_convert_list,6628,199245
-DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199245
-parse_solitary_modifier 6695,201136
-#define SINGLE_LETTER_MOD(6701,201259
-#define MULTI_LETTER_MOD(6705,201344
-#undef SINGLE_LETTER_MOD6763,202642
-#undef MULTI_LETTER_MOD6764,202667
-lucid_event_type_list_p 6775,202890
-get_input_pending 6814,203961
-record_asynch_buffer_change 6834,204580
-gobble_input 6872,205703
-tty_read_avail_input 6967,208311
-handle_async_input 7149,214040
-process_pending_signals 7165,214360
-unblock_input_to 7177,214646
-unblock_input 7200,215278
-totally_unblock_input 7209,215446
-handle_input_available_signal 7217,215530
-deliver_input_available_signal 7226,215701
-struct user_signal_info7235,215866
- int sig;7238,215916
- char *name;name7241,215957
- int npending;7244,216008
- struct user_signal_info *next;next7246,216025
-static struct user_signal_info *user_signals user_signals7250,216091
-add_user_signal 7253,216150
-handle_user_signal 7275,216599
-deliver_user_signal 7316,217559
-find_user_signal_name 7322,217660
-store_user_signal_events 7334,217842
-static Lisp_Object menu_bar_one_keymap_changed_items;7363,218417
-static Lisp_Object menu_bar_items_vector;7368,218631
-static int menu_bar_items_index;7369,218673
-static const char *separator_names[separator_names7372,218708
-menu_separator_name_p 7393,219149
-menu_bar_items 7426,219853
-Lisp_Object item_properties;7568,224604
-menu_bar_item 7571,224646
-menu_item_eval_property_1 7647,227176
-eval_dyn 7658,227466
-menu_item_eval_property 7666,227676
-parse_menu_item 7686,228342
-static Lisp_Object tool_bar_items_vector;7965,236337
-static Lisp_Object tool_bar_item_properties;7970,236511
-static int ntool_bar_items;7974,236607
-tool_bar_items 7990,237084
-process_tool_bar_item 8075,239893
-#define PROP(8112,240970
-set_prop 8114,241039
-parse_tool_bar_item 8167,242454
-#undef PROP8379,248845
-init_tool_bar_items 8387,248970
-append_tool_bar_item 8401,249262
-read_char_x_menu_prompt 8443,250772
-read_char_minibuf_menu_prompt 8503,252446
-#define PUSH_C_STR(8527,253015
-follow_key 8726,258554
-active_maps 8733,258696
-typedef struct keyremap8742,259022
- Lisp_Object parent;8745,259108
- Lisp_Object map;8748,259225
- int start,8753,259447
- int start, end;8753,259447
-} keyremap;8754,259465
-access_keymap_keyremap 8764,259809
-keyremap_step 8811,261451
-test_undefined 8867,262935
-read_key_sequence 8916,264862
-read_key_sequence_vs 9826,295822
-DEFUN ("read-key-sequence", Fread_key_sequence,9885,297295
-DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297295
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299983
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299983
-detect_input_pending 9950,300489
-detect_input_pending_ignore_squeezables 9959,300655
-detect_input_pending_run_timers 9967,300871
-clear_input_pending 9985,301363
-requeued_events_pending_p 9997,301733
-DEFUN ("input-pending-p", Finput_pending_p,10002,301814
-DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301814
-DEFUN ("recent-keys", Frecent_keys,10024,302597
-DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302597
-DEFUN ("this-command-keys", Fthis_command_keys,10055,303518
-DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303518
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303959
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303959
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304381
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304381
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304956
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304956
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305496
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305496
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306511
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306511
-DEFUN ("recursion-depth", Frecursion_depth,10158,307070
-DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307070
-DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307407
-DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307407
-DEFUN ("discard-input", Fdiscard_input,10203,308448
-DEFUN ("discard-input", Fdiscard_input,discard-input10203,308448
-DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308950
-DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308950
-stuff_buffered_input 10285,311046
-set_waiting_for_input 10323,312017
-clear_waiting_for_input 10337,312391
-handle_interrupt_signal 10351,312755
-deliver_interrupt_signal 10378,313643
-static int volatile force_quit_count;10387,313933
-handle_interrupt 10401,314415
-quit_throw_to_read_char 10541,318712
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319289
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319289
-DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320517
-DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320517
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321433
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321433
-DEFUN ("set-quit-char", Fset_quit_char,10694,322707
-DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322707
-DEFUN ("set-input-mode", Fset_input_mode,10729,323571
-DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323571
-DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324460
-DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324460
-DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325838
-DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325838
-DEFUN ("posn-at-point", Fposn_at_point,10824,327061
-DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327061
-init_kboard 10861,328215
-allocate_kboard 10893,329285
-wipe_kboard 10909,329638
-delete_kboard 10917,329752
-init_keyboard 10942,330282
-struct event_head11021,332697
- short var;11023,332717
- short kind;11024,332730
-static const struct event_head head_table[head_table11027,332748
-syms_of_keyboard 11045,333578
-keys_of_keyboard 11841,367116
-mark_kboards 11916,370435
+make_lispy_movement 6104,183531
+make_lispy_switch_frame 6131,184262
+make_lispy_focus_in 6137,184369
+make_lispy_focus_out 6145,184495
+parse_modifiers_uncached 6163,184945
+#define SINGLE_LETTER_MOD(6185,185465
+#undef SINGLE_LETTER_MOD6212,185906
+#define MULTI_LETTER_MOD(6214,185932
+#undef MULTI_LETTER_MOD6231,186400
+apply_modifiers_uncached 6273,187574
+static const char *const modifier_names[modifier_names6319,189193
+#define NUM_MOD_NAMES 6325,189399
+static Lisp_Object modifier_symbols;6327,189449
+lispy_modifier_list 6331,189586
+#define KEY_TO_CHAR(6353,190252
+parse_modifiers 6356,190328
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191517
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191517
+apply_modifiers 6422,192391
+reorder_modifiers 6491,194720
+modify_event_symbol 6536,196528
+DEFUN ("event-convert-list", Fevent_convert_list,6628,199244
+DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199244
+parse_solitary_modifier 6695,201135
+#define SINGLE_LETTER_MOD(6701,201258
+#define MULTI_LETTER_MOD(6705,201343
+#undef SINGLE_LETTER_MOD6763,202641
+#undef MULTI_LETTER_MOD6764,202666
+lucid_event_type_list_p 6775,202889
+get_input_pending 6814,203960
+record_asynch_buffer_change 6834,204579
+gobble_input 6872,205702
+tty_read_avail_input 6967,208310
+handle_async_input 7149,214039
+process_pending_signals 7165,214359
+unblock_input_to 7177,214645
+unblock_input 7200,215277
+totally_unblock_input 7209,215445
+handle_input_available_signal 7217,215529
+deliver_input_available_signal 7226,215700
+struct user_signal_info7235,215865
+ int sig;7238,215915
+ char *name;name7241,215956
+ int npending;7244,216007
+ struct user_signal_info *next;next7246,216024
+static struct user_signal_info *user_signals user_signals7250,216090
+add_user_signal 7253,216149
+handle_user_signal 7275,216598
+deliver_user_signal 7316,217558
+find_user_signal_name 7322,217659
+store_user_signal_events 7334,217841
+static Lisp_Object menu_bar_one_keymap_changed_items;7363,218416
+static Lisp_Object menu_bar_items_vector;7368,218630
+static int menu_bar_items_index;7369,218672
+static const char *separator_names[separator_names7372,218707
+menu_separator_name_p 7393,219148
+menu_bar_items 7426,219852
+Lisp_Object item_properties;7568,224603
+menu_bar_item 7571,224645
+menu_item_eval_property_1 7647,227175
+eval_dyn 7658,227465
+menu_item_eval_property 7666,227675
+parse_menu_item 7686,228341
+static Lisp_Object tool_bar_items_vector;7965,236336
+static Lisp_Object tool_bar_item_properties;7970,236510
+static int ntool_bar_items;7974,236606
+tool_bar_items 7990,237083
+process_tool_bar_item 8075,239892
+#define PROP(8112,240969
+set_prop 8114,241038
+parse_tool_bar_item 8167,242453
+#undef PROP8379,248844
+init_tool_bar_items 8387,248969
+append_tool_bar_item 8401,249261
+read_char_x_menu_prompt 8443,250771
+read_char_minibuf_menu_prompt 8503,252445
+#define PUSH_C_STR(8527,253014
+follow_key 8726,258553
+active_maps 8733,258695
+typedef struct keyremap8742,259021
+ Lisp_Object parent;8745,259107
+ Lisp_Object map;8748,259224
+ int start,8753,259446
+ int start, end;8753,259446
+} keyremap;8754,259464
+access_keymap_keyremap 8764,259808
+keyremap_step 8811,261450
+test_undefined 8867,262934
+read_key_sequence 8916,264861
+read_key_sequence_vs 9826,295821
+DEFUN ("read-key-sequence", Fread_key_sequence,9885,297294
+DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297294
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299982
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299982
+detect_input_pending 9950,300488
+detect_input_pending_ignore_squeezables 9959,300654
+detect_input_pending_run_timers 9967,300870
+clear_input_pending 9985,301362
+requeued_events_pending_p 9997,301732
+DEFUN ("input-pending-p", Finput_pending_p,10002,301813
+DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301813
+DEFUN ("recent-keys", Frecent_keys,10024,302596
+DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302596
+DEFUN ("this-command-keys", Fthis_command_keys,10055,303517
+DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303517
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303958
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303958
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304380
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304380
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304955
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304955
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305495
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305495
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306510
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306510
+DEFUN ("recursion-depth", Frecursion_depth,10158,307069
+DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307069
+DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307406
+DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307406
+DEFUN ("discard-input", Fdiscard_input,10203,308447
+DEFUN ("discard-input", Fdiscard_input,discard-input10203,308447
+DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308949
+DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308949
+stuff_buffered_input 10285,311045
+set_waiting_for_input 10323,312016
+clear_waiting_for_input 10337,312390
+handle_interrupt_signal 10351,312754
+deliver_interrupt_signal 10378,313642
+static int volatile force_quit_count;10387,313932
+handle_interrupt 10401,314414
+quit_throw_to_read_char 10541,318711
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319288
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319288
+DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320516
+DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320516
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321432
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321432
+DEFUN ("set-quit-char", Fset_quit_char,10694,322706
+DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322706
+DEFUN ("set-input-mode", Fset_input_mode,10729,323570
+DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323570
+DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324459
+DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324459
+DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325837
+DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325837
+DEFUN ("posn-at-point", Fposn_at_point,10824,327060
+DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327060
+init_kboard 10861,328214
+allocate_kboard 10893,329284
+wipe_kboard 10909,329637
+delete_kboard 10917,329751
+init_keyboard 10942,330281
+struct event_head11021,332696
+ short var;11023,332716
+ short kind;11024,332729
+static const struct event_head head_table[head_table11027,332747
+syms_of_keyboard 11045,333577
+keys_of_keyboard 11841,367115
+mark_kboards 11916,370434
c-src/emacs/src/lisp.h,27827
#define EMACS_LISP_H22,801
@@ -2520,11 +2518,11 @@ main(37,571
D(43,659
int x;44,694
-el-src/TAGTEST.EL,179
-(foo::defmumble bletch 1,0
-(defun foo==bar foo==bar2,33
-(defalias 'pending-delete-mode pending-delete-mode6,149
-(defalias (quote explicitly-quoted-pending-delete-mode)9,222
+el-src/TAGTEST.EL,181
+(foo::defmumble bletch 3,33
+(defun foo==bar foo==bar4,66
+(defalias 'pending-delete-mode pending-delete-mode8,182
+(defalias (quote explicitly-quoted-pending-delete-mode)11,255
el-src/emacs/lisp/progmodes/etags.el,5069
(defvar tags-file-name 34,1035
@@ -3313,22 +3311,22 @@ ord_add_element(71,1867
ord_del_element(85,2344
ord_disjoint(100,2783
ord_intersect(108,2953
-ord_intersection(126,3552
-ord_intersection3(130,3691
-ord_intersection(150,4531
-ord_intersection4(154,4703
-ord_intersection(176,5664
-ord_intersection2(181,5812
-ord_member(200,6318
-ord_seteq(216,6683
-ord_setproduct(225,6971
-ord_subset(240,7377
-ord_subtract(257,7861
-ord_symdiff(265,8054
-ord_union(288,8887
-ord_union4(303,9352
-ord_union(324,10171
-ord_union_all(329,10313
+ord_intersection(126,3553
+ord_intersection3(130,3692
+ord_intersection(150,4533
+ord_intersection4(154,4705
+ord_intersection(176,5666
+ord_intersection2(181,5814
+ord_member(200,6320
+ord_seteq(216,6685
+ord_setproduct(225,6973
+ord_subset(240,7379
+ord_subtract(257,7863
+ord_symdiff(265,8056
+ord_union(288,8889
+ord_union4(303,9354
+ord_union(324,10173
+ord_union_all(329,10315
prol-src/natded.prolog,2319
expandmng(100,2879
@@ -3543,6 +3541,11 @@ module A9,57
alias_method ( :foo2,foo237,586
A::Constant Constant42,655
+rs-src/test.rs,52
+enum IpAddrKind 3,11
+fn test1(8,48
+fn main(12,88
+
scm-src/test.scm,260
(define hello 1,0
(set! hello 3,32
@@ -3757,533 +3760,628 @@ tex-src/texinfo.tex,30627
\def\vritemindex #1{\vritemindex1068,35482
\def\tablez #1#2#3#4#5#6{\tablez1074,35631
\def\Edescription{\Edescription1077,35689
-\def\itemfont{\itemfont1082,35891
-\def\Etable{\Etable1090,36117
-\def\itemize{\itemize1103,36441
-\def\itemizezzz #1{\itemizezzz1105,36477
-\def\itemizey #1#2{\itemizey1110,36572
-\def#2{1119,36818
-\def\itemcontents{\itemcontents1120,36859
-\def\bullet{\bullet1123,36907
-\def\minus{\minus1124,36934
-\def\frenchspacing{\frenchspacing1128,37042
-\def\splitoff#1#2\endmark{\splitoff1134,37267
-\def\enumerate{\enumerate1140,37497
-\def\enumeratezzz #1{\enumeratezzz1141,37536
-\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37589
- \def\thearg{\thearg1146,37736
- \ifx\thearg\empty \def\thearg{\thearg1147,37755
-\def\numericenumerate{\numericenumerate1184,39089
-\def\lowercaseenumerate{\lowercaseenumerate1190,39219
-\def\uppercaseenumerate{\uppercaseenumerate1203,39566
-\def\startenumeration#1{\startenumeration1219,40056
-\def\alphaenumerate{\alphaenumerate1227,40238
-\def\capsenumerate{\capsenumerate1228,40273
-\def\Ealphaenumerate{\Ealphaenumerate1229,40307
-\def\Ecapsenumerate{\Ecapsenumerate1230,40341
-\def\itemizeitem{\itemizeitem1234,40421
-\def\newindex #1{\newindex1259,41278
-\def\defindex{\defindex1268,41567
-\def\newcodeindex #1{\newcodeindex1272,41675
-\def\defcodeindex{\defcodeindex1279,41935
-\def\synindex #1 #2 {\synindex1283,42115
-\def\syncodeindex #1 #2 {\syncodeindex1292,42455
-\def\doindex#1{\doindex1309,43134
-\def\singleindexer #1{\singleindexer1310,43193
-\def\docodeindex#1{\docodeindex1313,43305
-\def\singlecodeindexer #1{\singlecodeindexer1314,43372
-\def\indexdummies{\indexdummies1316,43430
-\def\_{\_1317,43450
-\def\w{\w1318,43478
-\def\bf{\bf1319,43505
-\def\rm{\rm1320,43534
-\def\sl{\sl1321,43563
-\def\sf{\sf1322,43592
-\def\tt{\tt1323,43620
-\def\gtr{\gtr1324,43648
-\def\less{\less1325,43678
-\def\hat{\hat1326,43710
-\def\char{\char1327,43740
-\def\TeX{\TeX1328,43772
-\def\dots{\dots1329,43802
-\def\copyright{\copyright1330,43835
-\def\tclose##1{\tclose1331,43878
-\def\code##1{\code1332,43923
-\def\samp##1{\samp1333,43964
-\def\t##1{\t1334,44005
-\def\r##1{\r1335,44040
-\def\i##1{\i1336,44075
-\def\b##1{\b1337,44110
-\def\cite##1{\cite1338,44145
-\def\key##1{\key1339,44186
-\def\file##1{\file1340,44225
-\def\var##1{\var1341,44266
-\def\kbd##1{\kbd1342,44305
-\def\indexdummyfont#1{\indexdummyfont1347,44461
-\def\indexdummytex{\indexdummytex1348,44487
-\def\indexdummydots{\indexdummydots1349,44511
-\def\indexnofonts{\indexnofonts1351,44537
-\let\w=\indexdummyfontdummyfont1352,44557
-\let\t=\indexdummyfontdummyfont1353,44580
-\let\r=\indexdummyfontdummyfont1354,44603
-\let\i=\indexdummyfontdummyfont1355,44626
-\let\b=\indexdummyfontdummyfont1356,44649
-\let\emph=\indexdummyfontdummyfont1357,44672
-\let\strong=\indexdummyfontdummyfont1358,44698
-\let\cite=\indexdummyfont=\indexdummyfont1359,44726
-\let\sc=\indexdummyfontdummyfont1360,44752
-\let\tclose=\indexdummyfontdummyfont1364,44924
-\let\code=\indexdummyfontdummyfont1365,44952
-\let\file=\indexdummyfontdummyfont1366,44978
-\let\samp=\indexdummyfontdummyfont1367,45004
-\let\kbd=\indexdummyfontdummyfont1368,45030
-\let\key=\indexdummyfontdummyfont1369,45055
-\let\var=\indexdummyfontdummyfont1370,45080
-\let\TeX=\indexdummytexdummytex1371,45105
-\let\dots=\indexdummydotsdummydots1372,45129
-\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45381
-\def\doind #1#2{\doind1384,45437
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45480
-\def\rawbackslashxx{\rawbackslashxx1389,45620
-{\indexnofontsnofonts1394,45882
-\def\dosubind #1#2#3{\dosubind1405,46193
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46241
-\def\rawbackslashxx{\rawbackslashxx1410,46345
-{\indexnofontsnofonts1414,46499
-\def\findex {\findex1443,47430
-\def\kindex {\kindex1444,47453
-\def\cindex {\cindex1445,47476
-\def\vindex {\vindex1446,47499
-\def\tindex {\tindex1447,47522
-\def\pindex {\pindex1448,47545
-\def\cindexsub {\cindexsub1450,47569
-\def\printindex{\printindex1462,47896
-\def\doprintindex#1{\doprintindex1464,47937
- \def\indexbackslash{\indexbackslash1481,48422
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48461
-\def\initial #1{\initial1517,49533
-\def\entry #1#2{\entry1523,49740
- \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50387
-\def\indexdotfill{\indexdotfill1549,50715
-\def\primary #1{\primary1552,50821
-\def\secondary #1#2{\secondary1556,50903
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50985
-\newbox\partialpageialpage1566,51158
-\def\begindoublecolumns{\begindoublecolumns1572,51316
- \output={\global\setbox\partialpage=ialpage=1573,51352
-\def\enddoublecolumns{\enddoublecolumns1577,51540
-\def\doublecolumnout{\doublecolumnout1580,51625
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51694
-\def\pagesofar{\pagesofar1584,51872
-\def\balancecolumns{\balancecolumns1588,52109
- \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52280
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52541
-\newcount \appendixno \appendixno = `\@no1627,53446
-\def\appendixletter{\appendixletter1628,53487
-\def\opencontents{\opencontents1632,53590
-\def\thischapter{\thischapter1637,53771
-\def\seccheck#1{\seccheck1638,53809
-\def\chapternofonts{\chapternofonts1643,53913
-\def\result{\result1646,53988
-\def\equiv{\equiv1647,54023
-\def\expansion{\expansion1648,54056
-\def\print{\print1649,54097
-\def\TeX{\TeX1650,54130
-\def\dots{\dots1651,54159
-\def\copyright{\copyright1652,54190
-\def\tt{\tt1653,54231
-\def\bf{\bf1654,54258
-\def\w{\w1655,54286
-\def\less{\less1656,54311
-\def\gtr{\gtr1657,54342
-\def\hat{\hat1658,54371
-\def\char{\char1659,54400
-\def\tclose##1{\tclose1660,54431
-\def\code##1{\code1661,54475
-\def\samp##1{\samp1662,54515
-\def\r##1{\r1663,54555
-\def\b##1{\b1664,54589
-\def\key##1{\key1665,54623
-\def\file##1{\file1666,54661
-\def\kbd##1{\kbd1667,54701
-\def\i##1{\i1669,54809
-\def\cite##1{\cite1670,54843
-\def\var##1{\var1671,54883
-\def\emph##1{\emph1672,54921
-\def\dfn##1{\dfn1673,54961
-\def\thischaptername{\thischaptername1676,55002
-\outer\def\chapter{\chapter1677,55041
-\def\chapterzzz #1{\chapterzzz1678,55082
-{\chapternofonts%nofonts%1687,55478
-\global\let\section = \numberedsec=1692,55631
-\global\let\subsection = \numberedsubsec=1693,55666
-\global\let\subsubsection = \numberedsubsubsec=1694,55707
-\outer\def\appendix{\appendix1697,55758
-\def\appendixzzz #1{\appendixzzz1698,55801
-\global\advance \appendixno by 1 \message{no1700,55878
-\chapmacro {#1}{Appendix \appendixletter}letter1701,55947
-\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56040
-{\chapternofonts%nofonts%1705,56112
- {#1}{Appendix \appendixletter}letter1707,56168
-\appendixnoderef %noderef1710,56268
-\global\let\section = \appendixsec=1711,56287
-\global\let\subsection = \appendixsubsec=1712,56322
-\global\let\subsubsection = \appendixsubsubsec=1713,56363
-\outer\def\top{\top1716,56414
-\outer\def\unnumbered{\unnumbered1717,56454
-\def\unnumberedzzz #1{\unnumberedzzz1718,56501
-{\chapternofonts%nofonts%1722,56664
-\global\let\section = \unnumberedsec=1727,56814
-\global\let\subsection = \unnumberedsubsec=1728,56851
-\global\let\subsubsection = \unnumberedsubsubsec=1729,56894
-\outer\def\numberedsec{\numberedsec1732,56947
-\def\seczzz #1{\seczzz1733,56988
-{\chapternofonts%nofonts%1736,57144
-\outer\def\appendixsection{\appendixsection1745,57330
-\outer\def\appendixsec{\appendixsec1746,57387
-\def\appendixsectionzzz #1{\appendixsectionzzz1747,57440
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57552
-{\chapternofonts%nofonts%1750,57620
-{#1}{\appendixletter}letter1752,57676
-\appendixnoderef %noderef1755,57776
-\outer\def\unnumberedsec{\unnumberedsec1759,57816
-\def\unnumberedseczzz #1{\unnumberedseczzz1760,57869
-{\chapternofonts%nofonts%1762,57964
-\outer\def\numberedsubsec{\numberedsubsec1770,58132
-\def\numberedsubseczzz #1{\numberedsubseczzz1771,58187
-{\chapternofonts%nofonts%1774,58366
-\outer\def\appendixsubsec{\appendixsubsec1783,58570
-\def\appendixsubseczzz #1{\appendixsubseczzz1784,58625
-\subsecheading {#1}{\appendixletter}letter1786,58747
-{\chapternofonts%nofonts%1787,58812
-{#1}{\appendixletter}letter1789,58871
-\appendixnoderef %noderef1792,58986
-\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59026
-\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59085
-{\chapternofonts%nofonts%1799,59186
-\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59357
-\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59418
-{\chapternofonts%nofonts%1812,59615
-\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59848
-\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59909
- {\appendixletter}letter1827,60048
-{\chapternofonts%nofonts%1828,60114
- {\appendixletter}letter1830,60179
-\appendixnoderef %noderef1834,60313
-\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60353
-\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60418
-{\chapternofonts%nofonts%1841,60525
-\def\infotop{\infotop1851,60854
-\def\infounnumbered{\infounnumbered1852,60892
-\def\infounnumberedsec{\infounnumberedsec1853,60937
-\def\infounnumberedsubsec{\infounnumberedsubsec1854,60988
-\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61045
-\def\infoappendix{\infoappendix1857,61109
-\def\infoappendixsec{\infoappendixsec1858,61150
-\def\infoappendixsubsec{\infoappendixsubsec1859,61197
-\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61250
-\def\infochapter{\infochapter1862,61310
-\def\infosection{\infosection1863,61349
-\def\infosubsection{\infosubsection1864,61388
-\def\infosubsubsection{\infosubsubsection1865,61433
-\global\let\section = \numberedsec=1870,61670
-\global\let\subsection = \numberedsubsec=1871,61705
-\global\let\subsubsection = \numberedsubsubsec=1872,61746
-\def\majorheading{\majorheading1886,62253
-\def\majorheadingzzz #1{\majorheadingzzz1887,62298
-\def\chapheading{\chapheading1893,62531
-\def\chapheadingzzz #1{\chapheadingzzz1894,62574
-\def\heading{\heading1899,62769
-\def\subheading{\subheading1901,62806
-\def\subsubheading{\subsubheading1903,62849
-\def\dobreak#1#2{\dobreak1910,63126
-\def\setchapterstyle #1 {\setchapterstyle1912,63204
-\def\chapbreak{\chapbreak1919,63459
-\def\chappager{\chappager1920,63509
-\def\chapoddpage{\chapoddpage1921,63547
-\def\setchapternewpage #1 {\setchapternewpage1923,63626
-\def\CHAPPAGoff{\CHAPPAGoff1925,63683
-\def\CHAPPAGon{\CHAPPAGon1929,63777
-\global\def\HEADINGSon{\HEADINGSon1932,63868
-\def\CHAPPAGodd{\CHAPPAGodd1934,63910
-\global\def\HEADINGSon{\HEADINGSon1937,64006
-\def\CHAPFplain{\CHAPFplain1941,64060
-\def\chfplain #1#2{\chfplain1945,64152
-\def\unnchfplain #1{\unnchfplain1956,64375
-\def\unnchfopen #1{\unnchfopen1964,64604
-\def\chfopen #1#2{\chfopen1970,64812
-\def\CHAPFopen{\CHAPFopen1975,64956
-\def\subsecheadingbreak{\subsecheadingbreak1982,65174
-\def\secheadingbreak{\secheadingbreak1985,65303
-\def\secheading #1#2#3{\secheading1993,65585
-\def\plainsecheading #1{\plainsecheading1994,65641
-\def\secheadingi #1{\secheadingi1995,65684
-\def\subsecheading #1#2#3#4{\subsecheading2006,66052
-\def\subsecheadingi #1{\subsecheadingi2007,66119
-\def\subsubsecfonts{\subsubsecfonts2014,66416
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66539
-\def\subsubsecheadingi #1{\subsubsecheadingi2018,66617
-\def\startcontents#1{\startcontents2032,67089
- \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67362
-\outer\def\contents{\contents2049,67721
-\outer\def\summarycontents{\summarycontents2057,67865
- \def\secentry ##1##2##3##4{\secentry2067,68236
- \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68271
- \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68306
- \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68347
- \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68385
- \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68432
-\def\chapentry#1#2#3{\chapentry2085,68866
-\def\shortchapentry#1#2#3{\shortchapentry2088,68983
- {#2\labelspace #1}space2091,69093
-\def\unnumbchapentry#1#2{\unnumbchapentry2094,69147
-\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69194
-\def\secentry#1#2#3#4{\secentry2102,69358
-\def\unnumbsecentry#1#2{\unnumbsecentry2103,69417
-\def\subsecentry#1#2#3#4#5{\subsecentry2106,69478
-\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69548
-\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69622
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69656
-\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69707
-\def\dochapentry#1#2{\dochapentry2123,70081
-\def\dosecentry#1#2{\dosecentry2138,70686
-\def\dosubsecentry#1#2{\dosubsecentry2145,70864
-\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71049
-\def\labelspace{\labelspace2160,71300
-\def\dopageno#1{\dopageno2162,71335
-\def\doshortpageno#1{\doshortpageno2163,71361
-\def\chapentryfonts{\chapentryfonts2165,71393
-\def\secentryfonts{\secentryfonts2166,71428
-\def\point{\point2192,72387
-\def\result{\result2194,72408
-\def\expansion{\expansion2195,72481
-\def\print{\print2196,72552
-\def\equiv{\equiv2198,72619
-\def\error{\error2218,73392
-\def\tex{\tex2224,73621
-\def\@{\@2242,74004
-\gdef\sepspaces{\def {\ }}}\2265,74736
-\def\aboveenvbreak{\aboveenvbreak2268,74818
-\def\afterenvbreak{\afterenvbreak2272,74984
-\def\ctl{\ctl2286,75495
-\def\ctr{\ctr2287,75567
-\def\cbl{\cbl2288,75606
-\def\cbr{\cbr2289,75646
-\def\carttop{\carttop2290,75685
-\def\cartbot{\cartbot2293,75793
-\long\def\cartouche{\cartouche2299,75933
-\def\Ecartouche{\Ecartouche2326,76721
-\def\lisp{\lisp2338,76856
-\def\Elisp{\Elisp2348,77203
-\def\next##1{\next2360,77529
-\def\Eexample{\Eexample2364,77571
-\def\Esmallexample{\Esmallexample2367,77618
-\def\smalllispx{\smalllispx2373,77796
-\def\Esmalllisp{\Esmalllisp2383,78150
-\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78506
-\def\next##1{\next2397,78563
-\def\display{\display2401,78643
-\def\Edisplay{\Edisplay2410,78962
-\def\next##1{\next2422,79273
-\def\format{\format2426,79376
-\def\Eformat{\Eformat2434,79672
-\def\next##1{\next2437,79761
-\def\flushleft{\flushleft2441,79813
-\def\Eflushleft{\Eflushleft2451,80184
-\def\next##1{\next2454,80277
-\def\flushright{\flushright2456,80299
-\def\Eflushright{\Eflushright2466,80671
-\def\next##1{\next2470,80802
-\def\quotation{\quotation2474,80860
-\def\Equotation{\Equotation2480,81052
-\def\setdeffont #1 {\setdeffont2493,81450
-\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81496
-\newskip\defargsindent \defargsindent=50ptargsindent2496,81539
-\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81582
-\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81625
-\def\activeparens{\activeparens2503,81823
-\def\opnr{\opnr2529,83035
-\def\lbrb{\lbrb2530,83100
-\def\defname #1#2{\defname2536,83301
-\advance\dimen2 by -\defbodyindentbodyindent2540,83419
-\advance\dimen3 by -\defbodyindentbodyindent2542,83473
-\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83527
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83669
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83744
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84113
-\advance\leftskip by -\defbodyindentbodyindent2557,84247
-\exdentamount=\defbodyindentbodyindent2558,84284
-\def\defparsebody #1#2#3{\defparsebody2568,84643
-\def#1{2572,84827
-\def#2{2573,84863
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84935
-\exdentamount=\defbodyindentbodyindent2576,85009
-\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85113
-\def#1{2585,85274
-\def#2##1 {2586,85310
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85393
-\exdentamount=\defbodyindentbodyindent2589,85467
-\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85552
-\def#1{2596,85713
-\def#2##1 ##2 {2597,85749
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85849
-\exdentamount=\defbodyindentbodyindent2601,85923
-\def\defvarparsebody #1#2#3{\defvarparsebody2608,86194
-\def#1{2612,86381
-\def#2{2613,86417
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86476
-\exdentamount=\defbodyindentbodyindent2616,86550
-\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86641
-\def#1{2625,86800
-\def#2##1 {2626,86836
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86906
-\exdentamount=\defbodyindentbodyindent2629,86980
-\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87052
-\def#1{2636,87216
-\def#2##1 ##2 {2637,87252
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87339
-\exdentamount=\defbodyindentbodyindent2641,87413
-\def\defunargs #1{\defunargs2664,88173
-\def\deftypefunargs #1{\deftypefunargs2676,88555
-\def\deffn{\deffn2690,88937
-\def\deffnheader #1#2#3{\deffnheader2692,88994
-\begingroup\defname {name2693,89042
-\def\defun{\defun2699,89187
-\def\defunheader #1#2{\defunheader2701,89240
-\begingroup\defname {name2702,89315
-\defunargs {unargs2703,89351
-\def\deftypefun{\deftypefun2709,89499
-\def\deftypefunheader #1#2{\deftypefunheader2712,89621
-\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89730
-\begingroup\defname {name2716,89822
-\deftypefunargs {typefunargs2717,89868
-\def\deftypefn{\deftypefn2723,90039
-\def\deftypefnheader #1#2#3{\deftypefnheader2726,90188
-\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90324
-\begingroup\defname {name2730,90417
-\deftypefunargs {typefunargs2731,90457
-\def\defmac{\defmac2737,90578
-\def\defmacheader #1#2{\defmacheader2739,90635
-\begingroup\defname {name2740,90711
-\defunargs {unargs2741,90744
-\def\defspec{\defspec2747,90868
-\def\defspecheader #1#2{\defspecheader2749,90929
-\begingroup\defname {name2750,91006
-\defunargs {unargs2751,91046
-\def\deffnx #1 {\deffnx2758,91241
-\def\defunx #1 {\defunx2759,91298
-\def\defmacx #1 {\defmacx2760,91355
-\def\defspecx #1 {\defspecx2761,91414
-\def\deftypefnx #1 {\deftypefnx2762,91475
-\def\deftypeunx #1 {\deftypeunx2763,91540
-\def\defop #1 {\defop2769,91686
-\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91721
-\def\defopheader #1#2#3{\defopheader2772,91775
-\begingroup\defname {name2774,91864
-\defunargs {unargs2775,91910
-\def\defmethod{\defmethod2780,91971
-\def\defmethodheader #1#2#3{\defmethodheader2782,92044
-\begingroup\defname {name2784,92132
-\defunargs {unargs2785,92172
-\def\defcv #1 {\defcv2790,92246
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92281
-\def\defcvarheader #1#2#3{\defcvarheader2793,92340
-\begingroup\defname {name2795,92426
-\defvarargs {varargs2796,92472
-\def\defivar{\defivar2801,92545
-\def\defivarheader #1#2#3{\defivarheader2803,92608
-\begingroup\defname {name2805,92694
-\defvarargs {varargs2806,92745
-\def\defopx #1 {\defopx2812,92894
-\def\defmethodx #1 {\defmethodx2813,92951
-\def\defcvx #1 {\defcvx2814,93016
-\def\defivarx #1 {\defivarx2815,93073
-\def\defvarargs #1{\defvarargs2822,93344
-\def\defvr{\defvr2828,93488
-\def\defvrheader #1#2#3{\defvrheader2830,93543
-\begingroup\defname {name2831,93591
-\def\defvar{\defvar2835,93676
-\def\defvarheader #1#2{\defvarheader2837,93736
-\begingroup\defname {name2838,93807
-\defvarargs {varargs2839,93843
-\def\defopt{\defopt2844,93909
-\def\defoptheader #1#2{\defoptheader2846,93969
-\begingroup\defname {name2847,94040
-\defvarargs {varargs2848,94079
-\def\deftypevar{\deftypevar2853,94136
-\def\deftypevarheader #1#2{\deftypevarheader2856,94252
-\begingroup\defname {name2858,94335
-\def\deftypevr{\deftypevr2865,94509
-\def\deftypevrheader #1#2#3{\deftypevrheader2867,94580
-\begingroup\defname {name2868,94632
-\def\defvrx #1 {\defvrx2876,94869
-\def\defvarx #1 {\defvarx2877,94926
-\def\defoptx #1 {\defoptx2878,94985
-\def\deftypevarx #1 {\deftypevarx2879,95044
-\def\deftypevrx #1 {\deftypevrx2880,95111
-\def\deftpargs #1{\deftpargs2885,95260
-\def\deftp{\deftp2889,95340
-\def\deftpheader #1#2#3{\deftpheader2891,95395
-\begingroup\defname {name2892,95443
-\def\deftpx #1 {\deftpx2897,95602
-\def\setref#1{\setref2908,95923
-\def\unnumbsetref#1{\unnumbsetref2913,96037
-\def\appendixsetref#1{\appendixsetref2918,96144
-\def\pxref#1{\pxref2929,96555
-\def\xref#1{\xref2930,96591
-\def\ref#1{\ref2931,96626
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96656
-\def\printedmanual{\printedmanual2933,96699
-\def\printednodename{\printednodename2934,96737
-\def\printednodename{\printednodename2939,96862
-section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97495
-\refx{x2957,97573
-\def\dosetq #1#2{\dosetq2965,97793
-\def\internalsetq #1#2{\internalsetq2973,98051
-\def\Ypagenumber{\Ypagenumber2977,98152
-\def\Ytitle{\Ytitle2979,98178
-\def\Ynothing{\Ynothing2981,98205
-\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98222
-\def\Yappendixletterandtype{\Yappendixletterandtype2992,98538
-\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98568
-\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98623
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98727
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98798
- \def\linenumber{\linenumber3009,99137
-\def\refx#1#2{\refx3015,99321
-\def\xrdef #1#2{\xrdef3037,99947
-\def\readauxfile{\readauxfile3040,100032
-\def\supereject{\supereject3110,101813
-\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102498
-\def\openindices{\openindices3139,102684
-\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102909
-\parindent = \defaultparindentaultparindent3152,102961
-\def\smallbook{\smallbook3175,103685
-\global\def\Esmallexample{\Esmallexample3192,104112
-\def\afourpaper{\afourpaper3196,104203
-\def\finalout{\finalout3224,105011
-\def\normaldoublequote{\normaldoublequote3235,105272
-\def\normaltilde{\normaltilde3236,105298
-\def\normalcaret{\normalcaret3237,105318
-\def\normalunderscore{\normalunderscore3238,105338
-\def\normalverticalbar{\normalverticalbar3239,105363
-\def\normalless{\normalless3240,105389
-\def\normalgreater{\normalgreater3241,105408
-\def\normalplus{\normalplus3242,105430
-\def\ifusingtt#1#2{\ifusingtt3253,105922
-\def\activedoublequote{\activedoublequote3261,106250
-\def~{~3264,106336
-\def^{^3267,106397
-\def_{_3270,106436
-\def\_{\_3272,106510
-\def\lvvmode{\lvvmode3279,106847
-\def|{|3282,106897
-\def<{<3285,106960
-\def>{>3288,107017
-\def+{+3290,107055
-\def\turnoffactive{\turnoffactive3296,107216
-\global\def={=3307,107502
-\def\normalbackslash{\normalbackslash3321,107884
+\def\itemfont{\itemfont1082,35890
+\def\Etable{\Etable1090,36116
+\def\itemize{\itemize1103,36440
+\def\itemizezzz #1{\itemizezzz1105,36476
+\def\itemizey #1#2{\itemizey1110,36571
+\def#2{1119,36817
+\def\itemcontents{\itemcontents1120,36858
+\def\bullet{\bullet1123,36906
+\def\minus{\minus1124,36933
+\def\frenchspacing{\frenchspacing1128,37041
+\def\splitoff#1#2\endmark{\splitoff1134,37266
+\def\enumerate{\enumerate1140,37496
+\def\enumeratezzz #1{\enumeratezzz1141,37535
+\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37588
+ \def\thearg{\thearg1146,37735
+ \ifx\thearg\empty \def\thearg{\thearg1147,37754
+\def\numericenumerate{\numericenumerate1184,39088
+\def\lowercaseenumerate{\lowercaseenumerate1190,39218
+\def\uppercaseenumerate{\uppercaseenumerate1203,39565
+\def\startenumeration#1{\startenumeration1219,40055
+\def\alphaenumerate{\alphaenumerate1227,40237
+\def\capsenumerate{\capsenumerate1228,40272
+\def\Ealphaenumerate{\Ealphaenumerate1229,40306
+\def\Ecapsenumerate{\Ecapsenumerate1230,40340
+\def\itemizeitem{\itemizeitem1234,40420
+\def\newindex #1{\newindex1259,41277
+\def\defindex{\defindex1268,41566
+\def\newcodeindex #1{\newcodeindex1272,41674
+\def\defcodeindex{\defcodeindex1279,41934
+\def\synindex #1 #2 {\synindex1283,42114
+\def\syncodeindex #1 #2 {\syncodeindex1292,42454
+\def\doindex#1{\doindex1309,43133
+\def\singleindexer #1{\singleindexer1310,43192
+\def\docodeindex#1{\docodeindex1313,43304
+\def\singlecodeindexer #1{\singlecodeindexer1314,43371
+\def\indexdummies{\indexdummies1316,43429
+\def\_{\_1317,43449
+\def\w{\w1318,43477
+\def\bf{\bf1319,43504
+\def\rm{\rm1320,43533
+\def\sl{\sl1321,43562
+\def\sf{\sf1322,43591
+\def\tt{\tt1323,43619
+\def\gtr{\gtr1324,43647
+\def\less{\less1325,43677
+\def\hat{\hat1326,43709
+\def\char{\char1327,43739
+\def\TeX{\TeX1328,43771
+\def\dots{\dots1329,43801
+\def\copyright{\copyright1330,43834
+\def\tclose##1{\tclose1331,43877
+\def\code##1{\code1332,43922
+\def\samp##1{\samp1333,43963
+\def\t##1{\t1334,44004
+\def\r##1{\r1335,44039
+\def\i##1{\i1336,44074
+\def\b##1{\b1337,44109
+\def\cite##1{\cite1338,44144
+\def\key##1{\key1339,44185
+\def\file##1{\file1340,44224
+\def\var##1{\var1341,44265
+\def\kbd##1{\kbd1342,44304
+\def\indexdummyfont#1{\indexdummyfont1347,44460
+\def\indexdummytex{\indexdummytex1348,44486
+\def\indexdummydots{\indexdummydots1349,44510
+\def\indexnofonts{\indexnofonts1351,44536
+\let\w=\indexdummyfontdummyfont1352,44556
+\let\t=\indexdummyfontdummyfont1353,44579
+\let\r=\indexdummyfontdummyfont1354,44602
+\let\i=\indexdummyfontdummyfont1355,44625
+\let\b=\indexdummyfontdummyfont1356,44648
+\let\emph=\indexdummyfontdummyfont1357,44671
+\let\strong=\indexdummyfontdummyfont1358,44697
+\let\cite=\indexdummyfont=\indexdummyfont1359,44725
+\let\sc=\indexdummyfontdummyfont1360,44751
+\let\tclose=\indexdummyfontdummyfont1364,44923
+\let\code=\indexdummyfontdummyfont1365,44951
+\let\file=\indexdummyfontdummyfont1366,44977
+\let\samp=\indexdummyfontdummyfont1367,45003
+\let\kbd=\indexdummyfontdummyfont1368,45029
+\let\key=\indexdummyfontdummyfont1369,45054
+\let\var=\indexdummyfontdummyfont1370,45079
+\let\TeX=\indexdummytexdummytex1371,45104
+\let\dots=\indexdummydotsdummydots1372,45128
+\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45380
+\def\doind #1#2{\doind1384,45436
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45479
+\def\rawbackslashxx{\rawbackslashxx1389,45619
+{\indexnofontsnofonts1394,45881
+\def\dosubind #1#2#3{\dosubind1405,46192
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46240
+\def\rawbackslashxx{\rawbackslashxx1410,46344
+{\indexnofontsnofonts1414,46498
+\def\findex {\findex1443,47429
+\def\kindex {\kindex1444,47452
+\def\cindex {\cindex1445,47475
+\def\vindex {\vindex1446,47498
+\def\tindex {\tindex1447,47521
+\def\pindex {\pindex1448,47544
+\def\cindexsub {\cindexsub1450,47568
+\def\printindex{\printindex1462,47895
+\def\doprintindex#1{\doprintindex1464,47936
+ \def\indexbackslash{\indexbackslash1481,48421
+ \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48460
+\def\initial #1{\initial1517,49532
+\def\entry #1#2{\entry1523,49739
+ \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50386
+\def\indexdotfill{\indexdotfill1549,50714
+\def\primary #1{\primary1552,50820
+\def\secondary #1#2{\secondary1556,50902
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50984
+\newbox\partialpageialpage1566,51157
+\def\begindoublecolumns{\begindoublecolumns1572,51315
+ \output={\global\setbox\partialpage=ialpage=1573,51351
+\def\enddoublecolumns{\enddoublecolumns1577,51539
+\def\doublecolumnout{\doublecolumnout1580,51624
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51693
+\def\pagesofar{\pagesofar1584,51871
+\def\balancecolumns{\balancecolumns1588,52108
+ \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52279
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52540
+\newcount \appendixno \appendixno = `\@no1627,53445
+\def\appendixletter{\appendixletter1628,53486
+\def\opencontents{\opencontents1632,53589
+\def\thischapter{\thischapter1637,53770
+\def\seccheck#1{\seccheck1638,53808
+\def\chapternofonts{\chapternofonts1643,53912
+\def\result{\result1646,53987
+\def\equiv{\equiv1647,54022
+\def\expansion{\expansion1648,54055
+\def\print{\print1649,54096
+\def\TeX{\TeX1650,54129
+\def\dots{\dots1651,54158
+\def\copyright{\copyright1652,54189
+\def\tt{\tt1653,54230
+\def\bf{\bf1654,54257
+\def\w{\w1655,54285
+\def\less{\less1656,54310
+\def\gtr{\gtr1657,54341
+\def\hat{\hat1658,54370
+\def\char{\char1659,54399
+\def\tclose##1{\tclose1660,54430
+\def\code##1{\code1661,54474
+\def\samp##1{\samp1662,54514
+\def\r##1{\r1663,54554
+\def\b##1{\b1664,54588
+\def\key##1{\key1665,54622
+\def\file##1{\file1666,54660
+\def\kbd##1{\kbd1667,54700
+\def\i##1{\i1669,54808
+\def\cite##1{\cite1670,54842
+\def\var##1{\var1671,54882
+\def\emph##1{\emph1672,54920
+\def\dfn##1{\dfn1673,54960
+\def\thischaptername{\thischaptername1676,55001
+\outer\def\chapter{\chapter1677,55040
+\def\chapterzzz #1{\chapterzzz1678,55081
+{\chapternofonts%nofonts%1687,55477
+\global\let\section = \numberedsec=1692,55630
+\global\let\subsection = \numberedsubsec=1693,55665
+\global\let\subsubsection = \numberedsubsubsec=1694,55706
+\outer\def\appendix{\appendix1697,55757
+\def\appendixzzz #1{\appendixzzz1698,55800
+\global\advance \appendixno by 1 \message{no1700,55877
+\chapmacro {#1}{Appendix \appendixletter}letter1701,55946
+\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56039
+{\chapternofonts%nofonts%1705,56111
+ {#1}{Appendix \appendixletter}letter1707,56167
+\appendixnoderef %noderef1710,56267
+\global\let\section = \appendixsec=1711,56286
+\global\let\subsection = \appendixsubsec=1712,56321
+\global\let\subsubsection = \appendixsubsubsec=1713,56362
+\outer\def\top{\top1716,56413
+\outer\def\unnumbered{\unnumbered1717,56453
+\def\unnumberedzzz #1{\unnumberedzzz1718,56500
+{\chapternofonts%nofonts%1722,56663
+\global\let\section = \unnumberedsec=1727,56813
+\global\let\subsection = \unnumberedsubsec=1728,56850
+\global\let\subsubsection = \unnumberedsubsubsec=1729,56893
+\outer\def\numberedsec{\numberedsec1732,56946
+\def\seczzz #1{\seczzz1733,56987
+{\chapternofonts%nofonts%1736,57143
+\outer\def\appendixsection{\appendixsection1745,57329
+\outer\def\appendixsec{\appendixsec1746,57386
+\def\appendixsectionzzz #1{\appendixsectionzzz1747,57439
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57551
+{\chapternofonts%nofonts%1750,57619
+{#1}{\appendixletter}letter1752,57675
+\appendixnoderef %noderef1755,57775
+\outer\def\unnumberedsec{\unnumberedsec1759,57815
+\def\unnumberedseczzz #1{\unnumberedseczzz1760,57868
+{\chapternofonts%nofonts%1762,57963
+\outer\def\numberedsubsec{\numberedsubsec1770,58131
+\def\numberedsubseczzz #1{\numberedsubseczzz1771,58186
+{\chapternofonts%nofonts%1774,58365
+\outer\def\appendixsubsec{\appendixsubsec1783,58569
+\def\appendixsubseczzz #1{\appendixsubseczzz1784,58624
+\subsecheading {#1}{\appendixletter}letter1786,58746
+{\chapternofonts%nofonts%1787,58811
+{#1}{\appendixletter}letter1789,58870
+\appendixnoderef %noderef1792,58985
+\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59025
+\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59084
+{\chapternofonts%nofonts%1799,59185
+\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59356
+\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59417
+{\chapternofonts%nofonts%1812,59614
+\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59847
+\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59908
+ {\appendixletter}letter1827,60047
+{\chapternofonts%nofonts%1828,60113
+ {\appendixletter}letter1830,60178
+\appendixnoderef %noderef1834,60312
+\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60352
+\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60417
+{\chapternofonts%nofonts%1841,60524
+\def\infotop{\infotop1851,60853
+\def\infounnumbered{\infounnumbered1852,60891
+\def\infounnumberedsec{\infounnumberedsec1853,60936
+\def\infounnumberedsubsec{\infounnumberedsubsec1854,60987
+\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61044
+\def\infoappendix{\infoappendix1857,61108
+\def\infoappendixsec{\infoappendixsec1858,61149
+\def\infoappendixsubsec{\infoappendixsubsec1859,61196
+\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61249
+\def\infochapter{\infochapter1862,61309
+\def\infosection{\infosection1863,61348
+\def\infosubsection{\infosubsection1864,61387
+\def\infosubsubsection{\infosubsubsection1865,61432
+\global\let\section = \numberedsec=1870,61669
+\global\let\subsection = \numberedsubsec=1871,61704
+\global\let\subsubsection = \numberedsubsubsec=1872,61745
+\def\majorheading{\majorheading1886,62252
+\def\majorheadingzzz #1{\majorheadingzzz1887,62297
+\def\chapheading{\chapheading1893,62530
+\def\chapheadingzzz #1{\chapheadingzzz1894,62573
+\def\heading{\heading1899,62768
+\def\subheading{\subheading1901,62805
+\def\subsubheading{\subsubheading1903,62848
+\def\dobreak#1#2{\dobreak1910,63125
+\def\setchapterstyle #1 {\setchapterstyle1912,63203
+\def\chapbreak{\chapbreak1919,63458
+\def\chappager{\chappager1920,63508
+\def\chapoddpage{\chapoddpage1921,63546
+\def\setchapternewpage #1 {\setchapternewpage1923,63625
+\def\CHAPPAGoff{\CHAPPAGoff1925,63682
+\def\CHAPPAGon{\CHAPPAGon1929,63776
+\global\def\HEADINGSon{\HEADINGSon1932,63867
+\def\CHAPPAGodd{\CHAPPAGodd1934,63909
+\global\def\HEADINGSon{\HEADINGSon1937,64005
+\def\CHAPFplain{\CHAPFplain1941,64059
+\def\chfplain #1#2{\chfplain1945,64151
+\def\unnchfplain #1{\unnchfplain1956,64374
+\def\unnchfopen #1{\unnchfopen1964,64603
+\def\chfopen #1#2{\chfopen1970,64811
+\def\CHAPFopen{\CHAPFopen1975,64955
+\def\subsecheadingbreak{\subsecheadingbreak1982,65173
+\def\secheadingbreak{\secheadingbreak1985,65302
+\def\secheading #1#2#3{\secheading1993,65584
+\def\plainsecheading #1{\plainsecheading1994,65640
+\def\secheadingi #1{\secheadingi1995,65683
+\def\subsecheading #1#2#3#4{\subsecheading2006,66051
+\def\subsecheadingi #1{\subsecheadingi2007,66118
+\def\subsubsecfonts{\subsubsecfonts2014,66415
+\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66538
+\def\subsubsecheadingi #1{\subsubsecheadingi2018,66616
+\def\startcontents#1{\startcontents2032,67088
+ \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67361
+\outer\def\contents{\contents2049,67720
+\outer\def\summarycontents{\summarycontents2057,67864
+ \def\secentry ##1##2##3##4{\secentry2067,68235
+ \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68270
+ \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68305
+ \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68346
+ \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68384
+ \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68431
+\def\chapentry#1#2#3{\chapentry2085,68865
+\def\shortchapentry#1#2#3{\shortchapentry2088,68982
+ {#2\labelspace #1}space2091,69092
+\def\unnumbchapentry#1#2{\unnumbchapentry2094,69146
+\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69193
+\def\secentry#1#2#3#4{\secentry2102,69357
+\def\unnumbsecentry#1#2{\unnumbsecentry2103,69416
+\def\subsecentry#1#2#3#4#5{\subsecentry2106,69477
+\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69547
+\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69621
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69655
+\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69706
+\def\dochapentry#1#2{\dochapentry2123,70080
+\def\dosecentry#1#2{\dosecentry2138,70685
+\def\dosubsecentry#1#2{\dosubsecentry2145,70863
+\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71048
+\def\labelspace{\labelspace2160,71299
+\def\dopageno#1{\dopageno2162,71334
+\def\doshortpageno#1{\doshortpageno2163,71360
+\def\chapentryfonts{\chapentryfonts2165,71392
+\def\secentryfonts{\secentryfonts2166,71427
+\def\point{\point2192,72386
+\def\result{\result2194,72407
+\def\expansion{\expansion2195,72480
+\def\print{\print2196,72551
+\def\equiv{\equiv2198,72618
+\def\error{\error2218,73391
+\def\tex{\tex2224,73620
+\def\@{\@2242,74003
+\gdef\sepspaces{\def {\ }}}\2265,74735
+\def\aboveenvbreak{\aboveenvbreak2268,74817
+\def\afterenvbreak{\afterenvbreak2272,74983
+\def\ctl{\ctl2286,75494
+\def\ctr{\ctr2287,75566
+\def\cbl{\cbl2288,75605
+\def\cbr{\cbr2289,75645
+\def\carttop{\carttop2290,75684
+\def\cartbot{\cartbot2293,75792
+\long\def\cartouche{\cartouche2299,75932
+\def\Ecartouche{\Ecartouche2326,76720
+\def\lisp{\lisp2338,76855
+\def\Elisp{\Elisp2348,77202
+\def\next##1{\next2360,77528
+\def\Eexample{\Eexample2364,77570
+\def\Esmallexample{\Esmallexample2367,77617
+\def\smalllispx{\smalllispx2373,77795
+\def\Esmalllisp{\Esmalllisp2383,78149
+\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78505
+\def\next##1{\next2397,78562
+\def\display{\display2401,78642
+\def\Edisplay{\Edisplay2410,78961
+\def\next##1{\next2422,79272
+\def\format{\format2426,79375
+\def\Eformat{\Eformat2434,79671
+\def\next##1{\next2437,79760
+\def\flushleft{\flushleft2441,79812
+\def\Eflushleft{\Eflushleft2451,80183
+\def\next##1{\next2454,80276
+\def\flushright{\flushright2456,80298
+\def\Eflushright{\Eflushright2466,80670
+\def\next##1{\next2470,80801
+\def\quotation{\quotation2474,80859
+\def\Equotation{\Equotation2480,81051
+\def\setdeffont #1 {\setdeffont2493,81449
+\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81495
+\newskip\defargsindent \defargsindent=50ptargsindent2496,81538
+\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81581
+\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81624
+\def\activeparens{\activeparens2503,81822
+\def\opnr{\opnr2529,83034
+\def\lbrb{\lbrb2530,83099
+\def\defname #1#2{\defname2536,83300
+\advance\dimen2 by -\defbodyindentbodyindent2540,83418
+\advance\dimen3 by -\defbodyindentbodyindent2542,83472
+\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83526
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83668
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83743
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84112
+\advance\leftskip by -\defbodyindentbodyindent2557,84246
+\exdentamount=\defbodyindentbodyindent2558,84283
+\def\defparsebody #1#2#3{\defparsebody2568,84642
+\def#1{2572,84826
+\def#2{2573,84862
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84934
+\exdentamount=\defbodyindentbodyindent2576,85008
+\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85112
+\def#1{2585,85273
+\def#2##1 {2586,85309
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85392
+\exdentamount=\defbodyindentbodyindent2589,85466
+\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85551
+\def#1{2596,85712
+\def#2##1 ##2 {2597,85748
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85848
+\exdentamount=\defbodyindentbodyindent2601,85922
+\def\defvarparsebody #1#2#3{\defvarparsebody2608,86193
+\def#1{2612,86380
+\def#2{2613,86416
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86475
+\exdentamount=\defbodyindentbodyindent2616,86549
+\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86640
+\def#1{2625,86799
+\def#2##1 {2626,86835
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86905
+\exdentamount=\defbodyindentbodyindent2629,86979
+\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87051
+\def#1{2636,87215
+\def#2##1 ##2 {2637,87251
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87338
+\exdentamount=\defbodyindentbodyindent2641,87412
+\def\defunargs #1{\defunargs2664,88172
+\def\deftypefunargs #1{\deftypefunargs2676,88554
+\def\deffn{\deffn2690,88936
+\def\deffnheader #1#2#3{\deffnheader2692,88993
+\begingroup\defname {name2693,89041
+\def\defun{\defun2699,89186
+\def\defunheader #1#2{\defunheader2701,89239
+\begingroup\defname {name2702,89314
+\defunargs {unargs2703,89350
+\def\deftypefun{\deftypefun2709,89498
+\def\deftypefunheader #1#2{\deftypefunheader2712,89620
+\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89729
+\begingroup\defname {name2716,89821
+\deftypefunargs {typefunargs2717,89867
+\def\deftypefn{\deftypefn2723,90038
+\def\deftypefnheader #1#2#3{\deftypefnheader2726,90187
+\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90323
+\begingroup\defname {name2730,90416
+\deftypefunargs {typefunargs2731,90456
+\def\defmac{\defmac2737,90577
+\def\defmacheader #1#2{\defmacheader2739,90634
+\begingroup\defname {name2740,90710
+\defunargs {unargs2741,90743
+\def\defspec{\defspec2747,90867
+\def\defspecheader #1#2{\defspecheader2749,90928
+\begingroup\defname {name2750,91005
+\defunargs {unargs2751,91045
+\def\deffnx #1 {\deffnx2758,91240
+\def\defunx #1 {\defunx2759,91297
+\def\defmacx #1 {\defmacx2760,91354
+\def\defspecx #1 {\defspecx2761,91413
+\def\deftypefnx #1 {\deftypefnx2762,91474
+\def\deftypeunx #1 {\deftypeunx2763,91539
+\def\defop #1 {\defop2769,91685
+\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91720
+\def\defopheader #1#2#3{\defopheader2772,91774
+\begingroup\defname {name2774,91863
+\defunargs {unargs2775,91909
+\def\defmethod{\defmethod2780,91970
+\def\defmethodheader #1#2#3{\defmethodheader2782,92043
+\begingroup\defname {name2784,92131
+\defunargs {unargs2785,92171
+\def\defcv #1 {\defcv2790,92245
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92280
+\def\defcvarheader #1#2#3{\defcvarheader2793,92339
+\begingroup\defname {name2795,92425
+\defvarargs {varargs2796,92471
+\def\defivar{\defivar2801,92544
+\def\defivarheader #1#2#3{\defivarheader2803,92607
+\begingroup\defname {name2805,92693
+\defvarargs {varargs2806,92744
+\def\defopx #1 {\defopx2812,92893
+\def\defmethodx #1 {\defmethodx2813,92950
+\def\defcvx #1 {\defcvx2814,93015
+\def\defivarx #1 {\defivarx2815,93072
+\def\defvarargs #1{\defvarargs2822,93343
+\def\defvr{\defvr2828,93487
+\def\defvrheader #1#2#3{\defvrheader2830,93542
+\begingroup\defname {name2831,93590
+\def\defvar{\defvar2835,93675
+\def\defvarheader #1#2{\defvarheader2837,93735
+\begingroup\defname {name2838,93806
+\defvarargs {varargs2839,93842
+\def\defopt{\defopt2844,93908
+\def\defoptheader #1#2{\defoptheader2846,93968
+\begingroup\defname {name2847,94039
+\defvarargs {varargs2848,94078
+\def\deftypevar{\deftypevar2853,94135
+\def\deftypevarheader #1#2{\deftypevarheader2856,94251
+\begingroup\defname {name2858,94334
+\def\deftypevr{\deftypevr2865,94508
+\def\deftypevrheader #1#2#3{\deftypevrheader2867,94579
+\begingroup\defname {name2868,94631
+\def\defvrx #1 {\defvrx2876,94868
+\def\defvarx #1 {\defvarx2877,94925
+\def\defoptx #1 {\defoptx2878,94984
+\def\deftypevarx #1 {\deftypevarx2879,95043
+\def\deftypevrx #1 {\deftypevrx2880,95110
+\def\deftpargs #1{\deftpargs2885,95259
+\def\deftp{\deftp2889,95339
+\def\deftpheader #1#2#3{\deftpheader2891,95394
+\begingroup\defname {name2892,95442
+\def\deftpx #1 {\deftpx2897,95601
+\def\setref#1{\setref2908,95922
+\def\unnumbsetref#1{\unnumbsetref2913,96036
+\def\appendixsetref#1{\appendixsetref2918,96143
+\def\pxref#1{\pxref2929,96554
+\def\xref#1{\xref2930,96590
+\def\ref#1{\ref2931,96625
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96655
+\def\printedmanual{\printedmanual2933,96698
+\def\printednodename{\printednodename2934,96736
+\def\printednodename{\printednodename2939,96861
+section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97493
+\refx{x2957,97571
+\def\dosetq #1#2{\dosetq2965,97791
+\def\internalsetq #1#2{\internalsetq2973,98049
+\def\Ypagenumber{\Ypagenumber2977,98150
+\def\Ytitle{\Ytitle2979,98176
+\def\Ynothing{\Ynothing2981,98203
+\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98220
+\def\Yappendixletterandtype{\Yappendixletterandtype2992,98536
+\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98566
+\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98621
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98725
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98796
+ \def\linenumber{\linenumber3009,99135
+\def\refx#1#2{\refx3015,99319
+\def\xrdef #1#2{\xrdef3037,99945
+\def\readauxfile{\readauxfile3040,100030
+\def\supereject{\supereject3110,101811
+\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102496
+\def\openindices{\openindices3139,102682
+\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102907
+\parindent = \defaultparindentaultparindent3152,102959
+\def\smallbook{\smallbook3175,103683
+\global\def\Esmallexample{\Esmallexample3192,104110
+\def\afourpaper{\afourpaper3196,104201
+\def\finalout{\finalout3224,105009
+\def\normaldoublequote{\normaldoublequote3235,105270
+\def\normaltilde{\normaltilde3236,105296
+\def\normalcaret{\normalcaret3237,105316
+\def\normalunderscore{\normalunderscore3238,105336
+\def\normalverticalbar{\normalverticalbar3239,105361
+\def\normalless{\normalless3240,105387
+\def\normalgreater{\normalgreater3241,105406
+\def\normalplus{\normalplus3242,105428
+\def\ifusingtt#1#2{\ifusingtt3253,105920
+\def\activedoublequote{\activedoublequote3261,106248
+\def~{~3264,106334
+\def^{^3267,106395
+\def_{_3270,106434
+\def\_{\_3272,106508
+\def\lvvmode{\lvvmode3279,106845
+\def|{|3282,106895
+\def<{<3285,106958
+\def>{>3288,107015
+\def+{+3290,107053
+\def\turnoffactive{\turnoffactive3296,107214
+\global\def={=3307,107500
+\def\normalbackslash{\normalbackslash3321,107882
+
+merc-src/accumulator.m,3228
+:- interface146,5371
+:- import_module hlds148,5386
+:- import_module univ152,5478
+:- pred accu_transform_proc159,5793
+:- implementation166,6115
+:- import_module libs180,6552
+:- import_module mdbcomp184,6681
+:- import_module parse_tree186,6742
+:- import_module assoc_list194,7013
+:- import_module bool195,7042
+:- import_module int196,7065
+:- import_module io197,7087
+:- import_module list198,7108
+:- import_module map199,7131
+:- import_module maybe200,7153
+:- import_module pair201,7177
+:- import_module require202,7200
+:- import_module set203,7226
+:- import_module solutions204,7248
+:- import_module string205,7276
+:- import_module term206,7301
+:- import_module varset207,7324
+:- type top_level213,7499
+:- type accu_goal_id225,7900
+:- type accu_case228,7964
+:- type accu_goal_store234,8091
+:- type accu_subst238,8216
+:- type accu_warning240,8264
+:- pred generate_warnings334,12550
+:- pred generate_warning342,12895
+:- pred should_attempt_accu_transform365,13886
+:- pred should_attempt_accu_transform_2398,15406
+:- pred accu_standardize440,17390
+:- pred identify_goal_type465,18169
+:- pred is_recursive_case549,21175
+:- type store_info560,21713
+:- func initialize_goal_store570,22060
+:- pred accu_store580,22421
+:- pred identify_recursive_calls601,23288
+:- pred identify_out_and_out_prime626,24396
+:- type accu_sets676,26425
+:- pred accu_stage1689,26977
+:- pred accu_stage1_2727,28347
+:- pred accu_sets_init781,30557
+:- func set_upto796,30984
+:- pred accu_before812,31498
+:- pred accu_assoc835,32477
+:- pred accu_construct862,33712
+:- pred accu_construct_assoc896,35307
+:- pred accu_update938,37069
+:- pred member_lessthan_goalid964,38219
+:- type accu_assoc975,38652
+:- pred accu_is_associative986,39138
+:- pred associativity_assertion1014,40263
+:- pred commutativity_assertion1037,41242
+:- pred accu_is_update1057,41952
+:- pred is_associative_construction1078,42802
+:- type accu_substs1095,43480
+:- type accu_base1103,43744
+:- pred accu_stage21124,44605
+:- pred accu_substs_init1179,46957
+:- pred acc_var_subst_init1194,47573
+:- pred create_new_var1207,48147
+:- pred accu_process_assoc_set1223,48862
+:- pred accu_has_heuristic1297,52081
+:- pred accu_heuristic1304,52336
+:- pred accu_process_update_set1318,52906
+:- pred accu_divide_base_case1380,55844
+:- pred accu_related1412,57146
+:- inst stored_goal_plain_call1444,58415
+:- pred lookup_call1449,58601
+:- pred accu_stage31470,59432
+:- pred acc_proc_info1508,61326
+:- pred acc_pred_info1556,63449
+:- pred accu_create_goal1600,65285
+:- func create_acc_call1621,66400
+:- pred create_orig_goal1634,66987
+:- pred create_acc_goal1662,68157
+:- func create_new_orig_recursive_goals1709,70225
+:- func create_new_recursive_goals1723,70918
+:- func create_new_base_goals1738,71717
+:- pred acc_unification1749,72156
+:- pred accu_top_level1766,72896
+:- pred update_accumulator_pred1856,76290
+:- func accu_rename1876,77253
+:- func base_case_ids1889,77784
+:- func base_case_ids_set1898,78048
+:- func accu_goal_list1905,78269
+:- pred calculate_goal_info1916,78680
+:- func chain_subst1932,79319
+:- pred chain_subst_21938,79482
+:- some [T] pred unravel_univ1956,80060
+:- pragma foreign_export1957,80116
c-src/c.c,76
T f(1,0
@@ -4406,13 +4504,13 @@ yyerror FUN1(286,5948
make_list FUN2(293,6028
#define ERROR 304,6228
yylex FUN0(315,6405
-parse_cell_or_range FUN2(587,11771
-#define CK_ABS_R(671,13213
-#define CK_REL_R(675,13292
-#define CK_ABS_C(680,13421
-#define CK_REL_C(684,13500
-#define MAYBEREL(689,13629
-str_to_col FUN1(847,16830
+parse_cell_or_range FUN2(587,11772
+#define CK_ABS_R(671,13214
+#define CK_REL_R(675,13293
+#define CK_ABS_C(680,13422
+#define CK_REL_C(684,13501
+#define MAYBEREL(689,13630
+str_to_col FUN1(847,16831
y-src/parse.c,520
#define YYBISON 4,64
diff --git a/test/manual/etags/ETAGS.good_4 b/test/manual/etags/ETAGS.good_4
index 15f67c5d28a..e726a993a91 100644
--- a/test/manual/etags/ETAGS.good_4
+++ b/test/manual/etags/ETAGS.good_4
@@ -175,7 +175,7 @@ package body Truc.Bidule Truc.Bidule/b138,2153
protected body Bidule Bidule/b139,2181
protected body Machin_T Machin_T/b146,2281
-c-src/abbrev.c,3274
+c-src/abbrev.c,3055
Lisp_Object Vabbrev_table_name_list;43,1429
Lisp_Object Vglobal_abbrev_table;48,1574
Lisp_Object Vfundamental_mode_abbrev_table;52,1685
@@ -186,57 +186,53 @@ Lisp_Object Vabbrev_start_location_buffer;66,2046
Lisp_Object Vlast_abbrev;70,2155
Lisp_Object Vlast_abbrev_text;75,2324
int last_abbrev_point;79,2414
-Lisp_Object Vpre_abbrev_expand_hook,83,2487
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;83,2487
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,85,2551
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table85,2551
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,92,2743
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table92,2743
-DEFUN ("define-abbrev", Fdefine_abbrev,107,3124
-DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev107,3124
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,149,4443
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev149,4443
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,160,4814
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev160,4814
-DEFUN ("abbrev-symbol", Fabbrev_symbol,174,5282
-DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol174,5282
-DEFUN ("abbrev-expansion", Fabbrev_expansion,202,6246
-DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion202,6246
-DEFUN ("expand-abbrev", Fexpand_abbrev,218,6761
-DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev218,6761
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,389,11682
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev389,11682
-write_abbrev 426,12889
-describe_abbrev 445,13324
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,466,13839
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description466,13839
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,506,14995
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table506,14995
-syms_of_abbrev 540,16072
- DEFVAR_LISP ("abbrev-table-name-list"542,16092
- DEFVAR_LISP ("global-abbrev-table"548,16354
- DEFVAR_LISP ("fundamental-mode-abbrev-table"555,16676
- DEFVAR_LISP ("last-abbrev"561,17018
- DEFVAR_LISP ("last-abbrev-text"564,17141
- DEFVAR_INT ("last-abbrev-location"568,17299
- DEFVAR_LISP ("abbrev-start-location"575,17498
- DEFVAR_LISP ("abbrev-start-location-buffer"581,17775
- DEFVAR_PER_BUFFER ("local-abbrev-table"586,18039
- DEFVAR_BOOL ("abbrevs-changed"589,18182
- DEFVAR_BOOL ("abbrev-all-caps"594,18385
- DEFVAR_LISP ("pre-abbrev-expand-hook"598,18541
- DEFVAR_LISP ("abbrev-table-name-list",\1542,16092
- DEFVAR_LISP ("global-abbrev-table",\1548,16354
- DEFVAR_LISP ("fundamental-mode-abbrev-table",\1555,16676
- DEFVAR_LISP ("last-abbrev",\1561,17018
- DEFVAR_LISP ("last-abbrev-text",\1564,17141
- DEFVAR_INT ("last-abbrev-location",\1568,17299
- DEFVAR_LISP ("abbrev-start-location",\1575,17498
- DEFVAR_LISP ("abbrev-start-location-buffer",\1581,17775
- DEFVAR_PER_BUFFER ("local-abbrev-table",\1586,18039
- DEFVAR_BOOL ("abbrevs-changed",\1589,18182
- DEFVAR_BOOL ("abbrev-all-caps",\1594,18385
- DEFVAR_LISP ("pre-abbrev-expand-hook",\1598,18541
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,82,2440
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table82,2440
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,89,2632
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table89,2632
+DEFUN ("define-abbrev", Fdefine_abbrev,104,3013
+DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev104,3013
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,146,4332
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev146,4332
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,157,4703
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev157,4703
+DEFUN ("abbrev-symbol", Fabbrev_symbol,171,5171
+DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol171,5171
+DEFUN ("abbrev-expansion", Fabbrev_expansion,199,6135
+DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion199,6135
+DEFUN ("expand-abbrev", Fexpand_abbrev,215,6650
+DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev215,6650
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,383,11495
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev383,11495
+write_abbrev 420,12702
+describe_abbrev 439,13137
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,460,13652
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description460,13652
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,500,14808
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table500,14808
+syms_of_abbrev 534,15885
+ DEFVAR_LISP ("abbrev-table-name-list"536,15905
+ DEFVAR_LISP ("global-abbrev-table"542,16167
+ DEFVAR_LISP ("fundamental-mode-abbrev-table"549,16489
+ DEFVAR_LISP ("last-abbrev"555,16831
+ DEFVAR_LISP ("last-abbrev-text"558,16954
+ DEFVAR_INT ("last-abbrev-location"562,17112
+ DEFVAR_LISP ("abbrev-start-location"569,17311
+ DEFVAR_LISP ("abbrev-start-location-buffer"575,17588
+ DEFVAR_PER_BUFFER ("local-abbrev-table"580,17852
+ DEFVAR_BOOL ("abbrevs-changed"583,17995
+ DEFVAR_BOOL ("abbrev-all-caps"588,18198
+ DEFVAR_LISP ("abbrev-table-name-list",\1536,15905
+ DEFVAR_LISP ("global-abbrev-table",\1542,16167
+ DEFVAR_LISP ("fundamental-mode-abbrev-table",\1549,16489
+ DEFVAR_LISP ("last-abbrev",\1555,16831
+ DEFVAR_LISP ("last-abbrev-text",\1558,16954
+ DEFVAR_INT ("last-abbrev-location",\1562,17112
+ DEFVAR_LISP ("abbrev-start-location",\1569,17311
+ DEFVAR_LISP ("abbrev-start-location-buffer",\1575,17588
+ DEFVAR_PER_BUFFER ("local-abbrev-table",\1580,17852
+ DEFVAR_BOOL ("abbrevs-changed",\1583,17995
+ DEFVAR_BOOL ("abbrev-all-caps",\1588,18198
c-src/torture.c,197
(*tag1 tag118,452
@@ -1063,295 +1059,295 @@ make_lispy_position 5228,157391
toolkit_menubar_in_use 5456,163954
make_scroll_bar_position 5469,164322
make_lispy_event 5485,164968
-make_lispy_movement 6104,183532
-make_lispy_switch_frame 6131,184263
-make_lispy_focus_in 6137,184370
-make_lispy_focus_out 6145,184496
-parse_modifiers_uncached 6163,184946
-#define SINGLE_LETTER_MOD(6185,185466
-#undef SINGLE_LETTER_MOD6212,185907
-#define MULTI_LETTER_MOD(6214,185933
-#undef MULTI_LETTER_MOD6231,186401
-apply_modifiers_uncached 6273,187575
-static const char *const modifier_names[modifier_names6319,189194
-#define NUM_MOD_NAMES 6325,189400
-static Lisp_Object modifier_symbols;6327,189450
-lispy_modifier_list 6331,189587
-#define KEY_TO_CHAR(6353,190253
-parse_modifiers 6356,190329
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191518
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191518
-apply_modifiers 6422,192392
-reorder_modifiers 6491,194721
-modify_event_symbol 6536,196529
-DEFUN ("event-convert-list", Fevent_convert_list,6628,199245
-DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199245
-parse_solitary_modifier 6695,201136
-#define SINGLE_LETTER_MOD(6701,201259
-#define MULTI_LETTER_MOD(6705,201344
-#undef SINGLE_LETTER_MOD6763,202642
-#undef MULTI_LETTER_MOD6764,202667
-lucid_event_type_list_p 6775,202890
-get_input_pending 6814,203961
-record_asynch_buffer_change 6834,204580
-gobble_input 6872,205703
-tty_read_avail_input 6967,208311
-handle_async_input 7149,214040
-process_pending_signals 7165,214360
-unblock_input_to 7177,214646
-unblock_input 7200,215278
-totally_unblock_input 7209,215446
-handle_input_available_signal 7217,215530
-deliver_input_available_signal 7226,215701
-struct user_signal_info7235,215866
-static struct user_signal_info *user_signals user_signals7250,216091
-add_user_signal 7253,216150
-handle_user_signal 7275,216599
-deliver_user_signal 7316,217559
-find_user_signal_name 7322,217660
-store_user_signal_events 7334,217842
-static Lisp_Object menu_bar_one_keymap_changed_items;7363,218417
-static Lisp_Object menu_bar_items_vector;7368,218631
-static int menu_bar_items_index;7369,218673
-static const char *separator_names[separator_names7372,218708
-menu_separator_name_p 7393,219149
-menu_bar_items 7426,219853
-Lisp_Object item_properties;7568,224604
-menu_bar_item 7571,224646
-menu_item_eval_property_1 7647,227176
-eval_dyn 7658,227466
-menu_item_eval_property 7666,227676
-parse_menu_item 7686,228342
-static Lisp_Object tool_bar_items_vector;7965,236337
-static Lisp_Object tool_bar_item_properties;7970,236511
-static int ntool_bar_items;7974,236607
-tool_bar_items 7990,237084
-process_tool_bar_item 8075,239893
-#define PROP(8112,240970
-set_prop 8114,241039
-parse_tool_bar_item 8167,242454
-#undef PROP8379,248845
-init_tool_bar_items 8387,248970
-append_tool_bar_item 8401,249262
-read_char_x_menu_prompt 8443,250772
-read_char_minibuf_menu_prompt 8503,252446
-#define PUSH_C_STR(8527,253015
-follow_key 8726,258554
-active_maps 8733,258696
-typedef struct keyremap8742,259022
-} keyremap;8754,259465
-access_keymap_keyremap 8764,259809
-keyremap_step 8811,261451
-test_undefined 8867,262935
-read_key_sequence 8916,264862
-read_key_sequence_vs 9826,295822
-DEFUN ("read-key-sequence", Fread_key_sequence,9885,297295
-DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297295
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299983
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299983
-detect_input_pending 9950,300489
-detect_input_pending_ignore_squeezables 9959,300655
-detect_input_pending_run_timers 9967,300871
-clear_input_pending 9985,301363
-requeued_events_pending_p 9997,301733
-DEFUN ("input-pending-p", Finput_pending_p,10002,301814
-DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301814
-DEFUN ("recent-keys", Frecent_keys,10024,302597
-DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302597
-DEFUN ("this-command-keys", Fthis_command_keys,10055,303518
-DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303518
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303959
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303959
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304381
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304381
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304956
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304956
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305496
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305496
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306511
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306511
-DEFUN ("recursion-depth", Frecursion_depth,10158,307070
-DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307070
-DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307407
-DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307407
-DEFUN ("discard-input", Fdiscard_input,10203,308448
-DEFUN ("discard-input", Fdiscard_input,discard-input10203,308448
-DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308950
-DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308950
-stuff_buffered_input 10285,311046
-set_waiting_for_input 10323,312017
-clear_waiting_for_input 10337,312391
-handle_interrupt_signal 10351,312755
-deliver_interrupt_signal 10378,313643
-static int volatile force_quit_count;10387,313933
-handle_interrupt 10401,314415
-quit_throw_to_read_char 10541,318712
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319289
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319289
-DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320517
-DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320517
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321433
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321433
-DEFUN ("set-quit-char", Fset_quit_char,10694,322707
-DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322707
-DEFUN ("set-input-mode", Fset_input_mode,10729,323571
-DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323571
-DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324460
-DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324460
-DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325838
-DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325838
-DEFUN ("posn-at-point", Fposn_at_point,10824,327061
-DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327061
-init_kboard 10861,328215
-allocate_kboard 10893,329285
-wipe_kboard 10909,329638
-delete_kboard 10917,329752
-init_keyboard 10942,330282
-struct event_head11021,332697
-static const struct event_head head_table[head_table11027,332748
-syms_of_keyboard 11045,333578
- DEFVAR_LISP ("internal--top-level-message"11058,333973
- DEFVAR_LISP ("last-command-event"11312,342174
- DEFVAR_LISP ("last-nonmenu-event"11315,342298
- DEFVAR_LISP ("last-input-event"11321,342637
- DEFVAR_LISP ("unread-command-events"11324,342731
- DEFVAR_LISP ("unread-post-input-method-events"11332,343191
- DEFVAR_LISP ("unread-input-method-events"11338,343530
- DEFVAR_LISP ("meta-prefix-char"11346,343899
- DEFVAR_KBOARD ("last-command"11351,344107
- DEFVAR_KBOARD ("real-last-command"11368,344788
- DEFVAR_KBOARD ("last-repeatable-command"11372,344974
- DEFVAR_LISP ("this-command"11378,345262
- DEFVAR_LISP ("real-this-command"11384,345499
- DEFVAR_LISP ("this-command-keys-shift-translated"11388,345681
- DEFVAR_LISP ("this-original-command"11396,346124
- DEFVAR_INT ("auto-save-interval"11403,346521
- DEFVAR_LISP ("auto-save-timeout"11408,346735
- DEFVAR_LISP ("echo-keystrokes"11415,347080
- DEFVAR_INT ("polling-period"11421,347351
- DEFVAR_LISP ("double-click-time"11428,347694
- DEFVAR_INT ("double-click-fuzz"11435,348030
- DEFVAR_INT ("num-input-keys"11446,348520
- DEFVAR_INT ("num-nonmacro-input-events"11452,348795
- DEFVAR_LISP ("last-event-frame"11457,349033
- DEFVAR_LISP ("tty-erase-char"11463,349312
- DEFVAR_LISP ("help-char"11466,349435
- DEFVAR_LISP ("help-event-list"11472,349718
- DEFVAR_LISP ("help-form"11477,349929
- DEFVAR_LISP ("prefix-help-command"11483,350177
- DEFVAR_LISP ("top-level"11489,350455
- DEFVAR_KBOARD ("keyboard-translate-table"11495,350676
- DEFVAR_BOOL ("cannot-suspend"11511,351489
- DEFVAR_BOOL ("menu-prompting"11516,351716
- DEFVAR_LISP ("menu-prompt-more-char"11526,352146
- DEFVAR_INT ("extra-keyboard-modifiers"11531,352392
- DEFVAR_LISP ("deactivate-mark"11545,353118
- DEFVAR_LISP ("pre-command-hook"11553,353487
- DEFVAR_LISP ("post-command-hook"11560,353842
- DEFVAR_LISP ("echo-area-clear-hook"11568,354205
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag"11574,354420
- DEFVAR_LISP ("menu-bar-final-items"11578,354623
- DEFVAR_LISP ("tool-bar-separator-image-expression"11583,354873
- DEFVAR_KBOARD ("overriding-terminal-local-map"11589,355231
- DEFVAR_LISP ("overriding-local-map"11598,355653
- DEFVAR_LISP ("overriding-local-map-menu-flag"11607,356104
- DEFVAR_LISP ("special-event-map"11613,356443
- DEFVAR_LISP ("track-mouse"11617,356631
- DEFVAR_KBOARD ("system-key-alist"11620,356758
- DEFVAR_KBOARD ("local-function-key-map"11629,357139
- DEFVAR_KBOARD ("input-decode-map"11658,358598
- DEFVAR_LISP ("function-key-map"11675,359386
- DEFVAR_LISP ("key-translation-map"11683,359802
- DEFVAR_LISP ("deferred-action-list"11689,360146
- DEFVAR_LISP ("deferred-action-function"11694,360394
- DEFVAR_LISP ("delayed-warnings-list"11700,360693
- DEFVAR_LISP ("timer-list"11708,361101
- DEFVAR_LISP ("timer-idle-list"11712,361253
- DEFVAR_LISP ("input-method-function"11716,361416
- DEFVAR_LISP ("input-method-previous-message"11737,362385
- DEFVAR_LISP ("show-help-function"11744,362746
- DEFVAR_LISP ("disable-point-adjustment"11749,362978
- DEFVAR_LISP ("global-disable-point-adjustment"11761,363528
- DEFVAR_LISP ("minibuffer-message-timeout"11770,363894
- DEFVAR_LISP ("throw-on-input"11775,364172
- DEFVAR_LISP ("command-error-function"11781,364423
- DEFVAR_LISP ("enable-disabled-menus-and-buttons"11790,364910
- DEFVAR_LISP ("select-active-regions"11798,365237
- DEFVAR_LISP ("saved-region-selection"11807,365629
- DEFVAR_LISP ("selection-inhibit-update-commands"11815,366014
- DEFVAR_LISP ("debug-on-event"11825,366555
-keys_of_keyboard 11841,367116
-mark_kboards 11916,370435
- DEFVAR_LISP ("internal--top-level-message",\111058,333973
- DEFVAR_LISP ("last-command-event",\111312,342174
- DEFVAR_LISP ("last-nonmenu-event",\111315,342298
- DEFVAR_LISP ("last-input-event",\111321,342637
- DEFVAR_LISP ("unread-command-events",\111324,342731
- DEFVAR_LISP ("unread-post-input-method-events",\111332,343191
- DEFVAR_LISP ("unread-input-method-events",\111338,343530
- DEFVAR_LISP ("meta-prefix-char",\111346,343899
- DEFVAR_KBOARD ("last-command",\111351,344107
- DEFVAR_KBOARD ("real-last-command",\111368,344788
- DEFVAR_KBOARD ("last-repeatable-command",\111372,344974
- DEFVAR_LISP ("this-command",\111378,345262
- DEFVAR_LISP ("real-this-command",\111384,345499
- DEFVAR_LISP ("this-command-keys-shift-translated",\111388,345681
- DEFVAR_LISP ("this-original-command",\111396,346124
- DEFVAR_INT ("auto-save-interval",\111403,346521
- DEFVAR_LISP ("auto-save-timeout",\111408,346735
- DEFVAR_LISP ("echo-keystrokes",\111415,347080
- DEFVAR_INT ("polling-period",\111421,347351
- DEFVAR_LISP ("double-click-time",\111428,347694
- DEFVAR_INT ("double-click-fuzz",\111435,348030
- DEFVAR_INT ("num-input-keys",\111446,348520
- DEFVAR_INT ("num-nonmacro-input-events",\111452,348795
- DEFVAR_LISP ("last-event-frame",\111457,349033
- DEFVAR_LISP ("tty-erase-char",\111463,349312
- DEFVAR_LISP ("help-char",\111466,349435
- DEFVAR_LISP ("help-event-list",\111472,349718
- DEFVAR_LISP ("help-form",\111477,349929
- DEFVAR_LISP ("prefix-help-command",\111483,350177
- DEFVAR_LISP ("top-level",\111489,350455
- DEFVAR_KBOARD ("keyboard-translate-table",\111495,350676
- DEFVAR_BOOL ("cannot-suspend",\111511,351489
- DEFVAR_BOOL ("menu-prompting",\111516,351716
- DEFVAR_LISP ("menu-prompt-more-char",\111526,352146
- DEFVAR_INT ("extra-keyboard-modifiers",\111531,352392
- DEFVAR_LISP ("deactivate-mark",\111545,353118
- DEFVAR_LISP ("pre-command-hook",\111553,353487
- DEFVAR_LISP ("post-command-hook",\111560,353842
- DEFVAR_LISP ("echo-area-clear-hook",\111568,354205
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag",\111574,354420
- DEFVAR_LISP ("menu-bar-final-items",\111578,354623
- DEFVAR_LISP ("tool-bar-separator-image-expression",\111583,354873
- DEFVAR_KBOARD ("overriding-terminal-local-map",\111589,355231
- DEFVAR_LISP ("overriding-local-map",\111598,355653
- DEFVAR_LISP ("overriding-local-map-menu-flag",\111607,356104
- DEFVAR_LISP ("special-event-map",\111613,356443
- DEFVAR_LISP ("track-mouse",\111617,356631
- DEFVAR_KBOARD ("system-key-alist",\111620,356758
- DEFVAR_KBOARD ("local-function-key-map",\111629,357139
- DEFVAR_KBOARD ("input-decode-map",\111658,358598
- DEFVAR_LISP ("function-key-map",\111675,359386
- DEFVAR_LISP ("key-translation-map",\111683,359802
- DEFVAR_LISP ("deferred-action-list",\111689,360146
- DEFVAR_LISP ("deferred-action-function",\111694,360394
- DEFVAR_LISP ("delayed-warnings-list",\111700,360693
- DEFVAR_LISP ("timer-list",\111708,361101
- DEFVAR_LISP ("timer-idle-list",\111712,361253
- DEFVAR_LISP ("input-method-function",\111716,361416
- DEFVAR_LISP ("input-method-previous-message",\111737,362385
- DEFVAR_LISP ("show-help-function",\111744,362746
- DEFVAR_LISP ("disable-point-adjustment",\111749,362978
- DEFVAR_LISP ("global-disable-point-adjustment",\111761,363528
- DEFVAR_LISP ("minibuffer-message-timeout",\111770,363894
- DEFVAR_LISP ("throw-on-input",\111775,364172
- DEFVAR_LISP ("command-error-function",\111781,364423
- DEFVAR_LISP ("enable-disabled-menus-and-buttons",\111790,364910
- DEFVAR_LISP ("select-active-regions",\111798,365237
- DEFVAR_LISP ("saved-region-selection",\111807,365629
- DEFVAR_LISP ("selection-inhibit-update-commands",\111815,366014
- DEFVAR_LISP ("debug-on-event",\111825,366555
+make_lispy_movement 6104,183531
+make_lispy_switch_frame 6131,184262
+make_lispy_focus_in 6137,184369
+make_lispy_focus_out 6145,184495
+parse_modifiers_uncached 6163,184945
+#define SINGLE_LETTER_MOD(6185,185465
+#undef SINGLE_LETTER_MOD6212,185906
+#define MULTI_LETTER_MOD(6214,185932
+#undef MULTI_LETTER_MOD6231,186400
+apply_modifiers_uncached 6273,187574
+static const char *const modifier_names[modifier_names6319,189193
+#define NUM_MOD_NAMES 6325,189399
+static Lisp_Object modifier_symbols;6327,189449
+lispy_modifier_list 6331,189586
+#define KEY_TO_CHAR(6353,190252
+parse_modifiers 6356,190328
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191517
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191517
+apply_modifiers 6422,192391
+reorder_modifiers 6491,194720
+modify_event_symbol 6536,196528
+DEFUN ("event-convert-list", Fevent_convert_list,6628,199244
+DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199244
+parse_solitary_modifier 6695,201135
+#define SINGLE_LETTER_MOD(6701,201258
+#define MULTI_LETTER_MOD(6705,201343
+#undef SINGLE_LETTER_MOD6763,202641
+#undef MULTI_LETTER_MOD6764,202666
+lucid_event_type_list_p 6775,202889
+get_input_pending 6814,203960
+record_asynch_buffer_change 6834,204579
+gobble_input 6872,205702
+tty_read_avail_input 6967,208310
+handle_async_input 7149,214039
+process_pending_signals 7165,214359
+unblock_input_to 7177,214645
+unblock_input 7200,215277
+totally_unblock_input 7209,215445
+handle_input_available_signal 7217,215529
+deliver_input_available_signal 7226,215700
+struct user_signal_info7235,215865
+static struct user_signal_info *user_signals user_signals7250,216090
+add_user_signal 7253,216149
+handle_user_signal 7275,216598
+deliver_user_signal 7316,217558
+find_user_signal_name 7322,217659
+store_user_signal_events 7334,217841
+static Lisp_Object menu_bar_one_keymap_changed_items;7363,218416
+static Lisp_Object menu_bar_items_vector;7368,218630
+static int menu_bar_items_index;7369,218672
+static const char *separator_names[separator_names7372,218707
+menu_separator_name_p 7393,219148
+menu_bar_items 7426,219852
+Lisp_Object item_properties;7568,224603
+menu_bar_item 7571,224645
+menu_item_eval_property_1 7647,227175
+eval_dyn 7658,227465
+menu_item_eval_property 7666,227675
+parse_menu_item 7686,228341
+static Lisp_Object tool_bar_items_vector;7965,236336
+static Lisp_Object tool_bar_item_properties;7970,236510
+static int ntool_bar_items;7974,236606
+tool_bar_items 7990,237083
+process_tool_bar_item 8075,239892
+#define PROP(8112,240969
+set_prop 8114,241038
+parse_tool_bar_item 8167,242453
+#undef PROP8379,248844
+init_tool_bar_items 8387,248969
+append_tool_bar_item 8401,249261
+read_char_x_menu_prompt 8443,250771
+read_char_minibuf_menu_prompt 8503,252445
+#define PUSH_C_STR(8527,253014
+follow_key 8726,258553
+active_maps 8733,258695
+typedef struct keyremap8742,259021
+} keyremap;8754,259464
+access_keymap_keyremap 8764,259808
+keyremap_step 8811,261450
+test_undefined 8867,262934
+read_key_sequence 8916,264861
+read_key_sequence_vs 9826,295821
+DEFUN ("read-key-sequence", Fread_key_sequence,9885,297294
+DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297294
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299982
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299982
+detect_input_pending 9950,300488
+detect_input_pending_ignore_squeezables 9959,300654
+detect_input_pending_run_timers 9967,300870
+clear_input_pending 9985,301362
+requeued_events_pending_p 9997,301732
+DEFUN ("input-pending-p", Finput_pending_p,10002,301813
+DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301813
+DEFUN ("recent-keys", Frecent_keys,10024,302596
+DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302596
+DEFUN ("this-command-keys", Fthis_command_keys,10055,303517
+DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303517
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303958
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303958
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304380
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304380
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304955
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304955
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305495
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305495
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306510
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306510
+DEFUN ("recursion-depth", Frecursion_depth,10158,307069
+DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307069
+DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307406
+DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307406
+DEFUN ("discard-input", Fdiscard_input,10203,308447
+DEFUN ("discard-input", Fdiscard_input,discard-input10203,308447
+DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308949
+DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308949
+stuff_buffered_input 10285,311045
+set_waiting_for_input 10323,312016
+clear_waiting_for_input 10337,312390
+handle_interrupt_signal 10351,312754
+deliver_interrupt_signal 10378,313642
+static int volatile force_quit_count;10387,313932
+handle_interrupt 10401,314414
+quit_throw_to_read_char 10541,318711
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319288
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319288
+DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320516
+DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320516
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321432
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321432
+DEFUN ("set-quit-char", Fset_quit_char,10694,322706
+DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322706
+DEFUN ("set-input-mode", Fset_input_mode,10729,323570
+DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323570
+DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324459
+DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324459
+DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325837
+DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325837
+DEFUN ("posn-at-point", Fposn_at_point,10824,327060
+DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327060
+init_kboard 10861,328214
+allocate_kboard 10893,329284
+wipe_kboard 10909,329637
+delete_kboard 10917,329751
+init_keyboard 10942,330281
+struct event_head11021,332696
+static const struct event_head head_table[head_table11027,332747
+syms_of_keyboard 11045,333577
+ DEFVAR_LISP ("internal--top-level-message"11058,333972
+ DEFVAR_LISP ("last-command-event"11312,342173
+ DEFVAR_LISP ("last-nonmenu-event"11315,342297
+ DEFVAR_LISP ("last-input-event"11321,342636
+ DEFVAR_LISP ("unread-command-events"11324,342730
+ DEFVAR_LISP ("unread-post-input-method-events"11332,343190
+ DEFVAR_LISP ("unread-input-method-events"11338,343529
+ DEFVAR_LISP ("meta-prefix-char"11346,343898
+ DEFVAR_KBOARD ("last-command"11351,344106
+ DEFVAR_KBOARD ("real-last-command"11368,344787
+ DEFVAR_KBOARD ("last-repeatable-command"11372,344973
+ DEFVAR_LISP ("this-command"11378,345261
+ DEFVAR_LISP ("real-this-command"11384,345498
+ DEFVAR_LISP ("this-command-keys-shift-translated"11388,345680
+ DEFVAR_LISP ("this-original-command"11396,346123
+ DEFVAR_INT ("auto-save-interval"11403,346520
+ DEFVAR_LISP ("auto-save-timeout"11408,346734
+ DEFVAR_LISP ("echo-keystrokes"11415,347079
+ DEFVAR_INT ("polling-period"11421,347350
+ DEFVAR_LISP ("double-click-time"11428,347693
+ DEFVAR_INT ("double-click-fuzz"11435,348029
+ DEFVAR_INT ("num-input-keys"11446,348519
+ DEFVAR_INT ("num-nonmacro-input-events"11452,348794
+ DEFVAR_LISP ("last-event-frame"11457,349032
+ DEFVAR_LISP ("tty-erase-char"11463,349311
+ DEFVAR_LISP ("help-char"11466,349434
+ DEFVAR_LISP ("help-event-list"11472,349717
+ DEFVAR_LISP ("help-form"11477,349928
+ DEFVAR_LISP ("prefix-help-command"11483,350176
+ DEFVAR_LISP ("top-level"11489,350454
+ DEFVAR_KBOARD ("keyboard-translate-table"11495,350675
+ DEFVAR_BOOL ("cannot-suspend"11511,351488
+ DEFVAR_BOOL ("menu-prompting"11516,351715
+ DEFVAR_LISP ("menu-prompt-more-char"11526,352145
+ DEFVAR_INT ("extra-keyboard-modifiers"11531,352391
+ DEFVAR_LISP ("deactivate-mark"11545,353117
+ DEFVAR_LISP ("pre-command-hook"11553,353486
+ DEFVAR_LISP ("post-command-hook"11560,353841
+ DEFVAR_LISP ("echo-area-clear-hook"11568,354204
+ DEFVAR_LISP ("lucid-menu-bar-dirty-flag"11574,354419
+ DEFVAR_LISP ("menu-bar-final-items"11578,354622
+ DEFVAR_LISP ("tool-bar-separator-image-expression"11583,354872
+ DEFVAR_KBOARD ("overriding-terminal-local-map"11589,355230
+ DEFVAR_LISP ("overriding-local-map"11598,355652
+ DEFVAR_LISP ("overriding-local-map-menu-flag"11607,356103
+ DEFVAR_LISP ("special-event-map"11613,356442
+ DEFVAR_LISP ("track-mouse"11617,356630
+ DEFVAR_KBOARD ("system-key-alist"11620,356757
+ DEFVAR_KBOARD ("local-function-key-map"11629,357138
+ DEFVAR_KBOARD ("input-decode-map"11658,358597
+ DEFVAR_LISP ("function-key-map"11675,359385
+ DEFVAR_LISP ("key-translation-map"11683,359801
+ DEFVAR_LISP ("deferred-action-list"11689,360145
+ DEFVAR_LISP ("deferred-action-function"11694,360393
+ DEFVAR_LISP ("delayed-warnings-list"11700,360692
+ DEFVAR_LISP ("timer-list"11708,361100
+ DEFVAR_LISP ("timer-idle-list"11712,361252
+ DEFVAR_LISP ("input-method-function"11716,361415
+ DEFVAR_LISP ("input-method-previous-message"11737,362384
+ DEFVAR_LISP ("show-help-function"11744,362745
+ DEFVAR_LISP ("disable-point-adjustment"11749,362977
+ DEFVAR_LISP ("global-disable-point-adjustment"11761,363527
+ DEFVAR_LISP ("minibuffer-message-timeout"11770,363893
+ DEFVAR_LISP ("throw-on-input"11775,364171
+ DEFVAR_LISP ("command-error-function"11781,364422
+ DEFVAR_LISP ("enable-disabled-menus-and-buttons"11790,364909
+ DEFVAR_LISP ("select-active-regions"11798,365236
+ DEFVAR_LISP ("saved-region-selection"11807,365628
+ DEFVAR_LISP ("selection-inhibit-update-commands"11815,366013
+ DEFVAR_LISP ("debug-on-event"11825,366554
+keys_of_keyboard 11841,367115
+mark_kboards 11916,370434
+ DEFVAR_LISP ("internal--top-level-message",\111058,333972
+ DEFVAR_LISP ("last-command-event",\111312,342173
+ DEFVAR_LISP ("last-nonmenu-event",\111315,342297
+ DEFVAR_LISP ("last-input-event",\111321,342636
+ DEFVAR_LISP ("unread-command-events",\111324,342730
+ DEFVAR_LISP ("unread-post-input-method-events",\111332,343190
+ DEFVAR_LISP ("unread-input-method-events",\111338,343529
+ DEFVAR_LISP ("meta-prefix-char",\111346,343898
+ DEFVAR_KBOARD ("last-command",\111351,344106
+ DEFVAR_KBOARD ("real-last-command",\111368,344787
+ DEFVAR_KBOARD ("last-repeatable-command",\111372,344973
+ DEFVAR_LISP ("this-command",\111378,345261
+ DEFVAR_LISP ("real-this-command",\111384,345498
+ DEFVAR_LISP ("this-command-keys-shift-translated",\111388,345680
+ DEFVAR_LISP ("this-original-command",\111396,346123
+ DEFVAR_INT ("auto-save-interval",\111403,346520
+ DEFVAR_LISP ("auto-save-timeout",\111408,346734
+ DEFVAR_LISP ("echo-keystrokes",\111415,347079
+ DEFVAR_INT ("polling-period",\111421,347350
+ DEFVAR_LISP ("double-click-time",\111428,347693
+ DEFVAR_INT ("double-click-fuzz",\111435,348029
+ DEFVAR_INT ("num-input-keys",\111446,348519
+ DEFVAR_INT ("num-nonmacro-input-events",\111452,348794
+ DEFVAR_LISP ("last-event-frame",\111457,349032
+ DEFVAR_LISP ("tty-erase-char",\111463,349311
+ DEFVAR_LISP ("help-char",\111466,349434
+ DEFVAR_LISP ("help-event-list",\111472,349717
+ DEFVAR_LISP ("help-form",\111477,349928
+ DEFVAR_LISP ("prefix-help-command",\111483,350176
+ DEFVAR_LISP ("top-level",\111489,350454
+ DEFVAR_KBOARD ("keyboard-translate-table",\111495,350675
+ DEFVAR_BOOL ("cannot-suspend",\111511,351488
+ DEFVAR_BOOL ("menu-prompting",\111516,351715
+ DEFVAR_LISP ("menu-prompt-more-char",\111526,352145
+ DEFVAR_INT ("extra-keyboard-modifiers",\111531,352391
+ DEFVAR_LISP ("deactivate-mark",\111545,353117
+ DEFVAR_LISP ("pre-command-hook",\111553,353486
+ DEFVAR_LISP ("post-command-hook",\111560,353841
+ DEFVAR_LISP ("echo-area-clear-hook",\111568,354204
+ DEFVAR_LISP ("lucid-menu-bar-dirty-flag",\111574,354419
+ DEFVAR_LISP ("menu-bar-final-items",\111578,354622
+ DEFVAR_LISP ("tool-bar-separator-image-expression",\111583,354872
+ DEFVAR_KBOARD ("overriding-terminal-local-map",\111589,355230
+ DEFVAR_LISP ("overriding-local-map",\111598,355652
+ DEFVAR_LISP ("overriding-local-map-menu-flag",\111607,356103
+ DEFVAR_LISP ("special-event-map",\111613,356442
+ DEFVAR_LISP ("track-mouse",\111617,356630
+ DEFVAR_KBOARD ("system-key-alist",\111620,356757
+ DEFVAR_KBOARD ("local-function-key-map",\111629,357138
+ DEFVAR_KBOARD ("input-decode-map",\111658,358597
+ DEFVAR_LISP ("function-key-map",\111675,359385
+ DEFVAR_LISP ("key-translation-map",\111683,359801
+ DEFVAR_LISP ("deferred-action-list",\111689,360145
+ DEFVAR_LISP ("deferred-action-function",\111694,360393
+ DEFVAR_LISP ("delayed-warnings-list",\111700,360692
+ DEFVAR_LISP ("timer-list",\111708,361100
+ DEFVAR_LISP ("timer-idle-list",\111712,361252
+ DEFVAR_LISP ("input-method-function",\111716,361415
+ DEFVAR_LISP ("input-method-previous-message",\111737,362384
+ DEFVAR_LISP ("show-help-function",\111744,362745
+ DEFVAR_LISP ("disable-point-adjustment",\111749,362977
+ DEFVAR_LISP ("global-disable-point-adjustment",\111761,363527
+ DEFVAR_LISP ("minibuffer-message-timeout",\111770,363893
+ DEFVAR_LISP ("throw-on-input",\111775,364171
+ DEFVAR_LISP ("command-error-function",\111781,364422
+ DEFVAR_LISP ("enable-disabled-menus-and-buttons",\111790,364909
+ DEFVAR_LISP ("select-active-regions",\111798,365236
+ DEFVAR_LISP ("saved-region-selection",\111807,365628
+ DEFVAR_LISP ("selection-inhibit-update-commands",\111815,366013
+ DEFVAR_LISP ("debug-on-event",\111825,366554
c-src/emacs/src/lisp.h,20276
#define EMACS_LISP_H22,801
@@ -2307,11 +2303,11 @@ main(37,571
class D 41,622
D(43,659
-el-src/TAGTEST.EL,179
-(foo::defmumble bletch 1,0
-(defun foo==bar foo==bar2,33
-(defalias 'pending-delete-mode pending-delete-mode6,149
-(defalias (quote explicitly-quoted-pending-delete-mode)9,222
+el-src/TAGTEST.EL,181
+(foo::defmumble bletch 3,33
+(defun foo==bar foo==bar4,66
+(defalias 'pending-delete-mode pending-delete-mode8,182
+(defalias (quote explicitly-quoted-pending-delete-mode)11,255
el-src/emacs/lisp/progmodes/etags.el,5069
(defvar tags-file-name 34,1035
@@ -3070,22 +3066,22 @@ ord_add_element(71,1867
ord_del_element(85,2344
ord_disjoint(100,2783
ord_intersect(108,2953
-ord_intersection(126,3552
-ord_intersection3(130,3691
-ord_intersection(150,4531
-ord_intersection4(154,4703
-ord_intersection(176,5664
-ord_intersection2(181,5812
-ord_member(200,6318
-ord_seteq(216,6683
-ord_setproduct(225,6971
-ord_subset(240,7377
-ord_subtract(257,7861
-ord_symdiff(265,8054
-ord_union(288,8887
-ord_union4(303,9352
-ord_union(324,10171
-ord_union_all(329,10313
+ord_intersection(126,3553
+ord_intersection3(130,3692
+ord_intersection(150,4533
+ord_intersection4(154,4705
+ord_intersection(176,5666
+ord_intersection2(181,5814
+ord_member(200,6320
+ord_seteq(216,6685
+ord_setproduct(225,6973
+ord_subset(240,7379
+ord_subtract(257,7863
+ord_symdiff(265,8056
+ord_union(288,8889
+ord_union4(303,9354
+ord_union(324,10173
+ord_union_all(329,10315
prol-src/natded.prolog,2319
expandmng(100,2879
@@ -3300,6 +3296,11 @@ module A9,57
alias_method ( :foo2,foo237,586
A::Constant Constant42,655
+rs-src/test.rs,52
+enum IpAddrKind 3,11
+fn test1(8,48
+fn main(12,88
+
scm-src/test.scm,260
(define hello 1,0
(set! hello 3,32
@@ -3514,533 +3515,628 @@ tex-src/texinfo.tex,30627
\def\vritemindex #1{\vritemindex1068,35482
\def\tablez #1#2#3#4#5#6{\tablez1074,35631
\def\Edescription{\Edescription1077,35689
-\def\itemfont{\itemfont1082,35891
-\def\Etable{\Etable1090,36117
-\def\itemize{\itemize1103,36441
-\def\itemizezzz #1{\itemizezzz1105,36477
-\def\itemizey #1#2{\itemizey1110,36572
-\def#2{1119,36818
-\def\itemcontents{\itemcontents1120,36859
-\def\bullet{\bullet1123,36907
-\def\minus{\minus1124,36934
-\def\frenchspacing{\frenchspacing1128,37042
-\def\splitoff#1#2\endmark{\splitoff1134,37267
-\def\enumerate{\enumerate1140,37497
-\def\enumeratezzz #1{\enumeratezzz1141,37536
-\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37589
- \def\thearg{\thearg1146,37736
- \ifx\thearg\empty \def\thearg{\thearg1147,37755
-\def\numericenumerate{\numericenumerate1184,39089
-\def\lowercaseenumerate{\lowercaseenumerate1190,39219
-\def\uppercaseenumerate{\uppercaseenumerate1203,39566
-\def\startenumeration#1{\startenumeration1219,40056
-\def\alphaenumerate{\alphaenumerate1227,40238
-\def\capsenumerate{\capsenumerate1228,40273
-\def\Ealphaenumerate{\Ealphaenumerate1229,40307
-\def\Ecapsenumerate{\Ecapsenumerate1230,40341
-\def\itemizeitem{\itemizeitem1234,40421
-\def\newindex #1{\newindex1259,41278
-\def\defindex{\defindex1268,41567
-\def\newcodeindex #1{\newcodeindex1272,41675
-\def\defcodeindex{\defcodeindex1279,41935
-\def\synindex #1 #2 {\synindex1283,42115
-\def\syncodeindex #1 #2 {\syncodeindex1292,42455
-\def\doindex#1{\doindex1309,43134
-\def\singleindexer #1{\singleindexer1310,43193
-\def\docodeindex#1{\docodeindex1313,43305
-\def\singlecodeindexer #1{\singlecodeindexer1314,43372
-\def\indexdummies{\indexdummies1316,43430
-\def\_{\_1317,43450
-\def\w{\w1318,43478
-\def\bf{\bf1319,43505
-\def\rm{\rm1320,43534
-\def\sl{\sl1321,43563
-\def\sf{\sf1322,43592
-\def\tt{\tt1323,43620
-\def\gtr{\gtr1324,43648
-\def\less{\less1325,43678
-\def\hat{\hat1326,43710
-\def\char{\char1327,43740
-\def\TeX{\TeX1328,43772
-\def\dots{\dots1329,43802
-\def\copyright{\copyright1330,43835
-\def\tclose##1{\tclose1331,43878
-\def\code##1{\code1332,43923
-\def\samp##1{\samp1333,43964
-\def\t##1{\t1334,44005
-\def\r##1{\r1335,44040
-\def\i##1{\i1336,44075
-\def\b##1{\b1337,44110
-\def\cite##1{\cite1338,44145
-\def\key##1{\key1339,44186
-\def\file##1{\file1340,44225
-\def\var##1{\var1341,44266
-\def\kbd##1{\kbd1342,44305
-\def\indexdummyfont#1{\indexdummyfont1347,44461
-\def\indexdummytex{\indexdummytex1348,44487
-\def\indexdummydots{\indexdummydots1349,44511
-\def\indexnofonts{\indexnofonts1351,44537
-\let\w=\indexdummyfontdummyfont1352,44557
-\let\t=\indexdummyfontdummyfont1353,44580
-\let\r=\indexdummyfontdummyfont1354,44603
-\let\i=\indexdummyfontdummyfont1355,44626
-\let\b=\indexdummyfontdummyfont1356,44649
-\let\emph=\indexdummyfontdummyfont1357,44672
-\let\strong=\indexdummyfontdummyfont1358,44698
-\let\cite=\indexdummyfont=\indexdummyfont1359,44726
-\let\sc=\indexdummyfontdummyfont1360,44752
-\let\tclose=\indexdummyfontdummyfont1364,44924
-\let\code=\indexdummyfontdummyfont1365,44952
-\let\file=\indexdummyfontdummyfont1366,44978
-\let\samp=\indexdummyfontdummyfont1367,45004
-\let\kbd=\indexdummyfontdummyfont1368,45030
-\let\key=\indexdummyfontdummyfont1369,45055
-\let\var=\indexdummyfontdummyfont1370,45080
-\let\TeX=\indexdummytexdummytex1371,45105
-\let\dots=\indexdummydotsdummydots1372,45129
-\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45381
-\def\doind #1#2{\doind1384,45437
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45480
-\def\rawbackslashxx{\rawbackslashxx1389,45620
-{\indexnofontsnofonts1394,45882
-\def\dosubind #1#2#3{\dosubind1405,46193
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46241
-\def\rawbackslashxx{\rawbackslashxx1410,46345
-{\indexnofontsnofonts1414,46499
-\def\findex {\findex1443,47430
-\def\kindex {\kindex1444,47453
-\def\cindex {\cindex1445,47476
-\def\vindex {\vindex1446,47499
-\def\tindex {\tindex1447,47522
-\def\pindex {\pindex1448,47545
-\def\cindexsub {\cindexsub1450,47569
-\def\printindex{\printindex1462,47896
-\def\doprintindex#1{\doprintindex1464,47937
- \def\indexbackslash{\indexbackslash1481,48422
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48461
-\def\initial #1{\initial1517,49533
-\def\entry #1#2{\entry1523,49740
- \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50387
-\def\indexdotfill{\indexdotfill1549,50715
-\def\primary #1{\primary1552,50821
-\def\secondary #1#2{\secondary1556,50903
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50985
-\newbox\partialpageialpage1566,51158
-\def\begindoublecolumns{\begindoublecolumns1572,51316
- \output={\global\setbox\partialpage=ialpage=1573,51352
-\def\enddoublecolumns{\enddoublecolumns1577,51540
-\def\doublecolumnout{\doublecolumnout1580,51625
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51694
-\def\pagesofar{\pagesofar1584,51872
-\def\balancecolumns{\balancecolumns1588,52109
- \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52280
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52541
-\newcount \appendixno \appendixno = `\@no1627,53446
-\def\appendixletter{\appendixletter1628,53487
-\def\opencontents{\opencontents1632,53590
-\def\thischapter{\thischapter1637,53771
-\def\seccheck#1{\seccheck1638,53809
-\def\chapternofonts{\chapternofonts1643,53913
-\def\result{\result1646,53988
-\def\equiv{\equiv1647,54023
-\def\expansion{\expansion1648,54056
-\def\print{\print1649,54097
-\def\TeX{\TeX1650,54130
-\def\dots{\dots1651,54159
-\def\copyright{\copyright1652,54190
-\def\tt{\tt1653,54231
-\def\bf{\bf1654,54258
-\def\w{\w1655,54286
-\def\less{\less1656,54311
-\def\gtr{\gtr1657,54342
-\def\hat{\hat1658,54371
-\def\char{\char1659,54400
-\def\tclose##1{\tclose1660,54431
-\def\code##1{\code1661,54475
-\def\samp##1{\samp1662,54515
-\def\r##1{\r1663,54555
-\def\b##1{\b1664,54589
-\def\key##1{\key1665,54623
-\def\file##1{\file1666,54661
-\def\kbd##1{\kbd1667,54701
-\def\i##1{\i1669,54809
-\def\cite##1{\cite1670,54843
-\def\var##1{\var1671,54883
-\def\emph##1{\emph1672,54921
-\def\dfn##1{\dfn1673,54961
-\def\thischaptername{\thischaptername1676,55002
-\outer\def\chapter{\chapter1677,55041
-\def\chapterzzz #1{\chapterzzz1678,55082
-{\chapternofonts%nofonts%1687,55478
-\global\let\section = \numberedsec=1692,55631
-\global\let\subsection = \numberedsubsec=1693,55666
-\global\let\subsubsection = \numberedsubsubsec=1694,55707
-\outer\def\appendix{\appendix1697,55758
-\def\appendixzzz #1{\appendixzzz1698,55801
-\global\advance \appendixno by 1 \message{no1700,55878
-\chapmacro {#1}{Appendix \appendixletter}letter1701,55947
-\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56040
-{\chapternofonts%nofonts%1705,56112
- {#1}{Appendix \appendixletter}letter1707,56168
-\appendixnoderef %noderef1710,56268
-\global\let\section = \appendixsec=1711,56287
-\global\let\subsection = \appendixsubsec=1712,56322
-\global\let\subsubsection = \appendixsubsubsec=1713,56363
-\outer\def\top{\top1716,56414
-\outer\def\unnumbered{\unnumbered1717,56454
-\def\unnumberedzzz #1{\unnumberedzzz1718,56501
-{\chapternofonts%nofonts%1722,56664
-\global\let\section = \unnumberedsec=1727,56814
-\global\let\subsection = \unnumberedsubsec=1728,56851
-\global\let\subsubsection = \unnumberedsubsubsec=1729,56894
-\outer\def\numberedsec{\numberedsec1732,56947
-\def\seczzz #1{\seczzz1733,56988
-{\chapternofonts%nofonts%1736,57144
-\outer\def\appendixsection{\appendixsection1745,57330
-\outer\def\appendixsec{\appendixsec1746,57387
-\def\appendixsectionzzz #1{\appendixsectionzzz1747,57440
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57552
-{\chapternofonts%nofonts%1750,57620
-{#1}{\appendixletter}letter1752,57676
-\appendixnoderef %noderef1755,57776
-\outer\def\unnumberedsec{\unnumberedsec1759,57816
-\def\unnumberedseczzz #1{\unnumberedseczzz1760,57869
-{\chapternofonts%nofonts%1762,57964
-\outer\def\numberedsubsec{\numberedsubsec1770,58132
-\def\numberedsubseczzz #1{\numberedsubseczzz1771,58187
-{\chapternofonts%nofonts%1774,58366
-\outer\def\appendixsubsec{\appendixsubsec1783,58570
-\def\appendixsubseczzz #1{\appendixsubseczzz1784,58625
-\subsecheading {#1}{\appendixletter}letter1786,58747
-{\chapternofonts%nofonts%1787,58812
-{#1}{\appendixletter}letter1789,58871
-\appendixnoderef %noderef1792,58986
-\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59026
-\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59085
-{\chapternofonts%nofonts%1799,59186
-\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59357
-\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59418
-{\chapternofonts%nofonts%1812,59615
-\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59848
-\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59909
- {\appendixletter}letter1827,60048
-{\chapternofonts%nofonts%1828,60114
- {\appendixletter}letter1830,60179
-\appendixnoderef %noderef1834,60313
-\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60353
-\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60418
-{\chapternofonts%nofonts%1841,60525
-\def\infotop{\infotop1851,60854
-\def\infounnumbered{\infounnumbered1852,60892
-\def\infounnumberedsec{\infounnumberedsec1853,60937
-\def\infounnumberedsubsec{\infounnumberedsubsec1854,60988
-\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61045
-\def\infoappendix{\infoappendix1857,61109
-\def\infoappendixsec{\infoappendixsec1858,61150
-\def\infoappendixsubsec{\infoappendixsubsec1859,61197
-\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61250
-\def\infochapter{\infochapter1862,61310
-\def\infosection{\infosection1863,61349
-\def\infosubsection{\infosubsection1864,61388
-\def\infosubsubsection{\infosubsubsection1865,61433
-\global\let\section = \numberedsec=1870,61670
-\global\let\subsection = \numberedsubsec=1871,61705
-\global\let\subsubsection = \numberedsubsubsec=1872,61746
-\def\majorheading{\majorheading1886,62253
-\def\majorheadingzzz #1{\majorheadingzzz1887,62298
-\def\chapheading{\chapheading1893,62531
-\def\chapheadingzzz #1{\chapheadingzzz1894,62574
-\def\heading{\heading1899,62769
-\def\subheading{\subheading1901,62806
-\def\subsubheading{\subsubheading1903,62849
-\def\dobreak#1#2{\dobreak1910,63126
-\def\setchapterstyle #1 {\setchapterstyle1912,63204
-\def\chapbreak{\chapbreak1919,63459
-\def\chappager{\chappager1920,63509
-\def\chapoddpage{\chapoddpage1921,63547
-\def\setchapternewpage #1 {\setchapternewpage1923,63626
-\def\CHAPPAGoff{\CHAPPAGoff1925,63683
-\def\CHAPPAGon{\CHAPPAGon1929,63777
-\global\def\HEADINGSon{\HEADINGSon1932,63868
-\def\CHAPPAGodd{\CHAPPAGodd1934,63910
-\global\def\HEADINGSon{\HEADINGSon1937,64006
-\def\CHAPFplain{\CHAPFplain1941,64060
-\def\chfplain #1#2{\chfplain1945,64152
-\def\unnchfplain #1{\unnchfplain1956,64375
-\def\unnchfopen #1{\unnchfopen1964,64604
-\def\chfopen #1#2{\chfopen1970,64812
-\def\CHAPFopen{\CHAPFopen1975,64956
-\def\subsecheadingbreak{\subsecheadingbreak1982,65174
-\def\secheadingbreak{\secheadingbreak1985,65303
-\def\secheading #1#2#3{\secheading1993,65585
-\def\plainsecheading #1{\plainsecheading1994,65641
-\def\secheadingi #1{\secheadingi1995,65684
-\def\subsecheading #1#2#3#4{\subsecheading2006,66052
-\def\subsecheadingi #1{\subsecheadingi2007,66119
-\def\subsubsecfonts{\subsubsecfonts2014,66416
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66539
-\def\subsubsecheadingi #1{\subsubsecheadingi2018,66617
-\def\startcontents#1{\startcontents2032,67089
- \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67362
-\outer\def\contents{\contents2049,67721
-\outer\def\summarycontents{\summarycontents2057,67865
- \def\secentry ##1##2##3##4{\secentry2067,68236
- \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68271
- \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68306
- \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68347
- \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68385
- \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68432
-\def\chapentry#1#2#3{\chapentry2085,68866
-\def\shortchapentry#1#2#3{\shortchapentry2088,68983
- {#2\labelspace #1}space2091,69093
-\def\unnumbchapentry#1#2{\unnumbchapentry2094,69147
-\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69194
-\def\secentry#1#2#3#4{\secentry2102,69358
-\def\unnumbsecentry#1#2{\unnumbsecentry2103,69417
-\def\subsecentry#1#2#3#4#5{\subsecentry2106,69478
-\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69548
-\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69622
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69656
-\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69707
-\def\dochapentry#1#2{\dochapentry2123,70081
-\def\dosecentry#1#2{\dosecentry2138,70686
-\def\dosubsecentry#1#2{\dosubsecentry2145,70864
-\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71049
-\def\labelspace{\labelspace2160,71300
-\def\dopageno#1{\dopageno2162,71335
-\def\doshortpageno#1{\doshortpageno2163,71361
-\def\chapentryfonts{\chapentryfonts2165,71393
-\def\secentryfonts{\secentryfonts2166,71428
-\def\point{\point2192,72387
-\def\result{\result2194,72408
-\def\expansion{\expansion2195,72481
-\def\print{\print2196,72552
-\def\equiv{\equiv2198,72619
-\def\error{\error2218,73392
-\def\tex{\tex2224,73621
-\def\@{\@2242,74004
-\gdef\sepspaces{\def {\ }}}\2265,74736
-\def\aboveenvbreak{\aboveenvbreak2268,74818
-\def\afterenvbreak{\afterenvbreak2272,74984
-\def\ctl{\ctl2286,75495
-\def\ctr{\ctr2287,75567
-\def\cbl{\cbl2288,75606
-\def\cbr{\cbr2289,75646
-\def\carttop{\carttop2290,75685
-\def\cartbot{\cartbot2293,75793
-\long\def\cartouche{\cartouche2299,75933
-\def\Ecartouche{\Ecartouche2326,76721
-\def\lisp{\lisp2338,76856
-\def\Elisp{\Elisp2348,77203
-\def\next##1{\next2360,77529
-\def\Eexample{\Eexample2364,77571
-\def\Esmallexample{\Esmallexample2367,77618
-\def\smalllispx{\smalllispx2373,77796
-\def\Esmalllisp{\Esmalllisp2383,78150
-\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78506
-\def\next##1{\next2397,78563
-\def\display{\display2401,78643
-\def\Edisplay{\Edisplay2410,78962
-\def\next##1{\next2422,79273
-\def\format{\format2426,79376
-\def\Eformat{\Eformat2434,79672
-\def\next##1{\next2437,79761
-\def\flushleft{\flushleft2441,79813
-\def\Eflushleft{\Eflushleft2451,80184
-\def\next##1{\next2454,80277
-\def\flushright{\flushright2456,80299
-\def\Eflushright{\Eflushright2466,80671
-\def\next##1{\next2470,80802
-\def\quotation{\quotation2474,80860
-\def\Equotation{\Equotation2480,81052
-\def\setdeffont #1 {\setdeffont2493,81450
-\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81496
-\newskip\defargsindent \defargsindent=50ptargsindent2496,81539
-\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81582
-\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81625
-\def\activeparens{\activeparens2503,81823
-\def\opnr{\opnr2529,83035
-\def\lbrb{\lbrb2530,83100
-\def\defname #1#2{\defname2536,83301
-\advance\dimen2 by -\defbodyindentbodyindent2540,83419
-\advance\dimen3 by -\defbodyindentbodyindent2542,83473
-\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83527
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83669
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83744
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84113
-\advance\leftskip by -\defbodyindentbodyindent2557,84247
-\exdentamount=\defbodyindentbodyindent2558,84284
-\def\defparsebody #1#2#3{\defparsebody2568,84643
-\def#1{2572,84827
-\def#2{2573,84863
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84935
-\exdentamount=\defbodyindentbodyindent2576,85009
-\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85113
-\def#1{2585,85274
-\def#2##1 {2586,85310
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85393
-\exdentamount=\defbodyindentbodyindent2589,85467
-\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85552
-\def#1{2596,85713
-\def#2##1 ##2 {2597,85749
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85849
-\exdentamount=\defbodyindentbodyindent2601,85923
-\def\defvarparsebody #1#2#3{\defvarparsebody2608,86194
-\def#1{2612,86381
-\def#2{2613,86417
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86476
-\exdentamount=\defbodyindentbodyindent2616,86550
-\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86641
-\def#1{2625,86800
-\def#2##1 {2626,86836
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86906
-\exdentamount=\defbodyindentbodyindent2629,86980
-\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87052
-\def#1{2636,87216
-\def#2##1 ##2 {2637,87252
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87339
-\exdentamount=\defbodyindentbodyindent2641,87413
-\def\defunargs #1{\defunargs2664,88173
-\def\deftypefunargs #1{\deftypefunargs2676,88555
-\def\deffn{\deffn2690,88937
-\def\deffnheader #1#2#3{\deffnheader2692,88994
-\begingroup\defname {name2693,89042
-\def\defun{\defun2699,89187
-\def\defunheader #1#2{\defunheader2701,89240
-\begingroup\defname {name2702,89315
-\defunargs {unargs2703,89351
-\def\deftypefun{\deftypefun2709,89499
-\def\deftypefunheader #1#2{\deftypefunheader2712,89621
-\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89730
-\begingroup\defname {name2716,89822
-\deftypefunargs {typefunargs2717,89868
-\def\deftypefn{\deftypefn2723,90039
-\def\deftypefnheader #1#2#3{\deftypefnheader2726,90188
-\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90324
-\begingroup\defname {name2730,90417
-\deftypefunargs {typefunargs2731,90457
-\def\defmac{\defmac2737,90578
-\def\defmacheader #1#2{\defmacheader2739,90635
-\begingroup\defname {name2740,90711
-\defunargs {unargs2741,90744
-\def\defspec{\defspec2747,90868
-\def\defspecheader #1#2{\defspecheader2749,90929
-\begingroup\defname {name2750,91006
-\defunargs {unargs2751,91046
-\def\deffnx #1 {\deffnx2758,91241
-\def\defunx #1 {\defunx2759,91298
-\def\defmacx #1 {\defmacx2760,91355
-\def\defspecx #1 {\defspecx2761,91414
-\def\deftypefnx #1 {\deftypefnx2762,91475
-\def\deftypeunx #1 {\deftypeunx2763,91540
-\def\defop #1 {\defop2769,91686
-\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91721
-\def\defopheader #1#2#3{\defopheader2772,91775
-\begingroup\defname {name2774,91864
-\defunargs {unargs2775,91910
-\def\defmethod{\defmethod2780,91971
-\def\defmethodheader #1#2#3{\defmethodheader2782,92044
-\begingroup\defname {name2784,92132
-\defunargs {unargs2785,92172
-\def\defcv #1 {\defcv2790,92246
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92281
-\def\defcvarheader #1#2#3{\defcvarheader2793,92340
-\begingroup\defname {name2795,92426
-\defvarargs {varargs2796,92472
-\def\defivar{\defivar2801,92545
-\def\defivarheader #1#2#3{\defivarheader2803,92608
-\begingroup\defname {name2805,92694
-\defvarargs {varargs2806,92745
-\def\defopx #1 {\defopx2812,92894
-\def\defmethodx #1 {\defmethodx2813,92951
-\def\defcvx #1 {\defcvx2814,93016
-\def\defivarx #1 {\defivarx2815,93073
-\def\defvarargs #1{\defvarargs2822,93344
-\def\defvr{\defvr2828,93488
-\def\defvrheader #1#2#3{\defvrheader2830,93543
-\begingroup\defname {name2831,93591
-\def\defvar{\defvar2835,93676
-\def\defvarheader #1#2{\defvarheader2837,93736
-\begingroup\defname {name2838,93807
-\defvarargs {varargs2839,93843
-\def\defopt{\defopt2844,93909
-\def\defoptheader #1#2{\defoptheader2846,93969
-\begingroup\defname {name2847,94040
-\defvarargs {varargs2848,94079
-\def\deftypevar{\deftypevar2853,94136
-\def\deftypevarheader #1#2{\deftypevarheader2856,94252
-\begingroup\defname {name2858,94335
-\def\deftypevr{\deftypevr2865,94509
-\def\deftypevrheader #1#2#3{\deftypevrheader2867,94580
-\begingroup\defname {name2868,94632
-\def\defvrx #1 {\defvrx2876,94869
-\def\defvarx #1 {\defvarx2877,94926
-\def\defoptx #1 {\defoptx2878,94985
-\def\deftypevarx #1 {\deftypevarx2879,95044
-\def\deftypevrx #1 {\deftypevrx2880,95111
-\def\deftpargs #1{\deftpargs2885,95260
-\def\deftp{\deftp2889,95340
-\def\deftpheader #1#2#3{\deftpheader2891,95395
-\begingroup\defname {name2892,95443
-\def\deftpx #1 {\deftpx2897,95602
-\def\setref#1{\setref2908,95923
-\def\unnumbsetref#1{\unnumbsetref2913,96037
-\def\appendixsetref#1{\appendixsetref2918,96144
-\def\pxref#1{\pxref2929,96555
-\def\xref#1{\xref2930,96591
-\def\ref#1{\ref2931,96626
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96656
-\def\printedmanual{\printedmanual2933,96699
-\def\printednodename{\printednodename2934,96737
-\def\printednodename{\printednodename2939,96862
-section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97495
-\refx{x2957,97573
-\def\dosetq #1#2{\dosetq2965,97793
-\def\internalsetq #1#2{\internalsetq2973,98051
-\def\Ypagenumber{\Ypagenumber2977,98152
-\def\Ytitle{\Ytitle2979,98178
-\def\Ynothing{\Ynothing2981,98205
-\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98222
-\def\Yappendixletterandtype{\Yappendixletterandtype2992,98538
-\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98568
-\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98623
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98727
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98798
- \def\linenumber{\linenumber3009,99137
-\def\refx#1#2{\refx3015,99321
-\def\xrdef #1#2{\xrdef3037,99947
-\def\readauxfile{\readauxfile3040,100032
-\def\supereject{\supereject3110,101813
-\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102498
-\def\openindices{\openindices3139,102684
-\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102909
-\parindent = \defaultparindentaultparindent3152,102961
-\def\smallbook{\smallbook3175,103685
-\global\def\Esmallexample{\Esmallexample3192,104112
-\def\afourpaper{\afourpaper3196,104203
-\def\finalout{\finalout3224,105011
-\def\normaldoublequote{\normaldoublequote3235,105272
-\def\normaltilde{\normaltilde3236,105298
-\def\normalcaret{\normalcaret3237,105318
-\def\normalunderscore{\normalunderscore3238,105338
-\def\normalverticalbar{\normalverticalbar3239,105363
-\def\normalless{\normalless3240,105389
-\def\normalgreater{\normalgreater3241,105408
-\def\normalplus{\normalplus3242,105430
-\def\ifusingtt#1#2{\ifusingtt3253,105922
-\def\activedoublequote{\activedoublequote3261,106250
-\def~{~3264,106336
-\def^{^3267,106397
-\def_{_3270,106436
-\def\_{\_3272,106510
-\def\lvvmode{\lvvmode3279,106847
-\def|{|3282,106897
-\def<{<3285,106960
-\def>{>3288,107017
-\def+{+3290,107055
-\def\turnoffactive{\turnoffactive3296,107216
-\global\def={=3307,107502
-\def\normalbackslash{\normalbackslash3321,107884
+\def\itemfont{\itemfont1082,35890
+\def\Etable{\Etable1090,36116
+\def\itemize{\itemize1103,36440
+\def\itemizezzz #1{\itemizezzz1105,36476
+\def\itemizey #1#2{\itemizey1110,36571
+\def#2{1119,36817
+\def\itemcontents{\itemcontents1120,36858
+\def\bullet{\bullet1123,36906
+\def\minus{\minus1124,36933
+\def\frenchspacing{\frenchspacing1128,37041
+\def\splitoff#1#2\endmark{\splitoff1134,37266
+\def\enumerate{\enumerate1140,37496
+\def\enumeratezzz #1{\enumeratezzz1141,37535
+\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37588
+ \def\thearg{\thearg1146,37735
+ \ifx\thearg\empty \def\thearg{\thearg1147,37754
+\def\numericenumerate{\numericenumerate1184,39088
+\def\lowercaseenumerate{\lowercaseenumerate1190,39218
+\def\uppercaseenumerate{\uppercaseenumerate1203,39565
+\def\startenumeration#1{\startenumeration1219,40055
+\def\alphaenumerate{\alphaenumerate1227,40237
+\def\capsenumerate{\capsenumerate1228,40272
+\def\Ealphaenumerate{\Ealphaenumerate1229,40306
+\def\Ecapsenumerate{\Ecapsenumerate1230,40340
+\def\itemizeitem{\itemizeitem1234,40420
+\def\newindex #1{\newindex1259,41277
+\def\defindex{\defindex1268,41566
+\def\newcodeindex #1{\newcodeindex1272,41674
+\def\defcodeindex{\defcodeindex1279,41934
+\def\synindex #1 #2 {\synindex1283,42114
+\def\syncodeindex #1 #2 {\syncodeindex1292,42454
+\def\doindex#1{\doindex1309,43133
+\def\singleindexer #1{\singleindexer1310,43192
+\def\docodeindex#1{\docodeindex1313,43304
+\def\singlecodeindexer #1{\singlecodeindexer1314,43371
+\def\indexdummies{\indexdummies1316,43429
+\def\_{\_1317,43449
+\def\w{\w1318,43477
+\def\bf{\bf1319,43504
+\def\rm{\rm1320,43533
+\def\sl{\sl1321,43562
+\def\sf{\sf1322,43591
+\def\tt{\tt1323,43619
+\def\gtr{\gtr1324,43647
+\def\less{\less1325,43677
+\def\hat{\hat1326,43709
+\def\char{\char1327,43739
+\def\TeX{\TeX1328,43771
+\def\dots{\dots1329,43801
+\def\copyright{\copyright1330,43834
+\def\tclose##1{\tclose1331,43877
+\def\code##1{\code1332,43922
+\def\samp##1{\samp1333,43963
+\def\t##1{\t1334,44004
+\def\r##1{\r1335,44039
+\def\i##1{\i1336,44074
+\def\b##1{\b1337,44109
+\def\cite##1{\cite1338,44144
+\def\key##1{\key1339,44185
+\def\file##1{\file1340,44224
+\def\var##1{\var1341,44265
+\def\kbd##1{\kbd1342,44304
+\def\indexdummyfont#1{\indexdummyfont1347,44460
+\def\indexdummytex{\indexdummytex1348,44486
+\def\indexdummydots{\indexdummydots1349,44510
+\def\indexnofonts{\indexnofonts1351,44536
+\let\w=\indexdummyfontdummyfont1352,44556
+\let\t=\indexdummyfontdummyfont1353,44579
+\let\r=\indexdummyfontdummyfont1354,44602
+\let\i=\indexdummyfontdummyfont1355,44625
+\let\b=\indexdummyfontdummyfont1356,44648
+\let\emph=\indexdummyfontdummyfont1357,44671
+\let\strong=\indexdummyfontdummyfont1358,44697
+\let\cite=\indexdummyfont=\indexdummyfont1359,44725
+\let\sc=\indexdummyfontdummyfont1360,44751
+\let\tclose=\indexdummyfontdummyfont1364,44923
+\let\code=\indexdummyfontdummyfont1365,44951
+\let\file=\indexdummyfontdummyfont1366,44977
+\let\samp=\indexdummyfontdummyfont1367,45003
+\let\kbd=\indexdummyfontdummyfont1368,45029
+\let\key=\indexdummyfontdummyfont1369,45054
+\let\var=\indexdummyfontdummyfont1370,45079
+\let\TeX=\indexdummytexdummytex1371,45104
+\let\dots=\indexdummydotsdummydots1372,45128
+\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45380
+\def\doind #1#2{\doind1384,45436
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45479
+\def\rawbackslashxx{\rawbackslashxx1389,45619
+{\indexnofontsnofonts1394,45881
+\def\dosubind #1#2#3{\dosubind1405,46192
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46240
+\def\rawbackslashxx{\rawbackslashxx1410,46344
+{\indexnofontsnofonts1414,46498
+\def\findex {\findex1443,47429
+\def\kindex {\kindex1444,47452
+\def\cindex {\cindex1445,47475
+\def\vindex {\vindex1446,47498
+\def\tindex {\tindex1447,47521
+\def\pindex {\pindex1448,47544
+\def\cindexsub {\cindexsub1450,47568
+\def\printindex{\printindex1462,47895
+\def\doprintindex#1{\doprintindex1464,47936
+ \def\indexbackslash{\indexbackslash1481,48421
+ \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48460
+\def\initial #1{\initial1517,49532
+\def\entry #1#2{\entry1523,49739
+ \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50386
+\def\indexdotfill{\indexdotfill1549,50714
+\def\primary #1{\primary1552,50820
+\def\secondary #1#2{\secondary1556,50902
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50984
+\newbox\partialpageialpage1566,51157
+\def\begindoublecolumns{\begindoublecolumns1572,51315
+ \output={\global\setbox\partialpage=ialpage=1573,51351
+\def\enddoublecolumns{\enddoublecolumns1577,51539
+\def\doublecolumnout{\doublecolumnout1580,51624
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51693
+\def\pagesofar{\pagesofar1584,51871
+\def\balancecolumns{\balancecolumns1588,52108
+ \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52279
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52540
+\newcount \appendixno \appendixno = `\@no1627,53445
+\def\appendixletter{\appendixletter1628,53486
+\def\opencontents{\opencontents1632,53589
+\def\thischapter{\thischapter1637,53770
+\def\seccheck#1{\seccheck1638,53808
+\def\chapternofonts{\chapternofonts1643,53912
+\def\result{\result1646,53987
+\def\equiv{\equiv1647,54022
+\def\expansion{\expansion1648,54055
+\def\print{\print1649,54096
+\def\TeX{\TeX1650,54129
+\def\dots{\dots1651,54158
+\def\copyright{\copyright1652,54189
+\def\tt{\tt1653,54230
+\def\bf{\bf1654,54257
+\def\w{\w1655,54285
+\def\less{\less1656,54310
+\def\gtr{\gtr1657,54341
+\def\hat{\hat1658,54370
+\def\char{\char1659,54399
+\def\tclose##1{\tclose1660,54430
+\def\code##1{\code1661,54474
+\def\samp##1{\samp1662,54514
+\def\r##1{\r1663,54554
+\def\b##1{\b1664,54588
+\def\key##1{\key1665,54622
+\def\file##1{\file1666,54660
+\def\kbd##1{\kbd1667,54700
+\def\i##1{\i1669,54808
+\def\cite##1{\cite1670,54842
+\def\var##1{\var1671,54882
+\def\emph##1{\emph1672,54920
+\def\dfn##1{\dfn1673,54960
+\def\thischaptername{\thischaptername1676,55001
+\outer\def\chapter{\chapter1677,55040
+\def\chapterzzz #1{\chapterzzz1678,55081
+{\chapternofonts%nofonts%1687,55477
+\global\let\section = \numberedsec=1692,55630
+\global\let\subsection = \numberedsubsec=1693,55665
+\global\let\subsubsection = \numberedsubsubsec=1694,55706
+\outer\def\appendix{\appendix1697,55757
+\def\appendixzzz #1{\appendixzzz1698,55800
+\global\advance \appendixno by 1 \message{no1700,55877
+\chapmacro {#1}{Appendix \appendixletter}letter1701,55946
+\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56039
+{\chapternofonts%nofonts%1705,56111
+ {#1}{Appendix \appendixletter}letter1707,56167
+\appendixnoderef %noderef1710,56267
+\global\let\section = \appendixsec=1711,56286
+\global\let\subsection = \appendixsubsec=1712,56321
+\global\let\subsubsection = \appendixsubsubsec=1713,56362
+\outer\def\top{\top1716,56413
+\outer\def\unnumbered{\unnumbered1717,56453
+\def\unnumberedzzz #1{\unnumberedzzz1718,56500
+{\chapternofonts%nofonts%1722,56663
+\global\let\section = \unnumberedsec=1727,56813
+\global\let\subsection = \unnumberedsubsec=1728,56850
+\global\let\subsubsection = \unnumberedsubsubsec=1729,56893
+\outer\def\numberedsec{\numberedsec1732,56946
+\def\seczzz #1{\seczzz1733,56987
+{\chapternofonts%nofonts%1736,57143
+\outer\def\appendixsection{\appendixsection1745,57329
+\outer\def\appendixsec{\appendixsec1746,57386
+\def\appendixsectionzzz #1{\appendixsectionzzz1747,57439
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57551
+{\chapternofonts%nofonts%1750,57619
+{#1}{\appendixletter}letter1752,57675
+\appendixnoderef %noderef1755,57775
+\outer\def\unnumberedsec{\unnumberedsec1759,57815
+\def\unnumberedseczzz #1{\unnumberedseczzz1760,57868
+{\chapternofonts%nofonts%1762,57963
+\outer\def\numberedsubsec{\numberedsubsec1770,58131
+\def\numberedsubseczzz #1{\numberedsubseczzz1771,58186
+{\chapternofonts%nofonts%1774,58365
+\outer\def\appendixsubsec{\appendixsubsec1783,58569
+\def\appendixsubseczzz #1{\appendixsubseczzz1784,58624
+\subsecheading {#1}{\appendixletter}letter1786,58746
+{\chapternofonts%nofonts%1787,58811
+{#1}{\appendixletter}letter1789,58870
+\appendixnoderef %noderef1792,58985
+\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59025
+\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59084
+{\chapternofonts%nofonts%1799,59185
+\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59356
+\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59417
+{\chapternofonts%nofonts%1812,59614
+\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59847
+\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59908
+ {\appendixletter}letter1827,60047
+{\chapternofonts%nofonts%1828,60113
+ {\appendixletter}letter1830,60178
+\appendixnoderef %noderef1834,60312
+\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60352
+\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60417
+{\chapternofonts%nofonts%1841,60524
+\def\infotop{\infotop1851,60853
+\def\infounnumbered{\infounnumbered1852,60891
+\def\infounnumberedsec{\infounnumberedsec1853,60936
+\def\infounnumberedsubsec{\infounnumberedsubsec1854,60987
+\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61044
+\def\infoappendix{\infoappendix1857,61108
+\def\infoappendixsec{\infoappendixsec1858,61149
+\def\infoappendixsubsec{\infoappendixsubsec1859,61196
+\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61249
+\def\infochapter{\infochapter1862,61309
+\def\infosection{\infosection1863,61348
+\def\infosubsection{\infosubsection1864,61387
+\def\infosubsubsection{\infosubsubsection1865,61432
+\global\let\section = \numberedsec=1870,61669
+\global\let\subsection = \numberedsubsec=1871,61704
+\global\let\subsubsection = \numberedsubsubsec=1872,61745
+\def\majorheading{\majorheading1886,62252
+\def\majorheadingzzz #1{\majorheadingzzz1887,62297
+\def\chapheading{\chapheading1893,62530
+\def\chapheadingzzz #1{\chapheadingzzz1894,62573
+\def\heading{\heading1899,62768
+\def\subheading{\subheading1901,62805
+\def\subsubheading{\subsubheading1903,62848
+\def\dobreak#1#2{\dobreak1910,63125
+\def\setchapterstyle #1 {\setchapterstyle1912,63203
+\def\chapbreak{\chapbreak1919,63458
+\def\chappager{\chappager1920,63508
+\def\chapoddpage{\chapoddpage1921,63546
+\def\setchapternewpage #1 {\setchapternewpage1923,63625
+\def\CHAPPAGoff{\CHAPPAGoff1925,63682
+\def\CHAPPAGon{\CHAPPAGon1929,63776
+\global\def\HEADINGSon{\HEADINGSon1932,63867
+\def\CHAPPAGodd{\CHAPPAGodd1934,63909
+\global\def\HEADINGSon{\HEADINGSon1937,64005
+\def\CHAPFplain{\CHAPFplain1941,64059
+\def\chfplain #1#2{\chfplain1945,64151
+\def\unnchfplain #1{\unnchfplain1956,64374
+\def\unnchfopen #1{\unnchfopen1964,64603
+\def\chfopen #1#2{\chfopen1970,64811
+\def\CHAPFopen{\CHAPFopen1975,64955
+\def\subsecheadingbreak{\subsecheadingbreak1982,65173
+\def\secheadingbreak{\secheadingbreak1985,65302
+\def\secheading #1#2#3{\secheading1993,65584
+\def\plainsecheading #1{\plainsecheading1994,65640
+\def\secheadingi #1{\secheadingi1995,65683
+\def\subsecheading #1#2#3#4{\subsecheading2006,66051
+\def\subsecheadingi #1{\subsecheadingi2007,66118
+\def\subsubsecfonts{\subsubsecfonts2014,66415
+\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66538
+\def\subsubsecheadingi #1{\subsubsecheadingi2018,66616
+\def\startcontents#1{\startcontents2032,67088
+ \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67361
+\outer\def\contents{\contents2049,67720
+\outer\def\summarycontents{\summarycontents2057,67864
+ \def\secentry ##1##2##3##4{\secentry2067,68235
+ \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68270
+ \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68305
+ \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68346
+ \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68384
+ \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68431
+\def\chapentry#1#2#3{\chapentry2085,68865
+\def\shortchapentry#1#2#3{\shortchapentry2088,68982
+ {#2\labelspace #1}space2091,69092
+\def\unnumbchapentry#1#2{\unnumbchapentry2094,69146
+\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69193
+\def\secentry#1#2#3#4{\secentry2102,69357
+\def\unnumbsecentry#1#2{\unnumbsecentry2103,69416
+\def\subsecentry#1#2#3#4#5{\subsecentry2106,69477
+\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69547
+\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69621
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69655
+\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69706
+\def\dochapentry#1#2{\dochapentry2123,70080
+\def\dosecentry#1#2{\dosecentry2138,70685
+\def\dosubsecentry#1#2{\dosubsecentry2145,70863
+\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71048
+\def\labelspace{\labelspace2160,71299
+\def\dopageno#1{\dopageno2162,71334
+\def\doshortpageno#1{\doshortpageno2163,71360
+\def\chapentryfonts{\chapentryfonts2165,71392
+\def\secentryfonts{\secentryfonts2166,71427
+\def\point{\point2192,72386
+\def\result{\result2194,72407
+\def\expansion{\expansion2195,72480
+\def\print{\print2196,72551
+\def\equiv{\equiv2198,72618
+\def\error{\error2218,73391
+\def\tex{\tex2224,73620
+\def\@{\@2242,74003
+\gdef\sepspaces{\def {\ }}}\2265,74735
+\def\aboveenvbreak{\aboveenvbreak2268,74817
+\def\afterenvbreak{\afterenvbreak2272,74983
+\def\ctl{\ctl2286,75494
+\def\ctr{\ctr2287,75566
+\def\cbl{\cbl2288,75605
+\def\cbr{\cbr2289,75645
+\def\carttop{\carttop2290,75684
+\def\cartbot{\cartbot2293,75792
+\long\def\cartouche{\cartouche2299,75932
+\def\Ecartouche{\Ecartouche2326,76720
+\def\lisp{\lisp2338,76855
+\def\Elisp{\Elisp2348,77202
+\def\next##1{\next2360,77528
+\def\Eexample{\Eexample2364,77570
+\def\Esmallexample{\Esmallexample2367,77617
+\def\smalllispx{\smalllispx2373,77795
+\def\Esmalllisp{\Esmalllisp2383,78149
+\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78505
+\def\next##1{\next2397,78562
+\def\display{\display2401,78642
+\def\Edisplay{\Edisplay2410,78961
+\def\next##1{\next2422,79272
+\def\format{\format2426,79375
+\def\Eformat{\Eformat2434,79671
+\def\next##1{\next2437,79760
+\def\flushleft{\flushleft2441,79812
+\def\Eflushleft{\Eflushleft2451,80183
+\def\next##1{\next2454,80276
+\def\flushright{\flushright2456,80298
+\def\Eflushright{\Eflushright2466,80670
+\def\next##1{\next2470,80801
+\def\quotation{\quotation2474,80859
+\def\Equotation{\Equotation2480,81051
+\def\setdeffont #1 {\setdeffont2493,81449
+\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81495
+\newskip\defargsindent \defargsindent=50ptargsindent2496,81538
+\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81581
+\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81624
+\def\activeparens{\activeparens2503,81822
+\def\opnr{\opnr2529,83034
+\def\lbrb{\lbrb2530,83099
+\def\defname #1#2{\defname2536,83300
+\advance\dimen2 by -\defbodyindentbodyindent2540,83418
+\advance\dimen3 by -\defbodyindentbodyindent2542,83472
+\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83526
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83668
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83743
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84112
+\advance\leftskip by -\defbodyindentbodyindent2557,84246
+\exdentamount=\defbodyindentbodyindent2558,84283
+\def\defparsebody #1#2#3{\defparsebody2568,84642
+\def#1{2572,84826
+\def#2{2573,84862
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84934
+\exdentamount=\defbodyindentbodyindent2576,85008
+\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85112
+\def#1{2585,85273
+\def#2##1 {2586,85309
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85392
+\exdentamount=\defbodyindentbodyindent2589,85466
+\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85551
+\def#1{2596,85712
+\def#2##1 ##2 {2597,85748
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85848
+\exdentamount=\defbodyindentbodyindent2601,85922
+\def\defvarparsebody #1#2#3{\defvarparsebody2608,86193
+\def#1{2612,86380
+\def#2{2613,86416
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86475
+\exdentamount=\defbodyindentbodyindent2616,86549
+\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86640
+\def#1{2625,86799
+\def#2##1 {2626,86835
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86905
+\exdentamount=\defbodyindentbodyindent2629,86979
+\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87051
+\def#1{2636,87215
+\def#2##1 ##2 {2637,87251
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87338
+\exdentamount=\defbodyindentbodyindent2641,87412
+\def\defunargs #1{\defunargs2664,88172
+\def\deftypefunargs #1{\deftypefunargs2676,88554
+\def\deffn{\deffn2690,88936
+\def\deffnheader #1#2#3{\deffnheader2692,88993
+\begingroup\defname {name2693,89041
+\def\defun{\defun2699,89186
+\def\defunheader #1#2{\defunheader2701,89239
+\begingroup\defname {name2702,89314
+\defunargs {unargs2703,89350
+\def\deftypefun{\deftypefun2709,89498
+\def\deftypefunheader #1#2{\deftypefunheader2712,89620
+\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89729
+\begingroup\defname {name2716,89821
+\deftypefunargs {typefunargs2717,89867
+\def\deftypefn{\deftypefn2723,90038
+\def\deftypefnheader #1#2#3{\deftypefnheader2726,90187
+\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90323
+\begingroup\defname {name2730,90416
+\deftypefunargs {typefunargs2731,90456
+\def\defmac{\defmac2737,90577
+\def\defmacheader #1#2{\defmacheader2739,90634
+\begingroup\defname {name2740,90710
+\defunargs {unargs2741,90743
+\def\defspec{\defspec2747,90867
+\def\defspecheader #1#2{\defspecheader2749,90928
+\begingroup\defname {name2750,91005
+\defunargs {unargs2751,91045
+\def\deffnx #1 {\deffnx2758,91240
+\def\defunx #1 {\defunx2759,91297
+\def\defmacx #1 {\defmacx2760,91354
+\def\defspecx #1 {\defspecx2761,91413
+\def\deftypefnx #1 {\deftypefnx2762,91474
+\def\deftypeunx #1 {\deftypeunx2763,91539
+\def\defop #1 {\defop2769,91685
+\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91720
+\def\defopheader #1#2#3{\defopheader2772,91774
+\begingroup\defname {name2774,91863
+\defunargs {unargs2775,91909
+\def\defmethod{\defmethod2780,91970
+\def\defmethodheader #1#2#3{\defmethodheader2782,92043
+\begingroup\defname {name2784,92131
+\defunargs {unargs2785,92171
+\def\defcv #1 {\defcv2790,92245
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92280
+\def\defcvarheader #1#2#3{\defcvarheader2793,92339
+\begingroup\defname {name2795,92425
+\defvarargs {varargs2796,92471
+\def\defivar{\defivar2801,92544
+\def\defivarheader #1#2#3{\defivarheader2803,92607
+\begingroup\defname {name2805,92693
+\defvarargs {varargs2806,92744
+\def\defopx #1 {\defopx2812,92893
+\def\defmethodx #1 {\defmethodx2813,92950
+\def\defcvx #1 {\defcvx2814,93015
+\def\defivarx #1 {\defivarx2815,93072
+\def\defvarargs #1{\defvarargs2822,93343
+\def\defvr{\defvr2828,93487
+\def\defvrheader #1#2#3{\defvrheader2830,93542
+\begingroup\defname {name2831,93590
+\def\defvar{\defvar2835,93675
+\def\defvarheader #1#2{\defvarheader2837,93735
+\begingroup\defname {name2838,93806
+\defvarargs {varargs2839,93842
+\def\defopt{\defopt2844,93908
+\def\defoptheader #1#2{\defoptheader2846,93968
+\begingroup\defname {name2847,94039
+\defvarargs {varargs2848,94078
+\def\deftypevar{\deftypevar2853,94135
+\def\deftypevarheader #1#2{\deftypevarheader2856,94251
+\begingroup\defname {name2858,94334
+\def\deftypevr{\deftypevr2865,94508
+\def\deftypevrheader #1#2#3{\deftypevrheader2867,94579
+\begingroup\defname {name2868,94631
+\def\defvrx #1 {\defvrx2876,94868
+\def\defvarx #1 {\defvarx2877,94925
+\def\defoptx #1 {\defoptx2878,94984
+\def\deftypevarx #1 {\deftypevarx2879,95043
+\def\deftypevrx #1 {\deftypevrx2880,95110
+\def\deftpargs #1{\deftpargs2885,95259
+\def\deftp{\deftp2889,95339
+\def\deftpheader #1#2#3{\deftpheader2891,95394
+\begingroup\defname {name2892,95442
+\def\deftpx #1 {\deftpx2897,95601
+\def\setref#1{\setref2908,95922
+\def\unnumbsetref#1{\unnumbsetref2913,96036
+\def\appendixsetref#1{\appendixsetref2918,96143
+\def\pxref#1{\pxref2929,96554
+\def\xref#1{\xref2930,96590
+\def\ref#1{\ref2931,96625
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96655
+\def\printedmanual{\printedmanual2933,96698
+\def\printednodename{\printednodename2934,96736
+\def\printednodename{\printednodename2939,96861
+section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97493
+\refx{x2957,97571
+\def\dosetq #1#2{\dosetq2965,97791
+\def\internalsetq #1#2{\internalsetq2973,98049
+\def\Ypagenumber{\Ypagenumber2977,98150
+\def\Ytitle{\Ytitle2979,98176
+\def\Ynothing{\Ynothing2981,98203
+\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98220
+\def\Yappendixletterandtype{\Yappendixletterandtype2992,98536
+\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98566
+\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98621
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98725
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98796
+ \def\linenumber{\linenumber3009,99135
+\def\refx#1#2{\refx3015,99319
+\def\xrdef #1#2{\xrdef3037,99945
+\def\readauxfile{\readauxfile3040,100030
+\def\supereject{\supereject3110,101811
+\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102496
+\def\openindices{\openindices3139,102682
+\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102907
+\parindent = \defaultparindentaultparindent3152,102959
+\def\smallbook{\smallbook3175,103683
+\global\def\Esmallexample{\Esmallexample3192,104110
+\def\afourpaper{\afourpaper3196,104201
+\def\finalout{\finalout3224,105009
+\def\normaldoublequote{\normaldoublequote3235,105270
+\def\normaltilde{\normaltilde3236,105296
+\def\normalcaret{\normalcaret3237,105316
+\def\normalunderscore{\normalunderscore3238,105336
+\def\normalverticalbar{\normalverticalbar3239,105361
+\def\normalless{\normalless3240,105387
+\def\normalgreater{\normalgreater3241,105406
+\def\normalplus{\normalplus3242,105428
+\def\ifusingtt#1#2{\ifusingtt3253,105920
+\def\activedoublequote{\activedoublequote3261,106248
+\def~{~3264,106334
+\def^{^3267,106395
+\def_{_3270,106434
+\def\_{\_3272,106508
+\def\lvvmode{\lvvmode3279,106845
+\def|{|3282,106895
+\def<{<3285,106958
+\def>{>3288,107015
+\def+{+3290,107053
+\def\turnoffactive{\turnoffactive3296,107214
+\global\def={=3307,107500
+\def\normalbackslash{\normalbackslash3321,107882
+
+merc-src/accumulator.m,3228
+:- interface146,5371
+:- import_module hlds148,5386
+:- import_module univ152,5478
+:- pred accu_transform_proc159,5793
+:- implementation166,6115
+:- import_module libs180,6552
+:- import_module mdbcomp184,6681
+:- import_module parse_tree186,6742
+:- import_module assoc_list194,7013
+:- import_module bool195,7042
+:- import_module int196,7065
+:- import_module io197,7087
+:- import_module list198,7108
+:- import_module map199,7131
+:- import_module maybe200,7153
+:- import_module pair201,7177
+:- import_module require202,7200
+:- import_module set203,7226
+:- import_module solutions204,7248
+:- import_module string205,7276
+:- import_module term206,7301
+:- import_module varset207,7324
+:- type top_level213,7499
+:- type accu_goal_id225,7900
+:- type accu_case228,7964
+:- type accu_goal_store234,8091
+:- type accu_subst238,8216
+:- type accu_warning240,8264
+:- pred generate_warnings334,12550
+:- pred generate_warning342,12895
+:- pred should_attempt_accu_transform365,13886
+:- pred should_attempt_accu_transform_2398,15406
+:- pred accu_standardize440,17390
+:- pred identify_goal_type465,18169
+:- pred is_recursive_case549,21175
+:- type store_info560,21713
+:- func initialize_goal_store570,22060
+:- pred accu_store580,22421
+:- pred identify_recursive_calls601,23288
+:- pred identify_out_and_out_prime626,24396
+:- type accu_sets676,26425
+:- pred accu_stage1689,26977
+:- pred accu_stage1_2727,28347
+:- pred accu_sets_init781,30557
+:- func set_upto796,30984
+:- pred accu_before812,31498
+:- pred accu_assoc835,32477
+:- pred accu_construct862,33712
+:- pred accu_construct_assoc896,35307
+:- pred accu_update938,37069
+:- pred member_lessthan_goalid964,38219
+:- type accu_assoc975,38652
+:- pred accu_is_associative986,39138
+:- pred associativity_assertion1014,40263
+:- pred commutativity_assertion1037,41242
+:- pred accu_is_update1057,41952
+:- pred is_associative_construction1078,42802
+:- type accu_substs1095,43480
+:- type accu_base1103,43744
+:- pred accu_stage21124,44605
+:- pred accu_substs_init1179,46957
+:- pred acc_var_subst_init1194,47573
+:- pred create_new_var1207,48147
+:- pred accu_process_assoc_set1223,48862
+:- pred accu_has_heuristic1297,52081
+:- pred accu_heuristic1304,52336
+:- pred accu_process_update_set1318,52906
+:- pred accu_divide_base_case1380,55844
+:- pred accu_related1412,57146
+:- inst stored_goal_plain_call1444,58415
+:- pred lookup_call1449,58601
+:- pred accu_stage31470,59432
+:- pred acc_proc_info1508,61326
+:- pred acc_pred_info1556,63449
+:- pred accu_create_goal1600,65285
+:- func create_acc_call1621,66400
+:- pred create_orig_goal1634,66987
+:- pred create_acc_goal1662,68157
+:- func create_new_orig_recursive_goals1709,70225
+:- func create_new_recursive_goals1723,70918
+:- func create_new_base_goals1738,71717
+:- pred acc_unification1749,72156
+:- pred accu_top_level1766,72896
+:- pred update_accumulator_pred1856,76290
+:- func accu_rename1876,77253
+:- func base_case_ids1889,77784
+:- func base_case_ids_set1898,78048
+:- func accu_goal_list1905,78269
+:- pred calculate_goal_info1916,78680
+:- func chain_subst1932,79319
+:- pred chain_subst_21938,79482
+:- some [T] pred unravel_univ1956,80060
+:- pragma foreign_export1957,80116
c-src/c.c,76
T f(1,0
@@ -4148,13 +4244,13 @@ yyerror FUN1(286,5948
make_list FUN2(293,6028
#define ERROR 304,6228
yylex FUN0(315,6405
-parse_cell_or_range FUN2(587,11771
-#define CK_ABS_R(671,13213
-#define CK_REL_R(675,13292
-#define CK_ABS_C(680,13421
-#define CK_REL_C(684,13500
-#define MAYBEREL(689,13629
-str_to_col FUN1(847,16830
+parse_cell_or_range FUN2(587,11772
+#define CK_ABS_R(671,13214
+#define CK_REL_R(675,13293
+#define CK_ABS_C(680,13422
+#define CK_REL_C(684,13501
+#define MAYBEREL(689,13630
+str_to_col FUN1(847,16831
y-src/parse.c,520
#define YYBISON 4,64
diff --git a/test/manual/etags/ETAGS.good_5 b/test/manual/etags/ETAGS.good_5
index 583de5cbe22..5133cc9e2b5 100644
--- a/test/manual/etags/ETAGS.good_5
+++ b/test/manual/etags/ETAGS.good_5
@@ -175,7 +175,7 @@ package body Truc.Bidule Truc.Bidule/b138,2153
protected body Bidule Bidule/b139,2181
protected body Machin_T Machin_T/b146,2281
-c-src/abbrev.c,3274
+c-src/abbrev.c,3055
Lisp_Object Vabbrev_table_name_list;43,1429
Lisp_Object Vglobal_abbrev_table;48,1574
Lisp_Object Vfundamental_mode_abbrev_table;52,1685
@@ -186,57 +186,53 @@ Lisp_Object Vabbrev_start_location_buffer;66,2046
Lisp_Object Vlast_abbrev;70,2155
Lisp_Object Vlast_abbrev_text;75,2324
int last_abbrev_point;79,2414
-Lisp_Object Vpre_abbrev_expand_hook,83,2487
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;83,2487
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,85,2551
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table85,2551
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,92,2743
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table92,2743
-DEFUN ("define-abbrev", Fdefine_abbrev,107,3124
-DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev107,3124
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,149,4443
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev149,4443
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,160,4814
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev160,4814
-DEFUN ("abbrev-symbol", Fabbrev_symbol,174,5282
-DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol174,5282
-DEFUN ("abbrev-expansion", Fabbrev_expansion,202,6246
-DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion202,6246
-DEFUN ("expand-abbrev", Fexpand_abbrev,218,6761
-DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev218,6761
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,389,11682
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev389,11682
-write_abbrev 426,12889
-describe_abbrev 445,13324
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,466,13839
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description466,13839
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,506,14995
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table506,14995
-syms_of_abbrev 540,16072
- DEFVAR_LISP ("abbrev-table-name-list"542,16092
- DEFVAR_LISP ("global-abbrev-table"548,16354
- DEFVAR_LISP ("fundamental-mode-abbrev-table"555,16676
- DEFVAR_LISP ("last-abbrev"561,17018
- DEFVAR_LISP ("last-abbrev-text"564,17141
- DEFVAR_INT ("last-abbrev-location"568,17299
- DEFVAR_LISP ("abbrev-start-location"575,17498
- DEFVAR_LISP ("abbrev-start-location-buffer"581,17775
- DEFVAR_PER_BUFFER ("local-abbrev-table"586,18039
- DEFVAR_BOOL ("abbrevs-changed"589,18182
- DEFVAR_BOOL ("abbrev-all-caps"594,18385
- DEFVAR_LISP ("pre-abbrev-expand-hook"598,18541
- DEFVAR_LISP ("abbrev-table-name-list",\1542,16092
- DEFVAR_LISP ("global-abbrev-table",\1548,16354
- DEFVAR_LISP ("fundamental-mode-abbrev-table",\1555,16676
- DEFVAR_LISP ("last-abbrev",\1561,17018
- DEFVAR_LISP ("last-abbrev-text",\1564,17141
- DEFVAR_INT ("last-abbrev-location",\1568,17299
- DEFVAR_LISP ("abbrev-start-location",\1575,17498
- DEFVAR_LISP ("abbrev-start-location-buffer",\1581,17775
- DEFVAR_PER_BUFFER ("local-abbrev-table",\1586,18039
- DEFVAR_BOOL ("abbrevs-changed",\1589,18182
- DEFVAR_BOOL ("abbrev-all-caps",\1594,18385
- DEFVAR_LISP ("pre-abbrev-expand-hook",\1598,18541
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,82,2440
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table82,2440
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,89,2632
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table89,2632
+DEFUN ("define-abbrev", Fdefine_abbrev,104,3013
+DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev104,3013
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,146,4332
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev146,4332
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,157,4703
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev157,4703
+DEFUN ("abbrev-symbol", Fabbrev_symbol,171,5171
+DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol171,5171
+DEFUN ("abbrev-expansion", Fabbrev_expansion,199,6135
+DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion199,6135
+DEFUN ("expand-abbrev", Fexpand_abbrev,215,6650
+DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev215,6650
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,383,11495
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev383,11495
+write_abbrev 420,12702
+describe_abbrev 439,13137
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,460,13652
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description460,13652
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,500,14808
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table500,14808
+syms_of_abbrev 534,15885
+ DEFVAR_LISP ("abbrev-table-name-list"536,15905
+ DEFVAR_LISP ("global-abbrev-table"542,16167
+ DEFVAR_LISP ("fundamental-mode-abbrev-table"549,16489
+ DEFVAR_LISP ("last-abbrev"555,16831
+ DEFVAR_LISP ("last-abbrev-text"558,16954
+ DEFVAR_INT ("last-abbrev-location"562,17112
+ DEFVAR_LISP ("abbrev-start-location"569,17311
+ DEFVAR_LISP ("abbrev-start-location-buffer"575,17588
+ DEFVAR_PER_BUFFER ("local-abbrev-table"580,17852
+ DEFVAR_BOOL ("abbrevs-changed"583,17995
+ DEFVAR_BOOL ("abbrev-all-caps"588,18198
+ DEFVAR_LISP ("abbrev-table-name-list",\1536,15905
+ DEFVAR_LISP ("global-abbrev-table",\1542,16167
+ DEFVAR_LISP ("fundamental-mode-abbrev-table",\1549,16489
+ DEFVAR_LISP ("last-abbrev",\1555,16831
+ DEFVAR_LISP ("last-abbrev-text",\1558,16954
+ DEFVAR_INT ("last-abbrev-location",\1562,17112
+ DEFVAR_LISP ("abbrev-start-location",\1569,17311
+ DEFVAR_LISP ("abbrev-start-location-buffer",\1575,17588
+ DEFVAR_PER_BUFFER ("local-abbrev-table",\1580,17852
+ DEFVAR_BOOL ("abbrevs-changed",\1583,17995
+ DEFVAR_BOOL ("abbrev-all-caps",\1588,18198
c-src/torture.c,197
(*tag1 tag118,452
@@ -1368,310 +1364,310 @@ make_lispy_position 5228,157391
toolkit_menubar_in_use 5456,163954
make_scroll_bar_position 5469,164322
make_lispy_event 5485,164968
-make_lispy_movement 6104,183532
-make_lispy_switch_frame 6131,184263
-make_lispy_focus_in 6137,184370
-make_lispy_focus_out 6145,184496
-parse_modifiers_uncached 6163,184946
-#define SINGLE_LETTER_MOD(6185,185466
-#undef SINGLE_LETTER_MOD6212,185907
-#define MULTI_LETTER_MOD(6214,185933
-#undef MULTI_LETTER_MOD6231,186401
-apply_modifiers_uncached 6273,187575
-static const char *const modifier_names[modifier_names6319,189194
-#define NUM_MOD_NAMES 6325,189400
-static Lisp_Object modifier_symbols;6327,189450
-lispy_modifier_list 6331,189587
-#define KEY_TO_CHAR(6353,190253
-parse_modifiers 6356,190329
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191518
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191518
-apply_modifiers 6422,192392
-reorder_modifiers 6491,194721
-modify_event_symbol 6536,196529
-DEFUN ("event-convert-list", Fevent_convert_list,6628,199245
-DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199245
-parse_solitary_modifier 6695,201136
-#define SINGLE_LETTER_MOD(6701,201259
-#define MULTI_LETTER_MOD(6705,201344
-#undef SINGLE_LETTER_MOD6763,202642
-#undef MULTI_LETTER_MOD6764,202667
-lucid_event_type_list_p 6775,202890
-get_input_pending 6814,203961
-record_asynch_buffer_change 6834,204580
-gobble_input 6872,205703
-tty_read_avail_input 6967,208311
-handle_async_input 7149,214040
-process_pending_signals 7165,214360
-unblock_input_to 7177,214646
-unblock_input 7200,215278
-totally_unblock_input 7209,215446
-handle_input_available_signal 7217,215530
-deliver_input_available_signal 7226,215701
-struct user_signal_info7235,215866
- int sig;7238,215916
- char *name;name7241,215957
- int npending;7244,216008
- struct user_signal_info *next;next7246,216025
-static struct user_signal_info *user_signals user_signals7250,216091
-add_user_signal 7253,216150
-handle_user_signal 7275,216599
-deliver_user_signal 7316,217559
-find_user_signal_name 7322,217660
-store_user_signal_events 7334,217842
-static void menu_bar_item 7362,218342
-static Lisp_Object menu_bar_one_keymap_changed_items;7363,218417
-static Lisp_Object menu_bar_items_vector;7368,218631
-static int menu_bar_items_index;7369,218673
-static const char *separator_names[separator_names7372,218708
-menu_separator_name_p 7393,219149
-menu_bar_items 7426,219853
-Lisp_Object item_properties;7568,224604
-menu_bar_item 7571,224646
-menu_item_eval_property_1 7647,227176
-eval_dyn 7658,227466
-menu_item_eval_property 7666,227676
-parse_menu_item 7686,228342
-static Lisp_Object tool_bar_items_vector;7965,236337
-static Lisp_Object tool_bar_item_properties;7970,236511
-static int ntool_bar_items;7974,236607
-static void init_tool_bar_items 7978,236665
-static void process_tool_bar_item 7979,236712
-static bool parse_tool_bar_item 7981,236802
-static void append_tool_bar_item 7982,236862
-tool_bar_items 7990,237084
-process_tool_bar_item 8075,239893
-#define PROP(8112,240970
-set_prop 8114,241039
-parse_tool_bar_item 8167,242454
-#undef PROP8379,248845
-init_tool_bar_items 8387,248970
-append_tool_bar_item 8401,249262
-read_char_x_menu_prompt 8443,250772
-read_char_minibuf_menu_prompt 8503,252446
-#define PUSH_C_STR(8527,253015
-follow_key 8726,258554
-active_maps 8733,258696
-typedef struct keyremap8742,259022
- Lisp_Object parent;8745,259108
- Lisp_Object map;8748,259225
- int start,8753,259447
- int start, end;8753,259447
-} keyremap;8754,259465
-access_keymap_keyremap 8764,259809
-keyremap_step 8811,261451
-test_undefined 8867,262935
-read_key_sequence 8916,264862
-read_key_sequence_vs 9826,295822
-DEFUN ("read-key-sequence", Fread_key_sequence,9885,297295
-DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297295
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299983
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299983
-detect_input_pending 9950,300489
-detect_input_pending_ignore_squeezables 9959,300655
-detect_input_pending_run_timers 9967,300871
-clear_input_pending 9985,301363
-requeued_events_pending_p 9997,301733
-DEFUN ("input-pending-p", Finput_pending_p,10002,301814
-DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301814
-DEFUN ("recent-keys", Frecent_keys,10024,302597
-DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302597
-DEFUN ("this-command-keys", Fthis_command_keys,10055,303518
-DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303518
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303959
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303959
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304381
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304381
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304956
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304956
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305496
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305496
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306511
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306511
-DEFUN ("recursion-depth", Frecursion_depth,10158,307070
-DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307070
-DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307407
-DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307407
-DEFUN ("discard-input", Fdiscard_input,10203,308448
-DEFUN ("discard-input", Fdiscard_input,discard-input10203,308448
-DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308950
-DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308950
-stuff_buffered_input 10285,311046
-set_waiting_for_input 10323,312017
-clear_waiting_for_input 10337,312391
-handle_interrupt_signal 10351,312755
-deliver_interrupt_signal 10378,313643
-static int volatile force_quit_count;10387,313933
-handle_interrupt 10401,314415
-quit_throw_to_read_char 10541,318712
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319289
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319289
-DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320517
-DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320517
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321433
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321433
-DEFUN ("set-quit-char", Fset_quit_char,10694,322707
-DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322707
-DEFUN ("set-input-mode", Fset_input_mode,10729,323571
-DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323571
-DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324460
-DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324460
-DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325838
-DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325838
-DEFUN ("posn-at-point", Fposn_at_point,10824,327061
-DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327061
-init_kboard 10861,328215
-allocate_kboard 10893,329285
-wipe_kboard 10909,329638
-delete_kboard 10917,329752
-init_keyboard 10942,330282
-struct event_head11021,332697
- short var;11023,332717
- short kind;11024,332730
-static const struct event_head head_table[head_table11027,332748
-syms_of_keyboard 11045,333578
- DEFVAR_LISP ("internal--top-level-message"11058,333973
- DEFVAR_LISP ("last-command-event"11312,342174
- DEFVAR_LISP ("last-nonmenu-event"11315,342298
- DEFVAR_LISP ("last-input-event"11321,342637
- DEFVAR_LISP ("unread-command-events"11324,342731
- DEFVAR_LISP ("unread-post-input-method-events"11332,343191
- DEFVAR_LISP ("unread-input-method-events"11338,343530
- DEFVAR_LISP ("meta-prefix-char"11346,343899
- DEFVAR_KBOARD ("last-command"11351,344107
- DEFVAR_KBOARD ("real-last-command"11368,344788
- DEFVAR_KBOARD ("last-repeatable-command"11372,344974
- DEFVAR_LISP ("this-command"11378,345262
- DEFVAR_LISP ("real-this-command"11384,345499
- DEFVAR_LISP ("this-command-keys-shift-translated"11388,345681
- DEFVAR_LISP ("this-original-command"11396,346124
- DEFVAR_INT ("auto-save-interval"11403,346521
- DEFVAR_LISP ("auto-save-timeout"11408,346735
- DEFVAR_LISP ("echo-keystrokes"11415,347080
- DEFVAR_INT ("polling-period"11421,347351
- DEFVAR_LISP ("double-click-time"11428,347694
- DEFVAR_INT ("double-click-fuzz"11435,348030
- DEFVAR_INT ("num-input-keys"11446,348520
- DEFVAR_INT ("num-nonmacro-input-events"11452,348795
- DEFVAR_LISP ("last-event-frame"11457,349033
- DEFVAR_LISP ("tty-erase-char"11463,349312
- DEFVAR_LISP ("help-char"11466,349435
- DEFVAR_LISP ("help-event-list"11472,349718
- DEFVAR_LISP ("help-form"11477,349929
- DEFVAR_LISP ("prefix-help-command"11483,350177
- DEFVAR_LISP ("top-level"11489,350455
- DEFVAR_KBOARD ("keyboard-translate-table"11495,350676
- DEFVAR_BOOL ("cannot-suspend"11511,351489
- DEFVAR_BOOL ("menu-prompting"11516,351716
- DEFVAR_LISP ("menu-prompt-more-char"11526,352146
- DEFVAR_INT ("extra-keyboard-modifiers"11531,352392
- DEFVAR_LISP ("deactivate-mark"11545,353118
- DEFVAR_LISP ("pre-command-hook"11553,353487
- DEFVAR_LISP ("post-command-hook"11560,353842
- DEFVAR_LISP ("echo-area-clear-hook"11568,354205
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag"11574,354420
- DEFVAR_LISP ("menu-bar-final-items"11578,354623
- DEFVAR_LISP ("tool-bar-separator-image-expression"11583,354873
- DEFVAR_KBOARD ("overriding-terminal-local-map"11589,355231
- DEFVAR_LISP ("overriding-local-map"11598,355653
- DEFVAR_LISP ("overriding-local-map-menu-flag"11607,356104
- DEFVAR_LISP ("special-event-map"11613,356443
- DEFVAR_LISP ("track-mouse"11617,356631
- DEFVAR_KBOARD ("system-key-alist"11620,356758
- DEFVAR_KBOARD ("local-function-key-map"11629,357139
- DEFVAR_KBOARD ("input-decode-map"11658,358598
- DEFVAR_LISP ("function-key-map"11675,359386
- DEFVAR_LISP ("key-translation-map"11683,359802
- DEFVAR_LISP ("deferred-action-list"11689,360146
- DEFVAR_LISP ("deferred-action-function"11694,360394
- DEFVAR_LISP ("delayed-warnings-list"11700,360693
- DEFVAR_LISP ("timer-list"11708,361101
- DEFVAR_LISP ("timer-idle-list"11712,361253
- DEFVAR_LISP ("input-method-function"11716,361416
- DEFVAR_LISP ("input-method-previous-message"11737,362385
- DEFVAR_LISP ("show-help-function"11744,362746
- DEFVAR_LISP ("disable-point-adjustment"11749,362978
- DEFVAR_LISP ("global-disable-point-adjustment"11761,363528
- DEFVAR_LISP ("minibuffer-message-timeout"11770,363894
- DEFVAR_LISP ("throw-on-input"11775,364172
- DEFVAR_LISP ("command-error-function"11781,364423
- DEFVAR_LISP ("enable-disabled-menus-and-buttons"11790,364910
- DEFVAR_LISP ("select-active-regions"11798,365237
- DEFVAR_LISP ("saved-region-selection"11807,365629
- DEFVAR_LISP ("selection-inhibit-update-commands"11815,366014
- DEFVAR_LISP ("debug-on-event"11825,366555
-keys_of_keyboard 11841,367116
-mark_kboards 11916,370435
- DEFVAR_LISP ("internal--top-level-message",\111058,333973
- DEFVAR_LISP ("last-command-event",\111312,342174
- DEFVAR_LISP ("last-nonmenu-event",\111315,342298
- DEFVAR_LISP ("last-input-event",\111321,342637
- DEFVAR_LISP ("unread-command-events",\111324,342731
- DEFVAR_LISP ("unread-post-input-method-events",\111332,343191
- DEFVAR_LISP ("unread-input-method-events",\111338,343530
- DEFVAR_LISP ("meta-prefix-char",\111346,343899
- DEFVAR_KBOARD ("last-command",\111351,344107
- DEFVAR_KBOARD ("real-last-command",\111368,344788
- DEFVAR_KBOARD ("last-repeatable-command",\111372,344974
- DEFVAR_LISP ("this-command",\111378,345262
- DEFVAR_LISP ("real-this-command",\111384,345499
- DEFVAR_LISP ("this-command-keys-shift-translated",\111388,345681
- DEFVAR_LISP ("this-original-command",\111396,346124
- DEFVAR_INT ("auto-save-interval",\111403,346521
- DEFVAR_LISP ("auto-save-timeout",\111408,346735
- DEFVAR_LISP ("echo-keystrokes",\111415,347080
- DEFVAR_INT ("polling-period",\111421,347351
- DEFVAR_LISP ("double-click-time",\111428,347694
- DEFVAR_INT ("double-click-fuzz",\111435,348030
- DEFVAR_INT ("num-input-keys",\111446,348520
- DEFVAR_INT ("num-nonmacro-input-events",\111452,348795
- DEFVAR_LISP ("last-event-frame",\111457,349033
- DEFVAR_LISP ("tty-erase-char",\111463,349312
- DEFVAR_LISP ("help-char",\111466,349435
- DEFVAR_LISP ("help-event-list",\111472,349718
- DEFVAR_LISP ("help-form",\111477,349929
- DEFVAR_LISP ("prefix-help-command",\111483,350177
- DEFVAR_LISP ("top-level",\111489,350455
- DEFVAR_KBOARD ("keyboard-translate-table",\111495,350676
- DEFVAR_BOOL ("cannot-suspend",\111511,351489
- DEFVAR_BOOL ("menu-prompting",\111516,351716
- DEFVAR_LISP ("menu-prompt-more-char",\111526,352146
- DEFVAR_INT ("extra-keyboard-modifiers",\111531,352392
- DEFVAR_LISP ("deactivate-mark",\111545,353118
- DEFVAR_LISP ("pre-command-hook",\111553,353487
- DEFVAR_LISP ("post-command-hook",\111560,353842
- DEFVAR_LISP ("echo-area-clear-hook",\111568,354205
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag",\111574,354420
- DEFVAR_LISP ("menu-bar-final-items",\111578,354623
- DEFVAR_LISP ("tool-bar-separator-image-expression",\111583,354873
- DEFVAR_KBOARD ("overriding-terminal-local-map",\111589,355231
- DEFVAR_LISP ("overriding-local-map",\111598,355653
- DEFVAR_LISP ("overriding-local-map-menu-flag",\111607,356104
- DEFVAR_LISP ("special-event-map",\111613,356443
- DEFVAR_LISP ("track-mouse",\111617,356631
- DEFVAR_KBOARD ("system-key-alist",\111620,356758
- DEFVAR_KBOARD ("local-function-key-map",\111629,357139
- DEFVAR_KBOARD ("input-decode-map",\111658,358598
- DEFVAR_LISP ("function-key-map",\111675,359386
- DEFVAR_LISP ("key-translation-map",\111683,359802
- DEFVAR_LISP ("deferred-action-list",\111689,360146
- DEFVAR_LISP ("deferred-action-function",\111694,360394
- DEFVAR_LISP ("delayed-warnings-list",\111700,360693
- DEFVAR_LISP ("timer-list",\111708,361101
- DEFVAR_LISP ("timer-idle-list",\111712,361253
- DEFVAR_LISP ("input-method-function",\111716,361416
- DEFVAR_LISP ("input-method-previous-message",\111737,362385
- DEFVAR_LISP ("show-help-function",\111744,362746
- DEFVAR_LISP ("disable-point-adjustment",\111749,362978
- DEFVAR_LISP ("global-disable-point-adjustment",\111761,363528
- DEFVAR_LISP ("minibuffer-message-timeout",\111770,363894
- DEFVAR_LISP ("throw-on-input",\111775,364172
- DEFVAR_LISP ("command-error-function",\111781,364423
- DEFVAR_LISP ("enable-disabled-menus-and-buttons",\111790,364910
- DEFVAR_LISP ("select-active-regions",\111798,365237
- DEFVAR_LISP ("saved-region-selection",\111807,365629
- DEFVAR_LISP ("selection-inhibit-update-commands",\111815,366014
- DEFVAR_LISP ("debug-on-event",\111825,366555
+make_lispy_movement 6104,183531
+make_lispy_switch_frame 6131,184262
+make_lispy_focus_in 6137,184369
+make_lispy_focus_out 6145,184495
+parse_modifiers_uncached 6163,184945
+#define SINGLE_LETTER_MOD(6185,185465
+#undef SINGLE_LETTER_MOD6212,185906
+#define MULTI_LETTER_MOD(6214,185932
+#undef MULTI_LETTER_MOD6231,186400
+apply_modifiers_uncached 6273,187574
+static const char *const modifier_names[modifier_names6319,189193
+#define NUM_MOD_NAMES 6325,189399
+static Lisp_Object modifier_symbols;6327,189449
+lispy_modifier_list 6331,189586
+#define KEY_TO_CHAR(6353,190252
+parse_modifiers 6356,190328
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191517
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191517
+apply_modifiers 6422,192391
+reorder_modifiers 6491,194720
+modify_event_symbol 6536,196528
+DEFUN ("event-convert-list", Fevent_convert_list,6628,199244
+DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199244
+parse_solitary_modifier 6695,201135
+#define SINGLE_LETTER_MOD(6701,201258
+#define MULTI_LETTER_MOD(6705,201343
+#undef SINGLE_LETTER_MOD6763,202641
+#undef MULTI_LETTER_MOD6764,202666
+lucid_event_type_list_p 6775,202889
+get_input_pending 6814,203960
+record_asynch_buffer_change 6834,204579
+gobble_input 6872,205702
+tty_read_avail_input 6967,208310
+handle_async_input 7149,214039
+process_pending_signals 7165,214359
+unblock_input_to 7177,214645
+unblock_input 7200,215277
+totally_unblock_input 7209,215445
+handle_input_available_signal 7217,215529
+deliver_input_available_signal 7226,215700
+struct user_signal_info7235,215865
+ int sig;7238,215915
+ char *name;name7241,215956
+ int npending;7244,216007
+ struct user_signal_info *next;next7246,216024
+static struct user_signal_info *user_signals user_signals7250,216090
+add_user_signal 7253,216149
+handle_user_signal 7275,216598
+deliver_user_signal 7316,217558
+find_user_signal_name 7322,217659
+store_user_signal_events 7334,217841
+static void menu_bar_item 7362,218341
+static Lisp_Object menu_bar_one_keymap_changed_items;7363,218416
+static Lisp_Object menu_bar_items_vector;7368,218630
+static int menu_bar_items_index;7369,218672
+static const char *separator_names[separator_names7372,218707
+menu_separator_name_p 7393,219148
+menu_bar_items 7426,219852
+Lisp_Object item_properties;7568,224603
+menu_bar_item 7571,224645
+menu_item_eval_property_1 7647,227175
+eval_dyn 7658,227465
+menu_item_eval_property 7666,227675
+parse_menu_item 7686,228341
+static Lisp_Object tool_bar_items_vector;7965,236336
+static Lisp_Object tool_bar_item_properties;7970,236510
+static int ntool_bar_items;7974,236606
+static void init_tool_bar_items 7978,236664
+static void process_tool_bar_item 7979,236711
+static bool parse_tool_bar_item 7981,236801
+static void append_tool_bar_item 7982,236861
+tool_bar_items 7990,237083
+process_tool_bar_item 8075,239892
+#define PROP(8112,240969
+set_prop 8114,241038
+parse_tool_bar_item 8167,242453
+#undef PROP8379,248844
+init_tool_bar_items 8387,248969
+append_tool_bar_item 8401,249261
+read_char_x_menu_prompt 8443,250771
+read_char_minibuf_menu_prompt 8503,252445
+#define PUSH_C_STR(8527,253014
+follow_key 8726,258553
+active_maps 8733,258695
+typedef struct keyremap8742,259021
+ Lisp_Object parent;8745,259107
+ Lisp_Object map;8748,259224
+ int start,8753,259446
+ int start, end;8753,259446
+} keyremap;8754,259464
+access_keymap_keyremap 8764,259808
+keyremap_step 8811,261450
+test_undefined 8867,262934
+read_key_sequence 8916,264861
+read_key_sequence_vs 9826,295821
+DEFUN ("read-key-sequence", Fread_key_sequence,9885,297294
+DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297294
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299982
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299982
+detect_input_pending 9950,300488
+detect_input_pending_ignore_squeezables 9959,300654
+detect_input_pending_run_timers 9967,300870
+clear_input_pending 9985,301362
+requeued_events_pending_p 9997,301732
+DEFUN ("input-pending-p", Finput_pending_p,10002,301813
+DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301813
+DEFUN ("recent-keys", Frecent_keys,10024,302596
+DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302596
+DEFUN ("this-command-keys", Fthis_command_keys,10055,303517
+DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303517
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303958
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303958
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304380
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304380
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304955
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304955
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305495
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305495
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306510
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306510
+DEFUN ("recursion-depth", Frecursion_depth,10158,307069
+DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307069
+DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307406
+DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307406
+DEFUN ("discard-input", Fdiscard_input,10203,308447
+DEFUN ("discard-input", Fdiscard_input,discard-input10203,308447
+DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308949
+DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308949
+stuff_buffered_input 10285,311045
+set_waiting_for_input 10323,312016
+clear_waiting_for_input 10337,312390
+handle_interrupt_signal 10351,312754
+deliver_interrupt_signal 10378,313642
+static int volatile force_quit_count;10387,313932
+handle_interrupt 10401,314414
+quit_throw_to_read_char 10541,318711
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319288
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319288
+DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320516
+DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320516
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321432
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321432
+DEFUN ("set-quit-char", Fset_quit_char,10694,322706
+DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322706
+DEFUN ("set-input-mode", Fset_input_mode,10729,323570
+DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323570
+DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324459
+DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324459
+DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325837
+DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325837
+DEFUN ("posn-at-point", Fposn_at_point,10824,327060
+DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327060
+init_kboard 10861,328214
+allocate_kboard 10893,329284
+wipe_kboard 10909,329637
+delete_kboard 10917,329751
+init_keyboard 10942,330281
+struct event_head11021,332696
+ short var;11023,332716
+ short kind;11024,332729
+static const struct event_head head_table[head_table11027,332747
+syms_of_keyboard 11045,333577
+ DEFVAR_LISP ("internal--top-level-message"11058,333972
+ DEFVAR_LISP ("last-command-event"11312,342173
+ DEFVAR_LISP ("last-nonmenu-event"11315,342297
+ DEFVAR_LISP ("last-input-event"11321,342636
+ DEFVAR_LISP ("unread-command-events"11324,342730
+ DEFVAR_LISP ("unread-post-input-method-events"11332,343190
+ DEFVAR_LISP ("unread-input-method-events"11338,343529
+ DEFVAR_LISP ("meta-prefix-char"11346,343898
+ DEFVAR_KBOARD ("last-command"11351,344106
+ DEFVAR_KBOARD ("real-last-command"11368,344787
+ DEFVAR_KBOARD ("last-repeatable-command"11372,344973
+ DEFVAR_LISP ("this-command"11378,345261
+ DEFVAR_LISP ("real-this-command"11384,345498
+ DEFVAR_LISP ("this-command-keys-shift-translated"11388,345680
+ DEFVAR_LISP ("this-original-command"11396,346123
+ DEFVAR_INT ("auto-save-interval"11403,346520
+ DEFVAR_LISP ("auto-save-timeout"11408,346734
+ DEFVAR_LISP ("echo-keystrokes"11415,347079
+ DEFVAR_INT ("polling-period"11421,347350
+ DEFVAR_LISP ("double-click-time"11428,347693
+ DEFVAR_INT ("double-click-fuzz"11435,348029
+ DEFVAR_INT ("num-input-keys"11446,348519
+ DEFVAR_INT ("num-nonmacro-input-events"11452,348794
+ DEFVAR_LISP ("last-event-frame"11457,349032
+ DEFVAR_LISP ("tty-erase-char"11463,349311
+ DEFVAR_LISP ("help-char"11466,349434
+ DEFVAR_LISP ("help-event-list"11472,349717
+ DEFVAR_LISP ("help-form"11477,349928
+ DEFVAR_LISP ("prefix-help-command"11483,350176
+ DEFVAR_LISP ("top-level"11489,350454
+ DEFVAR_KBOARD ("keyboard-translate-table"11495,350675
+ DEFVAR_BOOL ("cannot-suspend"11511,351488
+ DEFVAR_BOOL ("menu-prompting"11516,351715
+ DEFVAR_LISP ("menu-prompt-more-char"11526,352145
+ DEFVAR_INT ("extra-keyboard-modifiers"11531,352391
+ DEFVAR_LISP ("deactivate-mark"11545,353117
+ DEFVAR_LISP ("pre-command-hook"11553,353486
+ DEFVAR_LISP ("post-command-hook"11560,353841
+ DEFVAR_LISP ("echo-area-clear-hook"11568,354204
+ DEFVAR_LISP ("lucid-menu-bar-dirty-flag"11574,354419
+ DEFVAR_LISP ("menu-bar-final-items"11578,354622
+ DEFVAR_LISP ("tool-bar-separator-image-expression"11583,354872
+ DEFVAR_KBOARD ("overriding-terminal-local-map"11589,355230
+ DEFVAR_LISP ("overriding-local-map"11598,355652
+ DEFVAR_LISP ("overriding-local-map-menu-flag"11607,356103
+ DEFVAR_LISP ("special-event-map"11613,356442
+ DEFVAR_LISP ("track-mouse"11617,356630
+ DEFVAR_KBOARD ("system-key-alist"11620,356757
+ DEFVAR_KBOARD ("local-function-key-map"11629,357138
+ DEFVAR_KBOARD ("input-decode-map"11658,358597
+ DEFVAR_LISP ("function-key-map"11675,359385
+ DEFVAR_LISP ("key-translation-map"11683,359801
+ DEFVAR_LISP ("deferred-action-list"11689,360145
+ DEFVAR_LISP ("deferred-action-function"11694,360393
+ DEFVAR_LISP ("delayed-warnings-list"11700,360692
+ DEFVAR_LISP ("timer-list"11708,361100
+ DEFVAR_LISP ("timer-idle-list"11712,361252
+ DEFVAR_LISP ("input-method-function"11716,361415
+ DEFVAR_LISP ("input-method-previous-message"11737,362384
+ DEFVAR_LISP ("show-help-function"11744,362745
+ DEFVAR_LISP ("disable-point-adjustment"11749,362977
+ DEFVAR_LISP ("global-disable-point-adjustment"11761,363527
+ DEFVAR_LISP ("minibuffer-message-timeout"11770,363893
+ DEFVAR_LISP ("throw-on-input"11775,364171
+ DEFVAR_LISP ("command-error-function"11781,364422
+ DEFVAR_LISP ("enable-disabled-menus-and-buttons"11790,364909
+ DEFVAR_LISP ("select-active-regions"11798,365236
+ DEFVAR_LISP ("saved-region-selection"11807,365628
+ DEFVAR_LISP ("selection-inhibit-update-commands"11815,366013
+ DEFVAR_LISP ("debug-on-event"11825,366554
+keys_of_keyboard 11841,367115
+mark_kboards 11916,370434
+ DEFVAR_LISP ("internal--top-level-message",\111058,333972
+ DEFVAR_LISP ("last-command-event",\111312,342173
+ DEFVAR_LISP ("last-nonmenu-event",\111315,342297
+ DEFVAR_LISP ("last-input-event",\111321,342636
+ DEFVAR_LISP ("unread-command-events",\111324,342730
+ DEFVAR_LISP ("unread-post-input-method-events",\111332,343190
+ DEFVAR_LISP ("unread-input-method-events",\111338,343529
+ DEFVAR_LISP ("meta-prefix-char",\111346,343898
+ DEFVAR_KBOARD ("last-command",\111351,344106
+ DEFVAR_KBOARD ("real-last-command",\111368,344787
+ DEFVAR_KBOARD ("last-repeatable-command",\111372,344973
+ DEFVAR_LISP ("this-command",\111378,345261
+ DEFVAR_LISP ("real-this-command",\111384,345498
+ DEFVAR_LISP ("this-command-keys-shift-translated",\111388,345680
+ DEFVAR_LISP ("this-original-command",\111396,346123
+ DEFVAR_INT ("auto-save-interval",\111403,346520
+ DEFVAR_LISP ("auto-save-timeout",\111408,346734
+ DEFVAR_LISP ("echo-keystrokes",\111415,347079
+ DEFVAR_INT ("polling-period",\111421,347350
+ DEFVAR_LISP ("double-click-time",\111428,347693
+ DEFVAR_INT ("double-click-fuzz",\111435,348029
+ DEFVAR_INT ("num-input-keys",\111446,348519
+ DEFVAR_INT ("num-nonmacro-input-events",\111452,348794
+ DEFVAR_LISP ("last-event-frame",\111457,349032
+ DEFVAR_LISP ("tty-erase-char",\111463,349311
+ DEFVAR_LISP ("help-char",\111466,349434
+ DEFVAR_LISP ("help-event-list",\111472,349717
+ DEFVAR_LISP ("help-form",\111477,349928
+ DEFVAR_LISP ("prefix-help-command",\111483,350176
+ DEFVAR_LISP ("top-level",\111489,350454
+ DEFVAR_KBOARD ("keyboard-translate-table",\111495,350675
+ DEFVAR_BOOL ("cannot-suspend",\111511,351488
+ DEFVAR_BOOL ("menu-prompting",\111516,351715
+ DEFVAR_LISP ("menu-prompt-more-char",\111526,352145
+ DEFVAR_INT ("extra-keyboard-modifiers",\111531,352391
+ DEFVAR_LISP ("deactivate-mark",\111545,353117
+ DEFVAR_LISP ("pre-command-hook",\111553,353486
+ DEFVAR_LISP ("post-command-hook",\111560,353841
+ DEFVAR_LISP ("echo-area-clear-hook",\111568,354204
+ DEFVAR_LISP ("lucid-menu-bar-dirty-flag",\111574,354419
+ DEFVAR_LISP ("menu-bar-final-items",\111578,354622
+ DEFVAR_LISP ("tool-bar-separator-image-expression",\111583,354872
+ DEFVAR_KBOARD ("overriding-terminal-local-map",\111589,355230
+ DEFVAR_LISP ("overriding-local-map",\111598,355652
+ DEFVAR_LISP ("overriding-local-map-menu-flag",\111607,356103
+ DEFVAR_LISP ("special-event-map",\111613,356442
+ DEFVAR_LISP ("track-mouse",\111617,356630
+ DEFVAR_KBOARD ("system-key-alist",\111620,356757
+ DEFVAR_KBOARD ("local-function-key-map",\111629,357138
+ DEFVAR_KBOARD ("input-decode-map",\111658,358597
+ DEFVAR_LISP ("function-key-map",\111675,359385
+ DEFVAR_LISP ("key-translation-map",\111683,359801
+ DEFVAR_LISP ("deferred-action-list",\111689,360145
+ DEFVAR_LISP ("deferred-action-function",\111694,360393
+ DEFVAR_LISP ("delayed-warnings-list",\111700,360692
+ DEFVAR_LISP ("timer-list",\111708,361100
+ DEFVAR_LISP ("timer-idle-list",\111712,361252
+ DEFVAR_LISP ("input-method-function",\111716,361415
+ DEFVAR_LISP ("input-method-previous-message",\111737,362384
+ DEFVAR_LISP ("show-help-function",\111744,362745
+ DEFVAR_LISP ("disable-point-adjustment",\111749,362977
+ DEFVAR_LISP ("global-disable-point-adjustment",\111761,363527
+ DEFVAR_LISP ("minibuffer-message-timeout",\111770,363893
+ DEFVAR_LISP ("throw-on-input",\111775,364171
+ DEFVAR_LISP ("command-error-function",\111781,364422
+ DEFVAR_LISP ("enable-disabled-menus-and-buttons",\111790,364909
+ DEFVAR_LISP ("select-active-regions",\111798,365236
+ DEFVAR_LISP ("saved-region-selection",\111807,365628
+ DEFVAR_LISP ("selection-inhibit-update-commands",\111815,366013
+ DEFVAR_LISP ("debug-on-event",\111825,366554
c-src/emacs/src/lisp.h,41391
#define EMACS_LISP_H22,801
@@ -3253,11 +3249,11 @@ main(37,571
D(43,659
int x;44,694
-el-src/TAGTEST.EL,179
-(foo::defmumble bletch 1,0
-(defun foo==bar foo==bar2,33
-(defalias 'pending-delete-mode pending-delete-mode6,149
-(defalias (quote explicitly-quoted-pending-delete-mode)9,222
+el-src/TAGTEST.EL,181
+(foo::defmumble bletch 3,33
+(defun foo==bar foo==bar4,66
+(defalias 'pending-delete-mode pending-delete-mode8,182
+(defalias (quote explicitly-quoted-pending-delete-mode)11,255
el-src/emacs/lisp/progmodes/etags.el,5188
(defvar tags-file-name 34,1035
@@ -4050,22 +4046,22 @@ ord_add_element(71,1867
ord_del_element(85,2344
ord_disjoint(100,2783
ord_intersect(108,2953
-ord_intersection(126,3552
-ord_intersection3(130,3691
-ord_intersection(150,4531
-ord_intersection4(154,4703
-ord_intersection(176,5664
-ord_intersection2(181,5812
-ord_member(200,6318
-ord_seteq(216,6683
-ord_setproduct(225,6971
-ord_subset(240,7377
-ord_subtract(257,7861
-ord_symdiff(265,8054
-ord_union(288,8887
-ord_union4(303,9352
-ord_union(324,10171
-ord_union_all(329,10313
+ord_intersection(126,3553
+ord_intersection3(130,3692
+ord_intersection(150,4533
+ord_intersection4(154,4705
+ord_intersection(176,5666
+ord_intersection2(181,5814
+ord_member(200,6320
+ord_seteq(216,6685
+ord_setproduct(225,6973
+ord_subset(240,7379
+ord_subtract(257,7863
+ord_symdiff(265,8056
+ord_union(288,8889
+ord_union4(303,9354
+ord_union(324,10173
+ord_union_all(329,10315
prol-src/natded.prolog,2319
expandmng(100,2879
@@ -4280,6 +4276,11 @@ module A9,57
alias_method ( :foo2,foo237,586
A::Constant Constant42,655
+rs-src/test.rs,52
+enum IpAddrKind 3,11
+fn test1(8,48
+fn main(12,88
+
scm-src/test.scm,260
(define hello 1,0
(set! hello 3,32
@@ -4494,533 +4495,687 @@ tex-src/texinfo.tex,30627
\def\vritemindex #1{\vritemindex1068,35482
\def\tablez #1#2#3#4#5#6{\tablez1074,35631
\def\Edescription{\Edescription1077,35689
-\def\itemfont{\itemfont1082,35891
-\def\Etable{\Etable1090,36117
-\def\itemize{\itemize1103,36441
-\def\itemizezzz #1{\itemizezzz1105,36477
-\def\itemizey #1#2{\itemizey1110,36572
-\def#2{1119,36818
-\def\itemcontents{\itemcontents1120,36859
-\def\bullet{\bullet1123,36907
-\def\minus{\minus1124,36934
-\def\frenchspacing{\frenchspacing1128,37042
-\def\splitoff#1#2\endmark{\splitoff1134,37267
-\def\enumerate{\enumerate1140,37497
-\def\enumeratezzz #1{\enumeratezzz1141,37536
-\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37589
- \def\thearg{\thearg1146,37736
- \ifx\thearg\empty \def\thearg{\thearg1147,37755
-\def\numericenumerate{\numericenumerate1184,39089
-\def\lowercaseenumerate{\lowercaseenumerate1190,39219
-\def\uppercaseenumerate{\uppercaseenumerate1203,39566
-\def\startenumeration#1{\startenumeration1219,40056
-\def\alphaenumerate{\alphaenumerate1227,40238
-\def\capsenumerate{\capsenumerate1228,40273
-\def\Ealphaenumerate{\Ealphaenumerate1229,40307
-\def\Ecapsenumerate{\Ecapsenumerate1230,40341
-\def\itemizeitem{\itemizeitem1234,40421
-\def\newindex #1{\newindex1259,41278
-\def\defindex{\defindex1268,41567
-\def\newcodeindex #1{\newcodeindex1272,41675
-\def\defcodeindex{\defcodeindex1279,41935
-\def\synindex #1 #2 {\synindex1283,42115
-\def\syncodeindex #1 #2 {\syncodeindex1292,42455
-\def\doindex#1{\doindex1309,43134
-\def\singleindexer #1{\singleindexer1310,43193
-\def\docodeindex#1{\docodeindex1313,43305
-\def\singlecodeindexer #1{\singlecodeindexer1314,43372
-\def\indexdummies{\indexdummies1316,43430
-\def\_{\_1317,43450
-\def\w{\w1318,43478
-\def\bf{\bf1319,43505
-\def\rm{\rm1320,43534
-\def\sl{\sl1321,43563
-\def\sf{\sf1322,43592
-\def\tt{\tt1323,43620
-\def\gtr{\gtr1324,43648
-\def\less{\less1325,43678
-\def\hat{\hat1326,43710
-\def\char{\char1327,43740
-\def\TeX{\TeX1328,43772
-\def\dots{\dots1329,43802
-\def\copyright{\copyright1330,43835
-\def\tclose##1{\tclose1331,43878
-\def\code##1{\code1332,43923
-\def\samp##1{\samp1333,43964
-\def\t##1{\t1334,44005
-\def\r##1{\r1335,44040
-\def\i##1{\i1336,44075
-\def\b##1{\b1337,44110
-\def\cite##1{\cite1338,44145
-\def\key##1{\key1339,44186
-\def\file##1{\file1340,44225
-\def\var##1{\var1341,44266
-\def\kbd##1{\kbd1342,44305
-\def\indexdummyfont#1{\indexdummyfont1347,44461
-\def\indexdummytex{\indexdummytex1348,44487
-\def\indexdummydots{\indexdummydots1349,44511
-\def\indexnofonts{\indexnofonts1351,44537
-\let\w=\indexdummyfontdummyfont1352,44557
-\let\t=\indexdummyfontdummyfont1353,44580
-\let\r=\indexdummyfontdummyfont1354,44603
-\let\i=\indexdummyfontdummyfont1355,44626
-\let\b=\indexdummyfontdummyfont1356,44649
-\let\emph=\indexdummyfontdummyfont1357,44672
-\let\strong=\indexdummyfontdummyfont1358,44698
-\let\cite=\indexdummyfont=\indexdummyfont1359,44726
-\let\sc=\indexdummyfontdummyfont1360,44752
-\let\tclose=\indexdummyfontdummyfont1364,44924
-\let\code=\indexdummyfontdummyfont1365,44952
-\let\file=\indexdummyfontdummyfont1366,44978
-\let\samp=\indexdummyfontdummyfont1367,45004
-\let\kbd=\indexdummyfontdummyfont1368,45030
-\let\key=\indexdummyfontdummyfont1369,45055
-\let\var=\indexdummyfontdummyfont1370,45080
-\let\TeX=\indexdummytexdummytex1371,45105
-\let\dots=\indexdummydotsdummydots1372,45129
-\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45381
-\def\doind #1#2{\doind1384,45437
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45480
-\def\rawbackslashxx{\rawbackslashxx1389,45620
-{\indexnofontsnofonts1394,45882
-\def\dosubind #1#2#3{\dosubind1405,46193
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46241
-\def\rawbackslashxx{\rawbackslashxx1410,46345
-{\indexnofontsnofonts1414,46499
-\def\findex {\findex1443,47430
-\def\kindex {\kindex1444,47453
-\def\cindex {\cindex1445,47476
-\def\vindex {\vindex1446,47499
-\def\tindex {\tindex1447,47522
-\def\pindex {\pindex1448,47545
-\def\cindexsub {\cindexsub1450,47569
-\def\printindex{\printindex1462,47896
-\def\doprintindex#1{\doprintindex1464,47937
- \def\indexbackslash{\indexbackslash1481,48422
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48461
-\def\initial #1{\initial1517,49533
-\def\entry #1#2{\entry1523,49740
- \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50387
-\def\indexdotfill{\indexdotfill1549,50715
-\def\primary #1{\primary1552,50821
-\def\secondary #1#2{\secondary1556,50903
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50985
-\newbox\partialpageialpage1566,51158
-\def\begindoublecolumns{\begindoublecolumns1572,51316
- \output={\global\setbox\partialpage=ialpage=1573,51352
-\def\enddoublecolumns{\enddoublecolumns1577,51540
-\def\doublecolumnout{\doublecolumnout1580,51625
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51694
-\def\pagesofar{\pagesofar1584,51872
-\def\balancecolumns{\balancecolumns1588,52109
- \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52280
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52541
-\newcount \appendixno \appendixno = `\@no1627,53446
-\def\appendixletter{\appendixletter1628,53487
-\def\opencontents{\opencontents1632,53590
-\def\thischapter{\thischapter1637,53771
-\def\seccheck#1{\seccheck1638,53809
-\def\chapternofonts{\chapternofonts1643,53913
-\def\result{\result1646,53988
-\def\equiv{\equiv1647,54023
-\def\expansion{\expansion1648,54056
-\def\print{\print1649,54097
-\def\TeX{\TeX1650,54130
-\def\dots{\dots1651,54159
-\def\copyright{\copyright1652,54190
-\def\tt{\tt1653,54231
-\def\bf{\bf1654,54258
-\def\w{\w1655,54286
-\def\less{\less1656,54311
-\def\gtr{\gtr1657,54342
-\def\hat{\hat1658,54371
-\def\char{\char1659,54400
-\def\tclose##1{\tclose1660,54431
-\def\code##1{\code1661,54475
-\def\samp##1{\samp1662,54515
-\def\r##1{\r1663,54555
-\def\b##1{\b1664,54589
-\def\key##1{\key1665,54623
-\def\file##1{\file1666,54661
-\def\kbd##1{\kbd1667,54701
-\def\i##1{\i1669,54809
-\def\cite##1{\cite1670,54843
-\def\var##1{\var1671,54883
-\def\emph##1{\emph1672,54921
-\def\dfn##1{\dfn1673,54961
-\def\thischaptername{\thischaptername1676,55002
-\outer\def\chapter{\chapter1677,55041
-\def\chapterzzz #1{\chapterzzz1678,55082
-{\chapternofonts%nofonts%1687,55478
-\global\let\section = \numberedsec=1692,55631
-\global\let\subsection = \numberedsubsec=1693,55666
-\global\let\subsubsection = \numberedsubsubsec=1694,55707
-\outer\def\appendix{\appendix1697,55758
-\def\appendixzzz #1{\appendixzzz1698,55801
-\global\advance \appendixno by 1 \message{no1700,55878
-\chapmacro {#1}{Appendix \appendixletter}letter1701,55947
-\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56040
-{\chapternofonts%nofonts%1705,56112
- {#1}{Appendix \appendixletter}letter1707,56168
-\appendixnoderef %noderef1710,56268
-\global\let\section = \appendixsec=1711,56287
-\global\let\subsection = \appendixsubsec=1712,56322
-\global\let\subsubsection = \appendixsubsubsec=1713,56363
-\outer\def\top{\top1716,56414
-\outer\def\unnumbered{\unnumbered1717,56454
-\def\unnumberedzzz #1{\unnumberedzzz1718,56501
-{\chapternofonts%nofonts%1722,56664
-\global\let\section = \unnumberedsec=1727,56814
-\global\let\subsection = \unnumberedsubsec=1728,56851
-\global\let\subsubsection = \unnumberedsubsubsec=1729,56894
-\outer\def\numberedsec{\numberedsec1732,56947
-\def\seczzz #1{\seczzz1733,56988
-{\chapternofonts%nofonts%1736,57144
-\outer\def\appendixsection{\appendixsection1745,57330
-\outer\def\appendixsec{\appendixsec1746,57387
-\def\appendixsectionzzz #1{\appendixsectionzzz1747,57440
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57552
-{\chapternofonts%nofonts%1750,57620
-{#1}{\appendixletter}letter1752,57676
-\appendixnoderef %noderef1755,57776
-\outer\def\unnumberedsec{\unnumberedsec1759,57816
-\def\unnumberedseczzz #1{\unnumberedseczzz1760,57869
-{\chapternofonts%nofonts%1762,57964
-\outer\def\numberedsubsec{\numberedsubsec1770,58132
-\def\numberedsubseczzz #1{\numberedsubseczzz1771,58187
-{\chapternofonts%nofonts%1774,58366
-\outer\def\appendixsubsec{\appendixsubsec1783,58570
-\def\appendixsubseczzz #1{\appendixsubseczzz1784,58625
-\subsecheading {#1}{\appendixletter}letter1786,58747
-{\chapternofonts%nofonts%1787,58812
-{#1}{\appendixletter}letter1789,58871
-\appendixnoderef %noderef1792,58986
-\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59026
-\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59085
-{\chapternofonts%nofonts%1799,59186
-\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59357
-\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59418
-{\chapternofonts%nofonts%1812,59615
-\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59848
-\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59909
- {\appendixletter}letter1827,60048
-{\chapternofonts%nofonts%1828,60114
- {\appendixletter}letter1830,60179
-\appendixnoderef %noderef1834,60313
-\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60353
-\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60418
-{\chapternofonts%nofonts%1841,60525
-\def\infotop{\infotop1851,60854
-\def\infounnumbered{\infounnumbered1852,60892
-\def\infounnumberedsec{\infounnumberedsec1853,60937
-\def\infounnumberedsubsec{\infounnumberedsubsec1854,60988
-\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61045
-\def\infoappendix{\infoappendix1857,61109
-\def\infoappendixsec{\infoappendixsec1858,61150
-\def\infoappendixsubsec{\infoappendixsubsec1859,61197
-\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61250
-\def\infochapter{\infochapter1862,61310
-\def\infosection{\infosection1863,61349
-\def\infosubsection{\infosubsection1864,61388
-\def\infosubsubsection{\infosubsubsection1865,61433
-\global\let\section = \numberedsec=1870,61670
-\global\let\subsection = \numberedsubsec=1871,61705
-\global\let\subsubsection = \numberedsubsubsec=1872,61746
-\def\majorheading{\majorheading1886,62253
-\def\majorheadingzzz #1{\majorheadingzzz1887,62298
-\def\chapheading{\chapheading1893,62531
-\def\chapheadingzzz #1{\chapheadingzzz1894,62574
-\def\heading{\heading1899,62769
-\def\subheading{\subheading1901,62806
-\def\subsubheading{\subsubheading1903,62849
-\def\dobreak#1#2{\dobreak1910,63126
-\def\setchapterstyle #1 {\setchapterstyle1912,63204
-\def\chapbreak{\chapbreak1919,63459
-\def\chappager{\chappager1920,63509
-\def\chapoddpage{\chapoddpage1921,63547
-\def\setchapternewpage #1 {\setchapternewpage1923,63626
-\def\CHAPPAGoff{\CHAPPAGoff1925,63683
-\def\CHAPPAGon{\CHAPPAGon1929,63777
-\global\def\HEADINGSon{\HEADINGSon1932,63868
-\def\CHAPPAGodd{\CHAPPAGodd1934,63910
-\global\def\HEADINGSon{\HEADINGSon1937,64006
-\def\CHAPFplain{\CHAPFplain1941,64060
-\def\chfplain #1#2{\chfplain1945,64152
-\def\unnchfplain #1{\unnchfplain1956,64375
-\def\unnchfopen #1{\unnchfopen1964,64604
-\def\chfopen #1#2{\chfopen1970,64812
-\def\CHAPFopen{\CHAPFopen1975,64956
-\def\subsecheadingbreak{\subsecheadingbreak1982,65174
-\def\secheadingbreak{\secheadingbreak1985,65303
-\def\secheading #1#2#3{\secheading1993,65585
-\def\plainsecheading #1{\plainsecheading1994,65641
-\def\secheadingi #1{\secheadingi1995,65684
-\def\subsecheading #1#2#3#4{\subsecheading2006,66052
-\def\subsecheadingi #1{\subsecheadingi2007,66119
-\def\subsubsecfonts{\subsubsecfonts2014,66416
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66539
-\def\subsubsecheadingi #1{\subsubsecheadingi2018,66617
-\def\startcontents#1{\startcontents2032,67089
- \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67362
-\outer\def\contents{\contents2049,67721
-\outer\def\summarycontents{\summarycontents2057,67865
- \def\secentry ##1##2##3##4{\secentry2067,68236
- \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68271
- \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68306
- \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68347
- \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68385
- \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68432
-\def\chapentry#1#2#3{\chapentry2085,68866
-\def\shortchapentry#1#2#3{\shortchapentry2088,68983
- {#2\labelspace #1}space2091,69093
-\def\unnumbchapentry#1#2{\unnumbchapentry2094,69147
-\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69194
-\def\secentry#1#2#3#4{\secentry2102,69358
-\def\unnumbsecentry#1#2{\unnumbsecentry2103,69417
-\def\subsecentry#1#2#3#4#5{\subsecentry2106,69478
-\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69548
-\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69622
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69656
-\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69707
-\def\dochapentry#1#2{\dochapentry2123,70081
-\def\dosecentry#1#2{\dosecentry2138,70686
-\def\dosubsecentry#1#2{\dosubsecentry2145,70864
-\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71049
-\def\labelspace{\labelspace2160,71300
-\def\dopageno#1{\dopageno2162,71335
-\def\doshortpageno#1{\doshortpageno2163,71361
-\def\chapentryfonts{\chapentryfonts2165,71393
-\def\secentryfonts{\secentryfonts2166,71428
-\def\point{\point2192,72387
-\def\result{\result2194,72408
-\def\expansion{\expansion2195,72481
-\def\print{\print2196,72552
-\def\equiv{\equiv2198,72619
-\def\error{\error2218,73392
-\def\tex{\tex2224,73621
-\def\@{\@2242,74004
-\gdef\sepspaces{\def {\ }}}\2265,74736
-\def\aboveenvbreak{\aboveenvbreak2268,74818
-\def\afterenvbreak{\afterenvbreak2272,74984
-\def\ctl{\ctl2286,75495
-\def\ctr{\ctr2287,75567
-\def\cbl{\cbl2288,75606
-\def\cbr{\cbr2289,75646
-\def\carttop{\carttop2290,75685
-\def\cartbot{\cartbot2293,75793
-\long\def\cartouche{\cartouche2299,75933
-\def\Ecartouche{\Ecartouche2326,76721
-\def\lisp{\lisp2338,76856
-\def\Elisp{\Elisp2348,77203
-\def\next##1{\next2360,77529
-\def\Eexample{\Eexample2364,77571
-\def\Esmallexample{\Esmallexample2367,77618
-\def\smalllispx{\smalllispx2373,77796
-\def\Esmalllisp{\Esmalllisp2383,78150
-\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78506
-\def\next##1{\next2397,78563
-\def\display{\display2401,78643
-\def\Edisplay{\Edisplay2410,78962
-\def\next##1{\next2422,79273
-\def\format{\format2426,79376
-\def\Eformat{\Eformat2434,79672
-\def\next##1{\next2437,79761
-\def\flushleft{\flushleft2441,79813
-\def\Eflushleft{\Eflushleft2451,80184
-\def\next##1{\next2454,80277
-\def\flushright{\flushright2456,80299
-\def\Eflushright{\Eflushright2466,80671
-\def\next##1{\next2470,80802
-\def\quotation{\quotation2474,80860
-\def\Equotation{\Equotation2480,81052
-\def\setdeffont #1 {\setdeffont2493,81450
-\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81496
-\newskip\defargsindent \defargsindent=50ptargsindent2496,81539
-\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81582
-\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81625
-\def\activeparens{\activeparens2503,81823
-\def\opnr{\opnr2529,83035
-\def\lbrb{\lbrb2530,83100
-\def\defname #1#2{\defname2536,83301
-\advance\dimen2 by -\defbodyindentbodyindent2540,83419
-\advance\dimen3 by -\defbodyindentbodyindent2542,83473
-\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83527
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83669
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83744
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84113
-\advance\leftskip by -\defbodyindentbodyindent2557,84247
-\exdentamount=\defbodyindentbodyindent2558,84284
-\def\defparsebody #1#2#3{\defparsebody2568,84643
-\def#1{2572,84827
-\def#2{2573,84863
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84935
-\exdentamount=\defbodyindentbodyindent2576,85009
-\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85113
-\def#1{2585,85274
-\def#2##1 {2586,85310
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85393
-\exdentamount=\defbodyindentbodyindent2589,85467
-\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85552
-\def#1{2596,85713
-\def#2##1 ##2 {2597,85749
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85849
-\exdentamount=\defbodyindentbodyindent2601,85923
-\def\defvarparsebody #1#2#3{\defvarparsebody2608,86194
-\def#1{2612,86381
-\def#2{2613,86417
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86476
-\exdentamount=\defbodyindentbodyindent2616,86550
-\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86641
-\def#1{2625,86800
-\def#2##1 {2626,86836
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86906
-\exdentamount=\defbodyindentbodyindent2629,86980
-\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87052
-\def#1{2636,87216
-\def#2##1 ##2 {2637,87252
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87339
-\exdentamount=\defbodyindentbodyindent2641,87413
-\def\defunargs #1{\defunargs2664,88173
-\def\deftypefunargs #1{\deftypefunargs2676,88555
-\def\deffn{\deffn2690,88937
-\def\deffnheader #1#2#3{\deffnheader2692,88994
-\begingroup\defname {name2693,89042
-\def\defun{\defun2699,89187
-\def\defunheader #1#2{\defunheader2701,89240
-\begingroup\defname {name2702,89315
-\defunargs {unargs2703,89351
-\def\deftypefun{\deftypefun2709,89499
-\def\deftypefunheader #1#2{\deftypefunheader2712,89621
-\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89730
-\begingroup\defname {name2716,89822
-\deftypefunargs {typefunargs2717,89868
-\def\deftypefn{\deftypefn2723,90039
-\def\deftypefnheader #1#2#3{\deftypefnheader2726,90188
-\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90324
-\begingroup\defname {name2730,90417
-\deftypefunargs {typefunargs2731,90457
-\def\defmac{\defmac2737,90578
-\def\defmacheader #1#2{\defmacheader2739,90635
-\begingroup\defname {name2740,90711
-\defunargs {unargs2741,90744
-\def\defspec{\defspec2747,90868
-\def\defspecheader #1#2{\defspecheader2749,90929
-\begingroup\defname {name2750,91006
-\defunargs {unargs2751,91046
-\def\deffnx #1 {\deffnx2758,91241
-\def\defunx #1 {\defunx2759,91298
-\def\defmacx #1 {\defmacx2760,91355
-\def\defspecx #1 {\defspecx2761,91414
-\def\deftypefnx #1 {\deftypefnx2762,91475
-\def\deftypeunx #1 {\deftypeunx2763,91540
-\def\defop #1 {\defop2769,91686
-\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91721
-\def\defopheader #1#2#3{\defopheader2772,91775
-\begingroup\defname {name2774,91864
-\defunargs {unargs2775,91910
-\def\defmethod{\defmethod2780,91971
-\def\defmethodheader #1#2#3{\defmethodheader2782,92044
-\begingroup\defname {name2784,92132
-\defunargs {unargs2785,92172
-\def\defcv #1 {\defcv2790,92246
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92281
-\def\defcvarheader #1#2#3{\defcvarheader2793,92340
-\begingroup\defname {name2795,92426
-\defvarargs {varargs2796,92472
-\def\defivar{\defivar2801,92545
-\def\defivarheader #1#2#3{\defivarheader2803,92608
-\begingroup\defname {name2805,92694
-\defvarargs {varargs2806,92745
-\def\defopx #1 {\defopx2812,92894
-\def\defmethodx #1 {\defmethodx2813,92951
-\def\defcvx #1 {\defcvx2814,93016
-\def\defivarx #1 {\defivarx2815,93073
-\def\defvarargs #1{\defvarargs2822,93344
-\def\defvr{\defvr2828,93488
-\def\defvrheader #1#2#3{\defvrheader2830,93543
-\begingroup\defname {name2831,93591
-\def\defvar{\defvar2835,93676
-\def\defvarheader #1#2{\defvarheader2837,93736
-\begingroup\defname {name2838,93807
-\defvarargs {varargs2839,93843
-\def\defopt{\defopt2844,93909
-\def\defoptheader #1#2{\defoptheader2846,93969
-\begingroup\defname {name2847,94040
-\defvarargs {varargs2848,94079
-\def\deftypevar{\deftypevar2853,94136
-\def\deftypevarheader #1#2{\deftypevarheader2856,94252
-\begingroup\defname {name2858,94335
-\def\deftypevr{\deftypevr2865,94509
-\def\deftypevrheader #1#2#3{\deftypevrheader2867,94580
-\begingroup\defname {name2868,94632
-\def\defvrx #1 {\defvrx2876,94869
-\def\defvarx #1 {\defvarx2877,94926
-\def\defoptx #1 {\defoptx2878,94985
-\def\deftypevarx #1 {\deftypevarx2879,95044
-\def\deftypevrx #1 {\deftypevrx2880,95111
-\def\deftpargs #1{\deftpargs2885,95260
-\def\deftp{\deftp2889,95340
-\def\deftpheader #1#2#3{\deftpheader2891,95395
-\begingroup\defname {name2892,95443
-\def\deftpx #1 {\deftpx2897,95602
-\def\setref#1{\setref2908,95923
-\def\unnumbsetref#1{\unnumbsetref2913,96037
-\def\appendixsetref#1{\appendixsetref2918,96144
-\def\pxref#1{\pxref2929,96555
-\def\xref#1{\xref2930,96591
-\def\ref#1{\ref2931,96626
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96656
-\def\printedmanual{\printedmanual2933,96699
-\def\printednodename{\printednodename2934,96737
-\def\printednodename{\printednodename2939,96862
-section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97495
-\refx{x2957,97573
-\def\dosetq #1#2{\dosetq2965,97793
-\def\internalsetq #1#2{\internalsetq2973,98051
-\def\Ypagenumber{\Ypagenumber2977,98152
-\def\Ytitle{\Ytitle2979,98178
-\def\Ynothing{\Ynothing2981,98205
-\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98222
-\def\Yappendixletterandtype{\Yappendixletterandtype2992,98538
-\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98568
-\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98623
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98727
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98798
- \def\linenumber{\linenumber3009,99137
-\def\refx#1#2{\refx3015,99321
-\def\xrdef #1#2{\xrdef3037,99947
-\def\readauxfile{\readauxfile3040,100032
-\def\supereject{\supereject3110,101813
-\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102498
-\def\openindices{\openindices3139,102684
-\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102909
-\parindent = \defaultparindentaultparindent3152,102961
-\def\smallbook{\smallbook3175,103685
-\global\def\Esmallexample{\Esmallexample3192,104112
-\def\afourpaper{\afourpaper3196,104203
-\def\finalout{\finalout3224,105011
-\def\normaldoublequote{\normaldoublequote3235,105272
-\def\normaltilde{\normaltilde3236,105298
-\def\normalcaret{\normalcaret3237,105318
-\def\normalunderscore{\normalunderscore3238,105338
-\def\normalverticalbar{\normalverticalbar3239,105363
-\def\normalless{\normalless3240,105389
-\def\normalgreater{\normalgreater3241,105408
-\def\normalplus{\normalplus3242,105430
-\def\ifusingtt#1#2{\ifusingtt3253,105922
-\def\activedoublequote{\activedoublequote3261,106250
-\def~{~3264,106336
-\def^{^3267,106397
-\def_{_3270,106436
-\def\_{\_3272,106510
-\def\lvvmode{\lvvmode3279,106847
-\def|{|3282,106897
-\def<{<3285,106960
-\def>{>3288,107017
-\def+{+3290,107055
-\def\turnoffactive{\turnoffactive3296,107216
-\global\def={=3307,107502
-\def\normalbackslash{\normalbackslash3321,107884
+\def\itemfont{\itemfont1082,35890
+\def\Etable{\Etable1090,36116
+\def\itemize{\itemize1103,36440
+\def\itemizezzz #1{\itemizezzz1105,36476
+\def\itemizey #1#2{\itemizey1110,36571
+\def#2{1119,36817
+\def\itemcontents{\itemcontents1120,36858
+\def\bullet{\bullet1123,36906
+\def\minus{\minus1124,36933
+\def\frenchspacing{\frenchspacing1128,37041
+\def\splitoff#1#2\endmark{\splitoff1134,37266
+\def\enumerate{\enumerate1140,37496
+\def\enumeratezzz #1{\enumeratezzz1141,37535
+\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37588
+ \def\thearg{\thearg1146,37735
+ \ifx\thearg\empty \def\thearg{\thearg1147,37754
+\def\numericenumerate{\numericenumerate1184,39088
+\def\lowercaseenumerate{\lowercaseenumerate1190,39218
+\def\uppercaseenumerate{\uppercaseenumerate1203,39565
+\def\startenumeration#1{\startenumeration1219,40055
+\def\alphaenumerate{\alphaenumerate1227,40237
+\def\capsenumerate{\capsenumerate1228,40272
+\def\Ealphaenumerate{\Ealphaenumerate1229,40306
+\def\Ecapsenumerate{\Ecapsenumerate1230,40340
+\def\itemizeitem{\itemizeitem1234,40420
+\def\newindex #1{\newindex1259,41277
+\def\defindex{\defindex1268,41566
+\def\newcodeindex #1{\newcodeindex1272,41674
+\def\defcodeindex{\defcodeindex1279,41934
+\def\synindex #1 #2 {\synindex1283,42114
+\def\syncodeindex #1 #2 {\syncodeindex1292,42454
+\def\doindex#1{\doindex1309,43133
+\def\singleindexer #1{\singleindexer1310,43192
+\def\docodeindex#1{\docodeindex1313,43304
+\def\singlecodeindexer #1{\singlecodeindexer1314,43371
+\def\indexdummies{\indexdummies1316,43429
+\def\_{\_1317,43449
+\def\w{\w1318,43477
+\def\bf{\bf1319,43504
+\def\rm{\rm1320,43533
+\def\sl{\sl1321,43562
+\def\sf{\sf1322,43591
+\def\tt{\tt1323,43619
+\def\gtr{\gtr1324,43647
+\def\less{\less1325,43677
+\def\hat{\hat1326,43709
+\def\char{\char1327,43739
+\def\TeX{\TeX1328,43771
+\def\dots{\dots1329,43801
+\def\copyright{\copyright1330,43834
+\def\tclose##1{\tclose1331,43877
+\def\code##1{\code1332,43922
+\def\samp##1{\samp1333,43963
+\def\t##1{\t1334,44004
+\def\r##1{\r1335,44039
+\def\i##1{\i1336,44074
+\def\b##1{\b1337,44109
+\def\cite##1{\cite1338,44144
+\def\key##1{\key1339,44185
+\def\file##1{\file1340,44224
+\def\var##1{\var1341,44265
+\def\kbd##1{\kbd1342,44304
+\def\indexdummyfont#1{\indexdummyfont1347,44460
+\def\indexdummytex{\indexdummytex1348,44486
+\def\indexdummydots{\indexdummydots1349,44510
+\def\indexnofonts{\indexnofonts1351,44536
+\let\w=\indexdummyfontdummyfont1352,44556
+\let\t=\indexdummyfontdummyfont1353,44579
+\let\r=\indexdummyfontdummyfont1354,44602
+\let\i=\indexdummyfontdummyfont1355,44625
+\let\b=\indexdummyfontdummyfont1356,44648
+\let\emph=\indexdummyfontdummyfont1357,44671
+\let\strong=\indexdummyfontdummyfont1358,44697
+\let\cite=\indexdummyfont=\indexdummyfont1359,44725
+\let\sc=\indexdummyfontdummyfont1360,44751
+\let\tclose=\indexdummyfontdummyfont1364,44923
+\let\code=\indexdummyfontdummyfont1365,44951
+\let\file=\indexdummyfontdummyfont1366,44977
+\let\samp=\indexdummyfontdummyfont1367,45003
+\let\kbd=\indexdummyfontdummyfont1368,45029
+\let\key=\indexdummyfontdummyfont1369,45054
+\let\var=\indexdummyfontdummyfont1370,45079
+\let\TeX=\indexdummytexdummytex1371,45104
+\let\dots=\indexdummydotsdummydots1372,45128
+\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45380
+\def\doind #1#2{\doind1384,45436
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45479
+\def\rawbackslashxx{\rawbackslashxx1389,45619
+{\indexnofontsnofonts1394,45881
+\def\dosubind #1#2#3{\dosubind1405,46192
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46240
+\def\rawbackslashxx{\rawbackslashxx1410,46344
+{\indexnofontsnofonts1414,46498
+\def\findex {\findex1443,47429
+\def\kindex {\kindex1444,47452
+\def\cindex {\cindex1445,47475
+\def\vindex {\vindex1446,47498
+\def\tindex {\tindex1447,47521
+\def\pindex {\pindex1448,47544
+\def\cindexsub {\cindexsub1450,47568
+\def\printindex{\printindex1462,47895
+\def\doprintindex#1{\doprintindex1464,47936
+ \def\indexbackslash{\indexbackslash1481,48421
+ \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48460
+\def\initial #1{\initial1517,49532
+\def\entry #1#2{\entry1523,49739
+ \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50386
+\def\indexdotfill{\indexdotfill1549,50714
+\def\primary #1{\primary1552,50820
+\def\secondary #1#2{\secondary1556,50902
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50984
+\newbox\partialpageialpage1566,51157
+\def\begindoublecolumns{\begindoublecolumns1572,51315
+ \output={\global\setbox\partialpage=ialpage=1573,51351
+\def\enddoublecolumns{\enddoublecolumns1577,51539
+\def\doublecolumnout{\doublecolumnout1580,51624
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51693
+\def\pagesofar{\pagesofar1584,51871
+\def\balancecolumns{\balancecolumns1588,52108
+ \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52279
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52540
+\newcount \appendixno \appendixno = `\@no1627,53445
+\def\appendixletter{\appendixletter1628,53486
+\def\opencontents{\opencontents1632,53589
+\def\thischapter{\thischapter1637,53770
+\def\seccheck#1{\seccheck1638,53808
+\def\chapternofonts{\chapternofonts1643,53912
+\def\result{\result1646,53987
+\def\equiv{\equiv1647,54022
+\def\expansion{\expansion1648,54055
+\def\print{\print1649,54096
+\def\TeX{\TeX1650,54129
+\def\dots{\dots1651,54158
+\def\copyright{\copyright1652,54189
+\def\tt{\tt1653,54230
+\def\bf{\bf1654,54257
+\def\w{\w1655,54285
+\def\less{\less1656,54310
+\def\gtr{\gtr1657,54341
+\def\hat{\hat1658,54370
+\def\char{\char1659,54399
+\def\tclose##1{\tclose1660,54430
+\def\code##1{\code1661,54474
+\def\samp##1{\samp1662,54514
+\def\r##1{\r1663,54554
+\def\b##1{\b1664,54588
+\def\key##1{\key1665,54622
+\def\file##1{\file1666,54660
+\def\kbd##1{\kbd1667,54700
+\def\i##1{\i1669,54808
+\def\cite##1{\cite1670,54842
+\def\var##1{\var1671,54882
+\def\emph##1{\emph1672,54920
+\def\dfn##1{\dfn1673,54960
+\def\thischaptername{\thischaptername1676,55001
+\outer\def\chapter{\chapter1677,55040
+\def\chapterzzz #1{\chapterzzz1678,55081
+{\chapternofonts%nofonts%1687,55477
+\global\let\section = \numberedsec=1692,55630
+\global\let\subsection = \numberedsubsec=1693,55665
+\global\let\subsubsection = \numberedsubsubsec=1694,55706
+\outer\def\appendix{\appendix1697,55757
+\def\appendixzzz #1{\appendixzzz1698,55800
+\global\advance \appendixno by 1 \message{no1700,55877
+\chapmacro {#1}{Appendix \appendixletter}letter1701,55946
+\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56039
+{\chapternofonts%nofonts%1705,56111
+ {#1}{Appendix \appendixletter}letter1707,56167
+\appendixnoderef %noderef1710,56267
+\global\let\section = \appendixsec=1711,56286
+\global\let\subsection = \appendixsubsec=1712,56321
+\global\let\subsubsection = \appendixsubsubsec=1713,56362
+\outer\def\top{\top1716,56413
+\outer\def\unnumbered{\unnumbered1717,56453
+\def\unnumberedzzz #1{\unnumberedzzz1718,56500
+{\chapternofonts%nofonts%1722,56663
+\global\let\section = \unnumberedsec=1727,56813
+\global\let\subsection = \unnumberedsubsec=1728,56850
+\global\let\subsubsection = \unnumberedsubsubsec=1729,56893
+\outer\def\numberedsec{\numberedsec1732,56946
+\def\seczzz #1{\seczzz1733,56987
+{\chapternofonts%nofonts%1736,57143
+\outer\def\appendixsection{\appendixsection1745,57329
+\outer\def\appendixsec{\appendixsec1746,57386
+\def\appendixsectionzzz #1{\appendixsectionzzz1747,57439
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57551
+{\chapternofonts%nofonts%1750,57619
+{#1}{\appendixletter}letter1752,57675
+\appendixnoderef %noderef1755,57775
+\outer\def\unnumberedsec{\unnumberedsec1759,57815
+\def\unnumberedseczzz #1{\unnumberedseczzz1760,57868
+{\chapternofonts%nofonts%1762,57963
+\outer\def\numberedsubsec{\numberedsubsec1770,58131
+\def\numberedsubseczzz #1{\numberedsubseczzz1771,58186
+{\chapternofonts%nofonts%1774,58365
+\outer\def\appendixsubsec{\appendixsubsec1783,58569
+\def\appendixsubseczzz #1{\appendixsubseczzz1784,58624
+\subsecheading {#1}{\appendixletter}letter1786,58746
+{\chapternofonts%nofonts%1787,58811
+{#1}{\appendixletter}letter1789,58870
+\appendixnoderef %noderef1792,58985
+\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59025
+\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59084
+{\chapternofonts%nofonts%1799,59185
+\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59356
+\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59417
+{\chapternofonts%nofonts%1812,59614
+\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59847
+\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59908
+ {\appendixletter}letter1827,60047
+{\chapternofonts%nofonts%1828,60113
+ {\appendixletter}letter1830,60178
+\appendixnoderef %noderef1834,60312
+\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60352
+\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60417
+{\chapternofonts%nofonts%1841,60524
+\def\infotop{\infotop1851,60853
+\def\infounnumbered{\infounnumbered1852,60891
+\def\infounnumberedsec{\infounnumberedsec1853,60936
+\def\infounnumberedsubsec{\infounnumberedsubsec1854,60987
+\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61044
+\def\infoappendix{\infoappendix1857,61108
+\def\infoappendixsec{\infoappendixsec1858,61149
+\def\infoappendixsubsec{\infoappendixsubsec1859,61196
+\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61249
+\def\infochapter{\infochapter1862,61309
+\def\infosection{\infosection1863,61348
+\def\infosubsection{\infosubsection1864,61387
+\def\infosubsubsection{\infosubsubsection1865,61432
+\global\let\section = \numberedsec=1870,61669
+\global\let\subsection = \numberedsubsec=1871,61704
+\global\let\subsubsection = \numberedsubsubsec=1872,61745
+\def\majorheading{\majorheading1886,62252
+\def\majorheadingzzz #1{\majorheadingzzz1887,62297
+\def\chapheading{\chapheading1893,62530
+\def\chapheadingzzz #1{\chapheadingzzz1894,62573
+\def\heading{\heading1899,62768
+\def\subheading{\subheading1901,62805
+\def\subsubheading{\subsubheading1903,62848
+\def\dobreak#1#2{\dobreak1910,63125
+\def\setchapterstyle #1 {\setchapterstyle1912,63203
+\def\chapbreak{\chapbreak1919,63458
+\def\chappager{\chappager1920,63508
+\def\chapoddpage{\chapoddpage1921,63546
+\def\setchapternewpage #1 {\setchapternewpage1923,63625
+\def\CHAPPAGoff{\CHAPPAGoff1925,63682
+\def\CHAPPAGon{\CHAPPAGon1929,63776
+\global\def\HEADINGSon{\HEADINGSon1932,63867
+\def\CHAPPAGodd{\CHAPPAGodd1934,63909
+\global\def\HEADINGSon{\HEADINGSon1937,64005
+\def\CHAPFplain{\CHAPFplain1941,64059
+\def\chfplain #1#2{\chfplain1945,64151
+\def\unnchfplain #1{\unnchfplain1956,64374
+\def\unnchfopen #1{\unnchfopen1964,64603
+\def\chfopen #1#2{\chfopen1970,64811
+\def\CHAPFopen{\CHAPFopen1975,64955
+\def\subsecheadingbreak{\subsecheadingbreak1982,65173
+\def\secheadingbreak{\secheadingbreak1985,65302
+\def\secheading #1#2#3{\secheading1993,65584
+\def\plainsecheading #1{\plainsecheading1994,65640
+\def\secheadingi #1{\secheadingi1995,65683
+\def\subsecheading #1#2#3#4{\subsecheading2006,66051
+\def\subsecheadingi #1{\subsecheadingi2007,66118
+\def\subsubsecfonts{\subsubsecfonts2014,66415
+\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66538
+\def\subsubsecheadingi #1{\subsubsecheadingi2018,66616
+\def\startcontents#1{\startcontents2032,67088
+ \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67361
+\outer\def\contents{\contents2049,67720
+\outer\def\summarycontents{\summarycontents2057,67864
+ \def\secentry ##1##2##3##4{\secentry2067,68235
+ \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68270
+ \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68305
+ \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68346
+ \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68384
+ \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68431
+\def\chapentry#1#2#3{\chapentry2085,68865
+\def\shortchapentry#1#2#3{\shortchapentry2088,68982
+ {#2\labelspace #1}space2091,69092
+\def\unnumbchapentry#1#2{\unnumbchapentry2094,69146
+\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69193
+\def\secentry#1#2#3#4{\secentry2102,69357
+\def\unnumbsecentry#1#2{\unnumbsecentry2103,69416
+\def\subsecentry#1#2#3#4#5{\subsecentry2106,69477
+\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69547
+\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69621
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69655
+\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69706
+\def\dochapentry#1#2{\dochapentry2123,70080
+\def\dosecentry#1#2{\dosecentry2138,70685
+\def\dosubsecentry#1#2{\dosubsecentry2145,70863
+\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71048
+\def\labelspace{\labelspace2160,71299
+\def\dopageno#1{\dopageno2162,71334
+\def\doshortpageno#1{\doshortpageno2163,71360
+\def\chapentryfonts{\chapentryfonts2165,71392
+\def\secentryfonts{\secentryfonts2166,71427
+\def\point{\point2192,72386
+\def\result{\result2194,72407
+\def\expansion{\expansion2195,72480
+\def\print{\print2196,72551
+\def\equiv{\equiv2198,72618
+\def\error{\error2218,73391
+\def\tex{\tex2224,73620
+\def\@{\@2242,74003
+\gdef\sepspaces{\def {\ }}}\2265,74735
+\def\aboveenvbreak{\aboveenvbreak2268,74817
+\def\afterenvbreak{\afterenvbreak2272,74983
+\def\ctl{\ctl2286,75494
+\def\ctr{\ctr2287,75566
+\def\cbl{\cbl2288,75605
+\def\cbr{\cbr2289,75645
+\def\carttop{\carttop2290,75684
+\def\cartbot{\cartbot2293,75792
+\long\def\cartouche{\cartouche2299,75932
+\def\Ecartouche{\Ecartouche2326,76720
+\def\lisp{\lisp2338,76855
+\def\Elisp{\Elisp2348,77202
+\def\next##1{\next2360,77528
+\def\Eexample{\Eexample2364,77570
+\def\Esmallexample{\Esmallexample2367,77617
+\def\smalllispx{\smalllispx2373,77795
+\def\Esmalllisp{\Esmalllisp2383,78149
+\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78505
+\def\next##1{\next2397,78562
+\def\display{\display2401,78642
+\def\Edisplay{\Edisplay2410,78961
+\def\next##1{\next2422,79272
+\def\format{\format2426,79375
+\def\Eformat{\Eformat2434,79671
+\def\next##1{\next2437,79760
+\def\flushleft{\flushleft2441,79812
+\def\Eflushleft{\Eflushleft2451,80183
+\def\next##1{\next2454,80276
+\def\flushright{\flushright2456,80298
+\def\Eflushright{\Eflushright2466,80670
+\def\next##1{\next2470,80801
+\def\quotation{\quotation2474,80859
+\def\Equotation{\Equotation2480,81051
+\def\setdeffont #1 {\setdeffont2493,81449
+\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81495
+\newskip\defargsindent \defargsindent=50ptargsindent2496,81538
+\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81581
+\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81624
+\def\activeparens{\activeparens2503,81822
+\def\opnr{\opnr2529,83034
+\def\lbrb{\lbrb2530,83099
+\def\defname #1#2{\defname2536,83300
+\advance\dimen2 by -\defbodyindentbodyindent2540,83418
+\advance\dimen3 by -\defbodyindentbodyindent2542,83472
+\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83526
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83668
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83743
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84112
+\advance\leftskip by -\defbodyindentbodyindent2557,84246
+\exdentamount=\defbodyindentbodyindent2558,84283
+\def\defparsebody #1#2#3{\defparsebody2568,84642
+\def#1{2572,84826
+\def#2{2573,84862
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84934
+\exdentamount=\defbodyindentbodyindent2576,85008
+\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85112
+\def#1{2585,85273
+\def#2##1 {2586,85309
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85392
+\exdentamount=\defbodyindentbodyindent2589,85466
+\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85551
+\def#1{2596,85712
+\def#2##1 ##2 {2597,85748
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85848
+\exdentamount=\defbodyindentbodyindent2601,85922
+\def\defvarparsebody #1#2#3{\defvarparsebody2608,86193
+\def#1{2612,86380
+\def#2{2613,86416
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86475
+\exdentamount=\defbodyindentbodyindent2616,86549
+\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86640
+\def#1{2625,86799
+\def#2##1 {2626,86835
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86905
+\exdentamount=\defbodyindentbodyindent2629,86979
+\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87051
+\def#1{2636,87215
+\def#2##1 ##2 {2637,87251
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87338
+\exdentamount=\defbodyindentbodyindent2641,87412
+\def\defunargs #1{\defunargs2664,88172
+\def\deftypefunargs #1{\deftypefunargs2676,88554
+\def\deffn{\deffn2690,88936
+\def\deffnheader #1#2#3{\deffnheader2692,88993
+\begingroup\defname {name2693,89041
+\def\defun{\defun2699,89186
+\def\defunheader #1#2{\defunheader2701,89239
+\begingroup\defname {name2702,89314
+\defunargs {unargs2703,89350
+\def\deftypefun{\deftypefun2709,89498
+\def\deftypefunheader #1#2{\deftypefunheader2712,89620
+\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89729
+\begingroup\defname {name2716,89821
+\deftypefunargs {typefunargs2717,89867
+\def\deftypefn{\deftypefn2723,90038
+\def\deftypefnheader #1#2#3{\deftypefnheader2726,90187
+\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90323
+\begingroup\defname {name2730,90416
+\deftypefunargs {typefunargs2731,90456
+\def\defmac{\defmac2737,90577
+\def\defmacheader #1#2{\defmacheader2739,90634
+\begingroup\defname {name2740,90710
+\defunargs {unargs2741,90743
+\def\defspec{\defspec2747,90867
+\def\defspecheader #1#2{\defspecheader2749,90928
+\begingroup\defname {name2750,91005
+\defunargs {unargs2751,91045
+\def\deffnx #1 {\deffnx2758,91240
+\def\defunx #1 {\defunx2759,91297
+\def\defmacx #1 {\defmacx2760,91354
+\def\defspecx #1 {\defspecx2761,91413
+\def\deftypefnx #1 {\deftypefnx2762,91474
+\def\deftypeunx #1 {\deftypeunx2763,91539
+\def\defop #1 {\defop2769,91685
+\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91720
+\def\defopheader #1#2#3{\defopheader2772,91774
+\begingroup\defname {name2774,91863
+\defunargs {unargs2775,91909
+\def\defmethod{\defmethod2780,91970
+\def\defmethodheader #1#2#3{\defmethodheader2782,92043
+\begingroup\defname {name2784,92131
+\defunargs {unargs2785,92171
+\def\defcv #1 {\defcv2790,92245
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92280
+\def\defcvarheader #1#2#3{\defcvarheader2793,92339
+\begingroup\defname {name2795,92425
+\defvarargs {varargs2796,92471
+\def\defivar{\defivar2801,92544
+\def\defivarheader #1#2#3{\defivarheader2803,92607
+\begingroup\defname {name2805,92693
+\defvarargs {varargs2806,92744
+\def\defopx #1 {\defopx2812,92893
+\def\defmethodx #1 {\defmethodx2813,92950
+\def\defcvx #1 {\defcvx2814,93015
+\def\defivarx #1 {\defivarx2815,93072
+\def\defvarargs #1{\defvarargs2822,93343
+\def\defvr{\defvr2828,93487
+\def\defvrheader #1#2#3{\defvrheader2830,93542
+\begingroup\defname {name2831,93590
+\def\defvar{\defvar2835,93675
+\def\defvarheader #1#2{\defvarheader2837,93735
+\begingroup\defname {name2838,93806
+\defvarargs {varargs2839,93842
+\def\defopt{\defopt2844,93908
+\def\defoptheader #1#2{\defoptheader2846,93968
+\begingroup\defname {name2847,94039
+\defvarargs {varargs2848,94078
+\def\deftypevar{\deftypevar2853,94135
+\def\deftypevarheader #1#2{\deftypevarheader2856,94251
+\begingroup\defname {name2858,94334
+\def\deftypevr{\deftypevr2865,94508
+\def\deftypevrheader #1#2#3{\deftypevrheader2867,94579
+\begingroup\defname {name2868,94631
+\def\defvrx #1 {\defvrx2876,94868
+\def\defvarx #1 {\defvarx2877,94925
+\def\defoptx #1 {\defoptx2878,94984
+\def\deftypevarx #1 {\deftypevarx2879,95043
+\def\deftypevrx #1 {\deftypevrx2880,95110
+\def\deftpargs #1{\deftpargs2885,95259
+\def\deftp{\deftp2889,95339
+\def\deftpheader #1#2#3{\deftpheader2891,95394
+\begingroup\defname {name2892,95442
+\def\deftpx #1 {\deftpx2897,95601
+\def\setref#1{\setref2908,95922
+\def\unnumbsetref#1{\unnumbsetref2913,96036
+\def\appendixsetref#1{\appendixsetref2918,96143
+\def\pxref#1{\pxref2929,96554
+\def\xref#1{\xref2930,96590
+\def\ref#1{\ref2931,96625
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96655
+\def\printedmanual{\printedmanual2933,96698
+\def\printednodename{\printednodename2934,96736
+\def\printednodename{\printednodename2939,96861
+section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97493
+\refx{x2957,97571
+\def\dosetq #1#2{\dosetq2965,97791
+\def\internalsetq #1#2{\internalsetq2973,98049
+\def\Ypagenumber{\Ypagenumber2977,98150
+\def\Ytitle{\Ytitle2979,98176
+\def\Ynothing{\Ynothing2981,98203
+\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98220
+\def\Yappendixletterandtype{\Yappendixletterandtype2992,98536
+\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98566
+\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98621
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98725
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98796
+ \def\linenumber{\linenumber3009,99135
+\def\refx#1#2{\refx3015,99319
+\def\xrdef #1#2{\xrdef3037,99945
+\def\readauxfile{\readauxfile3040,100030
+\def\supereject{\supereject3110,101811
+\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102496
+\def\openindices{\openindices3139,102682
+\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102907
+\parindent = \defaultparindentaultparindent3152,102959
+\def\smallbook{\smallbook3175,103683
+\global\def\Esmallexample{\Esmallexample3192,104110
+\def\afourpaper{\afourpaper3196,104201
+\def\finalout{\finalout3224,105009
+\def\normaldoublequote{\normaldoublequote3235,105270
+\def\normaltilde{\normaltilde3236,105296
+\def\normalcaret{\normalcaret3237,105316
+\def\normalunderscore{\normalunderscore3238,105336
+\def\normalverticalbar{\normalverticalbar3239,105361
+\def\normalless{\normalless3240,105387
+\def\normalgreater{\normalgreater3241,105406
+\def\normalplus{\normalplus3242,105428
+\def\ifusingtt#1#2{\ifusingtt3253,105920
+\def\activedoublequote{\activedoublequote3261,106248
+\def~{~3264,106334
+\def^{^3267,106395
+\def_{_3270,106434
+\def\_{\_3272,106508
+\def\lvvmode{\lvvmode3279,106845
+\def|{|3282,106895
+\def<{<3285,106958
+\def>{>3288,107015
+\def+{+3290,107053
+\def\turnoffactive{\turnoffactive3296,107214
+\global\def={=3307,107500
+\def\normalbackslash{\normalbackslash3321,107882
+
+merc-src/accumulator.m,4915
+:- interface146,5371
+:- import_module hlds148,5386
+:- import_module univ152,5478
+:- pred accu_transform_proc159,5793
+:- implementation166,6115
+:- import_module libs180,6552
+:- import_module mdbcomp184,6681
+:- import_module parse_tree186,6742
+:- import_module assoc_list194,7013
+:- import_module bool195,7042
+:- import_module int196,7065
+:- import_module io197,7087
+:- import_module list198,7108
+:- import_module map199,7131
+:- import_module maybe200,7153
+:- import_module pair201,7177
+:- import_module require202,7200
+:- import_module set203,7226
+:- import_module solutions204,7248
+:- import_module string205,7276
+:- import_module term206,7301
+:- import_module varset207,7324
+:- type top_level213,7499
+:- type accu_goal_id225,7900
+:- type accu_case228,7964
+:- type accu_goal_store234,8091
+:- type accu_subst238,8216
+:- type accu_warning240,8264
+accu_transform_proc247,8578
+:- pred generate_warnings334,12550
+generate_warnings337,12669
+:- pred generate_warning342,12895
+generate_warning345,13001
+:- pred should_attempt_accu_transform365,13886
+should_attempt_accu_transform370,14123
+:- pred should_attempt_accu_transform_2398,15406
+should_attempt_accu_transform_2405,15763
+:- pred accu_standardize440,17390
+accu_standardize442,17455
+:- pred identify_goal_type465,18169
+identify_goal_type469,18359
+:- pred is_recursive_case549,21175
+is_recursive_case551,21253
+:- type store_info560,21713
+:- func initialize_goal_store570,22060
+initialize_goal_store573,22166
+:- pred accu_store580,22421
+accu_store584,22576
+:- pred identify_recursive_calls601,23288
+identify_recursive_calls604,23406
+:- pred identify_out_and_out_prime626,24396
+identify_out_and_out_prime631,24631
+:- type accu_sets676,26425
+:- pred accu_stage1689,26977
+accu_stage1693,27155
+:- pred accu_stage1_2727,28347
+accu_stage1_2731,28515
+:- pred accu_sets_init781,30557
+accu_sets_init783,30605
+:- func set_upto796,30984
+set_upto798,31039
+:- pred accu_before812,31498
+accu_before815,31639
+:- pred accu_assoc835,32477
+accu_assoc838,32617
+:- pred accu_construct862,33712
+accu_construct865,33856
+:- pred accu_construct_assoc896,35307
+accu_construct_assoc899,35457
+:- pred accu_update938,37069
+accu_update941,37210
+:- pred member_lessthan_goalid964,38219
+member_lessthan_goalid967,38342
+:- type accu_assoc975,38652
+:- pred accu_is_associative986,39138
+accu_is_associative989,39250
+:- pred associativity_assertion1014,40263
+associativity_assertion1017,40404
+:- pred commutativity_assertion1037,41242
+commutativity_assertion1040,41369
+:- pred accu_is_update1057,41952
+accu_is_update1060,42066
+:- pred is_associative_construction1078,42802
+is_associative_construction1081,42898
+:- type accu_substs1095,43480
+:- type accu_base1103,43744
+:- pred accu_stage21124,44605
+accu_stage21131,44946
+:- pred accu_substs_init1179,46957
+accu_substs_init1182,47097
+:- pred acc_var_subst_init1194,47573
+acc_var_subst_init1198,47718
+:- pred create_new_var1207,48147
+create_new_var1210,48288
+:- pred accu_process_assoc_set1223,48862
+accu_process_assoc_set1229,49150
+:- pred accu_has_heuristic1297,52081
+accu_has_heuristic1299,52161
+:- pred accu_heuristic1304,52336
+accu_heuristic1307,52457
+:- pred accu_process_update_set1318,52906
+accu_process_update_set1325,53221
+:- pred accu_divide_base_case1380,55844
+accu_divide_base_case1385,56059
+:- pred accu_related1412,57146
+accu_related1415,57270
+:- inst stored_goal_plain_call1444,58415
+:- pred lookup_call1449,58601
+lookup_call1452,58715
+:- pred accu_stage31470,59432
+accu_stage31477,59826
+:- pred acc_proc_info1508,61326
+acc_proc_info1512,61485
+:- pred acc_pred_info1556,63449
+acc_pred_info1559,63597
+:- pred accu_create_goal1600,65285
+accu_create_goal1607,65628
+:- func create_acc_call1621,66400
+create_acc_call1625,66569
+:- pred create_orig_goal1634,66987
+create_orig_goal1638,67176
+:- pred create_acc_goal1662,68157
+create_acc_goal1667,68380
+:- func create_new_orig_recursive_goals1709,70225
+create_new_orig_recursive_goals1712,70368
+:- func create_new_recursive_goals1723,70918
+create_new_recursive_goals1727,71108
+:- func create_new_base_goals1738,71717
+create_new_base_goals1741,71831
+:- pred acc_unification1749,72156
+acc_unification1751,72225
+:- pred accu_top_level1766,72896
+accu_top_level1770,73058
+:- pred update_accumulator_pred1856,76290
+update_accumulator_pred1859,76411
+:- func accu_rename1876,77253
+accu_rename1879,77363
+:- func base_case_ids1889,77784
+base_case_ids1891,77846
+:- func base_case_ids_set1898,78048
+base_case_ids_set1900,78113
+:- func accu_goal_list1905,78269
+accu_goal_list1907,78349
+:- pred calculate_goal_info1916,78680
+calculate_goal_info1918,78753
+:- func chain_subst1932,79319
+chain_subst1934,79378
+:- pred chain_subst_21938,79482
+chain_subst_21941,79576
+:- some [T] pred unravel_univ1956,80060
+:- pragma foreign_export1957,80116
+unravel_univ1961,80340
c-src/c.c,76
T f(1,0
@@ -5160,13 +5315,13 @@ extern struct node *yylval;yylval306,6246
unsigned char parse_cell_or_range 309,6291
unsigned char parse_cell_or_range 311,6355
yylex FUN0(315,6405
-parse_cell_or_range FUN2(587,11771
-#define CK_ABS_R(671,13213
-#define CK_REL_R(675,13292
-#define CK_ABS_C(680,13421
-#define CK_REL_C(684,13500
-#define MAYBEREL(689,13629
-str_to_col FUN1(847,16830
+parse_cell_or_range FUN2(587,11772
+#define CK_ABS_R(671,13214
+#define CK_REL_R(675,13293
+#define CK_ABS_C(680,13422
+#define CK_REL_C(684,13501
+#define MAYBEREL(689,13630
+str_to_col FUN1(847,16831
y-src/parse.c,520
#define YYBISON 4,64
diff --git a/test/manual/etags/ETAGS.good_6 b/test/manual/etags/ETAGS.good_6
index 86df93afab1..75047951a8a 100644
--- a/test/manual/etags/ETAGS.good_6
+++ b/test/manual/etags/ETAGS.good_6
@@ -175,7 +175,7 @@ package body Truc.Bidule Truc.Bidule/b138,2153
protected body Bidule Bidule/b139,2181
protected body Machin_T Machin_T/b146,2281
-c-src/abbrev.c,3274
+c-src/abbrev.c,3055
Lisp_Object Vabbrev_table_name_list;43,1429
Lisp_Object Vglobal_abbrev_table;48,1574
Lisp_Object Vfundamental_mode_abbrev_table;52,1685
@@ -186,57 +186,53 @@ Lisp_Object Vabbrev_start_location_buffer;66,2046
Lisp_Object Vlast_abbrev;70,2155
Lisp_Object Vlast_abbrev_text;75,2324
int last_abbrev_point;79,2414
-Lisp_Object Vpre_abbrev_expand_hook,83,2487
-Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;83,2487
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,85,2551
-DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table85,2551
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,92,2743
-DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table92,2743
-DEFUN ("define-abbrev", Fdefine_abbrev,107,3124
-DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev107,3124
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,149,4443
-DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev149,4443
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,160,4814
-DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev160,4814
-DEFUN ("abbrev-symbol", Fabbrev_symbol,174,5282
-DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol174,5282
-DEFUN ("abbrev-expansion", Fabbrev_expansion,202,6246
-DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion202,6246
-DEFUN ("expand-abbrev", Fexpand_abbrev,218,6761
-DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev218,6761
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,389,11682
-DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev389,11682
-write_abbrev 426,12889
-describe_abbrev 445,13324
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,466,13839
-DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description466,13839
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,506,14995
-DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table506,14995
-syms_of_abbrev 540,16072
- DEFVAR_LISP ("abbrev-table-name-list"542,16092
- DEFVAR_LISP ("global-abbrev-table"548,16354
- DEFVAR_LISP ("fundamental-mode-abbrev-table"555,16676
- DEFVAR_LISP ("last-abbrev"561,17018
- DEFVAR_LISP ("last-abbrev-text"564,17141
- DEFVAR_INT ("last-abbrev-location"568,17299
- DEFVAR_LISP ("abbrev-start-location"575,17498
- DEFVAR_LISP ("abbrev-start-location-buffer"581,17775
- DEFVAR_PER_BUFFER ("local-abbrev-table"586,18039
- DEFVAR_BOOL ("abbrevs-changed"589,18182
- DEFVAR_BOOL ("abbrev-all-caps"594,18385
- DEFVAR_LISP ("pre-abbrev-expand-hook"598,18541
- DEFVAR_LISP ("abbrev-table-name-list",\1542,16092
- DEFVAR_LISP ("global-abbrev-table",\1548,16354
- DEFVAR_LISP ("fundamental-mode-abbrev-table",\1555,16676
- DEFVAR_LISP ("last-abbrev",\1561,17018
- DEFVAR_LISP ("last-abbrev-text",\1564,17141
- DEFVAR_INT ("last-abbrev-location",\1568,17299
- DEFVAR_LISP ("abbrev-start-location",\1575,17498
- DEFVAR_LISP ("abbrev-start-location-buffer",\1581,17775
- DEFVAR_PER_BUFFER ("local-abbrev-table",\1586,18039
- DEFVAR_BOOL ("abbrevs-changed",\1589,18182
- DEFVAR_BOOL ("abbrev-all-caps",\1594,18385
- DEFVAR_LISP ("pre-abbrev-expand-hook",\1598,18541
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,82,2440
+DEFUN ("make-abbrev-table", Fmake_abbrev_table,make-abbrev-table82,2440
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,89,2632
+DEFUN ("clear-abbrev-table", Fclear_abbrev_table,clear-abbrev-table89,2632
+DEFUN ("define-abbrev", Fdefine_abbrev,104,3013
+DEFUN ("define-abbrev", Fdefine_abbrev,define-abbrev104,3013
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,146,4332
+DEFUN ("define-global-abbrev", Fdefine_global_abbrev,define-global-abbrev146,4332
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,157,4703
+DEFUN ("define-mode-abbrev", Fdefine_mode_abbrev,define-mode-abbrev157,4703
+DEFUN ("abbrev-symbol", Fabbrev_symbol,171,5171
+DEFUN ("abbrev-symbol", Fabbrev_symbol,abbrev-symbol171,5171
+DEFUN ("abbrev-expansion", Fabbrev_expansion,199,6135
+DEFUN ("abbrev-expansion", Fabbrev_expansion,abbrev-expansion199,6135
+DEFUN ("expand-abbrev", Fexpand_abbrev,215,6650
+DEFUN ("expand-abbrev", Fexpand_abbrev,expand-abbrev215,6650
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,383,11495
+DEFUN ("unexpand-abbrev", Funexpand_abbrev,unexpand-abbrev383,11495
+write_abbrev 420,12702
+describe_abbrev 439,13137
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,460,13652
+DEFUN ("insert-abbrev-table-description", Finsert_abbrev_table_description,insert-abbrev-table-description460,13652
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,500,14808
+DEFUN ("define-abbrev-table", Fdefine_abbrev_table,define-abbrev-table500,14808
+syms_of_abbrev 534,15885
+ DEFVAR_LISP ("abbrev-table-name-list"536,15905
+ DEFVAR_LISP ("global-abbrev-table"542,16167
+ DEFVAR_LISP ("fundamental-mode-abbrev-table"549,16489
+ DEFVAR_LISP ("last-abbrev"555,16831
+ DEFVAR_LISP ("last-abbrev-text"558,16954
+ DEFVAR_INT ("last-abbrev-location"562,17112
+ DEFVAR_LISP ("abbrev-start-location"569,17311
+ DEFVAR_LISP ("abbrev-start-location-buffer"575,17588
+ DEFVAR_PER_BUFFER ("local-abbrev-table"580,17852
+ DEFVAR_BOOL ("abbrevs-changed"583,17995
+ DEFVAR_BOOL ("abbrev-all-caps"588,18198
+ DEFVAR_LISP ("abbrev-table-name-list",\1536,15905
+ DEFVAR_LISP ("global-abbrev-table",\1542,16167
+ DEFVAR_LISP ("fundamental-mode-abbrev-table",\1549,16489
+ DEFVAR_LISP ("last-abbrev",\1555,16831
+ DEFVAR_LISP ("last-abbrev-text",\1558,16954
+ DEFVAR_INT ("last-abbrev-location",\1562,17112
+ DEFVAR_LISP ("abbrev-start-location",\1569,17311
+ DEFVAR_LISP ("abbrev-start-location-buffer",\1575,17588
+ DEFVAR_PER_BUFFER ("local-abbrev-table",\1580,17852
+ DEFVAR_BOOL ("abbrevs-changed",\1583,17995
+ DEFVAR_BOOL ("abbrev-all-caps",\1588,18198
c-src/torture.c,197
(*tag1 tag118,452
@@ -1368,310 +1364,310 @@ make_lispy_position 5228,157391
toolkit_menubar_in_use 5456,163954
make_scroll_bar_position 5469,164322
make_lispy_event 5485,164968
-make_lispy_movement 6104,183532
-make_lispy_switch_frame 6131,184263
-make_lispy_focus_in 6137,184370
-make_lispy_focus_out 6145,184496
-parse_modifiers_uncached 6163,184946
-#define SINGLE_LETTER_MOD(6185,185466
-#undef SINGLE_LETTER_MOD6212,185907
-#define MULTI_LETTER_MOD(6214,185933
-#undef MULTI_LETTER_MOD6231,186401
-apply_modifiers_uncached 6273,187575
-static const char *const modifier_names[modifier_names6319,189194
-#define NUM_MOD_NAMES 6325,189400
-static Lisp_Object modifier_symbols;6327,189450
-lispy_modifier_list 6331,189587
-#define KEY_TO_CHAR(6353,190253
-parse_modifiers 6356,190329
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191518
-DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191518
-apply_modifiers 6422,192392
-reorder_modifiers 6491,194721
-modify_event_symbol 6536,196529
-DEFUN ("event-convert-list", Fevent_convert_list,6628,199245
-DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199245
-parse_solitary_modifier 6695,201136
-#define SINGLE_LETTER_MOD(6701,201259
-#define MULTI_LETTER_MOD(6705,201344
-#undef SINGLE_LETTER_MOD6763,202642
-#undef MULTI_LETTER_MOD6764,202667
-lucid_event_type_list_p 6775,202890
-get_input_pending 6814,203961
-record_asynch_buffer_change 6834,204580
-gobble_input 6872,205703
-tty_read_avail_input 6967,208311
-handle_async_input 7149,214040
-process_pending_signals 7165,214360
-unblock_input_to 7177,214646
-unblock_input 7200,215278
-totally_unblock_input 7209,215446
-handle_input_available_signal 7217,215530
-deliver_input_available_signal 7226,215701
-struct user_signal_info7235,215866
- int sig;7238,215916
- char *name;name7241,215957
- int npending;7244,216008
- struct user_signal_info *next;next7246,216025
-static struct user_signal_info *user_signals user_signals7250,216091
-add_user_signal 7253,216150
-handle_user_signal 7275,216599
-deliver_user_signal 7316,217559
-find_user_signal_name 7322,217660
-store_user_signal_events 7334,217842
-static void menu_bar_item 7362,218342
-static Lisp_Object menu_bar_one_keymap_changed_items;7363,218417
-static Lisp_Object menu_bar_items_vector;7368,218631
-static int menu_bar_items_index;7369,218673
-static const char *separator_names[separator_names7372,218708
-menu_separator_name_p 7393,219149
-menu_bar_items 7426,219853
-Lisp_Object item_properties;7568,224604
-menu_bar_item 7571,224646
-menu_item_eval_property_1 7647,227176
-eval_dyn 7658,227466
-menu_item_eval_property 7666,227676
-parse_menu_item 7686,228342
-static Lisp_Object tool_bar_items_vector;7965,236337
-static Lisp_Object tool_bar_item_properties;7970,236511
-static int ntool_bar_items;7974,236607
-static void init_tool_bar_items 7978,236665
-static void process_tool_bar_item 7979,236712
-static bool parse_tool_bar_item 7981,236802
-static void append_tool_bar_item 7982,236862
-tool_bar_items 7990,237084
-process_tool_bar_item 8075,239893
-#define PROP(8112,240970
-set_prop 8114,241039
-parse_tool_bar_item 8167,242454
-#undef PROP8379,248845
-init_tool_bar_items 8387,248970
-append_tool_bar_item 8401,249262
-read_char_x_menu_prompt 8443,250772
-read_char_minibuf_menu_prompt 8503,252446
-#define PUSH_C_STR(8527,253015
-follow_key 8726,258554
-active_maps 8733,258696
-typedef struct keyremap8742,259022
- Lisp_Object parent;8745,259108
- Lisp_Object map;8748,259225
- int start,8753,259447
- int start, end;8753,259447
-} keyremap;8754,259465
-access_keymap_keyremap 8764,259809
-keyremap_step 8811,261451
-test_undefined 8867,262935
-read_key_sequence 8916,264862
-read_key_sequence_vs 9826,295822
-DEFUN ("read-key-sequence", Fread_key_sequence,9885,297295
-DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297295
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299983
-DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299983
-detect_input_pending 9950,300489
-detect_input_pending_ignore_squeezables 9959,300655
-detect_input_pending_run_timers 9967,300871
-clear_input_pending 9985,301363
-requeued_events_pending_p 9997,301733
-DEFUN ("input-pending-p", Finput_pending_p,10002,301814
-DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301814
-DEFUN ("recent-keys", Frecent_keys,10024,302597
-DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302597
-DEFUN ("this-command-keys", Fthis_command_keys,10055,303518
-DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303518
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303959
-DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303959
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304381
-DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304381
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304956
-DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304956
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305496
-DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305496
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306511
-DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306511
-DEFUN ("recursion-depth", Frecursion_depth,10158,307070
-DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307070
-DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307407
-DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307407
-DEFUN ("discard-input", Fdiscard_input,10203,308448
-DEFUN ("discard-input", Fdiscard_input,discard-input10203,308448
-DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308950
-DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308950
-stuff_buffered_input 10285,311046
-set_waiting_for_input 10323,312017
-clear_waiting_for_input 10337,312391
-handle_interrupt_signal 10351,312755
-deliver_interrupt_signal 10378,313643
-static int volatile force_quit_count;10387,313933
-handle_interrupt 10401,314415
-quit_throw_to_read_char 10541,318712
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319289
-DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319289
-DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320517
-DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320517
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321433
-DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321433
-DEFUN ("set-quit-char", Fset_quit_char,10694,322707
-DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322707
-DEFUN ("set-input-mode", Fset_input_mode,10729,323571
-DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323571
-DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324460
-DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324460
-DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325838
-DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325838
-DEFUN ("posn-at-point", Fposn_at_point,10824,327061
-DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327061
-init_kboard 10861,328215
-allocate_kboard 10893,329285
-wipe_kboard 10909,329638
-delete_kboard 10917,329752
-init_keyboard 10942,330282
-struct event_head11021,332697
- short var;11023,332717
- short kind;11024,332730
-static const struct event_head head_table[head_table11027,332748
-syms_of_keyboard 11045,333578
- DEFVAR_LISP ("internal--top-level-message"11058,333973
- DEFVAR_LISP ("last-command-event"11312,342174
- DEFVAR_LISP ("last-nonmenu-event"11315,342298
- DEFVAR_LISP ("last-input-event"11321,342637
- DEFVAR_LISP ("unread-command-events"11324,342731
- DEFVAR_LISP ("unread-post-input-method-events"11332,343191
- DEFVAR_LISP ("unread-input-method-events"11338,343530
- DEFVAR_LISP ("meta-prefix-char"11346,343899
- DEFVAR_KBOARD ("last-command"11351,344107
- DEFVAR_KBOARD ("real-last-command"11368,344788
- DEFVAR_KBOARD ("last-repeatable-command"11372,344974
- DEFVAR_LISP ("this-command"11378,345262
- DEFVAR_LISP ("real-this-command"11384,345499
- DEFVAR_LISP ("this-command-keys-shift-translated"11388,345681
- DEFVAR_LISP ("this-original-command"11396,346124
- DEFVAR_INT ("auto-save-interval"11403,346521
- DEFVAR_LISP ("auto-save-timeout"11408,346735
- DEFVAR_LISP ("echo-keystrokes"11415,347080
- DEFVAR_INT ("polling-period"11421,347351
- DEFVAR_LISP ("double-click-time"11428,347694
- DEFVAR_INT ("double-click-fuzz"11435,348030
- DEFVAR_INT ("num-input-keys"11446,348520
- DEFVAR_INT ("num-nonmacro-input-events"11452,348795
- DEFVAR_LISP ("last-event-frame"11457,349033
- DEFVAR_LISP ("tty-erase-char"11463,349312
- DEFVAR_LISP ("help-char"11466,349435
- DEFVAR_LISP ("help-event-list"11472,349718
- DEFVAR_LISP ("help-form"11477,349929
- DEFVAR_LISP ("prefix-help-command"11483,350177
- DEFVAR_LISP ("top-level"11489,350455
- DEFVAR_KBOARD ("keyboard-translate-table"11495,350676
- DEFVAR_BOOL ("cannot-suspend"11511,351489
- DEFVAR_BOOL ("menu-prompting"11516,351716
- DEFVAR_LISP ("menu-prompt-more-char"11526,352146
- DEFVAR_INT ("extra-keyboard-modifiers"11531,352392
- DEFVAR_LISP ("deactivate-mark"11545,353118
- DEFVAR_LISP ("pre-command-hook"11553,353487
- DEFVAR_LISP ("post-command-hook"11560,353842
- DEFVAR_LISP ("echo-area-clear-hook"11568,354205
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag"11574,354420
- DEFVAR_LISP ("menu-bar-final-items"11578,354623
- DEFVAR_LISP ("tool-bar-separator-image-expression"11583,354873
- DEFVAR_KBOARD ("overriding-terminal-local-map"11589,355231
- DEFVAR_LISP ("overriding-local-map"11598,355653
- DEFVAR_LISP ("overriding-local-map-menu-flag"11607,356104
- DEFVAR_LISP ("special-event-map"11613,356443
- DEFVAR_LISP ("track-mouse"11617,356631
- DEFVAR_KBOARD ("system-key-alist"11620,356758
- DEFVAR_KBOARD ("local-function-key-map"11629,357139
- DEFVAR_KBOARD ("input-decode-map"11658,358598
- DEFVAR_LISP ("function-key-map"11675,359386
- DEFVAR_LISP ("key-translation-map"11683,359802
- DEFVAR_LISP ("deferred-action-list"11689,360146
- DEFVAR_LISP ("deferred-action-function"11694,360394
- DEFVAR_LISP ("delayed-warnings-list"11700,360693
- DEFVAR_LISP ("timer-list"11708,361101
- DEFVAR_LISP ("timer-idle-list"11712,361253
- DEFVAR_LISP ("input-method-function"11716,361416
- DEFVAR_LISP ("input-method-previous-message"11737,362385
- DEFVAR_LISP ("show-help-function"11744,362746
- DEFVAR_LISP ("disable-point-adjustment"11749,362978
- DEFVAR_LISP ("global-disable-point-adjustment"11761,363528
- DEFVAR_LISP ("minibuffer-message-timeout"11770,363894
- DEFVAR_LISP ("throw-on-input"11775,364172
- DEFVAR_LISP ("command-error-function"11781,364423
- DEFVAR_LISP ("enable-disabled-menus-and-buttons"11790,364910
- DEFVAR_LISP ("select-active-regions"11798,365237
- DEFVAR_LISP ("saved-region-selection"11807,365629
- DEFVAR_LISP ("selection-inhibit-update-commands"11815,366014
- DEFVAR_LISP ("debug-on-event"11825,366555
-keys_of_keyboard 11841,367116
-mark_kboards 11916,370435
- DEFVAR_LISP ("internal--top-level-message",\111058,333973
- DEFVAR_LISP ("last-command-event",\111312,342174
- DEFVAR_LISP ("last-nonmenu-event",\111315,342298
- DEFVAR_LISP ("last-input-event",\111321,342637
- DEFVAR_LISP ("unread-command-events",\111324,342731
- DEFVAR_LISP ("unread-post-input-method-events",\111332,343191
- DEFVAR_LISP ("unread-input-method-events",\111338,343530
- DEFVAR_LISP ("meta-prefix-char",\111346,343899
- DEFVAR_KBOARD ("last-command",\111351,344107
- DEFVAR_KBOARD ("real-last-command",\111368,344788
- DEFVAR_KBOARD ("last-repeatable-command",\111372,344974
- DEFVAR_LISP ("this-command",\111378,345262
- DEFVAR_LISP ("real-this-command",\111384,345499
- DEFVAR_LISP ("this-command-keys-shift-translated",\111388,345681
- DEFVAR_LISP ("this-original-command",\111396,346124
- DEFVAR_INT ("auto-save-interval",\111403,346521
- DEFVAR_LISP ("auto-save-timeout",\111408,346735
- DEFVAR_LISP ("echo-keystrokes",\111415,347080
- DEFVAR_INT ("polling-period",\111421,347351
- DEFVAR_LISP ("double-click-time",\111428,347694
- DEFVAR_INT ("double-click-fuzz",\111435,348030
- DEFVAR_INT ("num-input-keys",\111446,348520
- DEFVAR_INT ("num-nonmacro-input-events",\111452,348795
- DEFVAR_LISP ("last-event-frame",\111457,349033
- DEFVAR_LISP ("tty-erase-char",\111463,349312
- DEFVAR_LISP ("help-char",\111466,349435
- DEFVAR_LISP ("help-event-list",\111472,349718
- DEFVAR_LISP ("help-form",\111477,349929
- DEFVAR_LISP ("prefix-help-command",\111483,350177
- DEFVAR_LISP ("top-level",\111489,350455
- DEFVAR_KBOARD ("keyboard-translate-table",\111495,350676
- DEFVAR_BOOL ("cannot-suspend",\111511,351489
- DEFVAR_BOOL ("menu-prompting",\111516,351716
- DEFVAR_LISP ("menu-prompt-more-char",\111526,352146
- DEFVAR_INT ("extra-keyboard-modifiers",\111531,352392
- DEFVAR_LISP ("deactivate-mark",\111545,353118
- DEFVAR_LISP ("pre-command-hook",\111553,353487
- DEFVAR_LISP ("post-command-hook",\111560,353842
- DEFVAR_LISP ("echo-area-clear-hook",\111568,354205
- DEFVAR_LISP ("lucid-menu-bar-dirty-flag",\111574,354420
- DEFVAR_LISP ("menu-bar-final-items",\111578,354623
- DEFVAR_LISP ("tool-bar-separator-image-expression",\111583,354873
- DEFVAR_KBOARD ("overriding-terminal-local-map",\111589,355231
- DEFVAR_LISP ("overriding-local-map",\111598,355653
- DEFVAR_LISP ("overriding-local-map-menu-flag",\111607,356104
- DEFVAR_LISP ("special-event-map",\111613,356443
- DEFVAR_LISP ("track-mouse",\111617,356631
- DEFVAR_KBOARD ("system-key-alist",\111620,356758
- DEFVAR_KBOARD ("local-function-key-map",\111629,357139
- DEFVAR_KBOARD ("input-decode-map",\111658,358598
- DEFVAR_LISP ("function-key-map",\111675,359386
- DEFVAR_LISP ("key-translation-map",\111683,359802
- DEFVAR_LISP ("deferred-action-list",\111689,360146
- DEFVAR_LISP ("deferred-action-function",\111694,360394
- DEFVAR_LISP ("delayed-warnings-list",\111700,360693
- DEFVAR_LISP ("timer-list",\111708,361101
- DEFVAR_LISP ("timer-idle-list",\111712,361253
- DEFVAR_LISP ("input-method-function",\111716,361416
- DEFVAR_LISP ("input-method-previous-message",\111737,362385
- DEFVAR_LISP ("show-help-function",\111744,362746
- DEFVAR_LISP ("disable-point-adjustment",\111749,362978
- DEFVAR_LISP ("global-disable-point-adjustment",\111761,363528
- DEFVAR_LISP ("minibuffer-message-timeout",\111770,363894
- DEFVAR_LISP ("throw-on-input",\111775,364172
- DEFVAR_LISP ("command-error-function",\111781,364423
- DEFVAR_LISP ("enable-disabled-menus-and-buttons",\111790,364910
- DEFVAR_LISP ("select-active-regions",\111798,365237
- DEFVAR_LISP ("saved-region-selection",\111807,365629
- DEFVAR_LISP ("selection-inhibit-update-commands",\111815,366014
- DEFVAR_LISP ("debug-on-event",\111825,366555
+make_lispy_movement 6104,183531
+make_lispy_switch_frame 6131,184262
+make_lispy_focus_in 6137,184369
+make_lispy_focus_out 6145,184495
+parse_modifiers_uncached 6163,184945
+#define SINGLE_LETTER_MOD(6185,185465
+#undef SINGLE_LETTER_MOD6212,185906
+#define MULTI_LETTER_MOD(6214,185932
+#undef MULTI_LETTER_MOD6231,186400
+apply_modifiers_uncached 6273,187574
+static const char *const modifier_names[modifier_names6319,189193
+#define NUM_MOD_NAMES 6325,189399
+static Lisp_Object modifier_symbols;6327,189449
+lispy_modifier_list 6331,189586
+#define KEY_TO_CHAR(6353,190252
+parse_modifiers 6356,190328
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,6399,191517
+DEFUN ("internal-event-symbol-parse-modifiers", Fevent_symbol_parse_modifiers,event-symbol-parse-modifiers6399,191517
+apply_modifiers 6422,192391
+reorder_modifiers 6491,194720
+modify_event_symbol 6536,196528
+DEFUN ("event-convert-list", Fevent_convert_list,6628,199244
+DEFUN ("event-convert-list", Fevent_convert_list,event-convert-list6628,199244
+parse_solitary_modifier 6695,201135
+#define SINGLE_LETTER_MOD(6701,201258
+#define MULTI_LETTER_MOD(6705,201343
+#undef SINGLE_LETTER_MOD6763,202641
+#undef MULTI_LETTER_MOD6764,202666
+lucid_event_type_list_p 6775,202889
+get_input_pending 6814,203960
+record_asynch_buffer_change 6834,204579
+gobble_input 6872,205702
+tty_read_avail_input 6967,208310
+handle_async_input 7149,214039
+process_pending_signals 7165,214359
+unblock_input_to 7177,214645
+unblock_input 7200,215277
+totally_unblock_input 7209,215445
+handle_input_available_signal 7217,215529
+deliver_input_available_signal 7226,215700
+struct user_signal_info7235,215865
+ int sig;7238,215915
+ char *name;name7241,215956
+ int npending;7244,216007
+ struct user_signal_info *next;next7246,216024
+static struct user_signal_info *user_signals user_signals7250,216090
+add_user_signal 7253,216149
+handle_user_signal 7275,216598
+deliver_user_signal 7316,217558
+find_user_signal_name 7322,217659
+store_user_signal_events 7334,217841
+static void menu_bar_item 7362,218341
+static Lisp_Object menu_bar_one_keymap_changed_items;7363,218416
+static Lisp_Object menu_bar_items_vector;7368,218630
+static int menu_bar_items_index;7369,218672
+static const char *separator_names[separator_names7372,218707
+menu_separator_name_p 7393,219148
+menu_bar_items 7426,219852
+Lisp_Object item_properties;7568,224603
+menu_bar_item 7571,224645
+menu_item_eval_property_1 7647,227175
+eval_dyn 7658,227465
+menu_item_eval_property 7666,227675
+parse_menu_item 7686,228341
+static Lisp_Object tool_bar_items_vector;7965,236336
+static Lisp_Object tool_bar_item_properties;7970,236510
+static int ntool_bar_items;7974,236606
+static void init_tool_bar_items 7978,236664
+static void process_tool_bar_item 7979,236711
+static bool parse_tool_bar_item 7981,236801
+static void append_tool_bar_item 7982,236861
+tool_bar_items 7990,237083
+process_tool_bar_item 8075,239892
+#define PROP(8112,240969
+set_prop 8114,241038
+parse_tool_bar_item 8167,242453
+#undef PROP8379,248844
+init_tool_bar_items 8387,248969
+append_tool_bar_item 8401,249261
+read_char_x_menu_prompt 8443,250771
+read_char_minibuf_menu_prompt 8503,252445
+#define PUSH_C_STR(8527,253014
+follow_key 8726,258553
+active_maps 8733,258695
+typedef struct keyremap8742,259021
+ Lisp_Object parent;8745,259107
+ Lisp_Object map;8748,259224
+ int start,8753,259446
+ int start, end;8753,259446
+} keyremap;8754,259464
+access_keymap_keyremap 8764,259808
+keyremap_step 8811,261450
+test_undefined 8867,262934
+read_key_sequence 8916,264861
+read_key_sequence_vs 9826,295821
+DEFUN ("read-key-sequence", Fread_key_sequence,9885,297294
+DEFUN ("read-key-sequence", Fread_key_sequence,read-key-sequence9885,297294
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,9938,299982
+DEFUN ("read-key-sequence-vector", Fread_key_sequence_vector,read-key-sequence-vector9938,299982
+detect_input_pending 9950,300488
+detect_input_pending_ignore_squeezables 9959,300654
+detect_input_pending_run_timers 9967,300870
+clear_input_pending 9985,301362
+requeued_events_pending_p 9997,301732
+DEFUN ("input-pending-p", Finput_pending_p,10002,301813
+DEFUN ("input-pending-p", Finput_pending_p,input-pending-p10002,301813
+DEFUN ("recent-keys", Frecent_keys,10024,302596
+DEFUN ("recent-keys", Frecent_keys,recent-keys10024,302596
+DEFUN ("this-command-keys", Fthis_command_keys,10055,303517
+DEFUN ("this-command-keys", Fthis_command_keys,this-command-keys10055,303517
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,10068,303958
+DEFUN ("this-command-keys-vector", Fthis_command_keys_vector,this-command-keys-vector10068,303958
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,10080,304380
+DEFUN ("this-single-command-keys", Fthis_single_command_keys,this-single-command-keys10080,304380
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,10096,304955
+DEFUN ("this-single-command-raw-keys", Fthis_single_command_raw_keys,this-single-command-raw-keys10096,304955
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,10109,305495
+DEFUN ("reset-this-command-lengths", Freset_this_command_lengths,reset-this-command-lengths10109,305495
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,10136,306510
+DEFUN ("clear-this-command-keys", Fclear_this_command_keys,clear-this-command-keys10136,306510
+DEFUN ("recursion-depth", Frecursion_depth,10158,307069
+DEFUN ("recursion-depth", Frecursion_depth,recursion-depth10158,307069
+DEFUN ("open-dribble-file", Fopen_dribble_file,10169,307406
+DEFUN ("open-dribble-file", Fopen_dribble_file,open-dribble-file10169,307406
+DEFUN ("discard-input", Fdiscard_input,10203,308447
+DEFUN ("discard-input", Fdiscard_input,discard-input10203,308447
+DEFUN ("suspend-emacs", Fsuspend_emacs,10225,308949
+DEFUN ("suspend-emacs", Fsuspend_emacs,suspend-emacs10225,308949
+stuff_buffered_input 10285,311045
+set_waiting_for_input 10323,312016
+clear_waiting_for_input 10337,312390
+handle_interrupt_signal 10351,312754
+deliver_interrupt_signal 10378,313642
+static int volatile force_quit_count;10387,313932
+handle_interrupt 10401,314414
+quit_throw_to_read_char 10541,318711
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,10562,319288
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode,set-input-interrupt-mode10562,319288
+DEFUN ("set-output-flow-control", Fset_output_flow_control,10609,320516
+DEFUN ("set-output-flow-control", Fset_output_flow_control,set-output-flow-control10609,320516
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,10643,321432
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode,set-input-meta-mode10643,321432
+DEFUN ("set-quit-char", Fset_quit_char,10694,322706
+DEFUN ("set-quit-char", Fset_quit_char,set-quit-char10694,322706
+DEFUN ("set-input-mode", Fset_input_mode,10729,323570
+DEFUN ("set-input-mode", Fset_input_mode,set-input-mode10729,323570
+DEFUN ("current-input-mode", Fcurrent_input_mode,10750,324459
+DEFUN ("current-input-mode", Fcurrent_input_mode,current-input-mode10750,324459
+DEFUN ("posn-at-x-y", Fposn_at_x_y,10787,325837
+DEFUN ("posn-at-x-y", Fposn_at_x_y,posn-at-x-y10787,325837
+DEFUN ("posn-at-point", Fposn_at_point,10824,327060
+DEFUN ("posn-at-point", Fposn_at_point,posn-at-point10824,327060
+init_kboard 10861,328214
+allocate_kboard 10893,329284
+wipe_kboard 10909,329637
+delete_kboard 10917,329751
+init_keyboard 10942,330281
+struct event_head11021,332696
+ short var;11023,332716
+ short kind;11024,332729
+static const struct event_head head_table[head_table11027,332747
+syms_of_keyboard 11045,333577
+ DEFVAR_LISP ("internal--top-level-message"11058,333972
+ DEFVAR_LISP ("last-command-event"11312,342173
+ DEFVAR_LISP ("last-nonmenu-event"11315,342297
+ DEFVAR_LISP ("last-input-event"11321,342636
+ DEFVAR_LISP ("unread-command-events"11324,342730
+ DEFVAR_LISP ("unread-post-input-method-events"11332,343190
+ DEFVAR_LISP ("unread-input-method-events"11338,343529
+ DEFVAR_LISP ("meta-prefix-char"11346,343898
+ DEFVAR_KBOARD ("last-command"11351,344106
+ DEFVAR_KBOARD ("real-last-command"11368,344787
+ DEFVAR_KBOARD ("last-repeatable-command"11372,344973
+ DEFVAR_LISP ("this-command"11378,345261
+ DEFVAR_LISP ("real-this-command"11384,345498
+ DEFVAR_LISP ("this-command-keys-shift-translated"11388,345680
+ DEFVAR_LISP ("this-original-command"11396,346123
+ DEFVAR_INT ("auto-save-interval"11403,346520
+ DEFVAR_LISP ("auto-save-timeout"11408,346734
+ DEFVAR_LISP ("echo-keystrokes"11415,347079
+ DEFVAR_INT ("polling-period"11421,347350
+ DEFVAR_LISP ("double-click-time"11428,347693
+ DEFVAR_INT ("double-click-fuzz"11435,348029
+ DEFVAR_INT ("num-input-keys"11446,348519
+ DEFVAR_INT ("num-nonmacro-input-events"11452,348794
+ DEFVAR_LISP ("last-event-frame"11457,349032
+ DEFVAR_LISP ("tty-erase-char"11463,349311
+ DEFVAR_LISP ("help-char"11466,349434
+ DEFVAR_LISP ("help-event-list"11472,349717
+ DEFVAR_LISP ("help-form"11477,349928
+ DEFVAR_LISP ("prefix-help-command"11483,350176
+ DEFVAR_LISP ("top-level"11489,350454
+ DEFVAR_KBOARD ("keyboard-translate-table"11495,350675
+ DEFVAR_BOOL ("cannot-suspend"11511,351488
+ DEFVAR_BOOL ("menu-prompting"11516,351715
+ DEFVAR_LISP ("menu-prompt-more-char"11526,352145
+ DEFVAR_INT ("extra-keyboard-modifiers"11531,352391
+ DEFVAR_LISP ("deactivate-mark"11545,353117
+ DEFVAR_LISP ("pre-command-hook"11553,353486
+ DEFVAR_LISP ("post-command-hook"11560,353841
+ DEFVAR_LISP ("echo-area-clear-hook"11568,354204
+ DEFVAR_LISP ("lucid-menu-bar-dirty-flag"11574,354419
+ DEFVAR_LISP ("menu-bar-final-items"11578,354622
+ DEFVAR_LISP ("tool-bar-separator-image-expression"11583,354872
+ DEFVAR_KBOARD ("overriding-terminal-local-map"11589,355230
+ DEFVAR_LISP ("overriding-local-map"11598,355652
+ DEFVAR_LISP ("overriding-local-map-menu-flag"11607,356103
+ DEFVAR_LISP ("special-event-map"11613,356442
+ DEFVAR_LISP ("track-mouse"11617,356630
+ DEFVAR_KBOARD ("system-key-alist"11620,356757
+ DEFVAR_KBOARD ("local-function-key-map"11629,357138
+ DEFVAR_KBOARD ("input-decode-map"11658,358597
+ DEFVAR_LISP ("function-key-map"11675,359385
+ DEFVAR_LISP ("key-translation-map"11683,359801
+ DEFVAR_LISP ("deferred-action-list"11689,360145
+ DEFVAR_LISP ("deferred-action-function"11694,360393
+ DEFVAR_LISP ("delayed-warnings-list"11700,360692
+ DEFVAR_LISP ("timer-list"11708,361100
+ DEFVAR_LISP ("timer-idle-list"11712,361252
+ DEFVAR_LISP ("input-method-function"11716,361415
+ DEFVAR_LISP ("input-method-previous-message"11737,362384
+ DEFVAR_LISP ("show-help-function"11744,362745
+ DEFVAR_LISP ("disable-point-adjustment"11749,362977
+ DEFVAR_LISP ("global-disable-point-adjustment"11761,363527
+ DEFVAR_LISP ("minibuffer-message-timeout"11770,363893
+ DEFVAR_LISP ("throw-on-input"11775,364171
+ DEFVAR_LISP ("command-error-function"11781,364422
+ DEFVAR_LISP ("enable-disabled-menus-and-buttons"11790,364909
+ DEFVAR_LISP ("select-active-regions"11798,365236
+ DEFVAR_LISP ("saved-region-selection"11807,365628
+ DEFVAR_LISP ("selection-inhibit-update-commands"11815,366013
+ DEFVAR_LISP ("debug-on-event"11825,366554
+keys_of_keyboard 11841,367115
+mark_kboards 11916,370434
+ DEFVAR_LISP ("internal--top-level-message",\111058,333972
+ DEFVAR_LISP ("last-command-event",\111312,342173
+ DEFVAR_LISP ("last-nonmenu-event",\111315,342297
+ DEFVAR_LISP ("last-input-event",\111321,342636
+ DEFVAR_LISP ("unread-command-events",\111324,342730
+ DEFVAR_LISP ("unread-post-input-method-events",\111332,343190
+ DEFVAR_LISP ("unread-input-method-events",\111338,343529
+ DEFVAR_LISP ("meta-prefix-char",\111346,343898
+ DEFVAR_KBOARD ("last-command",\111351,344106
+ DEFVAR_KBOARD ("real-last-command",\111368,344787
+ DEFVAR_KBOARD ("last-repeatable-command",\111372,344973
+ DEFVAR_LISP ("this-command",\111378,345261
+ DEFVAR_LISP ("real-this-command",\111384,345498
+ DEFVAR_LISP ("this-command-keys-shift-translated",\111388,345680
+ DEFVAR_LISP ("this-original-command",\111396,346123
+ DEFVAR_INT ("auto-save-interval",\111403,346520
+ DEFVAR_LISP ("auto-save-timeout",\111408,346734
+ DEFVAR_LISP ("echo-keystrokes",\111415,347079
+ DEFVAR_INT ("polling-period",\111421,347350
+ DEFVAR_LISP ("double-click-time",\111428,347693
+ DEFVAR_INT ("double-click-fuzz",\111435,348029
+ DEFVAR_INT ("num-input-keys",\111446,348519
+ DEFVAR_INT ("num-nonmacro-input-events",\111452,348794
+ DEFVAR_LISP ("last-event-frame",\111457,349032
+ DEFVAR_LISP ("tty-erase-char",\111463,349311
+ DEFVAR_LISP ("help-char",\111466,349434
+ DEFVAR_LISP ("help-event-list",\111472,349717
+ DEFVAR_LISP ("help-form",\111477,349928
+ DEFVAR_LISP ("prefix-help-command",\111483,350176
+ DEFVAR_LISP ("top-level",\111489,350454
+ DEFVAR_KBOARD ("keyboard-translate-table",\111495,350675
+ DEFVAR_BOOL ("cannot-suspend",\111511,351488
+ DEFVAR_BOOL ("menu-prompting",\111516,351715
+ DEFVAR_LISP ("menu-prompt-more-char",\111526,352145
+ DEFVAR_INT ("extra-keyboard-modifiers",\111531,352391
+ DEFVAR_LISP ("deactivate-mark",\111545,353117
+ DEFVAR_LISP ("pre-command-hook",\111553,353486
+ DEFVAR_LISP ("post-command-hook",\111560,353841
+ DEFVAR_LISP ("echo-area-clear-hook",\111568,354204
+ DEFVAR_LISP ("lucid-menu-bar-dirty-flag",\111574,354419
+ DEFVAR_LISP ("menu-bar-final-items",\111578,354622
+ DEFVAR_LISP ("tool-bar-separator-image-expression",\111583,354872
+ DEFVAR_KBOARD ("overriding-terminal-local-map",\111589,355230
+ DEFVAR_LISP ("overriding-local-map",\111598,355652
+ DEFVAR_LISP ("overriding-local-map-menu-flag",\111607,356103
+ DEFVAR_LISP ("special-event-map",\111613,356442
+ DEFVAR_LISP ("track-mouse",\111617,356630
+ DEFVAR_KBOARD ("system-key-alist",\111620,356757
+ DEFVAR_KBOARD ("local-function-key-map",\111629,357138
+ DEFVAR_KBOARD ("input-decode-map",\111658,358597
+ DEFVAR_LISP ("function-key-map",\111675,359385
+ DEFVAR_LISP ("key-translation-map",\111683,359801
+ DEFVAR_LISP ("deferred-action-list",\111689,360145
+ DEFVAR_LISP ("deferred-action-function",\111694,360393
+ DEFVAR_LISP ("delayed-warnings-list",\111700,360692
+ DEFVAR_LISP ("timer-list",\111708,361100
+ DEFVAR_LISP ("timer-idle-list",\111712,361252
+ DEFVAR_LISP ("input-method-function",\111716,361415
+ DEFVAR_LISP ("input-method-previous-message",\111737,362384
+ DEFVAR_LISP ("show-help-function",\111744,362745
+ DEFVAR_LISP ("disable-point-adjustment",\111749,362977
+ DEFVAR_LISP ("global-disable-point-adjustment",\111761,363527
+ DEFVAR_LISP ("minibuffer-message-timeout",\111770,363893
+ DEFVAR_LISP ("throw-on-input",\111775,364171
+ DEFVAR_LISP ("command-error-function",\111781,364422
+ DEFVAR_LISP ("enable-disabled-menus-and-buttons",\111790,364909
+ DEFVAR_LISP ("select-active-regions",\111798,365236
+ DEFVAR_LISP ("saved-region-selection",\111807,365628
+ DEFVAR_LISP ("selection-inhibit-update-commands",\111815,366013
+ DEFVAR_LISP ("debug-on-event",\111825,366554
c-src/emacs/src/lisp.h,41391
#define EMACS_LISP_H22,801
@@ -3253,11 +3249,11 @@ main(37,571
D(D::D43,659
int x;D::x44,694
-el-src/TAGTEST.EL,179
-(foo::defmumble bletch 1,0
-(defun foo==bar foo==bar2,33
-(defalias 'pending-delete-mode pending-delete-mode6,149
-(defalias (quote explicitly-quoted-pending-delete-mode)9,222
+el-src/TAGTEST.EL,181
+(foo::defmumble bletch 3,33
+(defun foo==bar foo==bar4,66
+(defalias 'pending-delete-mode pending-delete-mode8,182
+(defalias (quote explicitly-quoted-pending-delete-mode)11,255
el-src/emacs/lisp/progmodes/etags.el,5188
(defvar tags-file-name 34,1035
@@ -4050,22 +4046,22 @@ ord_add_element(71,1867
ord_del_element(85,2344
ord_disjoint(100,2783
ord_intersect(108,2953
-ord_intersection(126,3552
-ord_intersection3(130,3691
-ord_intersection(150,4531
-ord_intersection4(154,4703
-ord_intersection(176,5664
-ord_intersection2(181,5812
-ord_member(200,6318
-ord_seteq(216,6683
-ord_setproduct(225,6971
-ord_subset(240,7377
-ord_subtract(257,7861
-ord_symdiff(265,8054
-ord_union(288,8887
-ord_union4(303,9352
-ord_union(324,10171
-ord_union_all(329,10313
+ord_intersection(126,3553
+ord_intersection3(130,3692
+ord_intersection(150,4533
+ord_intersection4(154,4705
+ord_intersection(176,5666
+ord_intersection2(181,5814
+ord_member(200,6320
+ord_seteq(216,6685
+ord_setproduct(225,6973
+ord_subset(240,7379
+ord_subtract(257,7863
+ord_symdiff(265,8056
+ord_union(288,8889
+ord_union4(303,9354
+ord_union(324,10173
+ord_union_all(329,10315
prol-src/natded.prolog,2319
expandmng(100,2879
@@ -4280,6 +4276,11 @@ module A9,57
alias_method ( :foo2,foo237,586
A::Constant Constant42,655
+rs-src/test.rs,52
+enum IpAddrKind 3,11
+fn test1(8,48
+fn main(12,88
+
scm-src/test.scm,260
(define hello 1,0
(set! hello 3,32
@@ -4494,533 +4495,687 @@ tex-src/texinfo.tex,30627
\def\vritemindex #1{\vritemindex1068,35482
\def\tablez #1#2#3#4#5#6{\tablez1074,35631
\def\Edescription{\Edescription1077,35689
-\def\itemfont{\itemfont1082,35891
-\def\Etable{\Etable1090,36117
-\def\itemize{\itemize1103,36441
-\def\itemizezzz #1{\itemizezzz1105,36477
-\def\itemizey #1#2{\itemizey1110,36572
-\def#2{1119,36818
-\def\itemcontents{\itemcontents1120,36859
-\def\bullet{\bullet1123,36907
-\def\minus{\minus1124,36934
-\def\frenchspacing{\frenchspacing1128,37042
-\def\splitoff#1#2\endmark{\splitoff1134,37267
-\def\enumerate{\enumerate1140,37497
-\def\enumeratezzz #1{\enumeratezzz1141,37536
-\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37589
- \def\thearg{\thearg1146,37736
- \ifx\thearg\empty \def\thearg{\thearg1147,37755
-\def\numericenumerate{\numericenumerate1184,39089
-\def\lowercaseenumerate{\lowercaseenumerate1190,39219
-\def\uppercaseenumerate{\uppercaseenumerate1203,39566
-\def\startenumeration#1{\startenumeration1219,40056
-\def\alphaenumerate{\alphaenumerate1227,40238
-\def\capsenumerate{\capsenumerate1228,40273
-\def\Ealphaenumerate{\Ealphaenumerate1229,40307
-\def\Ecapsenumerate{\Ecapsenumerate1230,40341
-\def\itemizeitem{\itemizeitem1234,40421
-\def\newindex #1{\newindex1259,41278
-\def\defindex{\defindex1268,41567
-\def\newcodeindex #1{\newcodeindex1272,41675
-\def\defcodeindex{\defcodeindex1279,41935
-\def\synindex #1 #2 {\synindex1283,42115
-\def\syncodeindex #1 #2 {\syncodeindex1292,42455
-\def\doindex#1{\doindex1309,43134
-\def\singleindexer #1{\singleindexer1310,43193
-\def\docodeindex#1{\docodeindex1313,43305
-\def\singlecodeindexer #1{\singlecodeindexer1314,43372
-\def\indexdummies{\indexdummies1316,43430
-\def\_{\_1317,43450
-\def\w{\w1318,43478
-\def\bf{\bf1319,43505
-\def\rm{\rm1320,43534
-\def\sl{\sl1321,43563
-\def\sf{\sf1322,43592
-\def\tt{\tt1323,43620
-\def\gtr{\gtr1324,43648
-\def\less{\less1325,43678
-\def\hat{\hat1326,43710
-\def\char{\char1327,43740
-\def\TeX{\TeX1328,43772
-\def\dots{\dots1329,43802
-\def\copyright{\copyright1330,43835
-\def\tclose##1{\tclose1331,43878
-\def\code##1{\code1332,43923
-\def\samp##1{\samp1333,43964
-\def\t##1{\t1334,44005
-\def\r##1{\r1335,44040
-\def\i##1{\i1336,44075
-\def\b##1{\b1337,44110
-\def\cite##1{\cite1338,44145
-\def\key##1{\key1339,44186
-\def\file##1{\file1340,44225
-\def\var##1{\var1341,44266
-\def\kbd##1{\kbd1342,44305
-\def\indexdummyfont#1{\indexdummyfont1347,44461
-\def\indexdummytex{\indexdummytex1348,44487
-\def\indexdummydots{\indexdummydots1349,44511
-\def\indexnofonts{\indexnofonts1351,44537
-\let\w=\indexdummyfontdummyfont1352,44557
-\let\t=\indexdummyfontdummyfont1353,44580
-\let\r=\indexdummyfontdummyfont1354,44603
-\let\i=\indexdummyfontdummyfont1355,44626
-\let\b=\indexdummyfontdummyfont1356,44649
-\let\emph=\indexdummyfontdummyfont1357,44672
-\let\strong=\indexdummyfontdummyfont1358,44698
-\let\cite=\indexdummyfont=\indexdummyfont1359,44726
-\let\sc=\indexdummyfontdummyfont1360,44752
-\let\tclose=\indexdummyfontdummyfont1364,44924
-\let\code=\indexdummyfontdummyfont1365,44952
-\let\file=\indexdummyfontdummyfont1366,44978
-\let\samp=\indexdummyfontdummyfont1367,45004
-\let\kbd=\indexdummyfontdummyfont1368,45030
-\let\key=\indexdummyfontdummyfont1369,45055
-\let\var=\indexdummyfontdummyfont1370,45080
-\let\TeX=\indexdummytexdummytex1371,45105
-\let\dots=\indexdummydotsdummydots1372,45129
-\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45381
-\def\doind #1#2{\doind1384,45437
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45480
-\def\rawbackslashxx{\rawbackslashxx1389,45620
-{\indexnofontsnofonts1394,45882
-\def\dosubind #1#2#3{\dosubind1405,46193
-{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46241
-\def\rawbackslashxx{\rawbackslashxx1410,46345
-{\indexnofontsnofonts1414,46499
-\def\findex {\findex1443,47430
-\def\kindex {\kindex1444,47453
-\def\cindex {\cindex1445,47476
-\def\vindex {\vindex1446,47499
-\def\tindex {\tindex1447,47522
-\def\pindex {\pindex1448,47545
-\def\cindexsub {\cindexsub1450,47569
-\def\printindex{\printindex1462,47896
-\def\doprintindex#1{\doprintindex1464,47937
- \def\indexbackslash{\indexbackslash1481,48422
- \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48461
-\def\initial #1{\initial1517,49533
-\def\entry #1#2{\entry1523,49740
- \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50387
-\def\indexdotfill{\indexdotfill1549,50715
-\def\primary #1{\primary1552,50821
-\def\secondary #1#2{\secondary1556,50903
-\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50985
-\newbox\partialpageialpage1566,51158
-\def\begindoublecolumns{\begindoublecolumns1572,51316
- \output={\global\setbox\partialpage=ialpage=1573,51352
-\def\enddoublecolumns{\enddoublecolumns1577,51540
-\def\doublecolumnout{\doublecolumnout1580,51625
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51694
-\def\pagesofar{\pagesofar1584,51872
-\def\balancecolumns{\balancecolumns1588,52109
- \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52280
- \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52541
-\newcount \appendixno \appendixno = `\@no1627,53446
-\def\appendixletter{\appendixletter1628,53487
-\def\opencontents{\opencontents1632,53590
-\def\thischapter{\thischapter1637,53771
-\def\seccheck#1{\seccheck1638,53809
-\def\chapternofonts{\chapternofonts1643,53913
-\def\result{\result1646,53988
-\def\equiv{\equiv1647,54023
-\def\expansion{\expansion1648,54056
-\def\print{\print1649,54097
-\def\TeX{\TeX1650,54130
-\def\dots{\dots1651,54159
-\def\copyright{\copyright1652,54190
-\def\tt{\tt1653,54231
-\def\bf{\bf1654,54258
-\def\w{\w1655,54286
-\def\less{\less1656,54311
-\def\gtr{\gtr1657,54342
-\def\hat{\hat1658,54371
-\def\char{\char1659,54400
-\def\tclose##1{\tclose1660,54431
-\def\code##1{\code1661,54475
-\def\samp##1{\samp1662,54515
-\def\r##1{\r1663,54555
-\def\b##1{\b1664,54589
-\def\key##1{\key1665,54623
-\def\file##1{\file1666,54661
-\def\kbd##1{\kbd1667,54701
-\def\i##1{\i1669,54809
-\def\cite##1{\cite1670,54843
-\def\var##1{\var1671,54883
-\def\emph##1{\emph1672,54921
-\def\dfn##1{\dfn1673,54961
-\def\thischaptername{\thischaptername1676,55002
-\outer\def\chapter{\chapter1677,55041
-\def\chapterzzz #1{\chapterzzz1678,55082
-{\chapternofonts%nofonts%1687,55478
-\global\let\section = \numberedsec=1692,55631
-\global\let\subsection = \numberedsubsec=1693,55666
-\global\let\subsubsection = \numberedsubsubsec=1694,55707
-\outer\def\appendix{\appendix1697,55758
-\def\appendixzzz #1{\appendixzzz1698,55801
-\global\advance \appendixno by 1 \message{no1700,55878
-\chapmacro {#1}{Appendix \appendixletter}letter1701,55947
-\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56040
-{\chapternofonts%nofonts%1705,56112
- {#1}{Appendix \appendixletter}letter1707,56168
-\appendixnoderef %noderef1710,56268
-\global\let\section = \appendixsec=1711,56287
-\global\let\subsection = \appendixsubsec=1712,56322
-\global\let\subsubsection = \appendixsubsubsec=1713,56363
-\outer\def\top{\top1716,56414
-\outer\def\unnumbered{\unnumbered1717,56454
-\def\unnumberedzzz #1{\unnumberedzzz1718,56501
-{\chapternofonts%nofonts%1722,56664
-\global\let\section = \unnumberedsec=1727,56814
-\global\let\subsection = \unnumberedsubsec=1728,56851
-\global\let\subsubsection = \unnumberedsubsubsec=1729,56894
-\outer\def\numberedsec{\numberedsec1732,56947
-\def\seczzz #1{\seczzz1733,56988
-{\chapternofonts%nofonts%1736,57144
-\outer\def\appendixsection{\appendixsection1745,57330
-\outer\def\appendixsec{\appendixsec1746,57387
-\def\appendixsectionzzz #1{\appendixsectionzzz1747,57440
-\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57552
-{\chapternofonts%nofonts%1750,57620
-{#1}{\appendixletter}letter1752,57676
-\appendixnoderef %noderef1755,57776
-\outer\def\unnumberedsec{\unnumberedsec1759,57816
-\def\unnumberedseczzz #1{\unnumberedseczzz1760,57869
-{\chapternofonts%nofonts%1762,57964
-\outer\def\numberedsubsec{\numberedsubsec1770,58132
-\def\numberedsubseczzz #1{\numberedsubseczzz1771,58187
-{\chapternofonts%nofonts%1774,58366
-\outer\def\appendixsubsec{\appendixsubsec1783,58570
-\def\appendixsubseczzz #1{\appendixsubseczzz1784,58625
-\subsecheading {#1}{\appendixletter}letter1786,58747
-{\chapternofonts%nofonts%1787,58812
-{#1}{\appendixletter}letter1789,58871
-\appendixnoderef %noderef1792,58986
-\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59026
-\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59085
-{\chapternofonts%nofonts%1799,59186
-\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59357
-\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59418
-{\chapternofonts%nofonts%1812,59615
-\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59848
-\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59909
- {\appendixletter}letter1827,60048
-{\chapternofonts%nofonts%1828,60114
- {\appendixletter}letter1830,60179
-\appendixnoderef %noderef1834,60313
-\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60353
-\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60418
-{\chapternofonts%nofonts%1841,60525
-\def\infotop{\infotop1851,60854
-\def\infounnumbered{\infounnumbered1852,60892
-\def\infounnumberedsec{\infounnumberedsec1853,60937
-\def\infounnumberedsubsec{\infounnumberedsubsec1854,60988
-\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61045
-\def\infoappendix{\infoappendix1857,61109
-\def\infoappendixsec{\infoappendixsec1858,61150
-\def\infoappendixsubsec{\infoappendixsubsec1859,61197
-\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61250
-\def\infochapter{\infochapter1862,61310
-\def\infosection{\infosection1863,61349
-\def\infosubsection{\infosubsection1864,61388
-\def\infosubsubsection{\infosubsubsection1865,61433
-\global\let\section = \numberedsec=1870,61670
-\global\let\subsection = \numberedsubsec=1871,61705
-\global\let\subsubsection = \numberedsubsubsec=1872,61746
-\def\majorheading{\majorheading1886,62253
-\def\majorheadingzzz #1{\majorheadingzzz1887,62298
-\def\chapheading{\chapheading1893,62531
-\def\chapheadingzzz #1{\chapheadingzzz1894,62574
-\def\heading{\heading1899,62769
-\def\subheading{\subheading1901,62806
-\def\subsubheading{\subsubheading1903,62849
-\def\dobreak#1#2{\dobreak1910,63126
-\def\setchapterstyle #1 {\setchapterstyle1912,63204
-\def\chapbreak{\chapbreak1919,63459
-\def\chappager{\chappager1920,63509
-\def\chapoddpage{\chapoddpage1921,63547
-\def\setchapternewpage #1 {\setchapternewpage1923,63626
-\def\CHAPPAGoff{\CHAPPAGoff1925,63683
-\def\CHAPPAGon{\CHAPPAGon1929,63777
-\global\def\HEADINGSon{\HEADINGSon1932,63868
-\def\CHAPPAGodd{\CHAPPAGodd1934,63910
-\global\def\HEADINGSon{\HEADINGSon1937,64006
-\def\CHAPFplain{\CHAPFplain1941,64060
-\def\chfplain #1#2{\chfplain1945,64152
-\def\unnchfplain #1{\unnchfplain1956,64375
-\def\unnchfopen #1{\unnchfopen1964,64604
-\def\chfopen #1#2{\chfopen1970,64812
-\def\CHAPFopen{\CHAPFopen1975,64956
-\def\subsecheadingbreak{\subsecheadingbreak1982,65174
-\def\secheadingbreak{\secheadingbreak1985,65303
-\def\secheading #1#2#3{\secheading1993,65585
-\def\plainsecheading #1{\plainsecheading1994,65641
-\def\secheadingi #1{\secheadingi1995,65684
-\def\subsecheading #1#2#3#4{\subsecheading2006,66052
-\def\subsecheadingi #1{\subsecheadingi2007,66119
-\def\subsubsecfonts{\subsubsecfonts2014,66416
-\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66539
-\def\subsubsecheadingi #1{\subsubsecheadingi2018,66617
-\def\startcontents#1{\startcontents2032,67089
- \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67362
-\outer\def\contents{\contents2049,67721
-\outer\def\summarycontents{\summarycontents2057,67865
- \def\secentry ##1##2##3##4{\secentry2067,68236
- \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68271
- \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68306
- \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68347
- \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68385
- \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68432
-\def\chapentry#1#2#3{\chapentry2085,68866
-\def\shortchapentry#1#2#3{\shortchapentry2088,68983
- {#2\labelspace #1}space2091,69093
-\def\unnumbchapentry#1#2{\unnumbchapentry2094,69147
-\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69194
-\def\secentry#1#2#3#4{\secentry2102,69358
-\def\unnumbsecentry#1#2{\unnumbsecentry2103,69417
-\def\subsecentry#1#2#3#4#5{\subsecentry2106,69478
-\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69548
-\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69622
- \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69656
-\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69707
-\def\dochapentry#1#2{\dochapentry2123,70081
-\def\dosecentry#1#2{\dosecentry2138,70686
-\def\dosubsecentry#1#2{\dosubsecentry2145,70864
-\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71049
-\def\labelspace{\labelspace2160,71300
-\def\dopageno#1{\dopageno2162,71335
-\def\doshortpageno#1{\doshortpageno2163,71361
-\def\chapentryfonts{\chapentryfonts2165,71393
-\def\secentryfonts{\secentryfonts2166,71428
-\def\point{\point2192,72387
-\def\result{\result2194,72408
-\def\expansion{\expansion2195,72481
-\def\print{\print2196,72552
-\def\equiv{\equiv2198,72619
-\def\error{\error2218,73392
-\def\tex{\tex2224,73621
-\def\@{\@2242,74004
-\gdef\sepspaces{\def {\ }}}\2265,74736
-\def\aboveenvbreak{\aboveenvbreak2268,74818
-\def\afterenvbreak{\afterenvbreak2272,74984
-\def\ctl{\ctl2286,75495
-\def\ctr{\ctr2287,75567
-\def\cbl{\cbl2288,75606
-\def\cbr{\cbr2289,75646
-\def\carttop{\carttop2290,75685
-\def\cartbot{\cartbot2293,75793
-\long\def\cartouche{\cartouche2299,75933
-\def\Ecartouche{\Ecartouche2326,76721
-\def\lisp{\lisp2338,76856
-\def\Elisp{\Elisp2348,77203
-\def\next##1{\next2360,77529
-\def\Eexample{\Eexample2364,77571
-\def\Esmallexample{\Esmallexample2367,77618
-\def\smalllispx{\smalllispx2373,77796
-\def\Esmalllisp{\Esmalllisp2383,78150
-\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78506
-\def\next##1{\next2397,78563
-\def\display{\display2401,78643
-\def\Edisplay{\Edisplay2410,78962
-\def\next##1{\next2422,79273
-\def\format{\format2426,79376
-\def\Eformat{\Eformat2434,79672
-\def\next##1{\next2437,79761
-\def\flushleft{\flushleft2441,79813
-\def\Eflushleft{\Eflushleft2451,80184
-\def\next##1{\next2454,80277
-\def\flushright{\flushright2456,80299
-\def\Eflushright{\Eflushright2466,80671
-\def\next##1{\next2470,80802
-\def\quotation{\quotation2474,80860
-\def\Equotation{\Equotation2480,81052
-\def\setdeffont #1 {\setdeffont2493,81450
-\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81496
-\newskip\defargsindent \defargsindent=50ptargsindent2496,81539
-\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81582
-\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81625
-\def\activeparens{\activeparens2503,81823
-\def\opnr{\opnr2529,83035
-\def\lbrb{\lbrb2530,83100
-\def\defname #1#2{\defname2536,83301
-\advance\dimen2 by -\defbodyindentbodyindent2540,83419
-\advance\dimen3 by -\defbodyindentbodyindent2542,83473
-\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83527
-\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83669
-\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83744
-\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84113
-\advance\leftskip by -\defbodyindentbodyindent2557,84247
-\exdentamount=\defbodyindentbodyindent2558,84284
-\def\defparsebody #1#2#3{\defparsebody2568,84643
-\def#1{2572,84827
-\def#2{2573,84863
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84935
-\exdentamount=\defbodyindentbodyindent2576,85009
-\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85113
-\def#1{2585,85274
-\def#2##1 {2586,85310
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85393
-\exdentamount=\defbodyindentbodyindent2589,85467
-\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85552
-\def#1{2596,85713
-\def#2##1 ##2 {2597,85749
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85849
-\exdentamount=\defbodyindentbodyindent2601,85923
-\def\defvarparsebody #1#2#3{\defvarparsebody2608,86194
-\def#1{2612,86381
-\def#2{2613,86417
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86476
-\exdentamount=\defbodyindentbodyindent2616,86550
-\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86641
-\def#1{2625,86800
-\def#2##1 {2626,86836
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86906
-\exdentamount=\defbodyindentbodyindent2629,86980
-\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87052
-\def#1{2636,87216
-\def#2##1 ##2 {2637,87252
-\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87339
-\exdentamount=\defbodyindentbodyindent2641,87413
-\def\defunargs #1{\defunargs2664,88173
-\def\deftypefunargs #1{\deftypefunargs2676,88555
-\def\deffn{\deffn2690,88937
-\def\deffnheader #1#2#3{\deffnheader2692,88994
-\begingroup\defname {name2693,89042
-\def\defun{\defun2699,89187
-\def\defunheader #1#2{\defunheader2701,89240
-\begingroup\defname {name2702,89315
-\defunargs {unargs2703,89351
-\def\deftypefun{\deftypefun2709,89499
-\def\deftypefunheader #1#2{\deftypefunheader2712,89621
-\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89730
-\begingroup\defname {name2716,89822
-\deftypefunargs {typefunargs2717,89868
-\def\deftypefn{\deftypefn2723,90039
-\def\deftypefnheader #1#2#3{\deftypefnheader2726,90188
-\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90324
-\begingroup\defname {name2730,90417
-\deftypefunargs {typefunargs2731,90457
-\def\defmac{\defmac2737,90578
-\def\defmacheader #1#2{\defmacheader2739,90635
-\begingroup\defname {name2740,90711
-\defunargs {unargs2741,90744
-\def\defspec{\defspec2747,90868
-\def\defspecheader #1#2{\defspecheader2749,90929
-\begingroup\defname {name2750,91006
-\defunargs {unargs2751,91046
-\def\deffnx #1 {\deffnx2758,91241
-\def\defunx #1 {\defunx2759,91298
-\def\defmacx #1 {\defmacx2760,91355
-\def\defspecx #1 {\defspecx2761,91414
-\def\deftypefnx #1 {\deftypefnx2762,91475
-\def\deftypeunx #1 {\deftypeunx2763,91540
-\def\defop #1 {\defop2769,91686
-\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91721
-\def\defopheader #1#2#3{\defopheader2772,91775
-\begingroup\defname {name2774,91864
-\defunargs {unargs2775,91910
-\def\defmethod{\defmethod2780,91971
-\def\defmethodheader #1#2#3{\defmethodheader2782,92044
-\begingroup\defname {name2784,92132
-\defunargs {unargs2785,92172
-\def\defcv #1 {\defcv2790,92246
-\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92281
-\def\defcvarheader #1#2#3{\defcvarheader2793,92340
-\begingroup\defname {name2795,92426
-\defvarargs {varargs2796,92472
-\def\defivar{\defivar2801,92545
-\def\defivarheader #1#2#3{\defivarheader2803,92608
-\begingroup\defname {name2805,92694
-\defvarargs {varargs2806,92745
-\def\defopx #1 {\defopx2812,92894
-\def\defmethodx #1 {\defmethodx2813,92951
-\def\defcvx #1 {\defcvx2814,93016
-\def\defivarx #1 {\defivarx2815,93073
-\def\defvarargs #1{\defvarargs2822,93344
-\def\defvr{\defvr2828,93488
-\def\defvrheader #1#2#3{\defvrheader2830,93543
-\begingroup\defname {name2831,93591
-\def\defvar{\defvar2835,93676
-\def\defvarheader #1#2{\defvarheader2837,93736
-\begingroup\defname {name2838,93807
-\defvarargs {varargs2839,93843
-\def\defopt{\defopt2844,93909
-\def\defoptheader #1#2{\defoptheader2846,93969
-\begingroup\defname {name2847,94040
-\defvarargs {varargs2848,94079
-\def\deftypevar{\deftypevar2853,94136
-\def\deftypevarheader #1#2{\deftypevarheader2856,94252
-\begingroup\defname {name2858,94335
-\def\deftypevr{\deftypevr2865,94509
-\def\deftypevrheader #1#2#3{\deftypevrheader2867,94580
-\begingroup\defname {name2868,94632
-\def\defvrx #1 {\defvrx2876,94869
-\def\defvarx #1 {\defvarx2877,94926
-\def\defoptx #1 {\defoptx2878,94985
-\def\deftypevarx #1 {\deftypevarx2879,95044
-\def\deftypevrx #1 {\deftypevrx2880,95111
-\def\deftpargs #1{\deftpargs2885,95260
-\def\deftp{\deftp2889,95340
-\def\deftpheader #1#2#3{\deftpheader2891,95395
-\begingroup\defname {name2892,95443
-\def\deftpx #1 {\deftpx2897,95602
-\def\setref#1{\setref2908,95923
-\def\unnumbsetref#1{\unnumbsetref2913,96037
-\def\appendixsetref#1{\appendixsetref2918,96144
-\def\pxref#1{\pxref2929,96555
-\def\xref#1{\xref2930,96591
-\def\ref#1{\ref2931,96626
-\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96656
-\def\printedmanual{\printedmanual2933,96699
-\def\printednodename{\printednodename2934,96737
-\def\printednodename{\printednodename2939,96862
-section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97495
-\refx{x2957,97573
-\def\dosetq #1#2{\dosetq2965,97793
-\def\internalsetq #1#2{\internalsetq2973,98051
-\def\Ypagenumber{\Ypagenumber2977,98152
-\def\Ytitle{\Ytitle2979,98178
-\def\Ynothing{\Ynothing2981,98205
-\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98222
-\def\Yappendixletterandtype{\Yappendixletterandtype2992,98538
-\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98568
-\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98623
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98727
-Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98798
- \def\linenumber{\linenumber3009,99137
-\def\refx#1#2{\refx3015,99321
-\def\xrdef #1#2{\xrdef3037,99947
-\def\readauxfile{\readauxfile3040,100032
-\def\supereject{\supereject3110,101813
-\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102498
-\def\openindices{\openindices3139,102684
-\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102909
-\parindent = \defaultparindentaultparindent3152,102961
-\def\smallbook{\smallbook3175,103685
-\global\def\Esmallexample{\Esmallexample3192,104112
-\def\afourpaper{\afourpaper3196,104203
-\def\finalout{\finalout3224,105011
-\def\normaldoublequote{\normaldoublequote3235,105272
-\def\normaltilde{\normaltilde3236,105298
-\def\normalcaret{\normalcaret3237,105318
-\def\normalunderscore{\normalunderscore3238,105338
-\def\normalverticalbar{\normalverticalbar3239,105363
-\def\normalless{\normalless3240,105389
-\def\normalgreater{\normalgreater3241,105408
-\def\normalplus{\normalplus3242,105430
-\def\ifusingtt#1#2{\ifusingtt3253,105922
-\def\activedoublequote{\activedoublequote3261,106250
-\def~{~3264,106336
-\def^{^3267,106397
-\def_{_3270,106436
-\def\_{\_3272,106510
-\def\lvvmode{\lvvmode3279,106847
-\def|{|3282,106897
-\def<{<3285,106960
-\def>{>3288,107017
-\def+{+3290,107055
-\def\turnoffactive{\turnoffactive3296,107216
-\global\def={=3307,107502
-\def\normalbackslash{\normalbackslash3321,107884
+\def\itemfont{\itemfont1082,35890
+\def\Etable{\Etable1090,36116
+\def\itemize{\itemize1103,36440
+\def\itemizezzz #1{\itemizezzz1105,36476
+\def\itemizey #1#2{\itemizey1110,36571
+\def#2{1119,36817
+\def\itemcontents{\itemcontents1120,36858
+\def\bullet{\bullet1123,36906
+\def\minus{\minus1124,36933
+\def\frenchspacing{\frenchspacing1128,37041
+\def\splitoff#1#2\endmark{\splitoff1134,37266
+\def\enumerate{\enumerate1140,37496
+\def\enumeratezzz #1{\enumeratezzz1141,37535
+\def\enumeratey #1 #2\endenumeratey{\enumeratey1142,37588
+ \def\thearg{\thearg1146,37735
+ \ifx\thearg\empty \def\thearg{\thearg1147,37754
+\def\numericenumerate{\numericenumerate1184,39088
+\def\lowercaseenumerate{\lowercaseenumerate1190,39218
+\def\uppercaseenumerate{\uppercaseenumerate1203,39565
+\def\startenumeration#1{\startenumeration1219,40055
+\def\alphaenumerate{\alphaenumerate1227,40237
+\def\capsenumerate{\capsenumerate1228,40272
+\def\Ealphaenumerate{\Ealphaenumerate1229,40306
+\def\Ecapsenumerate{\Ecapsenumerate1230,40340
+\def\itemizeitem{\itemizeitem1234,40420
+\def\newindex #1{\newindex1259,41277
+\def\defindex{\defindex1268,41566
+\def\newcodeindex #1{\newcodeindex1272,41674
+\def\defcodeindex{\defcodeindex1279,41934
+\def\synindex #1 #2 {\synindex1283,42114
+\def\syncodeindex #1 #2 {\syncodeindex1292,42454
+\def\doindex#1{\doindex1309,43133
+\def\singleindexer #1{\singleindexer1310,43192
+\def\docodeindex#1{\docodeindex1313,43304
+\def\singlecodeindexer #1{\singlecodeindexer1314,43371
+\def\indexdummies{\indexdummies1316,43429
+\def\_{\_1317,43449
+\def\w{\w1318,43477
+\def\bf{\bf1319,43504
+\def\rm{\rm1320,43533
+\def\sl{\sl1321,43562
+\def\sf{\sf1322,43591
+\def\tt{\tt1323,43619
+\def\gtr{\gtr1324,43647
+\def\less{\less1325,43677
+\def\hat{\hat1326,43709
+\def\char{\char1327,43739
+\def\TeX{\TeX1328,43771
+\def\dots{\dots1329,43801
+\def\copyright{\copyright1330,43834
+\def\tclose##1{\tclose1331,43877
+\def\code##1{\code1332,43922
+\def\samp##1{\samp1333,43963
+\def\t##1{\t1334,44004
+\def\r##1{\r1335,44039
+\def\i##1{\i1336,44074
+\def\b##1{\b1337,44109
+\def\cite##1{\cite1338,44144
+\def\key##1{\key1339,44185
+\def\file##1{\file1340,44224
+\def\var##1{\var1341,44265
+\def\kbd##1{\kbd1342,44304
+\def\indexdummyfont#1{\indexdummyfont1347,44460
+\def\indexdummytex{\indexdummytex1348,44486
+\def\indexdummydots{\indexdummydots1349,44510
+\def\indexnofonts{\indexnofonts1351,44536
+\let\w=\indexdummyfontdummyfont1352,44556
+\let\t=\indexdummyfontdummyfont1353,44579
+\let\r=\indexdummyfontdummyfont1354,44602
+\let\i=\indexdummyfontdummyfont1355,44625
+\let\b=\indexdummyfontdummyfont1356,44648
+\let\emph=\indexdummyfontdummyfont1357,44671
+\let\strong=\indexdummyfontdummyfont1358,44697
+\let\cite=\indexdummyfont=\indexdummyfont1359,44725
+\let\sc=\indexdummyfontdummyfont1360,44751
+\let\tclose=\indexdummyfontdummyfont1364,44923
+\let\code=\indexdummyfontdummyfont1365,44951
+\let\file=\indexdummyfontdummyfont1366,44977
+\let\samp=\indexdummyfontdummyfont1367,45003
+\let\kbd=\indexdummyfontdummyfont1368,45029
+\let\key=\indexdummyfontdummyfont1369,45054
+\let\var=\indexdummyfontdummyfont1370,45079
+\let\TeX=\indexdummytexdummytex1371,45104
+\let\dots=\indexdummydotsdummydots1372,45128
+\let\indexbackslash=0 %overridden during \printindex.backslash=01382,45380
+\def\doind #1#2{\doind1384,45436
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1386,45479
+\def\rawbackslashxx{\rawbackslashxx1389,45619
+{\indexnofontsnofonts1394,45881
+\def\dosubind #1#2#3{\dosubind1405,46192
+{\indexdummies % Must do this here, since \bf, etc expand at this stagedummies1407,46240
+\def\rawbackslashxx{\rawbackslashxx1410,46344
+{\indexnofontsnofonts1414,46498
+\def\findex {\findex1443,47429
+\def\kindex {\kindex1444,47452
+\def\cindex {\cindex1445,47475
+\def\vindex {\vindex1446,47498
+\def\tindex {\tindex1447,47521
+\def\pindex {\pindex1448,47544
+\def\cindexsub {\cindexsub1450,47568
+\def\printindex{\printindex1462,47895
+\def\doprintindex#1{\doprintindex1464,47936
+ \def\indexbackslash{\indexbackslash1481,48421
+ \indexfonts\rm \tolerance=9500 \advance\baselineskip -1ptfonts\rm1482,48460
+\def\initial #1{\initial1517,49532
+\def\entry #1#2{\entry1523,49739
+ \null\nobreak\indexdotfill % Have leaders before the page number.dotfill1540,50386
+\def\indexdotfill{\indexdotfill1549,50714
+\def\primary #1{\primary1552,50820
+\def\secondary #1#2{\secondary1556,50902
+\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\pardotfill1559,50984
+\newbox\partialpageialpage1566,51157
+\def\begindoublecolumns{\begindoublecolumns1572,51315
+ \output={\global\setbox\partialpage=ialpage=1573,51351
+\def\enddoublecolumns{\enddoublecolumns1577,51539
+\def\doublecolumnout{\doublecolumnout1580,51624
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1581,51693
+\def\pagesofar{\pagesofar1584,51871
+\def\balancecolumns{\balancecolumns1588,52108
+ \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpageialpage1594,52279
+ \dimen@=\pageheight \advance\dimen@ by-\ht\partialpageialpage1600,52540
+\newcount \appendixno \appendixno = `\@no1627,53445
+\def\appendixletter{\appendixletter1628,53486
+\def\opencontents{\opencontents1632,53589
+\def\thischapter{\thischapter1637,53770
+\def\seccheck#1{\seccheck1638,53808
+\def\chapternofonts{\chapternofonts1643,53912
+\def\result{\result1646,53987
+\def\equiv{\equiv1647,54022
+\def\expansion{\expansion1648,54055
+\def\print{\print1649,54096
+\def\TeX{\TeX1650,54129
+\def\dots{\dots1651,54158
+\def\copyright{\copyright1652,54189
+\def\tt{\tt1653,54230
+\def\bf{\bf1654,54257
+\def\w{\w1655,54285
+\def\less{\less1656,54310
+\def\gtr{\gtr1657,54341
+\def\hat{\hat1658,54370
+\def\char{\char1659,54399
+\def\tclose##1{\tclose1660,54430
+\def\code##1{\code1661,54474
+\def\samp##1{\samp1662,54514
+\def\r##1{\r1663,54554
+\def\b##1{\b1664,54588
+\def\key##1{\key1665,54622
+\def\file##1{\file1666,54660
+\def\kbd##1{\kbd1667,54700
+\def\i##1{\i1669,54808
+\def\cite##1{\cite1670,54842
+\def\var##1{\var1671,54882
+\def\emph##1{\emph1672,54920
+\def\dfn##1{\dfn1673,54960
+\def\thischaptername{\thischaptername1676,55001
+\outer\def\chapter{\chapter1677,55040
+\def\chapterzzz #1{\chapterzzz1678,55081
+{\chapternofonts%nofonts%1687,55477
+\global\let\section = \numberedsec=1692,55630
+\global\let\subsection = \numberedsubsec=1693,55665
+\global\let\subsubsection = \numberedsubsubsec=1694,55706
+\outer\def\appendix{\appendix1697,55757
+\def\appendixzzz #1{\appendixzzz1698,55800
+\global\advance \appendixno by 1 \message{no1700,55877
+\chapmacro {#1}{Appendix \appendixletter}letter1701,55946
+\xdef\thischapter{Appendix \appendixletter: \noexpand\thischaptername}letter:1704,56039
+{\chapternofonts%nofonts%1705,56111
+ {#1}{Appendix \appendixletter}letter1707,56167
+\appendixnoderef %noderef1710,56267
+\global\let\section = \appendixsec=1711,56286
+\global\let\subsection = \appendixsubsec=1712,56321
+\global\let\subsubsection = \appendixsubsubsec=1713,56362
+\outer\def\top{\top1716,56413
+\outer\def\unnumbered{\unnumbered1717,56453
+\def\unnumberedzzz #1{\unnumberedzzz1718,56500
+{\chapternofonts%nofonts%1722,56663
+\global\let\section = \unnumberedsec=1727,56813
+\global\let\subsection = \unnumberedsubsec=1728,56850
+\global\let\subsubsection = \unnumberedsubsubsec=1729,56893
+\outer\def\numberedsec{\numberedsec1732,56946
+\def\seczzz #1{\seczzz1733,56987
+{\chapternofonts%nofonts%1736,57143
+\outer\def\appendixsection{\appendixsection1745,57329
+\outer\def\appendixsec{\appendixsec1746,57386
+\def\appendixsectionzzz #1{\appendixsectionzzz1747,57439
+\gdef\thissection{#1}\secheading {#1}{\appendixletter}letter1749,57551
+{\chapternofonts%nofonts%1750,57619
+{#1}{\appendixletter}letter1752,57675
+\appendixnoderef %noderef1755,57775
+\outer\def\unnumberedsec{\unnumberedsec1759,57815
+\def\unnumberedseczzz #1{\unnumberedseczzz1760,57868
+{\chapternofonts%nofonts%1762,57963
+\outer\def\numberedsubsec{\numberedsubsec1770,58131
+\def\numberedsubseczzz #1{\numberedsubseczzz1771,58186
+{\chapternofonts%nofonts%1774,58365
+\outer\def\appendixsubsec{\appendixsubsec1783,58569
+\def\appendixsubseczzz #1{\appendixsubseczzz1784,58624
+\subsecheading {#1}{\appendixletter}letter1786,58746
+{\chapternofonts%nofonts%1787,58811
+{#1}{\appendixletter}letter1789,58870
+\appendixnoderef %noderef1792,58985
+\outer\def\unnumberedsubsec{\unnumberedsubsec1796,59025
+\def\unnumberedsubseczzz #1{\unnumberedsubseczzz1797,59084
+{\chapternofonts%nofonts%1799,59185
+\outer\def\numberedsubsubsec{\numberedsubsubsec1807,59356
+\def\numberedsubsubseczzz #1{\numberedsubsubseczzz1808,59417
+{\chapternofonts%nofonts%1812,59614
+\outer\def\appendixsubsubsec{\appendixsubsubsec1823,59847
+\def\appendixsubsubseczzz #1{\appendixsubsubseczzz1824,59908
+ {\appendixletter}letter1827,60047
+{\chapternofonts%nofonts%1828,60113
+ {\appendixletter}letter1830,60178
+\appendixnoderef %noderef1834,60312
+\outer\def\unnumberedsubsubsec{\unnumberedsubsubsec1838,60352
+\def\unnumberedsubsubseczzz #1{\unnumberedsubsubseczzz1839,60417
+{\chapternofonts%nofonts%1841,60524
+\def\infotop{\infotop1851,60853
+\def\infounnumbered{\infounnumbered1852,60891
+\def\infounnumberedsec{\infounnumberedsec1853,60936
+\def\infounnumberedsubsec{\infounnumberedsubsec1854,60987
+\def\infounnumberedsubsubsec{\infounnumberedsubsubsec1855,61044
+\def\infoappendix{\infoappendix1857,61108
+\def\infoappendixsec{\infoappendixsec1858,61149
+\def\infoappendixsubsec{\infoappendixsubsec1859,61196
+\def\infoappendixsubsubsec{\infoappendixsubsubsec1860,61249
+\def\infochapter{\infochapter1862,61309
+\def\infosection{\infosection1863,61348
+\def\infosubsection{\infosubsection1864,61387
+\def\infosubsubsection{\infosubsubsection1865,61432
+\global\let\section = \numberedsec=1870,61669
+\global\let\subsection = \numberedsubsec=1871,61704
+\global\let\subsubsection = \numberedsubsubsec=1872,61745
+\def\majorheading{\majorheading1886,62252
+\def\majorheadingzzz #1{\majorheadingzzz1887,62297
+\def\chapheading{\chapheading1893,62530
+\def\chapheadingzzz #1{\chapheadingzzz1894,62573
+\def\heading{\heading1899,62768
+\def\subheading{\subheading1901,62805
+\def\subsubheading{\subsubheading1903,62848
+\def\dobreak#1#2{\dobreak1910,63125
+\def\setchapterstyle #1 {\setchapterstyle1912,63203
+\def\chapbreak{\chapbreak1919,63458
+\def\chappager{\chappager1920,63508
+\def\chapoddpage{\chapoddpage1921,63546
+\def\setchapternewpage #1 {\setchapternewpage1923,63625
+\def\CHAPPAGoff{\CHAPPAGoff1925,63682
+\def\CHAPPAGon{\CHAPPAGon1929,63776
+\global\def\HEADINGSon{\HEADINGSon1932,63867
+\def\CHAPPAGodd{\CHAPPAGodd1934,63909
+\global\def\HEADINGSon{\HEADINGSon1937,64005
+\def\CHAPFplain{\CHAPFplain1941,64059
+\def\chfplain #1#2{\chfplain1945,64151
+\def\unnchfplain #1{\unnchfplain1956,64374
+\def\unnchfopen #1{\unnchfopen1964,64603
+\def\chfopen #1#2{\chfopen1970,64811
+\def\CHAPFopen{\CHAPFopen1975,64955
+\def\subsecheadingbreak{\subsecheadingbreak1982,65173
+\def\secheadingbreak{\secheadingbreak1985,65302
+\def\secheading #1#2#3{\secheading1993,65584
+\def\plainsecheading #1{\plainsecheading1994,65640
+\def\secheadingi #1{\secheadingi1995,65683
+\def\subsecheading #1#2#3#4{\subsecheading2006,66051
+\def\subsecheadingi #1{\subsecheadingi2007,66118
+\def\subsubsecfonts{\subsubsecfonts2014,66415
+\def\subsubsecheading #1#2#3#4#5{\subsubsecheading2017,66538
+\def\subsubsecheadingi #1{\subsubsecheadingi2018,66616
+\def\startcontents#1{\startcontents2032,67088
+ \unnumbchapmacro{#1}\def\thischapter{\thischapter2040,67361
+\outer\def\contents{\contents2049,67720
+\outer\def\summarycontents{\summarycontents2057,67864
+ \def\secentry ##1##2##3##4{\secentry2067,68235
+ \def\unnumbsecentry ##1##2{\unnumbsecentry2068,68270
+ \def\subsecentry ##1##2##3##4##5{\subsecentry2069,68305
+ \def\unnumbsubsecentry ##1##2{\unnumbsubsecentry2070,68346
+ \def\subsubsecentry ##1##2##3##4##5##6{\subsubsecentry2071,68384
+ \def\unnumbsubsubsecentry ##1##2{\unnumbsubsubsecentry2072,68431
+\def\chapentry#1#2#3{\chapentry2085,68865
+\def\shortchapentry#1#2#3{\shortchapentry2088,68982
+ {#2\labelspace #1}space2091,69092
+\def\unnumbchapentry#1#2{\unnumbchapentry2094,69146
+\def\shortunnumberedentry#1#2{\shortunnumberedentry2095,69193
+\def\secentry#1#2#3#4{\secentry2102,69357
+\def\unnumbsecentry#1#2{\unnumbsecentry2103,69416
+\def\subsecentry#1#2#3#4#5{\subsecentry2106,69477
+\def\unnumbsubsecentry#1#2{\unnumbsubsecentry2107,69547
+\def\subsubsecentry#1#2#3#4#5#6{\subsubsecentry2110,69621
+ \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}space2111,69655
+\def\unnumbsubsubsecentry#1#2{\unnumbsubsubsecentry2112,69706
+\def\dochapentry#1#2{\dochapentry2123,70080
+\def\dosecentry#1#2{\dosecentry2138,70685
+\def\dosubsecentry#1#2{\dosubsecentry2145,70863
+\def\dosubsubsecentry#1#2{\dosubsubsecentry2152,71048
+\def\labelspace{\labelspace2160,71299
+\def\dopageno#1{\dopageno2162,71334
+\def\doshortpageno#1{\doshortpageno2163,71360
+\def\chapentryfonts{\chapentryfonts2165,71392
+\def\secentryfonts{\secentryfonts2166,71427
+\def\point{\point2192,72386
+\def\result{\result2194,72407
+\def\expansion{\expansion2195,72480
+\def\print{\print2196,72551
+\def\equiv{\equiv2198,72618
+\def\error{\error2218,73391
+\def\tex{\tex2224,73620
+\def\@{\@2242,74003
+\gdef\sepspaces{\def {\ }}}\2265,74735
+\def\aboveenvbreak{\aboveenvbreak2268,74817
+\def\afterenvbreak{\afterenvbreak2272,74983
+\def\ctl{\ctl2286,75494
+\def\ctr{\ctr2287,75566
+\def\cbl{\cbl2288,75605
+\def\cbr{\cbr2289,75645
+\def\carttop{\carttop2290,75684
+\def\cartbot{\cartbot2293,75792
+\long\def\cartouche{\cartouche2299,75932
+\def\Ecartouche{\Ecartouche2326,76720
+\def\lisp{\lisp2338,76855
+\def\Elisp{\Elisp2348,77202
+\def\next##1{\next2360,77528
+\def\Eexample{\Eexample2364,77570
+\def\Esmallexample{\Esmallexample2367,77617
+\def\smalllispx{\smalllispx2373,77795
+\def\Esmalllisp{\Esmalllisp2383,78149
+\obeyspaces \obeylines \ninett \indexfonts \rawbackslashfonts2396,78505
+\def\next##1{\next2397,78562
+\def\display{\display2401,78642
+\def\Edisplay{\Edisplay2410,78961
+\def\next##1{\next2422,79272
+\def\format{\format2426,79375
+\def\Eformat{\Eformat2434,79671
+\def\next##1{\next2437,79760
+\def\flushleft{\flushleft2441,79812
+\def\Eflushleft{\Eflushleft2451,80183
+\def\next##1{\next2454,80276
+\def\flushright{\flushright2456,80298
+\def\Eflushright{\Eflushright2466,80670
+\def\next##1{\next2470,80801
+\def\quotation{\quotation2474,80859
+\def\Equotation{\Equotation2480,81051
+\def\setdeffont #1 {\setdeffont2493,81449
+\newskip\defbodyindent \defbodyindent=.4inbodyindent2495,81495
+\newskip\defargsindent \defargsindent=50ptargsindent2496,81538
+\newskip\deftypemargin \deftypemargin=12pttypemargin2497,81581
+\newskip\deflastargmargin \deflastargmargin=18ptlastargmargin2498,81624
+\def\activeparens{\activeparens2503,81822
+\def\opnr{\opnr2529,83034
+\def\lbrb{\lbrb2530,83099
+\def\defname #1#2{\defname2536,83300
+\advance\dimen2 by -\defbodyindentbodyindent2540,83418
+\advance\dimen3 by -\defbodyindentbodyindent2542,83472
+\setbox0=\hbox{\hskip \deflastargmargin{lastargmargin2544,83526
+\dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuationsargsindent2546,83668
+\parshape 2 0in \dimen0 \defargsindent \dimen1 %argsindent2547,83743
+\rlap{\rightline{{\rm #2}\hskip \deftypemargin}typemargin2554,84112
+\advance\leftskip by -\defbodyindentbodyindent2557,84246
+\exdentamount=\defbodyindentbodyindent2558,84283
+\def\defparsebody #1#2#3{\defparsebody2568,84642
+\def#1{2572,84826
+\def#2{2573,84862
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2575,84934
+\exdentamount=\defbodyindentbodyindent2576,85008
+\def\defmethparsebody #1#2#3#4 {\defmethparsebody2581,85112
+\def#1{2585,85273
+\def#2##1 {2586,85309
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2588,85392
+\exdentamount=\defbodyindentbodyindent2589,85466
+\def\defopparsebody #1#2#3#4#5 {\defopparsebody2592,85551
+\def#1{2596,85712
+\def#2##1 ##2 {2597,85748
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2600,85848
+\exdentamount=\defbodyindentbodyindent2601,85922
+\def\defvarparsebody #1#2#3{\defvarparsebody2608,86193
+\def#1{2612,86380
+\def#2{2613,86416
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2615,86475
+\exdentamount=\defbodyindentbodyindent2616,86549
+\def\defvrparsebody #1#2#3#4 {\defvrparsebody2621,86640
+\def#1{2625,86799
+\def#2##1 {2626,86835
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2628,86905
+\exdentamount=\defbodyindentbodyindent2629,86979
+\def\defopvarparsebody #1#2#3#4#5 {\defopvarparsebody2632,87051
+\def#1{2636,87215
+\def#2##1 ##2 {2637,87251
+\advance\leftskip by \defbodyindent \advance \rightskip by \defbodyindentbodyindent2640,87338
+\exdentamount=\defbodyindentbodyindent2641,87412
+\def\defunargs #1{\defunargs2664,88172
+\def\deftypefunargs #1{\deftypefunargs2676,88554
+\def\deffn{\deffn2690,88936
+\def\deffnheader #1#2#3{\deffnheader2692,88993
+\begingroup\defname {name2693,89041
+\def\defun{\defun2699,89186
+\def\defunheader #1#2{\defunheader2701,89239
+\begingroup\defname {name2702,89314
+\defunargs {unargs2703,89350
+\def\deftypefun{\deftypefun2709,89498
+\def\deftypefunheader #1#2{\deftypefunheader2712,89620
+\def\deftypefunheaderx #1#2 #3\relax{\deftypefunheaderx2714,89729
+\begingroup\defname {name2716,89821
+\deftypefunargs {typefunargs2717,89867
+\def\deftypefn{\deftypefn2723,90038
+\def\deftypefnheader #1#2#3{\deftypefnheader2726,90187
+\def\deftypefnheaderx #1#2#3 #4\relax{\deftypefnheaderx2728,90323
+\begingroup\defname {name2730,90416
+\deftypefunargs {typefunargs2731,90456
+\def\defmac{\defmac2737,90577
+\def\defmacheader #1#2{\defmacheader2739,90634
+\begingroup\defname {name2740,90710
+\defunargs {unargs2741,90743
+\def\defspec{\defspec2747,90867
+\def\defspecheader #1#2{\defspecheader2749,90928
+\begingroup\defname {name2750,91005
+\defunargs {unargs2751,91045
+\def\deffnx #1 {\deffnx2758,91240
+\def\defunx #1 {\defunx2759,91297
+\def\defmacx #1 {\defmacx2760,91354
+\def\defspecx #1 {\defspecx2761,91413
+\def\deftypefnx #1 {\deftypefnx2762,91474
+\def\deftypeunx #1 {\deftypeunx2763,91539
+\def\defop #1 {\defop2769,91685
+\defopparsebody\Edefop\defopx\defopheader\defoptype}opparsebody\Edefop\defopx\defopheader\defoptype2770,91720
+\def\defopheader #1#2#3{\defopheader2772,91774
+\begingroup\defname {name2774,91863
+\defunargs {unargs2775,91909
+\def\defmethod{\defmethod2780,91970
+\def\defmethodheader #1#2#3{\defmethodheader2782,92043
+\begingroup\defname {name2784,92131
+\defunargs {unargs2785,92171
+\def\defcv #1 {\defcv2790,92245
+\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}opvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype2791,92280
+\def\defcvarheader #1#2#3{\defcvarheader2793,92339
+\begingroup\defname {name2795,92425
+\defvarargs {varargs2796,92471
+\def\defivar{\defivar2801,92544
+\def\defivarheader #1#2#3{\defivarheader2803,92607
+\begingroup\defname {name2805,92693
+\defvarargs {varargs2806,92744
+\def\defopx #1 {\defopx2812,92893
+\def\defmethodx #1 {\defmethodx2813,92950
+\def\defcvx #1 {\defcvx2814,93015
+\def\defivarx #1 {\defivarx2815,93072
+\def\defvarargs #1{\defvarargs2822,93343
+\def\defvr{\defvr2828,93487
+\def\defvrheader #1#2#3{\defvrheader2830,93542
+\begingroup\defname {name2831,93590
+\def\defvar{\defvar2835,93675
+\def\defvarheader #1#2{\defvarheader2837,93735
+\begingroup\defname {name2838,93806
+\defvarargs {varargs2839,93842
+\def\defopt{\defopt2844,93908
+\def\defoptheader #1#2{\defoptheader2846,93968
+\begingroup\defname {name2847,94039
+\defvarargs {varargs2848,94078
+\def\deftypevar{\deftypevar2853,94135
+\def\deftypevarheader #1#2{\deftypevarheader2856,94251
+\begingroup\defname {name2858,94334
+\def\deftypevr{\deftypevr2865,94508
+\def\deftypevrheader #1#2#3{\deftypevrheader2867,94579
+\begingroup\defname {name2868,94631
+\def\defvrx #1 {\defvrx2876,94868
+\def\defvarx #1 {\defvarx2877,94925
+\def\defoptx #1 {\defoptx2878,94984
+\def\deftypevarx #1 {\deftypevarx2879,95043
+\def\deftypevrx #1 {\deftypevrx2880,95110
+\def\deftpargs #1{\deftpargs2885,95259
+\def\deftp{\deftp2889,95339
+\def\deftpheader #1#2#3{\deftpheader2891,95394
+\begingroup\defname {name2892,95442
+\def\deftpx #1 {\deftpx2897,95601
+\def\setref#1{\setref2908,95922
+\def\unnumbsetref#1{\unnumbsetref2913,96036
+\def\appendixsetref#1{\appendixsetref2918,96143
+\def\pxref#1{\pxref2929,96554
+\def\xref#1{\xref2930,96590
+\def\ref#1{\ref2931,96625
+\def\xrefX[#1,#2,#3,#4,#5,#6]{\xrefX[2932,96655
+\def\printedmanual{\printedmanual2933,96698
+\def\printednodename{\printednodename2934,96736
+\def\printednodename{\printednodename2939,96861
+section ``\printednodename'' in \cite{\printedmanual}\printedmanual2954,97493
+\refx{x2957,97571
+\def\dosetq #1#2{\dosetq2965,97791
+\def\internalsetq #1#2{\internalsetq2973,98049
+\def\Ypagenumber{\Ypagenumber2977,98150
+\def\Ytitle{\Ytitle2979,98176
+\def\Ynothing{\Ynothing2981,98203
+\def\Ysectionnumberandtype{\Ysectionnumberandtype2983,98220
+\def\Yappendixletterandtype{\Yappendixletterandtype2992,98536
+\ifnum\secno=0 Appendix\xreftie'char\the\appendixno{no2993,98566
+\else \ifnum \subsecno=0 Section\xreftie'char\the\appendixno.\the\secno %no.\the\secno2994,98621
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno %no.\the\secno.\the\subsecno2996,98725
+Section\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno %no.\the\secno.\the\subsecno.\the\subsubsecno2998,98796
+ \def\linenumber{\linenumber3009,99135
+\def\refx#1#2{\refx3015,99319
+\def\xrdef #1#2{\xrdef3037,99945
+\def\readauxfile{\readauxfile3040,100030
+\def\supereject{\supereject3110,101811
+\footstrut\parindent=\defaultparindent\hang\textindent{aultparindent\hang\textindent3131,102496
+\def\openindices{\openindices3139,102682
+\newdimen\defaultparindent \defaultparindent = 15ptaultparindent3151,102907
+\parindent = \defaultparindentaultparindent3152,102959
+\def\smallbook{\smallbook3175,103683
+\global\def\Esmallexample{\Esmallexample3192,104110
+\def\afourpaper{\afourpaper3196,104201
+\def\finalout{\finalout3224,105009
+\def\normaldoublequote{\normaldoublequote3235,105270
+\def\normaltilde{\normaltilde3236,105296
+\def\normalcaret{\normalcaret3237,105316
+\def\normalunderscore{\normalunderscore3238,105336
+\def\normalverticalbar{\normalverticalbar3239,105361
+\def\normalless{\normalless3240,105387
+\def\normalgreater{\normalgreater3241,105406
+\def\normalplus{\normalplus3242,105428
+\def\ifusingtt#1#2{\ifusingtt3253,105920
+\def\activedoublequote{\activedoublequote3261,106248
+\def~{~3264,106334
+\def^{^3267,106395
+\def_{_3270,106434
+\def\_{\_3272,106508
+\def\lvvmode{\lvvmode3279,106845
+\def|{|3282,106895
+\def<{<3285,106958
+\def>{>3288,107015
+\def+{+3290,107053
+\def\turnoffactive{\turnoffactive3296,107214
+\global\def={=3307,107500
+\def\normalbackslash{\normalbackslash3321,107882
+
+merc-src/accumulator.m,4915
+:- interface146,5371
+:- import_module hlds148,5386
+:- import_module univ152,5478
+:- pred accu_transform_proc159,5793
+:- implementation166,6115
+:- import_module libs180,6552
+:- import_module mdbcomp184,6681
+:- import_module parse_tree186,6742
+:- import_module assoc_list194,7013
+:- import_module bool195,7042
+:- import_module int196,7065
+:- import_module io197,7087
+:- import_module list198,7108
+:- import_module map199,7131
+:- import_module maybe200,7153
+:- import_module pair201,7177
+:- import_module require202,7200
+:- import_module set203,7226
+:- import_module solutions204,7248
+:- import_module string205,7276
+:- import_module term206,7301
+:- import_module varset207,7324
+:- type top_level213,7499
+:- type accu_goal_id225,7900
+:- type accu_case228,7964
+:- type accu_goal_store234,8091
+:- type accu_subst238,8216
+:- type accu_warning240,8264
+accu_transform_proc247,8578
+:- pred generate_warnings334,12550
+generate_warnings337,12669
+:- pred generate_warning342,12895
+generate_warning345,13001
+:- pred should_attempt_accu_transform365,13886
+should_attempt_accu_transform370,14123
+:- pred should_attempt_accu_transform_2398,15406
+should_attempt_accu_transform_2405,15763
+:- pred accu_standardize440,17390
+accu_standardize442,17455
+:- pred identify_goal_type465,18169
+identify_goal_type469,18359
+:- pred is_recursive_case549,21175
+is_recursive_case551,21253
+:- type store_info560,21713
+:- func initialize_goal_store570,22060
+initialize_goal_store573,22166
+:- pred accu_store580,22421
+accu_store584,22576
+:- pred identify_recursive_calls601,23288
+identify_recursive_calls604,23406
+:- pred identify_out_and_out_prime626,24396
+identify_out_and_out_prime631,24631
+:- type accu_sets676,26425
+:- pred accu_stage1689,26977
+accu_stage1693,27155
+:- pred accu_stage1_2727,28347
+accu_stage1_2731,28515
+:- pred accu_sets_init781,30557
+accu_sets_init783,30605
+:- func set_upto796,30984
+set_upto798,31039
+:- pred accu_before812,31498
+accu_before815,31639
+:- pred accu_assoc835,32477
+accu_assoc838,32617
+:- pred accu_construct862,33712
+accu_construct865,33856
+:- pred accu_construct_assoc896,35307
+accu_construct_assoc899,35457
+:- pred accu_update938,37069
+accu_update941,37210
+:- pred member_lessthan_goalid964,38219
+member_lessthan_goalid967,38342
+:- type accu_assoc975,38652
+:- pred accu_is_associative986,39138
+accu_is_associative989,39250
+:- pred associativity_assertion1014,40263
+associativity_assertion1017,40404
+:- pred commutativity_assertion1037,41242
+commutativity_assertion1040,41369
+:- pred accu_is_update1057,41952
+accu_is_update1060,42066
+:- pred is_associative_construction1078,42802
+is_associative_construction1081,42898
+:- type accu_substs1095,43480
+:- type accu_base1103,43744
+:- pred accu_stage21124,44605
+accu_stage21131,44946
+:- pred accu_substs_init1179,46957
+accu_substs_init1182,47097
+:- pred acc_var_subst_init1194,47573
+acc_var_subst_init1198,47718
+:- pred create_new_var1207,48147
+create_new_var1210,48288
+:- pred accu_process_assoc_set1223,48862
+accu_process_assoc_set1229,49150
+:- pred accu_has_heuristic1297,52081
+accu_has_heuristic1299,52161
+:- pred accu_heuristic1304,52336
+accu_heuristic1307,52457
+:- pred accu_process_update_set1318,52906
+accu_process_update_set1325,53221
+:- pred accu_divide_base_case1380,55844
+accu_divide_base_case1385,56059
+:- pred accu_related1412,57146
+accu_related1415,57270
+:- inst stored_goal_plain_call1444,58415
+:- pred lookup_call1449,58601
+lookup_call1452,58715
+:- pred accu_stage31470,59432
+accu_stage31477,59826
+:- pred acc_proc_info1508,61326
+acc_proc_info1512,61485
+:- pred acc_pred_info1556,63449
+acc_pred_info1559,63597
+:- pred accu_create_goal1600,65285
+accu_create_goal1607,65628
+:- func create_acc_call1621,66400
+create_acc_call1625,66569
+:- pred create_orig_goal1634,66987
+create_orig_goal1638,67176
+:- pred create_acc_goal1662,68157
+create_acc_goal1667,68380
+:- func create_new_orig_recursive_goals1709,70225
+create_new_orig_recursive_goals1712,70368
+:- func create_new_recursive_goals1723,70918
+create_new_recursive_goals1727,71108
+:- func create_new_base_goals1738,71717
+create_new_base_goals1741,71831
+:- pred acc_unification1749,72156
+acc_unification1751,72225
+:- pred accu_top_level1766,72896
+accu_top_level1770,73058
+:- pred update_accumulator_pred1856,76290
+update_accumulator_pred1859,76411
+:- func accu_rename1876,77253
+accu_rename1879,77363
+:- func base_case_ids1889,77784
+base_case_ids1891,77846
+:- func base_case_ids_set1898,78048
+base_case_ids_set1900,78113
+:- func accu_goal_list1905,78269
+accu_goal_list1907,78349
+:- pred calculate_goal_info1916,78680
+calculate_goal_info1918,78753
+:- func chain_subst1932,79319
+chain_subst1934,79378
+:- pred chain_subst_21938,79482
+chain_subst_21941,79576
+:- some [T] pred unravel_univ1956,80060
+:- pragma foreign_export1957,80116
+unravel_univ1961,80340
c-src/c.c,76
T f(1,0
@@ -5160,13 +5315,13 @@ extern struct node *yylval;yylval306,6246
unsigned char parse_cell_or_range 309,6291
unsigned char parse_cell_or_range 311,6355
yylex FUN0(315,6405
-parse_cell_or_range FUN2(587,11771
-#define CK_ABS_R(671,13213
-#define CK_REL_R(675,13292
-#define CK_ABS_C(680,13421
-#define CK_REL_C(684,13500
-#define MAYBEREL(689,13629
-str_to_col FUN1(847,16830
+parse_cell_or_range FUN2(587,11772
+#define CK_ABS_R(671,13214
+#define CK_REL_R(675,13293
+#define CK_ABS_C(680,13422
+#define CK_REL_C(684,13501
+#define MAYBEREL(689,13630
+str_to_col FUN1(847,16831
y-src/parse.c,520
#define YYBISON 4,64
diff --git a/test/manual/etags/Makefile b/test/manual/etags/Makefile
index c1df703905e..b3a82fdba8d 100644
--- a/test/manual/etags/Makefile
+++ b/test/manual/etags/Makefile
@@ -16,6 +16,7 @@ HTMLSRC=$(addprefix ./html-src/,softwarelibero.html index.shtml algrthms.html so
#JAVASRC=$(addprefix ./java-src/, )
LUASRC=$(addprefix ./lua-src/,allegro.lua test.lua)
MAKESRC=$(addprefix ./make-src/,Makefile)
+MERCSRC=$(addprefix ./merc-src/,accumulator.m)
OBJCSRC=$(addprefix ./objc-src/,Subprocess.h Subprocess.m PackInsp.h PackInsp.m)
OBJCPPSRC=$(addprefix ./objcpp-src/,SimpleCalc.H SimpleCalc.M)
PASSRC=$(addprefix ./pas-src/,common.pas)
@@ -25,13 +26,14 @@ PSSRC=$(addprefix ./ps-src/,rfc1245.ps)
PROLSRC=$(addprefix ./prol-src/,ordsets.prolog natded.prolog)
PYTSRC=$(addprefix ./pyt-src/,server.py)
RBSRC=$(addprefix ./ruby-src/,test.rb test1.ru)
+RSSRC=$(addprefix ./rs-src/,test.rs)
SCMSRC=$(addprefix ./scm-src/,test.scm)
TEXSRC=$(addprefix ./tex-src/,testenv.tex gzip.texi texinfo.tex nonewline.tex)
YSRC=$(addprefix ./y-src/,parse.y parse.c atest.y cccp.c cccp.y)
SRCS=${ADASRC} ${ASRC} ${CSRC} ${CPSRC} ${ELSRC} ${ERLSRC} ${FSRC}\
${FORTHSRC} ${GOSRC} ${HTMLSRC} ${JAVASRC} ${LUASRC} ${MAKESRC}\
${OBJCSRC} ${OBJCPPSRC} ${PASSRC} ${PHPSRC} ${PERLSRC} ${PSSRC}\
- ${PROLSRC} ${PYTSRC} ${RBSRC} ${SCMSRC} ${TEXSRC} ${YSRC}
+ ${PROLSRC} ${PYTSRC} ${RBSRC} ${RSSRC} ${SCMSRC} ${TEXSRC} ${YSRC} ${MERCSRC}
NONSRCS=./f-src/entry.strange ./erl-src/lists.erl ./cp-src/clheir.hpp.gz
ETAGS_PROG=../../../lib-src/etags
diff --git a/test/manual/etags/README b/test/manual/etags/README
new file mode 100644
index 00000000000..7bce861030b
--- /dev/null
+++ b/test/manual/etags/README
@@ -0,0 +1,60 @@
+This directory contains the test suite for the 'etags' and 'ctags'
+programs.
+
+The input files, which include source files in various languages
+supported by the programs, are in the *-src/ directories (e.g., c-src
+for C sources, ada-src for Ada, tex-src for TeX, etc.).
+
+The expected results are slightly different for each of the 7 commands
+(see below) run by the test suite, and are on files ETAGS.good_N
+(where N is between 1 and 6) and CTAGS.good.
+
+To run the tests, say
+
+ make check
+
+in this directory. This should run the programs 7 times with various
+command line switches, and should not show any differences between the
+produced file ETAGS/CTAGS and the corresponding expected results. Any
+diffs shown by the 'diff' utility should be examined for potential
+regressions in 'etags' or 'ctags'.
+
+In some cases, diffs should be expected. These include:
+
+ . adding new input files in the *-src/ directories
+ . routine changes in the existing input files, such as the yearly
+ update of copyright years, spelling changes, etc.
+ . adding new features to etags.c
+
+When the diffs are expected, they should be examined to make sure
+there are no regressions. To do so, compare the line numbers and byte
+offsets shown in the new ETAGS/CTAGS files against the up-to-date
+input files, and make sure the new values match, whereas the old one
+don't. Also make sure there no new or missing entries in the
+ETAGS/CTAGS files as compared with the expected results. (When new
+input files are added, there obviously will be new entries -- these
+should be compared to the input files to verify correctness.)
+
+Once the differences are deemed to be justified, i.e. you decide that
+the new ETAGS/CTAGS file should become the new expected result, you
+should copy the ETAGS/CTAGS files produced by the test run to the
+corresponding "good" files, one by one. Like this:
+
+ $ make check
+ $ cp ETAGS ETAGS.good_1
+ $ make check
+ $ cp ETAGS ETAGS.good_2
+ $ make check
+ $ cp ETAGS ETAGS.good_3
+ ...
+ $ make check
+ $ cp ETAGS ETAGS.good_6
+ $ make check
+ $ cp CTAGS CTAGS.good
+
+This uses the fact that "make check" will stop after the first
+failure, i.e. after the first time 'diff' reports any diffs, and then
+the ETAGS/CTAGS file from the last invocation is available for
+becoming the new expected-result file. Alternatively, you can see the
+name of the expected-result file which needs to be updated in the
+output of the 'diff' utility.
diff --git a/test/manual/etags/el-src/TAGTEST.EL b/test/manual/etags/el-src/TAGTEST.EL
index 89a67913771..3e6599a4a45 100644
--- a/test/manual/etags/el-src/TAGTEST.EL
+++ b/test/manual/etags/el-src/TAGTEST.EL
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t -*-
+
(foo::defmumble bletch beuarghh)
(defun foo==bar () (message "hi")) ; Bug#5624
;;; Ctags test file for lisp mode.
diff --git a/test/manual/etags/merc-src/accumulator.m b/test/manual/etags/merc-src/accumulator.m
new file mode 100644
index 00000000000..c82dbf58ff8
--- /dev/null
+++ b/test/manual/etags/merc-src/accumulator.m
@@ -0,0 +1,1962 @@
+%---------------------------------------------------------------------------%
+% vim: ft=mercury ts=4 sw=4 et
+%---------------------------------------------------------------------------%
+% Copyright (C) 1999-2000,2002-2007, 2009-2012 The University of Melbourne.
+% Copyright (C) 2015 The Mercury team.
+% This file may only be copied under the terms of the GNU General
+% Public License - see the file COPYING in the Mercury distribution.
+%---------------------------------------------------------------------------%
+%
+% Module: accumulator.m.
+% Main authors: petdr.
+%
+% Attempts to transform a single proc to a tail recursive form by
+% introducing accumulators. The algorithm can do this if the code after
+% the recursive call has either the order independent state update or
+% associative property.
+%
+% /* Order independent State update property */
+% :- promise all [A,B,S0,S]
+% (
+% (some[SA] (update(A, S0, SA), update(B, SA, S)))
+% <=>
+% (some[SB] (update(B, S0, SB), update(A, SB, S)))
+% ).
+%
+% /* Associativity property */
+% :- promise all [A,B,C,ABC]
+% (
+% (some[AB] (assoc(A, B, AB), assoc(AB, C, ABC)))
+% <=>
+% (some[BC] (assoc(B, C, BC), assoc(A, BC, ABC)))
+% ).
+%
+% XXX What about exceptions and non-termination?
+%
+% The promise declarations above only provide promises about the declarative
+% semantics, but in order to apply this optimization, we ought to check that
+% it will preserve the operational semantics (modulo whatever changes are
+% allowed by the language semantics options).
+%
+% Currently we check and respect the --fully-strict option, but not the
+% --no-reorder-conj option. XXX we should check --no-reorder-conj!
+% If --no-reorder-conj was set, it would still be OK to apply this
+% transformation, but ONLY in cases where the goals which get reordered
+% are guaranteed not to throw any exceptions.
+%
+% The algorithm implemented is a combination of the algorithms from
+% "Making Mercury Programs Tail Recursive" and
+% "State Update Transformation", which can be found at
+% <http://www.cs.mu.oz.au/research/mercury/information/papers.html>.
+%
+% Note that currently "State Update Transformation" paper only resides
+% in CVS papers archive in the directory update, but has been submitted
+% to PPDP '00.
+%
+% The transformation recognises predicates in the form
+%
+% p(In, OutUpdate, OutAssoc) :-
+% minimal(In),
+% initialize(OutUpdate),
+% base(OutAssoc).
+% p(In, OutUpdate, OutAssoc) :-
+% decompose(In, Current, Rest),
+% p(Rest, OutUpdate0, OutAssoc0),
+% update(Current, OutUpdate0, OutUpdate),
+% assoc(Current, OutAssoc0, OutAssoc).
+%
+% which can be transformed by the algorithm in "State Update Transformation" to
+%
+% p(In, OutUpdate, OutAssoc) :-
+% initialize(AccUpdate),
+% p_acc(In, OutUpdate, OutAssoc, AccUpdate).
+%
+% p_acc(In, OutUpdate, OutAssoc, AccUpdate) :-
+% minimal(In),
+% base(OutAssoc),
+% OutUpdate = AccUpdate.
+% p_acc(In, OutUpdate, OutAssoc, AccUpdate0) :-
+% decompose(In, Current, Rest),
+% update(Current, AccUpdate0, AccUpdate),
+% p_acc(Rest, OutUpdate, OutAssoc0, AccUpdate),
+% assoc(Current, OutAssoc0, OutAssoc).
+%
+% we then apply the algorithm from "Making Mercury Programs Tail Recursive"
+% to p_acc to obtain
+%
+% p_acc(In, OutUpdate, OutAssoc, AccUpdate) :-
+% minimal(In),
+% base(OutAssoc),
+% OutUpdate = AccUpdate.
+% p_acc(In, OutUpdate, OutAssoc, AccUpdate0) :-
+% decompose(In, Current, Rest),
+% update(Current, AccUpdate0, AccUpdate),
+% p_acc2(Rest, OutUpdate, OutAssoc, AccUpdate, Current).
+%
+% p_acc2(In, OutUpdate, OutAssoc, AccUpdate0, AccAssoc0) :-
+% minimal(In),
+% base(Base),
+% assoc(AccAssoc0, Base, OutAssoc),
+% OutUpdate = AccUpdate0.
+% p_acc2(In, OutUpdate, OutAssoc, AccUpdate0, AccAssoc0) :-
+% decompose(In, Current, Rest),
+% update(Current, AccUpdate0, AccUpdate),
+% assoc(AccAssoc0, Current, AccAssoc),
+% p_acc2(Rest, OutUpdate, OutAssoc, AccUpdate, AccAssoc).
+%
+% p_acc is no longer recursive and is only ever called from p, so we
+% inline p_acc into p to obtain the final schema.
+%
+% p(In, OutUpdate, OutAssoc) :-
+% minimal(In),
+% base(OutAssoc),
+% initialize(AccUpdate),
+% OutUpdate = AccUpdate.
+% p(In, OutUpdate, OutAssoc) :-
+% decompose(In, Current, Rest),
+% initialize(AccUpdate0),
+% update(Current, AccUpdate0, AccUpdate),
+% p_acc2(Rest, OutUpdate, OutAssoc, AccUpdate, Current).
+%
+% p_acc2(In, OutUpdate, OutAssoc, AccUpdate0, AccAssoc0) :-
+% minimal(In),
+% base(Base),
+% assoc(AccAssoc0, Base, OutAssoc),
+% OutUpdate = AccUpdate0.
+% p_acc2(In, OutUpdate, OutAssoc, AccUpdate0, AccAssoc0) :-
+% decompose(In, Current, Rest),
+% update(Current, AccUpdate0, AccUpdate),
+% assoc(AccAssoc0, Current, AccAssoc),
+% p_acc2(Rest, OutUpdate, OutAssoc, AccUpdate, AccAssoc).
+%
+% The only real difficulty in this new transformation is identifying the
+% initialize/1 and base/1 goals from the original base case.
+%
+% Note that if the recursive clause contains multiple calls to p, the
+% transformation attempts to move each recursive call to the end
+% until one succeeds. This makes the order of independent recursive
+% calls in the body irrelevant.
+%
+% XXX Replace calls to can_reorder_goals with calls to the version that
+% use the intermodule-analysis framework.
+%
+%---------------------------------------------------------------------------%
+
+:- module transform_hlds.accumulator.
+:- interface.
+
+:- import_module hlds.
+:- import_module hlds.hlds_module.
+:- import_module hlds.hlds_pred.
+
+:- import_module univ.
+
+ % Attempt to transform a procedure into accumulator recursive form.
+ % If we succeed, we will add the recursive version of the procedure
+ % to the module_info. However, we may also encounter errors, which
+ % we will add to the list of error_specs in the univ accumulator.
+ %
+:- pred accu_transform_proc(pred_proc_id::in, pred_info::in,
+ proc_info::in, proc_info::out, module_info::in, module_info::out,
+ univ::in, univ::out) is det.
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- implementation.
+
+:- import_module hlds.assertion.
+:- import_module hlds.goal_util.
+:- import_module hlds.hlds_error_util.
+:- import_module hlds.hlds_goal.
+:- import_module hlds.hlds_out.
+:- import_module hlds.hlds_out.hlds_out_util.
+:- import_module hlds.hlds_promise.
+:- import_module hlds.instmap.
+:- import_module hlds.pred_table.
+:- import_module hlds.quantification.
+:- import_module hlds.status.
+:- import_module hlds.vartypes.
+:- import_module libs.
+:- import_module libs.globals.
+:- import_module libs.optimization_options.
+:- import_module libs.options.
+:- import_module mdbcomp.
+:- import_module mdbcomp.sym_name.
+:- import_module parse_tree.
+:- import_module parse_tree.error_util.
+:- import_module parse_tree.prog_data.
+:- import_module parse_tree.prog_mode.
+:- import_module parse_tree.prog_util.
+:- import_module parse_tree.set_of_var.
+:- import_module transform_hlds.goal_store.
+
+:- import_module assoc_list.
+:- import_module bool.
+:- import_module int.
+:- import_module io.
+:- import_module list.
+:- import_module map.
+:- import_module maybe.
+:- import_module pair.
+:- import_module require.
+:- import_module set.
+:- import_module solutions.
+:- import_module string.
+:- import_module term.
+:- import_module varset.
+
+%---------------------------------------------------------------------------%
+
+ % The form of the goal around the base and recursive cases.
+ %
+:- type top_level
+ ---> switch_base_rec
+ ; switch_rec_base
+ ; disj_base_rec
+ ; disj_rec_base
+ ; ite_base_rec
+ ; ite_rec_base.
+
+ % An accu_goal_id represents a goal. The first field says which conjunction
+ % the goal came from (the base case or the recursive case), and the second
+ % gives the location of the goal in that conjunction.
+ %
+:- type accu_goal_id
+ ---> accu_goal_id(accu_case, int).
+
+:- type accu_case
+ ---> accu_base
+ ; accu_rec.
+
+ % The goal_store associates a goal with each goal_id.
+ %
+:- type accu_goal_store == goal_store(accu_goal_id).
+
+ % A substitution from the first variable name to the second.
+ %
+:- type accu_subst == map(prog_var, prog_var).
+
+:- type accu_warning
+ ---> accu_warn(prog_context, pred_id, prog_var, prog_var).
+ % Warn that two prog_vars in a call to pred_id at the given context
+ % were swapped, which may cause an efficiency problem.
+
+%---------------------------------------------------------------------------%
+
+accu_transform_proc(proc(PredId, ProcId), PredInfo, !ProcInfo, !ModuleInfo,
+ !Cookie) :-
+ module_info_get_globals(!.ModuleInfo, Globals),
+ globals.get_opt_tuple(Globals, OptTuple),
+ DoLCMC = OptTuple ^ ot_opt_lcmc_accumulator,
+ globals.lookup_bool_option(Globals, fully_strict, FullyStrict),
+ ( if
+ should_attempt_accu_transform(!ModuleInfo, PredId, ProcId, PredInfo,
+ !ProcInfo, FullyStrict, DoLCMC, Warnings)
+ then
+ globals.lookup_bool_option(Globals, very_verbose, VeryVerbose),
+ (
+ VeryVerbose = yes,
+ trace [io(!IO)] (
+ module_info_get_name(!.ModuleInfo, ModuleName),
+ get_progress_output_stream(Globals, ModuleName,
+ ProgressStream, !IO),
+ PredStr = pred_id_to_string(!.ModuleInfo, PredId),
+ io.format(ProgressStream,
+ "%% Accumulators introduced into %s\n", [s(PredStr)], !IO)
+ )
+ ;
+ VeryVerbose = no
+ ),
+
+ (
+ Warnings = []
+ ;
+ Warnings = [_ | _],
+ pred_info_get_context(PredInfo, Context),
+ PredPieces = describe_one_pred_name(!.ModuleInfo,
+ should_module_qualify, PredId),
+ InPieces = [words("In") | PredPieces] ++ [suffix(":"), nl],
+ InMsg = simple_msg(Context,
+ [option_is_set(warn_accumulator_swaps, yes,
+ [always(InPieces)])]),
+
+ proc_info_get_varset(!.ProcInfo, VarSet),
+ generate_warnings(!.ModuleInfo, VarSet, Warnings, WarnMsgs),
+ (
+ Warnings = [_],
+ EnsurePieces = [words("Please ensure that this"),
+ words("argument rearrangement does not introduce"),
+ words("performance problems.")]
+ ;
+ Warnings = [_, _ | _],
+ EnsurePieces = [words("Please ensure that these"),
+ words("argument rearrangements do not introduce"),
+ words("performance problems.")]
+ ),
+ SuppressPieces =
+ [words("These warnings can be suppressed by"),
+ quote("--no-warn-accumulator-swaps"), suffix(".")],
+ VerbosePieces = [words("If a predicate has been declared"),
+ words("associative"),
+ words("via a"), quote("promise"), words("declaration,"),
+ words("the compiler will rearrange the order of"),
+ words("the arguments in calls to that predicate,"),
+ words("if by so doing it makes the containing predicate"),
+ words("tail recursive. In such situations, the compiler"),
+ words("will issue this warning. If this reordering"),
+ words("changes the performance characteristics"),
+ words("of the call to the predicate, use"),
+ quote("--no-accumulator-introduction"),
+ words("to turn the optimization off, or "),
+ quote("--no-warn-accumulator-swaps"),
+ words("to turn off the warnings.")],
+ EnsureSuppressMsg = simple_msg(Context,
+ [option_is_set(warn_accumulator_swaps, yes,
+ [always(EnsurePieces), always(SuppressPieces)]),
+ verbose_only(verbose_once, VerbosePieces)]),
+ Severity = severity_conditional(warn_accumulator_swaps, yes,
+ severity_warning, no),
+ Msgs = [InMsg | WarnMsgs] ++ [EnsureSuppressMsg],
+ Spec = error_spec($pred, Severity, phase_accumulator_intro, Msgs),
+
+ det_univ_to_type(!.Cookie, Specs0),
+ Specs = [Spec | Specs0],
+ type_to_univ(Specs, !:Cookie)
+ )
+ else
+ true
+ ).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- pred generate_warnings(module_info::in, prog_varset::in,
+ list(accu_warning)::in, list(error_msg)::out) is det.
+
+generate_warnings(_, _, [], []).
+generate_warnings(ModuleInfo, VarSet, [Warning | Warnings], [Msg | Msgs]) :-
+ generate_warning(ModuleInfo, VarSet, Warning, Msg),
+ generate_warnings(ModuleInfo, VarSet, Warnings, Msgs).
+
+:- pred generate_warning(module_info::in, prog_varset::in, accu_warning::in,
+ error_msg::out) is det.
+
+generate_warning(ModuleInfo, VarSet, Warning, Msg) :-
+ Warning = accu_warn(Context, PredId, VarA, VarB),
+ PredPieces = describe_one_pred_name(ModuleInfo, should_module_qualify,
+ PredId),
+
+ varset.lookup_name(VarSet, VarA, VarAName),
+ varset.lookup_name(VarSet, VarB, VarBName),
+
+ Pieces = [words("warning: the call to")] ++ PredPieces ++
+ [words("has had the location of the variables"),
+ quote(VarAName), words("and"), quote(VarBName),
+ words("swapped to allow accumulator introduction."), nl],
+ Msg = simplest_msg(Context, Pieces).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % should_attempt_accu_transform is only true iff the current proc
+ % has been transformed to call the newly created accumulator proc.
+ %
+:- pred should_attempt_accu_transform(module_info::in, module_info::out,
+ pred_id::in, proc_id::in, pred_info::in, proc_info::in, proc_info::out,
+ bool::in, maybe_opt_lcmc_accumulator::in,
+ list(accu_warning)::out) is semidet.
+
+should_attempt_accu_transform(!ModuleInfo, PredId, ProcId, PredInfo,
+ !ProcInfo, FullyStrict, DoLCMC, Warnings) :-
+ proc_info_get_goal(!.ProcInfo, Goal0),
+ proc_info_get_headvars(!.ProcInfo, HeadVars),
+ proc_info_get_initial_instmap(!.ModuleInfo, !.ProcInfo, InitialInstMap),
+ accu_standardize(Goal0, Goal),
+ identify_goal_type(PredId, ProcId, Goal, InitialInstMap,
+ TopLevel, Base, BaseInstMap, Rec, RecInstMap),
+
+ C = initialize_goal_store(Rec, RecInstMap, Base, BaseInstMap),
+ identify_recursive_calls(PredId, ProcId, C, RecCallIds),
+ list.length(Rec, M),
+
+ should_attempt_accu_transform_2(!ModuleInfo, PredId, PredInfo, !ProcInfo,
+ HeadVars, InitialInstMap, TopLevel, FullyStrict, DoLCMC,
+ RecCallIds, C, M, Rec, Warnings).
+
+ % should_attempt_accu_transform_2 takes a list of locations of the
+ % recursive calls, and attempts to introduce accumulator into each of the
+ % recursive calls, stopping at the first one that succeeds.
+ % This catches the following case, as selecting the first recursive call
+ % allows the second recursive call to be moved before it, and
+ % OutA is in the correct spot in list.append.
+ %
+ % p(InA, OutA),
+ % p(InB, OutB),
+ % list.append(OutB, OutA, Out)
+ %
+:- pred should_attempt_accu_transform_2(module_info::in, module_info::out,
+ pred_id::in, pred_info::in, proc_info::in, proc_info::out,
+ list(prog_var)::in, instmap::in, top_level::in, bool::in,
+ maybe_opt_lcmc_accumulator::in,
+ list(accu_goal_id)::in, accu_goal_store::in, int::in, list(hlds_goal)::in,
+ list(accu_warning)::out) is semidet.
+
+should_attempt_accu_transform_2(!ModuleInfo, PredId, PredInfo, !ProcInfo,
+ HeadVars, InitialInstMap, TopLevel, FullyStrict, DoLCMC,
+ [Id | Ids], C, M, Rec, Warnings) :-
+ proc_info_get_vartypes(!.ProcInfo, VarTypes0),
+ identify_out_and_out_prime(!.ModuleInfo, VarTypes0, InitialInstMap,
+ Id, Rec, HeadVars, Out, OutPrime, HeadToCallSubst, CallToHeadSubst),
+ ( if
+ accu_stage1(!.ModuleInfo, VarTypes0, FullyStrict, DoLCMC, Id, M, C,
+ Sets),
+ accu_stage2(!.ModuleInfo, !.ProcInfo, Id, C, Sets, OutPrime, Out,
+ VarSet, VarTypes, Accs, BaseCase, BasePairs, Substs, CS,
+ WarningsPrime),
+ accu_stage3(Id, Accs, VarSet, VarTypes, C, CS, Substs,
+ HeadToCallSubst, CallToHeadSubst, BaseCase, BasePairs, Sets, Out,
+ TopLevel, PredId, PredInfo, !ProcInfo, !ModuleInfo)
+ then
+ Warnings = WarningsPrime
+ else
+ should_attempt_accu_transform_2(!ModuleInfo, PredId, PredInfo,
+ !ProcInfo, HeadVars, InitialInstMap, TopLevel, FullyStrict, DoLCMC,
+ Ids, C, M, Rec, Warnings)
+ ).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % Transform the goal into a standard form that is amenable to
+ % introducing accumulators.
+ %
+ % At the moment all this does is remove any extra disj/conj wrappers
+ % around the top level goal.
+ %
+ % Future work is for this code to rearrange code with multiple base
+ % and recursive cases into a single base and recursive case.
+ %
+:- pred accu_standardize(hlds_goal::in, hlds_goal::out) is det.
+
+accu_standardize(Goal0, Goal) :-
+ ( if
+ Goal0 = hlds_goal(GoalExpr0, _),
+ (
+ GoalExpr0 = conj(plain_conj, [Goal1])
+ ;
+ GoalExpr0 = disj([Goal1])
+ )
+ then
+ accu_standardize(Goal1, Goal)
+ else
+ Goal = Goal0
+ ).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % This predicate takes the original goal and identifies the `shape'
+ % of the goal around the recursive and base cases.
+ %
+ % Note that the base case can contain a recursive call, as the
+ % transformation doesn't depend on what is in the base case.
+ %
+:- pred identify_goal_type(pred_id::in, proc_id::in, hlds_goal::in,
+ instmap::in, top_level::out, list(hlds_goal)::out, instmap::out,
+ list(hlds_goal)::out, instmap::out) is semidet.
+
+identify_goal_type(PredId, ProcId, Goal, InitialInstMap, Type,
+ Base, BaseInstMap, Rec, RecInstMap) :-
+ Goal = hlds_goal(GoalExpr, _GoalInfo),
+ (
+ GoalExpr = switch(_Var, _CanFail, Cases),
+ ( if
+ Cases = [case(_IdA, [], GoalA), case(_IdB, [], GoalB)],
+ goal_to_conj_list(GoalA, GoalAList),
+ goal_to_conj_list(GoalB, GoalBList)
+ then
+ ( if is_recursive_case(GoalAList, proc(PredId, ProcId)) then
+ Type = switch_rec_base,
+ Base = GoalBList,
+ Rec = GoalAList
+ else if is_recursive_case(GoalBList, proc(PredId, ProcId)) then
+ Type = switch_base_rec,
+ Base = GoalAList,
+ Rec = GoalBList
+ else
+ fail
+ ),
+ BaseInstMap = InitialInstMap,
+ RecInstMap = InitialInstMap
+ else
+ fail
+ )
+ ;
+ GoalExpr = disj(Goals),
+ ( if
+ Goals = [GoalA, GoalB],
+ goal_to_conj_list(GoalA, GoalAList),
+ goal_to_conj_list(GoalB, GoalBList)
+ then
+ ( if is_recursive_case(GoalAList, proc(PredId, ProcId)) then
+ Type = disj_rec_base,
+ Base = GoalBList,
+ Rec = GoalAList
+ else if is_recursive_case(GoalBList, proc(PredId, ProcId)) then
+ Type = disj_base_rec,
+ Base = GoalAList,
+ Rec = GoalBList
+ else
+ fail
+ ),
+ BaseInstMap = InitialInstMap,
+ RecInstMap = InitialInstMap
+ else
+ fail
+ )
+ ;
+ GoalExpr = if_then_else(_Vars, Cond, Then, Else),
+ Cond = hlds_goal(_CondGoalExpr, CondGoalInfo),
+ CondInstMapDelta = goal_info_get_instmap_delta(CondGoalInfo),
+
+ goal_to_conj_list(Then, GoalAList),
+ goal_to_conj_list(Else, GoalBList),
+ ( if is_recursive_case(GoalAList, proc(PredId, ProcId)) then
+ Type = ite_rec_base,
+ Base = GoalBList,
+ Rec = GoalAList,
+
+ BaseInstMap = InitialInstMap,
+ apply_instmap_delta(CondInstMapDelta, InitialInstMap, RecInstMap)
+ else if is_recursive_case(GoalBList, proc(PredId, ProcId)) then
+ Type = ite_base_rec,
+ Base = GoalAList,
+ Rec = GoalBList,
+
+ RecInstMap = InitialInstMap,
+ apply_instmap_delta(CondInstMapDelta, InitialInstMap, BaseInstMap)
+ else
+ fail
+ )
+ ).
+
+ % is_recursive_case(Gs, Id) is true iff the list of goals, Gs,
+ % contains a call to the procedure specified by Id, where the call
+ % is located in a position that can be used by the transformation
+ % (i.e. not hidden in a compound goal).
+ %
+:- pred is_recursive_case(list(hlds_goal)::in, pred_proc_id::in) is semidet.
+
+is_recursive_case(Goals, proc(PredId, ProcId)) :-
+ list.append(_Initial, [RecursiveCall | _Final], Goals),
+ RecursiveCall = hlds_goal(plain_call(PredId, ProcId, _, _, _, _), _).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % The store info is folded over the list of goals which
+ % represent the base and recursive case conjunctions.
+:- type store_info
+ ---> store_info(
+ store_loc :: int,
+ % The location of the goal in the conjunction.
+ store_instmap :: instmap,
+ store_goals :: accu_goal_store
+ ).
+
+ % Initialise the goal_store, which will hold the C_{a,b} goals.
+ %
+:- func initialize_goal_store(list(hlds_goal), instmap,
+ list(hlds_goal), instmap) = accu_goal_store.
+
+initialize_goal_store(Rec, RecInstMap, Base, BaseInstMap) = C :-
+ goal_store_init(C0),
+ list.foldl3(accu_store(accu_rec), Rec,
+ 1, _, RecInstMap, _, C0, C1),
+ list.foldl3(accu_store(accu_base), Base,
+ 1, _, BaseInstMap, _, C1, C).
+
+:- pred accu_store(accu_case::in, hlds_goal::in,
+ int::in, int::out, instmap::in, instmap::out,
+ accu_goal_store::in, accu_goal_store::out) is det.
+
+accu_store(Case, Goal, !N, !InstMap, !GoalStore) :-
+ Id = accu_goal_id(Case, !.N),
+ goal_store_det_insert(Id, stored_goal(Goal, !.InstMap), !GoalStore),
+
+ !:N = !.N + 1,
+ Goal = hlds_goal(_, GoalInfo),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
+ apply_instmap_delta(InstMapDelta, !InstMap).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % Determine the k's which are recursive calls.
+ % Note that this doesn't find recursive calls which are `hidden'
+ % in compound goals, this is not a problem as currently we can't use
+ % these to do transformation.
+ %
+:- pred identify_recursive_calls(pred_id::in, proc_id::in,
+ accu_goal_store::in, list(accu_goal_id)::out) is det.
+
+identify_recursive_calls(PredId, ProcId, GoalStore, Ids) :-
+ P =
+ ( pred(Key::out) is nondet :-
+ goal_store_member(GoalStore, Key, stored_goal(Goal, _InstMap)),
+ Key = accu_goal_id(accu_rec, _),
+ Goal = hlds_goal(plain_call(PredId, ProcId, _, _, _, _), _)
+ ),
+ solutions.solutions(P, Ids).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % Determine the variables which are members of the sets Out and Out',
+ % and initialize the substitutions between the two sets.
+ %
+ % This is done by identifing those variables whose instantiatedness change
+ % in the goals after the recursive call and are headvars.
+ %
+ % Note that we are only identifying the output variables which will need
+ % to be accumulated, as there may be other output variables which are
+ % produced prior to the recursive call.
+ %
+:- pred identify_out_and_out_prime(module_info::in, vartypes::in, instmap::in,
+ accu_goal_id::in, list(hlds_goal)::in,
+ list(prog_var)::in, list(prog_var)::out, list(prog_var)::out,
+ accu_subst::out, accu_subst::out) is det.
+
+identify_out_and_out_prime(ModuleInfo, VarTypes, InitialInstMap, GoalId,
+ Rec, HeadVars, Out, OutPrime, HeadToCallSubst, CallToHeadSubst) :-
+ GoalId = accu_goal_id(_Case, K),
+ ( if
+ list.take(K, Rec, InitialGoals),
+ list.drop(K-1, Rec, FinalGoals),
+ FinalGoals = [hlds_goal(plain_call(_, _, Args, _, _, _), _) | Rest]
+ then
+ goal_list_instmap_delta(InitialGoals, InitInstMapDelta),
+ apply_instmap_delta( InitInstMapDelta,
+ InitialInstMap, InstMapBeforeRest),
+
+ goal_list_instmap_delta(Rest, InstMapDelta),
+ apply_instmap_delta(InstMapDelta, InstMapBeforeRest, InstMapAfterRest),
+
+ instmap_changed_vars(ModuleInfo, VarTypes,
+ InstMapBeforeRest, InstMapAfterRest, ChangedVars),
+
+ assoc_list.from_corresponding_lists(HeadVars, Args, HeadArg0),
+
+ Member =
+ ( pred(M::in) is semidet :-
+ M = HeadVar - _,
+ set_of_var.member(ChangedVars, HeadVar)
+ ),
+ list.filter(Member, HeadArg0, HeadArg),
+ list.map(fst, HeadArg, Out),
+ list.map(snd, HeadArg, OutPrime),
+
+ map.from_assoc_list(HeadArg, HeadToCallSubst),
+
+ list.map((pred(X-Y::in, Y-X::out) is det), HeadArg, ArgHead),
+ map.from_assoc_list(ArgHead, CallToHeadSubst)
+ else
+ unexpected($pred, "test failed")
+ ).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % For each goal after the recursive call, we place that goal
+ % into a set according to what properties that goal has.
+ % For the definition of what goes into each set, inspect the documentation
+ % for the functions named before, assoc, and so on.
+ %
+:- type accu_sets
+ ---> accu_sets(
+ as_before :: set(accu_goal_id),
+ as_assoc :: set(accu_goal_id),
+ as_construct_assoc :: set(accu_goal_id),
+ as_construct :: set(accu_goal_id),
+ as_update :: set(accu_goal_id),
+ as_reject :: set(accu_goal_id)
+ ).
+
+ % Stage 1 is responsible for identifying which goals are associative,
+ % which can be moved before the recursive call and so on.
+ %
+:- pred accu_stage1(module_info::in, vartypes::in, bool::in,
+ maybe_opt_lcmc_accumulator::in, accu_goal_id::in, int::in,
+ accu_goal_store::in, accu_sets::out) is semidet.
+
+accu_stage1(ModuleInfo, VarTypes, FullyStrict, DoLCMC, GoalId, M, GoalStore,
+ Sets) :-
+ GoalId = accu_goal_id(Case, K),
+ NextGoalId = accu_goal_id(Case, K + 1),
+ accu_sets_init(Sets0),
+ accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, NextGoalId, K, M,
+ GoalStore, Sets0, Sets1),
+ Sets1 = accu_sets(Before, Assoc,
+ ConstructAssoc, Construct, Update, Reject),
+ Sets = accu_sets(Before `set.union` set_upto(Case, K - 1), Assoc,
+ ConstructAssoc, Construct, Update, Reject),
+
+ % Continue the transformation only if the set reject is empty and
+ % the set assoc or update contains something that needs to be moved
+ % before the recursive call.
+ set.is_empty(Reject),
+ (
+ not set.is_empty(Assoc)
+ ;
+ not set.is_empty(Update)
+ ),
+ (
+ DoLCMC = do_not_opt_lcmc_accumulator,
+ % If LCMC is not turned on, then there must be no construction
+ % unifications after the recursive call.
+ set.is_empty(Construct),
+ set.is_empty(ConstructAssoc)
+ ;
+ DoLCMC = opt_lcmc_accumulator
+ ).
+
+ % For each goal after the recursive call decide which set
+ % the goal belongs to.
+ %
+:- pred accu_stage1_2(module_info::in, vartypes::in, bool::in,
+ accu_goal_id::in, int::in, int::in, accu_goal_store::in,
+ accu_sets::in, accu_sets::out) is det.
+
+accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, GoalId, K, M, GoalStore,
+ !Sets) :-
+ GoalId = accu_goal_id(Case, I),
+ NextGoalId = accu_goal_id(Case, I + 1),
+ ( if I > M then
+ true
+ else
+ ( if
+ accu_before(ModuleInfo, VarTypes, FullyStrict, GoalId, K,
+ GoalStore, !.Sets)
+ then
+ !Sets ^ as_before := set.insert(!.Sets ^ as_before, GoalId),
+ accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, NextGoalId, K, M,
+ GoalStore, !Sets)
+ else if
+ accu_assoc(ModuleInfo, VarTypes, FullyStrict, GoalId, K,
+ GoalStore, !.Sets)
+ then
+ !Sets ^ as_assoc := set.insert(!.Sets ^ as_assoc, GoalId),
+ accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, NextGoalId, K, M,
+ GoalStore, !Sets)
+ else if
+ accu_construct(ModuleInfo, VarTypes, FullyStrict, GoalId, K,
+ GoalStore, !.Sets)
+ then
+ !Sets ^ as_construct := set.insert(!.Sets ^ as_construct, GoalId),
+ accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, NextGoalId, K, M,
+ GoalStore, !Sets)
+ else if
+ accu_construct_assoc(ModuleInfo, VarTypes, FullyStrict, GoalId, K,
+ GoalStore, !.Sets)
+ then
+ !Sets ^ as_construct_assoc :=
+ set.insert(!.Sets ^ as_construct_assoc, GoalId),
+ accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, NextGoalId, K, M,
+ GoalStore, !Sets)
+ else if
+ accu_update(ModuleInfo, VarTypes, FullyStrict, GoalId, K,
+ GoalStore, !.Sets)
+ then
+ !Sets ^ as_update := set.insert(!.Sets ^ as_update, GoalId),
+ accu_stage1_2(ModuleInfo, VarTypes, FullyStrict, NextGoalId, K, M,
+ GoalStore, !Sets)
+ else
+ !Sets ^ as_reject := set.insert(!.Sets ^ as_reject, GoalId)
+ )
+ ).
+
+%---------------------------------------------------------------------------%
+
+:- pred accu_sets_init(accu_sets::out) is det.
+
+accu_sets_init(Sets) :-
+ set.init(EmptySet),
+ Before = EmptySet,
+ Assoc = EmptySet,
+ ConstructAssoc = EmptySet,
+ Construct = EmptySet,
+ Update = EmptySet,
+ Reject = EmptySet,
+ Sets = accu_sets(Before, Assoc, ConstructAssoc, Construct, Update, Reject).
+
+ % set_upto(Case, K) returns the set
+ % {accu_goal_id(Case, 1) .. accu_goal_id(Case, K)}.
+ %
+:- func set_upto(accu_case, int) = set(accu_goal_id).
+
+set_upto(Case, K) = Set :-
+ ( if K =< 0 then
+ set.init(Set)
+ else
+ Set0 = set_upto(Case, K - 1),
+ set.insert(accu_goal_id(Case, K), Set0, Set)
+ ).
+
+%---------------------------------------------------------------------------%
+
+ % A goal is a member of the before set iff the goal only depends on goals
+ % which are before the recursive call or can be moved before the recursive
+ % call (member of the before set).
+ %
+:- pred accu_before(module_info::in, vartypes::in, bool::in,
+ accu_goal_id::in, int::in, accu_goal_store::in, accu_sets::in) is semidet.
+
+accu_before(ModuleInfo, VarTypes, FullyStrict, GoalId, K, GoalStore, Sets) :-
+ GoalId = accu_goal_id(Case, _I),
+ Before = Sets ^ as_before,
+ goal_store_lookup(GoalStore, GoalId, stored_goal(LaterGoal, LaterInstMap)),
+ (
+ member_lessthan_goalid(GoalStore, GoalId, LessThanGoalId,
+ stored_goal(EarlierGoal, EarlierInstMap)),
+ not can_reorder_goals_old(ModuleInfo, VarTypes, FullyStrict,
+ EarlierInstMap, EarlierGoal, LaterInstMap, LaterGoal)
+ )
+ =>
+ (
+ set.member(LessThanGoalId, set_upto(Case, K - 1) `union` Before)
+ ).
+
+ % A goal is a member of the assoc set iff the goal only depends on goals
+ % upto and including the recursive call and goals which can be moved
+ % before the recursive call (member of the before set) AND the goal
+ % is associative.
+ %
+:- pred accu_assoc(module_info::in, vartypes::in, bool::in,
+ accu_goal_id::in, int::in, accu_goal_store::in, accu_sets::in) is semidet.
+
+accu_assoc(ModuleInfo, VarTypes, FullyStrict, GoalId, K, GoalStore, Sets) :-
+ GoalId = accu_goal_id(Case, _I),
+ Before = Sets ^ as_before,
+ goal_store_lookup(GoalStore, GoalId, stored_goal(LaterGoal, LaterInstMap)),
+ LaterGoal = hlds_goal(plain_call(PredId, _, Args, _, _, _), _),
+ accu_is_associative(ModuleInfo, PredId, Args, _),
+ (
+ % XXX LessThanGoalId was _N - J, not N - J: it ignored the case.
+ % See the diff with the previous version.
+ member_lessthan_goalid(GoalStore, GoalId, LessThanGoalId,
+ stored_goal(EarlierGoal, EarlierInstMap)),
+ not can_reorder_goals_old(ModuleInfo, VarTypes, FullyStrict,
+ EarlierInstMap, EarlierGoal, LaterInstMap, LaterGoal)
+ )
+ =>
+ (
+ set.member(LessThanGoalId, set_upto(Case, K) `union` Before)
+ ).
+
+ % A goal is a member of the construct set iff the goal only depends
+ % on goals upto and including the recursive call and goals which
+ % can be moved before the recursive call (member of the before set)
+ % AND the goal is construction unification.
+ %
+:- pred accu_construct(module_info::in, vartypes::in, bool::in,
+ accu_goal_id::in, int::in, accu_goal_store::in, accu_sets::in) is semidet.
+
+accu_construct(ModuleInfo, VarTypes, FullyStrict, GoalId, K, GoalStore,
+ Sets) :-
+ GoalId = accu_goal_id(Case, _I),
+ Before = Sets ^ as_before,
+ Construct = Sets ^ as_construct,
+ goal_store_lookup(GoalStore, GoalId, stored_goal(LaterGoal, LaterInstMap)),
+ LaterGoal = hlds_goal(unify(_, _, _, Unify, _), _GoalInfo),
+ Unify = construct(_, _, _, _, _, _, _),
+ (
+ % XXX LessThanGoalId was _N - J, not N - J: it ignored the case.
+ % See the diff with the previous version.
+ member_lessthan_goalid(GoalStore, GoalId, LessThanGoalId,
+ stored_goal(EarlierGoal, EarlierInstMap)),
+ not can_reorder_goals_old(ModuleInfo, VarTypes, FullyStrict,
+ EarlierInstMap, EarlierGoal, LaterInstMap, LaterGoal)
+ )
+ =>
+ (
+ set.member(LessThanGoalId,
+ set_upto(Case, K) `union` Before `union` Construct)
+ ).
+
+ % A goal is a member of the construct_assoc set iff the goal depends only
+ % on goals upto and including the recursive call and goals which can be
+ % moved before the recursive call (member of the before set) and goals
+ % which are associative AND the goal is construction unification AND
+ % there is only one member of the assoc set which the construction
+ % unification depends on AND the construction unification can be expressed
+ % as a call to the member of the assoc set which the construction
+ % unification depends on.
+ %
+:- pred accu_construct_assoc(module_info::in, vartypes::in, bool::in,
+ accu_goal_id::in, int::in, accu_goal_store::in, accu_sets::in) is semidet.
+
+accu_construct_assoc(ModuleInfo, VarTypes, FullyStrict,
+ GoalId, K, GoalStore, Sets) :-
+ GoalId = accu_goal_id(Case, _I),
+ Before = Sets ^ as_before,
+ Assoc = Sets ^ as_assoc,
+ ConstructAssoc = Sets ^ as_construct_assoc,
+ goal_store_lookup(GoalStore, GoalId, stored_goal(LaterGoal, LaterInstMap)),
+ LaterGoal = hlds_goal(unify(_, _, _, Unify, _), _GoalInfo),
+ Unify = construct(_, ConsId, _, _, _, _, _),
+
+ goal_store_all_ancestors(GoalStore, GoalId, VarTypes, ModuleInfo,
+ FullyStrict, Ancestors),
+
+ set.is_singleton(Assoc `intersect` Ancestors, AssocId),
+ goal_store_lookup(GoalStore, AssocId,
+ stored_goal(AssocGoal, _AssocInstMap)),
+ AssocGoal = hlds_goal(plain_call(PredId, _, _, _, _, _), _),
+
+ is_associative_construction(ModuleInfo, PredId, ConsId),
+ (
+ % XXX LessThanGoalId was _N - J, not N - J: it ignored the case.
+ % See the diff with the previous version.
+ member_lessthan_goalid(GoalStore, GoalId, LessThanGoalId,
+ stored_goal(EarlierGoal, EarlierInstMap)),
+ not can_reorder_goals_old(ModuleInfo, VarTypes, FullyStrict,
+ EarlierInstMap, EarlierGoal, LaterInstMap, LaterGoal)
+ )
+ =>
+ (
+ set.member(LessThanGoalId,
+ set_upto(Case, K) `union` Before `union` Assoc
+ `union` ConstructAssoc)
+ ).
+
+ % A goal is a member of the update set iff the goal only depends
+ % on goals upto and including the recursive call and goals which
+ % can be moved before the recursive call (member of the before set)
+ % AND the goal updates some state.
+ %
+:- pred accu_update(module_info::in, vartypes::in, bool::in,
+ accu_goal_id::in, int::in, accu_goal_store::in, accu_sets::in) is semidet.
+
+accu_update(ModuleInfo, VarTypes, FullyStrict, GoalId, K, GoalStore, Sets) :-
+ GoalId = accu_goal_id(Case, _I),
+ Before = Sets ^ as_before,
+ goal_store_lookup(GoalStore, GoalId, stored_goal(LaterGoal, LaterInstMap)),
+ LaterGoal = hlds_goal(plain_call(PredId, _, Args, _, _, _), _),
+ accu_is_update(ModuleInfo, PredId, Args, _),
+ (
+ % XXX LessThanGoalId was _N - J, not N - J: it ignored the case.
+ % See the diff with the previous version.
+ member_lessthan_goalid(GoalStore, GoalId, LessThanGoalId,
+ stored_goal(EarlierGoal, EarlierInstMap)),
+ not can_reorder_goals_old(ModuleInfo, VarTypes, FullyStrict,
+ EarlierInstMap, EarlierGoal, LaterInstMap, LaterGoal)
+ )
+ =>
+ (
+ set.member(LessThanGoalId, set_upto(Case, K) `union` Before)
+ ).
+
+ % member_lessthan_goalid(GS, IdA, IdB, GB) is true iff the goal_id, IdB,
+ % and its associated goal, GB, is a member of the goal_store, GS,
+ % and IdB is less than IdA.
+ %
+:- pred member_lessthan_goalid(accu_goal_store::in,
+ accu_goal_id::in, accu_goal_id::out, stored_goal::out) is nondet.
+
+member_lessthan_goalid(GoalStore, GoalId, LessThanGoalId, LessThanGoal) :-
+ goal_store_member(GoalStore, LessThanGoalId, LessThanGoal),
+ GoalId = accu_goal_id(Case, I),
+ LessThanGoalId = accu_goal_id(Case, J),
+ J < I.
+
+%---------------------------------------------------------------------------%
+
+:- type accu_assoc
+ ---> accu_assoc(
+ set_of_progvar, % the associative input args
+ prog_var, % the corresponding output arg
+ bool % is the predicate commutative?
+ ).
+
+ % If accu_is_associative is true, it returns the two arguments which are
+ % associative and the variable which depends on those two arguments,
+ % and an indicator of whether or not the predicate is commutative.
+ %
+:- pred accu_is_associative(module_info::in, pred_id::in, list(prog_var)::in,
+ accu_assoc::out) is semidet.
+
+accu_is_associative(ModuleInfo, PredId, Args, Result) :-
+ module_info_pred_info(ModuleInfo, PredId, PredInfo),
+ pred_info_get_assertions(PredInfo, Assertions),
+ AssertionsList = set.to_sorted_list(Assertions),
+ associativity_assertion(ModuleInfo, AssertionsList, Args,
+ AssociativeVarsOutputVar),
+ ( if
+ commutativity_assertion(ModuleInfo, AssertionsList, Args,
+ _CommutativeVars)
+ then
+ IsCommutative = yes
+ else
+ IsCommutative = no
+ ),
+ AssociativeVarsOutputVar =
+ associative_vars_output_var(AssociativeVars, OutputVar),
+ Result = accu_assoc(AssociativeVars, OutputVar, IsCommutative).
+
+ % Does there exist one (and only one) associativity assertion for the
+ % current predicate?
+ % The 'and only one condition' is required because we currently
+ % do not handle the case of predicates which have individual parts
+ % which are associative, because then we do not know which variable
+ % is descended from which.
+ %
+:- pred associativity_assertion(module_info::in, list(assert_id)::in,
+ list(prog_var)::in, associative_vars_output_var::out) is semidet.
+
+associativity_assertion(ModuleInfo, [AssertId | AssertIds], Args0,
+ AssociativeVarsOutputVar) :-
+ ( if
+ assertion.is_associativity_assertion(ModuleInfo, AssertId,
+ Args0, AssociativeVarsOutputVarPrime)
+ then
+ AssociativeVarsOutputVar = AssociativeVarsOutputVarPrime,
+ not associativity_assertion(ModuleInfo, AssertIds, Args0, _)
+ else
+ associativity_assertion(ModuleInfo, AssertIds, Args0,
+ AssociativeVarsOutputVar)
+ ).
+
+ % Does there exist one (and only one) commutativity assertion for the
+ % current predicate?
+ % The 'and only one condition' is required because we currently
+ % do not handle the case of predicates which have individual
+ % parts which are commutative, because then we do not know which variable
+ % is descended from which.
+ %
+:- pred commutativity_assertion(module_info::in,list(assert_id)::in,
+ list(prog_var)::in, set_of_progvar::out) is semidet.
+
+commutativity_assertion(ModuleInfo, [AssertId | AssertIds], Args0,
+ CommutativeVars) :-
+ ( if
+ assertion.is_commutativity_assertion(ModuleInfo, AssertId,
+ Args0, CommutativeVarsPrime)
+ then
+ CommutativeVars = CommutativeVarsPrime,
+ not commutativity_assertion(ModuleInfo, AssertIds, Args0, _)
+ else
+ commutativity_assertion(ModuleInfo, AssertIds, Args0,
+ CommutativeVars)
+ ).
+
+%---------------------------------------------------------------------------%
+
+ % Does the current predicate update some state?
+ %
+:- pred accu_is_update(module_info::in, pred_id::in, list(prog_var)::in,
+ state_update_vars::out) is semidet.
+
+accu_is_update(ModuleInfo, PredId, Args, ResultStateVars) :-
+ module_info_pred_info(ModuleInfo, PredId, PredInfo),
+ pred_info_get_assertions(PredInfo, Assertions),
+ list.filter_map(
+ ( pred(AssertId::in, StateVars::out) is semidet :-
+ assertion.is_update_assertion(ModuleInfo, AssertId,
+ PredId, Args, StateVars)
+ ),
+ set.to_sorted_list(Assertions), Result),
+ % XXX Maybe we should just match on the first result,
+ % just in case there are duplicate promises.
+ Result = [ResultStateVars].
+
+%---------------------------------------------------------------------------%
+
+ % Can the construction unification be expressed as a call to the
+ % specified predicate.
+ %
+:- pred is_associative_construction(module_info::in, pred_id::in, cons_id::in)
+ is semidet.
+
+is_associative_construction(ModuleInfo, PredId, ConsId) :-
+ module_info_pred_info(ModuleInfo, PredId, PredInfo),
+ pred_info_get_assertions(PredInfo, Assertions),
+ list.filter(
+ ( pred(AssertId::in) is semidet :-
+ assertion.is_construction_equivalence_assertion(ModuleInfo,
+ AssertId, ConsId, PredId)
+ ),
+ set.to_sorted_list(Assertions), Result),
+ Result = [_ | _].
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- type accu_substs
+ ---> accu_substs(
+ acc_var_subst :: accu_subst,
+ rec_call_subst :: accu_subst,
+ assoc_call_subst :: accu_subst,
+ update_subst :: accu_subst
+ ).
+
+:- type accu_base
+ ---> accu_base(
+ % goals which initialize update
+ init_update :: set(accu_goal_id),
+
+ % goals which initialize assoc
+ init_assoc :: set(accu_goal_id),
+
+ % other goals
+ other :: set(accu_goal_id)
+ ).
+
+ % Stage 2 is responsible for identifying the substitutions which
+ % are needed to mimic the unfold/fold process that was used as
+ % the justification of the algorithm in the paper.
+ % It is also responsible for ensuring that the reordering of arguments
+ % doesn't worsen the big-O complexity of the procedure.
+ % It also divides the base case into goals that initialize the
+ % variables used by the update goals, and those used by the assoc
+ % goals and then all the rest.
+ %
+:- pred accu_stage2(module_info::in, proc_info::in,
+ accu_goal_id::in, accu_goal_store::in, accu_sets::in,
+ list(prog_var)::in, list(prog_var)::in, prog_varset::out, vartypes::out,
+ list(prog_var)::out, accu_base::out, list(pair(prog_var))::out,
+ accu_substs::out, accu_goal_store::out, list(accu_warning)::out)
+ is semidet.
+
+accu_stage2(ModuleInfo, ProcInfo0, GoalId, GoalStore, Sets, OutPrime, Out,
+ !:VarSet, !:VarTypes, Accs, BaseCase, BasePairs, !:Substs,
+ CS, Warnings) :-
+ Sets = accu_sets(Before0, Assoc, ConstructAssoc, Construct, Update, _),
+ GoalId = accu_goal_id(Case, K),
+ Before = Before0 `union` set_upto(Case, K-1),
+
+ % Note Update set is not placed in the after set, as the after set is used
+ % to determine the variables that need to be accumulated for the
+ % associative calls.
+ After = Assoc `union` ConstructAssoc `union` Construct,
+
+ P =
+ ( pred(Id::in, Set0::in, Set::out) is det :-
+ goal_store_lookup(GoalStore, Id, stored_goal(Goal, _InstMap)),
+ Goal = hlds_goal(_GoalExpr, GoalInfo),
+ NonLocals = goal_info_get_nonlocals(GoalInfo),
+ set_of_var.union(NonLocals, Set0, Set)
+ ),
+ list.foldl(P, set.to_sorted_list(Before),
+ set_of_var.init, BeforeNonLocals),
+ list.foldl(P, set.to_sorted_list(After),
+ set_of_var.init, AfterNonLocals),
+ InitAccs = set_of_var.intersect(BeforeNonLocals, AfterNonLocals),
+
+ proc_info_get_varset(ProcInfo0, !:VarSet),
+ proc_info_get_vartypes(ProcInfo0, !:VarTypes),
+
+ accu_substs_init(set_of_var.to_sorted_list(InitAccs), !VarSet, !VarTypes,
+ !:Substs),
+
+ set_of_var.list_to_set(OutPrime, OutPrimeSet),
+ accu_process_assoc_set(ModuleInfo, GoalStore, set.to_sorted_list(Assoc),
+ OutPrimeSet, !Substs, !VarSet, !VarTypes, CS, Warnings),
+
+ accu_process_update_set(ModuleInfo, GoalStore, set.to_sorted_list(Update),
+ OutPrimeSet, !Substs, !VarSet, !VarTypes, UpdateOut, UpdateAccOut,
+ BasePairs),
+
+ Accs = set_of_var.to_sorted_list(InitAccs) ++ UpdateAccOut,
+
+ accu_divide_base_case(ModuleInfo, !.VarTypes, GoalStore, UpdateOut, Out,
+ UpdateBase, AssocBase, OtherBase),
+
+ BaseCase = accu_base(UpdateBase, AssocBase, OtherBase).
+
+%---------------------------------------------------------------------------%
+
+:- pred accu_substs_init(list(prog_var)::in, prog_varset::in, prog_varset::out,
+ vartypes::in, vartypes::out, accu_substs::out) is det.
+
+accu_substs_init(InitAccs, !VarSet, !VarTypes, Substs) :-
+ map.init(Subst),
+ acc_var_subst_init(InitAccs, !VarSet, !VarTypes, AccVarSubst),
+ RecCallSubst = Subst,
+ AssocCallSubst = Subst,
+ UpdateSubst = Subst,
+ Substs = accu_substs(AccVarSubst, RecCallSubst, AssocCallSubst,
+ UpdateSubst).
+
+ % Initialise the acc_var_subst to be from Var to A_Var where Var is a
+ % member of InitAccs and A_Var is a fresh variable of the same type of Var.
+ %
+:- pred acc_var_subst_init(list(prog_var)::in,
+ prog_varset::in, prog_varset::out, vartypes::in, vartypes::out,
+ accu_subst::out) is det.
+
+acc_var_subst_init([], !VarSet, !VarTypes, map.init).
+acc_var_subst_init([Var | Vars], !VarSet, !VarTypes, Subst) :-
+ create_new_var(Var, "A_", AccVar, !VarSet, !VarTypes),
+ acc_var_subst_init(Vars, !VarSet, !VarTypes, Subst0),
+ map.det_insert(Var, AccVar, Subst0, Subst).
+
+ % Create a fresh variable which is the same type as the old variable
+ % and has the same name except that it begins with the prefix.
+ %
+:- pred create_new_var(prog_var::in, string::in, prog_var::out,
+ prog_varset::in, prog_varset::out, vartypes::in, vartypes::out) is det.
+
+create_new_var(OldVar, Prefix, NewVar, !VarSet, !VarTypes) :-
+ varset.lookup_name(!.VarSet, OldVar, OldName),
+ string.append(Prefix, OldName, NewName),
+ varset.new_named_var(NewName, NewVar, !VarSet),
+ lookup_var_type(!.VarTypes, OldVar, Type),
+ add_var_type(NewVar, Type, !VarTypes).
+
+%---------------------------------------------------------------------------%
+
+ % For each member of the assoc set determine the substitutions needed,
+ % and also check the efficiency of the procedure isn't worsened
+ % by reordering the arguments to a call.
+ %
+:- pred accu_process_assoc_set(module_info::in, accu_goal_store::in,
+ list(accu_goal_id)::in, set_of_progvar::in,
+ accu_substs::in, accu_substs::out,
+ prog_varset::in, prog_varset::out, vartypes::in, vartypes::out,
+ accu_goal_store::out, list(accu_warning)::out) is semidet.
+
+accu_process_assoc_set(_ModuleInfo, _GS, [], _OutPrime, !Substs,
+ !VarSet, !VarTypes, CS, []) :-
+ goal_store_init(CS).
+accu_process_assoc_set(ModuleInfo, GS, [Id | Ids], OutPrime, !Substs,
+ !VarSet, !VarTypes, CS, Warnings) :-
+ !.Substs = accu_substs(AccVarSubst, RecCallSubst0, AssocCallSubst0,
+ UpdateSubst),
+
+ lookup_call(GS, Id, stored_goal(Goal, InstMap)),
+
+ Goal = hlds_goal(plain_call(PredId, _, Args, _, _, _), GoalInfo),
+ accu_is_associative(ModuleInfo, PredId, Args, AssocInfo),
+ AssocInfo = accu_assoc(Vars, AssocOutput, IsCommutative),
+ OutPrimeVars = set_of_var.intersect(Vars, OutPrime),
+ set_of_var.is_singleton(OutPrimeVars, DuringAssocVar),
+ set_of_var.is_singleton(set_of_var.difference(Vars, OutPrimeVars),
+ BeforeAssocVar),
+
+ map.lookup(AccVarSubst, BeforeAssocVar, AccVar),
+ create_new_var(BeforeAssocVar, "NewAcc_", NewAcc, !VarSet, !VarTypes),
+
+ map.det_insert(DuringAssocVar, AccVar, AssocCallSubst0, AssocCallSubst1),
+ map.det_insert(AssocOutput, NewAcc, AssocCallSubst1, AssocCallSubst),
+ map.det_insert(DuringAssocVar, AssocOutput, RecCallSubst0, RecCallSubst1),
+ map.det_insert(BeforeAssocVar, NewAcc, RecCallSubst1, RecCallSubst),
+
+ !:Substs = accu_substs(AccVarSubst, RecCallSubst, AssocCallSubst,
+ UpdateSubst),
+
+ % ONLY swap the order of the variables if the goal is
+ % associative and not commutative.
+ (
+ IsCommutative = yes,
+ CSGoal = stored_goal(Goal, InstMap),
+ CurWarnings = []
+ ;
+ IsCommutative = no,
+
+ % Ensure that the reordering doesn't cause a efficiency problem.
+ module_info_pred_info(ModuleInfo, PredId, PredInfo),
+ ModuleName = pred_info_module(PredInfo),
+ PredName = pred_info_name(PredInfo),
+ Arity = pred_info_orig_arity(PredInfo),
+ ( if accu_has_heuristic(ModuleName, PredName, Arity) then
+ % Only do the transformation if the accumulator variable is
+ % *not* in a position where it will control the running time
+ % of the predicate.
+ accu_heuristic(ModuleName, PredName, Arity, Args,
+ PossibleDuringAssocVars),
+ set_of_var.member(PossibleDuringAssocVars, DuringAssocVar),
+ CurWarnings = []
+ else
+ ProgContext = goal_info_get_context(GoalInfo),
+ CurWarnings = [accu_warn(ProgContext, PredId, BeforeAssocVar,
+ DuringAssocVar)]
+ ),
+ % Swap the arguments.
+ [A, B] = set_of_var.to_sorted_list(Vars),
+ map.from_assoc_list([A - B, B - A], Subst),
+ rename_some_vars_in_goal(Subst, Goal, SwappedGoal),
+ CSGoal = stored_goal(SwappedGoal, InstMap)
+ ),
+
+ accu_process_assoc_set(ModuleInfo, GS, Ids, OutPrime, !Substs,
+ !VarSet, !VarTypes, CS0, Warnings0),
+ goal_store_det_insert(Id, CSGoal, CS0, CS),
+ Warnings = Warnings0 ++ CurWarnings.
+
+:- pred accu_has_heuristic(module_name::in, string::in, arity::in) is semidet.
+
+accu_has_heuristic(unqualified("list"), "append", 3).
+
+ % heuristic returns the set of which head variables are important
+ % in the running time of the predicate.
+ %
+:- pred accu_heuristic(module_name::in, string::in, arity::in,
+ list(prog_var)::in, set_of_progvar::out) is semidet.
+
+accu_heuristic(unqualified("list"), "append", 3, [_Typeinfo, A, _B, _C],
+ Set) :-
+ set_of_var.make_singleton(A, Set).
+
+%---------------------------------------------------------------------------%
+
+ % For each member of the update set determine the substitutions needed
+ % (creating the accumulator variables when needed).
+ % Also associate with each Output variable which accumulator variable
+ % to get the result from.
+ %
+:- pred accu_process_update_set(module_info::in, accu_goal_store::in,
+ list(accu_goal_id)::in, set_of_progvar::in,
+ accu_substs::in, accu_substs::out,
+ prog_varset::in, prog_varset::out, vartypes::in, vartypes::out,
+ list(prog_var)::out, list(prog_var)::out, list(pair(prog_var))::out)
+ is semidet.
+
+accu_process_update_set(_ModuleInfo, _GS, [], _OutPrime, !Substs,
+ !VarSet, !VarTypes, [], [], []).
+accu_process_update_set(ModuleInfo, GS, [Id | Ids], OutPrime, !Substs,
+ !VarSet, !VarTypes, StateOutputVars, Accs, BasePairs) :-
+ !.Substs = accu_substs(AccVarSubst0, RecCallSubst0, AssocCallSubst,
+ UpdateSubst0),
+ lookup_call(GS, Id, stored_goal(Goal, _InstMap)),
+
+ Goal = hlds_goal(plain_call(PredId, _, Args, _, _, _), _GoalInfo),
+ accu_is_update(ModuleInfo, PredId, Args, StateVars),
+ StateVars = state_update_vars(StateVarA, StateVarB),
+
+ ( if set_of_var.member(OutPrime, StateVarA) then
+ StateInputVar = StateVarA,
+ StateOutputVar = StateVarB
+ else
+ StateInputVar = StateVarB,
+ StateOutputVar = StateVarA
+ ),
+
+ create_new_var(StateInputVar, "Acc_", Acc0, !VarSet, !VarTypes),
+ create_new_var(StateOutputVar, "Acc_", Acc, !VarSet, !VarTypes),
+
+ map.det_insert(StateInputVar, Acc0, UpdateSubst0, UpdateSubst1),
+ map.det_insert(StateOutputVar, Acc, UpdateSubst1, UpdateSubst),
+ map.det_insert(StateInputVar, StateOutputVar, RecCallSubst0, RecCallSubst),
+ map.det_insert(Acc, Acc0, AccVarSubst0, AccVarSubst),
+ !:Substs = accu_substs(AccVarSubst, RecCallSubst, AssocCallSubst,
+ UpdateSubst),
+
+ accu_process_update_set(ModuleInfo, GS, Ids, OutPrime, !Substs,
+ !VarSet, !VarTypes, StateOutputVars0, Accs0, BasePairs0),
+
+ % Rather then concatenating to start of the list we concatenate to the end
+ % of the list. This allows the accumulator introduction to be applied
+ % as the heuristic will succeed (remember after transforming the two
+ % input variables will have their order swapped, so they must be in the
+ % inefficient order to start with)
+
+ StateOutputVars = StateOutputVars0 ++ [StateOutputVar],
+ Accs = Accs0 ++ [Acc],
+ BasePairs = BasePairs0 ++ [StateOutputVar - Acc0].
+
+%---------------------------------------------------------------------------%
+
+ % divide_base_case(UpdateOut, Out, U, A, O) is true iff given the output
+ % variables which are instantiated by update goals, UpdateOut, and all
+ % the variables that need to be accumulated, Out, divide the base case up
+ % into three sets, those base case goals which initialize the variables
+ % used by update calls, U, those which initialize variables used by
+ % assoc calls, A, and the rest of the goals, O. Note that the sets
+ % are not necessarily disjoint, as the result of a goal may be used
+ % to initialize a variable in both U and A, so both U and A will contain
+ % the same goal_id.
+ %
+:- pred accu_divide_base_case(module_info::in, vartypes::in,
+ accu_goal_store::in, list(prog_var)::in, list(prog_var)::in,
+ set(accu_goal_id)::out, set(accu_goal_id)::out, set(accu_goal_id)::out)
+ is det.
+
+accu_divide_base_case(ModuleInfo, VarTypes, C, UpdateOut, Out,
+ UpdateBase, AssocBase, OtherBase) :-
+ list.delete_elems(Out, UpdateOut, AssocOut),
+
+ list.map(accu_related(ModuleInfo, VarTypes, C), UpdateOut, UpdateBaseList),
+ list.map(accu_related(ModuleInfo, VarTypes, C), AssocOut, AssocBaseList),
+ UpdateBase = set.power_union(set.list_to_set(UpdateBaseList)),
+ AssocBase = set.power_union(set.list_to_set(AssocBaseList)),
+
+ Set = base_case_ids_set(C) `difference` (UpdateBase `union` AssocBase),
+ set.to_sorted_list(Set, List),
+
+ list.map(
+ ( pred(GoalId::in, Ancestors::out) is det :-
+ goal_store_all_ancestors(C, GoalId, VarTypes,
+ ModuleInfo, no, Ancestors)
+ ), List, OtherBaseList),
+
+ OtherBase = set.list_to_set(List) `union`
+ (base_case_ids_set(C) `intersect`
+ set.power_union(set.list_to_set(OtherBaseList))).
+
+ % accu_related(ModuleInfo, VarTypes, GoalStore, Var, Related):
+ %
+ % From GoalStore, return all the goal_ids, Related, which are needed
+ % to initialize Var.
+ %
+:- pred accu_related(module_info::in, vartypes::in, accu_goal_store::in,
+ prog_var::in, set(accu_goal_id)::out) is det.
+
+accu_related(ModuleInfo, VarTypes, GoalStore, Var, Related) :-
+ solutions.solutions(
+ ( pred(Key::out) is nondet :-
+ goal_store_member(GoalStore, Key, stored_goal(Goal, InstMap0)),
+ Key = accu_goal_id(accu_base, _),
+ Goal = hlds_goal(_GoalExpr, GoalInfo),
+ InstMapDelta = goal_info_get_instmap_delta(GoalInfo),
+ apply_instmap_delta(InstMapDelta, InstMap0, InstMap),
+ instmap_changed_vars(ModuleInfo, VarTypes,
+ InstMap0, InstMap, ChangedVars),
+ set_of_var.is_singleton(ChangedVars, Var)
+ ), Ids),
+ (
+ Ids = [],
+ unexpected($pred, "no Id")
+ ;
+ Ids = [Id],
+ goal_store_all_ancestors(GoalStore, Id, VarTypes, ModuleInfo, no,
+ Ancestors),
+ list.filter((pred(accu_goal_id(accu_base, _)::in) is semidet),
+ set.to_sorted_list(set.insert(Ancestors, Id)), RelatedList),
+ Related = set.list_to_set(RelatedList)
+ ;
+ Ids = [_, _ | _],
+ unexpected($pred, "more than one Id")
+ ).
+
+%---------------------------------------------------------------------------%
+
+:- inst stored_goal_plain_call for goal_store.stored_goal/0
+ ---> stored_goal(goal_plain_call, ground).
+
+ % Do a goal_store_lookup where the result is known to be a call.
+ %
+:- pred lookup_call(accu_goal_store::in, accu_goal_id::in,
+ stored_goal::out(stored_goal_plain_call)) is det.
+
+lookup_call(GoalStore, Id, stored_goal(Call, InstMap)) :-
+ goal_store_lookup(GoalStore, Id, stored_goal(Goal, InstMap)),
+ ( if
+ Goal = hlds_goal(GoalExpr, GoalInfo),
+ GoalExpr = plain_call(_, _, _, _, _, _)
+ then
+ Call = hlds_goal(GoalExpr, GoalInfo)
+ else
+ unexpected($pred, "not a call")
+ ).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % accu_stage3 creates the accumulator version of the predicate using
+ % the substitutions determined in stage2. It also redefines the
+ % original procedure to call the accumulator version of the procedure.
+ %
+:- pred accu_stage3(accu_goal_id::in, list(prog_var)::in, prog_varset::in,
+ vartypes::in, accu_goal_store::in, accu_goal_store::in,
+ accu_substs::in, accu_subst::in, accu_subst::in,
+ accu_base::in, list(pair(prog_var))::in, accu_sets::in,
+ list(prog_var)::in, top_level::in, pred_id::in, pred_info::in,
+ proc_info::in, proc_info::out, module_info::in, module_info::out) is det.
+
+accu_stage3(RecCallId, Accs, VarSet, VarTypes, C, CS, Substs,
+ HeadToCallSubst, CallToHeadSubst, BaseCase, BasePairs, Sets, Out,
+ TopLevel, OrigPredId, OrigPredInfo, !OrigProcInfo, !ModuleInfo) :-
+ acc_proc_info(Accs, VarSet, VarTypes, Substs, !.OrigProcInfo,
+ AccTypes, AccProcInfo),
+ acc_pred_info(AccTypes, Out, AccProcInfo, OrigPredId, OrigPredInfo,
+ AccProcId, AccPredInfo),
+ AccName = unqualified(pred_info_name(AccPredInfo)),
+
+ module_info_get_predicate_table(!.ModuleInfo, PredTable0),
+ predicate_table_insert(AccPredInfo, AccPredId, PredTable0, PredTable),
+ module_info_set_predicate_table(PredTable, !ModuleInfo),
+ accu_create_goal(RecCallId, Accs, AccPredId, AccProcId, AccName, Substs,
+ HeadToCallSubst, CallToHeadSubst, BaseCase, BasePairs, Sets, C, CS,
+ OrigBaseGoal, OrigRecGoal, AccBaseGoal, AccRecGoal),
+
+ proc_info_get_goal(!.OrigProcInfo, OrigGoal0),
+ accu_top_level(TopLevel, OrigGoal0, OrigBaseGoal, OrigRecGoal,
+ AccBaseGoal, AccRecGoal, OrigGoal, AccGoal),
+
+ proc_info_set_goal(OrigGoal, !OrigProcInfo),
+ proc_info_set_varset(VarSet, !OrigProcInfo),
+ proc_info_set_vartypes(VarTypes, !OrigProcInfo),
+
+ requantify_proc_general(ordinary_nonlocals_no_lambda, !OrigProcInfo),
+ update_accumulator_pred(AccPredId, AccProcId, AccGoal, !ModuleInfo).
+
+%---------------------------------------------------------------------------%
+
+ % Construct a proc_info for the introduced predicate.
+ %
+:- pred acc_proc_info(list(prog_var)::in, prog_varset::in, vartypes::in,
+ accu_substs::in, proc_info::in, list(mer_type)::out, proc_info::out)
+ is det.
+
+acc_proc_info(Accs0, VarSet, VarTypes, Substs, OrigProcInfo,
+ AccTypes, AccProcInfo) :-
+ % ProcInfo Stuff that must change.
+ proc_info_get_headvars(OrigProcInfo, HeadVars0),
+ proc_info_get_argmodes(OrigProcInfo, HeadModes0),
+
+ proc_info_get_inst_varset(OrigProcInfo, InstVarSet),
+ proc_info_get_inferred_determinism(OrigProcInfo, Detism),
+ proc_info_get_goal(OrigProcInfo, Goal),
+ proc_info_get_context(OrigProcInfo, Context),
+ proc_info_get_rtti_varmaps(OrigProcInfo, RttiVarMaps),
+ proc_info_get_is_address_taken(OrigProcInfo, IsAddressTaken),
+ proc_info_get_has_parallel_conj(OrigProcInfo, HasParallelConj),
+ proc_info_get_var_name_remap(OrigProcInfo, VarNameRemap),
+
+ Substs = accu_substs(AccVarSubst, _RecCallSubst, _AssocCallSubst,
+ _UpdateSubst),
+ list.map(map.lookup(AccVarSubst), Accs0, Accs),
+
+ % We place the extra accumulator variables at the start, because placing
+ % them at the end breaks the convention that the last variable of a
+ % function is the output variable.
+ HeadVars = Accs ++ HeadVars0,
+
+ % XXX we don't want to use the inst of the var as it can be more specific
+ % than it should be. ie int_const(1) when it should be any integer.
+ % However this will no longer handle partially instantiated data
+ % structures.
+ Inst = ground(shared, none_or_default_func),
+ inst_lists_to_mode_list([Inst], [Inst], Mode),
+ list.duplicate(list.length(Accs), list.det_head(Mode), AccModes),
+ HeadModes = AccModes ++ HeadModes0,
+
+ lookup_var_types(VarTypes, Accs, AccTypes),
+
+ SeqNum = item_no_seq_num,
+ proc_info_create(Context, SeqNum, VarSet, VarTypes, HeadVars,
+ InstVarSet, HeadModes, detism_decl_none, Detism, Goal, RttiVarMaps,
+ IsAddressTaken, HasParallelConj, VarNameRemap, AccProcInfo).
+
+%---------------------------------------------------------------------------%
+
+ % Construct the pred_info for the introduced predicate.
+ %
+:- pred acc_pred_info(list(mer_type)::in, list(prog_var)::in, proc_info::in,
+ pred_id::in, pred_info::in, proc_id::out, pred_info::out) is det.
+
+acc_pred_info(NewTypes, OutVars, NewProcInfo, OrigPredId, OrigPredInfo,
+ NewProcId, NewPredInfo) :-
+ % PredInfo stuff that must change.
+ pred_info_get_arg_types(OrigPredInfo, TypeVarSet, ExistQVars, Types0),
+
+ ModuleName = pred_info_module(OrigPredInfo),
+ Name = pred_info_name(OrigPredInfo),
+ PredOrFunc = pred_info_is_pred_or_func(OrigPredInfo),
+ pred_info_get_context(OrigPredInfo, PredContext),
+ pred_info_get_markers(OrigPredInfo, Markers),
+ pred_info_get_class_context(OrigPredInfo, ClassContext),
+ pred_info_get_origin(OrigPredInfo, OldOrigin),
+ pred_info_get_var_name_remap(OrigPredInfo, VarNameRemap),
+
+ set.init(Assertions),
+
+ proc_info_get_context(NewProcInfo, Context),
+ term.context_line(Context, Line),
+ Counter = 0,
+
+ Types = NewTypes ++ Types0,
+
+ make_pred_name_with_context(ModuleName, "AccFrom", PredOrFunc, Name,
+ Line, Counter, SymName),
+
+ OutVarNums = list.map(term.var_to_int, OutVars),
+ Origin = origin_transformed(transform_accumulator(OutVarNums),
+ OldOrigin, OrigPredId),
+ GoalType = goal_not_for_promise(np_goal_type_none),
+ pred_info_create(ModuleName, SymName, PredOrFunc, PredContext, Origin,
+ pred_status(status_local), Markers, Types, TypeVarSet,
+ ExistQVars, ClassContext, Assertions, VarNameRemap, GoalType,
+ NewProcInfo, NewProcId, NewPredInfo).
+
+%---------------------------------------------------------------------------%
+
+ % create_goal creates the new base and recursive case of the
+ % original procedure (OrigBaseGoal and OrigRecGoal) and the base
+ % and recursive cases of accumulator version (AccBaseGoal and
+ % AccRecGoal).
+ %
+:- pred accu_create_goal(accu_goal_id::in, list(prog_var)::in,
+ pred_id::in, proc_id::in, sym_name::in, accu_substs::in,
+ accu_subst::in, accu_subst::in, accu_base::in,
+ list(pair(prog_var))::in, accu_sets::in,
+ accu_goal_store::in, accu_goal_store::in,
+ hlds_goal::out, hlds_goal::out, hlds_goal::out, hlds_goal::out) is det.
+
+accu_create_goal(RecCallId, Accs, AccPredId, AccProcId, AccName, Substs,
+ HeadToCallSubst, CallToHeadSubst, BaseIds, BasePairs,
+ Sets, C, CS, OrigBaseGoal, OrigRecGoal, AccBaseGoal, AccRecGoal) :-
+ lookup_call(C, RecCallId, stored_goal(OrigCall, _InstMap)),
+ Call = create_acc_call(OrigCall, Accs, AccPredId, AccProcId, AccName),
+ create_orig_goal(Call, Substs, HeadToCallSubst, CallToHeadSubst,
+ BaseIds, Sets, C, OrigBaseGoal, OrigRecGoal),
+ create_acc_goal(Call, Substs, HeadToCallSubst, BaseIds, BasePairs,
+ Sets, C, CS, AccBaseGoal, AccRecGoal).
+
+ % create_acc_call takes the original call and generates a call to the
+ % accumulator version of the call, which can have the substitutions
+ % applied to it easily.
+ %
+:- func create_acc_call(hlds_goal::in(goal_plain_call), list(prog_var)::in,
+ pred_id::in, proc_id::in, sym_name::in) = (hlds_goal::out(goal_plain_call))
+ is det.
+
+create_acc_call(OrigCall, Accs, AccPredId, AccProcId, AccName) = Call :-
+ OrigCall = hlds_goal(OrigCallExpr, GoalInfo),
+ OrigCallExpr = plain_call(_PredId, _ProcId, Args, Builtin, Context, _Name),
+ CallExpr = plain_call(AccPredId, AccProcId, Accs ++ Args, Builtin,
+ Context, AccName),
+ Call = hlds_goal(CallExpr, GoalInfo).
+
+ % Create the goals which are to replace the original predicate.
+ %
+:- pred create_orig_goal(hlds_goal::in, accu_substs::in,
+ accu_subst::in, accu_subst::in, accu_base::in, accu_sets::in,
+ accu_goal_store::in, hlds_goal::out, hlds_goal::out) is det.
+
+create_orig_goal(Call, Substs, HeadToCallSubst, CallToHeadSubst,
+ BaseIds, Sets, C, OrigBaseGoal, OrigRecGoal) :-
+ Substs = accu_substs(_AccVarSubst, _RecCallSubst, _AssocCallSubst,
+ UpdateSubst),
+
+ BaseIds = accu_base(UpdateBase, _AssocBase, _OtherBase),
+ Before = Sets ^ as_before,
+ Update = Sets ^ as_update,
+
+ U = create_new_orig_recursive_goals(UpdateBase, Update,
+ HeadToCallSubst, UpdateSubst, C),
+
+ rename_some_vars_in_goal(CallToHeadSubst, Call, BaseCall),
+ Cbefore = accu_goal_list(set.to_sorted_list(Before), C),
+ Uupdate = accu_goal_list(set.to_sorted_list(UpdateBase) ++
+ set.to_sorted_list(Update), U),
+ Cbase = accu_goal_list(base_case_ids(C), C),
+ calculate_goal_info(conj(plain_conj, Cbefore ++ Uupdate ++ [BaseCall]),
+ OrigRecGoal),
+ calculate_goal_info(conj(plain_conj, Cbase), OrigBaseGoal).
+
+ % Create the goals which are to go in the new accumulator version
+ % of the predicate.
+ %
+:- pred create_acc_goal(hlds_goal::in, accu_substs::in, accu_subst::in,
+ accu_base::in, list(pair(prog_var))::in, accu_sets::in,
+ accu_goal_store::in, accu_goal_store::in,
+ hlds_goal::out, hlds_goal::out) is det.
+
+create_acc_goal(Call, Substs, HeadToCallSubst, BaseIds, BasePairs, Sets,
+ C, CS, AccBaseGoal, AccRecGoal) :-
+ Substs = accu_substs(AccVarSubst, RecCallSubst, AssocCallSubst,
+ UpdateSubst),
+
+ BaseIds = accu_base(_UpdateBase, AssocBase, OtherBase),
+ Sets = accu_sets(Before, Assoc, ConstructAssoc, Construct, Update,
+ _Reject),
+
+ rename_some_vars_in_goal(RecCallSubst, Call, RecCall),
+
+ Cbefore = accu_goal_list(set.to_sorted_list(Before), C),
+
+ % Create the goals which will be used in the new recursive case.
+ R = create_new_recursive_goals(Assoc, Construct `union` ConstructAssoc,
+ Update, AssocCallSubst, AccVarSubst, UpdateSubst, C, CS),
+
+ Rassoc = accu_goal_list(set.to_sorted_list(Assoc), R),
+ Rupdate = accu_goal_list(set.to_sorted_list(Update), R),
+ Rconstruct = accu_goal_list(set.to_sorted_list(Construct `union`
+ ConstructAssoc), R),
+
+ % Create the goals which will be used in the new base case.
+ B = create_new_base_goals(Assoc `union` Construct `union`
+ ConstructAssoc, C, AccVarSubst, HeadToCallSubst),
+ Bafter = set.to_sorted_list(Assoc `union`
+ Construct `union` ConstructAssoc),
+
+ BaseCase = accu_goal_list(set.to_sorted_list(AssocBase `union` OtherBase)
+ ++ Bafter, B),
+
+ list.map(acc_unification, BasePairs, UpdateBase),
+
+ calculate_goal_info(conj(plain_conj, Cbefore ++ Rassoc ++ Rupdate
+ ++ [RecCall] ++ Rconstruct), AccRecGoal),
+ calculate_goal_info(conj(plain_conj, UpdateBase ++ BaseCase), AccBaseGoal).
+
+ % Create the U set of goals (those that will be used in the original
+ % recursive case) by renaming all the goals which are used to initialize
+ % the update state variable using the head_to_call followed by the
+ % update_subst, and rename all the update goals using the update_subst.
+ %
+:- func create_new_orig_recursive_goals(set(accu_goal_id), set(accu_goal_id),
+ accu_subst, accu_subst, accu_goal_store) = accu_goal_store.
+
+create_new_orig_recursive_goals(UpdateBase, Update, HeadToCallSubst,
+ UpdateSubst, C)
+ = accu_rename(set.to_sorted_list(Update), UpdateSubst, C, Ubase) :-
+ Ubase = accu_rename(set.to_sorted_list(UpdateBase),
+ chain_subst(HeadToCallSubst, UpdateSubst), C, goal_store_init).
+
+ % Create the R set of goals (those that will be used in the new
+ % recursive case) by renaming all the members of assoc in CS
+ % using assoc_call_subst and all the members of (construct U
+ % construct_assoc) in C with acc_var_subst.
+ %
+:- func create_new_recursive_goals(set(accu_goal_id), set(accu_goal_id),
+ set(accu_goal_id), accu_subst, accu_subst, accu_subst,
+ accu_goal_store, accu_goal_store) = accu_goal_store.
+
+create_new_recursive_goals(Assoc, Constructs, Update,
+ AssocCallSubst, AccVarSubst, UpdateSubst, C, CS)
+ = accu_rename(set.to_sorted_list(Constructs), AccVarSubst, C, RBase) :-
+ RBase0 = accu_rename(set.to_sorted_list(Assoc), AssocCallSubst, CS,
+ goal_store_init),
+ RBase = accu_rename(set.to_sorted_list(Update), UpdateSubst, C, RBase0).
+
+ % Create the B set of goals (those that will be used in the new base case)
+ % by renaming all the base case goals of C with head_to_call and all the
+ % members of (assoc U construct U construct_assoc) of C with acc_var_subst.
+ %
+:- func create_new_base_goals(set(accu_goal_id), accu_goal_store,
+ accu_subst, accu_subst) = accu_goal_store.
+
+create_new_base_goals(Ids, C, AccVarSubst, HeadToCallSubst)
+ = accu_rename(set.to_sorted_list(Ids), AccVarSubst, C, Bbase) :-
+ Bbase = accu_rename(base_case_ids(C), HeadToCallSubst, C, goal_store_init).
+
+ % acc_unification(O-A, G):
+ %
+ % is true if G represents the assignment unification Out = Acc.
+ %
+:- pred acc_unification(pair(prog_var)::in, hlds_goal::out) is det.
+
+acc_unification(Out - Acc, Goal) :-
+ UnifyMode = unify_modes_li_lf_ri_rf(free, ground_inst,
+ ground_inst, ground_inst),
+ Context = unify_context(umc_explicit, []),
+ Expr = unify(Out, rhs_var(Acc), UnifyMode, assign(Out,Acc), Context),
+ set_of_var.list_to_set([Out, Acc], NonLocalVars),
+ InstMapDelta = instmap_delta_bind_var(Out),
+ goal_info_init(NonLocalVars, InstMapDelta, detism_det, purity_pure, Info),
+ Goal = hlds_goal(Expr, Info).
+
+%---------------------------------------------------------------------------%
+
+ % Given the top level structure of the goal create new version
+ % with new base and recursive cases plugged in.
+ %
+:- pred accu_top_level(top_level::in, hlds_goal::in,
+ hlds_goal::in, hlds_goal::in, hlds_goal::in,
+ hlds_goal::in, hlds_goal::out, hlds_goal::out) is det.
+
+accu_top_level(TopLevel, Goal, OrigBaseGoal, OrigRecGoal,
+ NewBaseGoal, NewRecGoal, OrigGoal, NewGoal) :-
+ (
+ TopLevel = switch_base_rec,
+ ( if
+ Goal = hlds_goal(switch(Var, CanFail, Cases0), GoalInfo),
+ Cases0 = [case(IdA, [], _), case(IdB, [], _)]
+ then
+ OrigCases = [case(IdA, [], OrigBaseGoal),
+ case(IdB, [], OrigRecGoal)],
+ OrigGoal = hlds_goal(switch(Var, CanFail, OrigCases), GoalInfo),
+
+ NewCases = [case(IdA, [], NewBaseGoal), case(IdB, [], NewRecGoal)],
+ NewGoal = hlds_goal(switch(Var, CanFail, NewCases), GoalInfo)
+ else
+ unexpected($pred, "not the correct top level")
+ )
+ ;
+ TopLevel = switch_rec_base,
+ ( if
+ Goal = hlds_goal(switch(Var, CanFail, Cases0), GoalInfo),
+ Cases0 = [case(IdA, [], _), case(IdB, [], _)]
+ then
+ OrigCases = [case(IdA, [], OrigRecGoal),
+ case(IdB, [], OrigBaseGoal)],
+ OrigGoal = hlds_goal(switch(Var, CanFail, OrigCases), GoalInfo),
+
+ NewCases = [case(IdA, [], NewRecGoal), case(IdB, [], NewBaseGoal)],
+ NewGoal = hlds_goal(switch(Var, CanFail, NewCases), GoalInfo)
+ else
+ unexpected($pred, "not the correct top level")
+ )
+ ;
+ TopLevel = disj_base_rec,
+ ( if
+ Goal = hlds_goal(disj(Goals), GoalInfo),
+ Goals = [_, _]
+ then
+ OrigGoals = [OrigBaseGoal, OrigRecGoal],
+ OrigGoal = hlds_goal(disj(OrigGoals), GoalInfo),
+
+ NewGoals = [NewBaseGoal, NewRecGoal],
+ NewGoal = hlds_goal(disj(NewGoals), GoalInfo)
+ else
+ unexpected($pred, "not the correct top level")
+ )
+ ;
+ TopLevel = disj_rec_base,
+ ( if
+ Goal = hlds_goal(disj(Goals), GoalInfo),
+ Goals = [_, _]
+ then
+ OrigGoals = [OrigRecGoal, OrigBaseGoal],
+ OrigGoal = hlds_goal(disj(OrigGoals), GoalInfo),
+
+ NewGoals = [NewRecGoal, NewBaseGoal],
+ NewGoal = hlds_goal(disj(NewGoals), GoalInfo)
+ else
+ unexpected($pred, "not the correct top level")
+ )
+ ;
+ TopLevel = ite_base_rec,
+ ( if Goal = hlds_goal(if_then_else(Vars, Cond, _, _), GoalInfo) then
+ OrigGoal = hlds_goal(if_then_else(Vars, Cond,
+ OrigBaseGoal, OrigRecGoal), GoalInfo),
+ NewGoal = hlds_goal(if_then_else(Vars, Cond,
+ NewBaseGoal, NewRecGoal), GoalInfo)
+ else
+ unexpected($pred, "not the correct top level")
+ )
+ ;
+ TopLevel = ite_rec_base,
+ ( if Goal = hlds_goal(if_then_else(Vars, Cond, _, _), GoalInfo) then
+ OrigGoal = hlds_goal(if_then_else(Vars, Cond,
+ OrigRecGoal, OrigBaseGoal), GoalInfo),
+ NewGoal = hlds_goal(if_then_else(Vars, Cond,
+ NewRecGoal, NewBaseGoal), GoalInfo)
+ else
+ unexpected($pred, "not the correct top level")
+ )
+ ).
+
+%---------------------------------------------------------------------------%
+
+ % Place the accumulator version of the predicate in the HLDS.
+ %
+:- pred update_accumulator_pred(pred_id::in, proc_id::in,
+ hlds_goal::in, module_info::in, module_info::out) is det.
+
+update_accumulator_pred(NewPredId, NewProcId, AccGoal, !ModuleInfo) :-
+ module_info_pred_proc_info(!.ModuleInfo, NewPredId, NewProcId,
+ PredInfo, ProcInfo0),
+ proc_info_set_goal(AccGoal, ProcInfo0, ProcInfo1),
+ requantify_proc_general(ordinary_nonlocals_no_lambda, ProcInfo1, ProcInfo),
+ module_info_set_pred_proc_info(NewPredId, NewProcId,
+ PredInfo, ProcInfo, !ModuleInfo).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+ % accu_rename(Ids, Subst, From, Initial):
+ %
+ % Return a goal_store, Final, which is the result of looking up each
+ % member of set of goal_ids, Ids, in the goal_store, From, applying
+ % the substitution and then storing the goal into the goal_store, Initial.
+ %
+:- func accu_rename(list(accu_goal_id), accu_subst,
+ accu_goal_store, accu_goal_store) = accu_goal_store.
+
+accu_rename(Ids, Subst, From, Initial) = Final :-
+ list.foldl(
+ ( pred(Id::in, GS0::in, GS::out) is det :-
+ goal_store_lookup(From, Id, stored_goal(Goal0, InstMap)),
+ rename_some_vars_in_goal(Subst, Goal0, Goal),
+ goal_store_det_insert(Id, stored_goal(Goal, InstMap), GS0, GS)
+ ), Ids, Initial, Final).
+
+ % Return all the goal_ids which belong in the base case.
+ %
+:- func base_case_ids(accu_goal_store) = list(accu_goal_id).
+
+base_case_ids(GS) = Base :-
+ solutions.solutions(
+ ( pred(Key::out) is nondet :-
+ goal_store_member(GS, Key, _Goal),
+ Key = accu_goal_id(accu_base, _)
+ ), Base).
+
+:- func base_case_ids_set(accu_goal_store) = set(accu_goal_id).
+
+base_case_ids_set(GS) = set.list_to_set(base_case_ids(GS)).
+
+ % Given a list of goal_ids, return the list of hlds_goals from
+ % the goal_store.
+ %
+:- func accu_goal_list(list(accu_goal_id), accu_goal_store) = list(hlds_goal).
+
+accu_goal_list(Ids, GS) = Goals :-
+ list.map(
+ ( pred(Key::in, G::out) is det :-
+ goal_store_lookup(GS, Key, stored_goal(G, _))
+ ), Ids, Goals).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- pred calculate_goal_info(hlds_goal_expr::in, hlds_goal::out) is det.
+
+calculate_goal_info(GoalExpr, hlds_goal(GoalExpr, GoalInfo)) :-
+ ( if GoalExpr = conj(plain_conj, GoalList) then
+ goal_list_nonlocals(GoalList, NonLocals),
+ goal_list_instmap_delta(GoalList, InstMapDelta),
+ goal_list_determinism(GoalList, Detism),
+
+ goal_info_init(NonLocals, InstMapDelta, Detism, purity_pure, GoalInfo)
+ else
+ unexpected($pred, "not a conj")
+ ).
+
+%---------------------------------------------------------------------------%
+%---------------------------------------------------------------------------%
+
+:- func chain_subst(accu_subst, accu_subst) = accu_subst.
+
+chain_subst(AtoB, BtoC) = AtoC :-
+ map.keys(AtoB, Keys),
+ chain_subst_2(Keys, AtoB, BtoC, AtoC).
+
+:- pred chain_subst_2(list(A)::in, map(A, B)::in, map(B, C)::in,
+ map(A, C)::out) is det.
+
+chain_subst_2([], _, _, AtoC) :-
+ map.init(AtoC).
+chain_subst_2([A | As], AtoB, BtoC, AtoC) :-
+ chain_subst_2(As, AtoB, BtoC, AtoC0),
+ map.lookup(AtoB, A, B),
+ ( if map.search(BtoC, B, C) then
+ map.det_insert(A, C, AtoC0, AtoC)
+ else
+ AtoC = AtoC0
+ ).
+
+%---------------------------------------------------------------------------%
+:- end_module transform_hlds.accumulator.
+%---------------------------------------------------------------------------%
+
+:- some [T] pred unravel_univ(univ::in, T::out) is det.
+:- pragma foreign_export("C", unravel_univ(in, out), "ML_unravel_univ").
+:- pragma foreign_export("C#", unravel_univ(in, out), "ML_unravel_univ").
+:- pragma foreign_export("Java", unravel_univ(in, out), "ML_unravel_univ").
+
+unravel_univ(Univ, X) :-
+ univ_value(Univ) = X.
diff --git a/test/manual/etags/rs-src/test.rs b/test/manual/etags/rs-src/test.rs
new file mode 100644
index 00000000000..081d0d7d4df
--- /dev/null
+++ b/test/manual/etags/rs-src/test.rs
@@ -0,0 +1,14 @@
+mod test;
+
+enum IpAddrKind {
+ V4,
+ V6,
+}
+
+fn test1() {
+ println!("Testing");
+}
+
+fn main() {
+ test::test1();
+}
diff --git a/test/manual/image-circular-tests.el b/test/manual/image-circular-tests.el
index 3d1d23234b7..7abb94dee6e 100644
--- a/test/manual/image-circular-tests.el
+++ b/test/manual/image-circular-tests.el
@@ -1,4 +1,4 @@
-;;; image-circular-tests.el --- test image functions with circular objects
+;;; image-circular-tests.el --- test image functions with circular objects -*- lexical-binding: t; -*-
;; Copyright (C) 2019, 2021 Free Software Foundation, Inc.
diff --git a/test/manual/image-size-tests.el b/test/manual/image-size-tests.el
index 489b3972932..44846a7a67a 100644
--- a/test/manual/image-size-tests.el
+++ b/test/manual/image-size-tests.el
@@ -1,4 +1,4 @@
-;;; image-size-tests.el -- tests for image scaling
+;;; image-size-tests.el --- tests for image scaling -*- lexical-binding: t; -*-
;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
@@ -45,7 +45,8 @@
(= (cdr size) height))))
(defun image-size-tests ()
- (unless (imagemagick-types)
+ (unless (and (fboundp 'imagemagick-types)
+ (imagemagick-types))
(error "This only makes sense if ImageMagick is installed"))
;; Test the image that's wider than it is tall.
;; Default sizes.
diff --git a/test/manual/image-transforms-tests.el b/test/manual/image-transforms-tests.el
index 5342b5edcae..debb74f2edb 100644
--- a/test/manual/image-transforms-tests.el
+++ b/test/manual/image-transforms-tests.el
@@ -1,4 +1,4 @@
-;;; image-transform-tests.el --- Test suite for image transforms. -*- lexical-binding: t -*-
+;;; image-transforms-tests.el --- Test suite for image transforms. -*- lexical-binding: t -*-
;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
diff --git a/test/manual/indent/scheme.scm b/test/manual/indent/scheme.scm
new file mode 100644
index 00000000000..9053a8743e4
--- /dev/null
+++ b/test/manual/indent/scheme.scm
@@ -0,0 +1,23 @@
+;; Testing sexp-comments
+
+(define a #;(hello) there)
+
+(define a #;1 there)
+
+(define a #;"asdf" there)
+
+(define a ;; #;(hello
+ there)
+
+(define a #;(hello
+ there) 2)
+
+(define a #;(hello
+ #;(world))
+ and)
+ there) 2)
+
+(define a #;(hello
+ #;"asdf" (world
+ and)
+ there) 2)
diff --git a/test/manual/indent/scss-mode.scss b/test/manual/indent/scss-mode.scss
index 189ec4e22ac..2cd4adb8d55 100644
--- a/test/manual/indent/scss-mode.scss
+++ b/test/manual/indent/scss-mode.scss
@@ -1,5 +1,7 @@
// Comment!
+@use "sass:math";
+
nav {
ul {
margin: 0; /* More comment */
@@ -44,8 +46,8 @@ article[role="main"] {
$var_with_underscores: #fff;
$_var-starting-with-underscore: none;
float: left !important;
- width: 600px / 888px * 100%;
- height: 100px / 888px * 100%;
+ width: math.div(600px, 888px) * 100%;
+ height: math.div(100px, 888px) * 100%;
color: $var_with_underscores;
display: $_var-starting-with-underscore;
}
diff --git a/test/manual/redisplay-testsuite.el b/test/manual/redisplay-testsuite.el
index 48f3788b54e..8e90f2d7a5c 100644
--- a/test/manual/redisplay-testsuite.el
+++ b/test/manual/redisplay-testsuite.el
@@ -1,4 +1,4 @@
-;;; redisplay-testsuite.el --- Test suite for redisplay.
+;;; redisplay-testsuite.el --- Test suite for redisplay. -*- lexical-binding: t; -*-
;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
diff --git a/test/manual/scroll-tests.el b/test/manual/scroll-tests.el
index 2f40b2bb696..dd15d54fa88 100644
--- a/test/manual/scroll-tests.el
+++ b/test/manual/scroll-tests.el
@@ -1,4 +1,4 @@
-;;; scroll-tests.el -- tests for scrolling -*- lexical-binding: t -*-
+;;; scroll-tests.el --- tests for scrolling -*- lexical-binding: t -*-
;; Copyright (C) 2017-2021 Free Software Foundation, Inc.
diff --git a/test/misc/test-custom-deps.el b/test/misc/test-custom-deps.el
new file mode 100644
index 00000000000..f072adddcb0
--- /dev/null
+++ b/test/misc/test-custom-deps.el
@@ -0,0 +1,42 @@
+;;; test-custom-deps.el --- Test custom deps -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The command `cus-test-deps' loads all (!) custom dependencies and
+;; reports about load errors.
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-deps custom-test-admin-cus-test)
+(defvar cus-test-deps-errors) ; from admin/cus-tests.el
+
+(ert-deftest test-custom-deps ()
+ :tags '(:expensive-test)
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (cus-test-deps)
+ (should-not cus-test-deps-errors))
+
+;;; test-custom-deps.el ends here
diff --git a/test/misc/test-custom-libs.el b/test/misc/test-custom-libs.el
new file mode 100644
index 00000000000..cc2be99dea8
--- /dev/null
+++ b/test/misc/test-custom-libs.el
@@ -0,0 +1,48 @@
+;;; test-custom-libs.el --- Test custom loads -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file runs for all libraries with autoloads separate emacs
+;; processes of the form "emacs -batch -l LIB".
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-libs custom-test-admin-cus-test)
+(defvar cus-test-libs-errors) ; from admin/cus-tests.el
+
+;; FIXME: Currently fails for:
+;; - lisp/term/ns-win.el
+;; - lisp/org/org-num.el
+(ert-deftest test-custom-libs ()
+ :tags '(:expensive-test)
+ :expected-result :failed ; FIXME: See above.
+ ;; This test is very slow, and IMO not worth the time it takes.
+ (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (cus-test-libs t)
+ (should-not cus-test-libs-errors))
+
+;;; test-custom-deps.el ends here
diff --git a/test/misc/test-custom-noloads.el b/test/misc/test-custom-noloads.el
new file mode 100644
index 00000000000..5e95e7d7740
--- /dev/null
+++ b/test/misc/test-custom-noloads.el
@@ -0,0 +1,45 @@
+;;; test-custom-noloads.el --- Test custom noloads -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The command `cus-test-noloads' returns a list of variables which
+;; are somewhere declared as custom options, but not loaded by
+;; `custom-load-symbol'.
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-noloads custom-test-admin-cus-test)
+(defvar cus-test-vars-not-cus-loaded) ; from admin/cus-tests.el
+
+;; FIXME: Multiple failures here.
+(ert-deftest custom-test-load ()
+ :tags '(:expensive-test :unstable)
+ :expected-result :failed ; FIXME: See above.
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (cus-test-noloads)
+ (should-not cus-test-vars-not-cus-loaded))
+
+;;; test-custom-noloads.el ends here
diff --git a/test/misc/test-custom-opts.el b/test/misc/test-custom-opts.el
new file mode 100644
index 00000000000..fa6b9e66aef
--- /dev/null
+++ b/test/misc/test-custom-opts.el
@@ -0,0 +1,39 @@
+;;; test-custom-opts.el --- Test custom opts -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; The command `cus-test-opts' tests many (all?) custom options.
+
+;;; Code:
+
+(require 'ert)
+
+(defconst custom-test-admin-cus-test
+ (expand-file-name "admin/cus-test.el" source-directory))
+
+(declare-function cus-test-opts custom-test-admin-cus-test)
+
+(ert-deftest check-for-wrong-custom-opts ()
+ :tags '(:expensive-test)
+ (skip-unless (file-readable-p custom-test-admin-cus-test))
+ (load custom-test-admin-cus-test)
+ (should (null (cus-test-opts t))))
+
+;;; test-custom-opts.el ends here
diff --git a/test/src/buffer-tests.el b/test/src/buffer-tests.el
index 123f2e8eabb..118311c4d26 100644
--- a/test/src/buffer-tests.el
+++ b/test/src/buffer-tests.el
@@ -754,7 +754,7 @@ with parameters from the *Messages* buffer modification."
(should-length 2 (overlays-in 1 (point-max)))
(should-length 1 (overlays-in (point-max) (point-max)))
(narrow-to-region 1 50)
- (should-length 0 (overlays-in 1 (point-max)))
+ (should-length 1 (overlays-in 1 (point-max)))
(should-length 1 (overlays-in (point-max) (point-max))))))
@@ -1345,8 +1345,8 @@ with parameters from the *Messages* buffer modification."
(add-hook 'kill-buffer-hook kbh nil t)
(add-hook 'kill-buffer-query-functions kbqf nil t)
(kill-buffer))
- (with-temp-buffer)
- (with-output-to-string)
+ (with-temp-buffer (ignore))
+ (with-output-to-string (ignore))
(should-not run-bluh)
(should-not run-kbh)
(should-not run-kbqf)
@@ -1361,4 +1361,63 @@ with parameters from the *Messages* buffer modification."
(should run-kbqf))
(remove-hook 'buffer-list-update-hook bluh))))
+(ert-deftest buffer-tests-inhibit-buffer-hooks-indirect ()
+ "Indirect buffers do not call `get-buffer-create'."
+ (dolist (inhibit '(nil t))
+ (let ((base (get-buffer-create "foo" inhibit)))
+ (unwind-protect
+ (dotimes (_i 11)
+ (let* (flag*
+ (flag (lambda () (prog1 t (setq flag* t))))
+ (indirect (make-indirect-buffer base "foo[indirect]" nil
+ inhibit)))
+ (unwind-protect
+ (progn
+ (with-current-buffer indirect
+ (add-hook 'kill-buffer-query-functions flag nil t))
+ (kill-buffer indirect)
+ (if inhibit
+ (should-not flag*)
+ (should flag*)))
+ (let (kill-buffer-query-functions)
+ (when (buffer-live-p indirect)
+ (kill-buffer indirect))))))
+ (let (kill-buffer-query-functions)
+ (when (buffer-live-p base)
+ (kill-buffer base)))))))
+
+(ert-deftest zero-length-overlays-and-not ()
+ (with-temp-buffer
+ (insert "hello")
+ (let ((long-overlay (make-overlay 2 4))
+ (zero-overlay (make-overlay 3 3)))
+ ;; Exclude.
+ (should (= (length (overlays-at 3)) 1))
+ (should (eq (car (overlays-at 3)) long-overlay))
+ ;; Include.
+ (should (= (length (overlays-in 3 3)) 2))
+ (should (memq long-overlay (overlays-in 3 3)))
+ (should (memq zero-overlay (overlays-in 3 3))))))
+
+(ert-deftest test-remove-overlays ()
+ (with-temp-buffer
+ (insert "foo")
+ (make-overlay (point) (point))
+ (should (= (length (overlays-in (point-min) (point-max))) 1))
+ (remove-overlays)
+ (should (= (length (overlays-in (point-min) (point-max))) 0)))
+
+ (with-temp-buffer
+ (insert "foo")
+ (goto-char 2)
+ (make-overlay (point) (point))
+ ;; We only count zero-length overlays at the end of the buffer.
+ (should (= (length (overlays-in 1 2)) 0))
+ (narrow-to-region 1 2)
+ ;; We've now narrowed, so the zero-length overlay is at the end of
+ ;; the (accessible part of the) buffer.
+ (should (= (length (overlays-in 1 2)) 1))
+ (remove-overlays)
+ (should (= (length (overlays-in (point-min) (point-max))) 0))))
+
;;; buffer-tests.el ends here
diff --git a/test/src/character-tests.el b/test/src/character-tests.el
new file mode 100644
index 00000000000..f630b32a5ee
--- /dev/null
+++ b/test/src/character-tests.el
@@ -0,0 +1,45 @@
+;;; character-tests.el --- tests for character.c -*- lexical-binding:t -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+
+(ert-deftest character-test-string-width ()
+ "Test `string-width' with and without compositions."
+ (should (= (string-width "1234") 4))
+ (should (= (string-width "12\t34") (+ 4 tab-width)))
+ (should (= (string-width "áëòç") 4))
+ (should (= (string-width "áëòç") 4))
+ (should (= (string-width "הַרְבֵּה אַהֲבָה") 9))
+ (should (= (string-width "1234" 1 3) 2))
+ (should (= (string-width "1234" nil -1) 3))
+ (should (= (string-width "1234" 2) 2))
+ (should-error (string-width "1234" nil 5))
+ (should-error (string-width "1234" -5))
+ (should (= (string-width "12\t34") (+ 4 tab-width)))
+ (should (= (string-width "1234\t56") (+ 6 tab-width)))
+ (should (= (string-width "áëòç") 4))
+ (should (= (string-width "áëòç" nil 3) 3))
+ (should (= (string-width "áëòç" 1 3) 2))
+ (should (= (string-width "áëòç" nil 2) 1))
+ (should (= (string-width "áëòç" nil 3) 2))
+ (should (= (string-width "áëòç" nil 4) 2))
+ (should (= (string-width "הַרְבֵּה אַהֲבָה") 9))
+ (should (= (string-width "הַרְבֵּה אַהֲבָה" nil 8) 4)))
diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el
index 0bdcff22ce5..134f5676709 100644
--- a/test/src/coding-tests.el
+++ b/test/src/coding-tests.el
@@ -56,7 +56,7 @@
(set-buffer-multibyte nil)
(insert (encode-coding-string "あ" 'euc-jp) "\xd" "\n")
(decode-coding-region (point-min) (point-max) 'euc-jp-dos)
- (should-not (string-match-p "\^M" (buffer-string)))))
+ (should-not (string-search "\^M" (buffer-string)))))
;; Return the contents (specified by CONTENT-TYPE; ascii, latin, or
;; binary) of a test file.
@@ -359,7 +359,7 @@
(delete-region (point-min) (point))))))
(defun benchmark-decoder ()
- (let ((gc-cons-threshold 4000000))
+ (let ((gc-cons-threshold (max gc-cons-threshold 4000000)))
(insert "Without optimization:\n")
(dolist (files test-file-list)
(dolist (file (cdr files))
diff --git a/test/src/comp-resources/comp-test-45603.el b/test/src/comp-resources/comp-test-45603.el
new file mode 100644
index 00000000000..f1c0dafb68d
--- /dev/null
+++ b/test/src/comp-resources/comp-test-45603.el
@@ -0,0 +1,28 @@
+;;; -*- lexical-binding: t; -*-
+
+;; Reduced from ivy.el.
+
+(defvar comp-test-45603-last)
+(defvar comp-test-45603-mark-prefix)
+(defvar comp-test-45603-directory)
+(defvar comp-test-45603-marked-candidates)
+
+(defun comp-test-45603--call-marked (action)
+ (let* ((prefix-len (length comp-test-45603-mark-prefix))
+ (marked-candidates
+ (mapcar
+ (lambda (s)
+ (let ((cand (substring s prefix-len)))
+ (if comp-test-45603-directory
+ (expand-file-name cand comp-test-45603-directory)
+ cand)))
+ comp-test-45603-marked-candidates))
+ (multi-action (comp-test-45603--get-multi-action comp-test-45603-last)))))
+
+(defalias 'comp-test-45603--file-local-name
+ (if (fboundp 'file-local-name)
+ #'file-local-name
+ (lambda (file)
+ (or (file-remote-p file 'localname) file))))
+
+(provide 'comp-test-45603)
diff --git a/test/src/comp-resources/comp-test-funcs-dyn.el b/test/src/comp-resources/comp-test-funcs-dyn.el
new file mode 100644
index 00000000000..3118455e3f6
--- /dev/null
+++ b/test/src/comp-resources/comp-test-funcs-dyn.el
@@ -0,0 +1,50 @@
+;;; comp-test-funcs-dyn.el --- compilation unit tested by comp-tests.el -*- lexical-binding: nil; -*-
+
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+;; Author: Andrea Corallo <akrl@sdf.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defun comp-tests-ffuncall-callee-dyn-f (a b)
+ (list a b))
+
+(defun comp-tests-ffuncall-callee-opt-dyn-f (a b &optional c d)
+ (list a b c d))
+
+(defun comp-tests-ffuncall-callee-rest-dyn-f (a b &rest c)
+ (list a b c))
+
+(defun comp-tests-ffuncall-callee-opt-rest-dyn-f (a b &optional c &rest d)
+ (list a b c d))
+
+(defun comp-tests-cl-macro-exp-f ()
+ (cl-loop for xxx in '(a b)
+ for yyy = xxx
+ collect xxx))
+
+(cl-defun comp-tests-cl-uninterned-arg-parse-f (a &optional b &aux)
+ (list a b))
+
+(provide 'comp-test-dyn-funcs)
+
+;;; comp-test-funcs-dyn.el ends here
diff --git a/test/src/comp-resources/comp-test-funcs.el b/test/src/comp-resources/comp-test-funcs.el
new file mode 100644
index 00000000000..f2a246320ac
--- /dev/null
+++ b/test/src/comp-resources/comp-test-funcs.el
@@ -0,0 +1,710 @@
+;;; comp-test-funcs.el --- compilation unit tested by comp-tests.el -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+;; Author: Andrea Corallo <akrl@sdf.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(defvar comp-tests-var1 3)
+
+(defun comp-tests-varref-f ()
+ comp-tests-var1)
+
+(defun comp-tests-list-f ()
+ (list 1 2 3))
+(defun comp-tests-list2-f (a b c)
+ (list a b c))
+(defun comp-tests-car-f (x)
+ ;; Bcar
+ (car x))
+(defun comp-tests-cdr-f (x)
+ ;; Bcdr
+ (cdr x))
+(defun comp-tests-car-safe-f (x)
+ ;; Bcar_safe
+ (car-safe x))
+(defun comp-tests-cdr-safe-f (x)
+ ;; Bcdr_safe
+ (cdr-safe x))
+
+(defun comp-tests-cons-car-f ()
+ (car (cons 1 2)))
+(defun comp-tests-cons-cdr-f (x)
+ (cdr (cons 'foo x)))
+
+(defun comp-tests-hint-fixnum-f (n)
+ (1+ (comp-hint-fixnum n)))
+
+(defun comp-tests-hint-cons-f (c)
+ (car (comp-hint-cons c)))
+
+(defun comp-tests-varset0-f ()
+ (setq comp-tests-var1 55))
+(defun comp-tests-varset1-f ()
+ (setq comp-tests-var1 66)
+ 4)
+
+(defun comp-tests-length-f ()
+ (length '(1 2 3)))
+
+(defun comp-tests-aref-aset-f ()
+ (let ((vec (make-vector 3 0)))
+ (aset vec 2 100)
+ (aref vec 2)))
+
+(defvar comp-tests-var2 3)
+(defun comp-tests-symbol-value-f ()
+ (symbol-value 'comp-tests-var2))
+
+(defun comp-tests-concat-f (x)
+ (concat "a" "b" "c" "d"
+ (concat "a" "b" "c" (concat "a" "b" (concat "foo" x)))))
+
+(defun comp-tests-ffuncall-callee-f (x y z)
+ (list x y z))
+
+(defun comp-tests-ffuncall-callee-optional-f (a b &optional c d)
+ (list a b c d))
+
+(defun comp-tests-ffuncall-callee-rest-f (a b &rest c)
+ (list a b c))
+
+(defun comp-tests-ffuncall-callee-more8-f (p1 p2 p3 p4 p5 p6 p7 p8 p9 p10)
+ ;; More then 8 args.
+ (list p1 p2 p3 p4 p5 p6 p7 p8 p9 p10))
+
+(defun comp-tests-ffuncall-callee-more8-rest-f (p1 p2 p3 p4 p5 p6 p7 p8 p9 &rest p10)
+ ;; More then 8 args.
+ (list p1 p2 p3 p4 p5 p6 p7 p8 p9 p10))
+
+(defun comp-tests-ffuncall-native-f ()
+ "Call a primitive with no dedicate op."
+ (make-vector 1 nil))
+
+(defun comp-tests-ffuncall-native-rest-f ()
+ "Call a primitive with no dedicate op with &rest."
+ (vector 1 2 3))
+
+(defun comp-tests-ffuncall-apply-many-f (x)
+ (apply #'list x))
+
+(defun comp-tests-ffuncall-lambda-f (x)
+ (let ((fun (lambda (x)
+ (1+ x))))
+ (funcall fun x)))
+
+(defun comp-tests-jump-table-1-f (x)
+ (pcase x
+ ('x 'a)
+ ('y 'b)
+ (_ 'c)))
+
+(defun comp-tests-jump-table-2-f (x)
+ (pcase x
+ ("aaa" 'a)
+ ("bbb" 'b)))
+
+(defun comp-tests-conditionals-1-f (x)
+ ;; Generate goto-if-nil
+ (if x 1 2))
+(defun comp-tests-conditionals-2-f (x)
+ ;; Generate goto-if-nil-else-pop
+ (when x
+ 1340))
+
+(defun comp-tests-fixnum-1-minus-f (x)
+ ;; Bsub1
+ (1- x))
+(defun comp-tests-fixnum-1-plus-f (x)
+ ;; Badd1
+ (1+ x))
+(defun comp-tests-fixnum-minus-f (x)
+ ;; Bnegate
+ (- x))
+
+(defun comp-tests-eqlsign-f (x y)
+ ;; Beqlsign
+ (= x y))
+(defun comp-tests-gtr-f (x y)
+ ;; Bgtr
+ (> x y))
+(defun comp-tests-lss-f (x y)
+ ;; Blss
+ (< x y))
+(defun comp-tests-les-f (x y)
+ ;; Bleq
+ (<= x y))
+(defun comp-tests-geq-f (x y)
+ ;; Bgeq
+ (>= x y))
+
+(defun comp-tests-setcar-f (x y)
+ (setcar x y)
+ x)
+(defun comp-tests-setcdr-f (x y)
+ (setcdr x y)
+ x)
+
+(defun comp-bubble-sort-f (list)
+ (let ((i (length list)))
+ (while (> i 1)
+ (let ((b list))
+ (while (cdr b)
+ (when (< (cadr b) (car b))
+ (setcar b (prog1 (cadr b)
+ (setcdr b (cons (car b) (cddr b))))))
+ (setq b (cdr b))))
+ (setq i (1- i)))
+ list))
+
+(defun comp-tests-consp-f (x)
+ ;; Bconsp
+ (consp x))
+(defun comp-tests-setcar2-f (x)
+ ;; Bsetcar
+ (setcar x 3))
+
+(defun comp-tests-integerp-f (x)
+ ;; Bintegerp
+ (integerp x))
+(defun comp-tests-numberp-f (x)
+ ;; Bnumberp
+ (numberp x))
+
+(defun comp-tests-discardn-f (x)
+ ;; BdiscardN
+ (1+ (let ((a 1)
+ (_b)
+ (_c))
+ a)))
+(defun comp-tests-insertn-f (a b c d)
+ ;; Binsert
+ (insert a b c d))
+
+(defun comp-tests-err-arith-f ()
+ (/ 1 0))
+(defun comp-tests-err-foo-f ()
+ (error "foo"))
+
+(defun comp-tests-condition-case-0-f ()
+ ;; Bpushhandler Bpophandler
+ (condition-case
+ err
+ (comp-tests-err-arith-f)
+ (arith-error (concat "arith-error "
+ (error-message-string err)
+ " catched"))
+ (error (concat "error "
+ (error-message-string err)
+ " catched"))))
+(defun comp-tests-condition-case-1-f ()
+ ;; Bpushhandler Bpophandler
+ (condition-case
+ err
+ (comp-tests-err-foo-f)
+ (arith-error (concat "arith-error "
+ (error-message-string err)
+ " catched"))
+ (error (concat "error "
+ (error-message-string err)
+ " catched"))))
+(defun comp-tests-catch-f (f)
+ (catch 'foo
+ (funcall f)))
+(defun comp-tests-throw-f (x)
+ (throw 'foo x))
+
+(defun comp-tests-buff0-f ()
+ (with-temp-buffer
+ (insert "foo")
+ (buffer-string)))
+
+(defun comp-tests-lambda-return-f ()
+ (lambda (x) (1+ x)))
+
+(defun comp-tests-fib-f (n)
+ (cond ((= n 0) 0)
+ ((= n 1) 1)
+ (t (+ (comp-tests-fib-f (- n 1))
+ (comp-tests-fib-f (- n 2))))))
+
+(defmacro comp-tests-macro-m (x)
+ x)
+
+(defun comp-tests-string-trim-f (url)
+ (string-trim url))
+
+(defun comp-tests-trampoline-removal-f ()
+ (make-hash-table))
+
+(defun comp-tests-signal-f ()
+ (signal 'foo t))
+
+(defun comp-tests-func-call-removal-f ()
+ (let ((a 10)
+ (b 3))
+ (% a b)))
+
+(defun comp-tests-doc-f ()
+ "A nice docstring"
+ t)
+
+(defun comp-test-interactive-form0-f (dir)
+ (interactive "D")
+ dir)
+
+(defun comp-test-interactive-form1-f (x y)
+ (interactive '(1 2))
+ (+ x y))
+
+(defun comp-test-interactive-form2-f ()
+ (interactive))
+
+(defun comp-test-40187-2-f ()
+ 'foo)
+
+(defalias 'comp-test-40187-1-f (symbol-function 'comp-test-40187-2-f))
+
+(defun comp-test-40187-2-f ()
+ 'bar)
+
+(defun comp-test-speed--1-f ()
+ (declare (speed -1))
+ 3)
+
+(defun comp-test-42360-f (str end-column
+ &optional start-column padding ellipsis
+ ellipsis-text-property)
+ ;; From `truncate-string-to-width'. A large enough function to
+ ;; potentially use all registers and that is modifying local
+ ;; variables inside condition-case.
+ (let ((str-len (length str))
+ (str-width 14)
+ (ellipsis-width 3)
+ (idx 0)
+ (column 0)
+ (head-padding "") (tail-padding "")
+ ch last-column last-idx from-idx)
+ (condition-case nil
+ (while (< column start-column)
+ (setq ch (aref str idx)
+ column (+ column (char-width ch))
+ idx (1+ idx)))
+ (args-out-of-range (setq idx str-len)))
+ (if (< column start-column)
+ (if padding (make-string end-column padding) "")
+ (when (and padding (> column start-column))
+ (setq head-padding (make-string (- column start-column) padding)))
+ (setq from-idx idx)
+ (when (>= end-column column)
+ (condition-case nil
+ (while (< column end-column)
+ (setq last-column column
+ last-idx idx
+ ch (aref str idx)
+ column (+ column (char-width ch))
+ idx (1+ idx)))
+ (args-out-of-range (setq idx str-len)))
+ (when (> column end-column)
+ (setq column last-column
+ idx last-idx))
+ (when (and padding (< column end-column))
+ (setq tail-padding (make-string (- end-column column) padding))))
+ (if (and ellipsis-text-property
+ (not (equal ellipsis ""))
+ idx)
+ (concat head-padding
+ (substring str from-idx idx)
+ (propertize (substring str idx) 'display (or ellipsis "")))
+ (concat head-padding (substring str from-idx idx)
+ tail-padding ellipsis)))))
+
+(defun comp-test-primitive-advice-f (x y)
+ (declare (speed 2))
+ (+ x y))
+
+(defun comp-test-primitive-redefine-f (x y)
+ (declare (speed 2))
+ (- x y))
+
+(defsubst comp-test-defsubst-f ()
+ t)
+
+(defvar comp-test-and-3-var 1)
+(defun comp-test-and-3-f (x)
+ (and (atom x)
+ comp-test-and-3-var
+ 2))
+
+(defun comp-test-copy-insn-f (insn)
+ ;; From `comp-copy-insn'.
+ (if (consp insn)
+ (let (result)
+ (while (consp insn)
+ (let ((newcar (car insn)))
+ (if (or (consp (car insn)) (comp-mvar-p (car insn)))
+ (setf newcar (comp-copy-insn (car insn))))
+ (push newcar result))
+ (setf insn (cdr insn)))
+ (nconc (nreverse result)
+ (if (comp-mvar-p insn) (comp-copy-insn insn) insn)))
+ (if (comp-mvar-p insn)
+ (copy-comp-mvar insn)
+ insn)))
+
+(defun comp-test-cond-rw-1-1-f ())
+
+(defun comp-test-cond-rw-1-2-f ()
+ (let ((it (comp-test-cond-rw-1-1-f))
+ (key 't))
+ (if (or (equal it key)
+ (eq key t))
+ it
+ nil)))
+
+(defun comp-test-44968-f (start end)
+ (let ((dirlist)
+ (dir (expand-file-name start))
+ (end (expand-file-name end)))
+ (while (not (or (equal dir (car dirlist))
+ (file-equal-p dir end)))
+ (push dir dirlist)
+ (setq dir (directory-file-name (file-name-directory dir))))
+ (nreverse dirlist)))
+
+(defun comp-test-45342-f (n)
+ (pcase n
+ (1 " ➊") (2 " ➋") (3 " ➌") (4 " ➍") (5 " ➎") (6 " ➏")
+ (7 " ➐") (8 " ➑") (9 " ➒") (10 " ➓") (_ "")))
+
+(defun comp-test-assume-double-neg-f (collection value)
+ ;; Reduced from `auth-source-search-collection'.
+ (when (atom collection)
+ (setq collection (list collection)))
+ (or (eq value t)
+ ;; value is (not (member t))
+ (eq collection value)
+ ;; collection is t, not (member t)!
+ (member value collection)))
+
+(defun comp-test-assume-in-loop-1-f (arg)
+ ;; Reduced from `comint-delim-arg'.
+ (let ((args nil)
+ (pos 0)
+ (len (length arg)))
+ (while (< pos len)
+ (let ((start pos))
+ (while (< pos len)
+ (setq pos (1+ pos)))
+ (setq args (cons (substring arg start pos) args))))
+ args))
+
+(defun comp-test-45376-1-f ()
+ ;; Reduced from `eshell-ls-find-column-lengths'.
+ (let* (res
+ (len 2)
+ (i 0)
+ (j 0))
+ (while (< j len)
+ (if (= i len)
+ (setq i 0))
+ (setq res (cons i res)
+ j (1+ j)
+ i (1+ i)))
+ res))
+
+(defun comp-test-45376-2-f ()
+ ;; Also reduced from `eshell-ls-find-column-lengths'.
+ (let* ((x 1)
+ res)
+ (while x
+ (let* ((y 4)
+ (i 0))
+ (while (> y 0)
+ (when (= i x)
+ (setq i 0))
+ (setf res (cons i res))
+ (setq y (1- y)
+ i (1+ i)))
+ (if (>= x 3)
+ (setq x nil)
+ (setq x (1+ x)))))
+ res))
+
+(defun comp-test-not-cons-f (x)
+ ;; Reduced from `cl-copy-list'.
+ (if (consp x)
+ (print x)
+ (car x)))
+
+(defun comp-test-45576-f ()
+ ;; Reduced from `eshell-find-alias-function'.
+ (let ((sym (intern-soft "eval")))
+ (if (and (functionp sym)
+ '(eshell-ls eshell-pred eshell-prompt eshell-script
+ eshell-term eshell-unix))
+ sym)))
+
+(defun comp-test-45635-f (&rest args)
+ ;; Reduced from `set-face-attribute'.
+ (let ((spec args)
+ family)
+ (while spec
+ (cond ((eq (car spec) :family)
+ (setq family (cadr spec))))
+ (setq spec (cddr spec)))
+ (when (and (stringp family)
+ (string-match "\\([^-]*\\)-\\([^-]*\\)" family))
+ (setq family (match-string 2 family)))
+ (when (or (stringp family)
+ (eq family 'unspecified))
+ family)))
+
+(defun comp-test-46670-1-f (_)
+ "foo")
+
+(defun comp-test-46670-2-f (s)
+ (and (equal (comp-test-46670-1-f (length s)) s)
+ s))
+
+(cl-defun comp-test-46824-1-f ()
+ (let ((next-repos '(1)))
+ (while t
+ (let ((recipe (car next-repos)))
+ (cl-block loop
+ (while t
+ (let ((err
+ (condition-case e
+ (progn
+ (setq next-repos
+ (cdr next-repos))
+ (cl-return-from loop))
+ (error e))))
+ (format "%S"
+ (error-message-string err))))))
+ (cl-return-from comp-test-46824-1-f))))
+
+(defun comp-test-47868-1-f ()
+ " ")
+
+(defun comp-test-47868-2-f ()
+ #(" " 0 1 (face font-lock-keyword-face)))
+
+(defun comp-test-47868-3-f ()
+ " ")
+
+(defun comp-test-47868-4-f ()
+ #(" " 0 1 (face font-lock-keyword-face)))
+
+
+
+;;;;;;;;;;;;;;;;;;;;
+;; Tromey's tests ;;
+;;;;;;;;;;;;;;;;;;;;
+
+;; Test Bconsp.
+(defun comp-test-consp (x) (consp x))
+
+;; Test Blistp.
+(defun comp-test-listp (x) (listp x))
+
+;; Test Bstringp.
+(defun comp-test-stringp (x) (stringp x))
+
+;; Test Bsymbolp.
+(defun comp-test-symbolp (x) (symbolp x))
+
+;; Test Bintegerp.
+(defun comp-test-integerp (x) (integerp x))
+
+;; Test Bnumberp.
+(defun comp-test-numberp (x) (numberp x))
+
+;; Test Badd1.
+(defun comp-test-add1 (x) (1+ x))
+
+;; Test Bsub1.
+(defun comp-test-sub1 (x) (1- x))
+
+;; Test Bneg.
+(defun comp-test-negate (x) (- x))
+
+;; Test Bnot.
+(defun comp-test-not (x) (not x))
+
+;; Test Bbobp, Beobp, Bpoint, Bpoint_min, Bpoint_max.
+(defun comp-test-bobp () (bobp))
+(defun comp-test-eobp () (eobp))
+(defun comp-test-point () (point))
+(defun comp-test-point-min () (point-min))
+(defun comp-test-point-max () (point-max))
+
+;; Test Bcar and Bcdr.
+(defun comp-test-car (x) (car x))
+(defun comp-test-cdr (x) (cdr x))
+
+;; Test Bcar_safe and Bcdr_safe.
+(defun comp-test-car-safe (x) (car-safe x))
+(defun comp-test-cdr-safe (x) (cdr-safe x))
+
+;; Test Beq.
+(defun comp-test-eq (x y) (eq x y))
+
+;; Test Bgotoifnil.
+(defun comp-test-if (x y) (if x x y))
+
+;; Test Bgotoifnilelsepop.
+(defun comp-test-and (x y) (and x y))
+
+;; Test Bgotoifnonnilelsepop.
+(defun comp-test-or (x y) (or x y))
+
+;; Test Bsave_excursion.
+(defun comp-test-save-excursion ()
+ (save-excursion
+ (insert "XYZ")))
+
+;; Test Bcurrent_buffer.
+(defun comp-test-current-buffer () (current-buffer))
+
+;; Test Bgtr.
+(defun comp-test-> (a b)
+ (> a b))
+
+;; Test Bpushcatch.
+(defun comp-test-catch (&rest l)
+ (catch 'done
+ (dolist (v l)
+ (when (> v 23)
+ (throw 'done v)))))
+
+;; Test Bmemq.
+(defun comp-test-memq (val list)
+ (memq val list))
+
+;; Test BlistN.
+(defun comp-test-listN (x)
+ (list x x x x x x x x x x x x x x x x))
+
+;; Test BconcatN.
+(defun comp-test-concatN (x)
+ (concat x x x x x x))
+
+;; Test optional and rest arguments.
+(defun comp-test-opt-rest (a &optional b &rest c)
+ (list a b c))
+
+;; Test for too many arguments.
+(defun comp-test-opt (a &optional b)
+ (cons a b))
+
+;; Test for unwind-protect.
+(defvar comp-test-up-val nil)
+(defun comp-test-unwind-protect (fun)
+ (setq comp-test-up-val nil)
+ (unwind-protect
+ (progn
+ (setq comp-test-up-val 23)
+ (funcall fun)
+ (setq comp-test-up-val 24))
+ (setq comp-test-up-val 999)))
+
+;; Non tested functions that proved just to be difficult to compile.
+
+(defun comp-test-callee (_ __) t)
+(defun comp-test-silly-frame1 (x)
+ ;; Check robustness against dead code.
+ (cl-case x
+ (0 (comp-test-callee
+ (pcase comp-tests-var1
+ (1 1)
+ (2 2))
+ 3))))
+
+(defun comp-test-silly-frame2 (token)
+ ;; Check robustness against dead code.
+ (while c
+ (cl-case c
+ (?< 1)
+ (?> 2))))
+
+(defun comp-test-big-interactive (filename &optional force arg load)
+ ;; Check non trivial interactive form using `byte-recompile-file'.
+ (interactive
+ (let ((file buffer-file-name)
+ (file-name nil)
+ (file-dir nil))
+ (and file
+ (derived-mode-p 'emacs-lisp-mode)
+ (setq file-name (file-name-nondirectory file)
+ file-dir (file-name-directory file)))
+ (list (read-file-name (if current-prefix-arg
+ "Byte compile file: "
+ "Byte recompile file: ")
+ file-dir file-name nil)
+ current-prefix-arg)))
+ (let ((dest (byte-compile-dest-file filename))
+ ;; Expand now so we get the current buffer's defaults
+ (filename (expand-file-name filename)))
+ (if (if (file-exists-p dest)
+ ;; File was already compiled
+ ;; Compile if forced to, or filename newer
+ (or force
+ (file-newer-than-file-p filename dest))
+ (and arg
+ (or (eq 0 arg)
+ (y-or-n-p (concat "Compile "
+ filename "? ")))))
+ (progn
+ (if (and noninteractive (not byte-compile-verbose))
+ (message "Compiling %s..." filename))
+ (byte-compile-file filename load))
+ (when load
+ (load (if (file-exists-p dest) dest filename)))
+ 'no-byte-compile)))
+
+(defun comp-test-no-return-1 (x)
+ (while x
+ (error "foo")))
+
+(defun comp-test-no-return-2 (x)
+ (cond
+ ((eql x '2) t)
+ ((error "bar") nil)))
+
+(defun comp-test-no-return-3 ())
+(defun comp-test-no-return-4 (x)
+ (when x
+ (error "foo")
+ (while (comp-test-no-return-3)
+ (comp-test-no-return-3))))
+
+(defun comp-test-=-nan (x)
+ (when (= x 0.0e+NaN)
+ x))
+
+(defun comp-test-=-infinity (x)
+ (when (= x 1.0e+INF)
+ x))
+
+(provide 'comp-test-funcs)
+
+;;; comp-test-funcs.el ends here
diff --git a/test/src/comp-resources/comp-test-pure.el b/test/src/comp-resources/comp-test-pure.el
new file mode 100644
index 00000000000..5c1d2d17472
--- /dev/null
+++ b/test/src/comp-resources/comp-test-pure.el
@@ -0,0 +1,40 @@
+;;; comp-test-pure.el --- compilation unit tested by comp-tests.el -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+;; Author: Andrea Corallo <akrl@sdf.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(defun comp-tests-pure-callee-f (x)
+ (1+ x))
+
+(defun comp-tests-pure-caller-f ()
+ (comp-tests-pure-callee-f 3))
+
+(defun comp-tests-pure-fibn-f (a b count)
+ (if (= count 0)
+ b
+ (comp-tests-pure-fibn-f (+ a b) a (- count 1))))
+
+(defun comp-tests-pure-fibn-entry-f ()
+ (comp-tests-pure-fibn-f 1 0 20))
+
+;;; comp-test-pure.el ends here
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
new file mode 100644
index 00000000000..fb9441eb66e
--- /dev/null
+++ b/test/src/comp-tests.el
@@ -0,0 +1,1443 @@
+;;; comp-tests.el --- unit tests for src/comp.c -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+;; Author: Andrea Corallo <akrl@sdf.org>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Unit tests for src/comp.c.
+
+;;; Code:
+
+(require 'ert)
+(require 'ert-x)
+(require 'cl-lib)
+
+(defconst comp-test-src (ert-resource-file "comp-test-funcs.el"))
+
+(defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el"))
+
+(when (featurep 'native-compile)
+ (require 'comp)
+ (message "Compiling tests...")
+ (load (native-compile comp-test-src))
+ (load (native-compile comp-test-dyn-src)))
+
+(defmacro comp-deftest (name args &rest docstring-and-body)
+ "Define a test for the native compiler tagging it as :nativecomp."
+ (declare (indent defun)
+ (doc-string 3))
+ `(ert-deftest ,(intern (concat "comp-tests-" (symbol-name name))) ,args
+ :tags '(:nativecomp)
+ ,@docstring-and-body))
+
+
+
+(ert-deftest comp-tests-bootstrap ()
+ "Compile the compiler and load it to compile it-self.
+Check that the resulting binaries do not differ."
+ :tags '(:expensive-test :nativecomp)
+ (let* ((byte+native-compile t) ; FIXME HACK
+ (comp-src (expand-file-name "../../../lisp/emacs-lisp/comp.el"
+ (ert-resource-directory)))
+ (comp1-src (make-temp-file "stage1-" nil ".el"))
+ (comp2-src (make-temp-file "stage2-" nil ".el"))
+ ;; Can't use debug symbols.
+ (native-comp-debug 0))
+ (copy-file comp-src comp1-src t)
+ (copy-file comp-src comp2-src t)
+ (let ((load-no-native t))
+ (load (concat comp-src "c") nil nil t t))
+ (should-not (subr-native-elisp-p (symbol-function #'native-compile)))
+ (message "Compiling stage1...")
+ (let* ((t0 (current-time))
+ (comp1-eln (native-compile comp1-src)))
+ (message "Done in %d secs" (float-time (time-since t0)))
+ (load comp1-eln nil nil t t)
+ (should (subr-native-elisp-p (symbol-function 'native-compile)))
+ (message "Compiling stage2...")
+ (let ((t0 (current-time))
+ (comp2-eln (native-compile comp2-src)))
+ (message "Done in %d secs" (float-time (time-since t0)))
+ (message "Comparing %s %s" comp1-eln comp2-eln)
+ (should (= (call-process "cmp" nil nil nil comp1-eln comp2-eln) 0))))))
+
+(comp-deftest provide ()
+ "Testing top level provide."
+ (should (featurep 'comp-test-funcs)))
+
+(comp-deftest varref ()
+ "Testing varref."
+ (should (= (comp-tests-varref-f) 3)))
+
+(comp-deftest list ()
+ "Testing cons car cdr."
+ (should (equal (comp-tests-list-f) '(1 2 3)))
+ (should (equal (comp-tests-list2-f 1 2 3) '(1 2 3)))
+ (should (= (comp-tests-car-f '(1 . 2)) 1))
+ (should (null (comp-tests-car-f nil)))
+ (should-error (comp-tests-car-f 3)
+ :type 'wrong-type-argument)
+ (should (= (comp-tests-cdr-f '(1 . 2)) 2))
+ (should (null (comp-tests-cdr-f nil)))
+ (should-error (comp-tests-cdr-f 3)
+ :type 'wrong-type-argument)
+ (should (= (comp-tests-car-safe-f '(1 . 2)) 1))
+ (should (null (comp-tests-car-safe-f 'a)))
+ (should (= (comp-tests-cdr-safe-f '(1 . 2)) 2))
+ (should (null (comp-tests-cdr-safe-f 'a))))
+
+(comp-deftest comp-tests-cons-car-cdr ()
+ "Testing cons car cdr."
+ (should (= (comp-tests-cons-car-f) 1))
+ (should (= (comp-tests-cons-cdr-f 3) 3)))
+
+(comp-deftest varset ()
+ "Testing varset."
+ (comp-tests-varset0-f)
+ (should (= comp-tests-var1 55))
+
+ (should (= (comp-tests-varset1-f) 4))
+ (should (= comp-tests-var1 66)))
+
+(comp-deftest length ()
+ "Testing length."
+ (should (= (comp-tests-length-f) 3)))
+
+(comp-deftest aref-aset ()
+ "Testing aref and aset."
+ (should (= (comp-tests-aref-aset-f) 100)))
+
+(comp-deftest symbol-value ()
+ "Testing aref and aset."
+ (should (= (comp-tests-symbol-value-f) 3)))
+
+(comp-deftest concat ()
+ "Testing concatX opcodes."
+ (should (string= (comp-tests-concat-f "bar") "abcdabcabfoobar")))
+
+(comp-deftest ffuncall ()
+ "Test calling conventions."
+
+ ;; (defun comp-tests-ffuncall-caller-f ()
+ ;; (comp-tests-ffuncall-callee-f 1 2 3))
+
+ ;; (should (equal (comp-tests-ffuncall-caller-f) '(1 2 3)))
+
+ ;; ;; After it gets compiled
+ ;; (native-compile #'comp-tests-ffuncall-callee-f)
+ ;; (should (equal (comp-tests-ffuncall-caller-f) '(1 2 3)))
+
+ ;; ;; Recompiling the caller once with callee already compiled
+ ;; (defun comp-tests-ffuncall-caller-f ()
+ ;; (comp-tests-ffuncall-callee-f 1 2 3))
+ ;; (should (equal (comp-tests-ffuncall-caller-f) '(1 2 3)))
+
+ (should (equal (comp-tests-ffuncall-callee-optional-f 1 2 3 4)
+ '(1 2 3 4)))
+ (should (equal (comp-tests-ffuncall-callee-optional-f 1 2 3)
+ '(1 2 3 nil)))
+ (should (equal (comp-tests-ffuncall-callee-optional-f 1 2)
+ '(1 2 nil nil)))
+
+ (should (equal (comp-tests-ffuncall-callee-rest-f 1 2)
+ '(1 2 nil)))
+ (should (equal (comp-tests-ffuncall-callee-rest-f 1 2 3)
+ '(1 2 (3))))
+ (should (equal (comp-tests-ffuncall-callee-rest-f 1 2 3 4)
+ '(1 2 (3 4))))
+
+ (should (equal (comp-tests-ffuncall-callee-more8-f 1 2 3 4 5 6 7 8 9 10)
+ '(1 2 3 4 5 6 7 8 9 10)))
+
+ (should (equal (comp-tests-ffuncall-callee-more8-rest-f 1 2 3 4 5 6 7 8 9 10 11)
+ '(1 2 3 4 5 6 7 8 9 (10 11))))
+
+ (should (equal (comp-tests-ffuncall-native-f) [nil]))
+
+ (should (equal (comp-tests-ffuncall-native-rest-f) [1 2 3]))
+
+ (should (equal (comp-tests-ffuncall-apply-many-f '(1 2 3))
+ '(1 2 3)))
+
+ (should (= (comp-tests-ffuncall-lambda-f 1) 2)))
+
+(comp-deftest jump-table ()
+ "Testing jump tables"
+ (should (eq (comp-tests-jump-table-1-f 'x) 'a))
+ (should (eq (comp-tests-jump-table-1-f 'y) 'b))
+ (should (eq (comp-tests-jump-table-1-f 'xxx) 'c))
+
+ ;; Jump table not with eq as test
+ (should (eq (comp-tests-jump-table-2-f "aaa") 'a))
+ (should (eq (comp-tests-jump-table-2-f "bbb") 'b)))
+
+(comp-deftest conditionals ()
+ "Testing conditionals."
+ (should (= (comp-tests-conditionals-1-f t) 1))
+ (should (= (comp-tests-conditionals-1-f nil) 2))
+ (should (= (comp-tests-conditionals-2-f t) 1340))
+ (should (eq (comp-tests-conditionals-2-f nil) nil)))
+
+(comp-deftest fixnum ()
+ "Testing some fixnum inline operation."
+ (should (= (comp-tests-fixnum-1-minus-f 10) 9))
+ (should (= (comp-tests-fixnum-1-minus-f most-negative-fixnum)
+ (1- most-negative-fixnum)))
+ (should-error (comp-tests-fixnum-1-minus-f 'a)
+ :type 'wrong-type-argument)
+ (should (= (comp-tests-fixnum-1-plus-f 10) 11))
+ (should (= (comp-tests-fixnum-1-plus-f most-positive-fixnum)
+ (1+ most-positive-fixnum)))
+ (should-error (comp-tests-fixnum-1-plus-f 'a)
+ :type 'wrong-type-argument)
+ (should (= (comp-tests-fixnum-minus-f 10) -10))
+ (should (= (comp-tests-fixnum-minus-f most-negative-fixnum)
+ (- most-negative-fixnum)))
+ (should-error (comp-tests-fixnum-minus-f 'a)
+ :type 'wrong-type-argument))
+
+(comp-deftest type-hints ()
+ "Just test compiler hints are transparent in this case."
+ ;; FIXME we should really check they are also effective.
+ (should (= (comp-tests-hint-fixnum-f 3) 4))
+ (should (= (comp-tests-hint-cons-f (cons 1 2)) 1)))
+
+(comp-deftest arith-comp ()
+ "Testing arithmetic comparisons."
+ (should (eq (comp-tests-eqlsign-f 4 3) nil))
+ (should (eq (comp-tests-eqlsign-f 3 3) t))
+ (should (eq (comp-tests-eqlsign-f 2 3) nil))
+ (should (eq (comp-tests-gtr-f 4 3) t))
+ (should (eq (comp-tests-gtr-f 3 3) nil))
+ (should (eq (comp-tests-gtr-f 2 3) nil))
+ (should (eq (comp-tests-lss-f 4 3) nil))
+ (should (eq (comp-tests-lss-f 3 3) nil))
+ (should (eq (comp-tests-lss-f 2 3) t))
+ (should (eq (comp-tests-les-f 4 3) nil))
+ (should (eq (comp-tests-les-f 3 3) t))
+ (should (eq (comp-tests-les-f 2 3) t))
+ (should (eq (comp-tests-geq-f 4 3) t))
+ (should (eq (comp-tests-geq-f 3 3) t))
+ (should (eq (comp-tests-geq-f 2 3) nil)))
+
+(comp-deftest setcarcdr ()
+ "Testing setcar setcdr."
+ (should (equal (comp-tests-setcar-f '(10 . 10) 3) '(3 . 10)))
+ (should (equal (comp-tests-setcdr-f '(10 . 10) 3) '(10 . 3)))
+ (should-error (comp-tests-setcar-f 3 10)
+ :type 'wrong-type-argument)
+ (should-error (comp-tests-setcdr-f 3 10)
+ :type 'wrong-type-argument))
+
+(comp-deftest bubble-sort ()
+ "Run bubble sort."
+ (let* ((list1 (mapcar #'random (make-list 1000 most-positive-fixnum)))
+ (list2 (copy-sequence list1)))
+ (should (equal (comp-bubble-sort-f list1)
+ (sort list2 #'<)))))
+
+(comp-deftest apply ()
+ "Test some inlined list functions."
+ (should (eq (comp-tests-consp-f '(1)) t))
+ (should (eq (comp-tests-consp-f 1) nil))
+ (let ((x (cons 1 2)))
+ (should (= (comp-tests-setcar2-f x) 3))
+ (should (equal x '(3 . 2)))))
+
+(comp-deftest num-inline ()
+ "Test some inlined number functions."
+ (should (eq (comp-tests-integerp-f 1) t))
+ (should (eq (comp-tests-integerp-f '(1)) nil))
+ (should (eq (comp-tests-integerp-f 3.5) nil))
+ (should (eq (comp-tests-integerp-f (1+ most-negative-fixnum)) t))
+
+ (should (eq (comp-tests-numberp-f 1) t))
+ (should (eq (comp-tests-numberp-f 'a) nil))
+ (should (eq (comp-tests-numberp-f 3.5) t)))
+
+(comp-deftest stack ()
+ "Test some stack operation."
+ (should (= (comp-tests-discardn-f 10) 2))
+ (should (string= (with-temp-buffer
+ (comp-tests-insertn-f "a" "b" "c" "d")
+ (buffer-string))
+ "abcd")))
+
+(comp-deftest non-locals ()
+ "Test non locals."
+ (should (string= (comp-tests-condition-case-0-f)
+ "arith-error Arithmetic error catched"))
+ (should (string= (comp-tests-condition-case-1-f)
+ "error foo catched"))
+ (should (= (comp-tests-catch-f
+ (lambda () (throw 'foo 3)))
+ 3))
+ (should (= (catch 'foo
+ (comp-tests-throw-f 3)))))
+
+(comp-deftest gc ()
+ "Try to do some longer computation to let the GC kick in."
+ (dotimes (_ 100000)
+ (comp-tests-cons-cdr-f 3))
+ (should (= (comp-tests-cons-cdr-f 3) 3)))
+
+(comp-deftest buffer ()
+ (should (string= (comp-tests-buff0-f) "foo")))
+
+(comp-deftest lambda-return ()
+ (let ((f (comp-tests-lambda-return-f)))
+ (should (subr-native-elisp-p f))
+ (should (= (funcall f 3) 4))))
+
+(comp-deftest recursive ()
+ (should (= (comp-tests-fib-f 10) 55)))
+
+(comp-deftest macro ()
+ "Just check we can define macros"
+ (should (macrop (symbol-function 'comp-tests-macro-m))))
+
+(comp-deftest string-trim ()
+ (should (string= (comp-tests-string-trim-f "dsaf ") "dsaf")))
+
+(comp-deftest trampoline-removal ()
+ ;; This tests that we can call primitives with no dedicated bytecode.
+ ;; At speed >= 2 the trampoline will not be used.
+ (should (hash-table-p (comp-tests-trampoline-removal-f))))
+
+(comp-deftest signal ()
+ (should (equal (condition-case err
+ (comp-tests-signal-f)
+ (t err))
+ '(foo . t))))
+
+(comp-deftest func-call-removal ()
+ ;; See `comp-propagate-insn' `comp-function-call-remove'.
+ (should (= (comp-tests-func-call-removal-f) 1)))
+
+(comp-deftest doc ()
+ (should (string= (documentation #'comp-tests-doc-f)
+ "A nice docstring"))
+ ;; Check a preloaded function, we can't use `comp-tests-doc-f' now
+ ;; as this is loaded manually with no .elc.
+ (should (string-match "\\.*.elc\\'" (symbol-file #'error))))
+
+(comp-deftest interactive-form ()
+ (should (equal (interactive-form #'comp-test-interactive-form0-f)
+ '(interactive "D")))
+ (should (equal (interactive-form #'comp-test-interactive-form1-f)
+ '(interactive '(1 2))))
+ (should (equal (interactive-form #'comp-test-interactive-form2-f)
+ '(interactive nil)))
+ (should (cl-every #'commandp '(comp-test-interactive-form0-f
+ comp-test-interactive-form1-f
+ comp-test-interactive-form2-f)))
+ (should-not (commandp #'comp-tests-doc-f)))
+
+(comp-deftest free-fun ()
+ "Check we are able to compile a single function."
+ (eval '(defun comp-tests-free-fun-f ()
+ "Some doc."
+ (interactive)
+ 3)
+ t)
+ (native-compile #'comp-tests-free-fun-f)
+
+ (should (subr-native-elisp-p (symbol-function #'comp-tests-free-fun-f)))
+ (should (= (comp-tests-free-fun-f) 3))
+ (should (string= (documentation #'comp-tests-free-fun-f)
+ "Some doc."))
+ (should (commandp #'comp-tests-free-fun-f))
+ (should (equal (interactive-form #'comp-tests-free-fun-f)
+ '(interactive))))
+
+(comp-deftest free-fun-silly-name ()
+ "Check we are able to compile a single function."
+ (eval '(defun comp-tests/free\fun-f ()) t)
+ (native-compile #'comp-tests/free\fun-f)
+ (should (subr-native-elisp-p (symbol-function #'comp-tests/free\fun-f))))
+
+(comp-deftest bug-40187 ()
+ "Check function name shadowing.
+https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
+ (should (eq (comp-test-40187-1-f) 'foo))
+ (should (eq (comp-test-40187-2-f) 'bar)))
+
+(comp-deftest speed--1 ()
+ "Check that at speed -1 we do not native compile."
+ (should (= (comp-test-speed--1-f) 3))
+ (should-not (subr-native-elisp-p (symbol-function #'comp-test-speed--1-f))))
+
+(comp-deftest bug-42360 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-07/msg00418.html>."
+ (should (string= (comp-test-42360-f "Nel mezzo del " 18 0 32 "yyy" nil)
+ "Nel mezzo del yyy")))
+
+(comp-deftest bug-44968 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-11/msg02357.html>"
+ (comp-test-44968-f "/tmp/test/foo" "/tmp"))
+
+(comp-deftest bug-45342 ()
+ "Preserve multibyte immediate strings.
+<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01771.html>"
+ (should (string= " ➊" (comp-test-45342-f 1))))
+
+(comp-deftest assume-double-neg ()
+ "In fwprop assumptions (not (not (member x))) /= (member x)."
+ (should-not (comp-test-assume-double-neg-f "bar" "foo")))
+
+(comp-deftest assume-in-loop-1 ()
+ "Broken call args assumptions lead to infinite loop."
+ (should (equal (comp-test-assume-in-loop-1-f "cd") '("cd"))))
+
+(comp-deftest bug-45376-1 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01883.html>"
+ (should (equal (comp-test-45376-1-f) '(1 0))))
+
+(comp-deftest bug-45376-2 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01883.html>"
+ (should (equal (comp-test-45376-2-f) '(0 2 1 0 1 0 1 0 0 0 0 0))))
+
+(defvar comp-test-primitive-advice)
+(comp-deftest primitive-advice ()
+ "Test effectiveness of primitive advising."
+ (let (comp-test-primitive-advice
+ (f (lambda (&rest args)
+ (setq comp-test-primitive-advice args))))
+ (advice-add #'+ :before f)
+ (unwind-protect
+ (progn
+ (should (= (comp-test-primitive-advice-f 3 4) 7))
+ (should (equal comp-test-primitive-advice '(3 4))))
+ (advice-remove #'+ f))))
+
+(defvar comp-test-primitive-redefine-args)
+(comp-deftest primitive-redefine ()
+ "Test effectiveness of primitive redefinition."
+ (cl-letf ((comp-test-primitive-redefine-args nil)
+ ((symbol-function #'-)
+ (lambda (&rest args)
+ (setq comp-test-primitive-redefine-args args)
+ 'xxx)))
+ (should (eq (comp-test-primitive-redefine-f 10 2) 'xxx))
+ (should (equal comp-test-primitive-redefine-args '(10 2)))))
+
+(comp-deftest compile-forms ()
+ "Verify lambda form native compilation."
+ (should-error (native-compile '(+ 1 foo)))
+ (let ((lexical-binding t)
+ (f (native-compile '(lambda (x) (1+ x)))))
+ (should (subr-native-elisp-p f))
+ (should (= (funcall f 2) 3)))
+ (let* ((lexical-binding nil)
+ (f (native-compile '(lambda (x) (1+ x)))))
+ (should (subr-native-elisp-p f))
+ (should (= (funcall f 2) 3))))
+
+(comp-deftest comp-test-defsubst ()
+ ;; Bug#42664, Bug#43280, Bug#44209.
+ (should-not (subr-native-elisp-p (symbol-function #'comp-test-defsubst-f))))
+
+(comp-deftest primitive-redefine-compile-44221 ()
+ "Test the compiler still works while primitives are redefined (bug#44221)."
+ (cl-letf (((symbol-function #'delete-region)
+ (lambda (_ _))))
+ (should (subr-native-elisp-p
+ (native-compile
+ '(lambda ()
+ (delete-region (point-min) (point-max))))))))
+
+(comp-deftest and-3 ()
+ (should (= (comp-test-and-3-f t) 2))
+ (should (null (comp-test-and-3-f '(1 2)))))
+
+(comp-deftest copy-insn ()
+ (should (equal (comp-test-copy-insn-f '(1 2 3 (4 5 6)))
+ '(1 2 3 (4 5 6))))
+ (should (null (comp-test-copy-insn-f nil))))
+
+(comp-deftest cond-rw-1 ()
+ "Check cond-rw does not break target blocks with multiple predecessor."
+ (should (null (comp-test-cond-rw-1-2-f))))
+
+(comp-deftest not-cons-1 ()
+ (should-not (comp-test-not-cons-f nil)))
+
+(comp-deftest 45576-1 ()
+ "Functionp satisfies also symbols.
+<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-01/msg00029.html>."
+ (should (eq (comp-test-45576-f) 'eval)))
+
+(comp-deftest 45635-1 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-01/msg00158.html>."
+ (should (string= (comp-test-45635-f :height 180 :family "PragmataPro Liga")
+ "PragmataPro Liga")))
+
+(comp-deftest 45603-1 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-12/msg01994.html>"
+ (load (native-compile (ert-resource-file "comp-test-45603.el")))
+ (should (fboundp #'comp-test-45603--file-local-name)))
+
+(comp-deftest 46670-1 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-02/msg01413.html>"
+ (should (string= (comp-test-46670-2-f "foo") "foo"))
+ (should (equal (subr-type (symbol-function #'comp-test-46670-2-f))
+ '(function (t) t))))
+
+(comp-deftest 46824-1 ()
+ "<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-02/msg01949.html>"
+ (should (equal (comp-test-46824-1-f) nil)))
+
+(comp-deftest comp-test-47868-1 ()
+ "Verify string hash consing strategy.
+
+<https://lists.gnu.org/archive/html/bug-gnu-emacs/2021-04/msg00921.html>"
+ (should-not (equal-including-properties (comp-test-47868-1-f)
+ (comp-test-47868-2-f)))
+ (should (eq (comp-test-47868-1-f) (comp-test-47868-3-f)))
+ (should (eq (comp-test-47868-2-f) (comp-test-47868-4-f))))
+
+
+;;;;;;;;;;;;;;;;;;;;;
+;; Tromey's tests. ;;
+;;;;;;;;;;;;;;;;;;;;;
+
+(comp-deftest consp ()
+ (should-not (comp-test-consp 23))
+ (should-not (comp-test-consp nil))
+ (should (comp-test-consp '(1 . 2))))
+
+(comp-deftest listp ()
+ (should-not (comp-test-listp 23))
+ (should (comp-test-listp nil))
+ (should (comp-test-listp '(1 . 2))))
+
+(comp-deftest stringp ()
+ (should-not (comp-test-stringp 23))
+ (should-not (comp-test-stringp nil))
+ (should (comp-test-stringp "hi")))
+
+(comp-deftest symbolp ()
+ (should-not (comp-test-symbolp 23))
+ (should-not (comp-test-symbolp "hi"))
+ (should (comp-test-symbolp 'whatever)))
+
+(comp-deftest integerp ()
+ (should (comp-test-integerp 23))
+ (should-not (comp-test-integerp 57.5))
+ (should-not (comp-test-integerp "hi"))
+ (should-not (comp-test-integerp 'whatever)))
+
+(comp-deftest numberp ()
+ (should (comp-test-numberp 23))
+ (should (comp-test-numberp 57.5))
+ (should-not (comp-test-numberp "hi"))
+ (should-not (comp-test-numberp 'whatever)))
+
+(comp-deftest add1 ()
+ (should (eq (comp-test-add1 23) 24))
+ (should (eq (comp-test-add1 -17) -16))
+ (should (eql (comp-test-add1 1.0) 2.0))
+ (should-error (comp-test-add1 nil)
+ :type 'wrong-type-argument))
+
+(comp-deftest sub1 ()
+ (should (eq (comp-test-sub1 23) 22))
+ (should (eq (comp-test-sub1 -17) -18))
+ (should (eql (comp-test-sub1 1.0) 0.0))
+ (should-error (comp-test-sub1 nil)
+ :type 'wrong-type-argument))
+
+(comp-deftest negate ()
+ (should (eq (comp-test-negate 23) -23))
+ (should (eq (comp-test-negate -17) 17))
+ (should (eql (comp-test-negate 1.0) -1.0))
+ (should-error (comp-test-negate nil)
+ :type 'wrong-type-argument))
+
+(comp-deftest not ()
+ (should (eq (comp-test-not 23) nil))
+ (should (eq (comp-test-not nil) t))
+ (should (eq (comp-test-not t) nil)))
+
+(comp-deftest bobp-and-eobp ()
+ (with-temp-buffer
+ (should (comp-test-bobp))
+ (should (comp-test-eobp))
+ (insert "hi")
+ (goto-char (point-min))
+ (should (eq (comp-test-point-min) (point-min)))
+ (should (eq (comp-test-point) (point-min)))
+ (should (comp-test-bobp))
+ (should-not (comp-test-eobp))
+ (goto-char (point-max))
+ (should (eq (comp-test-point-max) (point-max)))
+ (should (eq (comp-test-point) (point-max)))
+ (should-not (comp-test-bobp))
+ (should (comp-test-eobp))))
+
+(comp-deftest car-cdr ()
+ (let ((pair '(1 . b)))
+ (should (eq (comp-test-car pair) 1))
+ (should (eq (comp-test-car nil) nil))
+ (should-error (comp-test-car 23)
+ :type 'wrong-type-argument)
+ (should (eq (comp-test-cdr pair) 'b))
+ (should (eq (comp-test-cdr nil) nil))
+ (should-error (comp-test-cdr 23)
+ :type 'wrong-type-argument)))
+
+(comp-deftest car-cdr-safe ()
+ (let ((pair '(1 . b)))
+ (should (eq (comp-test-car-safe pair) 1))
+ (should (eq (comp-test-car-safe nil) nil))
+ (should (eq (comp-test-car-safe 23) nil))
+ (should (eq (comp-test-cdr-safe pair) 'b))
+ (should (eq (comp-test-cdr-safe nil) nil))
+ (should (eq (comp-test-cdr-safe 23) nil))))
+
+(comp-deftest eq ()
+ (should (comp-test-eq 'a 'a))
+ (should (comp-test-eq 5 5))
+ (should-not (comp-test-eq 'a 'b)))
+
+(comp-deftest if ()
+ (should (eq (comp-test-if 'a 'b) 'a))
+ (should (eq (comp-test-if 0 23) 0))
+ (should (eq (comp-test-if nil 'b) 'b)))
+
+(comp-deftest and ()
+ (should (eq (comp-test-and 'a 'b) 'b))
+ (should (eq (comp-test-and 0 23) 23))
+ (should (eq (comp-test-and nil 'b) nil)))
+
+(comp-deftest or ()
+ (should (eq (comp-test-or 'a 'b) 'a))
+ (should (eq (comp-test-or 0 23) 0))
+ (should (eq (comp-test-or nil 'b) 'b)))
+
+(comp-deftest save-excursion ()
+ (with-temp-buffer
+ (comp-test-save-excursion)
+ (should (eq (point) (point-min)))
+ (should (eq (comp-test-current-buffer) (current-buffer)))))
+
+(comp-deftest > ()
+ (should (eq (comp-test-> 0 23) nil))
+ (should (eq (comp-test-> 23 0) t)))
+
+(comp-deftest catch ()
+ (should (eq (comp-test-catch 0 1 2 3 4) nil))
+ (should (eq (comp-test-catch 20 21 22 23 24 25 26 27 28) 24)))
+
+(comp-deftest memq ()
+ (should (equal (comp-test-memq 0 '(5 4 3 2 1 0)) '(0)))
+ (should (eq (comp-test-memq 72 '(5 4 3 2 1 0)) nil)))
+
+(comp-deftest listN ()
+ (should (equal (comp-test-listN 57)
+ '(57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57))))
+
+(comp-deftest concatN ()
+ (should (equal (comp-test-concatN "x") "xxxxxx")))
+
+(comp-deftest opt-rest ()
+ (should (equal (comp-test-opt-rest 1) '(1 nil nil)))
+ (should (equal (comp-test-opt-rest 1 2) '(1 2 nil)))
+ (should (equal (comp-test-opt-rest 1 2 3) '(1 2 (3))))
+ (should (equal (comp-test-opt-rest 1 2 56 57 58)
+ '(1 2 (56 57 58)))))
+
+(comp-deftest opt ()
+ (should (equal (comp-test-opt 23) '(23)))
+ (should (equal (comp-test-opt 23 24) '(23 . 24)))
+ (should-error (comp-test-opt)
+ :type 'wrong-number-of-arguments)
+ (should-error (comp-test-opt nil 24 97)
+ :type 'wrong-number-of-arguments))
+
+(comp-deftest unwind-protect ()
+ (comp-test-unwind-protect 'ignore)
+ (should (eq comp-test-up-val 999))
+ (condition-case nil
+ (comp-test-unwind-protect (lambda () (error "HI")))
+ (error
+ nil))
+ (should (eq comp-test-up-val 999)))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Tests for dynamic scope. ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(comp-deftest dynamic-ffuncall ()
+ "Test calling convention for dynamic binding."
+
+ (should (equal (comp-tests-ffuncall-callee-dyn-f 1 2)
+ '(1 2)))
+
+ (should (equal (comp-tests-ffuncall-callee-opt-dyn-f 1 2 3 4)
+ '(1 2 3 4)))
+ (should (equal (comp-tests-ffuncall-callee-opt-dyn-f 1 2 3)
+ '(1 2 3 nil)))
+ (should (equal (comp-tests-ffuncall-callee-opt-dyn-f 1 2)
+ '(1 2 nil nil)))
+
+ (should (equal (comp-tests-ffuncall-callee-rest-dyn-f 1 2)
+ '(1 2 nil)))
+ (should (equal (comp-tests-ffuncall-callee-rest-dyn-f 1 2 3)
+ '(1 2 (3))))
+ (should (equal (comp-tests-ffuncall-callee-rest-dyn-f 1 2 3 4)
+ '(1 2 (3 4))))
+
+ (should (equal (comp-tests-ffuncall-callee-opt-rest-dyn-f 1 2)
+ '(1 2 nil nil)))
+ (should (equal (comp-tests-ffuncall-callee-opt-rest-dyn-f 1 2 3)
+ '(1 2 3 nil)))
+ (should (equal (comp-tests-ffuncall-callee-opt-rest-dyn-f 1 2 3 4)
+ '(1 2 3 (4)))))
+
+(comp-deftest dynamic-arity ()
+ "Test func-arity on dynamic scope functions."
+ (should (equal '(2 . 2)
+ (func-arity #'comp-tests-ffuncall-callee-dyn-f)))
+ (should (equal '(2 . 4)
+ (func-arity #'comp-tests-ffuncall-callee-opt-dyn-f)))
+ (should (equal '(2 . many)
+ (func-arity #'comp-tests-ffuncall-callee-rest-dyn-f)))
+ (should (equal '(2 . many)
+ (func-arity #'comp-tests-ffuncall-callee-opt-rest-dyn-f))))
+
+(comp-deftest dynamic-help-arglist ()
+ "Test `help-function-arglist' works on lisp/d (bug#42572)."
+ (should (equal (help-function-arglist
+ (symbol-function #'comp-tests-ffuncall-callee-opt-rest-dyn-f)
+ t)
+ '(a b &optional c &rest d))))
+
+(comp-deftest cl-macro-exp ()
+ "Verify CL macro expansion (bug#42088)."
+ (should (equal (comp-tests-cl-macro-exp-f) '(a b))))
+
+(comp-deftest cl-uninterned-arg-parse-f ()
+ "Verify the parsing of a lambda list with uninterned symbols (bug#42120)."
+ (should (equal (comp-tests-cl-uninterned-arg-parse-f 1 2)
+ '(1 2))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Middle-end specific tests. ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun comp-tests-mentioned-p-1 (x insn)
+ (cl-loop for y in insn
+ when (cond
+ ((consp y) (comp-tests-mentioned-p x y))
+ ((and (comp-mvar-p y) (comp-cstr-imm-vld-p y))
+ (equal (comp-cstr-imm y) x))
+ (t (equal x y)))
+ return t))
+
+(defun comp-tests-mentioned-p (x insn)
+ "Check if X is actively mentioned in INSN."
+ (unless (eq (car-safe insn)
+ 'comment)
+ (comp-tests-mentioned-p-1 x insn)))
+
+(defun comp-tests-map-checker (func-name checker)
+ "Apply CHECKER to each insn of FUNC-NAME.
+Return a list of results."
+ (cl-loop
+ with func-c-name = (comp-c-func-name (or func-name 'anonymous-lambda) "F" t)
+ with f = (gethash func-c-name (comp-ctxt-funcs-h comp-ctxt))
+ for bb being each hash-value of (comp-func-blocks f)
+ nconc
+ (cl-loop
+ for insn in (comp-block-insns bb)
+ collect (funcall checker insn))))
+
+(defun comp-tests-tco-checker (_)
+ "Check that inside `comp-tests-tco-f' we have no recursion."
+ (should
+ (cl-notany
+ #'identity
+ (comp-tests-map-checker
+ 'comp-tests-tco-f
+ (lambda (insn)
+ (or (comp-tests-mentioned-p 'comp-tests-tco-f insn)
+ (comp-tests-mentioned-p (comp-c-func-name 'comp-tests-tco-f "F" t)
+ insn)))))))
+
+(comp-deftest tco ()
+ "Check for tail recursion elimination."
+ (let ((native-comp-speed 3)
+ ;; Disable ipa-pure otherwise `comp-tests-tco-f' gets
+ ;; optimized-out.
+ (comp-disabled-passes '(comp-ipa-pure))
+ (comp-post-pass-hooks '((comp-tco comp-tests-tco-checker)
+ (comp-final comp-tests-tco-checker))))
+ (eval '(defun comp-tests-tco-f (a b count)
+ (if (= count 0)
+ b
+ (comp-tests-tco-f (+ a b) a (- count 1))))
+ t)
+ (native-compile #'comp-tests-tco-f)
+ (should (subr-native-elisp-p (symbol-function #'comp-tests-tco-f)))
+ (should (= (comp-tests-tco-f 1 0 10) 55))))
+
+(defun comp-tests-fw-prop-checker-1 (_)
+ "Check that inside `comp-tests-fw-prop-f' `concat' and `length' are folded."
+ (should
+ (cl-notany
+ #'identity
+ (comp-tests-map-checker
+ 'comp-tests-fw-prop-1-f
+ (lambda (insn)
+ (or (comp-tests-mentioned-p 'concat insn)
+ (comp-tests-mentioned-p 'length insn)))))))
+
+(comp-deftest fw-prop-1 ()
+ "Some tests for forward propagation."
+ (let ((native-comp-speed 2)
+ (comp-post-pass-hooks '((comp-final comp-tests-fw-prop-checker-1))))
+ (eval '(defun comp-tests-fw-prop-1-f ()
+ (let* ((a "xxx")
+ (b "yyy")
+ (c (concat a b))) ; <= has to optimize
+ (length c))) ; <= has to optimize
+ t)
+ (native-compile #'comp-tests-fw-prop-1-f)
+ (should (subr-native-elisp-p (symbol-function #'comp-tests-fw-prop-1-f)))
+ (should (= (comp-tests-fw-prop-1-f) 6))))
+
+(defun comp-tests-check-ret-type-spec (func-form ret-type)
+ (let ((lexical-binding t)
+ (native-comp-speed 2)
+ (f-name (cl-second func-form)))
+ (eval func-form t)
+ (native-compile f-name)
+ (should (equal (cl-third (subr-type (symbol-function f-name)))
+ ret-type))))
+
+(cl-eval-when (compile eval load)
+ (defconst comp-tests-type-spec-tests
+ `(
+ ;; 1
+ ((defun comp-tests-ret-type-spec-f (x)
+ x)
+ t)
+
+ ;; 2
+ ((defun comp-tests-ret-type-spec-f ()
+ 1)
+ (integer 1 1))
+
+ ;; 3
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if x 1 3))
+ (or (integer 1 1) (integer 3 3)))
+
+ ;; 4
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let (y)
+ (if x
+ (setf y 1)
+ (setf y 2))
+ y))
+ (integer 1 2))
+
+ ;; 5
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let (y)
+ (if x
+ (setf y 1)
+ (setf y 3))
+ y))
+ (or (integer 1 1) (integer 3 3)))
+
+ ;; 6
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if x
+ (list x)
+ 3))
+ (or cons (integer 3 3)))
+
+ ;; 7
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if x
+ 'foo
+ 3))
+ (or (member foo) (integer 3 3)))
+
+ ;; 8
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (eq x 3)
+ x
+ 'foo))
+ (or (member foo) (integer 3 3)))
+
+ ;; 9
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (eq 3 x)
+ x
+ 'foo))
+ (or (member foo) (integer 3 3)))
+
+ ;; 10
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (eql x 3)
+ x
+ 'foo))
+ (or (member foo) (integer 3 3)))
+
+ ;; 11
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (eql 3 x)
+ x
+ 'foo))
+ (or (member foo) (integer 3 3)))
+
+ ;; 12
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (eql x 3)
+ 'foo
+ x))
+ (not (integer 3 3)))
+
+ ;; 13
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (if (= x y)
+ x
+ 'foo))
+ (or (member foo) marker number))
+
+ ;; 14
+ ((defun comp-tests-ret-type-spec-f (x)
+ (comp-hint-fixnum x))
+ (integer ,most-negative-fixnum ,most-positive-fixnum))
+
+ ;; 15
+ ((defun comp-tests-ret-type-spec-f (x)
+ (comp-hint-cons x))
+ cons)
+
+ ;; 16
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let (y)
+ (when x
+ (setf y 4))
+ y))
+ (or null (integer 4 4)))
+
+ ;; 17
+ ((defun comp-tests-ret-type-spec-f ()
+ (let (x
+ (y 3))
+ (setf x y)
+ y))
+ (integer 3 3))
+
+ ;; 18
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let ((y 3))
+ (when x
+ (setf y x))
+ y))
+ t)
+
+ ;; 19
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (eq x y))
+ boolean)
+
+ ;; 20
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when x
+ 'foo))
+ (or (member foo) null))
+
+ ;; 21
+ ((defun comp-tests-ret-type-spec-f (x)
+ (unless x
+ 'foo))
+ (or (member foo) null))
+
+ ;; 22
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (> x 3)
+ x))
+ (or null float (integer 4 *)))
+
+ ;; 23
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (>= x 3)
+ x))
+ (or null float (integer 3 *)))
+
+ ;; 24
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (< x 3)
+ x))
+ (or null float (integer * 2)))
+
+ ;; 25
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (<= x 3)
+ x))
+ (or null float (integer * 3)))
+
+ ;; 26
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (> 3 x)
+ x))
+ (or null float (integer * 2)))
+
+ ;; 27
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (>= 3 x)
+ x))
+ (or null float (integer * 3)))
+
+ ;; 28
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (< 3 x)
+ x))
+ (or null float (integer 4 *)))
+
+ ;; 29
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (<= 3 x)
+ x))
+ (or null float (integer 3 *)))
+
+ ;; 30
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let ((y 3))
+ (when (> x y)
+ x)))
+ (or null float (integer 4 *)))
+
+ ;; 31
+ ((defun comp-tests-ret-type-spec-f (x)
+ (let ((y 3))
+ (when (> y x)
+ x)))
+ (or null float (integer * 2)))
+
+ ;; 32
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (and (> x 3)
+ (< x 10))
+ x))
+ (or null float (integer 4 9)))
+
+ ;; 33
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (or (> x 3)
+ (< x 10))
+ x))
+ (or null float integer))
+
+ ;; 34
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (or (< x 3)
+ (> x 10))
+ x))
+ (or null float (integer * 2) (integer 11 *)))
+
+ ;; 35 No float range support.
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (> x 1.0)
+ x))
+ (or null marker number))
+
+ ;; 36
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (> x 3)
+ (> y 2))
+ (+ x y)))
+ (or null float (integer 7 *)))
+
+ ;; 37
+ ;; SBCL: (OR REAL NULL)
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= x 3)
+ (<= y 2))
+ (+ x y)))
+ (or null float (integer * 5)))
+
+ ;; 38
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (< 1 x 5)
+ (< 1 y 5))
+ (+ x y)))
+ (or null float (integer 4 8)))
+
+ ;; 39
+ ;; SBCL gives: (OR REAL NULL)
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= 1 x 10)
+ (<= 2 y 3))
+ (+ x y)))
+ (or null float (integer 3 13)))
+
+ ;; 40
+ ;; SBCL: (OR REAL NULL)
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= 1 x 10)
+ (<= 2 y 3))
+ (- x y)))
+ (or null float (integer -2 8)))
+
+ ;; 41
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= 1 x)
+ (<= 2 y 3))
+ (- x y)))
+ (or null float (integer -2 *)))
+
+ ;; 42
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= 1 x 10)
+ (<= 2 y))
+ (- x y)))
+ (or null float (integer * 8)))
+
+ ;; 43
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= x 10)
+ (<= 2 y))
+ (- x y)))
+ (or null float (integer * 8)))
+
+ ;; 44
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= x 10)
+ (<= y 3))
+ (- x y)))
+ (or null float integer))
+
+ ;; 45
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (when (and (<= 2 x)
+ (<= 3 y))
+ (- x y)))
+ (or null float integer))
+
+ ;; 46
+ ;; SBCL: (OR (RATIONAL (6) (30)) (SINGLE-FLOAT 6.0 30.0)
+ ;; (DOUBLE-FLOAT 6.0d0 30.0d0) NULL)
+ ((defun comp-tests-ret-type-spec-f (x y z i j k)
+ (when (and (< 1 x 5)
+ (< 1 y 5)
+ (< 1 z 5)
+ (< 1 i 5)
+ (< 1 j 5)
+ (< 1 k 5))
+ (+ x y z i j k)))
+ (or null float (integer 12 24)))
+
+ ;; 47
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (<= 1 x 5)
+ (1+ x)))
+ (or null float (integer 2 6)))
+
+ ;;48
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (<= 1 x 5)
+ (1- x)))
+ (or null float (integer 0 4)))
+
+ ;; 49
+ ((defun comp-tests-ret-type-spec-f ()
+ (error "foo"))
+ nil)
+
+ ;; 50
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (stringp x)
+ x
+ 'bar))
+ (or (member bar) string))
+
+ ;; 51
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (stringp x)
+ 'bar
+ x))
+ (not string))
+
+ ;; 52
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (integerp x)
+ x
+ 'bar))
+ (or (member bar) integer))
+
+ ;; 53
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (integerp x)
+ x))
+ (or null integer))
+
+ ;; 54
+ ((defun comp-tests-ret-type-spec-f (x)
+ (unless (symbolp x)
+ x))
+ t)
+
+ ;; 55
+ ((defun comp-tests-ret-type-spec-f (x)
+ (unless (integerp x)
+ x))
+ (not integer))
+
+ ;; 56
+ ((defun comp-tests-ret-type-spec-f (x)
+ (cl-ecase x
+ (1 (message "one"))
+ (5 (message "five")))
+ x)
+ t
+ ;; FIXME improve `comp-cond-cstrs-target-mvar' to cross block
+ ;; boundary if necessary as this should return:
+ ;; (or (integer 1 1) (integer 5 5))
+ )
+
+ ;; 57
+ ((defun comp-tests-ret-type-spec-f (x)
+ (unless (or (eq x 'foo)
+ (eql x 3))
+ (error "Not foo or 3"))
+ x)
+ (or (member foo) (integer 3 3)))
+
+ ;;58
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (if (and (natnump x)
+ (natnump y)
+ (<= x y))
+ x
+ (error "")))
+ (integer 0 *))
+
+ ;; 59
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (if (and (>= x 3)
+ (<= y 10)
+ (<= x y))
+ x
+ (error "")))
+ (or float (integer 3 10)))
+
+ ;; 60
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (if (and (<= x 10)
+ (>= y 3)
+ (>= x y))
+ x
+ (error "")))
+ (or float (integer 3 10)))
+
+ ;; 61
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 1.0)
+ x
+ (error "")))
+ (or (member 1.0) (integer 1 1)))
+
+ ;; 62
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 1.0)
+ x
+ (error "")))
+ (or (member 1.0) (integer 1 1)))
+
+ ;; 63
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 1.1)
+ x
+ (error "")))
+ (member 1.1))
+
+ ;; 64
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 1)
+ x
+ (error "")))
+ (or (member 1.0) (integer 1 1)))
+
+ ;; 65
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 1)
+ x
+ (error "")))
+ (or (member 1.0) (integer 1 1)))
+
+ ;; 66
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (eql x 0.0)
+ x
+ (error "")))
+ float)
+
+ ;; 67
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (equal x '(1 2 3))
+ x
+ (error "")))
+ cons)
+
+ ;; 68
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (and (floatp x)
+ (= x 1))
+ x
+ (error "")))
+ ;; Conservative (see cstr relax in `comp-cstr-=').
+ (or (member 1.0) (integer 1 1)))
+
+ ;; 69
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (and (integer x)
+ (= x 1))
+ x
+ (error "")))
+ ;; Conservative (see cstr relax in `comp-cstr-=').
+ (or (member 1.0) (integer 1 1)))
+
+ ;; 70
+ ((defun comp-tests-ret-type-spec-f (x y)
+ (if (and (floatp x)
+ (integerp y)
+ (= x y))
+ x
+ (error "")))
+ (or float integer))
+
+ ;; 71
+ ((defun comp-tests-ret-type-spec-f (x)
+ (if (= x 0.0)
+ x
+ (error "")))
+ (or (member -0.0 0.0) (integer 0 0)))
+
+ ;; 72
+ ((defun comp-tests-ret-type-spec-f (x)
+ (unless (= x 0.0)
+ (error ""))
+ (unless (eql x -0.0)
+ (error ""))
+ x)
+ float)
+
+ ;; 73
+ ((defun comp-tests-ret-type-spec-f (x)
+ (when (eql x 1.0)
+ (error ""))
+ x)
+ t)))
+
+ (defun comp-tests-define-type-spec-test (number x)
+ `(comp-deftest ,(intern (format "ret-type-spec-%d" number)) ()
+ ,(format "Type specifier test number %d." number)
+ (let ((comp-ctxt (make-comp-cstr-ctxt)))
+ (comp-tests-check-ret-type-spec ',(car x) ',(cadr x))))))
+
+(defmacro comp-tests-define-type-spec-tests ()
+ "Define all type specifier tests."
+ `(progn
+ ,@(cl-loop
+ for test in comp-tests-type-spec-tests
+ for n from 1
+ collect (comp-tests-define-type-spec-test n test))))
+
+(comp-tests-define-type-spec-tests)
+
+(defun comp-tests-pure-checker-1 (_)
+ "Check that inside `comp-tests-pure-caller-f' `comp-tests-pure-callee-f' is
+ folded."
+ (should
+ (cl-notany
+ #'identity
+ (comp-tests-map-checker
+ 'comp-tests-pure-caller-f
+ (lambda (insn)
+ (or (comp-tests-mentioned-p 'comp-tests-pure-callee-f insn)
+ (comp-tests-mentioned-p (comp-c-func-name
+ 'comp-tests-pure-callee-f "F" t)
+ insn)))))))
+
+(defun comp-tests-pure-checker-2 (_)
+ "Check that `comp-tests-pure-fibn-f' is folded."
+ (should
+ (cl-notany
+ #'identity
+ (comp-tests-map-checker
+ 'comp-tests-pure-fibn-entry-f
+ (lambda (insn)
+ (or (comp-tests-mentioned-p 'comp-tests-pure-fibn-f insn)
+ (comp-tests-mentioned-p (comp-c-func-name 'comp-tests-pure-fibn-f "F" t)
+ insn)))))))
+
+(comp-deftest pure ()
+ "Some tests for pure functions optimization."
+ (let ((native-comp-speed 3)
+ (comp-post-pass-hooks '((comp-final comp-tests-pure-checker-1
+ comp-tests-pure-checker-2))))
+ (load (native-compile (ert-resource-file "comp-test-pure.el")))
+
+ (should (subr-native-elisp-p (symbol-function #'comp-tests-pure-caller-f)))
+ (should (= (comp-tests-pure-caller-f) 4))
+
+ (should (subr-native-elisp-p (symbol-function #'comp-tests-pure-fibn-entry-f)))
+ (should (= (comp-tests-pure-fibn-entry-f) 6765))))
+
+(defvar comp-tests-cond-rw-checked-function nil
+ "Function to be checked.")
+(defun comp-tests-cond-rw-checker-val (_)
+ "Check we manage to propagate the correct return value."
+ (should
+ (cl-some
+ #'identity
+ (comp-tests-map-checker
+ comp-tests-cond-rw-checked-function
+ (lambda (insn)
+ (pcase insn
+ (`(return ,mvar)
+ (and (comp-cstr-imm-vld-p mvar)
+ (eql (comp-cstr-imm mvar) 123)))))))))
+
+(defvar comp-tests-cond-rw-expected-type nil
+ "Type to expect in `comp-tests-cond-rw-checker-type'.")
+(defun comp-tests-cond-rw-checker-type (_)
+ "Check we manage to propagate the correct return type."
+ (should
+ (cl-some
+ #'identity
+ (comp-tests-map-checker
+ comp-tests-cond-rw-checked-function
+ (lambda (insn)
+ (pcase insn
+ (`(return ,mvar)
+ (equal (comp-mvar-typeset mvar)
+ comp-tests-cond-rw-expected-type))))))))
+
+;;; comp-tests.el ends here
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 03d867f18a8..b1e5fa0767c 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -358,12 +358,35 @@ comparing the subr with a much slower lisp implementation."
(should (equal (symbol-value var) 42))
(should (equal (default-value var) (symbol-value var)))
(set var 123)
+ (should (not (local-variable-p var)))
(should (equal (symbol-value var) 123))
(should (equal (default-value var) (symbol-value var)))) ;bug#44733
(should (equal (symbol-value var) def))
(should (equal (default-value var) (symbol-value var))))
(should (equal (default-value var) def))))))
+(ert-deftest data-tests--let-buffer-local-no-unwind-other-buffers ()
+ "Test that a let-binding for a buffer-local unwinds only current-buffer."
+ (let ((blvar (make-symbol "blvar")))
+ (set-default blvar 0)
+ (make-variable-buffer-local blvar)
+ (dolist (var (list blvar 'left-margin))
+ (let* ((def (default-value var))
+ (newdef (+ def 1))
+ (otherbuf (generate-new-buffer "otherbuf")))
+ (with-temp-buffer
+ (cl-progv (list var) (list newdef)
+ (with-current-buffer otherbuf
+ (set var 123)
+ (should (local-variable-p var))
+ (should (equal (symbol-value var) 123))
+ (should (equal (default-value var) newdef))))
+ (with-current-buffer otherbuf
+ (should (local-variable-p var))
+ (should (equal (symbol-value var) 123))
+ (should (equal (default-value var) def)))
+ )))))
+
(ert-deftest binding-test-makunbound ()
"Tests of makunbound, from the manual."
(with-current-buffer binding-test-buffer-B
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index dcec971c12e..a731a95ccf0 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -1,4 +1,4 @@
-;;; editfns-tests.el -- tests for editfns.c -*- lexical-binding:t -*-
+;;; editfns-tests.el --- tests for editfns.c -*- lexical-binding:t -*-
;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
@@ -128,6 +128,10 @@
(format (concat "%-3d/" s) 12)
#("12 /X" 4 5 (prop "val"))))))
+(ert-deftest propertize/error-even-number-of-args ()
+ "Number of args for `propertize' must be odd."
+ (should-error (propertize "foo" 'bar) :type 'wrong-number-of-arguments))
+
;; Tests for bug#5131.
(defun transpose-test-reverse-word (start end)
"Reverse characters in a word by transposing pairs of characters."
diff --git a/test/src/emacs-module-resources/mod-test.c b/test/src/emacs-module-resources/mod-test.c
index ad59cfc18cd..5720af8c605 100644
--- a/test/src/emacs-module-resources/mod-test.c
+++ b/test/src/emacs-module-resources/mod-test.c
@@ -288,6 +288,8 @@ struct super_struct
char large_unused_buffer[512];
};
+static void signal_errno (emacs_env *, char const *);
+
/* Return a new user-pointer to a super_struct, with amazing_int set
to the passed parameter. */
static emacs_value
@@ -295,6 +297,8 @@ Fmod_test_userptr_make (emacs_env *env, ptrdiff_t nargs, emacs_value args[],
void *data)
{
struct super_struct *p = calloc (1, sizeof *p);
+ if (!p)
+ signal_errno (env, "calloc");
p->amazing_int = env->extract_integer (env, args[0]);
return env->make_user_ptr (env, free, p);
}
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index af5bc2a0baf..a4d858113ed 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -1,4 +1,4 @@
-;;; emacs-module-tests --- Test GNU Emacs modules. -*- lexical-binding: t; -*-
+;;; emacs-module-tests.el --- Test GNU Emacs modules. -*- lexical-binding: t; -*-
;; Copyright 2015-2021 Free Software Foundation, Inc.
@@ -37,7 +37,9 @@
"File name of the Emacs binary currently running.")
(eval-and-compile
- (defconst mod-test-file (ert-resource-file "mod-test")
+ (defconst mod-test-file
+ (expand-file-name "../test/src/emacs-module-resources/mod-test"
+ invocation-directory)
"File name of the module test file."))
(require 'mod-test mod-test-file)
diff --git a/test/src/emacs-tests.el b/test/src/emacs-tests.el
new file mode 100644
index 00000000000..ac08e055b55
--- /dev/null
+++ b/test/src/emacs-tests.el
@@ -0,0 +1,263 @@
+;;; emacs-tests.el --- unit tests for emacs.c -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Unit tests for src/emacs.c.
+
+;;; Code:
+
+(require 'cl-lib)
+(require 'ert)
+(require 'rx)
+(require 'subr-x)
+
+(defconst emacs-tests--lib-src
+ (substitute-in-file-name "$EMACS_TEST_DIRECTORY/../lib-src/")
+ "Location of the lib-src directory.")
+
+(ert-deftest emacs-tests/seccomp/absent-file ()
+ (skip-unless (string-match-p (rx bow "SECCOMP" eow)
+ system-configuration-features))
+ (let ((emacs
+ (expand-file-name invocation-name invocation-directory))
+ (process-environment nil))
+ (skip-unless (file-executable-p emacs))
+ (should-not (file-exists-p "/does-not-exist.bpf"))
+ (should-not
+ (eql (call-process emacs nil nil nil
+ "--quick" "--batch"
+ "--seccomp=/does-not-exist.bpf")
+ 0))))
+
+(cl-defmacro emacs-tests--with-temp-file
+ (var (prefix &optional suffix text) &rest body)
+ "Evaluate BODY while a new temporary file exists.
+Bind VAR to the name of the file. Pass PREFIX, SUFFIX, and TEXT
+to `make-temp-file', which see."
+ (declare (indent 2) (debug (symbolp (form form form) body)))
+ (cl-check-type var symbol)
+ ;; Use an uninterned symbol so that the code still works if BODY
+ ;; changes VAR.
+ (let ((filename (make-symbol "filename")))
+ `(let ((,filename (make-temp-file ,prefix nil ,suffix ,text)))
+ (unwind-protect
+ (let ((,var ,filename))
+ ,@body)
+ (delete-file ,filename)))))
+
+(ert-deftest emacs-tests/seccomp/empty-file ()
+ (skip-unless (string-match-p (rx bow "SECCOMP" eow)
+ system-configuration-features))
+ (let ((emacs
+ (expand-file-name invocation-name invocation-directory))
+ (process-environment nil))
+ (skip-unless (file-executable-p emacs))
+ (emacs-tests--with-temp-file filter ("seccomp-invalid-" ".bpf")
+ ;; The --seccomp option is processed early, without filename
+ ;; handlers. Therefore remote or quoted filenames wouldn't
+ ;; work.
+ (should-not (file-remote-p filter))
+ (cl-callf file-name-unquote filter)
+ ;; According to the Seccomp man page, a filter must have at
+ ;; least one element, so Emacs should reject an empty file.
+ (should-not
+ (eql (call-process emacs nil nil nil
+ "--quick" "--batch"
+ (concat "--seccomp=" filter))
+ 0)))))
+
+(ert-deftest emacs-tests/seccomp/file-too-large ()
+ (skip-unless (string-match-p (rx bow "SECCOMP" eow)
+ system-configuration-features))
+ (let ((emacs
+ (expand-file-name invocation-name invocation-directory))
+ (process-environment nil)
+ ;; This value should be correct on all supported systems.
+ (ushort-max #xFFFF)
+ ;; Either 8 or 16, but 16 should be large enough in all cases.
+ (filter-size 16))
+ (skip-unless (file-executable-p emacs))
+ (emacs-tests--with-temp-file
+ filter ("seccomp-too-large-" ".bpf"
+ (make-string (* (1+ ushort-max) filter-size) ?a))
+ ;; The --seccomp option is processed early, without filename
+ ;; handlers. Therefore remote or quoted filenames wouldn't
+ ;; work.
+ (should-not (file-remote-p filter))
+ (cl-callf file-name-unquote filter)
+ ;; The filter count must fit into an `unsigned short'. A bigger
+ ;; file should be rejected.
+ (should-not
+ (eql (call-process emacs nil nil nil
+ "--quick" "--batch"
+ (concat "--seccomp=" filter))
+ 0)))))
+
+(ert-deftest emacs-tests/seccomp/invalid-file-size ()
+ (skip-unless (string-match-p (rx bow "SECCOMP" eow)
+ system-configuration-features))
+ (let ((emacs
+ (expand-file-name invocation-name invocation-directory))
+ (process-environment nil))
+ (skip-unless (file-executable-p emacs))
+ (emacs-tests--with-temp-file filter ("seccomp-invalid-" ".bpf"
+ "123456")
+ ;; The --seccomp option is processed early, without filename
+ ;; handlers. Therefore remote or quoted filenames wouldn't
+ ;; work.
+ (should-not (file-remote-p filter))
+ (cl-callf file-name-unquote filter)
+ ;; The Seccomp filter file must have a file size that's a
+ ;; multiple of the size of struct sock_filter, which is 8 or 16,
+ ;; but never 6.
+ (should-not
+ (eql (call-process emacs nil nil nil
+ "--quick" "--batch"
+ (concat "--seccomp=" filter))
+ 0)))))
+
+(ert-deftest emacs-tests/seccomp/allows-stdout ()
+ (skip-unless (string-match-p (rx bow "SECCOMP" eow)
+ system-configuration-features))
+ (let ((emacs
+ (expand-file-name invocation-name invocation-directory))
+ (filter (expand-file-name "seccomp-filter.bpf"
+ emacs-tests--lib-src))
+ (process-environment nil))
+ (skip-unless (file-executable-p emacs))
+ (skip-unless (file-readable-p filter))
+ ;; The --seccomp option is processed early, without filename
+ ;; handlers. Therefore remote or quoted filenames wouldn't work.
+ (should-not (file-remote-p filter))
+ (cl-callf file-name-unquote filter)
+ (with-temp-buffer
+ (let ((start-time (current-time))
+ (status (call-process
+ emacs nil t nil
+ "--quick" "--batch"
+ (concat "--seccomp=" filter)
+ (format "--eval=%S" '(message "Hi"))))
+ (end-time (current-time)))
+ (ert-info ((emacs-tests--seccomp-debug start-time end-time))
+ (should (eql status 0)))
+ (should (equal (string-trim (buffer-string)) "Hi"))))))
+
+(ert-deftest emacs-tests/seccomp/forbids-subprocess ()
+ (skip-unless (string-match-p (rx bow "SECCOMP" eow)
+ system-configuration-features))
+ (let ((emacs
+ (expand-file-name invocation-name invocation-directory))
+ (filter (expand-file-name "seccomp-filter.bpf"
+ emacs-tests--lib-src))
+ (process-environment nil))
+ (skip-unless (file-executable-p emacs))
+ (skip-unless (file-readable-p filter))
+ ;; The --seccomp option is processed early, without filename
+ ;; handlers. Therefore remote or quoted filenames wouldn't work.
+ (should-not (file-remote-p filter))
+ (cl-callf file-name-unquote filter)
+ (with-temp-buffer
+ (let ((start-time (current-time))
+ (status
+ (call-process
+ emacs nil t nil
+ "--quick" "--batch"
+ (concat "--seccomp=" filter)
+ (format "--eval=%S" `(call-process ,emacs nil nil nil
+ "--version"))))
+ (end-time (current-time)))
+ (ert-info ((emacs-tests--seccomp-debug start-time end-time))
+ (should-not (eql status 0)))))))
+
+(ert-deftest emacs-tests/bwrap/allows-stdout ()
+ (let ((bash (executable-find "bash"))
+ (bwrap (executable-find "bwrap"))
+ (emacs
+ (expand-file-name invocation-name invocation-directory))
+ (filter (expand-file-name "seccomp-filter-exec.bpf"
+ emacs-tests--lib-src))
+ (process-environment nil))
+ (skip-unless bash)
+ (skip-unless bwrap)
+ (skip-unless (file-executable-p emacs))
+ (skip-unless (file-readable-p filter))
+ (should-not (file-remote-p bwrap))
+ (should-not (file-remote-p emacs))
+ (should-not (file-remote-p filter))
+ (with-temp-buffer
+ (let* ((command
+ (concat
+ (mapconcat #'shell-quote-argument
+ `(,(file-name-unquote bwrap)
+ "--ro-bind" "/" "/"
+ "--seccomp" "20"
+ "--"
+ ,(file-name-unquote emacs)
+ "--quick" "--batch"
+ ,(format "--eval=%S" '(message "Hi")))
+ " ")
+ " 20< "
+ (shell-quote-argument (file-name-unquote filter))))
+ (start-time (current-time))
+ (status (call-process bash nil t nil "-c" command))
+ (end-time (current-time)))
+ (ert-info ((emacs-tests--seccomp-debug start-time end-time))
+ (should (eql status 0)))
+ (should (equal (string-trim (buffer-string)) "Hi"))))))
+
+(defun emacs-tests--seccomp-debug (start-time end-time)
+ "Return potentially useful debugging information for Seccomp.
+Assume that the current buffer contains subprocess output for the
+failing process. START-TIME and END-TIME are time values between
+which the process was running."
+ ;; Add a bit of slack for the timestamps.
+ (cl-callf time-subtract start-time 5)
+ (cl-callf time-add end-time 5)
+ (with-output-to-string
+ (princ "Process output:")
+ (terpri)
+ (princ (buffer-substring-no-properties (point-min) (point-max)))
+ ;; Search audit logs for Seccomp messages.
+ (when-let ((ausearch (executable-find "ausearch")))
+ (terpri)
+ (princ "Potentially relevant Seccomp audit events:")
+ (terpri)
+ (let ((process-environment '("LC_TIME=C")))
+ (call-process ausearch nil standard-output nil
+ "--message" "SECCOMP"
+ "--start"
+ (format-time-string "%D" start-time)
+ (format-time-string "%T" start-time)
+ "--end"
+ (format-time-string "%D" end-time)
+ (format-time-string "%T" end-time)
+ "--interpret")))
+ ;; Print coredump information if available.
+ (when-let ((coredumpctl (executable-find "coredumpctl")))
+ (terpri)
+ (princ "Potentially useful coredump information:")
+ (terpri)
+ (call-process coredumpctl nil standard-output nil
+ "info"
+ "--since" (format-time-string "%F %T" start-time)
+ "--until" (format-time-string "%F %T" end-time)
+ "--no-pager"))))
+
+;;; emacs-tests.el ends here
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index 7f193d4eeab..f4d123b4261 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -1,4 +1,4 @@
-;;; unit tests for src/fileio.c -*- lexical-binding: t; -*-
+;;; fileio-tests.el --- unit tests for src/fileio.c -*- lexical-binding: t; -*-
;; Copyright 2017-2021 Free Software Foundation, Inc.
@@ -160,4 +160,26 @@ Also check that an encoding error can appear in a symlink."
(should-error (file-exists-p "/foo\0bar")
:type 'wrong-type-argument))
+(ert-deftest fileio-tests/file-name-concat ()
+ (should (equal (file-name-concat "foo" "bar") "foo/bar"))
+ (should (equal (file-name-concat "foo" "bar") "foo/bar"))
+ (should (equal (file-name-concat "foo" "bar" "zot") "foo/bar/zot"))
+ (should (equal (file-name-concat "foo/" "bar") "foo/bar"))
+ (should (equal (file-name-concat "foo//" "bar") "foo//bar"))
+ (should (equal (file-name-concat "foo/" "bar/" "zot") "foo/bar/zot"))
+ (should (equal (file-name-concat "fóo" "bar") "fóo/bar"))
+ (should (equal (file-name-concat "foo" "bár") "foo/bár"))
+ (should (equal (file-name-concat "fóo" "bár") "fóo/bár"))
+ (let ((string (make-string 5 ?a)))
+ (should (not (multibyte-string-p string)))
+ (aset string 2 255)
+ (should (not (multibyte-string-p string)))
+ (should (equal (file-name-concat "fóo" string) "fóo/aa\377aa")))
+ (should (equal (file-name-concat "foo") "foo"))
+ (should (equal (file-name-concat "foo/") "foo/"))
+ (should (equal (file-name-concat "foo" "") "foo"))
+ (should (equal (file-name-concat "foo" "" "" "" nil) "foo"))
+ (should (equal (file-name-concat "" "bar") "bar"))
+ (should (equal (file-name-concat "" "") "")))
+
;;; fileio-tests.el ends here
diff --git a/test/src/filelock-tests.el b/test/src/filelock-tests.el
new file mode 100644
index 00000000000..a96d6d67289
--- /dev/null
+++ b/test/src/filelock-tests.el
@@ -0,0 +1,183 @@
+;;; filelock-tests.el --- test file locking -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file tests code in src/filelock.c and, to some extent, the
+;; related code in src/fileio.c.
+;;
+;; See also (info "(emacs)Interlocking") and (info "(elisp)File Locks")
+
+;;; Code:
+
+(require 'cl-macs)
+(require 'ert)
+(require 'seq)
+
+(defun filelock-tests--fixture (test-function)
+ "Call TEST-FUNCTION under a test fixture.
+Create a test directory and a buffer whose `buffer-file-name' and
+`buffer-file-truename' are a file within it, then call
+TEST-FUNCTION. Finally, delete the buffer and the test
+directory."
+ (let* ((temp-dir (make-temp-file "filelock-tests" t))
+ (name (concat (file-name-as-directory temp-dir)
+ "userfile"))
+ (create-lockfiles t))
+ (unwind-protect
+ (with-temp-buffer
+ (setq buffer-file-name name
+ buffer-file-truename name)
+ (unwind-protect
+ (save-current-buffer
+ (funcall test-function))
+ ;; Set `buffer-file-truename' nil to prevent unlocking,
+ ;; which might prompt the user and/or signal errors.
+ (setq buffer-file-name nil
+ buffer-file-truename nil)))
+ (delete-directory temp-dir t nil))))
+
+(defun filelock-tests--make-lock-name (file-name)
+ "Return the lock file name for FILE-NAME.
+Equivalent logic in Emacs proper is implemented in C and
+unavailable to Lisp."
+ (concat (file-name-directory (expand-file-name file-name))
+ ".#"
+ (file-name-nondirectory file-name)))
+
+(defun filelock-tests--spoil-lock-file (file-name)
+ "Spoil the lock file for FILE-NAME.
+Cause Emacs to report errors for various file locking operations
+on FILE-NAME going forward. Create a file that is incompatible
+with Emacs' file locking protocol, but uses the same name as
+FILE-NAME's lock file. A directory file is used, which is
+portable in practice."
+ (make-directory (filelock-tests--make-lock-name file-name)))
+
+(defun filelock-tests--unspoil-lock-file (file-name)
+ "Remove the lock file spoiler for FILE-NAME.
+See `filelock-tests--spoil-lock-file'."
+ (delete-directory (filelock-tests--make-lock-name file-name) t))
+
+(defun filelock-tests--should-be-locked ()
+ "Abort the current test if the current buffer is not locked.
+Exception: on systems without lock file support, aborts the
+current test if the current file is locked (which should never
+the case)."
+ (if (eq system-type 'ms-dos)
+ (should-not (file-locked-p buffer-file-truename))
+ (should (file-locked-p buffer-file-truename))))
+
+(ert-deftest filelock-tests-lock-unlock-no-errors ()
+ "Check that locking and unlocking works without error."
+ (filelock-tests--fixture
+ (lambda ()
+ (should-not (file-locked-p (buffer-file-name)))
+
+ ;; inserting text should lock the buffer's file.
+ (insert "this locks the buffer's file")
+ (filelock-tests--should-be-locked)
+ (unlock-buffer)
+ (set-buffer-modified-p nil)
+ (should-not (file-locked-p (buffer-file-name)))
+
+ ;; `set-buffer-modified-p' should lock the buffer's file.
+ (set-buffer-modified-p t)
+ (filelock-tests--should-be-locked)
+ (unlock-buffer)
+ (should-not (file-locked-p (buffer-file-name)))
+
+ (should-not (file-locked-p (buffer-file-name))))))
+
+(ert-deftest filelock-tests-lock-spoiled ()
+ "Check `lock-buffer' ."
+ (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support
+ (filelock-tests--fixture
+ (lambda ()
+ (filelock-tests--spoil-lock-file buffer-file-truename)
+ ;; FIXME: errors when locking a file are ignored; should they be?
+ (set-buffer-modified-p t)
+ (filelock-tests--unspoil-lock-file buffer-file-truename)
+ (should-not (file-locked-p buffer-file-truename)))))
+
+(ert-deftest filelock-tests-file-locked-p-spoiled ()
+ "Check that `file-locked-p' fails if the lockfile is \"spoiled\"."
+ (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support
+ (filelock-tests--fixture
+ (lambda ()
+ (filelock-tests--spoil-lock-file buffer-file-truename)
+ (let ((err (should-error (file-locked-p (buffer-file-name)))))
+ (should (equal (seq-subseq err 0 2)
+ '(file-error "Testing file lock")))))))
+
+(ert-deftest filelock-tests-unlock-spoiled ()
+ "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"."
+ (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support
+ (filelock-tests--fixture
+ (lambda ()
+ ;; Set the buffer modified with file locking temporarily
+ ;; disabled.
+ (let ((create-lockfiles nil))
+ (set-buffer-modified-p t))
+ (should-not (file-locked-p buffer-file-truename))
+ (filelock-tests--spoil-lock-file buffer-file-truename)
+
+ ;; Errors from `unlock-buffer' should call
+ ;; `userlock--handle-unlock-error' (bug#46397).
+ (let (errors)
+ (cl-letf (((symbol-function 'userlock--handle-unlock-error)
+ (lambda (err) (push err errors))))
+ (unlock-buffer))
+ (should (consp errors))
+ (should (equal '(file-error "Unlocking file")
+ (seq-subseq (car errors) 0 2)))
+ (should (equal (length errors) 1))))))
+
+(ert-deftest filelock-tests-kill-buffer-spoiled ()
+ "Check that `kill-buffer' fails if a lockfile is \"spoiled\"."
+ (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support
+ (filelock-tests--fixture
+ (lambda ()
+ ;; Set the buffer modified with file locking temporarily
+ ;; disabled.
+ (let ((create-lockfiles nil))
+ (set-buffer-modified-p t))
+ (should-not (file-locked-p buffer-file-truename))
+ (filelock-tests--spoil-lock-file buffer-file-truename)
+
+ ;; Kill the current buffer. Because the buffer is modified Emacs
+ ;; will attempt to unlock it. Temporarily bind `yes-or-no-p' to
+ ;; a function that fakes a "yes" answer for the "Buffer modified;
+ ;; kill anyway?" prompt.
+ ;;
+ ;; File errors from unlocking files should call
+ ;; `userlock--handle-unlock-error' (bug#46397).
+ (let (errors)
+ (cl-letf (((symbol-function 'yes-or-no-p)
+ (lambda (&rest _) t))
+ ((symbol-function 'userlock--handle-unlock-error)
+ (lambda (err) (push err errors))))
+ (kill-buffer))
+ (should (consp errors))
+ (should (equal '(file-error "Unlocking file")
+ (seq-subseq (car errors) 0 2)))
+ (should (equal (length errors) 1))))))
+
+(provide 'filelock-tests)
+;;; filelock-tests.el ends here
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index 928fb15f109..9f6593a177c 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/src/font-tests.el b/test/src/font-tests.el
index de153b8de9b..ea57b122f4f 100644
--- a/test/src/font-tests.el
+++ b/test/src/font-tests.el
@@ -159,6 +159,31 @@ expected font properties from parsing NAME.")
(insert "\n"))))
(goto-char (point-min)))
+(ert-deftest font-parse-xlfd-test ()
+ ;; Normal number of segments.
+ (should (equal (font-get
+ (font-spec :name "-GNU -FreeSans-semibold-italic-normal-*-*-*-*-*-*-0-iso10646-1")
+ :family)
+ 'FreeSans))
+ (should (equal (font-get
+ (font-spec :name "-GNU -FreeSans-semibold-italic-normal-*-*-*-*-*-*-0-iso10646-1")
+ :foundry)
+ 'GNU\ ))
+ ;; Dash in the family name.
+ (should (equal (font-get
+ (font-spec :name "-Take-mikachan-PS-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1")
+ :family)
+ 'mikachan-PS))
+ (should (equal (font-get
+ (font-spec :name "-Take-mikachan-PS-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1")
+ :weight)
+ 'normal))
+ ;; Synthetic test.
+ (should (equal (font-get
+ (font-spec :name "-foundry-name-with-lots-of-dashes-normal-normal-normal-*-*-*-*-*-*-0-iso10646-1")
+ :family)
+ 'name-with-lots-of-dashes)))
+
;; Local Variables:
;; no-byte-compile: t
;; End:
diff --git a/test/src/indent-tests.el b/test/src/indent-tests.el
index 10f1202949b..6a3f1a5c95f 100644
--- a/test/src/indent-tests.el
+++ b/test/src/indent-tests.el
@@ -4,18 +4,18 @@
;; This file is part of GNU Emacs.
-;; 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.
-;;
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 `https://www.gnu.org/licenses/'.
+;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
diff --git a/test/src/json-tests.el b/test/src/json-tests.el
index 4be11b8c81a..8dc0a744aa0 100644
--- a/test/src/json-tests.el
+++ b/test/src/json-tests.el
@@ -51,6 +51,34 @@
(should (equal (json-parse-buffer) lisp))
(should (eobp)))))
+(ert-deftest json-serialize/roundtrip-scalars ()
+ "Check that Bug#42994 is fixed."
+ (skip-unless (fboundp 'json-serialize))
+ (dolist (case '((:null "null")
+ (:false "false")
+ (t "true")
+ (0 "0")
+ (123 "123")
+ (-456 "-456")
+ (3.75 "3.75")
+ ;; The noncharacter U+FFFF should be passed through,
+ ;; cf. https://www.unicode.org/faq/private_use.html#noncharacters.
+ ("abc\uFFFFαβγ𝔸𝐁𝖢\"\\"
+ "\"abc\uFFFFαβγ𝔸𝐁𝖢\\\"\\\\\"")))
+ (cl-destructuring-bind (lisp json) case
+ (ert-info ((format "%S ↔ %S" lisp json))
+ (should (equal (json-serialize lisp) json))
+ (with-temp-buffer
+ (json-insert lisp)
+ (should (equal (buffer-string) json))
+ (should (eobp)))
+ (should (equal (json-parse-string json) lisp))
+ (with-temp-buffer
+ (insert json)
+ (goto-char 1)
+ (should (equal (json-parse-buffer) lisp))
+ (should (eobp)))))))
+
(ert-deftest json-serialize/object ()
(skip-unless (fboundp 'json-serialize))
(let ((table (make-hash-table :test #'equal)))
@@ -224,7 +252,7 @@ Test with both unibyte and multibyte strings."
(let* ((input
"{ \"abc\" : [9, false] , \"def\" : null }")
(output
- (replace-regexp-in-string " " "" input)))
+ (string-replace " " "" input)))
(should (equal (json-parse-string input
:object-type 'plist
:null-object :json-null
diff --git a/test/src/keyboard-tests.el b/test/src/keyboard-tests.el
index 607d2eafd45..41c8cdd15f0 100644
--- a/test/src/keyboard-tests.el
+++ b/test/src/keyboard-tests.el
@@ -23,14 +23,15 @@
(ert-deftest keyboard-unread-command-events ()
"Test `unread-command-events'."
- (should (equal (progn (push ?\C-a unread-command-events)
- (read-event nil nil 1))
- ?\C-a))
- (should (equal (progn (run-with-timer
- 1 nil
- (lambda () (push '(t . ?\C-b) unread-command-events)))
- (read-event nil nil 2))
- ?\C-b)))
+ (let ((unread-command-events nil))
+ (should (equal (progn (push ?\C-a unread-command-events)
+ (read-event nil nil 1))
+ ?\C-a))
+ (should (equal (progn (run-with-timer
+ 1 nil
+ (lambda () (push '(t . ?\C-b) unread-command-events)))
+ (read-event nil nil 2))
+ ?\C-b))))
(ert-deftest keyboard-lossage-size ()
"Test `lossage-size'."
@@ -46,6 +47,28 @@
(should-error (lossage-size (1- min-value)))
(should (= lossage-orig (lossage-size lossage-orig)))))
+;; FIXME: This test doesn't currently work :-(
+;; (ert-deftest keyboard-tests--echo-keystrokes-bug15332 ()
+;; (let ((msgs '())
+;; (unread-command-events nil)
+;; (redisplay--interactive t)
+;; (echo-keystrokes 2))
+;; (setq unread-command-events '(?\C-u))
+;; (let* ((timer1
+;; (run-with-timer 3 1
+;; (lambda ()
+;; (setq unread-command-events '(?5)))))
+;; (timer2
+;; (run-with-timer 2.5 1
+;; (lambda ()
+;; (push (current-message) msgs)))))
+;; (run-with-timer 5 nil
+;; (lambda ()
+;; (cancel-timer timer1)
+;; (cancel-timer timer2)
+;; (throw 'exit msgs)))
+;; (recursive-edit)
+;; (should (equal msgs '("C-u 55-" "C-u 5-" "C-u-"))))))
(provide 'keyboard-tests)
;;; keyboard-tests.el ends here
diff --git a/test/src/keymap-tests.el b/test/src/keymap-tests.el
index d4f5fc3f190..a9b0cb502d3 100644
--- a/test/src/keymap-tests.el
+++ b/test/src/keymap-tests.el
@@ -63,10 +63,66 @@
(keymap--get-keyelt object t)
(should menu-item-filter-ran)))
+(ert-deftest keymap-define-key/undefined ()
+ ;; nil (means key is undefined in this keymap),
+ (let ((map (make-keymap)))
+ (define-key map [?a] nil)
+ (should-not (lookup-key map [?a]))))
+
+(ert-deftest keymap-define-key/keyboard-macro ()
+ ;; a string (treated as a keyboard macro),
+ (let ((map (make-keymap)))
+ (define-key map [?a] "abc")
+ (should (equal (lookup-key map [?a]) "abc"))))
+
+(ert-deftest keymap-define-key/lambda ()
+ (let ((map (make-keymap)))
+ (define-key map [?a] (lambda () (interactive) nil))
+ (should (functionp (lookup-key map [?a])))))
+
+(ert-deftest keymap-define-key/keymap ()
+ ;; a keymap (to define a prefix key),
+ (let ((map (make-keymap))
+ (map2 (make-keymap)))
+ (define-key map [?a] map2)
+ (define-key map2 [?b] 'foo)
+ (should (eq (lookup-key map [?a ?b]) 'foo))))
+
+(ert-deftest keymap-define-key/menu-item ()
+ ;; or an extended menu item definition.
+ ;; (See info node ‘(elisp)Extended Menu Items’.)
+ (let ((map (make-sparse-keymap))
+ (menu (make-sparse-keymap)))
+ (define-key menu [new-file]
+ '(menu-item "Visit New File..." find-file
+ :enable (menu-bar-non-minibuffer-window-p)
+ :help "Specify a new file's name, to edit the file"))
+ (define-key map [menu-bar file] (cons "File" menu))
+ (should (eq (lookup-key map [menu-bar file new-file]) 'find-file))))
+
(ert-deftest keymap-lookup-key ()
(let ((map (make-keymap)))
(define-key map [?a] 'foo)
- (should (eq (lookup-key map [?a]) 'foo))))
+ (should (eq (lookup-key map [?a]) 'foo))
+ (should-not (lookup-key map [?b]))))
+
+(ert-deftest keymap-lookup-key/list-of-keymaps ()
+ (let ((map1 (make-keymap))
+ (map2 (make-keymap)))
+ (define-key map1 [?a] 'foo)
+ (define-key map2 [?b] 'bar)
+ (should (eq (lookup-key (list map1 map2) [?a]) 'foo))
+ (should (eq (lookup-key (list map1 map2) [?b]) 'bar))
+ (should-not (lookup-key (list map1 map2) [?c]))))
+
+(ert-deftest keymap-lookup-key/too-long ()
+ (let ((map (make-keymap)))
+ (define-key map (kbd "C-c f") 'foo)
+ (should (= (lookup-key map (kbd "C-c f x")) 2))))
+
+;; TODO: Write test for the ACCEPT-DEFAULT argument.
+;; (ert-deftest keymap-lookup-key/accept-default ()
+;; ...)
(ert-deftest describe-buffer-bindings/header-in-current-buffer ()
"Header should be inserted into the current buffer.
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index f2a60bcf327..dac8f95bc4d 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -196,4 +196,71 @@ literals (Bug#20852)."
(should-error (read-event "foo: "))
(should-error (read-char-exclusive "foo: "))))
+(ert-deftest lread-float ()
+ (should (equal (read "13") 13))
+ (should (equal (read "+13") 13))
+ (should (equal (read "-13") -13))
+ (should (equal (read "13.") 13))
+ (should (equal (read "+13.") 13))
+ (should (equal (read "-13.") -13))
+ (should (equal (read "13.25") 13.25))
+ (should (equal (read "+13.25") 13.25))
+ (should (equal (read "-13.25") -13.25))
+ (should (equal (read ".25") 0.25))
+ (should (equal (read "+.25") 0.25))
+ (should (equal (read "-.25") -0.25))
+ (should (equal (read "13e4") 130000.0))
+ (should (equal (read "+13e4") 130000.0))
+ (should (equal (read "-13e4") -130000.0))
+ (should (equal (read "13e+4") 130000.0))
+ (should (equal (read "+13e+4") 130000.0))
+ (should (equal (read "-13e+4") -130000.0))
+ (should (equal (read "625e-4") 0.0625))
+ (should (equal (read "+625e-4") 0.0625))
+ (should (equal (read "-625e-4") -0.0625))
+ (should (equal (read "1.25e2") 125.0))
+ (should (equal (read "+1.25e2") 125.0))
+ (should (equal (read "-1.25e2") -125.0))
+ (should (equal (read "1.25e+2") 125.0))
+ (should (equal (read "+1.25e+2") 125.0))
+ (should (equal (read "-1.25e+2") -125.0))
+ (should (equal (read "1.25e-1") 0.125))
+ (should (equal (read "+1.25e-1") 0.125))
+ (should (equal (read "-1.25e-1") -0.125))
+ (should (equal (read "4.e3") 4000.0))
+ (should (equal (read "+4.e3") 4000.0))
+ (should (equal (read "-4.e3") -4000.0))
+ (should (equal (read "4.e+3") 4000.0))
+ (should (equal (read "+4.e+3") 4000.0))
+ (should (equal (read "-4.e+3") -4000.0))
+ (should (equal (read "5.e-1") 0.5))
+ (should (equal (read "+5.e-1") 0.5))
+ (should (equal (read "-5.e-1") -0.5))
+ (should (equal (read "0") 0))
+ (should (equal (read "+0") 0))
+ (should (equal (read "-0") 0))
+ (should (equal (read "0.") 0))
+ (should (equal (read "+0.") 0))
+ (should (equal (read "-0.") 0))
+ (should (equal (read "0.0") 0.0))
+ (should (equal (read "+0.0") 0.0))
+ (should (equal (read "-0.0") -0.0))
+ (should (equal (read "0e5") 0.0))
+ (should (equal (read "+0e5") 0.0))
+ (should (equal (read "-0e5") -0.0))
+ (should (equal (read "0e-5") 0.0))
+ (should (equal (read "+0e-5") 0.0))
+ (should (equal (read "-0e-5") -0.0))
+ (should (equal (read ".0e-5") 0.0))
+ (should (equal (read "+.0e-5") 0.0))
+ (should (equal (read "-.0e-5") -0.0))
+ (should (equal (read "0.0e-5") 0.0))
+ (should (equal (read "+0.0e-5") 0.0))
+ (should (equal (read "-0.0e-5") -0.0))
+ (should (equal (read "0.e-5") 0.0))
+ (should (equal (read "+0.e-5") 0.0))
+ (should (equal (read "-0.e-5") -0.0))
+ )
+
+
;;; lread-tests.el ends here
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e62bcb3f7c0..9bab523708e 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -26,9 +26,9 @@
(require 'cl-lib)
(require 'ert)
(require 'puny)
-(require 'rx)
(require 'subr-x)
(require 'dns)
+(require 'url-http)
;; Timeout in seconds; the test fails if the timeout is reached.
(defvar process-test-sentinel-wait-timeout 2.0)
@@ -348,8 +348,7 @@ See Bug#30460."
invocation-directory))
:stop t))))
-;; All the following tests require working DNS, which appears not to
-;; be the case for hydra.nixos.org, so disable them there for now.
+;; The following tests require working DNS
;; This will need updating when IANA assign more IPv6 global ranges.
(defun ipv6-is-available ()
@@ -360,9 +359,16 @@ See Bug#30460."
(= (logand (aref elt 0) #xe000) #x2000)))
(network-interface-list))))
+;; Check if the Internet seems to be working. Mainly to pacify
+;; Debian's CI system.
+(defvar internet-is-working
+ (progn
+ (require 'dns)
+ (dns-query "google.com")))
+
(ert-deftest lookup-family-specification ()
"`network-lookup-address-info' should only accept valid family symbols."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should-error (network-lookup-address-info "localhost" 'both))
(should (network-lookup-address-info "localhost" 'ipv4))
@@ -371,20 +377,20 @@ See Bug#30460."
(ert-deftest lookup-unicode-domains ()
"Unicode domains should fail."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should-error (network-lookup-address-info "faß.de"))
(should (network-lookup-address-info (puny-encode-domain "faß.de")))))
(ert-deftest unibyte-domain-name ()
"Unibyte domain names should work."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should (network-lookup-address-info (string-to-unibyte "google.com")))))
(ert-deftest lookup-google ()
"Check that we can look up google IP addresses."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(let ((addresses-both (network-lookup-address-info "google.com"))
(addresses-v4 (network-lookup-address-info "google.com" 'ipv4)))
@@ -396,10 +402,12 @@ See Bug#30460."
(ert-deftest non-existent-lookup-failure ()
"Check that looking up non-existent domain returns nil."
- (skip-unless (not (getenv "EMACS_HYDRA_CI")))
+ (skip-unless internet-is-working)
(with-timeout (60 (ert-fail "Test timed out"))
(should (eq nil (network-lookup-address-info "emacs.invalid")))))
+;; End of tests requiring DNS
+
(defmacro process-tests--ignore-EMFILE (&rest body)
"Evaluate BODY, ignoring EMFILE errors."
(declare (indent 0) (debug t))
@@ -619,6 +627,8 @@ FD_SETSIZE file descriptors (Bug#24325)."
FD_SETSIZE file descriptors (Bug#24325)."
(skip-unless (featurep 'make-network-process '(:server t)))
(skip-unless (featurep 'make-network-process '(:family local)))
+ ;; Avoid hang due to connect/accept handshake on Cygwin (bug#49496).
+ (skip-unless (not (eq system-type 'cygwin)))
(with-timeout (60 (ert-fail "Test timed out"))
(process-tests--with-temp-directory directory
(process-tests--with-processes processes
@@ -907,5 +917,34 @@ Return nil if FILENAME doesn't exist."
;; ...and the change description should be "interrupt".
(should (equal '("interrupt\n") events)))))
+(ert-deftest process-async-https-with-delay ()
+ "Bug#49449: asynchronous TLS connection with delayed completion."
+ (skip-unless (and internet-is-working (gnutls-available-p)))
+ (let* ((status nil)
+ (buf (url-http
+ #s(url "https" nil nil "elpa.gnu.org" nil
+ "/packages/archive-contents" nil nil t silent t t)
+ (lambda (s) (setq status s))
+ '(nil) nil 'tls)))
+ (unwind-protect
+ (progn
+ ;; Busy-wait for 1 s to allow for the TCP connection to complete.
+ (let ((delay 1.0)
+ (t0 (float-time)))
+ (while (< (float-time) (+ t0 delay))))
+ ;; Wait for the entire operation to finish.
+ (let ((limit 4.0)
+ (t0 (float-time)))
+ (while (and (null status)
+ (< (float-time) (+ t0 limit)))
+ (sit-for 0.1)))
+ (should status)
+ (should-not (assq :error status))
+ (should buf)
+ (should (> (buffer-size buf) 0))
+ )
+ (when buf
+ (kill-buffer buf)))))
+
(provide 'process-tests)
;;; process-tests.el ends here
diff --git a/test/src/search-tests.el b/test/src/search-tests.el
new file mode 100644
index 00000000000..b7b4ab9a8ff
--- /dev/null
+++ b/test/src/search-tests.el
@@ -0,0 +1,42 @@
+;;; search-tests.el --- tests for search.c functions -*- lexical-binding: t -*-
+
+;; Copyright (C) 2015-2016, 2018-2021 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Code:
+
+(require 'ert)
+
+(ert-deftest test-replace-match-modification-hooks ()
+ (let ((ov-set nil))
+ (with-temp-buffer
+ (insert "1 abc")
+ (setq ov-set (make-overlay 3 5))
+ (overlay-put
+ ov-set 'modification-hooks
+ (list (lambda (o after &rest _args)
+ (when after
+ (let ((inhibit-modification-hooks t))
+ (save-excursion
+ (goto-char 2)
+ (insert "234")))))))
+ (goto-char 3)
+ (if (search-forward "bc")
+ (replace-match "bcd"))
+ (should (= (point) 10)))))
+
+;;; search-tests.el ends here
diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el
index 479b818935f..e4e3054d37a 100644
--- a/test/src/syntax-tests.el
+++ b/test/src/syntax-tests.el
@@ -21,6 +21,7 @@
(require 'ert)
(require 'ert-x)
+(require 'cl-lib)
(ert-deftest parse-partial-sexp-continue-over-comment-marker ()
"Continue a parse that stopped in the middle of a comment marker."
@@ -56,6 +57,16 @@
(should (equal (parse-partial-sexp aftC pointX nil nil pps-aftC)
ppsX)))))
+(ert-deftest syntax-class-character-test ()
+ (cl-loop for char across " .w_()'\"$\\/<>@!|"
+ for i from 0
+ do (should (= char (syntax-class-to-char i)))
+ when (string-to-syntax (string char))
+ do (should (= char (syntax-class-to-char
+ (car (string-to-syntax (string char)))))))
+ (should-error (syntax-class-to-char -1))
+ (should-error (syntax-class-to-char 200)))
+
(ert-deftest parse-partial-sexp-paren-comments ()
"Test syntax parsing with paren comment markers.
Specifically, where the first character of the comment marker is
diff --git a/test/src/thread-tests.el b/test/src/thread-tests.el
index f14d2426ef0..fc7bc7441b7 100644
--- a/test/src/thread-tests.el
+++ b/test/src/thread-tests.el
@@ -1,4 +1,4 @@
-;;; threads.el --- tests for threads. -*- lexical-binding: t -*-
+;;; thread-tests.el --- tests for threads. -*- lexical-binding: t -*-
;; Copyright (C) 2012-2021 Free Software Foundation, Inc.
@@ -315,8 +315,8 @@
"Test signaling a thread as soon as it is started by the OS."
(skip-unless (featurep 'threads))
(let ((thread
- (make-thread #'(lambda ()
- (while t (thread-yield))))))
+ (make-thread (lambda ()
+ (while t (thread-yield))))))
(thread-signal thread 'error nil)
(sit-for 1)
(should-not (thread-live-p thread))
@@ -331,7 +331,7 @@
(let (buffer-read-only)
(erase-buffer))
(let ((thread
- (make-thread #'(lambda () (thread-signal main-thread 'error nil)))))
+ (make-thread (lambda () (thread-signal main-thread 'error nil)))))
(while (thread-live-p thread)
(thread-yield))
(read-event nil nil 0.1)
diff --git a/test/src/timefns-tests.el b/test/src/timefns-tests.el
index e55bd1eb4ee..0a450a7573f 100644
--- a/test/src/timefns-tests.el
+++ b/test/src/timefns-tests.el
@@ -1,4 +1,4 @@
-;;; timefns-tests.el -- tests for timefns.c -*- lexical-binding: t -*-
+;;; timefns-tests.el --- tests for timefns.c -*- lexical-binding: t -*-
;; Copyright (C) 2016-2021 Free Software Foundation, Inc.
diff --git a/test/src/undo-tests.el b/test/src/undo-tests.el
index 055bf102dfc..a658bccf6dc 100644
--- a/test/src/undo-tests.el
+++ b/test/src/undo-tests.el
@@ -46,6 +46,7 @@
;;; Code:
(require 'ert)
+(require 'facemenu)
(ert-deftest undo-test0 ()
"Test basics of \\[undo]."
@@ -87,6 +88,7 @@
(ert-deftest undo-test1 ()
"Test undo of \\[undo] command (redo)."
+ (require 'facemenu)
(with-temp-buffer
(buffer-enable-undo)
(undo-boundary)