aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVibhav Pant2020-08-21 14:04:35 +0530
committerVibhav Pant2020-08-21 14:04:35 +0530
commitf0f8d7b82492e741950c363a03b886965c91b1b0 (patch)
tree19b716830b1ebabc0d7d75949c4e6800c0f104ad
parent9e64a087c4d167e7ec1c4e22bea3e6af53b563de (diff)
parentc818c29771d3cb51875643b2f6c894073e429dd2 (diff)
downloademacs-feature/native-comp-macos-fixes.tar.gz
emacs-feature/native-comp-macos-fixes.zip
Merge branch 'feature/native-comp' into feature/native-comp-macos-fixesfeature/native-comp-macos-fixes
-rw-r--r--ChangeLog.3100
-rw-r--r--Makefile.in20
-rw-r--r--admin/release-process8
-rw-r--r--configure.ac31
-rw-r--r--doc/emacs/basic.texi2
-rw-r--r--doc/emacs/custom.texi1
-rw-r--r--doc/emacs/fixit.texi10
-rw-r--r--doc/emacs/frames.texi8
-rw-r--r--doc/emacs/maintaining.texi5
-rw-r--r--doc/emacs/mini.texi7
-rw-r--r--doc/emacs/misc.texi4
-rw-r--r--doc/lispref/commands.texi7
-rw-r--r--doc/lispref/functions.texi9
-rw-r--r--doc/lispref/searching.texi2
-rw-r--r--doc/lispref/sequences.texi6
-rw-r--r--doc/lispref/tips.texi2
-rw-r--r--doc/misc/efaq.texi7
-rw-r--r--doc/misc/gnus.texi8
-rw-r--r--doc/misc/message.texi2
-rw-r--r--doc/misc/url.texi2
-rw-r--r--etc/HISTORY2
-rw-r--r--etc/NEWS217
-rw-r--r--etc/NEWS.2716
-rw-r--r--etc/PROBLEMS38
-rw-r--r--lib/c++defs.h10
-rw-r--r--lib/canonicalize-lgpl.c4
-rw-r--r--lib/cdefs.h9
-rw-r--r--lib/dup2.c4
-rw-r--r--lib/fcntl.in.h18
-rw-r--r--lib/getopt-cdefs.in.h2
-rw-r--r--lib/gnulib.mk.in4
-rw-r--r--lib/intprops.h2
-rw-r--r--lib/md5.h2
-rw-r--r--lib/mktime.c2
-rw-r--r--lib/nstrftime.c22
-rw-r--r--lib/open.c4
-rw-r--r--lib/regcomp.c2
-rw-r--r--lib/regex_internal.h2
-rw-r--r--lib/stdio.in.h46
-rw-r--r--lib/stdlib.in.h29
-rw-r--r--lib/strftime.h7
-rw-r--r--lib/string.in.h15
-rw-r--r--lib/sys_random.in.h4
-rw-r--r--lib/sys_select.in.h6
-rw-r--r--lib/sys_stat.in.h14
-rw-r--r--lib/sys_time.in.h2
-rw-r--r--lib/time.in.h12
-rw-r--r--lib/time_rz.c51
-rw-r--r--lib/unistd.in.h159
-rw-r--r--lib/verify.h41
-rw-r--r--lisp/Makefile.in13
-rw-r--r--lisp/abbrev.el10
-rw-r--r--lisp/bookmark.el13
-rw-r--r--lisp/buff-menu.el3
-rw-r--r--lisp/cedet/ede/make.el24
-rw-r--r--lisp/cedet/semantic/bovine/c.el25
-rw-r--r--lisp/cedet/semantic/dep.el18
-rw-r--r--lisp/cedet/semantic/lex-spp.el4
-rw-r--r--lisp/comint.el16
-rw-r--r--lisp/cus-edit.el27
-rw-r--r--lisp/descr-text.el3
-rw-r--r--lisp/desktop.el2
-rw-r--r--lisp/dirtrack.el3
-rw-r--r--lisp/doc-view.el46
-rw-r--r--lisp/emacs-lisp/bytecomp.el6
-rw-r--r--lisp/emacs-lisp/chart.el4
-rw-r--r--lisp/emacs-lisp/comp.el64
-rw-r--r--lisp/emacs-lisp/crm.el6
-rw-r--r--lisp/emacs-lisp/derived.el1
-rw-r--r--lisp/emacs-lisp/easymenu.el10
-rw-r--r--lisp/emacs-lisp/ert.el9
-rw-r--r--lisp/emacs-lisp/find-func.el11
-rw-r--r--lisp/emacs-lisp/lisp-mode.el6
-rw-r--r--lisp/emacs-lisp/rx.el4
-rw-r--r--lisp/emulation/viper-cmd.el27
-rw-r--r--lisp/emulation/viper-mous.el2
-rw-r--r--lisp/emulation/viper-util.el20
-rw-r--r--lisp/epa.el4
-rw-r--r--lisp/epg.el16
-rw-r--r--lisp/erc/erc-backend.el3
-rw-r--r--lisp/erc/erc-dcc.el8
-rw-r--r--lisp/erc/erc-fill.el2
-rw-r--r--lisp/erc/erc-goodies.el3
-rw-r--r--lisp/erc/erc-log.el2
-rw-r--r--lisp/erc/erc-match.el67
-rw-r--r--lisp/erc/erc-notify.el2
-rw-r--r--lisp/erc/erc-pcomplete.el1
-rw-r--r--lisp/erc/erc-stamp.el1
-rw-r--r--lisp/erc/erc-track.el12
-rw-r--r--lisp/erc/erc.el27
-rw-r--r--lisp/eshell/em-rebind.el1
-rw-r--r--lisp/eshell/esh-io.el7
-rw-r--r--lisp/eshell/esh-mode.el75
-rw-r--r--lisp/eshell/eshell.el9
-rw-r--r--lisp/ffap.el139
-rw-r--r--lisp/files.el13
-rw-r--r--lisp/forms.el25
-rw-r--r--lisp/gnus/gnus-sum.el3
-rw-r--r--lisp/gnus/message.el63
-rw-r--r--lisp/gnus/mml-smime.el1
-rw-r--r--lisp/gnus/mml1991.el1
-rw-r--r--lisp/gnus/mml2015.el1
-rw-r--r--lisp/gnus/smiley.el13
-rw-r--r--lisp/help-fns.el6
-rw-r--r--lisp/hi-lock.el6
-rw-r--r--lisp/hilit-chg.el16
-rw-r--r--lisp/htmlfontify.el5
-rw-r--r--lisp/icomplete.el11
-rw-r--r--lisp/ido.el12
-rw-r--r--lisp/image/gravatar.el111
-rw-r--r--lisp/international/mule-cmds.el5
-rw-r--r--lisp/international/mule-diag.el4
-rw-r--r--lisp/international/mule-util.el9
-rw-r--r--lisp/international/mule.el135
-rw-r--r--lisp/ldefs-boot.el6
-rw-r--r--lisp/loadup.el44
-rw-r--r--lisp/mail/binhex.el10
-rw-r--r--lisp/mail/emacsbug.el12
-rw-r--r--lisp/mail/flow-fill.el36
-rw-r--r--lisp/mail/rmail.el19
-rw-r--r--lisp/mail/rmailedit.el4
-rw-r--r--lisp/mail/uudecode.el14
-rw-r--r--lisp/minibuffer.el28
-rw-r--r--lisp/mouse.el28
-rw-r--r--lisp/mwheel.el29
-rw-r--r--lisp/net/eudc-bob.el130
-rw-r--r--lisp/net/eww.el25
-rw-r--r--lisp/net/newst-treeview.el30
-rw-r--r--lisp/net/ntlm.el44
-rw-r--r--lisp/net/tramp-sh.el98
-rw-r--r--lisp/net/tramp.el103
-rw-r--r--lisp/obsolete/erc-compat.el (renamed from lisp/erc/erc-compat.el)1
-rw-r--r--lisp/obsolete/tpu-edt.el12
-rw-r--r--lisp/password-cache.el16
-rw-r--r--lisp/progmodes/cc-engine.el2
-rw-r--r--lisp/progmodes/compile.el9
-rw-r--r--lisp/progmodes/cperl-mode.el3
-rw-r--r--lisp/progmodes/ebnf2ps.el4
-rw-r--r--lisp/progmodes/elisp-mode.el10
-rw-r--r--lisp/progmodes/etags.el4
-rw-r--r--lisp/progmodes/idlw-help.el3
-rw-r--r--lisp/progmodes/idlw-shell.el7
-rw-r--r--lisp/progmodes/idlwave.el193
-rw-r--r--lisp/progmodes/perl-mode.el4
-rw-r--r--lisp/progmodes/project.el22
-rw-r--r--lisp/progmodes/python.el19
-rw-r--r--lisp/progmodes/subword.el2
-rw-r--r--lisp/progmodes/xref.el43
-rw-r--r--lisp/ps-def.el18
-rw-r--r--lisp/ps-print.el8
-rw-r--r--lisp/savehist.el4
-rw-r--r--lisp/shell.el57
-rw-r--r--lisp/simple.el22
-rw-r--r--lisp/so-long.el64
-rw-r--r--lisp/speedbar.el28
-rw-r--r--lisp/startup.el14
-rw-r--r--lisp/subr.el10
-rw-r--r--lisp/t-mouse.el2
-rw-r--r--lisp/term.el32
-rw-r--r--lisp/term/w32-win.el4
-rw-r--r--lisp/textmodes/bibtex.el1
-rw-r--r--lisp/textmodes/flyspell.el61
-rw-r--r--lisp/textmodes/ispell.el16
-rw-r--r--lisp/textmodes/remember.el3
-rw-r--r--lisp/thingatpt.el2
-rw-r--r--lisp/time.el294
-rw-r--r--lisp/tooltip.el2
-rw-r--r--lisp/url/url-expand.el2
-rw-r--r--lisp/url/url-util.el25
-rw-r--r--lisp/url/url-vars.el7
-rw-r--r--lisp/vc/diff-mode.el2
-rw-r--r--lisp/vc/ediff-init.el5
-rw-r--r--lisp/vc/ediff-util.el22
-rw-r--r--lisp/vc/vc-git.el18
-rw-r--r--lisp/vc/vc-hooks.el8
-rw-r--r--lisp/vc/vc-mtn.el1
-rw-r--r--lisp/vc/vc.el3
-rw-r--r--lisp/vcursor.el3
-rw-r--r--lisp/vt-control.el2
-rw-r--r--lisp/window.el21
-rw-r--r--lisp/woman.el4
-rw-r--r--m4/00gnulib.m438
-rw-r--r--m4/absolute-header.m410
-rw-r--r--m4/alloca.m44
-rw-r--r--m4/canonicalize.m414
-rw-r--r--m4/dup2.m43
-rw-r--r--m4/fchmodat.m44
-rw-r--r--m4/fcntl.m43
-rw-r--r--m4/fdopendir.m420
-rw-r--r--m4/fpending.m44
-rw-r--r--m4/futimens.m45
-rw-r--r--m4/getdtablesize.m419
-rw-r--r--m4/getloadavg.m44
-rw-r--r--m4/getrandom.m45
-rw-r--r--m4/gnulib-common.m482
-rw-r--r--m4/include_next.m418
-rw-r--r--m4/largefile.m46
-rw-r--r--m4/manywarnings.m48
-rw-r--r--m4/mktime.m48
-rw-r--r--m4/nstrftime.m44
-rw-r--r--m4/open-slash.m43
-rw-r--r--m4/pselect.m45
-rw-r--r--m4/pthread_sigmask.m43
-rw-r--r--m4/sys_random_h.m45
-rw-r--r--m4/time_h.m41
-rw-r--r--m4/utimens.m45
-rw-r--r--m4/utimensat.m45
-rw-r--r--m4/utimes.m43
-rw-r--r--m4/warnings.m421
-rw-r--r--src/Makefile.in6
-rw-r--r--src/ccl.c115
-rw-r--r--src/charset.c9
-rw-r--r--src/coding.c12
-rw-r--r--src/comp.c150
-rw-r--r--src/comp.h2
-rw-r--r--src/composite.c4
-rw-r--r--src/emacs.c16
-rw-r--r--src/fns.c30
-rw-r--r--src/font.c74
-rw-r--r--src/fontset.c27
-rw-r--r--src/ftfont.c12
-rw-r--r--src/hbfont.c11
-rw-r--r--src/image.c71
-rw-r--r--src/lisp.h18
-rw-r--r--src/lread.c214
-rw-r--r--src/macfont.m6
-rw-r--r--src/minibuf.c2
-rw-r--r--src/nsselect.m2
-rw-r--r--src/nsterm.m23
-rw-r--r--src/nsxwidget.m4
-rw-r--r--src/pdumper.c38
-rw-r--r--src/search.c13
-rw-r--r--src/syntax.c4
-rw-r--r--src/sysdep.c35
-rw-r--r--src/timefns.c33
-rw-r--r--src/window.c2
-rw-r--r--src/xdisp.c8
-rw-r--r--src/xfaces.c28
-rw-r--r--src/xfns.c13
-rw-r--r--src/xrdb.c4
-rw-r--r--src/xselect.c21
-rw-r--r--src/xterm.c21
-rw-r--r--src/xterm.h1
-rw-r--r--src/xwidget.c4
-rw-r--r--test/lisp/cedet/srecode-utest-template.el5
-rw-r--r--test/lisp/emacs-lisp/bytecomp-tests.el43
-rw-r--r--test/lisp/emacs-lisp/cl-lib-tests.el16
-rw-r--r--test/lisp/ffap-tests.el40
-rw-r--r--test/lisp/mail/flow-fill-tests.el3
-rw-r--r--test/lisp/progmodes/compile-tests.el4
-rw-r--r--test/lisp/progmodes/cperl-mode-tests.el51
-rw-r--r--test/lisp/simple-tests.el7
-rw-r--r--test/lisp/textmodes/bibtex-tests.el57
-rw-r--r--test/lisp/textmodes/paragraphs-tests.el4
-rw-r--r--test/lisp/url/url-expand-tests.el7
-rw-r--r--test/manual/etags/c-src/abbrev.c14
-rw-r--r--test/manual/image-circular-tests.el144
-rw-r--r--test/src/comp-tests.el3
-rw-r--r--test/src/fns-tests.el6
259 files changed, 3220 insertions, 2489 deletions
diff --git a/ChangeLog.3 b/ChangeLog.3
index c8dd40b5eb6..1a530118995 100644
--- a/ChangeLog.3
+++ b/ChangeLog.3
@@ -1,3 +1,99 @@
12020-08-03 Phil Sainty <psainty@orcon.net.nz>
2
3 lisp/so-long.el: Improve support for major mode hooks
4
5 * lisp/so-long.el (so-long-remember-all, so-long-disable-minor-modes)
6 (so-long-override-variables): Store and use the `so-long-minor-modes'
7 and `so-long-variable-overrides' values seen by the original major
8 mode, so that buffer-local changes made in the major mode hook will be
9 respected.
10
11 Add documentation of this and other major mode hook usage.
12
132020-08-02 Grégory Mounié <Gregory.Mounie@imag.fr> (tiny change)
14
15 Avoid segfaults if XIM is set but not xim_styles
16
17 Emacs segfaults at the X11 initialization if XIM is set
18 and xim_styles is NULL. This patch avoids the crash.
19 * src/xfns.c: Check also if FRAME_X_XIM_STYLES(f) is NULL.
20 (Bug#42676) (Bug#42673) (Bug#42677)
21
222020-07-31 Philipp Stephani <phst@google.com>
23
24 Backport: Make checking for liveness of global values more precise.
25
26 We can't just use a hash lookup because a global and a local reference
27 might refer to the same Lisp object.
28
29 * src/emacs-module.c (module_free_global_ref): More precise check for
30 global liveness.
31
32 (cherry picked from commit 9f01ce6327af886f26399924a9aadf16cdd4fd9f)
33
342020-07-31 Philipp Stephani <phst@google.com>
35
36 Backport: Fix subtle bug when checking liveness of module values.
37
38 We can't simply look up the Lisp object in the global reference table
39 because an invalid local and a valid global reference might refer to
40 the same object. Instead, we have to test the address of the global
41 reference against the stored references.
42
43 * src/emacs-module.c (module_global_reference_p): New helper function.
44 (value_to_lisp): Use it.
45
46 (cherry picked from commit 6355a3ec62f43c9b99d483982ff851d32dd78891)
47
482020-07-31 Philipp Stephani <phst@google.com>
49
50 Backport: Fix memory leak for global module objects (Bug#42482).
51
52 Instead of storing the global values in a global 'emacs_value_storage'
53 object, store them as hash values alongside the reference counts.
54 That way the garbage collector takes care of cleaning them up.
55
56 * src/emacs-module.c (global_storage): Remove.
57 (struct module_global_reference): New pseudovector type.
58 (XMODULE_GLOBAL_REFERENCE): New helper function.
59 (module_make_global_ref, module_free_global_ref): Use
60 'module_global_reference' struct for global reference values.
61 (value_to_lisp, module_handle_nonlocal_exit): Adapt to deletion of
62 'global_storage'.
63
64 (cherry picked from commit 5c5eb9790898e4ab10bcbbdb6871947ed3018569)
65
662020-07-30 Nicolas Petton <nicolas@petton.fr>
67
68 * admin/authors.el (authors-aliases): Remove a faulty regexp.
69
702020-07-29 Stefan Kangas <stefankangas@gmail.com>
71
72 * doc/lispref/symbols.texi (Definitions): Fix typo.
73
742020-07-28 Nicolas Petton <nicolas@petton.fr>
75
76 * etc/HISTORY: Add Emacs 27.1 release date.
77
782020-07-28 Nicolas Petton <nicolas@petton.fr>
79
80 Bump Emacs version to 27.1
81
82 * README:
83 * configure.ac:
84 * msdos/sed2v2.inp:
85 * nt/README.W32: Bump Emacs version.
86
872020-07-28 Nicolas Petton <nicolas@petton.fr>
88
89 * etc/AUTHORS: Update.
90
912020-07-28 Nicolas Petton <nicolas@petton.fr>
92
93 Update authors.el
94
95 * admin/authors.el (authors-aliases): Add author aliases.
96
12020-07-28 Nicolas Petton <nicolas@petton.fr> 972020-07-28 Nicolas Petton <nicolas@petton.fr>
2 98
3 * etc/NEWS: Remove temporary markup. 99 * etc/NEWS: Remove temporary markup.
@@ -2862,7 +2958,7 @@
2862 * doc/lispref/searching.texi (Rx Constructs): Document. 2958 * doc/lispref/searching.texi (Rx Constructs): Document.
2863 * lisp/emacs-lisp/rx.el (rx--normalise-or-arg) 2959 * lisp/emacs-lisp/rx.el (rx--normalise-or-arg)
2864 (rx--all-string-or-args): New. 2960 (rx--all-string-or-args): New.
2865 (rx--translate-or): Normalise arguments first, and check for strings 2961 (rx--translate-or): Normalize arguments first, and check for strings
2866 in subforms. 2962 in subforms.
2867 (rx--expand-eval): Extracted from rx--translate-eval. 2963 (rx--expand-eval): Extracted from rx--translate-eval.
2868 (rx--translate-eval): Call rx--expand-eval. 2964 (rx--translate-eval): Call rx--expand-eval.
@@ -142382,7 +142478,7 @@
142382 142478
142383This file records repository revisions from 142479This file records repository revisions from
142384commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to 142480commit 9d56a21e6a696ad19ac65c4b405aeca44785884a (exclusive) to
142385commit 56f958807c0b8ea8f45e3c088157ca144a1b1fac (inclusive). 142481commit 1ca4da054be7eb340c511d817f3ec89c8b819db7 (inclusive).
142386See ChangeLog.2 for earlier changes. 142482See ChangeLog.2 for earlier changes.
142387 142483
142388;; Local Variables: 142484;; Local Variables:
diff --git a/Makefile.in b/Makefile.in
index 03dd881897c..e951c4f5a71 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -108,6 +108,8 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
108am__v_at_0 = @ 108am__v_at_0 = @
109am__v_at_1 = 109am__v_at_1 =
110 110
111HAVE_NATIVE_COMP = @HAVE_NATIVE_COMP@
112
111# ==================== Where To Install Things ==================== 113# ==================== Where To Install Things ====================
112 114
113# Location to install Emacs.app under GNUstep / macOS. 115# Location to install Emacs.app under GNUstep / macOS.
@@ -330,6 +332,8 @@ CONFIG_STATUS_FILES_IN = \
330COPYDIR = ${srcdir}/etc ${srcdir}/lisp 332COPYDIR = ${srcdir}/etc ${srcdir}/lisp
331COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}" 333COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}"
332 334
335ELN_DESTDIR = "$(DESTDIR)${libexecdir}/emacs/${version}/${configuration}/"
336
333all: ${SUBDIR} info 337all: ${SUBDIR} info
334 338
335.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 etc-emacsver 339.PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 etc-emacsver
@@ -423,11 +427,12 @@ VCSWITNESS = $(if $(wildcard $(srcdir)/$(dirstate)),$$(srcdir)/../$(dirstate))
423src: Makefile 427src: Makefile
424ifeq (${ns_self_contained},no) 428ifeq (${ns_self_contained},no)
425 $(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' BIN_DESTDIR='$(DESTDIR)${bindir}/' \ 429 $(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' BIN_DESTDIR='$(DESTDIR)${bindir}/' \
426 LISP_DESTDIR='$(DESTDIR)${lispdir}/' all 430 ELN_DESTDIR='$(ELN_DESTDIR)' all
427else 431else
428 $(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' BIN_DESTDIR='${ns_appbindir}/' \ 432 $(MAKE) -C $@ VCSWITNESS='$(VCSWITNESS)' BIN_DESTDIR='${ns_appbindir}/' \
429 LISP_DESTDIR='$(DESTDIR)${lispdir}/' all 433 ELN_DESTDIR='$(ELN_DESTDIR)' all
430endif 434endif
435
431blessmail: Makefile src 436blessmail: Makefile src
432 $(MAKE) -C lib-src maybe-blessmail 437 $(MAKE) -C lib-src maybe-blessmail
433 438
@@ -466,14 +471,14 @@ $(srcdir)/configure: $(srcdir)/configure.ac $(srcdir)/m4/*.m4
466# ==================== Installation ==================== 471# ==================== Installation ====================
467 472
468.PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info 473.PHONY: install install-arch-dep install-arch-indep install-etcdoc install-info
469.PHONY: install-man install-etc install-strip install-$(NTDIR) 474.PHONY: install-man install-etc install-strip install-$(NTDIR) install-eln
470.PHONY: uninstall uninstall-$(NTDIR) 475.PHONY: uninstall uninstall-$(NTDIR)
471 476
472## If we let lib-src do its own installation, that means we 477## If we let lib-src do its own installation, that means we
473## don't have to duplicate the list of utilities to install in 478## don't have to duplicate the list of utilities to install in
474## this Makefile as well. 479## this Makefile as well.
475 480
476install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail 481install: all install-arch-indep install-etcdoc install-arch-dep install-$(NTDIR) blessmail install-eln
477 @true 482 @true
478 483
479## Ensure that $subdir contains a subdirs.el file. 484## Ensure that $subdir contains a subdirs.el file.
@@ -757,6 +762,12 @@ install-etc:
757 done ; \ 762 done ; \
758 done 763 done
759 764
765### Install native compiled Lisp files.
766install-eln:
767ifeq ($(HAVE_NATIVE_COMP),yes)
768 find eln-cache -type f -exec ${INSTALL_DATA} -D "{}" "$(ELN_DESTDIR){}" \;
769endif
770
760### Build Emacs and install it, stripping binaries while installing them. 771### Build Emacs and install it, stripping binaries while installing them.
761install-strip: 772install-strip:
762 $(MAKE) INSTALL_STRIP=-s install 773 $(MAKE) INSTALL_STRIP=-s install
@@ -867,6 +878,7 @@ clean: $(clean_dirs:=_clean)
867 [ ! -d test ] || $(MAKE) -C test $@ 878 [ ! -d test ] || $(MAKE) -C test $@
868 -rm -f ./*.tmp etc/*.tmp* 879 -rm -f ./*.tmp etc/*.tmp*
869 -rm -rf info-dir.* 880 -rm -rf info-dir.*
881 -rm -rf eln-cache
870 882
871### 'bootclean' 883### 'bootclean'
872### Delete all files that need to be remade for a clean bootstrap. 884### Delete all files that need to be remade for a clean bootstrap.
diff --git a/admin/release-process b/admin/release-process
index 1ed7a2e29e7..b8587e62047 100644
--- a/admin/release-process
+++ b/admin/release-process
@@ -192,16 +192,14 @@ sk Miroslav Vaško
192** Check for modes which bind M-s that conflicts with a new global binding M-s 192** Check for modes which bind M-s that conflicts with a new global binding M-s
193and change key bindings where necessary. The current list of modes: 193and change key bindings where necessary. The current list of modes:
194 194
1951. Gnus binds 'M-s' to 'gnus-summary-search-article-forward'. 1951. Minibuffer binds 'M-s' to 'next-matching-history-element'
196
1972. Minibuffer binds 'M-s' to 'next-matching-history-element'
198 (not useful any more since C-s can now search in the history). 196 (not useful any more since C-s can now search in the history).
199 197
2003. PCL-CVS binds 'M-s' to 'cvs-status', and log-edit-mode binds it to 1982. PCL-CVS binds 'M-s' to 'cvs-status', and log-edit-mode binds it to
201 'log-edit-comment-search-forward'. Perhaps search commands 199 'log-edit-comment-search-forward'. Perhaps search commands
202 on the global key binding 'M-s' are useless in these modes. 200 on the global key binding 'M-s' are useless in these modes.
203 201
2044. Rmail binds '\es' to 'rmail-search'/'rmail-summary-search'. 2023. Rmail binds '\es' to 'rmail-search'/'rmail-summary-search'.
205 203
206 204
207* DOCUMENTATION 205* DOCUMENTATION
diff --git a/configure.ac b/configure.ac
index 4b8497b5969..0582b2f61c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,6 +219,21 @@ AC_DEFUN([OPTION_DEFAULT_OFF], [dnl
219 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl 219 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=no])dnl
220])dnl 220])dnl
221 221
222dnl OPTION_DEFAULT_IFAVAILABLE(NAME, HELP-STRING)
223dnl Create a new --with option that defaults to 'ifavailable'.
224dnl NAME is the base name of the option. The shell variable with_NAME
225dnl will be set to either the user's value (if the option is
226dnl specified; 'yes' for a plain --with-NAME) or to 'ifavailable' (if the
227dnl option is not specified). Note that the shell variable name is
228dnl constructed as autoconf does, by replacing non-alphanumeric
229dnl characters with "_".
230dnl HELP-STRING is the help text for the option.
231AC_DEFUN([OPTION_DEFAULT_IFAVAILABLE], [dnl
232 AC_ARG_WITH([$1],[AS_HELP_STRING([--with-$1],[$2])],[],[dnl
233 m4_bpatsubst([with_$1], [[^0-9a-z]], [_])=ifavailable])dnl
234])dnl
235
236
222dnl OPTION_DEFAULT_ON(NAME, HELP-STRING) 237dnl OPTION_DEFAULT_ON(NAME, HELP-STRING)
223dnl Create a new --with option that defaults to $with_features. 238dnl Create a new --with option that defaults to $with_features.
224dnl NAME is the base name of the option. The shell variable with_NAME 239dnl NAME is the base name of the option. The shell variable with_NAME
@@ -438,7 +453,7 @@ OPTION_DEFAULT_ON([cairo],[don't compile with Cairo drawing])
438OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support]) 453OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])
439OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support]) 454OPTION_DEFAULT_OFF([imagemagick],[compile with ImageMagick image support])
440OPTION_DEFAULT_ON([native-image-api], [don't use native image APIs (GDI+ on Windows)]) 455OPTION_DEFAULT_ON([native-image-api], [don't use native image APIs (GDI+ on Windows)])
441OPTION_DEFAULT_ON([json], [don't compile with native JSON support]) 456OPTION_DEFAULT_IFAVAILABLE([json], [don't compile with native JSON support])
442 457
443OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts]) 458OPTION_DEFAULT_ON([xft],[don't use XFT for anti aliased fonts])
444OPTION_DEFAULT_ON([harfbuzz],[don't use HarfBuzz for text shaping]) 459OPTION_DEFAULT_ON([harfbuzz],[don't use HarfBuzz for text shaping])
@@ -709,7 +724,7 @@ case "${canonical}" in
709 *-apple-darwin* ) 724 *-apple-darwin* )
710 case "${canonical}" in 725 case "${canonical}" in
711 *-apple-darwin[0-9].*) unported=yes ;; 726 *-apple-darwin[0-9].*) unported=yes ;;
712 i[3456]86-* | x86_64-* ) ;; 727 i[3456]86-* | x86_64-* | arm-* ) ;;
713 * ) unported=yes ;; 728 * ) unported=yes ;;
714 esac 729 esac
715 opsys=darwin 730 opsys=darwin
@@ -1012,7 +1027,10 @@ AS_IF([test $gl_gcc_warnings = no],
1012 [# Use -fanalyzer and related options only if --enable-gcc-warnings, 1027 [# Use -fanalyzer and related options only if --enable-gcc-warnings,
1013 # as they slow GCC considerably. 1028 # as they slow GCC considerably.
1014 nw="$nw -fanalyzer -Wno-analyzer-double-free -Wno-analyzer-malloc-leak" 1029 nw="$nw -fanalyzer -Wno-analyzer-double-free -Wno-analyzer-malloc-leak"
1015 nw="$nw -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free"]) 1030 nw="$nw -Wno-analyzer-null-dereference -Wno-analyzer-use-after-free"
1031 # Use -Wsuggest-attribute=malloc only if --enable-gcc-warnings,
1032 # as it doesn't flag code that is wrong in any way.
1033 nw="$nw -Wsuggest-attribute=malloc"])
1016 1034
1017 nw="$nw -Wcast-align=strict" # Emacs is tricky with pointers. 1035 nw="$nw -Wcast-align=strict" # Emacs is tricky with pointers.
1018 nw="$nw -Wduplicated-branches" # Too many false alarms 1036 nw="$nw -Wduplicated-branches" # Too many false alarms
@@ -2927,7 +2945,7 @@ AC_SUBST(LIBSYSTEMD_CFLAGS)
2927HAVE_JSON=no 2945HAVE_JSON=no
2928JSON_OBJ= 2946JSON_OBJ=
2929 2947
2930if test "${with_json}" = yes; then 2948if test "${with_json}" != no; then
2931 EMACS_CHECK_MODULES([JSON], [jansson >= 2.7], 2949 EMACS_CHECK_MODULES([JSON], [jansson >= 2.7],
2932 [HAVE_JSON=yes], [HAVE_JSON=no]) 2950 [HAVE_JSON=yes], [HAVE_JSON=no])
2933 if test "${HAVE_JSON}" = yes; then 2951 if test "${HAVE_JSON}" = yes; then
@@ -3965,6 +3983,11 @@ case $with_gnutls,$HAVE_GNUTLS in
3965 *) MISSING="$MISSING gnutls" 3983 *) MISSING="$MISSING gnutls"
3966 WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-gnutls=ifavailable";; 3984 WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-gnutls=ifavailable";;
3967esac 3985esac
3986case $with_json,$HAVE_JSON in
3987 no,* | ifavailable,* | *,yes) ;;
3988 *) MISSING="$MISSING json"
3989 WITH_IFAVAILABLE="$WITH_IFAVAILABLE --with-json=ifavailable";;
3990esac
3968if test "X${MISSING}" != X; then 3991if test "X${MISSING}" != X; then
3969 AC_MSG_ERROR([The following required libraries were not found: 3992 AC_MSG_ERROR([The following required libraries were not found:
3970 $MISSING 3993 $MISSING
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index abb385f53d5..0b685fafe9c 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -115,7 +115,7 @@ just like digits. Case is ignored.
115starting with @kbd{C-x 8}. For example, @kbd{C-x 8 [} inserts @t{‘} 115starting with @kbd{C-x 8}. For example, @kbd{C-x 8 [} inserts @t{‘}
116which is Unicode code-point U+2018 @sc{left single quotation mark}, 116which is Unicode code-point U+2018 @sc{left single quotation mark},
117sometimes called a left single ``curved quote'' or ``curly quote''. 117sometimes called a left single ``curved quote'' or ``curly quote''.
118Similarly, @kbd{C-x 8 ]}, @kbd{C-x 8 @{} and @kbd{C-x 8 @}} insert the 118Similarly, @w{@kbd{C-x 8 ]}}, @kbd{C-x 8 @{} and @kbd{C-x 8 @}} insert the
119curved quotes @t{’}, @t{“} and @t{”}, respectively. Also, a working 119curved quotes @t{’}, @t{“} and @t{”}, respectively. Also, a working
120@key{Alt} key acts like @kbd{C-x 8} (unless followed by @key{RET}); 120@key{Alt} key acts like @kbd{C-x 8} (unless followed by @key{RET});
121e.g., @kbd{A-[} acts like @kbd{C-x 8 [} and inserts @t{‘}. To see 121e.g., @kbd{A-[} acts like @kbd{C-x 8 [} and inserts @t{‘}. To see
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index acd7fb13ae1..a512fd14c80 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2605,6 +2605,7 @@ the function or facility is available, like this:
2605(if (fboundp 'blink-cursor-mode) 2605(if (fboundp 'blink-cursor-mode)
2606 (blink-cursor-mode 0)) 2606 (blink-cursor-mode 0))
2607 2607
2608@c FIXME: Find better example since `set-coding-priority' is removed.
2608(if (boundp 'coding-category-utf-8) 2609(if (boundp 'coding-category-utf-8)
2609 (set-coding-priority '(coding-category-utf-8))) 2610 (set-coding-priority '(coding-category-utf-8)))
2610@end example 2611@end example
diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi
index 5046146dda6..6633848716e 100644
--- a/doc/emacs/fixit.texi
+++ b/doc/emacs/fixit.texi
@@ -445,12 +445,14 @@ use @code{flyspell-region} or @code{flyspell-buffer} for that.
445@findex flyspell-correct-word-before-point 445@findex flyspell-correct-word-before-point
446 When Flyspell mode highlights a word as misspelled, you can click on 446 When Flyspell mode highlights a word as misspelled, you can click on
447it with @kbd{mouse-2} (@code{flyspell-correct-word}) to display a menu 447it with @kbd{mouse-2} (@code{flyspell-correct-word}) to display a menu
448of possible corrections and actions. In addition, @kbd{C-.} or 448of possible corrections and actions. If you want this menu on
449@kbd{mouse-3} instead, customize the variable
450@code{flyspell-use-mouse-3-for-menu}. In addition, @kbd{C-.} or
449@kbd{@key{ESC}-@key{TAB}} (@code{flyspell-auto-correct-word}) will 451@kbd{@key{ESC}-@key{TAB}} (@code{flyspell-auto-correct-word}) will
450propose various successive corrections for the word at point, and 452propose various successive corrections for the word at point, and
451@w{@kbd{C-c $}} (@code{flyspell-correct-word-before-point}) will pop up a 453@w{@kbd{C-c $}} (@code{flyspell-correct-word-before-point}) will pop
452menu of possible corrections. Of course, you can always correct the 454up a menu of possible corrections. Of course, you can always correct
453misspelled word by editing it manually in any way you like. 455the misspelled word by editing it manually in any way you like.
454 456
455@findex flyspell-prog-mode 457@findex flyspell-prog-mode
456 Flyspell Prog mode works just like ordinary Flyspell mode, except 458 Flyspell Prog mode works just like ordinary Flyspell mode, except
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index b99d8ab1453..b74887612b9 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -366,9 +366,13 @@ instead of running the @code{mouse-save-then-kill} command, rebind
366@kbd{mouse-3} by adding the following line to your init file 366@kbd{mouse-3} by adding the following line to your init file
367(@pxref{Init Rebinding}): 367(@pxref{Init Rebinding}):
368 368
369@c FIXME: `mouse-popup-menubar-stuff' is obsolete since 23.1.
370@smallexample 369@smallexample
371(global-set-key [mouse-3] 'mouse-popup-menubar-stuff) 370(global-set-key [mouse-3]
371 '(menu-item "Menu Bar" ignore
372 :filter (lambda (_)
373 (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0))
374 (mouse-menu-bar-map)
375 (mouse-menu-major-mode-map)))))
372@end smallexample 376@end smallexample
373 377
374@node Mode Line Mouse 378@node Mode Line Mouse
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 43ec2d4e9f2..9f550b49874 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -1793,13 +1793,12 @@ for a buffer to switch and considering only the current project's
1793buffers as candidates for completion. 1793buffers as candidates for completion.
1794 1794
1795@findex project-kill-buffers 1795@findex project-kill-buffers
1796@vindex project-kill-buffers-ignores 1796@vindex project-kill-buffer-conditions
1797 When you finish working on the project, you may wish to kill all the 1797 When you finish working on the project, you may wish to kill all the
1798buffers that belong to the project, to keep your Emacs session 1798buffers that belong to the project, to keep your Emacs session
1799smaller. The command @kbd{C-x p k} (@code{project-kill-buffers}) 1799smaller. The command @kbd{C-x p k} (@code{project-kill-buffers})
1800accomplishes that: it kills all the buffers that belong to the current 1800accomplishes that: it kills all the buffers that belong to the current
1801project, except if @code{project-kill-buffers-ignores} tells 1801project that satisfy any of @code{project-kill-buffer-conditions}.
1802otherwise.
1803 1802
1804@node Switching Projects 1803@node Switching Projects
1805@subsection Switching Projects 1804@subsection Switching Projects
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index 55e41e38cb7..54f046a7e05 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -518,6 +518,13 @@ between @samp{foo} and @samp{bar}, that matches
518@samp{@var{a}foo@var{b}bar@var{c}}, where @var{a}, @var{b}, and 518@samp{@var{a}foo@var{b}bar@var{c}}, where @var{a}, @var{b}, and
519@var{c} can be any string including the empty string. 519@var{c} can be any string including the empty string.
520 520
521@item flex
522@cindex @code{flex}, completion style
523This aggressive completion style, also known as @code{flx} or
524@code{fuzzy} or @code{scatter} completion, attempts to complete using
525in-order substrings. For example, it can consider @samp{foo} to match
526@samp{frodo} or @samp{fbarbazoo}.
527
521@item initials 528@item initials
522@cindex @code{initials}, completion style 529@cindex @code{initials}, completion style
523This very aggressive completion style attempts to complete acronyms 530This very aggressive completion style attempts to complete acronyms
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index f3c9d769810..317a1979e9d 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -245,13 +245,13 @@ Do an incremental search on the selected article buffer
245(@code{gnus-summary-isearch-article}), as if you switched to the 245(@code{gnus-summary-isearch-article}), as if you switched to the
246buffer and typed @kbd{C-s} (@pxref{Incremental Search}). 246buffer and typed @kbd{C-s} (@pxref{Incremental Search}).
247 247
248@kindex M-s @r{(Gnus Summary mode)} 248@kindex M-s M-s @r{(Gnus Summary mode)}
249@findex gnus-summary-search-article-forward 249@findex gnus-summary-search-article-forward
250@item M-s @var{regexp} @key{RET} 250@item M-s @var{regexp} @key{RET}
251Search forward for articles containing a match for @var{regexp} 251Search forward for articles containing a match for @var{regexp}
252(@code{gnus-summary-search-article-forward}). 252(@code{gnus-summary-search-article-forward}).
253 253
254@kindex M-r @r{(Gnus Summary mode)} 254@kindex M-s M-r @r{(Gnus Summary mode)}
255@findex gnus-summary-search-article-backward 255@findex gnus-summary-search-article-backward
256@item M-r @var{regexp} @key{RET} 256@item M-r @var{regexp} @key{RET}
257Search back for articles containing a match for @var{regexp} 257Search back for articles containing a match for @var{regexp}
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index d25f0093618..25f657404f3 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -1845,6 +1845,13 @@ is, after a prefix key---then Emacs reorders the events so that this
1845event comes either before or after the multi-event key sequence, not 1845event comes either before or after the multi-event key sequence, not
1846within it. 1846within it.
1847 1847
1848 Some of these special events, such as @code{delete-frame}, invoke
1849Emacs commands by default; others are not bound. If you want to
1850arrange for a special event to invoke a command, you can do that via
1851@code{special-event-map}. The command you bind to a function key in
1852that map can then examine the full event which invoked it in
1853@code{last-input-event}. @xref{Special Events}.
1854
1848@node Event Examples 1855@node Event Examples
1849@subsection Event Examples 1856@subsection Event Examples
1850 1857
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index bc8ec0ef1b0..2898cb4d2b4 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -267,7 +267,8 @@ reason functions are defined to start with @code{lambda} is so that
267other lists, intended for other uses, will not accidentally be valid as 267other lists, intended for other uses, will not accidentally be valid as
268functions. 268functions.
269 269
270 The second element is a list of symbols---the argument variable names. 270 The second element is a list of symbols---the argument variable
271names (@pxref{Argument List}).
271This is called the @dfn{lambda list}. When a Lisp function is called, 272This is called the @dfn{lambda list}. When a Lisp function is called,
272the argument values are matched up against the variables in the lambda 273the argument values are matched up against the variables in the lambda
273list, which are given local bindings with the values provided. 274list, which are given local bindings with the values provided.
@@ -342,7 +343,7 @@ stored as symbol function definitions to produce named functions
342(@pxref{Function Names}). 343(@pxref{Function Names}).
343 344
344@node Argument List 345@node Argument List
345@subsection Other Features of Argument Lists 346@subsection Features of Argument Lists
346@kindex wrong-number-of-arguments 347@kindex wrong-number-of-arguments
347@cindex argument binding 348@cindex argument binding
348@cindex binding arguments 349@cindex binding arguments
@@ -583,8 +584,8 @@ a function.
583@defmac defun name args [doc] [declare] [interactive] body@dots{} 584@defmac defun name args [doc] [declare] [interactive] body@dots{}
584@code{defun} is the usual way to define new Lisp functions. It 585@code{defun} is the usual way to define new Lisp functions. It
585defines the symbol @var{name} as a function with argument list 586defines the symbol @var{name} as a function with argument list
586@var{args} and body forms given by @var{body}. Neither @var{name} nor 587@var{args} (@pxref{Argument List}) and body forms given by @var{body}.
587@var{args} should be quoted. 588Neither @var{name} nor @var{args} should be quoted.
588 589
589@var{doc}, if present, should be a string specifying the function's 590@var{doc}, if present, should be a string specifying the function's
590documentation string (@pxref{Function Documentation}). @var{declare}, 591documentation string (@pxref{Function Documentation}). @var{declare},
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index c8a12bdd66b..b6242c539b7 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -342,7 +342,7 @@ this choice, the rest of the regexp matches successfully.
342long time, if they lead to ambiguous matching. For 342long time, if they lead to ambiguous matching. For
343example, trying to match the regular expression @samp{\(x+y*\)*a} 343example, trying to match the regular expression @samp{\(x+y*\)*a}
344against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could 344against the string @samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz} could
345take hours before it ultimately fails. Emacs must try each way of 345take hours before it ultimately fails. Emacs may try each way of
346grouping the @samp{x}s before concluding that none of them can work. 346grouping the @samp{x}s before concluding that none of them can work.
347In general, avoid expressions that can match the same string in 347In general, avoid expressions that can match the same string in
348multiple ways. 348multiple ways.
diff --git a/doc/lispref/sequences.texi b/doc/lispref/sequences.texi
index 91c3049f875..ca52369bd0c 100644
--- a/doc/lispref/sequences.texi
+++ b/doc/lispref/sequences.texi
@@ -791,11 +791,11 @@ use instead of the default @code{equal}.
791 791
792@example 792@example
793@group 793@group
794(seq-contains '(symbol1 symbol2) 'symbol1) 794(seq-contains-p '(symbol1 symbol2) 'symbol1)
795@result{} symbol1 795@result{} t
796@end group 796@end group
797@group 797@group
798(seq-contains '(symbol1 symbol2) 'symbol3) 798(seq-contains-p '(symbol1 symbol2) 'symbol3)
799@result{} nil 799@result{} nil
800@end group 800@end group
801@end example 801@end example
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 6292054d306..1826e8f7b42 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -956,7 +956,7 @@ multiple sub-sections. Even though that was the only recommended
956approach for a long time, many people have chosen to use multiple 956approach for a long time, many people have chosen to use multiple
957top-level code sections instead. You may chose either style. 957top-level code sections instead. You may chose either style.
958 958
959Using multiple top-level code sections has the advanatage that it 959Using multiple top-level code sections has the advantage that it
960avoids introducing an additional nesting level but it also means that 960avoids introducing an additional nesting level but it also means that
961the section named @samp{Code} does not contain all the code, which is 961the section named @samp{Code} does not contain all the code, which is
962awkward. To avoid that, you should put no code at all inside that 962awkward. To avoid that, you should put no code at all inside that
diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi
index 82467048a08..3c1244101f4 100644
--- a/doc/misc/efaq.texi
+++ b/doc/misc/efaq.texi
@@ -3464,7 +3464,6 @@ see @ref{Packages that do not come with Emacs}.
3464@cindex Finding other packages 3464@cindex Finding other packages
3465@cindex Lisp packages that do not come with Emacs 3465@cindex Lisp packages that do not come with Emacs
3466@cindex Packages, those that do not come with Emacs 3466@cindex Packages, those that do not come with Emacs
3467@cindex Emacs Lisp List
3468@cindex Emacs Lisp Archive 3467@cindex Emacs Lisp Archive
3469 3468
3470The easiest way to add more features to your Emacs is to use the 3469The easiest way to add more features to your Emacs is to use the
@@ -3500,10 +3499,6 @@ The @uref{https://emacswiki.org, Emacs Wiki} contains pointers to some
3500additional extensions. @uref{https://wikemacs.org, WikEmacs} is an 3499additional extensions. @uref{https://wikemacs.org, WikEmacs} is an
3501alternative wiki for Emacs. 3500alternative wiki for Emacs.
3502 3501
3503@uref{http://www.damtp.cam.ac.uk/user/sje30/emacs/ell.html, The Emacs
3504Lisp List (ELL)}, has pointers to many Emacs Lisp files, but at time
3505of writing it is no longer being updated.
3506
3507It is impossible for us to list here all the sites that offer Emacs 3502It is impossible for us to list here all the sites that offer Emacs
3508Lisp packages. If you are interested in a specific feature, then 3503Lisp packages. If you are interested in a specific feature, then
3509after checking Emacs itself and GNU ELPA, a web search is often the 3504after checking Emacs itself and GNU ELPA, a web search is often the
@@ -4192,7 +4187,7 @@ You can get the old behavior by binding @kbd{SPC} to
4192(define-key minibuffer-local-filename-completion-map (kbd "SPC") 4187(define-key minibuffer-local-filename-completion-map (kbd "SPC")
4193 'minibuffer-complete-word) 4188 'minibuffer-complete-word)
4194 4189
4195(define-key minibuffer-local-must-match-filename-map (kbd "SPC") 4190(define-key minibuffer-local-filename-must-match-map (kbd "SPC")
4196 'minibuffer-complete-word) 4191 'minibuffer-complete-word)
4197@end lisp 4192@end lisp
4198 4193
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 584c54674dd..332926a6859 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -11029,14 +11029,14 @@ Go to the Gnus info node (@code{gnus-info-find-node}).
11029 11029
11030@table @kbd 11030@table @kbd
11031 11031
11032@item M-s 11032@item M-s M-s
11033@kindex M-s @r{(Summary)} 11033@kindex M-s M-s @r{(Summary)}
11034@findex gnus-summary-search-article-forward 11034@findex gnus-summary-search-article-forward
11035Search through all subsequent (raw) articles for a regexp 11035Search through all subsequent (raw) articles for a regexp
11036(@code{gnus-summary-search-article-forward}). 11036(@code{gnus-summary-search-article-forward}).
11037 11037
11038@item M-r 11038@item M-s M-r
11039@kindex M-r @r{(Summary)} 11039@kindex M-s M-r @r{(Summary)}
11040@findex gnus-summary-search-article-backward 11040@findex gnus-summary-search-article-backward
11041Search through all previous (raw) articles for a regexp 11041Search through all previous (raw) articles for a regexp
11042(@code{gnus-summary-search-article-backward}). 11042(@code{gnus-summary-search-article-backward}).
diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index 204a6386e01..55b166eb8b0 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -1265,7 +1265,7 @@ for a long time. For more details, see
1265To use this in Message, say: 1265To use this in Message, say:
1266 1266
1267@lisp 1267@lisp
1268(add-hook 'message-send-hook 'message-add-openpgp-header) 1268(add-hook 'message-header-setup-hook 'message-add-openpgp-header)
1269@end lisp 1269@end lisp
1270 1270
1271@noindent 1271@noindent
diff --git a/doc/misc/url.texi b/doc/misc/url.texi
index 8d9b1024070..0304ff4b9f1 100644
--- a/doc/misc/url.texi
+++ b/doc/misc/url.texi
@@ -1312,8 +1312,6 @@ repeated visits do not require repeated domain lookups.
1312@end defopt 1312@end defopt
1313@defopt url-max-password-attempts 1313@defopt url-max-password-attempts
1314@end defopt 1314@end defopt
1315@defopt url-temporary-directory
1316@end defopt
1317@defopt url-show-status 1315@defopt url-show-status
1318@end defopt 1316@end defopt
1319@defopt url-confirmation-func 1317@defopt url-confirmation-func
diff --git a/etc/HISTORY b/etc/HISTORY
index f0fd7d6f218..a6b9f57814f 100644
--- a/etc/HISTORY
+++ b/etc/HISTORY
@@ -220,7 +220,7 @@ GNU Emacs 26.2 (2019-04-12) emacs-26.2
220 220
221GNU Emacs 26.3 (2019-08-28) emacs-26.3 221GNU Emacs 26.3 (2019-08-28) emacs-26.3
222 222
223GNU Emacs 27.1 (2020-08-06) emacs-27.1 223GNU Emacs 27.1 (2020-08-10) emacs-27.1
224 224
225 225
226---------------------------------------------------------------------- 226----------------------------------------------------------------------
diff --git a/etc/NEWS b/etc/NEWS
index 2be9743a454..34d078b485f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -199,7 +199,7 @@ and variables.
199displayed and which are kept hidden. 199displayed and which are kept hidden.
200 200
201--- 201---
202*** New command bound to 'C': 'archive-copy-file' 202*** New command bound to 'C': 'archive-copy-file'.
203This command extracts the file under point and writes the data to a 203This command extracts the file under point and writes the data to a
204file. 204file.
205 205
@@ -216,16 +216,16 @@ as a data list rather than as a piece of code.
216 216
217+++ 217+++
218*** New user option 'calendar-time-zone-style'. 218*** New user option 'calendar-time-zone-style'.
219If 'numeric, calendar functions (eg calendar-sunrise-sunset) that display 219If 'numeric', calendar functions (eg 'calendar-sunrise-sunset') that display
220time zones will use a form like "+0100" instead of "CET". 220time zones will use a form like "+0100" instead of "CET".
221 221
222** Dired 222** Dired
223 223
224+++ 224+++
225*** New user option 'dired-copy-dereference'. 225*** New user option 'dired-copy-dereference'.
226If set, Dired will dereferences symbolic links when copying. This can 226If set to non-nil, Dired will dereference symbolic links when copying.
227be switched off on a per-usage basis by providing 'dired-do-copy' with 227This can be switched off on a per-usage basis by providing
228a 'C-u' prefix. 228'dired-do-copy' with a 'C-u' prefix.
229 229
230*** New user option 'dired-mark-region' affects all Dired commands 230*** New user option 'dired-mark-region' affects all Dired commands
231that mark files. When non-nil and the region is active in Transient 231that mark files. When non-nil and the region is active in Transient
@@ -259,9 +259,20 @@ invoke 'C-u C-x v s' ('vc-create-tag').
259--- 259---
260*** 'vc-hg' now uses 'hg summary' to populate extra 'vc-dir' headers. 260*** 'vc-hg' now uses 'hg summary' to populate extra 'vc-dir' headers.
261 261
262---
263*** New variable 'vc-git-revision-complete-only-branches'
264If non-nil, only branches and remotes are considered when doing
265completion over branch names.
262 266
263** Gnus 267** Gnus
264 268
269+++
270*** The key binding of 'gnus-summary-search-article-forward' has changed.
271This command was previously on 'M-s' and shadowed the global 'M-s'
272search prefix. The command has now been moved to 'M-s M-s'. (For
273consistency, the 'M-s M-r' key binding has been added for the
274'gnus-summary-search-article-backward' command.)
275
265--- 276---
266*** The value of "all" in the 'large-newsgroup-initial' group parameter changes. 277*** The value of "all" in the 'large-newsgroup-initial' group parameter changes.
267It was previously nil, which didn't work, because nil is 278It was previously nil, which didn't work, because nil is
@@ -293,23 +304,23 @@ To generate these headers, add the new function
293be generated according to the new 'message-openpgp-header' variable. 304be generated according to the new 'message-openpgp-header' variable.
294 305
295--- 306---
296*** A change to how Mail-Copies-To: never is handled. 307*** A change to how "Mail-Copies-To: never" is handled.
297If a user has specified Mail-Copies-To: never, and Message was asked 308If a user has specified "Mail-Copies-To: never", and Message was asked
298to do a "wide reply", some other arbitrary recipient would end up in 309to do a "wide reply", some other arbitrary recipient would end up in
299the resulting To header, while the remaining recipients would be put 310the resulting "To" header, while the remaining recipients would be put
300in the Cc header. This is somewhat misleading, as it looks like 311in the "Cc" header. This is somewhat misleading, as it looks like
301you're responding to a specific person in particular. This has been 312you're responding to a specific person in particular. This has been
302changed so that all the recipients are put in the To header in these 313changed so that all the recipients are put in the "To" header in these
303instances. 314instances.
304 315
305+++ 316+++
306*** New function to start Emacs in Message mode to send an email. 317*** New function to start Emacs in Message mode to send an email.
307Emacs can be defined as a handler for the "x-scheme-handler/mailto" 318Emacs can be defined as a handler for the "x-scheme-handler/mailto"
308MIME type with the following command: "emacs -f message-mailto %u". 319MIME type with the following command: "emacs -f message-mailto %u".
309An emacs-mail.desktop file has been included, suitable for installing 320An "emacs-mail.desktop" file has been included, suitable for
310in desktop directories like /usr/share/applications. Clicking on a 321installing in desktop directories like "/usr/share/applications".
311mailto: link in other applications will then open Emacs with headers 322Clicking on a 'mailto:' link in other applications will then open
312filled out according to the link, e.g. 323Emacs with headers filled out according to the link, e.g.
313"mailto:larsi@gnus.org?subject=This+is+a+test". 324"mailto:larsi@gnus.org?subject=This+is+a+test".
314 325
315--- 326---
@@ -324,7 +335,7 @@ this user option.
324*** New command to take screenshots. 335*** New command to take screenshots.
325In Message mode buffers, the 'C-c C-p' ('message-insert-screenshot') 336In Message mode buffers, the 'C-c C-p' ('message-insert-screenshot')
326command has been added. It depends on using an external program to 337command has been added. It depends on using an external program to
327take the actual screenshot, and defaults to ImageMagick "import". 338take the actual screenshot, and defaults to "ImageMagick import".
328 339
329** Help 340** Help
330 341
@@ -345,7 +356,7 @@ This file was a compatibility kludge which is no longer needed.
345 356
346--- 357---
347** Lisp mode now uses 'common-lisp-indent-function'. 358** Lisp mode now uses 'common-lisp-indent-function'.
348To revert to the previous behaviour, 359To revert to the previous behavior,
349'(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'. 360'(setq lisp-indent-function 'lisp-indent-function)' from 'lisp-mode-hook'.
350 361
351** Edebug 362** Edebug
@@ -491,7 +502,7 @@ Defaults to 'libravatar', with 'unicornify' and 'gravatar' as options.
491 502
492*** Regexp matching of messages is now case-sensitive by default. 503*** Regexp matching of messages is now case-sensitive by default.
493The variable 'compilation-error-case-fold-search' can be set for 504The variable 'compilation-error-case-fold-search' can be set for
494case-insensitive matching of messages when the old behaviour is 505case-insensitive matching of messages when the old behavior is
495required, but the recommended solution is to use a correctly matching 506required, but the recommended solution is to use a correctly matching
496regexp instead. 507regexp instead.
497 508
@@ -523,10 +534,10 @@ This is used when invoking 'texi2dvi' from 'texinfo-tex-buffer'.
523 534
524--- 535---
525*** New commands for moving in and between environments. 536*** New commands for moving in and between environments.
526An "environment" is something that ends with @end. The commands are 537An "environment" is something that ends with '@end'. The commands are
527'C-c C-c C-f' (next end), 'C-c C-c C-b' (previous end), 538'C-c C-c C-f' (next end), 'C-c C-c C-b' (previous end),
528'C-c C-c C-n' (next start) and 'C-c C-c C-p' (previous start), as well 539'C-c C-c C-n' (next start) and 'C-c C-c C-p' (previous start), as well
529as 'C-c .', which will alternate between the start end the end of the 540as 'C-c .', which will alternate between the start and the end of the
530current environment. 541current environment.
531 542
532** Rmail 543** Rmail
@@ -650,8 +661,8 @@ mode buffer.
650+++ 661+++
651*** New Emacs command line convenience function. 662*** New Emacs command line convenience function.
652The 'eww-browse' command has been added, which allows you to register 663The 'eww-browse' command has been added, which allows you to register
653Emacs as a MIME handler for "text/x-uri", and will call eww on the 664Emacs as a MIME handler for "text/x-uri", and will call 'eww' on the
654supplied URL. Usage example: emacs -f eww-browse https://gnu.org 665supplied URL. Usage example: "emacs -f eww-browse https://gnu.org".
655 666
656+++ 667+++
657*** 'eww-download-directory' will now use the XDG location, if defined. 668*** 'eww-download-directory' will now use the XDG location, if defined.
@@ -714,13 +725,25 @@ https://www.w3.org/TR/xml/#charsets). Now it rejects such strings.
714** erc 725** erc
715 726
716--- 727---
717*** The /ignore command will now ask for a timeout to stop ignoring the user. 728*** The '/ignore' command will now ask for a timeout to stop ignoring the user.
718Allowed inputs are seconds or ISO8601-like periods like "1h" or "4h30m". 729Allowed inputs are seconds or ISO8601-like periods like "1h" or "4h30m".
719 730
720--- 731---
721*** ERC now recognizes C-] for italic text. 732*** ERC now recognizes 'C-]' for italic text.
722Italic text is displayed in the new 'erc-italic-face'. 733Italic text is displayed in the new 'erc-italic-face'.
723 734
735---
736*** The erc-compat.el library is now marked obsolete.
737This file contained ERC compatibility code for Emacs 21 and XEmacs
738which is no longer needed.
739
740---
741*** erc-match.el now supports 'message' highlight type (not including the nick).
742The 'erc-current-nick-highlight-type', 'erc-pal-highlight-type',
743'erc-fool-highlight-type', 'erc-keyword-highlight-type', and
744'erc-dangerous-host-highlight-type' variables now support a 'message'
745type for highlighting the entire message but not the sender's nick.
746
724** Battery 747** Battery
725 748
726--- 749---
@@ -771,18 +794,68 @@ The recentf files are no longer backed up.
771** Calc 794** Calc
772 795
773--- 796---
774*** The behaviour when doing forward-delete has been changed. 797*** The behavior when doing forward-delete has been changed.
775Previously, using the 'C-d' command would delete the final number in 798Previously, using the 'C-d' command would delete the final number in
776the input field, no matter where point was. This has been changed to 799the input field, no matter where point was. This has been changed to
777work more traditionally, with 'C-d' deleting the next character. 800work more traditionally, with 'C-d' deleting the next character.
778Likewise, point isn't moved to the end of the string before inserting 801Likewise, point isn't moved to the end of the string before inserting
779digits. 802digits.
780 803
804** term-mode
805
806---
807*** New user option 'term-scroll-snap-to-bottom'.
808By default, 'term' and 'ansi-term' will now recenter the buffer so
809that the prompt is on the final line in the window. Setting this new
810user option to nil inhibits this behavior.
811
812---
813*** New user option 'term-set-terminal-size'
814If non-nil, the 'LINES' and 'COLUMNS' environment variables will be set
815based on the current window size. In previous versions of Emacs, this
816was always done (and that could lead to odd displays when resizing the
817window after starting). This variable defaults to nil.
818
819
781** Miscellaneous 820** Miscellaneous
782 821
783*** The new library hierarchy.el has been added. 822---
784It's a library to create, query, navigate and display hierarchy 823*** 'C-s' in 'M-x' now searches over completions again.
785structures. 824In Emacs 23, typing 'M-x' ('read-extended-command') and then 'C-s' (to
825do an interactive search) would search over possible completions.
826This was lost in Emacs 24, but is now back again.
827
828---
829*** 'M-x report-emacs-bug' will no longer include "Recent messages" section.
830These were taken from the "*Messages*" buffer, and may inadvertently
831leak information from the reporting user.
832
833---
834*** 'count-windows' now takes an optional parameter ALL-FRAMES.
835The semantics are as with 'walk-windows'.
836
837---
838*** Killing virtual ido buffers interactively will make them go away.
839Previously, killing a virtual ido buffer with 'ido-kill-buffer' didn't
840do anything. This has now been changed, and killing virtual buffers
841with that command will remove the buffer from recentf.
842
843---
844*** New variable 'ffap-file-name-with-spaces'.
845If non-nil, 'find-file-at-point' and friends will try to guess more
846expansively to identify a file name with spaces.
847
848---
849*** Two new commands for centering in 'doc-view-mode'.
850The new commands 'doc-view-center-page-horizontally' (bound to 'c h')
851and 'doc-view-center-page-vertically' (bound to 'c v') center the page
852horizontally and vertically, respectively.
853
854---
855*** Change in meaning of 'icomplete-show-matches-on-no-input'.
856Previously, choosing a different completion with commands like 'C-.'
857and then hitting 'RET' would choose the default completion. Doing this
858will now choose the completion under point instead.
786 859
787--- 860---
788*** The width of the buffer-name column in 'list-buffers' is now dynamic. 861*** The width of the buffer-name column in 'list-buffers' is now dynamic.
@@ -791,23 +864,23 @@ wider than the length of the longest buffer name, except that it will
791never be narrower than 19 characters. 864never be narrower than 19 characters.
792 865
793*** Bookmarks can now be targets for new tabs. 866*** Bookmarks can now be targets for new tabs.
794When the 'bookmark.el' library is loaded, a customize choice is added 867When the bookmark.el library is loaded, a customize choice is added
795to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list. 868to 'tab-bar-new-tab-choice' for new tabs to show the bookmark list.
796 869
797 870
798** xwidget-webkit mode 871** xwidget-webkit mode
799 872
800*** New xwidget functions 873*** New xwidget functions.
801'xwidget-webkit-uri' (return the current URL), 'xwidget-webkit-title' 874'xwidget-webkit-uri' (return the current URL), 'xwidget-webkit-title'
802(return the current title), and 'xwidget-webkit-goto-history' (goto a 875(return the current title), and 'xwidget-webkit-goto-history' (goto a
803point in history). 876point in history).
804 877
805*** Pixel-based scrolling 878*** Pixel-based scrolling.
806The 'xwidget-webkit-scroll-up', 'xwidget-webkit-scroll-down' commands 879The 'xwidget-webkit-scroll-up', 'xwidget-webkit-scroll-down' commands
807now supports scrolling arbitrary pixel values. It now treats the 880now supports scrolling arbitrary pixel values. It now treats the
808optional 2nd argument as the pixel values to scroll. 881optional 2nd argument as the pixel values to scroll.
809 882
810*** New commands for scrolling 883*** New commands for scrolling.
811The new commands 'xwidget-webkit-scroll-up-line', 884The new commands 'xwidget-webkit-scroll-up-line',
812'xwidget-webkit-scroll-down-line', 'xwidget-webkit-scroll-forward', 885'xwidget-webkit-scroll-down-line', 'xwidget-webkit-scroll-forward',
813'xwidget-webkit-scroll-backward' can be used to scroll webkit by the 886'xwidget-webkit-scroll-backward' can be used to scroll webkit by the
@@ -817,6 +890,41 @@ height of lines or width of chars.
817When non-nil, use a new xwidget webkit session after bookmark jump. 890When non-nil, use a new xwidget webkit session after bookmark jump.
818Otherwise, it will use 'xwidget-webkit-last-session'. 891Otherwise, it will use 'xwidget-webkit-last-session'.
819 892
893** Flyspell mode
894
895+++
896*** Corrections and actions menu can be optionally bound to 'mouse-3'.
897When Flyspell mode highlights a word as misspelled, you can click on
898it to display a menu of possible corrections and actions. You can now
899easily bind this menu to 'down-mouse-3' (usually the right mouse button)
900instead of 'mouse-2' (the default) by customizing the new user option
901'flyspell-use-mouse-3-for-menu'.
902
903** Time
904
905---
906*** 'display-time-world' has been renamed to 'world-clock'.
907'world-clock' creates a buffer with an updating time display using
908several time zones. It is hoped that the new names are more
909discoverable.
910
911The following functions have been renamed:
912
913 'display-time-world' to 'world-clock'
914 'display-time-world-mode' to 'world-clock-mode'
915 'display-time-world-display' to 'world-clock-display'
916 'display-time-world-timer' to 'world-clock-update'
917
918The following user options have been renamed:
919
920 'display-time-world-list' to 'world-clock-list'
921 'display-time-world-time-format' to 'world-clock-time-format'
922 'display-time-world-buffer-name' to 'world-clock-buffer-name'
923 'display-time-world-timer-enable' to 'world-clock-timer-enable'
924 'display-time-world-timer-second' to 'world-clock-timer-second'
925
926The old names are now obsolete.
927
820 928
821* New Modes and Packages in Emacs 28.1 929* New Modes and Packages in Emacs 28.1
822 930
@@ -827,6 +935,10 @@ composed of Lisp symbolic expressions that do not form a computer
827program. The ".dir-locals.el" file is automatically set to use this 935program. The ".dir-locals.el" file is automatically set to use this
828mode, as are other data files produced by Emacs. 936mode, as are other data files produced by Emacs.
829 937
938** hierarchy.el
939
940It's a library to create, query, navigate and display hierarchy structures.
941
830 942
831* Incompatible Editing Changes in Emacs 28.1 943* Incompatible Editing Changes in Emacs 28.1
832 944
@@ -889,7 +1001,41 @@ have now been removed.
889 1001
890--- 1002---
891** Some libraries obsolete since Emacs 23 have been removed: 1003** Some libraries obsolete since Emacs 23 have been removed:
892'ledit.el', 'lmenu.el', 'lucid.el and 'old-whitespace.el'. 1004ledit.el, lmenu.el, lucid.el and old-whitespace.el.
1005
1006---
1007** Some functions and variables obsolete since Emacs 23 have been removed:
1008
1009'GOLD-map', 'bookmark-jump-noselect',
1010'bookmark-read-annotation-text-func', 'buffer-menu-mode-hook',
1011'char-coding-system-table', 'char-valid-p', 'charset-bytes',
1012'charset-id', 'charset-list' (function), 'complete-in-turn',
1013'completion-common-substring', 'crm-minibuffer-complete',
1014'crm-minibuffer-complete-and-exit', 'crm-minibuffer-completion-help',
1015'custom-mode', 'custom-mode-hook', 'detect-coding-with-priority',
1016'dirtrack-debug' (function), 'dirtrack-debug-toggle',
1017'dynamic-completion-table',
1018'easy-menu-precalculate-equivalent-keybindings',
1019'epa-display-verify-result', 'epg-passphrase-callback-function',
1020'eshell-report-bug', 'ffap-bug', 'ffap-submit-bug', 'forward-point',
1021'generic-char-p', 'global-highlight-changes', 'hi-lock-face-history',
1022'hi-lock-regexp-history', 'highlight-changes-active-string',
1023'highlight-changes-initial-state', 'highlight-changes-passive-string',
1024'ispell-aspell-supports-utf8', 'lisp-mode-auto-fill',
1025'locate-file-completion', 'make-coding-system',
1026'minibuffer-local-must-match-filename-map', 'mouse-major-mode-menu',
1027'mouse-popup-menubar', 'mouse-popup-menubar-stuff',
1028'newsticker-groups-filename', 'non-iso-charset-alist',
1029'nonascii-insert-offset', 'nonascii-translation-table',
1030'password-read-and-add', 'pre-abbrev-expand-hook',
1031'process-filter-multibyte-p', 'remember-buffer' (function),
1032'rmail-message-filter', 'set-coding-priority',
1033'set-process-filter-multibyte', 'shell-dirtrack-toggle',
1034't-mouse-mode', 'tooltip-hook', 'tpu-have-ispell',
1035'url-generate-unique-filename', 'url-temporary-directory',
1036'vc-arch-command', 'vc-default-working-revision' (variable),
1037'vc-mtn-command', 'vc-revert-buffer', 'vc-workfile-version',
1038'vcursor-toggle-vcursor-map', 'w32-focus-frame', 'w32-select-font'.
893 1039
894 1040
895* Lisp Changes in Emacs 28.1 1041* Lisp Changes in Emacs 28.1
@@ -899,6 +1045,12 @@ have now been removed.
899ignore invisible lines. 1045ignore invisible lines.
900 1046
901--- 1047---
1048** 'count-words' now crosses field boundaries.
1049Originally, 'count-words' would stop counting at the first field
1050boundary it encountered; now it keeps counting all the way to the
1051region's (or buffer's) end.
1052
1053---
902** New function 'custom-add-choice'. 1054** New function 'custom-add-choice'.
903This function can be used by modes to add elements to the 1055This function can be used by modes to add elements to the
904'choice' customization type of a variable. 1056'choice' customization type of a variable.
@@ -1039,7 +1191,6 @@ GNU General Public License for more details.
1039You should have received a copy of the GNU General Public License 1191You should have received a copy of the GNU General Public License
1040along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. 1192along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
1041 1193
1042
1043 1194
1044Local variables: 1195Local variables:
1045coding: utf-8 1196coding: utf-8
diff --git a/etc/NEWS.27 b/etc/NEWS.27
index a056f5c1e82..31b69025173 100644
--- a/etc/NEWS.27
+++ b/etc/NEWS.27
@@ -202,10 +202,11 @@ it won't work right without some adjustment:
202 202
203** Emacs now notifies systemd when startup finishes or shutdown begins. 203** Emacs now notifies systemd when startup finishes or shutdown begins.
204Units that are ordered after 'emacs.service' will only be started 204Units that are ordered after 'emacs.service' will only be started
205after Emacs has finished initialization and is ready for use. 205after Emacs has finished initialization and is ready for use, and
206(If your Emacs is installed in a non-standard location and you copied the 206Emacs needs to be built with systemd support. (If your Emacs is
207emacs.service file to e.g. "~/.config/systemd/user/", you will need to copy 207installed in a non-standard location and you copied the emacs.service
208the new version of the file again.) 208file to e.g. "~/.config/systemd/user/", you will need to copy the new
209version of the file again.)
209 210
210 211
211* Changes in Emacs 27.1 212* Changes in Emacs 27.1
@@ -595,7 +596,7 @@ the node "(emacs) Directory Variables" of the user manual.
595 596
596** Network connections using 'local' can now use IPv6. 597** Network connections using 'local' can now use IPv6.
597'make-network-process' now uses the correct loopback address when 598'make-network-process' now uses the correct loopback address when
598asked to use ':host 'local' and ':family 'ipv6'. 599asked to use ":host 'local" and ":family 'ipv6".
599 600
600** The new function 'replace-region-contents' replaces the current 601** The new function 'replace-region-contents' replaces the current
601region using a given replacement-function in a non-destructive manner 602region using a given replacement-function in a non-destructive manner
@@ -1917,6 +1918,11 @@ The value of the new 'sender' slot (if a string) is used to set gpg's
1917'mml-secure-openpgp-sign-with-sender'. See gpg(1) manual page about 1918'mml-secure-openpgp-sign-with-sender'. See gpg(1) manual page about
1918"--sender" for more information. 1919"--sender" for more information.
1919 1920
1921*** 'epg-find-configuration' no longer finds GnuPG 2.0 through 2.1.5.
1922Previously, it found these versions by mistake. The intent was to
1923find GnuPG 2.1.6 or later, or find GnuPG 1.4.3 or later within the
1924GnuPG 1 series.
1925
1920** Rmail 1926** Rmail
1921 1927
1922*** New user option 'rmail-output-reset-deleted-flag'. 1928*** New user option 'rmail-output-reset-deleted-flag'.
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 598a79f978a..f68a183c5d7 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -419,27 +419,6 @@ EMACSLOADPATH overrides which directories the function "load" will search.
419If you observe strange problems, check for this variable in your 419If you observe strange problems, check for this variable in your
420environment. 420environment.
421 421
422*** Using epop3.el package causes Emacs to signal an error.
423
424The error message might be something like this:
425
426 "Lisp nesting exceeds max-lisp-eval-depth"
427
428This happens because epop3 redefines the function gethash, which is a
429built-in primitive beginning with Emacs 21.1. We don't have a patch
430for epop3 to fix it, but perhaps a newer version of epop3 corrects that.
431
432*** Buffers from 'with-output-to-temp-buffer' get set up in Help mode.
433
434Changes in Emacs 20.4 to the hooks used by that function cause
435problems for some packages, specifically BBDB. See the function's
436documentation for the hooks involved. BBDB 2.00.06 fixes the problem.
437
438*** The Hyperbole package causes *Help* buffers not to be displayed in
439Help mode due to setting 'temp-buffer-show-hook' rather than using
440'add-hook'. Using '(add-hook 'temp-buffer-show-hook 'help-mode-finish)'
441after loading Hyperbole should fix this.
442
443** Keyboard problems 422** Keyboard problems
444 423
445*** Unable to enter the M-| key on some German keyboards. 424*** Unable to enter the M-| key on some German keyboards.
@@ -575,13 +554,6 @@ For example, simply moving through a file that contains hundreds of
575thousands of characters per line is slow, and consumes a lot of CPU. 554thousands of characters per line is slow, and consumes a lot of CPU.
576This is a known limitation of Emacs with no solution at this time. 555This is a known limitation of Emacs with no solution at this time.
577 556
578*** Emacs uses 100% of CPU time
579
580This was a known problem with some old versions of the Semantic package.
581The solution was to upgrade Semantic to version 2.0pre4 (distributed
582with CEDET 1.0pre4) or later. Note that Emacs includes Semantic since
58323.2, and this issue does not apply to the included version.
584
585*** Display artifacts on GUI frames on X-based systems. 557*** Display artifacts on GUI frames on X-based systems.
586 558
587This is known to be caused by using double-buffering (which is enabled 559This is known to be caused by using double-buffering (which is enabled
@@ -1952,11 +1924,6 @@ A few versions of the Linux kernel have timer bugs that break CPU
1952profiling; see Bug#34235. To fix the problem, upgrade to one of the 1924profiling; see Bug#34235. To fix the problem, upgrade to one of the
1953kernel versions 4.14.97, 4.19.19, or 4.20.6, or later. 1925kernel versions 4.14.97, 4.19.19, or 4.20.6, or later.
1954 1926
1955*** GNU/Linux: Process output is corrupted.
1956
1957There is a bug in Linux kernel 2.6.10 PTYs that can cause emacs to
1958read corrupted process output.
1959
1960*** GNU/Linux: Remote access to CVS with SSH causes file corruption. 1927*** GNU/Linux: Remote access to CVS with SSH causes file corruption.
1961 1928
1962If you access a remote CVS repository via SSH, files may be corrupted 1929If you access a remote CVS repository via SSH, files may be corrupted
@@ -2740,11 +2707,6 @@ library on these systems. The solution is to reconfigure Emacs while
2740disabling all the features that require libgio: rsvg, dbus, gconf, and 2707disabling all the features that require libgio: rsvg, dbus, gconf, and
2741imagemagick. 2708imagemagick.
2742 2709
2743*** Building Emacs for Cygwin can fail with GCC 3
2744
2745As of Emacs 22.1, there have been stability problems with Cygwin
2746builds of Emacs using GCC 3. Cygwin users are advised to use GCC 4.
2747
2748*** Building Emacs 23.3 and later will fail under Cygwin 1.5.19 2710*** Building Emacs 23.3 and later will fail under Cygwin 1.5.19
2749 2711
2750This is a consequence of a change to src/dired.c on 2010-07-27. The 2712This is a consequence of a change to src/dired.c on 2010-07-27. The
diff --git a/lib/c++defs.h b/lib/c++defs.h
index 90e6fd62e6d..6a9bf295eb5 100644
--- a/lib/c++defs.h
+++ b/lib/c++defs.h
@@ -146,6 +146,16 @@
146 _GL_EXTERN_C int _gl_cxxalias_dummy 146 _GL_EXTERN_C int _gl_cxxalias_dummy
147#endif 147#endif
148 148
149/* _GL_CXXALIAS_MDA (func, rettype, parameters);
150 is to be used when func is a Microsoft deprecated alias, on native Windows.
151 It declares a C++ alias called GNULIB_NAMESPACE::func
152 that redirects to _func, if GNULIB_NAMESPACE is defined.
153 Example:
154 _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
155 */
156#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
157 _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
158
149/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); 159/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
150 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); 160 is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
151 except that the C function rpl_func may have a slightly different 161 except that the C function rpl_func may have a slightly different
diff --git a/lib/canonicalize-lgpl.c b/lib/canonicalize-lgpl.c
index 9f990988393..0b89d2a1842 100644
--- a/lib/canonicalize-lgpl.c
+++ b/lib/canonicalize-lgpl.c
@@ -52,7 +52,9 @@
52# include "pathmax.h" 52# include "pathmax.h"
53# include "malloca.h" 53# include "malloca.h"
54# include "filename.h" 54# include "filename.h"
55# if HAVE_GETCWD 55# if defined _WIN32 && !defined __CYGWIN__
56# define __getcwd _getcwd
57# elif HAVE_GETCWD
56# if IN_RELOCWRAPPER 58# if IN_RELOCWRAPPER
57 /* When building the relocatable program wrapper, use the system's getcwd 59 /* When building the relocatable program wrapper, use the system's getcwd
58 function, not the gnulib override, otherwise we would get a link error. 60 function, not the gnulib override, otherwise we would get a link error.
diff --git a/lib/cdefs.h b/lib/cdefs.h
index 4f89f4e4bf0..b1870fd0a93 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -85,7 +85,7 @@
85# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct 85# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
86# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct 86# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
87# else 87# else
88# if defined __cplusplus && __GNUC_PREREQ (2,8) 88# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
89# define __THROW throw () 89# define __THROW throw ()
90# define __THROWNL throw () 90# define __THROWNL throw ()
91# define __NTH(fct) __LEAF_ATTR fct throw () 91# define __NTH(fct) __LEAF_ATTR fct throw ()
@@ -148,7 +148,7 @@
148# define __warnattr(msg) __attribute__((__warning__ (msg))) 148# define __warnattr(msg) __attribute__((__warning__ (msg)))
149# define __errordecl(name, msg) \ 149# define __errordecl(name, msg) \
150 extern void name (void) __attribute__((__error__ (msg))) 150 extern void name (void) __attribute__((__error__ (msg)))
151#elif __glibc_clang_has_attribute (__diagnose_if__) 151#elif __glibc_clang_has_attribute (__diagnose_if__) && 0 /* fails on Fedora 31 with Clang 9. */
152# define __warndecl(name, msg) \ 152# define __warndecl(name, msg) \
153 extern void name (void) __attribute__((__diagnose_if__ (1, msg, "warning"))) 153 extern void name (void) __attribute__((__diagnose_if__ (1, msg, "warning")))
154# define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning"))) 154# define __warnattr(msg) __attribute__((__diagnose_if__ (1, msg, "warning")))
@@ -194,7 +194,7 @@
194 Example: 194 Example:
195 int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ 195 int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
196 196
197#if defined __GNUC__ && __GNUC__ >= 2 197#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
198 198
199# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) 199# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
200# ifdef __cplusplus 200# ifdef __cplusplus
@@ -465,7 +465,8 @@
465 465
466#if (!defined _Static_assert && !defined __cplusplus \ 466#if (!defined _Static_assert && !defined __cplusplus \
467 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ 467 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
468 && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) 468 && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \
469 || defined __STRICT_ANSI__))
469# define _Static_assert(expr, diagnostic) \ 470# define _Static_assert(expr, diagnostic) \
470 extern int (*__Static_assert_function (void)) \ 471 extern int (*__Static_assert_function (void)) \
471 [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] 472 [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
diff --git a/lib/dup2.c b/lib/dup2.c
index 9bc3951f3d2..323e19b25ec 100644
--- a/lib/dup2.c
+++ b/lib/dup2.c
@@ -52,7 +52,7 @@ dup2_nothrow (int fd, int desired_fd)
52 52
53 TRY_MSVC_INVAL 53 TRY_MSVC_INVAL
54 { 54 {
55 result = dup2 (fd, desired_fd); 55 result = _dup2 (fd, desired_fd);
56 } 56 }
57 CATCH_MSVC_INVAL 57 CATCH_MSVC_INVAL
58 { 58 {
@@ -64,7 +64,7 @@ dup2_nothrow (int fd, int desired_fd)
64 return result; 64 return result;
65} 65}
66# else 66# else
67# define dup2_nothrow dup2 67# define dup2_nothrow _dup2
68# endif 68# endif
69 69
70static int 70static int
diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h
index 0a21c957baf..6f16bc66921 100644
--- a/lib/fcntl.in.h
+++ b/lib/fcntl.in.h
@@ -97,6 +97,12 @@
97_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode) 97_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
98 _GL_ARG_NONNULL ((1))); 98 _GL_ARG_NONNULL ((1)));
99_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode)); 99_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
100# elif defined _WIN32 && !defined __CYGWIN__
101# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
102# undef creat
103# define creat _creat
104# endif
105_GL_CXXALIAS_MDA (creat, int, (const char *filename, mode_t mode));
100# else 106# else
101_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode)); 107_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
102# endif 108# endif
@@ -106,6 +112,9 @@ _GL_CXXALIASWARN (creat);
106/* Assume creat is always declared. */ 112/* Assume creat is always declared. */
107_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - " 113_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
108 "use gnulib module creat for portability"); 114 "use gnulib module creat for portability");
115#elif defined _WIN32 && !defined __CYGWIN__
116# undef creat
117# define creat _creat
109#endif 118#endif
110 119
111#if @GNULIB_FCNTL@ 120#if @GNULIB_FCNTL@
@@ -146,6 +155,12 @@ _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
146_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) 155_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
147 _GL_ARG_NONNULL ((1))); 156 _GL_ARG_NONNULL ((1)));
148_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); 157_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
158# elif defined _WIN32 && !defined __CYGWIN__
159# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
160# undef open
161# define open _open
162# endif
163_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
149# else 164# else
150_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); 165_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
151# endif 166# endif
@@ -159,6 +174,9 @@ _GL_CXXALIASWARN (open);
159/* Assume open is always declared. */ 174/* Assume open is always declared. */
160_GL_WARN_ON_USE (open, "open is not always POSIX compliant - " 175_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
161 "use gnulib module open for portability"); 176 "use gnulib module open for portability");
177#elif defined _WIN32 && !defined __CYGWIN__
178# undef open
179# define open _open
162#endif 180#endif
163 181
164#if @GNULIB_OPENAT@ 182#if @GNULIB_OPENAT@
diff --git a/lib/getopt-cdefs.in.h b/lib/getopt-cdefs.in.h
index c510ab163c3..674838c666a 100644
--- a/lib/getopt-cdefs.in.h
+++ b/lib/getopt-cdefs.in.h
@@ -57,7 +57,7 @@
57#endif 57#endif
58 58
59#ifndef __THROW 59#ifndef __THROW
60# if defined __cplusplus && __GNUC_PREREQ (2,8) 60# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
61# define __THROW throw () 61# define __THROW throw ()
62# else 62# else
63# define __THROW 63# define __THROW
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 92d0621c61a..7b4fc74219f 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -682,7 +682,6 @@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
682HAVE_TIMEGM = @HAVE_TIMEGM@ 682HAVE_TIMEGM = @HAVE_TIMEGM@
683HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ 683HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
684HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@ 684HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
685HAVE_TZSET = @HAVE_TZSET@
686HAVE_UNISTD_H = @HAVE_UNISTD_H@ 685HAVE_UNISTD_H = @HAVE_UNISTD_H@
687HAVE_UNLINKAT = @HAVE_UNLINKAT@ 686HAVE_UNLINKAT = @HAVE_UNLINKAT@
688HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ 687HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
@@ -1159,7 +1158,7 @@ ifeq (,$(OMIT_GNULIB_MODULE_absolute-header))
1159# Use this preprocessor expression to decide whether #include_next works. 1158# Use this preprocessor expression to decide whether #include_next works.
1160# Do not rely on a 'configure'-time test for this, since the expression 1159# Do not rely on a 'configure'-time test for this, since the expression
1161# might appear in an installed header, which is used by some other compiler. 1160# might appear in an installed header, which is used by some other compiler.
1162HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER) 1161HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
1163 1162
1164endif 1163endif
1165## end gnulib module absolute-header 1164## end gnulib module absolute-header
@@ -3185,7 +3184,6 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
3185 -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ 3184 -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
3186 -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ 3185 -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
3187 -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ 3186 -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
3188 -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \
3189 -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ 3187 -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
3190 -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ 3188 -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
3191 -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ 3189 -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
diff --git a/lib/intprops.h b/lib/intprops.h
index 220f532e499..f2f70b3e733 100644
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -396,7 +396,7 @@
396 For now, assume all versions of GCC-like compilers generate bogus 396 For now, assume all versions of GCC-like compilers generate bogus
397 warnings for _Generic. This matters only for compilers that 397 warnings for _Generic. This matters only for compilers that
398 lack relevant builtins. */ 398 lack relevant builtins. */
399#if __GNUC__ 399#if __GNUC__ || defined __clang__
400# define _GL__GENERIC_BOGUS 1 400# define _GL__GENERIC_BOGUS 1
401#else 401#else
402# define _GL__GENERIC_BOGUS 0 402# define _GL__GENERIC_BOGUS 0
diff --git a/lib/md5.h b/lib/md5.h
index 3c6048242b0..c728ba1b6f2 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -40,7 +40,7 @@
40#endif 40#endif
41 41
42#ifndef __THROW 42#ifndef __THROW
43# if defined __cplusplus && __GNUC_PREREQ (2,8) 43# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
44# define __THROW throw () 44# define __THROW throw ()
45# else 45# else
46# define __THROW 46# define __THROW
diff --git a/lib/mktime.c b/lib/mktime.c
index 92c00b2b14b..5b4c144ecad 100644
--- a/lib/mktime.c
+++ b/lib/mktime.c
@@ -94,7 +94,7 @@ my_tzset (void)
94 const char *tz = getenv ("TZ"); 94 const char *tz = getenv ("TZ");
95 if (tz != NULL && strchr (tz, '/') != NULL) 95 if (tz != NULL && strchr (tz, '/') != NULL)
96 _putenv ("TZ="); 96 _putenv ("TZ=");
97# elif HAVE_TZSET 97# else
98 tzset (); 98 tzset ();
99# endif 99# endif
100} 100}
diff --git a/lib/nstrftime.c b/lib/nstrftime.c
index 2816cf4d58b..7d5a97f7635 100644
--- a/lib/nstrftime.c
+++ b/lib/nstrftime.c
@@ -21,7 +21,6 @@
21# define HAVE_TM_GMTOFF 1 21# define HAVE_TM_GMTOFF 1
22# define HAVE_TM_ZONE 1 22# define HAVE_TM_ZONE 1
23# define HAVE_TZNAME 1 23# define HAVE_TZNAME 1
24# define HAVE_TZSET 1
25# include "../locale/localeinfo.h" 24# include "../locale/localeinfo.h"
26#else 25#else
27# include <config.h> 26# include <config.h>
@@ -34,6 +33,7 @@
34#endif 33#endif
35 34
36#include <ctype.h> 35#include <ctype.h>
36#include <errno.h>
37#include <time.h> 37#include <time.h>
38 38
39#if HAVE_TZNAME && !HAVE_DECL_TZNAME 39#if HAVE_TZNAME && !HAVE_DECL_TZNAME
@@ -163,7 +163,10 @@ extern char *tzname[];
163 size_t _w = pad == L_('-') || width < 0 ? 0 : width; \ 163 size_t _w = pad == L_('-') || width < 0 ? 0 : width; \
164 size_t _incr = _n < _w ? _w : _n; \ 164 size_t _incr = _n < _w ? _w : _n; \
165 if (_incr >= maxsize - i) \ 165 if (_incr >= maxsize - i) \
166 return 0; \ 166 { \
167 errno = ERANGE; \
168 return 0; \
169 } \
167 if (p) \ 170 if (p) \
168 { \ 171 { \
169 if (_n < _w) \ 172 if (_n < _w) \
@@ -365,7 +368,7 @@ tm_diff (const struct tm *a, const struct tm *b)
365#define ISO_WEEK1_WDAY 4 /* Thursday */ 368#define ISO_WEEK1_WDAY 4 /* Thursday */
366#define YDAY_MINIMUM (-366) 369#define YDAY_MINIMUM (-366)
367static int iso_week_days (int, int); 370static int iso_week_days (int, int);
368#ifdef __GNUC__ 371#if defined __GNUC__ || defined __clang__
369__inline__ 372__inline__
370#endif 373#endif
371static int 374static int
@@ -389,7 +392,6 @@ iso_week_days (int yday, int wday)
389#endif 392#endif
390 393
391#ifdef my_strftime 394#ifdef my_strftime
392# undef HAVE_TZSET
393# define extra_args , tz, ns 395# define extra_args , tz, ns
394# define extra_args_spec , timezone_t tz, int ns 396# define extra_args_spec , timezone_t tz, int ns
395#else 397#else
@@ -449,6 +451,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
449 size_t maxsize = (size_t) -1; 451 size_t maxsize = (size_t) -1;
450#endif 452#endif
451 453
454 int saved_errno = errno;
452 int hour12 = tp->tm_hour; 455 int hour12 = tp->tm_hour;
453#ifdef _NL_CURRENT 456#ifdef _NL_CURRENT
454 /* We cannot make the following values variables since we must delay 457 /* We cannot make the following values variables since we must delay
@@ -523,7 +526,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
523 { 526 {
524 /* POSIX.1 requires that local time zone information be used as 527 /* POSIX.1 requires that local time zone information be used as
525 though strftime called tzset. */ 528 though strftime called tzset. */
526# if HAVE_TZSET 529# ifndef my_strftime
527 if (!*tzset_called) 530 if (!*tzset_called)
528 { 531 {
529 tzset (); 532 tzset ();
@@ -1188,7 +1191,13 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1188 time_t t; 1191 time_t t;
1189 1192
1190 ltm = *tp; 1193 ltm = *tp;
1194 ltm.tm_yday = -1;
1191 t = mktime_z (tz, &ltm); 1195 t = mktime_z (tz, &ltm);
1196 if (ltm.tm_yday < 0)
1197 {
1198 errno = EOVERFLOW;
1199 return 0;
1200 }
1192 1201
1193 /* Generate string value for T using time_t arithmetic; 1202 /* Generate string value for T using time_t arithmetic;
1194 this works even if sizeof (long) < sizeof (time_t). */ 1203 this works even if sizeof (long) < sizeof (time_t). */
@@ -1417,7 +1426,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1417 1426
1418 /* POSIX.1 requires that local time zone information be used as 1427 /* POSIX.1 requires that local time zone information be used as
1419 though strftime called tzset. */ 1428 though strftime called tzset. */
1420# if HAVE_TZSET 1429# ifndef my_strftime
1421 if (!*tzset_called) 1430 if (!*tzset_called)
1422 { 1431 {
1423 tzset (); 1432 tzset ();
@@ -1486,5 +1495,6 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize)
1486 *p = L_('\0'); 1495 *p = L_('\0');
1487#endif 1496#endif
1488 1497
1498 errno = saved_errno;
1489 return i; 1499 return i;
1490} 1500}
diff --git a/lib/open.c b/lib/open.c
index 751b42d7dcf..0f7c6e9b9d3 100644
--- a/lib/open.c
+++ b/lib/open.c
@@ -30,7 +30,11 @@
30static int 30static int
31orig_open (const char *filename, int flags, mode_t mode) 31orig_open (const char *filename, int flags, mode_t mode)
32{ 32{
33#if defined _WIN32 && !defined __CYGWIN__
34 return _open (filename, flags, mode);
35#else
33 return open (filename, flags, mode); 36 return open (filename, flags, mode);
37#endif
34} 38}
35 39
36/* Specification. */ 40/* Specification. */
diff --git a/lib/regcomp.c b/lib/regcomp.c
index 84044be5e09..a4b95b0b2ff 100644
--- a/lib/regcomp.c
+++ b/lib/regcomp.c
@@ -558,7 +558,7 @@ weak_alias (__regerror, regerror)
558static const bitset_t utf8_sb_map = 558static const bitset_t utf8_sb_map =
559{ 559{
560 /* Set the first 128 bits. */ 560 /* Set the first 128 bits. */
561# if defined __GNUC__ && !defined __STRICT_ANSI__ 561# if (defined __GNUC__ || __clang_major__ >= 4) && !defined __STRICT_ANSI__
562 [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX 562 [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX
563# else 563# else
564# if 4 * BITSET_WORD_BITS < ASCII_CHARS 564# if 4 * BITSET_WORD_BITS < ASCII_CHARS
diff --git a/lib/regex_internal.h b/lib/regex_internal.h
index 9a0c2ed97c8..0c72e3f7b01 100644
--- a/lib/regex_internal.h
+++ b/lib/regex_internal.h
@@ -335,7 +335,7 @@ typedef struct
335 Idx idx; /* for BACK_REF */ 335 Idx idx; /* for BACK_REF */
336 re_context_type ctx_type; /* for ANCHOR */ 336 re_context_type ctx_type; /* for ANCHOR */
337 } opr; 337 } opr;
338#if __GNUC__ >= 2 && !defined __STRICT_ANSI__ 338#if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
339 re_token_type_t type : 8; 339 re_token_type_t type : 8;
340#else 340#else
341 re_token_type_t type; 341 re_token_type_t type;
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index cbebc8462fd..6d12cd826de 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -215,6 +215,11 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
215 "use gnulib module fclose for portable POSIX compliance"); 215 "use gnulib module fclose for portable POSIX compliance");
216#endif 216#endif
217 217
218#if defined _WIN32 && !defined __CYGWIN__
219# undef fcloseall
220# define fcloseall _fcloseall
221#endif
222
218#if @GNULIB_FDOPEN@ 223#if @GNULIB_FDOPEN@
219# if @REPLACE_FDOPEN@ 224# if @REPLACE_FDOPEN@
220# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 225# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -224,6 +229,12 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
224_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode) 229_GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
225 _GL_ARG_NONNULL ((2))); 230 _GL_ARG_NONNULL ((2)));
226_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode)); 231_GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
232# elif defined _WIN32 && !defined __CYGWIN__
233# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
234# undef fdopen
235# define fdopen _fdopen
236# endif
237_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
227# else 238# else
228_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); 239_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
229# endif 240# endif
@@ -233,6 +244,9 @@ _GL_CXXALIASWARN (fdopen);
233/* Assume fdopen is always declared. */ 244/* Assume fdopen is always declared. */
234_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - " 245_GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
235 "use gnulib module fdopen for portability"); 246 "use gnulib module fdopen for portability");
247#elif defined _WIN32 && !defined __CYGWIN__
248# undef fdopen
249# define fdopen _fdopen
236#endif 250#endif
237 251
238#if @GNULIB_FFLUSH@ 252#if @GNULIB_FFLUSH@
@@ -297,6 +311,11 @@ _GL_CXXALIASWARN (fgets);
297# endif 311# endif
298#endif 312#endif
299 313
314#if defined _WIN32 && !defined __CYGWIN__
315# undef fileno
316# define fileno _fileno
317#endif
318
300#if @GNULIB_FOPEN@ 319#if @GNULIB_FOPEN@
301# if @REPLACE_FOPEN@ 320# if @REPLACE_FOPEN@
302# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 321# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -824,6 +843,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
824_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); 843_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
825#endif 844#endif
826 845
846#if defined _WIN32 && !defined __CYGWIN__
847# undef getw
848# define getw _getw
849#endif
850
827#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ 851#if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
828struct obstack; 852struct obstack;
829/* Grow an obstack with formatted output. Return the number of 853/* Grow an obstack with formatted output. Return the number of
@@ -940,7 +964,7 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
940#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ 964#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
941# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ 965# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
942 || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) 966 || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
943# if defined __GNUC__ 967# if defined __GNUC__ || defined __clang__
944# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 968# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
945/* Don't break __attribute__((format(printf,M,N))). */ 969/* Don't break __attribute__((format(printf,M,N))). */
946# define printf __printf__ 970# define printf __printf__
@@ -1037,6 +1061,11 @@ _GL_CXXALIASWARN (puts);
1037# endif 1061# endif
1038#endif 1062#endif
1039 1063
1064#if defined _WIN32 && !defined __CYGWIN__
1065# undef putw
1066# define putw _putw
1067#endif
1068
1040#if @GNULIB_REMOVE@ 1069#if @GNULIB_REMOVE@
1041# if @REPLACE_REMOVE@ 1070# if @REPLACE_REMOVE@
1042# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1071# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1114,7 +1143,7 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
1114 1143
1115#if @GNULIB_SCANF@ 1144#if @GNULIB_SCANF@
1116# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ 1145# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
1117# if defined __GNUC__ 1146# if defined __GNUC__ || defined __clang__
1118# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1147# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1119# undef scanf 1148# undef scanf
1120/* Don't break __attribute__((format(scanf,M,N))). */ 1149/* Don't break __attribute__((format(scanf,M,N))). */
@@ -1170,7 +1199,9 @@ _GL_CXXALIAS_SYS (snprintf, int,
1170 (char *restrict str, size_t size, 1199 (char *restrict str, size_t size,
1171 const char *restrict format, ...)); 1200 const char *restrict format, ...));
1172# endif 1201# endif
1202# if __GLIBC__ >= 2
1173_GL_CXXALIASWARN (snprintf); 1203_GL_CXXALIASWARN (snprintf);
1204# endif
1174#elif defined GNULIB_POSIXCHECK 1205#elif defined GNULIB_POSIXCHECK
1175# undef snprintf 1206# undef snprintf
1176# if HAVE_RAW_DECL_SNPRINTF 1207# if HAVE_RAW_DECL_SNPRINTF
@@ -1214,6 +1245,11 @@ _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
1214 "POSIX compliance"); 1245 "POSIX compliance");
1215#endif 1246#endif
1216 1247
1248#if defined _WIN32 && !defined __CYGWIN__
1249# undef tempnam
1250# define tempnam _tempnam
1251#endif
1252
1217#if @GNULIB_TMPFILE@ 1253#if @GNULIB_TMPFILE@
1218# if @REPLACE_TMPFILE@ 1254# if @REPLACE_TMPFILE@
1219# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1255# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1382,7 +1418,9 @@ _GL_CXXALIAS_SYS (vfscanf, int,
1382 (FILE *restrict stream, 1418 (FILE *restrict stream,
1383 const char *restrict format, va_list args)); 1419 const char *restrict format, va_list args));
1384# endif 1420# endif
1421# if __GLIBC__ >= 2
1385_GL_CXXALIASWARN (vfscanf); 1422_GL_CXXALIASWARN (vfscanf);
1423# endif
1386#endif 1424#endif
1387 1425
1388#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@ 1426#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
@@ -1436,7 +1474,9 @@ _GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
1436# else 1474# else
1437_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args)); 1475_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
1438# endif 1476# endif
1477# if __GLIBC__ >= 2
1439_GL_CXXALIASWARN (vscanf); 1478_GL_CXXALIASWARN (vscanf);
1479# endif
1440#endif 1480#endif
1441 1481
1442#if @GNULIB_VSNPRINTF@ 1482#if @GNULIB_VSNPRINTF@
@@ -1464,7 +1504,9 @@ _GL_CXXALIAS_SYS (vsnprintf, int,
1464 (char *restrict str, size_t size, 1504 (char *restrict str, size_t size,
1465 const char *restrict format, va_list args)); 1505 const char *restrict format, va_list args));
1466# endif 1506# endif
1507# if __GLIBC__ >= 2
1467_GL_CXXALIASWARN (vsnprintf); 1508_GL_CXXALIASWARN (vsnprintf);
1509# endif
1468#elif defined GNULIB_POSIXCHECK 1510#elif defined GNULIB_POSIXCHECK
1469# undef vsnprintf 1511# undef vsnprintf
1470# if HAVE_RAW_DECL_VSNPRINTF 1512# if HAVE_RAW_DECL_VSNPRINTF
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 5c598a275d1..47a1309e633 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -217,6 +217,21 @@ _GL_WARN_ON_USE (canonicalize_file_name,
217# endif 217# endif
218#endif 218#endif
219 219
220#if defined _WIN32 && !defined __CYGWIN__
221# undef ecvt
222# define ecvt _ecvt
223#endif
224
225#if defined _WIN32 && !defined __CYGWIN__
226# undef fcvt
227# define fcvt _fcvt
228#endif
229
230#if defined _WIN32 && !defined __CYGWIN__
231# undef gcvt
232# define gcvt _gcvt
233#endif
234
220#if @GNULIB_GETLOADAVG@ 235#if @GNULIB_GETLOADAVG@
221/* Store max(NELEM,3) load average numbers in LOADAVG[]. 236/* Store max(NELEM,3) load average numbers in LOADAVG[].
222 The three numbers are the load average of the last 1 minute, the last 5 237 The three numbers are the load average of the last 1 minute, the last 5
@@ -468,6 +483,11 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
468# endif 483# endif
469#endif 484#endif
470 485
486#if defined _WIN32 && !defined __CYGWIN__
487# undef mktemp
488# define mktemp _mktemp
489#endif
490
471#if @GNULIB_POSIX_OPENPT@ 491#if @GNULIB_POSIX_OPENPT@
472/* Return an FD open to the master side of a pseudo-terminal. Flags should 492/* Return an FD open to the master side of a pseudo-terminal. Flags should
473 include O_RDWR, and may also include O_NOCTTY. */ 493 include O_RDWR, and may also include O_NOCTTY. */
@@ -546,10 +566,19 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
546# endif 566# endif
547_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); 567_GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
548_GL_CXXALIAS_RPL (putenv, int, (char *string)); 568_GL_CXXALIAS_RPL (putenv, int, (char *string));
569# elif defined _WIN32 && !defined __CYGWIN__
570# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
571# undef putenv
572# define putenv _putenv
573# endif
574_GL_CXXALIAS_MDA (putenv, int, (char *string));
549# else 575# else
550_GL_CXXALIAS_SYS (putenv, int, (char *string)); 576_GL_CXXALIAS_SYS (putenv, int, (char *string));
551# endif 577# endif
552_GL_CXXALIASWARN (putenv); 578_GL_CXXALIASWARN (putenv);
579#elif defined _WIN32 && !defined __CYGWIN__
580# undef putenv
581# define putenv _putenv
553#endif 582#endif
554 583
555#if @GNULIB_QSORT_R@ 584#if @GNULIB_QSORT_R@
diff --git a/lib/strftime.h b/lib/strftime.h
index e8501631573..fe0c4195a59 100644
--- a/lib/strftime.h
+++ b/lib/strftime.h
@@ -24,7 +24,12 @@ extern "C" {
24/* Just like strftime, but with two more arguments: 24/* Just like strftime, but with two more arguments:
25 POSIX requires that strftime use the local timezone information. 25 POSIX requires that strftime use the local timezone information.
26 Use the timezone __TZ instead. Use __NS as the number of 26 Use the timezone __TZ instead. Use __NS as the number of
27 nanoseconds in the %N directive. */ 27 nanoseconds in the %N directive.
28
29 On error, set errno and return 0. Otherwise, return the number of
30 bytes generated (not counting the trailing NUL), preserving errno
31 if the number is 0. This errno behavior is in draft POSIX 202x
32 plus some requested changes to POSIX. */
28size_t nstrftime (char *restrict, size_t, char const *, struct tm const *, 33size_t nstrftime (char *restrict, size_t, char const *, struct tm const *,
29 timezone_t __tz, int __ns); 34 timezone_t __tz, int __ns);
30 35
diff --git a/lib/string.in.h b/lib/string.in.h
index c0c1a54f39d..7d83668f6ec 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -123,6 +123,12 @@ _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
123#endif 123#endif
124 124
125 125
126#if defined _WIN32 && !defined __CYGWIN__
127# undef memccpy
128# define memccpy _memccpy
129#endif
130
131
126/* Return the first instance of C within N bytes of S, or NULL. */ 132/* Return the first instance of C within N bytes of S, or NULL. */
127#if @GNULIB_MEMCHR@ 133#if @GNULIB_MEMCHR@
128# if @REPLACE_MEMCHR@ 134# if @REPLACE_MEMCHR@
@@ -384,6 +390,12 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
384# endif 390# endif
385_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); 391_GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
386_GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); 392_GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
393# elif defined _WIN32 && !defined __CYGWIN__
394# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
395# undef strdup
396# define strdup _strdup
397# endif
398_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
387# else 399# else
388# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup 400# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
389 /* strdup exists as a function and as a macro. Get rid of the macro. */ 401 /* strdup exists as a function and as a macro. Get rid of the macro. */
@@ -401,6 +413,9 @@ _GL_CXXALIASWARN (strdup);
401_GL_WARN_ON_USE (strdup, "strdup is unportable - " 413_GL_WARN_ON_USE (strdup, "strdup is unportable - "
402 "use gnulib module strdup for portability"); 414 "use gnulib module strdup for portability");
403# endif 415# endif
416#elif defined _WIN32 && !defined __CYGWIN__
417# undef strdup
418# define strdup _strdup
404#endif 419#endif
405 420
406/* Append no more than N characters from SRC onto DEST. */ 421/* Append no more than N characters from SRC onto DEST. */
diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
index f14ac1f5723..a82d716de2e 100644
--- a/lib/sys_random.in.h
+++ b/lib/sys_random.in.h
@@ -23,6 +23,10 @@
23 23
24#if @HAVE_SYS_RANDOM_H@ 24#if @HAVE_SYS_RANDOM_H@
25 25
26/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>. */
27# if defined __UCLIBC__
28# include <stddef.h>
29# endif
26/* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>. 30/* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>.
27 On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that 31 On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that
28 includes <Availability.h>, such as <stdlib.h> or <unistd.h>. */ 32 includes <Availability.h>, such as <stdlib.h> or <unistd.h>. */
diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h
index 7a7b157d545..72cb9ba7b0f 100644
--- a/lib/sys_select.in.h
+++ b/lib/sys_select.in.h
@@ -177,14 +177,14 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
177# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 177# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
178# undef close 178# undef close
179# define close close_used_without_including_unistd_h 179# define close close_used_without_including_unistd_h
180# else 180# elif !defined __clang__
181 _GL_WARN_ON_USE (close, 181 _GL_WARN_ON_USE (close,
182 "close() used without including <unistd.h>"); 182 "close() used without including <unistd.h>");
183# endif 183# endif
184# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 184# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
185# undef gethostname 185# undef gethostname
186# define gethostname gethostname_used_without_including_unistd_h 186# define gethostname gethostname_used_without_including_unistd_h
187# else 187# elif !defined __clang__
188 _GL_WARN_ON_USE (gethostname, 188 _GL_WARN_ON_USE (gethostname,
189 "gethostname() used without including <unistd.h>"); 189 "gethostname() used without including <unistd.h>");
190# endif 190# endif
@@ -219,7 +219,7 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
219# define setsockopt setsockopt_used_without_including_sys_socket_h 219# define setsockopt setsockopt_used_without_including_sys_socket_h
220# undef shutdown 220# undef shutdown
221# define shutdown shutdown_used_without_including_sys_socket_h 221# define shutdown shutdown_used_without_including_sys_socket_h
222# else 222# elif !defined __clang__
223 _GL_WARN_ON_USE (socket, 223 _GL_WARN_ON_USE (socket,
224 "socket() used without including <sys/socket.h>"); 224 "socket() used without including <sys/socket.h>");
225 _GL_WARN_ON_USE (connect, 225 _GL_WARN_ON_USE (connect,
diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h
index 89e167f6d1c..3e0e4b27b7e 100644
--- a/lib/sys_stat.in.h
+++ b/lib/sys_stat.in.h
@@ -391,6 +391,12 @@ struct stat
391#endif 391#endif
392 392
393 393
394#if defined _WIN32 && !defined __CYGWIN__
395# undef chmod
396# define chmod _chmod
397#endif
398
399
394#if @GNULIB_FCHMODAT@ 400#if @GNULIB_FCHMODAT@
395# if @REPLACE_FCHMODAT@ 401# if @REPLACE_FCHMODAT@
396# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 402# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -432,7 +438,9 @@ _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
432# else 438# else
433_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); 439_GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
434# endif 440# endif
441# if __GLIBC__ >= 2
435_GL_CXXALIASWARN (fstat); 442_GL_CXXALIASWARN (fstat);
443# endif
436#elif @GNULIB_OVERRIDES_STRUCT_STAT@ 444#elif @GNULIB_OVERRIDES_STRUCT_STAT@
437# undef fstat 445# undef fstat
438# define fstat fstat_used_without_requesting_gnulib_module_fstat 446# define fstat fstat_used_without_requesting_gnulib_module_fstat
@@ -800,6 +808,12 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
800#endif 808#endif
801 809
802 810
811#if defined _WIN32 && !defined __CYGWIN__
812# undef umask
813# define umask _umask
814#endif
815
816
803#if @GNULIB_UTIMENSAT@ 817#if @GNULIB_UTIMENSAT@
804/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat 818/* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
805 implementation relies on futimesat, which on Solaris 10 makes an invocation 819 implementation relies on futimesat, which on Solaris 10 makes an invocation
diff --git a/lib/sys_time.in.h b/lib/sys_time.in.h
index d30b26719b2..1c12d5f13d7 100644
--- a/lib/sys_time.in.h
+++ b/lib/sys_time.in.h
@@ -135,7 +135,7 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
135# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 135# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
136# undef close 136# undef close
137# define close close_used_without_including_unistd_h 137# define close close_used_without_including_unistd_h
138# else 138# elif !defined __clang__
139 _GL_WARN_ON_USE (close, 139 _GL_WARN_ON_USE (close,
140 "close() used without including <unistd.h>"); 140 "close() used without including <unistd.h>");
141# endif 141# endif
diff --git a/lib/time.in.h b/lib/time.in.h
index 1d11650e77f..32e6ec03ef4 100644
--- a/lib/time.in.h
+++ b/lib/time.in.h
@@ -135,13 +135,19 @@ _GL_CXXALIASWARN (nanosleep);
135# endif 135# endif
136_GL_FUNCDECL_RPL (tzset, void, (void)); 136_GL_FUNCDECL_RPL (tzset, void, (void));
137_GL_CXXALIAS_RPL (tzset, void, (void)); 137_GL_CXXALIAS_RPL (tzset, void, (void));
138# else 138# elif defined _WIN32 && !defined __CYGWIN__
139# if ! @HAVE_TZSET@ 139# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
140_GL_FUNCDECL_SYS (tzset, void, (void)); 140# undef tzset
141# define tzset _tzset
141# endif 142# endif
143_GL_CXXALIAS_MDA (tzset, void, (void));
144# else
142_GL_CXXALIAS_SYS (tzset, void, (void)); 145_GL_CXXALIAS_SYS (tzset, void, (void));
143# endif 146# endif
144_GL_CXXALIASWARN (tzset); 147_GL_CXXALIASWARN (tzset);
148# elif defined _WIN32 && !defined __CYGWIN__
149# undef tzset
150# define tzset _tzset
145# endif 151# endif
146 152
147/* Return the 'time_t' representation of TP and normalize TP. */ 153/* Return the 'time_t' representation of TP and normalize TP. */
diff --git a/lib/time_rz.c b/lib/time_rz.c
index 5d85963c9ed..95438cf876e 100644
--- a/lib/time_rz.c
+++ b/lib/time_rz.c
@@ -54,31 +54,6 @@ enum { ABBR_SIZE_MIN = DEFAULT_MXFAST - offsetof (struct tm_zone, abbrs) };
54 matters; the pointer is never dereferenced. */ 54 matters; the pointer is never dereferenced. */
55static timezone_t const local_tz = (timezone_t) 1; 55static timezone_t const local_tz = (timezone_t) 1;
56 56
57#if HAVE_TM_ZONE || HAVE_TZNAME
58
59/* Return true if the values A and B differ according to the rules for
60 tm_isdst: A and B differ if one is zero and the other positive. */
61static bool
62isdst_differ (int a, int b)
63{
64 return !a != !b && 0 <= a && 0 <= b;
65}
66
67/* Return true if A and B are equal. */
68static int
69equal_tm (const struct tm *a, const struct tm *b)
70{
71 return ! ((a->tm_sec ^ b->tm_sec)
72 | (a->tm_min ^ b->tm_min)
73 | (a->tm_hour ^ b->tm_hour)
74 | (a->tm_mday ^ b->tm_mday)
75 | (a->tm_mon ^ b->tm_mon)
76 | (a->tm_year ^ b->tm_year)
77 | isdst_differ (a->tm_isdst, b->tm_isdst));
78}
79
80#endif
81
82/* Copy to ABBRS the abbreviation at ABBR with size ABBR_SIZE (this 57/* Copy to ABBRS the abbreviation at ABBR with size ABBR_SIZE (this
83 includes its trailing null byte). Append an extra null byte to 58 includes its trailing null byte). Append an extra null byte to
84 mark the end of ABBRS. */ 59 mark the end of ABBRS. */
@@ -327,17 +302,25 @@ mktime_z (timezone_t tz, struct tm *tm)
327 timezone_t old_tz = set_tz (tz); 302 timezone_t old_tz = set_tz (tz);
328 if (old_tz) 303 if (old_tz)
329 { 304 {
330 time_t t = mktime (tm);
331#if HAVE_TM_ZONE || HAVE_TZNAME
332 time_t badtime = -1;
333 struct tm tm_1; 305 struct tm tm_1;
334 if ((t != badtime 306 tm_1.tm_sec = tm->tm_sec;
335 || (localtime_r (&t, &tm_1) && equal_tm (tm, &tm_1))) 307 tm_1.tm_min = tm->tm_min;
336 && !save_abbr (tz, tm)) 308 tm_1.tm_hour = tm->tm_hour;
337 t = badtime; 309 tm_1.tm_mday = tm->tm_mday;
310 tm_1.tm_mon = tm->tm_mon;
311 tm_1.tm_year = tm->tm_year;
312 tm_1.tm_yday = -1;
313 tm_1.tm_isdst = tm->tm_isdst;
314 time_t t = mktime (&tm_1);
315 bool ok = 0 <= tm_1.tm_yday;
316#if HAVE_TM_ZONE || HAVE_TZNAME
317 ok = ok && save_abbr (tz, &tm_1);
338#endif 318#endif
339 if (revert_tz (old_tz)) 319 if (revert_tz (old_tz) && ok)
340 return t; 320 {
321 *tm = tm_1;
322 return t;
323 }
341 } 324 }
342 return -1; 325 return -1;
343 } 326 }
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index a81a14fe873..357a35e3881 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -273,6 +273,12 @@ _GL_INLINE_HEADER_BEGIN
273_GL_FUNCDECL_RPL (access, int, (const char *file, int mode) 273_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
274 _GL_ARG_NONNULL ((1))); 274 _GL_ARG_NONNULL ((1)));
275_GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); 275_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
276# elif defined _WIN32 && !defined __CYGWIN__
277# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
278# undef access
279# define access _access
280# endif
281_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
276# else 282# else
277_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); 283_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
278# endif 284# endif
@@ -286,11 +292,22 @@ _GL_WARN_ON_USE (access, "access does not always support X_OK - "
286 "also, this function is a security risk - " 292 "also, this function is a security risk - "
287 "use the gnulib module faccessat instead"); 293 "use the gnulib module faccessat instead");
288# endif 294# endif
295#elif defined _WIN32 && !defined __CYGWIN__
296# undef access
297# define access _access
289#endif 298#endif
290 299
291 300
292#if @GNULIB_CHDIR@ 301#if @GNULIB_CHDIR@
302# if defined _WIN32 && !defined __CYGWIN__
303# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
304# undef chdir
305# define chdir _chdir
306# endif
307_GL_CXXALIAS_MDA (chdir, int, (const char *file));
308# else
293_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); 309_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
310# endif
294_GL_CXXALIASWARN (chdir); 311_GL_CXXALIASWARN (chdir);
295#elif defined GNULIB_POSIXCHECK 312#elif defined GNULIB_POSIXCHECK
296# undef chdir 313# undef chdir
@@ -298,6 +315,9 @@ _GL_CXXALIASWARN (chdir);
298_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - " 315_GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
299 "use gnulib module chdir for portability"); 316 "use gnulib module chdir for portability");
300# endif 317# endif
318#elif defined _WIN32 && !defined __CYGWIN__
319# undef chdir
320# define chdir _chdir
301#endif 321#endif
302 322
303 323
@@ -342,6 +362,12 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
342# endif 362# endif
343_GL_FUNCDECL_RPL (close, int, (int fd)); 363_GL_FUNCDECL_RPL (close, int, (int fd));
344_GL_CXXALIAS_RPL (close, int, (int fd)); 364_GL_CXXALIAS_RPL (close, int, (int fd));
365# elif defined _WIN32 && !defined __CYGWIN__
366# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
367# undef close
368# define close _close
369# endif
370_GL_CXXALIAS_MDA (close, int, (int fd));
345# else 371# else
346_GL_CXXALIAS_SYS (close, int, (int fd)); 372_GL_CXXALIAS_SYS (close, int, (int fd));
347# endif 373# endif
@@ -354,6 +380,9 @@ _GL_CXXALIASWARN (close);
354/* Assume close is always declared. */ 380/* Assume close is always declared. */
355_GL_WARN_ON_USE (close, "close does not portably work on sockets - " 381_GL_WARN_ON_USE (close, "close does not portably work on sockets - "
356 "use gnulib module close for portability"); 382 "use gnulib module close for portability");
383#elif defined _WIN32 && !defined __CYGWIN__
384# undef close
385# define close _close
357#endif 386#endif
358 387
359 388
@@ -382,6 +411,12 @@ _GL_WARN_ON_USE (copy_file_range,
382# endif 411# endif
383_GL_FUNCDECL_RPL (dup, int, (int oldfd)); 412_GL_FUNCDECL_RPL (dup, int, (int oldfd));
384_GL_CXXALIAS_RPL (dup, int, (int oldfd)); 413_GL_CXXALIAS_RPL (dup, int, (int oldfd));
414# elif defined _WIN32 && !defined __CYGWIN__
415# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
416# undef dup
417# define dup _dup
418# endif
419_GL_CXXALIAS_MDA (dup, int, (int oldfd));
385# else 420# else
386_GL_CXXALIAS_SYS (dup, int, (int oldfd)); 421_GL_CXXALIAS_SYS (dup, int, (int oldfd));
387# endif 422# endif
@@ -392,6 +427,9 @@ _GL_CXXALIASWARN (dup);
392_GL_WARN_ON_USE (dup, "dup is unportable - " 427_GL_WARN_ON_USE (dup, "dup is unportable - "
393 "use gnulib module dup for portability"); 428 "use gnulib module dup for portability");
394# endif 429# endif
430#elif defined _WIN32 && !defined __CYGWIN__
431# undef dup
432# define dup _dup
395#endif 433#endif
396 434
397 435
@@ -407,6 +445,12 @@ _GL_WARN_ON_USE (dup, "dup is unportable - "
407# endif 445# endif
408_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); 446_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
409_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); 447_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
448# elif defined _WIN32 && !defined __CYGWIN__
449# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
450# undef dup2
451# define dup2 _dup2
452# endif
453_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
410# else 454# else
411_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); 455_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
412# endif 456# endif
@@ -417,6 +461,9 @@ _GL_CXXALIASWARN (dup2);
417_GL_WARN_ON_USE (dup2, "dup2 is unportable - " 461_GL_WARN_ON_USE (dup2, "dup2 is unportable - "
418 "use gnulib module dup2 for portability"); 462 "use gnulib module dup2 for portability");
419# endif 463# endif
464#elif defined _WIN32 && !defined __CYGWIN__
465# undef dup2
466# define dup2 _dup2
420#endif 467#endif
421 468
422 469
@@ -517,6 +564,43 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
517#endif 564#endif
518 565
519 566
567#if defined _WIN32 && !defined __CYGWIN__
568# undef execl
569# define execl _execl
570#endif
571
572#if defined _WIN32 && !defined __CYGWIN__
573# undef execle
574# define execle _execle
575#endif
576
577#if defined _WIN32 && !defined __CYGWIN__
578# undef execlp
579# define execlp _execlp
580#endif
581
582
583#if defined _WIN32 && !defined __CYGWIN__
584# undef execv
585# define execv _execv
586#endif
587
588#if defined _WIN32 && !defined __CYGWIN__
589# undef execve
590# define execve _execve
591#endif
592
593#if defined _WIN32 && !defined __CYGWIN__
594# undef execvp
595# define execvp _execvp
596#endif
597
598#if defined _WIN32 && !defined __CYGWIN__
599# undef execvpe
600# define execvpe _execvpe
601#endif
602
603
520#if @GNULIB_FACCESSAT@ 604#if @GNULIB_FACCESSAT@
521# if @REPLACE_FACCESSAT@ 605# if @REPLACE_FACCESSAT@
522# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 606# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -692,6 +776,12 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
692# endif 776# endif
693_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); 777_GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
694_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); 778_GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
779# elif defined _WIN32 && !defined __CYGWIN__
780# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
781# undef getcwd
782# define getcwd _getcwd
783# endif
784_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
695# else 785# else
696/* Need to cast, because on mingw, the second parameter is 786/* Need to cast, because on mingw, the second parameter is
697 int size. */ 787 int size. */
@@ -704,6 +794,9 @@ _GL_CXXALIASWARN (getcwd);
704_GL_WARN_ON_USE (getcwd, "getcwd is unportable - " 794_GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
705 "use gnulib module getcwd for portability"); 795 "use gnulib module getcwd for portability");
706# endif 796# endif
797#elif defined _WIN32 && !defined __CYGWIN__
798# undef getcwd
799# define getcwd _getcwd
707#endif 800#endif
708 801
709 802
@@ -1038,6 +1131,12 @@ _GL_WARN_ON_USE (getpass, "getpass is unportable - "
1038#endif 1131#endif
1039 1132
1040 1133
1134#if defined _WIN32 && !defined __CYGWIN__
1135# undef getpid
1136# define getpid _getpid
1137#endif
1138
1139
1041#if @GNULIB_GETUSERSHELL@ 1140#if @GNULIB_GETUSERSHELL@
1042/* Return the next valid login shell on the system, or NULL when the end of 1141/* Return the next valid login shell on the system, or NULL when the end of
1043 the list has been reached. */ 1142 the list has been reached. */
@@ -1110,6 +1209,12 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
1110# endif 1209# endif
1111_GL_FUNCDECL_RPL (isatty, int, (int fd)); 1210_GL_FUNCDECL_RPL (isatty, int, (int fd));
1112_GL_CXXALIAS_RPL (isatty, int, (int fd)); 1211_GL_CXXALIAS_RPL (isatty, int, (int fd));
1212# elif defined _WIN32 && !defined __CYGWIN__
1213# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1214# undef isatty
1215# define isatty _isatty
1216# endif
1217_GL_CXXALIAS_MDA (isatty, int, (int fd));
1113# else 1218# else
1114_GL_CXXALIAS_SYS (isatty, int, (int fd)); 1219_GL_CXXALIAS_SYS (isatty, int, (int fd));
1115# endif 1220# endif
@@ -1120,6 +1225,9 @@ _GL_CXXALIASWARN (isatty);
1120_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " 1225_GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
1121 "use gnulib module isatty for portability"); 1226 "use gnulib module isatty for portability");
1122# endif 1227# endif
1228#elif defined _WIN32 && !defined __CYGWIN__
1229# undef isatty
1230# define isatty _isatty
1123#endif 1231#endif
1124 1232
1125 1233
@@ -1231,6 +1339,12 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
1231# endif 1339# endif
1232_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); 1340_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1233_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); 1341_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
1342# elif defined _WIN32 && !defined __CYGWIN__
1343# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1344# undef lseek
1345# define lseek _lseek
1346# endif
1347_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
1234# else 1348# else
1235_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); 1349_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
1236# endif 1350# endif
@@ -1241,6 +1355,9 @@ _GL_CXXALIASWARN (lseek);
1241_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " 1355_GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
1242 "systems - use gnulib module lseek for portability"); 1356 "systems - use gnulib module lseek for portability");
1243# endif 1357# endif
1358#elif defined _WIN32 && !defined __CYGWIN__
1359# undef lseek
1360# define lseek _lseek
1244#endif 1361#endif
1245 1362
1246 1363
@@ -1373,6 +1490,12 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
1373_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) 1490_GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
1374 _GL_ARG_NONNULL ((2))); 1491 _GL_ARG_NONNULL ((2)));
1375_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); 1492_GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1493# elif defined _WIN32 && !defined __CYGWIN__
1494# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1495# undef read
1496# define read _read
1497# endif
1498_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
1376# else 1499# else
1377/* Need to cast, because on mingw, the third parameter is 1500/* Need to cast, because on mingw, the third parameter is
1378 unsigned int count 1501 unsigned int count
@@ -1380,6 +1503,9 @@ _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
1380_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); 1503_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
1381# endif 1504# endif
1382_GL_CXXALIASWARN (read); 1505_GL_CXXALIASWARN (read);
1506#elif defined _WIN32 && !defined __CYGWIN__
1507# undef read
1508# define read _read
1383#endif 1509#endif
1384 1510
1385 1511
@@ -1462,6 +1588,12 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
1462# endif 1588# endif
1463_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); 1589_GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
1464_GL_CXXALIAS_RPL (rmdir, int, (char const *name)); 1590_GL_CXXALIAS_RPL (rmdir, int, (char const *name));
1591# elif defined _WIN32 && !defined __CYGWIN__
1592# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1593# undef rmdir
1594# define rmdir _rmdir
1595# endif
1596_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
1465# else 1597# else
1466_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); 1598_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
1467# endif 1599# endif
@@ -1472,6 +1604,9 @@ _GL_CXXALIASWARN (rmdir);
1472_GL_WARN_ON_USE (rmdir, "rmdir is unportable - " 1604_GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
1473 "use gnulib module rmdir for portability"); 1605 "use gnulib module rmdir for portability");
1474# endif 1606# endif
1607#elif defined _WIN32 && !defined __CYGWIN__
1608# undef rmdir
1609# define rmdir _rmdir
1475#endif 1610#endif
1476 1611
1477 1612
@@ -1530,6 +1665,12 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - "
1530#endif 1665#endif
1531 1666
1532 1667
1668#if defined _WIN32 && !defined __CYGWIN__
1669# undef swab
1670# define swab _swab
1671#endif
1672
1673
1533#if @GNULIB_SYMLINK@ 1674#if @GNULIB_SYMLINK@
1534# if @REPLACE_SYMLINK@ 1675# if @REPLACE_SYMLINK@
1535# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1676# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1654,6 +1795,12 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
1654# endif 1795# endif
1655_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); 1796_GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
1656_GL_CXXALIAS_RPL (unlink, int, (char const *file)); 1797_GL_CXXALIAS_RPL (unlink, int, (char const *file));
1798# elif defined _WIN32 && !defined __CYGWIN__
1799# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1800# undef unlink
1801# define unlink _unlink
1802# endif
1803_GL_CXXALIAS_MDA (unlink, int, (char const *file));
1657# else 1804# else
1658_GL_CXXALIAS_SYS (unlink, int, (char const *file)); 1805_GL_CXXALIAS_SYS (unlink, int, (char const *file));
1659# endif 1806# endif
@@ -1664,6 +1811,9 @@ _GL_CXXALIASWARN (unlink);
1664_GL_WARN_ON_USE (unlink, "unlink is not portable - " 1811_GL_WARN_ON_USE (unlink, "unlink is not portable - "
1665 "use gnulib module unlink for portability"); 1812 "use gnulib module unlink for portability");
1666# endif 1813# endif
1814#elif defined _WIN32 && !defined __CYGWIN__
1815# undef unlink
1816# define unlink _unlink
1667#endif 1817#endif
1668 1818
1669 1819
@@ -1735,6 +1885,12 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
1735_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) 1885_GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
1736 _GL_ARG_NONNULL ((2))); 1886 _GL_ARG_NONNULL ((2)));
1737_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); 1887_GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
1888# elif defined _WIN32 && !defined __CYGWIN__
1889# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1890# undef write
1891# define write _write
1892# endif
1893_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
1738# else 1894# else
1739/* Need to cast, because on mingw, the third parameter is 1895/* Need to cast, because on mingw, the third parameter is
1740 unsigned int count 1896 unsigned int count
@@ -1742,6 +1898,9 @@ _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
1742_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count)); 1898_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
1743# endif 1899# endif
1744_GL_CXXALIASWARN (write); 1900_GL_CXXALIASWARN (write);
1901#elif defined _WIN32 && !defined __CYGWIN__
1902# undef write
1903# define write _write
1745#endif 1904#endif
1746 1905
1747_GL_INLINE_HEADER_END 1906_GL_INLINE_HEADER_END
diff --git a/lib/verify.h b/lib/verify.h
index 58172f3cb7f..d485a0283a9 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -23,11 +23,15 @@
23 23
24/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC) 24/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC)
25 works as per C11. This is supported by GCC 4.6.0 and later, in C 25 works as per C11. This is supported by GCC 4.6.0 and later, in C
26 mode. 26 mode, and by clang (also in C++ mode).
27 27
28 Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as 28 Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
29 per C2X, and define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) 29 per C2X. This is supported by GCC 9.1 and later, and by clang in
30 works as per C++17. This is supported by GCC 9.1 and later. 30 C++1z mode.
31
32 Define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) works as per
33 C++17. This is supported by GCC 9.1 and later, and by clang in
34 C++1z mode.
31 35
32 Support compilers claiming conformance to the relevant standard, 36 Support compilers claiming conformance to the relevant standard,
33 and also support GCC when not pedantic. If we were willing to slow 37 and also support GCC when not pedantic. If we were willing to slow
@@ -35,7 +39,8 @@
35 since this affects only the quality of diagnostics, why bother? */ 39 since this affects only the quality of diagnostics, why bother? */
36#ifndef __cplusplus 40#ifndef __cplusplus
37# if (201112L <= __STDC_VERSION__ \ 41# if (201112L <= __STDC_VERSION__ \
38 || (!defined __STRICT_ANSI__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__))) 42 || (!defined __STRICT_ANSI__ \
43 && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 4 <= __clang_major__)))
39# define _GL_HAVE__STATIC_ASSERT 1 44# define _GL_HAVE__STATIC_ASSERT 1
40# endif 45# endif
41# if (202000L <= __STDC_VERSION__ \ 46# if (202000L <= __STDC_VERSION__ \
@@ -43,7 +48,15 @@
43# define _GL_HAVE__STATIC_ASSERT1 1 48# define _GL_HAVE__STATIC_ASSERT1 1
44# endif 49# endif
45#else 50#else
46# if 201703L <= __cplusplus || 9 <= __GNUC__ 51# if 4 <= __clang_major__
52# define _GL_HAVE__STATIC_ASSERT 1
53# endif
54# if 4 <= __clang_major__ && 201411 <= __cpp_static_assert
55# define _GL_HAVE__STATIC_ASSERT1 1
56# endif
57# if 201703L <= __cplusplus \
58 || 9 <= __GNUC__ \
59 || (4 <= __clang_major__ && 201411 <= __cpp_static_assert)
47# define _GL_HAVE_STATIC_ASSERT1 1 60# define _GL_HAVE_STATIC_ASSERT1 1
48# endif 61# endif
49#endif 62#endif
@@ -233,13 +246,6 @@ template <int w>
233 246
234/* @assert.h omit start@ */ 247/* @assert.h omit start@ */
235 248
236#if defined __has_builtin
237/* <https://clang.llvm.org/docs/LanguageExtensions.html#builtin-functions> */
238# define _GL_HAS_BUILTIN_ASSUME __has_builtin (__builtin_assume)
239#else
240# define _GL_HAS_BUILTIN_ASSUME 0
241#endif
242
243#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)) 249#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
244# define _GL_HAS_BUILTIN_TRAP 1 250# define _GL_HAS_BUILTIN_TRAP 1
245#elif defined __has_builtin 251#elif defined __has_builtin
@@ -299,11 +305,14 @@ template <int w>
299 305
300 Although assuming R can help a compiler generate better code or 306 Although assuming R can help a compiler generate better code or
301 diagnostics, performance can suffer if R uses hard-to-optimize 307 diagnostics, performance can suffer if R uses hard-to-optimize
302 features such as function calls not inlined by the compiler. */ 308 features such as function calls not inlined by the compiler.
309
310 Avoid Clang’s __builtin_assume, as clang 9.0.1 -Wassume can
311 generate a bogus diagnostic "the argument to '__builtin_assume' has
312 side effects that will be discarded" even when the argument has no
313 side effects. */
303 314
304#if _GL_HAS_BUILTIN_ASSUME 315#if _GL_HAS_BUILTIN_UNREACHABLE
305# define assume(R) __builtin_assume (R)
306#elif _GL_HAS_BUILTIN_UNREACHABLE
307# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) 316# define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
308#elif 1200 <= _MSC_VER 317#elif 1200 <= _MSC_VER
309# define assume(R) __assume (R) 318# define assume(R) __assume (R)
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 9bcceceb0ee..164e4a01f59 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -302,7 +302,7 @@ endif
302# subdirectories, to make sure require's and load's in the files being 302# subdirectories, to make sure require's and load's in the files being
303# compiled find the right files. 303# compiled find the right files.
304 304
305.SUFFIXES: .eln .elc .el 305.SUFFIXES: .elc .el
306 306
307# An old-fashioned suffix rule, which, according to the GNU Make manual, 307# An old-fashioned suffix rule, which, according to the GNU Make manual,
308# cannot have prerequisites. 308# cannot have prerequisites.
@@ -357,13 +357,6 @@ compile-main: gen-lisp compile-clean
357 TARGETS="$$chunk"; \ 357 TARGETS="$$chunk"; \
358 done 358 done
359 359
360.PHONY: native-compile-clean
361native-compile-clean:
362# Erase all eln output compilation folders.
363ifeq ($(HAVE_NATIVE_COMP),yes)
364 find $(lisp) -regex ".*/eln-.*-[0-9a-z]+\\'" -type d | xargs rm -rf
365endif
366
367.PHONY: compile-clean 360.PHONY: compile-clean
368# Erase left-over .elc files that do not have a corresponding .el file. 361# Erase left-over .elc files that do not have a corresponding .el file.
369compile-clean: 362compile-clean:
@@ -400,7 +393,7 @@ compile: $(LOADDEFS) autoloads compile-first
400# Compile all Lisp files. This is like 'compile' but compiles files 393# Compile all Lisp files. This is like 'compile' but compiles files
401# unconditionally. Some files don't actually get compiled because they 394# unconditionally. Some files don't actually get compiled because they
402# set the local variable no-byte-compile. 395# set the local variable no-byte-compile.
403compile-always: native-compile-clean 396compile-always:
404 find $(lisp) -name '*.elc' $(FIND_DELETE) 397 find $(lisp) -name '*.elc' $(FIND_DELETE)
405 $(MAKE) compile 398 $(MAKE) compile
406 399
@@ -490,7 +483,7 @@ $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(CAL_DIR)/diary-loaddefs.el
490 483
491.PHONY: bootstrap-clean distclean maintainer-clean extraclean 484.PHONY: bootstrap-clean distclean maintainer-clean extraclean
492 485
493bootstrap-clean: native-compile-clean 486bootstrap-clean:
494 find $(lisp) -name '*.elc' $(FIND_DELETE) 487 find $(lisp) -name '*.elc' $(FIND_DELETE)
495 rm -f $(AUTOGENEL) 488 rm -f $(AUTOGENEL)
496 489
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 2d61a96010e..468b0d995b3 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -517,14 +517,6 @@ It is nil if the abbrev has already been unexpanded.")
517;; "Local (mode-specific) abbrev table of current buffer.") 517;; "Local (mode-specific) abbrev table of current buffer.")
518;; (make-variable-buffer-local 'local-abbrev-table) 518;; (make-variable-buffer-local 'local-abbrev-table)
519 519
520(defcustom pre-abbrev-expand-hook nil
521 "Function or functions to be called before abbrev expansion is done.
522This is the first thing that `expand-abbrev' does, and so this may change
523the current abbrev table before abbrev lookup happens."
524 :type 'hook
525 :group 'abbrev-mode)
526(make-obsolete-variable 'pre-abbrev-expand-hook 'abbrev-expand-function "23.1")
527
528(defun clear-abbrev-table (table) 520(defun clear-abbrev-table (table)
529 "Undefine all abbrevs in abbrev table TABLE, leaving it empty." 521 "Undefine all abbrevs in abbrev table TABLE, leaving it empty."
530 (setq abbrevs-changed t) 522 (setq abbrevs-changed t)
@@ -836,12 +828,10 @@ Takes no argument and should return the abbrev symbol if expansion took place.")
836(defun expand-abbrev () 828(defun expand-abbrev ()
837 "Expand the abbrev before point, if there is an abbrev there. 829 "Expand the abbrev before point, if there is an abbrev there.
838Effective when explicitly called even when `abbrev-mode' is nil. 830Effective when explicitly called even when `abbrev-mode' is nil.
839Before doing anything else, runs `pre-abbrev-expand-hook'.
840Calls the value of `abbrev-expand-function' with no argument to do 831Calls the value of `abbrev-expand-function' with no argument to do
841the work, and returns whatever it does. (That return value should 832the work, and returns whatever it does. (That return value should
842be the abbrev symbol if expansion occurred, else nil.)" 833be the abbrev symbol if expansion occurred, else nil.)"
843 (interactive) 834 (interactive)
844 (run-hooks 'pre-abbrev-expand-hook)
845 (funcall abbrev-expand-function)) 835 (funcall abbrev-expand-function))
846 836
847(defun abbrev--default-expand () 837(defun abbrev--default-expand ()
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 36a361c3f4b..8a3bcf8e59d 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -923,8 +923,6 @@ annotations."
923 "# Date: " (current-time-string) "\n")) 923 "# Date: " (current-time-string) "\n"))
924 924
925 925
926(define-obsolete-variable-alias 'bookmark-read-annotation-text-func
927 'bookmark-edit-annotation-text-func "23.1")
928(defvar bookmark-edit-annotation-text-func 'bookmark-default-annotation-text 926(defvar bookmark-edit-annotation-text-func 'bookmark-default-annotation-text
929 "Function to return default text to use for a bookmark annotation. 927 "Function to return default text to use for a bookmark annotation.
930It takes one argument, the name of the bookmark, as a string.") 928It takes one argument, the name of the bookmark, as a string.")
@@ -1143,17 +1141,6 @@ DISPLAY-FUNC would be `switch-to-buffer-other-window'."
1143 (let ((pop-up-frames t)) 1141 (let ((pop-up-frames t))
1144 (bookmark-jump-other-window bookmark))) 1142 (bookmark-jump-other-window bookmark)))
1145 1143
1146(defun bookmark-jump-noselect (bookmark)
1147 "Return the location pointed to by BOOKMARK (see `bookmark-jump').
1148The return value has the form (BUFFER . POINT).
1149
1150Note: this function is deprecated and is present for Emacs 22
1151compatibility only."
1152 (declare (obsolete bookmark-handle-bookmark "23.1"))
1153 (save-excursion
1154 (bookmark-handle-bookmark bookmark)
1155 (cons (current-buffer) (point))))
1156
1157(defun bookmark-handle-bookmark (bookmark-name-or-record) 1144(defun bookmark-handle-bookmark (bookmark-name-or-record)
1158 "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler' 1145 "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler'
1159if it has none. This changes current buffer and point and returns nil, 1146if it has none. This changes current buffer and point and returns nil,
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el
index aa5c47ca7f4..d06ba287879 100644
--- a/lisp/buff-menu.el
+++ b/lisp/buff-menu.el
@@ -229,9 +229,6 @@ commands.")
229 map) 229 map)
230 "Local keymap for `Buffer-menu-mode' buffers.") 230 "Local keymap for `Buffer-menu-mode' buffers.")
231 231
232(define-obsolete-variable-alias 'buffer-menu-mode-hook
233 'Buffer-menu-mode-hook "23.1")
234
235(define-derived-mode Buffer-menu-mode tabulated-list-mode "Buffer Menu" 232(define-derived-mode Buffer-menu-mode tabulated-list-mode "Buffer Menu"
236 "Major mode for Buffer Menu buffers. 233 "Major mode for Buffer Menu buffers.
237The Buffer Menu is invoked by the commands \\[list-buffers], 234The Buffer Menu is invoked by the commands \\[list-buffers],
diff --git a/lisp/cedet/ede/make.el b/lisp/cedet/ede/make.el
index ecce3e7105b..140e7387a68 100644
--- a/lisp/cedet/ede/make.el
+++ b/lisp/cedet/ede/make.el
@@ -32,29 +32,15 @@
32 32
33(declare-function inversion-check-version "inversion") 33(declare-function inversion-check-version "inversion")
34 34
35(if (fboundp 'locate-file) 35(defsubst ede--find-executable (exec)
36 (defsubst ede--find-executable (exec) 36 "Return an expanded file name for a program EXEC on the exec path."
37 "Return an expanded file name for a program EXEC on the exec path." 37 (declare (obsolete locate-file "28.1"))
38 (locate-file exec exec-path)) 38 (locate-file exec exec-path))
39
40 ;; Else, older version of Emacs.
41
42 (defsubst ede--find-executable (exec)
43 "Return an expanded file name for a program EXEC on the exec path."
44 (let ((p exec-path)
45 (found nil))
46 (while (and p (not found))
47 (let ((f (expand-file-name exec (car p))))
48 (if (file-exists-p f)
49 (setq found f)))
50 (setq p (cdr p)))
51 found))
52 )
53 39
54(defvar ede-make-min-version "3.0" 40(defvar ede-make-min-version "3.0"
55 "Minimum version of GNU make required.") 41 "Minimum version of GNU make required.")
56 42
57(defcustom ede-make-command (cond ((ede--find-executable "gmake") 43(defcustom ede-make-command (cond ((executable-find "gmake")
58 "gmake") 44 "gmake")
59 (t "make")) ;; What to do? 45 (t "make")) ;; What to do?
60 "The MAKE command to use for EDE when compiling. 46 "The MAKE command to use for EDE when compiling.
diff --git a/lisp/cedet/semantic/bovine/c.el b/lisp/cedet/semantic/bovine/c.el
index 358829a4568..3649d1c2f1f 100644
--- a/lisp/cedet/semantic/bovine/c.el
+++ b/lisp/cedet/semantic/bovine/c.el
@@ -46,27 +46,10 @@
46(declare-function c-forward-conditional "cc-cmds") 46(declare-function c-forward-conditional "cc-cmds")
47(declare-function ede-system-include-path "ede") 47(declare-function ede-system-include-path "ede")
48 48
49;;; Compatibility
50;;
51(eval-when-compile (require 'cc-mode)) 49(eval-when-compile (require 'cc-mode))
52 50
53(if (fboundp 'c-end-of-macro) 51(define-obsolete-function-alias 'semantic-c-end-of-macro
54 (eval-and-compile 52 #'c-end-of-macro "28.1")
55 (defalias 'semantic-c-end-of-macro 'c-end-of-macro))
56 ;; From cc-mode 5.30
57 (defun semantic-c-end-of-macro ()
58 "Go to the end of a preprocessor directive.
59More accurately, move point to the end of the closest following line
60that doesn't end with a line continuation backslash.
61
62This function does not do any hidden buffer changes."
63 (while (progn
64 (end-of-line)
65 (when (and (eq (char-before) ?\\)
66 (not (eobp)))
67 (forward-char)
68 t))))
69 )
70 53
71;;; Code: 54;;; Code:
72(with-suppressed-warnings ((obsolete define-child-mode)) 55(with-suppressed-warnings ((obsolete define-child-mode))
@@ -266,7 +249,7 @@ Return the defined symbol as a special spp lex token."
266 (semantic-lex-analyzer #'semantic-cpp-lexer) 249 (semantic-lex-analyzer #'semantic-cpp-lexer)
267 (raw-stream 250 (raw-stream
268 (semantic-lex-spp-stream-for-macro (save-excursion 251 (semantic-lex-spp-stream-for-macro (save-excursion
269 (semantic-c-end-of-macro) 252 (c-end-of-macro)
270 ;; HACK - If there's a C comment after 253 ;; HACK - If there's a C comment after
271 ;; the macro, do not parse it. 254 ;; the macro, do not parse it.
272 (if (looking-back "/\\*.*" beginning-of-define) 255 (if (looking-back "/\\*.*" beginning-of-define)
@@ -590,7 +573,7 @@ case, we must skip it since it is the ELSE part."
590(define-lex-regex-analyzer semantic-lex-c-macrobits 573(define-lex-regex-analyzer semantic-lex-c-macrobits
591 "Ignore various forms of #if/#else/#endif conditionals." 574 "Ignore various forms of #if/#else/#endif conditionals."
592 "^\\s-*#\\s-*\\(if\\(n?def\\)?\\|endif\\|elif\\|else\\)" 575 "^\\s-*#\\s-*\\(if\\(n?def\\)?\\|endif\\|elif\\|else\\)"
593 (semantic-c-end-of-macro) 576 (c-end-of-macro)
594 (setq semantic-lex-end-point (point)) 577 (setq semantic-lex-end-point (point))
595 nil) 578 nil)
596 579
diff --git a/lisp/cedet/semantic/dep.el b/lisp/cedet/semantic/dep.el
index 47afa25dd74..60ab6033aec 100644
--- a/lisp/cedet/semantic/dep.el
+++ b/lisp/cedet/semantic/dep.el
@@ -183,16 +183,8 @@ macro `defcustom-mode-local-semantic-dependency-system-include-path'."
183;; 183;;
184;; methods for finding files on a provided path. 184;; methods for finding files on a provided path.
185(defmacro semantic--dependency-find-file-on-path (file path) 185(defmacro semantic--dependency-find-file-on-path (file path)
186 (if (fboundp 'locate-file) 186 (declare (obsolete locate-file "28.1"))
187 `(locate-file ,file ,path) 187 `(locate-file ,file ,path))
188 `(let ((p ,path)
189 (found nil))
190 (while (and p (not found))
191 (let ((f (expand-file-name ,file (car p))))
192 (if (file-exists-p f)
193 (setq found f)))
194 (setq p (cdr p)))
195 found)))
196 188
197(defvar ede-minor-mode) 189(defvar ede-minor-mode)
198(defvar ede-object) 190(defvar ede-object)
@@ -216,11 +208,11 @@ provided mode, not from the current major mode."
216 (when (file-exists-p file) 208 (when (file-exists-p file)
217 (setq found file)) 209 (setq found file))
218 (when (and (not found) (not systemp)) 210 (when (and (not found) (not systemp))
219 (setq found (semantic--dependency-find-file-on-path file locp))) 211 (setq found (locate-file file locp)))
220 (when (and (not found) edesys) 212 (when (and (not found) edesys)
221 (setq found (semantic--dependency-find-file-on-path file edesys))) 213 (setq found (locate-file file edesys)))
222 (when (not found) 214 (when (not found)
223 (setq found (semantic--dependency-find-file-on-path file sysp))) 215 (setq found (locate-file file sysp)))
224 (if found (expand-file-name found)))) 216 (if found (expand-file-name found))))
225 217
226 218
diff --git a/lisp/cedet/semantic/lex-spp.el b/lisp/cedet/semantic/lex-spp.el
index b8812de05b6..e6e124eb812 100644
--- a/lisp/cedet/semantic/lex-spp.el
+++ b/lisp/cedet/semantic/lex-spp.el
@@ -70,7 +70,7 @@
70(require 'semantic) 70(require 'semantic)
71(require 'semantic/lex) 71(require 'semantic/lex)
72 72
73(declare-function semantic-c-end-of-macro "semantic/bovine/c") 73(declare-function c-end-of-macro "cc-engine")
74 74
75;;; Code: 75;;; Code:
76(defvar semantic-lex-spp-macro-symbol-obarray nil 76(defvar semantic-lex-spp-macro-symbol-obarray nil
@@ -946,7 +946,7 @@ by another macro."
946 (save-excursion 946 (save-excursion
947 (let ((start (match-beginning 0)) 947 (let ((start (match-beginning 0))
948 (end (match-end 0)) 948 (end (match-end 0))
949 (peom (save-excursion (semantic-c-end-of-macro) (point)))) 949 (peom (save-excursion (c-end-of-macro) (point))))
950 (condition-case nil 950 (condition-case nil
951 (progn 951 (progn
952 ;; This will throw an error if no closing paren can be found. 952 ;; This will throw an error if no closing paren can be found.
diff --git a/lisp/comint.el b/lisp/comint.el
index c3cb439d8b8..092902d865e 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -223,6 +223,13 @@ This variable is buffer-local."
223 (other :tag "on" t)) 223 (other :tag "on" t))
224 :group 'comint) 224 :group 'comint)
225 225
226(defcustom comint-highlight-input t
227 "If non-nil, highlight input with `comint-highlight-input' face.
228Otherwise keep the original highlighting untouched."
229 :version "28.1"
230 :type 'boolean
231 :group 'comint)
232
226(defface comint-highlight-input '((t (:weight bold))) 233(defface comint-highlight-input '((t (:weight bold)))
227 "Face to use to highlight user input." 234 "Face to use to highlight user input."
228 :group 'comint) 235 :group 'comint)
@@ -1897,9 +1904,10 @@ Similarly for Soar, Scheme, etc."
1897 (end (if no-newline (point) (1- (point))))) 1904 (end (if no-newline (point) (1- (point)))))
1898 (with-silent-modifications 1905 (with-silent-modifications
1899 (when (> end beg) 1906 (when (> end beg)
1900 (add-text-properties beg end 1907 (when comint-highlight-input
1901 '(front-sticky t 1908 (add-text-properties beg end
1902 font-lock-face comint-highlight-input)) 1909 '( font-lock-face comint-highlight-input
1910 front-sticky t )))
1903 (unless comint-use-prompt-regexp 1911 (unless comint-use-prompt-regexp
1904 ;; Give old user input a field property of `input', to 1912 ;; Give old user input a field property of `input', to
1905 ;; distinguish it from both process output and unsent 1913 ;; distinguish it from both process output and unsent
@@ -3852,7 +3860,7 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
3852 (set-buffer output-buffer) 3860 (set-buffer output-buffer)
3853 (goto-char (point-min)) 3861 (goto-char (point-min))
3854 ;; Skip past the command, if it was echoed 3862 ;; Skip past the command, if it was echoed
3855 (and (looking-at command) 3863 (and (looking-at (regexp-quote command))
3856 (forward-line)) 3864 (forward-line))
3857 (while (and (not (eobp)) 3865 (while (and (not (eobp))
3858 (re-search-forward regexp nil t)) 3866 (re-search-forward regexp nil t))
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 16695967dfa..23ceb3a857a 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -801,16 +801,19 @@ has been executed, nil otherwise."
801If a setting was edited and set before, this saves it. If a 801If a setting was edited and set before, this saves it. If a
802setting was merely edited before, this sets it then saves it." 802setting was merely edited before, this sets it then saves it."
803 (interactive) 803 (interactive)
804 (when (custom-command-apply 804 (let (edited-widgets)
805 (lambda (child) 805 (when (custom-command-apply
806 (when (memq (widget-get child :custom-state) 806 (lambda (child)
807 '(modified set changed rogue)) 807 (when (memq (widget-get child :custom-state)
808 (widget-apply child :custom-mark-to-save))) 808 '(modified set changed rogue))
809 "Save all settings in this buffer? " t) 809 (push child edited-widgets)
810 ;; Save changes to buffer and redraw. 810 (widget-apply child :custom-mark-to-save)))
811 (custom-save-all) 811 "Save all settings in this buffer? " t)
812 (dolist (child custom-options) 812 ;; Save changes to buffer.
813 (widget-apply child :custom-state-set-and-redraw)))) 813 (custom-save-all)
814 ;; Redraw and recalculate the state when necessary.
815 (dolist (widget edited-widgets)
816 (widget-apply widget :custom-state-set-and-redraw)))))
814 817
815(defun custom-reset (_widget &optional event) 818(defun custom-reset (_widget &optional event)
816 "Select item from reset menu." 819 "Select item from reset menu."
@@ -4868,8 +4871,6 @@ If several parents are listed, go to the first of them."
4868 (parent (downcase (widget-get button :tag)))) 4871 (parent (downcase (widget-get button :tag))))
4869 (customize-group parent))))) 4872 (customize-group parent)))))
4870 4873
4871(define-obsolete-variable-alias 'custom-mode-hook 'Custom-mode-hook "23.1")
4872
4873(defcustom Custom-mode-hook nil 4874(defcustom Custom-mode-hook nil
4874 "Hook called when entering Custom mode." 4875 "Hook called when entering Custom mode."
4875 :type 'hook 4876 :type 'hook
@@ -4940,8 +4941,6 @@ if that value is non-nil."
4940 4941
4941(put 'Custom-mode 'mode-class 'special) 4942(put 'Custom-mode 'mode-class 'special)
4942 4943
4943(define-obsolete-function-alias 'custom-mode 'Custom-mode "23.1")
4944
4945;;; The End. 4944;;; The End.
4946 4945
4947(provide 'cus-edit) 4946(provide 'cus-edit)
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 55f0b7dcb40..d6da4280630 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -141,8 +141,7 @@ otherwise."
141 (wid-field (get-char-property pos 'field)) 141 (wid-field (get-char-property pos 'field))
142 (wid-button (get-char-property pos 'button)) 142 (wid-button (get-char-property pos 'button))
143 (wid-doc (get-char-property pos 'widget-doc)) 143 (wid-doc (get-char-property pos 'widget-doc))
144 ;; If button.el is not loaded, we have no buttons in the text. 144 (button (button-at pos))
145 (button (and (fboundp 'button-at) (button-at pos)))
146 (button-type (and button (button-type button))) 145 (button-type (and button (button-type button)))
147 (button-label (and button (button-label button))) 146 (button-label (and button (button-label button)))
148 (widget (or wid-field wid-button wid-doc))) 147 (widget (or wid-field wid-button wid-doc)))
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 7fe5f73b879..7a7f1d07c93 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1037,7 +1037,7 @@ file.
1037 1037
1038To upgrade a version 206 file to version 208, call this command 1038To upgrade a version 206 file to version 208, call this command
1039explicitly with a prefix argument: \\[universal-argument] \\[desktop-save]. 1039explicitly with a prefix argument: \\[universal-argument] \\[desktop-save].
1040If you are upgrading from Emacs 24 or older, we recommed to do 1040If you are upgrading from Emacs 24 or older, we recommend to do
1041this once you decide you no longer need compatibility with versions 1041this once you decide you no longer need compatibility with versions
1042of Emacs before 25.1. 1042of Emacs before 25.1.
1043 1043
diff --git a/lisp/dirtrack.el b/lisp/dirtrack.el
index 3a0bbd2c9c2..ad0c18d1b38 100644
--- a/lisp/dirtrack.el
+++ b/lisp/dirtrack.el
@@ -196,9 +196,6 @@ directory."
196 (remove-hook 'comint-preoutput-filter-functions 'dirtrack t))) 196 (remove-hook 'comint-preoutput-filter-functions 'dirtrack t)))
197 197
198 198
199(define-obsolete-function-alias 'dirtrack-debug-toggle 'dirtrack-debug-mode
200 "23.1")
201(define-obsolete-variable-alias 'dirtrack-debug 'dirtrack-debug-mode "23.1")
202(define-minor-mode dirtrack-debug-mode 199(define-minor-mode dirtrack-debug-mode
203 "Toggle Dirtrack debugging." 200 "Toggle Dirtrack debugging."
204 nil nil nil 201 nil nil nil
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index de342f1519e..77c06a8eaf9 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -435,6 +435,9 @@ Typically \"page-%s.png\".")
435 (define-key map (kbd "c m") 'doc-view-set-slice-using-mouse) 435 (define-key map (kbd "c m") 'doc-view-set-slice-using-mouse)
436 (define-key map (kbd "c b") 'doc-view-set-slice-from-bounding-box) 436 (define-key map (kbd "c b") 'doc-view-set-slice-from-bounding-box)
437 (define-key map (kbd "c r") 'doc-view-reset-slice) 437 (define-key map (kbd "c r") 'doc-view-reset-slice)
438 ;; Centering the image
439 (define-key map (kbd "c h") 'doc-view-center-page-horizontally)
440 (define-key map (kbd "c v") 'doc-view-center-page-vertically)
438 ;; Searching 441 ;; Searching
439 (define-key map (kbd "C-s") 'doc-view-search) 442 (define-key map (kbd "C-s") 'doc-view-search)
440 (define-key map (kbd "<find>") 'doc-view-search) 443 (define-key map (kbd "<find>") 'doc-view-search)
@@ -740,8 +743,7 @@ It's a subdirectory of `doc-view-cache-directory'."
740Document types are symbols like `dvi', `ps', `pdf', or `odf' (any 743Document types are symbols like `dvi', `ps', `pdf', or `odf' (any
741OpenDocument format)." 744OpenDocument format)."
742 (and (display-graphic-p) 745 (and (display-graphic-p)
743 (or (image-type-available-p 'imagemagick) 746 (image-type-available-p 'png)
744 (image-type-available-p 'png))
745 (cond 747 (cond
746 ((eq type 'dvi) 748 ((eq type 'dvi)
747 (and (doc-view-mode-p 'pdf) 749 (and (doc-view-mode-p 'pdf)
@@ -769,10 +771,7 @@ OpenDocument format)."
769(defun doc-view-enlarge (factor) 771(defun doc-view-enlarge (factor)
770 "Enlarge the document by FACTOR." 772 "Enlarge the document by FACTOR."
771 (interactive (list doc-view-shrink-factor)) 773 (interactive (list doc-view-shrink-factor))
772 (if (and doc-view-scale-internally 774 (if doc-view-scale-internally
773 (eq (plist-get (cdr (doc-view-current-image)) :type)
774 'imagemagick))
775 ;; ImageMagick supports on-the-fly-rescaling.
776 (let ((new (ceiling (* factor doc-view-image-width)))) 775 (let ((new (ceiling (* factor doc-view-image-width))))
777 (unless (equal new doc-view-image-width) 776 (unless (equal new doc-view-image-width)
778 (setq-local doc-view-image-width new) 777 (setq-local doc-view-image-width new)
@@ -792,9 +791,7 @@ OpenDocument format)."
792(defun doc-view-scale-reset () 791(defun doc-view-scale-reset ()
793 "Reset the document size/zoom level to the initial one." 792 "Reset the document size/zoom level to the initial one."
794 (interactive) 793 (interactive)
795 (if (and doc-view-scale-internally 794 (if doc-view-scale-internally
796 (eq (plist-get (cdr (doc-view-current-image)) :type)
797 'imagemagick))
798 (progn 795 (progn
799 (kill-local-variable 'doc-view-image-width) 796 (kill-local-variable 'doc-view-image-width)
800 (doc-view-insert-image 797 (doc-view-insert-image
@@ -927,6 +924,32 @@ Resize the containing frame if needed."
927 (when new-frame-params 924 (when new-frame-params
928 (modify-frame-parameters (selected-frame) new-frame-params)))) 925 (modify-frame-parameters (selected-frame) new-frame-params))))
929 926
927(defun doc-view-center-page-horizontally ()
928 "Center page horizontally when page is wider than window."
929 (interactive)
930 (let ((page-width (car (image-size (doc-view-current-image) 'pixel)))
931 (window-width (window-body-width nil 'pixel))
932 ;; How much do we scroll in order to center the page?
933 (pixel-hscroll 0)
934 ;; How many pixels are there in a column?
935 (col-in-pixel (/ (window-body-width nil 'pixel)
936 (window-body-width nil))))
937 (when (> page-width window-width)
938 (setq pixel-hscroll (/ (- page-width window-width) 2))
939 (set-window-hscroll (selected-window)
940 (/ pixel-hscroll col-in-pixel)))))
941
942(defun doc-view-center-page-vertically ()
943 "Center page vertically when page is wider than window."
944 (interactive)
945 (let ((page-height (cdr (image-size (doc-view-current-image) 'pixel)))
946 (window-height (window-body-height nil 'pixel))
947 ;; How much do we scroll in order to center the page?
948 (pixel-scroll 0))
949 (when (> page-height window-height)
950 (setq pixel-scroll (/ (- page-height window-height) 2))
951 (set-window-vscroll (selected-window) pixel-scroll 'pixel))))
952
930(defun doc-view-reconvert-doc () 953(defun doc-view-reconvert-doc ()
931 "Reconvert the current document. 954 "Reconvert the current document.
932Should be invoked when the cached images aren't up-to-date." 955Should be invoked when the cached images aren't up-to-date."
@@ -1393,12 +1416,11 @@ ARGS is a list of image descriptors."
1393 ;; Only insert the image if the buffer is visible. 1416 ;; Only insert the image if the buffer is visible.
1394 (when (window-live-p (overlay-get ol 'window)) 1417 (when (window-live-p (overlay-get ol 'window))
1395 (let* ((image (if (and file (file-readable-p file)) 1418 (let* ((image (if (and file (file-readable-p file))
1396 (if (not (and doc-view-scale-internally 1419 (if (not doc-view-scale-internally)
1397 (fboundp 'imagemagick-types)))
1398 (apply #'create-image file doc-view--image-type nil args) 1420 (apply #'create-image file doc-view--image-type nil args)
1399 (unless (member :width args) 1421 (unless (member :width args)
1400 (setq args `(,@args :width ,doc-view-image-width))) 1422 (setq args `(,@args :width ,doc-view-image-width)))
1401 (apply #'create-image file 'imagemagick nil args)))) 1423 (apply #'create-image file doc-view--image-type nil args))))
1402 (slice (doc-view-current-slice)) 1424 (slice (doc-view-current-slice))
1403 (img-width (and image (car (image-size image)))) 1425 (img-width (and image (car (image-size image))))
1404 (displayed-img-width (if (and image slice) 1426 (displayed-img-width (if (and image slice)
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 20a481a8a1c..507cfe76ffa 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -2041,7 +2041,8 @@ The value is non-nil if there were no errors, nil if errors."
2041 (with-current-buffer output-buffer 2041 (with-current-buffer output-buffer
2042 (goto-char (point-max)) 2042 (goto-char (point-max))
2043 (insert "\n") ; aaah, unix. 2043 (insert "\n") ; aaah, unix.
2044 (if (file-writable-p target-file) 2044 (if (or (file-writable-p target-file)
2045 byte-native-compiling)
2045 ;; We must disable any code conversion here. 2046 ;; We must disable any code conversion here.
2046 (progn 2047 (progn
2047 (let* ((coding-system-for-write 'no-conversion) 2048 (let* ((coding-system-for-write 'no-conversion)
@@ -2050,7 +2051,8 @@ The value is non-nil if there were no errors, nil if errors."
2050 ;; parallel bootstrap), it does not risk getting a 2051 ;; parallel bootstrap), it does not risk getting a
2051 ;; half-finished file. (Bug#4196) 2052 ;; half-finished file. (Bug#4196)
2052 (tempfile 2053 (tempfile
2053 (make-temp-file (expand-file-name target-file))) 2054 (make-temp-file (when (file-writable-p target-file)
2055 (expand-file-name target-file))))
2054 (default-modes (default-file-modes)) 2056 (default-modes (default-file-modes))
2055 (temp-modes (logand default-modes #o600)) 2057 (temp-modes (logand default-modes #o600))
2056 (desired-modes (logand default-modes #o666)) 2058 (desired-modes (logand default-modes #o666))
diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el
index 2321ac1ed50..964836a32ac 100644
--- a/lisp/emacs-lisp/chart.el
+++ b/lisp/emacs-lisp/chart.el
@@ -105,9 +105,7 @@ Useful if new Emacs is used on B&W display.")
105 (car cl) 105 (car cl)
106 "white")) 106 "white"))
107 (set-face-foreground nf "black") 107 (set-face-foreground nf "black")
108 (if (and chart-face-use-pixmaps 108 (if (and chart-face-use-pixmaps pl)
109 pl
110 (fboundp 'set-face-background-pixmap))
111 (condition-case nil 109 (condition-case nil
112 (set-face-background-pixmap nf (car pl)) 110 (set-face-background-pixmap nf (car pl))
113 (error (message "Cannot set background pixmap %s" (car pl))))) 111 (error (message "Cannot set background pixmap %s" (car pl)))))
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index a92392f63ac..3176351b37d 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -36,18 +36,12 @@
36(require 'gv) 36(require 'gv)
37(require 'rx) 37(require 'rx)
38(require 'subr-x) 38(require 'subr-x)
39(require 'warnings)
39 40
40(defgroup comp nil 41(defgroup comp nil
41 "Emacs Lisp native compiler." 42 "Emacs Lisp native compiler."
42 :group 'lisp) 43 :group 'lisp)
43 44
44(defcustom comp-deferred-compilation nil
45 "If non-nil compile asyncronously all .elc files being loaded.
46Once compilation happened each function definition is updated to
47the native compiled one."
48 :type 'boolean
49 :group 'comp)
50
51(defcustom comp-speed 2 45(defcustom comp-speed 2
52 "Compiler optimization level. From -1 to 3. 46 "Compiler optimization level. From -1 to 3.
53- -1 functions are kept in bytecode form and no native compilation is performed. 47- -1 functions are kept in bytecode form and no native compilation is performed.
@@ -143,6 +137,9 @@ before compilation. Usable to modify the compiler environment."
143(defvar comp-dry-run nil 137(defvar comp-dry-run nil
144 "When non nil run everything but the C back-end.") 138 "When non nil run everything but the C back-end.")
145 139
140(defconst comp-valid-source-re (rx ".el" (? ".gz") eos)
141 "Regexp to match filename of valid input source files.")
142
146(defconst comp-log-buffer-name "*Native-compile-Log*" 143(defconst comp-log-buffer-name "*Native-compile-Log*"
147 "Name of the native-compiler log buffer.") 144 "Name of the native-compiler log buffer.")
148 145
@@ -569,28 +566,6 @@ VERBOSITY is a number between 0 and 3."
569 566
570 567
571 568
572(defun comp-output-directory (src)
573 "Return the compilation direcotry for source SRC."
574 (let* ((src (if (symbolp src) (symbol-name src) src))
575 (expanded-filename (expand-file-name src)))
576 (file-name-as-directory
577 (concat (file-name-directory expanded-filename)
578 comp-native-path-postfix))))
579
580(defun comp-output-base-filename (src)
581 "Output filename sans extention for SRC file being native compiled."
582 (let* ((src (if (symbolp src) (symbol-name src) src))
583 (expanded-filename (expand-file-name src))
584 (output-dir (comp-output-directory src))
585 (output-filename
586 (file-name-sans-extension
587 (file-name-nondirectory expanded-filename))))
588 (expand-file-name output-filename output-dir)))
589
590(defun comp-output-filename (src)
591 "Output filename for SRC file being native compiled."
592 (concat (comp-output-base-filename src) ".eln"))
593
594(defmacro comp-loop-insn-in-block (basic-block &rest body) 569(defmacro comp-loop-insn-in-block (basic-block &rest body)
595 "Loop over all insns in BASIC-BLOCK executning BODY. 570 "Loop over all insns in BASIC-BLOCK executning BODY.
596Inside BODY `insn' can be used to read or set the current 571Inside BODY `insn' can be used to read or set the current
@@ -2486,7 +2461,7 @@ Prepare every function for final compilation and drive the C back-end."
2486 (unless (file-exists-p dir) 2461 (unless (file-exists-p dir)
2487 ;; In case it's created in the meanwhile. 2462 ;; In case it's created in the meanwhile.
2488 (ignore-error 'file-already-exists 2463 (ignore-error 'file-already-exists
2489 (make-directory dir))) 2464 (make-directory dir t)))
2490 (unless comp-dry-run 2465 (unless comp-dry-run
2491 (comp--compile-ctxt-to-file name)))) 2466 (comp--compile-ctxt-to-file name))))
2492 2467
@@ -2592,17 +2567,20 @@ display a message."
2592 (cl-loop 2567 (cl-loop
2593 for (source-file . load) = (pop comp-files-queue) 2568 for (source-file . load) = (pop comp-files-queue)
2594 while source-file 2569 while source-file
2595 do (cl-assert (string-match-p (rx ".el" eos) source-file) nil 2570 do (cl-assert (string-match-p comp-valid-source-re source-file) nil
2596 "`comp-files-queue' should be \".el\" files: %s" 2571 "`comp-files-queue' should be \".el\" files: %s"
2597 source-file) 2572 source-file)
2598 when (or comp-always-compile 2573 when (or comp-always-compile
2574 load ; Always compile when the compilation is
2575 ; commanded for late load.
2599 (file-newer-than-file-p source-file 2576 (file-newer-than-file-p source-file
2600 (comp-output-filename source-file))) 2577 (comp-el-to-eln-filename source-file)))
2601 do (let* ((expr `(progn 2578 do (let* ((expr `(progn
2602 (require 'comp) 2579 (require 'comp)
2603 (setf comp-speed ,comp-speed 2580 (setf comp-speed ,comp-speed
2604 comp-debug ,comp-debug 2581 comp-debug ,comp-debug
2605 comp-verbose ,comp-verbose 2582 comp-verbose ,comp-verbose
2583 comp-eln-load-path ',comp-eln-load-path
2606 load-path ',load-path) 2584 load-path ',load-path)
2607 ,comp-async-env-modifier-form 2585 ,comp-async-env-modifier-form
2608 (message "Compiling %s..." ,source-file) 2586 (message "Compiling %s..." ,source-file)
@@ -2636,7 +2614,7 @@ display a message."
2636 (when (and load1 2614 (when (and load1
2637 (zerop (process-exit-status process))) 2615 (zerop (process-exit-status process)))
2638 (native-elisp-load 2616 (native-elisp-load
2639 (comp-output-filename source-file1) 2617 (comp-el-to-eln-filename source-file1)
2640 (eq load1 'late))) 2618 (eq load1 'late)))
2641 (comp-run-async-workers))))) 2619 (comp-run-async-workers)))))
2642 (puthash source-file process comp-async-compilations)) 2620 (puthash source-file process comp-async-compilations))
@@ -2676,7 +2654,11 @@ Return the compilation unit file name."
2676 (byte-compile-debug t) 2654 (byte-compile-debug t)
2677 (comp-ctxt 2655 (comp-ctxt
2678 (make-comp-ctxt 2656 (make-comp-ctxt
2679 :output (comp-output-base-filename function-or-file) 2657 :output (comp-el-to-eln-filename (if (symbolp function-or-file)
2658 (symbol-name function-or-file)
2659 function-or-file)
2660 (when byte-native-for-bootstrap
2661 (car (last comp-eln-load-path))))
2680 :with-late-load with-late-load))) 2662 :with-late-load with-late-load)))
2681 (comp-log "\n \n" 1) 2663 (comp-log "\n \n" 1)
2682 (condition-case err 2664 (condition-case err
@@ -2746,8 +2728,8 @@ LOAD can be nil t or 'late."
2746 (dolist (path paths) 2728 (dolist (path paths)
2747 (cond ((file-directory-p path) 2729 (cond ((file-directory-p path)
2748 (dolist (file (if recursively 2730 (dolist (file (if recursively
2749 (directory-files-recursively path (rx ".el" eos)) 2731 (directory-files-recursively path comp-valid-source-re)
2750 (directory-files path t (rx ".el" eos)))) 2732 (directory-files path t comp-valid-source-re)))
2751 (push file files))) 2733 (push file files)))
2752 ((file-exists-p path) (push path files)) 2734 ((file-exists-p path) (push path files))
2753 (t (signal 'native-compiler-error 2735 (t (signal 'native-compiler-error
@@ -2770,11 +2752,11 @@ queued with LOAD %"
2770 (and (eq load 'late) 2752 (and (eq load 'late)
2771 (cl-some (lambda (re) (string-match re file)) 2753 (cl-some (lambda (re) (string-match re file))
2772 comp-deferred-compilation-black-list))) 2754 comp-deferred-compilation-black-list)))
2773 (let ((out-dir (comp-output-directory file)) 2755 (let* ((out-filename (comp-el-to-eln-filename file))
2774 (out-filename (comp-output-filename file))) 2756 (out-dir (file-name-directory out-filename)))
2775 (if (or (file-writable-p out-filename) 2757 (unless (file-exists-p out-dir)
2776 (and (not (file-exists-p out-dir)) 2758 (make-directory out-dir t))
2777 (file-writable-p (substring out-dir 0 -1)))) 2759 (if (file-writable-p out-filename)
2778 (setf comp-files-queue 2760 (setf comp-files-queue
2779 (append comp-files-queue `((,file . ,load)))) 2761 (append comp-files-queue `((,file . ,load))))
2780 (display-warning 'comp 2762 (display-warning 'comp
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 65483d0813a..89d106ee489 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -270,12 +270,6 @@ with empty strings removed."
270 (remove-hook 'choose-completion-string-functions 270 (remove-hook 'choose-completion-string-functions
271 'crm--choose-completion-string))) 271 'crm--choose-completion-string)))
272 272
273(define-obsolete-function-alias 'crm-minibuffer-complete 'crm-complete "23.1")
274(define-obsolete-function-alias
275 'crm-minibuffer-completion-help 'crm-completion-help "23.1")
276(define-obsolete-function-alias
277 'crm-minibuffer-complete-and-exit 'crm-complete-and-exit "23.1")
278
279;; testing and debugging 273;; testing and debugging
280;; (defun crm-init-test-environ () 274;; (defun crm-init-test-environ ()
281;; "Set up some variables for testing." 275;; "Set up some variables for testing."
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 3eafad177dd..6a11f1c3949 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -364,6 +364,7 @@ which more-or-less shadow%s %s's corresponding table%s."
364 364
365(defsubst derived-mode-setup-function-name (mode) 365(defsubst derived-mode-setup-function-name (mode)
366 "Construct a setup-function name based on a MODE name." 366 "Construct a setup-function name based on a MODE name."
367 (declare (obsolete nil "28.1"))
367 (intern (concat (symbol-name mode) "-setup"))) 368 (intern (concat (symbol-name mode) "-setup")))
368 369
369 370
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 6ba8b997f84..73dabef3fa5 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -29,16 +29,6 @@
29 29
30;;; Code: 30;;; Code:
31 31
32(defvar easy-menu-precalculate-equivalent-keybindings nil
33 "Determine when equivalent key bindings are computed for easy-menu menus.
34It can take some time to calculate the equivalent key bindings that are shown
35in a menu. If the variable is on, then this calculation gives a (maybe
36noticeable) delay when a mode is first entered. If the variable is off, then
37this delay will come when a menu is displayed the first time. If you never use
38menus, turn this variable off, otherwise it is probably better to keep it on.")
39(make-obsolete-variable
40 'easy-menu-precalculate-equivalent-keybindings nil "23.1")
41
42(defsubst easy-menu-intern (s) 32(defsubst easy-menu-intern (s)
43 (if (stringp s) (intern s) s)) 33 (if (stringp s) (intern s) s))
44 34
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 764354b03b7..241eece05b6 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -515,7 +515,14 @@ Returns nil if they are."
515 `(cdr ,cdr-x) 515 `(cdr ,cdr-x)
516 (cl-assert (equal a b) t) 516 (cl-assert (equal a b) t)
517 nil)))))))) 517 nil))))))))
518 ((pred arrayp) 518 ((pred cl-struct-p)
519 (cl-loop for slot in (cl-struct-slot-info (type-of a))
520 for ai across a
521 for bi across b
522 for xf = (ert--explain-equal-rec ai bi)
523 do (when xf (cl-return `(struct-field ,(car slot) ,xf)))
524 finally (cl-assert (equal a b) t)))
525 ((or (pred arrayp) (pred recordp))
519 ;; For mixed unibyte/multibyte string comparisons, make both multibyte. 526 ;; For mixed unibyte/multibyte string comparisons, make both multibyte.
520 (when (and (stringp a) 527 (when (and (stringp a)
521 (xor (multibyte-string-p a) (multibyte-string-p b))) 528 (xor (multibyte-string-p a) (multibyte-string-p b)))
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index efbcfb3a722..60b16257a3e 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -188,11 +188,7 @@ LIBRARY should be a string (the name of the library)."
188 ((string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library) 188 ((string-match "\\.el\\(c\\(\\..*\\)?\\)\\'" library)
189 (setq library (replace-match "" t t library))) 189 (setq library (replace-match "" t t library)))
190 ((string-match "\\.eln\\'" library) 190 ((string-match "\\.eln\\'" library)
191 ;; From help-fns.el. 191 (setq library (gethash (file-name-nondirectory library) comp-eln-to-el-h))))
192 (setq library (expand-file-name (concat (file-name-base library)
193 ".el")
194 (concat (file-name-directory library)
195 "..")))))
196 (or 192 (or
197 (locate-file library 193 (locate-file library
198 (or find-function-source-path load-path) 194 (or find-function-source-path load-path)
@@ -300,12 +296,13 @@ if non-nil)."
300 (find-library-suffixes) 296 (find-library-suffixes)
301 "\\|")) 297 "\\|"))
302 (table (cl-loop for dir in (or find-function-source-path load-path) 298 (table (cl-loop for dir in (or find-function-source-path load-path)
303 when (file-readable-p dir) 299 for dir-or-default = (or dir default-directory)
300 when (file-readable-p dir-or-default)
304 append (mapcar 301 append (mapcar
305 (lambda (file) 302 (lambda (file)
306 (replace-regexp-in-string suffix-regexp 303 (replace-regexp-in-string suffix-regexp
307 "" file)) 304 "" file))
308 (directory-files dir nil 305 (directory-files dir-or-default nil
309 suffix-regexp)))) 306 suffix-regexp))))
310 (def (if (eq (function-called-at-point) 'require) 307 (def (if (eq (function-called-at-point) 'require)
311 ;; `function-called-at-point' may return 'require 308 ;; `function-called-at-point' may return 'require
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 1311d94cb01..584ed8c6f90 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -200,7 +200,9 @@
200 (save-excursion 200 (save-excursion
201 (ignore-errors 201 (ignore-errors
202 (goto-char pos) 202 (goto-char pos)
203 (or (eql (char-before) ?\') 203 ;; '(lambda ..) is not a funcall position, but #'(lambda ...) is.
204 (or (and (eql (char-before) ?\')
205 (not (eql (char-before (1- (point))) ?#)))
204 (let* ((ppss (syntax-ppss)) 206 (let* ((ppss (syntax-ppss))
205 (paren-posns (nth 9 ppss)) 207 (paren-posns (nth 9 ppss))
206 (parent 208 (parent
@@ -785,8 +787,6 @@ or to switch back to an existing one."
785 nil))) 787 nil)))
786 (comment-indent-default))) 788 (comment-indent-default)))
787 789
788(define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1")
789
790(defcustom lisp-indent-offset nil 790(defcustom lisp-indent-offset nil
791 "If non-nil, indent second line of expressions that many more columns." 791 "If non-nil, indent second line of expressions that many more columns."
792 :group 'lisp 792 :group 'lisp
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 88bb0a8bd6c..8d8d071031c 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -255,9 +255,9 @@ Left-fold the list L, starting with X, by the binary function F."
255 x) 255 x)
256 256
257(defun rx--normalise-or-arg (form) 257(defun rx--normalise-or-arg (form)
258 "Normalise the `or' argument FORM. 258 "Normalize the `or' argument FORM.
259Characters become strings, user-definitions and `eval' forms are expanded, 259Characters become strings, user-definitions and `eval' forms are expanded,
260and `or' forms are normalised recursively." 260and `or' forms are normalized recursively."
261 (cond ((characterp form) 261 (cond ((characterp form)
262 (char-to-string form)) 262 (char-to-string form))
263 ((and (consp form) (memq (car form) '(or |))) 263 ((and (consp form) (memq (car form) '(or |)))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 77f1b291043..dd7648c2b77 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -694,7 +694,7 @@
694ARG is used as the prefix value for the executed command. If 694ARG is used as the prefix value for the executed command. If
695EVENTS is a list of events, which become the beginning of the command." 695EVENTS is a list of events, which become the beginning of the command."
696 (interactive "P") 696 (interactive "P")
697 (if (viper= (viper-last-command-char) ?\\) 697 (if (viper= last-command-event ?\\)
698 (message "Switched to EMACS state for the next command...")) 698 (message "Switched to EMACS state for the next command..."))
699 (viper-escape-to-state arg events 'emacs-state)) 699 (viper-escape-to-state arg events 'emacs-state))
700 700
@@ -1149,7 +1149,7 @@ as a Meta key and any number of multiple escapes are allowed."
1149 "Begin numeric argument for the next command." 1149 "Begin numeric argument for the next command."
1150 (interactive "P") 1150 (interactive "P")
1151 (viper-prefix-arg-value 1151 (viper-prefix-arg-value
1152 (viper-last-command-char) (if (consp arg) (cdr arg) nil))) 1152 last-command-event (if (consp arg) (cdr arg) nil)))
1153 1153
1154(defun viper-command-argument (arg) 1154(defun viper-command-argument (arg)
1155 "Accept a motion command as an argument." 1155 "Accept a motion command as an argument."
@@ -1157,7 +1157,7 @@ as a Meta key and any number of multiple escapes are allowed."
1157 (let ((viper-intermediate-command 'viper-command-argument)) 1157 (let ((viper-intermediate-command 'viper-command-argument))
1158 (condition-case nil 1158 (condition-case nil
1159 (viper-prefix-arg-com 1159 (viper-prefix-arg-com
1160 (viper-last-command-char) 1160 last-command-event
1161 (cond ((null arg) nil) 1161 (cond ((null arg) nil)
1162 ((consp arg) (car arg)) 1162 ((consp arg) (car arg))
1163 ((integerp arg) arg) 1163 ((integerp arg) arg)
@@ -1564,7 +1564,7 @@ invokes the command before that, etc."
1564 1564
1565;; Hook used in viper-undo 1565;; Hook used in viper-undo
1566(defun viper-after-change-undo-hook (beg end _len) 1566(defun viper-after-change-undo-hook (beg end _len)
1567 (if (and (boundp 'undo-in-progress) undo-in-progress) 1567 (if undo-in-progress
1568 (setq undo-beg-posn beg 1568 (setq undo-beg-posn beg
1569 undo-end-posn (or end beg)) 1569 undo-end-posn (or end beg))
1570 ;; some other hooks may be changing various text properties in 1570 ;; some other hooks may be changing various text properties in
@@ -1598,9 +1598,9 @@ invokes the command before that, etc."
1598 (pos-visible-in-window-p before-undo-pt)) 1598 (pos-visible-in-window-p before-undo-pt))
1599 (progn 1599 (progn
1600 (push-mark (point-marker) t) 1600 (push-mark (point-marker) t)
1601 (viper-sit-for-short 300) 1601 (sit-for 0.3)
1602 (goto-char undo-end-posn) 1602 (goto-char undo-end-posn)
1603 (viper-sit-for-short 300) 1603 (sit-for 0.3)
1604 (if (pos-visible-in-window-p undo-beg-posn) 1604 (if (pos-visible-in-window-p undo-beg-posn)
1605 (goto-char before-undo-pt) 1605 (goto-char before-undo-pt)
1606 (goto-char undo-beg-posn))) 1606 (goto-char undo-beg-posn)))
@@ -1886,15 +1886,11 @@ Undo previous insertion and inserts new."
1886 (or unread-command-events 1886 (or unread-command-events
1887 executing-kbd-macro 1887 executing-kbd-macro
1888 (sit-for 840)) 1888 (sit-for 840))
1889 (if (fboundp 'minibuffer-prompt-end) 1889 (delete-region (minibuffer-prompt-end) (point-max))
1890 (delete-region (minibuffer-prompt-end) (point-max))
1891 (erase-buffer))
1892 (insert viper-initial))) 1890 (insert viper-initial)))
1893 1891
1894(defsubst viper-minibuffer-real-start () 1892(defsubst viper-minibuffer-real-start ()
1895 (if (fboundp 'minibuffer-prompt-end) 1893 (minibuffer-prompt-end))
1896 (minibuffer-prompt-end)
1897 (point-min)))
1898 1894
1899(defun viper-minibuffer-post-command-hook() 1895(defun viper-minibuffer-post-command-hook()
1900 (when (active-minibuffer-window) 1896 (when (active-minibuffer-window)
@@ -1908,7 +1904,7 @@ Undo previous insertion and inserts new."
1908 "Exit minibuffer Viper way." 1904 "Exit minibuffer Viper way."
1909 (interactive) 1905 (interactive)
1910 (let (command) 1906 (let (command)
1911 (setq command (local-key-binding (char-to-string (viper-last-command-char)))) 1907 (setq command (local-key-binding (char-to-string last-command-event)))
1912 (run-hooks 'viper-minibuffer-exit-hook) 1908 (run-hooks 'viper-minibuffer-exit-hook)
1913 (if command 1909 (if command
1914 (command-execute command) 1910 (command-execute command)
@@ -2883,7 +2879,7 @@ If point is on a widget or a button, simulate clicking on that widget/button."
2883 (and (consp widget) 2879 (and (consp widget)
2884 (get (widget-type widget) 'widget-type)))) 2880 (get (widget-type widget) 'widget-type))))
2885 (widget-button-press (point)) 2881 (widget-button-press (point))
2886 (if (and (fboundp 'button-at) (fboundp 'push-button) (button-at (point))) 2882 (if (button-at (point))
2887 (push-button) 2883 (push-button)
2888 ;; not a widget or a button 2884 ;; not a widget or a button
2889 (save-excursion 2885 (save-excursion
@@ -4738,8 +4734,7 @@ Please, specify your level now: "))
4738 (viper-color-display-p (if (viper-window-display-p) 4734 (viper-color-display-p (if (viper-window-display-p)
4739 (viper-color-display-p) 4735 (viper-color-display-p)
4740 'non-x)) 4736 'non-x))
4741 (viper-frame-parameters (if (fboundp 'frame-parameters) 4737 (viper-frame-parameters (frame-parameters (selected-frame)))
4742 (frame-parameters (selected-frame))))
4743 (viper-minibuffer-emacs-face (if (viper-has-face-support-p) 4738 (viper-minibuffer-emacs-face (if (viper-has-face-support-p)
4744 (facep 4739 (facep
4745 viper-minibuffer-emacs-face) 4740 viper-minibuffer-emacs-face)
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 6ecfec548cb..928a3ef00ee 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -98,7 +98,7 @@ considered related."
98;;; Code 98;;; Code
99 99
100(defsubst viper-multiclick-p () 100(defsubst viper-multiclick-p ()
101 (not (viper-sit-for-short viper-multiclick-timeout t))) 101 (not (sit-for (/ viper-multiclick-timeout 1000.0) t)))
102 102
103;; Returns window where click occurs 103;; Returns window where click occurs
104(defun viper-mouse-click-window (click) 104(defun viper-mouse-click-window (click)
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 1561204151d..83e45e1cd0c 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -786,14 +786,11 @@ Otherwise return the normal value."
786(defun viper-check-minibuffer-overlay () 786(defun viper-check-minibuffer-overlay ()
787 (if (overlayp viper-minibuffer-overlay) 787 (if (overlayp viper-minibuffer-overlay)
788 (move-overlay 788 (move-overlay
789 viper-minibuffer-overlay 789 viper-minibuffer-overlay (minibuffer-prompt-end) (1+ (buffer-size)))
790 (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1)
791 (1+ (buffer-size)))
792 (setq viper-minibuffer-overlay 790 (setq viper-minibuffer-overlay
793 ;; make overlay open-ended 791 ;; make overlay open-ended
794 (make-overlay 792 (make-overlay
795 (if (fboundp 'minibuffer-prompt-end) (minibuffer-prompt-end) 1) 793 (minibuffer-prompt-end) (1+ (buffer-size))
796 (1+ (buffer-size))
797 (current-buffer) nil 'rear-advance)))) 794 (current-buffer) nil 'rear-advance))))
798 795
799 796
@@ -808,9 +805,8 @@ Otherwise return the normal value."
808(define-obsolete-function-alias 'viper-abbreviate-file-name 805(define-obsolete-function-alias 'viper-abbreviate-file-name
809 'abbreviate-file-name "27.1") 806 'abbreviate-file-name "27.1")
810 807
811;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
812;; in sit-for, so this function smooths out the differences.
813(defsubst viper-sit-for-short (val &optional nodisp) 808(defsubst viper-sit-for-short (val &optional nodisp)
809 (declare (obsolete nil "28.1"))
814 (sit-for (/ val 1000.0) nodisp)) 810 (sit-for (/ val 1000.0) nodisp))
815 811
816;; EVENT may be a single event of a sequence of events 812;; EVENT may be a single event of a sequence of events
@@ -868,11 +864,10 @@ Otherwise return the normal value."
868 864
869;; Uses different timeouts for ESC-sequences and others 865;; Uses different timeouts for ESC-sequences and others
870(defun viper-fast-keysequence-p () 866(defun viper-fast-keysequence-p ()
871 (not (viper-sit-for-short 867 (not (sit-for (/ (if (viper-ESC-event-p last-input-event)
872 (if (viper-ESC-event-p last-input-event) 868 (viper-ESC-keyseq-timeout)
873 (viper-ESC-keyseq-timeout) 869 viper-fast-keyseq-timeout) 1000.0)
874 viper-fast-keyseq-timeout) 870 t)))
875 t)))
876 871
877(define-obsolete-function-alias 'viper-read-event-convert-to-char 872(define-obsolete-function-alias 'viper-read-event-convert-to-char
878 'read-event "27.1") 873 'read-event "27.1")
@@ -920,6 +915,7 @@ Otherwise return the normal value."
920 basis))) 915 basis)))
921 916
922(defun viper-last-command-char () 917(defun viper-last-command-char ()
918 (declare (obsolete nil "28.1"))
923 last-command-event) 919 last-command-event)
924 920
925(defun viper-key-to-emacs-key (key) 921(defun viper-key-to-emacs-key (key)
diff --git a/lisp/epa.el b/lisp/epa.el
index d190824293f..5140d3f0a69 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -666,10 +666,6 @@ If SECRET is non-nil, list secret keys instead of public keys."
666 (goto-char (point-min))) 666 (goto-char (point-min)))
667 (display-buffer buffer))))) 667 (display-buffer buffer)))))
668 668
669(defun epa-display-verify-result (verify-result)
670 (declare (obsolete epa-display-info "23.1"))
671 (epa-display-info (epg-verify-result-to-string verify-result)))
672
673(defun epa-passphrase-callback-function (context key-id handback) 669(defun epa-passphrase-callback-function (context key-id handback)
674 (if (eq key-id 'SYM) 670 (if (eq key-id 'SYM)
675 (read-passwd 671 (read-passwd
diff --git a/lisp/epg.el b/lisp/epg.el
index 96af3ad4bca..920b85398f3 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -190,6 +190,7 @@
190 (string nil :read-only t)) 190 (string nil :read-only t))
191 191
192;;;; Context Struct 192;;;; Context Struct
193(declare-function epa-passphrase-callback-function "epa.el")
193 194
194(cl-defstruct (epg-context 195(cl-defstruct (epg-context
195 (:constructor nil) 196 (:constructor nil)
@@ -215,7 +216,7 @@
215 cipher-algorithm 216 cipher-algorithm
216 digest-algorithm 217 digest-algorithm
217 compress-algorithm 218 compress-algorithm
218 (passphrase-callback (list #'epg-passphrase-callback-function)) 219 (passphrase-callback (list #'epa-passphrase-callback-function))
219 progress-callback 220 progress-callback
220 edit-callback 221 edit-callback
221 signers 222 signers
@@ -1246,19 +1247,6 @@ callback data (if any)."
1246 1247
1247;;; Functions 1248;;; Functions
1248 1249
1249(defun epg-passphrase-callback-function (context key-id _handback)
1250 (declare (obsolete epa-passphrase-callback-function "23.1"))
1251 (if (eq key-id 'SYM)
1252 (read-passwd "Passphrase for symmetric encryption: "
1253 (eq (epg-context-operation context) 'encrypt))
1254 (read-passwd
1255 (if (eq key-id 'PIN)
1256 "Passphrase for PIN: "
1257 (let ((entry (assoc key-id epg-user-id-alist)))
1258 (if entry
1259 (format "Passphrase for %s %s: " key-id (cdr entry))
1260 (format "Passphrase for %s: " key-id)))))))
1261
1262(defun epg--list-keys-1 (context name mode) 1250(defun epg--list-keys-1 (context name mode)
1263 (let ((args (append (if (epg-context-home-directory context) 1251 (let ((args (append (if (epg-context-home-directory context)
1264 (list "--homedir" 1252 (list "--homedir"
diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 4f3d85ba3c8..1cf0bb49217 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -98,7 +98,6 @@
98 98
99;;; Code: 99;;; Code:
100 100
101(require 'erc-compat)
102(eval-when-compile (require 'cl-lib)) 101(eval-when-compile (require 'cl-lib))
103;; There's a fairly strong mutual dependency between erc.el and erc-backend.el. 102;; There's a fairly strong mutual dependency between erc.el and erc-backend.el.
104;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the 103;; Luckily, erc.el does not need erc-backend.el for macroexpansion whereas the
@@ -782,7 +781,7 @@ value of `erc-server-coding-system'."
782 (pop precedence)) 781 (pop precedence))
783 (when precedence 782 (when precedence
784 (setq coding (car precedence))))) 783 (setq coding (car precedence)))))
785 (erc-decode-coding-string str coding))) 784 (decode-coding-string str coding t)))
786 785
787;; proposed name, not used by anything yet 786;; proposed name, not used by anything yet
788(defun erc-send-line (text display-fn) 787(defun erc-send-line (text display-fn)
diff --git a/lisp/erc/erc-dcc.el b/lisp/erc/erc-dcc.el
index bf98eb818f3..477f148197b 100644
--- a/lisp/erc/erc-dcc.el
+++ b/lisp/erc/erc-dcc.el
@@ -419,7 +419,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
419 (pcomplete-here 419 (pcomplete-here
420 (pcase (intern (downcase (pcomplete-arg 1))) 420 (pcase (intern (downcase (pcomplete-arg 1)))
421 ('chat (mapcar (lambda (elt) (plist-get elt :nick)) 421 ('chat (mapcar (lambda (elt) (plist-get elt :nick))
422 (erc-remove-if-not 422 (cl-remove-if-not
423 #'(lambda (elt) 423 #'(lambda (elt)
424 (eq (plist-get elt :type) 'CHAT)) 424 (eq (plist-get elt :type) 'CHAT))
425 erc-dcc-list))) 425 erc-dcc-list)))
@@ -427,7 +427,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
427 (mapcar (lambda (elt) (symbol-name (plist-get elt :type))) 427 (mapcar (lambda (elt) (symbol-name (plist-get elt :type)))
428 erc-dcc-list))) 428 erc-dcc-list)))
429 ('get (mapcar #'erc-dcc-nick 429 ('get (mapcar #'erc-dcc-nick
430 (erc-remove-if-not 430 (cl-remove-if-not
431 #'(lambda (elt) 431 #'(lambda (elt)
432 (eq (plist-get elt :type) 'GET)) 432 (eq (plist-get elt :type) 'GET))
433 erc-dcc-list))) 433 erc-dcc-list)))
@@ -435,7 +435,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
435 (pcomplete-here 435 (pcomplete-here
436 (pcase (intern (downcase (pcomplete-arg 2))) 436 (pcase (intern (downcase (pcomplete-arg 2)))
437 ('get (mapcar (lambda (elt) (plist-get elt :file)) 437 ('get (mapcar (lambda (elt) (plist-get elt :file))
438 (erc-remove-if-not 438 (cl-remove-if-not
439 #'(lambda (elt) 439 #'(lambda (elt)
440 (and (eq (plist-get elt :type) 'GET) 440 (and (eq (plist-get elt :type) 'GET)
441 (erc-nick-equal-p (erc-extract-nick 441 (erc-nick-equal-p (erc-extract-nick
@@ -443,7 +443,7 @@ where FOO is one of CLOSE, GET, SEND, LIST, CHAT, etc."
443 (pcomplete-arg 1)))) 443 (pcomplete-arg 1))))
444 erc-dcc-list))) 444 erc-dcc-list)))
445 ('close (mapcar #'erc-dcc-nick 445 ('close (mapcar #'erc-dcc-nick
446 (erc-remove-if-not 446 (cl-remove-if-not
447 #'(lambda (elt) 447 #'(lambda (elt)
448 (eq (plist-get elt :type) 448 (eq (plist-get elt :type)
449 (intern (upcase (pcomplete-arg 1))))) 449 (intern (upcase (pcomplete-arg 1)))))
diff --git a/lisp/erc/erc-fill.el b/lisp/erc/erc-fill.el
index 39a8be5e0cf..d09caf7aa12 100644
--- a/lisp/erc/erc-fill.el
+++ b/lisp/erc/erc-fill.el
@@ -38,7 +38,7 @@
38 :group 'erc) 38 :group 'erc)
39 39
40;;;###autoload(autoload 'erc-fill-mode "erc-fill" nil t) 40;;;###autoload(autoload 'erc-fill-mode "erc-fill" nil t)
41(erc-define-minor-mode erc-fill-mode 41(define-minor-mode erc-fill-mode
42 "Toggle ERC fill mode. 42 "Toggle ERC fill mode.
43With a prefix argument ARG, enable ERC fill mode if ARG is 43With a prefix argument ARG, enable ERC fill mode if ARG is
44positive, and disable it otherwise. If called from Lisp, enable 44positive, and disable it otherwise. If called from Lisp, enable
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index ff7a77f1265..a475f0a1770 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -399,8 +399,7 @@ See `erc-interpret-controls-p' and `erc-interpret-mirc-color' for options."
399 (start (match-beginning 0)) 399 (start (match-beginning 0))
400 (end (+ (match-beginning 0) 400 (end (+ (match-beginning 0)
401 (length (match-string 5 s))))) 401 (length (match-string 5 s)))))
402 (setq s (erc-replace-match-subexpression-in-string 402 (setq s (replace-match "" nil nil s 1))
403 "" s control 1 start))
404 (cond ((and erc-interpret-mirc-color (or fg-color bg-color)) 403 (cond ((and erc-interpret-mirc-color (or fg-color bg-color))
405 (setq fg fg-color) 404 (setq fg fg-color)
406 (setq bg bg-color)) 405 (setq bg bg-color))
diff --git a/lisp/erc/erc-log.el b/lisp/erc/erc-log.el
index e2c066da9b1..2166123e674 100644
--- a/lisp/erc/erc-log.el
+++ b/lisp/erc/erc-log.el
@@ -267,7 +267,7 @@ The current buffer is given by BUFFER."
267 (with-current-buffer buffer 267 (with-current-buffer buffer
268 (auto-save-mode -1) 268 (auto-save-mode -1)
269 (setq buffer-file-name nil) 269 (setq buffer-file-name nil)
270 (erc-set-write-file-functions '(erc-save-buffer-in-logs)) 270 (set (make-local-variable 'write-file-functions) '(erc-save-buffer-in-logs))
271 (when erc-log-insert-log-on-open 271 (when erc-log-insert-log-on-open
272 (ignore-errors 272 (ignore-errors
273 (save-excursion 273 (save-excursion
diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el
index 6e87a183fc1..b3145674f29 100644
--- a/lisp/erc/erc-match.el
+++ b/lisp/erc/erc-match.el
@@ -94,7 +94,9 @@ The following values are allowed:
94 `nick-or-keyword' - highlight the nick of the user who typed your nickname, 94 `nick-or-keyword' - highlight the nick of the user who typed your nickname,
95 or all instances of the current nickname if there was 95 or all instances of the current nickname if there was
96 no sending user 96 no sending user
97 `all' - highlight the entire message where current nickname occurs 97 `message' - highlight the entire message where current nickname occurs
98 `all' - highlight the entire message (including the nick) where
99 current nickname occurs
98 100
99Any other value disables highlighting of current nickname altogether." 101Any other value disables highlighting of current nickname altogether."
100 :group 'erc-match 102 :group 'erc-match
@@ -102,6 +104,7 @@ Any other value disables highlighting of current nickname altogether."
102 (const nick) 104 (const nick)
103 (const keyword) 105 (const keyword)
104 (const nick-or-keyword) 106 (const nick-or-keyword)
107 (const message)
105 (const all))) 108 (const all)))
106 109
107(defcustom erc-pal-highlight-type 'nick 110(defcustom erc-pal-highlight-type 'nick
@@ -110,14 +113,17 @@ See `erc-pals'.
110 113
111The following values are allowed: 114The following values are allowed:
112 115
113 nil - do not highlight the message at all 116 nil - do not highlight the message at all
114 `nick' - highlight pal's nickname only 117 `nick' - highlight pal's nickname only
115 `all' - highlight the entire message from pal 118 `message' - highlight the entire message from pal
119 `all' - highlight the entire message (including the nick)
120 from pal
116 121
117Any other value disables pal highlighting altogether." 122Any other value disables pal highlighting altogether."
118 :group 'erc-match 123 :group 'erc-match
119 :type '(choice (const nil) 124 :type '(choice (const nil)
120 (const nick) 125 (const nick)
126 (const message)
121 (const all))) 127 (const all)))
122 128
123(defcustom erc-fool-highlight-type 'nick 129(defcustom erc-fool-highlight-type 'nick
@@ -126,14 +132,17 @@ See `erc-fools'.
126 132
127The following values are allowed: 133The following values are allowed:
128 134
129 nil - do not highlight the message at all 135 nil - do not highlight the message at all
130 `nick' - highlight fool's nickname only 136 `nick' - highlight fool's nickname only
131 `all' - highlight the entire message from fool 137 `message' - highlight the entire message from fool
138 `all' - highlight the entire message (including the nick)
139 from fool
132 140
133Any other value disables fool highlighting altogether." 141Any other value disables fool highlighting altogether."
134 :group 'erc-match 142 :group 'erc-match
135 :type '(choice (const nil) 143 :type '(choice (const nil)
136 (const nick) 144 (const nick)
145 (const message)
137 (const all))) 146 (const all)))
138 147
139(defcustom erc-keyword-highlight-type 'keyword 148(defcustom erc-keyword-highlight-type 'keyword
@@ -143,12 +152,15 @@ See variable `erc-keywords'.
143The following values are allowed: 152The following values are allowed:
144 153
145 `keyword' - highlight keyword only 154 `keyword' - highlight keyword only
146 `all' - highlight the entire message containing keyword 155 `message' - highlight the entire message containing keyword
156 `all' - highlight the entire message (including the nick)
157 containing keyword
147 158
148Any other value disables keyword highlighting altogether." 159Any other value disables keyword highlighting altogether."
149 :group 'erc-match 160 :group 'erc-match
150 :type '(choice (const nil) 161 :type '(choice (const nil)
151 (const keyword) 162 (const keyword)
163 (const message)
152 (const all))) 164 (const all)))
153 165
154(defcustom erc-dangerous-host-highlight-type 'nick 166(defcustom erc-dangerous-host-highlight-type 'nick
@@ -157,13 +169,16 @@ See `erc-dangerous-hosts'.
157 169
158The following values are allowed: 170The following values are allowed:
159 171
160 `nick' - highlight nick from dangerous-host only 172 `nick' - highlight nick from dangerous-host only
161 `all' - highlight the entire message from dangerous-host 173 `message' - highlight the entire message from dangerous-host
174 `all' - highlight the entire message (including the nick)
175 from dangerous-host
162 176
163Any other value disables dangerous-host highlighting altogether." 177Any other value disables dangerous-host highlighting altogether."
164 :group 'erc-match 178 :group 'erc-match
165 :type '(choice (const nil) 179 :type '(choice (const nil)
166 (const nick) 180 (const nick)
181 (const message)
167 (const all))) 182 (const all)))
168 183
169 184
@@ -449,19 +464,18 @@ Use this defun with `erc-insert-modify-hook'."
449 (match-beginning 0))) 464 (match-beginning 0)))
450 (nick-end (when nick-beg 465 (nick-end (when nick-beg
451 (match-end 0))) 466 (match-end 0)))
452 (message (buffer-substring 467 (message-beg (if (and nick-end
453 (if (and nick-end 468 (<= (+ 2 nick-end) (point-max)))
454 (<= (+ 2 nick-end) (point-max))) 469 ;; Message starts 2 characters after the
455 ;; Message starts 2 characters after the nick 470 ;; nick except for CTCP ACTION messages.
456 ;; except for CTCP ACTION messages. Nick 471 ;; Nick surrounded by angle brackets only in
457 ;; surrounded by angle brackets only in normal 472 ;; normal messages.
458 ;; messages. 473 (+ nick-end
459 (+ nick-end 474 (if (eq ?> (char-after nick-end))
460 (if (eq ?> (char-after nick-end)) 475 2
461 2 476 1))
462 1)) 477 (point-min)))
463 (point-min)) 478 (message (buffer-substring message-beg (point-max))))
464 (point-max))))
465 (when (and vector 479 (when (and vector
466 (not (and erc-match-exclude-server-buffer 480 (not (and erc-match-exclude-server-buffer
467 (erc-server-buffer-p)))) 481 (erc-server-buffer-p))))
@@ -498,7 +512,12 @@ Use this defun with `erc-insert-modify-hook'."
498 (while (re-search-forward match-regex nil t) 512 (while (re-search-forward match-regex nil t)
499 (erc-put-text-property (match-beginning 0) (match-end 0) 513 (erc-put-text-property (match-beginning 0) (match-end 0)
500 'font-lock-face match-face)))) 514 'font-lock-face match-face))))
501 ;; Highlight the whole message 515 ;; Highlight the whole message (not including the nick)
516 ((eq match-htype 'message)
517 (erc-put-text-property
518 message-beg (point-max)
519 'font-lock-face match-face (current-buffer)))
520 ;; Highlight the whole message (including the nick)
502 ((eq match-htype 'all) 521 ((eq match-htype 'all)
503 (erc-put-text-property 522 (erc-put-text-property
504 (point-min) (point-max) 523 (point-min) (point-max)
diff --git a/lisp/erc/erc-notify.el b/lisp/erc/erc-notify.el
index 1b092c8a6a9..144a981f832 100644
--- a/lisp/erc/erc-notify.el
+++ b/lisp/erc/erc-notify.el
@@ -181,7 +181,7 @@ nick from `erc-last-ison' to prevent any further notifications."
181 (let ((nick (erc-extract-nick (erc-response.sender parsed)))) 181 (let ((nick (erc-extract-nick (erc-response.sender parsed))))
182 (when (and (erc-member-ignore-case nick erc-notify-list) 182 (when (and (erc-member-ignore-case nick erc-notify-list)
183 (erc-member-ignore-case nick erc-last-ison)) 183 (erc-member-ignore-case nick erc-last-ison))
184 (setq erc-last-ison (erc-delete-if 184 (setq erc-last-ison (cl-delete-if
185 (let ((nick-down (erc-downcase nick))) 185 (let ((nick-down (erc-downcase nick)))
186 (lambda (el) 186 (lambda (el)
187 (string= nick-down (erc-downcase el)))) 187 (string= nick-down (erc-downcase el))))
diff --git a/lisp/erc/erc-pcomplete.el b/lisp/erc/erc-pcomplete.el
index 7643fa85b96..f8b7e13be02 100644
--- a/lisp/erc/erc-pcomplete.el
+++ b/lisp/erc/erc-pcomplete.el
@@ -41,7 +41,6 @@
41 41
42(require 'pcomplete) 42(require 'pcomplete)
43(require 'erc) 43(require 'erc)
44(require 'erc-compat)
45(require 'time-date) 44(require 'time-date)
46 45
47(defgroup erc-pcomplete nil 46(defgroup erc-pcomplete nil
diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el
index cbab2f9da2b..08970f2d70e 100644
--- a/lisp/erc/erc-stamp.el
+++ b/lisp/erc/erc-stamp.el
@@ -35,7 +35,6 @@
35;;; Code: 35;;; Code:
36 36
37(require 'erc) 37(require 'erc)
38(require 'erc-compat)
39 38
40(defgroup erc-stamp nil 39(defgroup erc-stamp nil
41 "For long conversation on IRC it is sometimes quite 40 "For long conversation on IRC it is sometimes quite
diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el
index 41d8fc1a98f..3398c8b9d0c 100644
--- a/lisp/erc/erc-track.el
+++ b/lisp/erc/erc-track.el
@@ -36,7 +36,6 @@
36 36
37(eval-when-compile (require 'cl-lib)) 37(eval-when-compile (require 'cl-lib))
38(require 'erc) 38(require 'erc)
39(require 'erc-compat)
40(require 'erc-match) 39(require 'erc-match)
41 40
42;;; Code: 41;;; Code:
@@ -329,9 +328,8 @@ important."
329 328
330(defun erc-track-remove-from-mode-line () 329(defun erc-track-remove-from-mode-line ()
331 "Remove `erc-track-modified-channels' from the mode-line." 330 "Remove `erc-track-modified-channels' from the mode-line."
332 (when (boundp 'mode-line-modes) 331 (setq mode-line-modes
333 (setq mode-line-modes 332 (remove '(t erc-modified-channels-object) mode-line-modes))
334 (remove '(t erc-modified-channels-object) mode-line-modes)))
335 (when (consp global-mode-string) 333 (when (consp global-mode-string)
336 (setq global-mode-string 334 (setq global-mode-string
337 (delq 'erc-modified-channels-object global-mode-string)))) 335 (delq 'erc-modified-channels-object global-mode-string))))
@@ -341,12 +339,10 @@ important."
341See `erc-track-position-in-mode-line' for possible values." 339See `erc-track-position-in-mode-line' for possible values."
342 ;; CVS Emacs has a new format string, and global-mode-string 340 ;; CVS Emacs has a new format string, and global-mode-string
343 ;; is very far to the right. 341 ;; is very far to the right.
344 (cond ((and (eq position 'before-modes) 342 (cond ((eq position 'before-modes)
345 (boundp 'mode-line-modes))
346 (add-to-list 'mode-line-modes 343 (add-to-list 'mode-line-modes
347 '(t erc-modified-channels-object))) 344 '(t erc-modified-channels-object)))
348 ((and (eq position 'after-modes) 345 ((eq position 'after-modes)
349 (boundp 'mode-line-modes))
350 (add-to-list 'mode-line-modes 346 (add-to-list 'mode-line-modes
351 '(t erc-modified-channels-object) t)) 347 '(t erc-modified-channels-object) t))
352 ((eq position t) 348 ((eq position t)
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el
index 41d7516fbb4..8712113790b 100644
--- a/lisp/erc/erc.el
+++ b/lisp/erc/erc.el
@@ -57,12 +57,12 @@
57 57
58(load "erc-loaddefs" nil t) 58(load "erc-loaddefs" nil t)
59 59
60(eval-when-compile (require 'cl-lib)) 60(require 'cl-lib)
61(require 'font-lock) 61(require 'font-lock)
62(require 'format-spec)
62(require 'pp) 63(require 'pp)
63(require 'thingatpt) 64(require 'thingatpt)
64(require 'auth-source) 65(require 'auth-source)
65(require 'erc-compat)
66(require 'time-date) 66(require 'time-date)
67(require 'iso8601) 67(require 'iso8601)
68(eval-when-compile (require 'subr-x)) 68(eval-when-compile (require 'subr-x))
@@ -877,8 +877,8 @@ See `erc-server-flood-margin' for other flood-related parameters.")
877;; Script parameters 877;; Script parameters
878 878
879(defcustom erc-startup-file-list 879(defcustom erc-startup-file-list
880 (list (concat erc-user-emacs-directory ".ercrc.el") 880 (list (concat user-emacs-directory ".ercrc.el")
881 (concat erc-user-emacs-directory ".ercrc") 881 (concat user-emacs-directory ".ercrc")
882 "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc") 882 "~/.ercrc.el" "~/.ercrc" ".ercrc.el" ".ercrc")
883 "List of files to try for a startup script. 883 "List of files to try for a startup script.
884The first existent and readable one will get executed. 884The first existent and readable one will get executed.
@@ -1306,7 +1306,7 @@ Example:
1306 (enable (intern (format "erc-%s-enable" (downcase sn)))) 1306 (enable (intern (format "erc-%s-enable" (downcase sn))))
1307 (disable (intern (format "erc-%s-disable" (downcase sn))))) 1307 (disable (intern (format "erc-%s-disable" (downcase sn)))))
1308 `(progn 1308 `(progn
1309 (erc-define-minor-mode 1309 (define-minor-mode
1310 ,mode 1310 ,mode
1311 ,(format "Toggle ERC %S mode. 1311 ,(format "Toggle ERC %S mode.
1312With a prefix argument ARG, enable %s if ARG is positive, 1312With a prefix argument ARG, enable %s if ARG is positive,
@@ -1489,8 +1489,7 @@ Defaults to the server buffer."
1489(define-derived-mode erc-mode fundamental-mode "ERC" 1489(define-derived-mode erc-mode fundamental-mode "ERC"
1490 "Major mode for Emacs IRC." 1490 "Major mode for Emacs IRC."
1491 (setq local-abbrev-table erc-mode-abbrev-table) 1491 (setq local-abbrev-table erc-mode-abbrev-table)
1492 (when (boundp 'next-line-add-newlines) 1492 (set (make-local-variable 'next-line-add-newlines) nil)
1493 (set (make-local-variable 'next-line-add-newlines) nil))
1494 (setq line-move-ignore-invisible t) 1493 (setq line-move-ignore-invisible t)
1495 (set (make-local-variable 'paragraph-separate) 1494 (set (make-local-variable 'paragraph-separate)
1496 (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)")) 1495 (concat "\C-l\\|\\(^" (regexp-quote (erc-prompt)) "\\)"))
@@ -2688,7 +2687,7 @@ displayed hostnames."
2688otherwise `erc-server-announced-name'. SERVER is matched against 2687otherwise `erc-server-announced-name'. SERVER is matched against
2689`erc-common-server-suffixes'." 2688`erc-common-server-suffixes'."
2690 (when server 2689 (when server
2691 (or (cdar (erc-remove-if-not 2690 (or (cdar (cl-remove-if-not
2692 (lambda (net) (string-match (car net) server)) 2691 (lambda (net) (string-match (car net) server))
2693 erc-common-server-suffixes)) 2692 erc-common-server-suffixes))
2694 erc-server-announced-name))) 2693 erc-server-announced-name)))
@@ -3725,8 +3724,9 @@ the message given by REASON."
3725 x-toolkit-scroll-bars))) 3724 x-toolkit-scroll-bars)))
3726 "") 3725 "")
3727 (if (featurep 'multi-tty) ", multi-tty" "")) 3726 (if (featurep 'multi-tty) ", multi-tty" ""))
3728 (if erc-emacs-build-time 3727 (if emacs-build-time
3729 (concat " of " erc-emacs-build-time) 3728 (concat " of " (format-time-string
3729 "%Y-%m-%d" emacs-build-time))
3730 ""))) 3730 "")))
3731 t) 3731 t)
3732 3732
@@ -4573,7 +4573,7 @@ See also: `erc-echo-notice-in-user-buffers',
4573 ((string-match "^-" mode) 4573 ((string-match "^-" mode)
4574 ;; Remove the unbanned masks from the ban list 4574 ;; Remove the unbanned masks from the ban list
4575 (setq erc-channel-banlist 4575 (setq erc-channel-banlist
4576 (erc-delete-if 4576 (cl-delete-if
4577 #'(lambda (y) 4577 #'(lambda (y)
4578 (member (upcase (cdr y)) 4578 (member (upcase (cdr y))
4579 (mapcar #'upcase 4579 (mapcar #'upcase
@@ -4594,7 +4594,7 @@ See also: `erc-echo-notice-in-user-buffers',
4594 "Group LIST into sublists of length N." 4594 "Group LIST into sublists of length N."
4595 (cond ((null list) nil) 4595 (cond ((null list) nil)
4596 ((null (nthcdr n list)) (list list)) 4596 ((null (nthcdr n list)) (list list))
4597 (t (cons (erc-subseq list 0 n) (erc-group-list (nthcdr n list) n))))) 4597 (t (cons (cl-subseq list 0 n) (erc-group-list (nthcdr n list) n)))))
4598 4598
4599 4599
4600;;; MOTD numreplies 4600;;; MOTD numreplies
@@ -6183,8 +6183,7 @@ non-nil value is found.
6183 output (apply #'format format-args)) 6183 output (apply #'format format-args))
6184 ;; Change all "1 units" to "1 unit". 6184 ;; Change all "1 units" to "1 unit".
6185 (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output) 6185 (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output)
6186 (setq output (erc-replace-match-subexpression-in-string 6186 (setq output (replace-match "" nil nil output 2)))
6187 "" output (match-string 2 output) 2 (match-beginning 2))))
6188 output)) 6187 output))
6189 6188
6190 6189
diff --git a/lisp/eshell/em-rebind.el b/lisp/eshell/em-rebind.el
index bf5a4bf1afe..7991c631772 100644
--- a/lisp/eshell/em-rebind.el
+++ b/lisp/eshell/em-rebind.el
@@ -114,7 +114,6 @@ This is default behavior of shells like bash."
114 backward-list 114 backward-list
115 forward-page 115 forward-page
116 backward-page 116 backward-page
117 forward-point
118 forward-paragraph 117 forward-paragraph
119 backward-paragraph 118 backward-paragraph
120 backward-prefix-chars 119 backward-prefix-chars
diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el
index 0aa4ec4d16c..b4154861908 100644
--- a/lisp/eshell/esh-io.el
+++ b/lisp/eshell/esh-io.el
@@ -382,12 +382,7 @@ it defaults to `insert'."
382 "Set handle INDEX, using MODE, to point to TARGET." 382 "Set handle INDEX, using MODE, to point to TARGET."
383 (when target 383 (when target
384 (if (and (stringp target) 384 (if (and (stringp target)
385 (or (cond 385 (or (string= target null-device)
386 ((boundp 'null-device)
387 (string= target null-device))
388 ((boundp 'grep-null-device)
389 (string= target grep-null-device))
390 (t nil))
391 (string= target "/dev/null"))) 386 (string= target "/dev/null")))
392 (aset eshell-current-handles index nil) 387 (aset eshell-current-handles index nil)
393 (let ((where (eshell-get-target target mode)) 388 (let ((where (eshell-get-target target mode))
diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el
index d0147b345aa..8799007c596 100644
--- a/lisp/eshell/esh-mode.el
+++ b/lisp/eshell/esh-mode.el
@@ -690,46 +690,47 @@ newline."
690 "Send the output from PROCESS (STRING) to the interactive display. 690 "Send the output from PROCESS (STRING) to the interactive display.
691This is done after all necessary filtering has been done." 691This is done after all necessary filtering has been done."
692 (let ((oprocbuf (if process (process-buffer process) 692 (let ((oprocbuf (if process (process-buffer process)
693 (current-buffer))) 693 (current-buffer)))
694 (inhibit-point-motion-hooks t) 694 (inhibit-point-motion-hooks t)
695 (inhibit-modification-hooks t)) 695 (inhibit-modification-hooks t))
696 (let ((functions eshell-preoutput-filter-functions)) 696 (when (and string oprocbuf (buffer-name oprocbuf))
697 (while (and functions string) 697 (with-current-buffer oprocbuf
698 (setq string (funcall (car functions) string)) 698 (let ((functions eshell-preoutput-filter-functions))
699 (setq functions (cdr functions)))) 699 (while (and functions string)
700 (if (and string oprocbuf (buffer-name oprocbuf)) 700 (setq string (funcall (car functions) string))
701 (let (opoint obeg oend) 701 (setq functions (cdr functions))))
702 (with-current-buffer oprocbuf 702 (when string
703 (setq opoint (point)) 703 (let (opoint obeg oend)
704 (setq obeg (point-min)) 704 (setq opoint (point))
705 (setq oend (point-max)) 705 (setq obeg (point-min))
706 (let ((buffer-read-only nil) 706 (setq oend (point-max))
707 (nchars (length string)) 707 (let ((buffer-read-only nil)
708 (ostart nil)) 708 (nchars (length string))
709 (widen) 709 (ostart nil))
710 (goto-char eshell-last-output-end) 710 (widen)
711 (setq ostart (point)) 711 (goto-char eshell-last-output-end)
712 (if (<= (point) opoint) 712 (setq ostart (point))
713 (setq opoint (+ opoint nchars))) 713 (if (<= (point) opoint)
714 (if (< (point) obeg) 714 (setq opoint (+ opoint nchars)))
715 (setq obeg (+ obeg nchars))) 715 (if (< (point) obeg)
716 (if (<= (point) oend) 716 (setq obeg (+ obeg nchars)))
717 (setq oend (+ oend nchars))) 717 (if (<= (point) oend)
718 (setq oend (+ oend nchars)))
718 ;; Let the ansi-color overlay hooks run. 719 ;; Let the ansi-color overlay hooks run.
719 (let ((inhibit-modification-hooks nil)) 720 (let ((inhibit-modification-hooks nil))
720 (insert-before-markers string)) 721 (insert-before-markers string))
721 (if (= (window-start) (point)) 722 (if (= (window-start) (point))
722 (set-window-start (selected-window) 723 (set-window-start (selected-window)
723 (- (point) nchars))) 724 (- (point) nchars)))
724 (if (= (point) eshell-last-input-end) 725 (if (= (point) eshell-last-input-end)
725 (set-marker eshell-last-input-end 726 (set-marker eshell-last-input-end
726 (- eshell-last-input-end nchars))) 727 (- eshell-last-input-end nchars)))
727 (set-marker eshell-last-output-start ostart) 728 (set-marker eshell-last-output-start ostart)
728 (set-marker eshell-last-output-end (point)) 729 (set-marker eshell-last-output-end (point))
729 (force-mode-line-update)) 730 (force-mode-line-update))
730 (narrow-to-region obeg oend) 731 (narrow-to-region obeg oend)
731 (goto-char opoint) 732 (goto-char opoint)
732 (eshell-run-output-filters)))))) 733 (eshell-run-output-filters)))))))
733 734
734(defun eshell-run-output-filters () 735(defun eshell-run-output-filters ()
735 "Run the `eshell-output-filter-functions' on the current output." 736 "Run the `eshell-output-filter-functions' on the current output."
diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el
index 5ffb159b575..6698ca45de4 100644
--- a/lisp/eshell/eshell.el
+++ b/lisp/eshell/eshell.el
@@ -384,15 +384,6 @@ corresponding to a successful execution."
384 (set status-var eshell-last-command-status)) 384 (set status-var eshell-last-command-status))
385 (cadr result)))))) 385 (cadr result))))))
386 386
387;;;_* Reporting bugs
388;;
389;; If you do encounter a bug, on any system, please report
390;; it -- in addition to any particular oddities in your configuration
391;; -- so that the problem may be corrected for the benefit of others.
392
393;;;###autoload
394(define-obsolete-function-alias 'eshell-report-bug 'report-emacs-bug "23.1")
395
396;;; Code: 387;;; Code:
397 388
398(defun eshell-unload-all-modules () 389(defun eshell-unload-all-modules ()
diff --git a/lisp/ffap.el b/lisp/ffap.el
index ceba9d26223..28f566dd93a 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1109,6 +1109,121 @@ The arguments CHARS, BEG and END are handled as described in
1109 ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95. 1109 ;; Added at suggestion of RHOGEE (for ff-paths), 7/24/95.
1110 "Last string returned by the function `ffap-string-at-point'.") 1110 "Last string returned by the function `ffap-string-at-point'.")
1111 1111
1112(defcustom ffap-file-name-with-spaces nil
1113 "If non-nil, enable looking for paths with spaces in `ffap-string-at-point'.
1114Enabling this variable may lead to `find-file-at-point' guessing
1115wrong more often when trying to find a file name intermingled
1116with normal text, but can be useful when working on systems that
1117normally use spaces in file names (like Microsoft Windows and the
1118like)."
1119 :type 'boolean
1120 :version "28.1")
1121
1122(defun ffap-search-backward-file-end (&optional dir-separator end)
1123 "Search backward position point where file would probably end.
1124Optional DIR-SEPARATOR defaults to \"/\". The search maximum is
1125`line-end-position' or optional END point.
1126
1127Suppose the cursor is somewhere that might be near end of file,
1128the guessing would position point before punctuation (like comma)
1129after the file extension:
1130
1131 C:\temp\file.log, which contain ....
1132 =============================== (before)
1133 ---------------- (after)
1134
1135
1136 C:\temp\file.log on Windows or /tmp/file.log on Unix
1137 =============================== (before)
1138 ---------------- (after)
1139
1140The strategy is to search backward until DIR-SEPARATOR which defaults to
1141\"/\" and then take educated guesses.
1142
1143Move point and return point if an adjustment was done."
1144 (unless dir-separator
1145 (setq dir-separator "/"))
1146 (let ((opoint (point))
1147 point punct end whitespace-p)
1148 (when (re-search-backward
1149 (regexp-quote dir-separator) (line-beginning-position) t)
1150 ;; Move to the beginning of the match..
1151 (forward-char 1)
1152 ;; ... until typical punctuation.
1153 (when (re-search-forward "\\([][<>()\"'`,.:;]\\)"
1154 (or end
1155 (line-end-position))
1156 t)
1157 (setq end (match-end 0))
1158 (setq punct (match-string 1))
1159 (setq whitespace-p (looking-at "[ \t\r\n]\\|$"))
1160 (goto-char end)
1161 (cond
1162 ((and (string-equal punct ".")
1163 whitespace-p) ;end of sentence
1164 (setq point (1- (point))))
1165 ((and (string-equal punct ".")
1166 (looking-at "[a-zA-Z0-9.]+")) ;possibly file extension
1167 (setq point (match-end 0)))
1168 (t
1169 (setq point (point)))))
1170 (goto-char opoint)
1171 (when point
1172 (goto-char point)
1173 point))))
1174
1175(defun ffap-search-forward-file-end (&optional dir-separator)
1176 "Search DIR-SEPARATOR and position point at file's maximum ending.
1177This includes spaces.
1178Optional DIR-SEPARATOR defaults to \"/\".
1179Call `ffap-search-backward-file-end' to refine the ending point."
1180 (unless dir-separator
1181 (setq dir-separator "/"))
1182 (let* ((chars ;expected chars in file name
1183 (concat "[^][^<>()\"'`;,#*|"
1184 ;; exclude the opposite as we know the separator
1185 (if (string-equal dir-separator "/")
1186 "\\\\"
1187 "/")
1188 "\t\r\n]"))
1189 (re (concat
1190 chars "*"
1191 (if dir-separator
1192 (regexp-quote dir-separator)
1193 "/")
1194 chars "*")))
1195 (when (looking-at re)
1196 (goto-char (match-end 0)))))
1197
1198(defun ffap-dir-separator-near-point ()
1199 "Search backward and forward for closest slash or backlash in line.
1200Return string slash or backslash. Point is moved to closest position."
1201 (let ((point (point))
1202 str pos)
1203 (when (looking-at ".*?/")
1204 (setq str "/"
1205 pos (match-end 0)))
1206 (when (and (looking-at ".*?\\\\")
1207 (or (null pos)
1208 (< (match-end 0) pos)))
1209 (setq str "\\"
1210 pos (match-end 0)))
1211 (goto-char point)
1212 (when (and (re-search-backward "/" (line-beginning-position) t)
1213 (or (null pos)
1214 (< (- point (point)) (- pos point))))
1215 (setq str "/"
1216 pos (1+ (point)))) ;1+ to keep cursor at the end of char
1217 (goto-char point)
1218 (when (and (re-search-backward "\\\\" (line-beginning-position) t)
1219 (or (null pos)
1220 (< (- point (point)) (- pos point))))
1221 (setq str "\\"
1222 pos (1+ (point))))
1223 (when pos
1224 (goto-char pos))
1225 str))
1226
1112(defun ffap-string-at-point (&optional mode) 1227(defun ffap-string-at-point (&optional mode)
1113 "Return a string of characters from around point. 1228 "Return a string of characters from around point.
1114 1229
@@ -1128,7 +1243,8 @@ Set the variables `ffap-string-at-point' and
1128 1243
1129When the region is active and larger than `ffap-max-region-length', 1244When the region is active and larger than `ffap-max-region-length',
1130return an empty string, and set `ffap-string-at-point-region' to '(1 1)." 1245return an empty string, and set `ffap-string-at-point-region' to '(1 1)."
1131 (let* ((args 1246 (let* (dir-separator
1247 (args
1132 (cdr 1248 (cdr
1133 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist) 1249 (or (assq (or mode major-mode) ffap-string-at-point-mode-alist)
1134 (assq 'file ffap-string-at-point-mode-alist)))) 1250 (assq 'file ffap-string-at-point-mode-alist))))
@@ -1137,14 +1253,25 @@ return an empty string, and set `ffap-string-at-point-region' to '(1 1)."
1137 (beg (if region-selected 1253 (beg (if region-selected
1138 (region-beginning) 1254 (region-beginning)
1139 (save-excursion 1255 (save-excursion
1140 (skip-chars-backward (car args)) 1256 (if (and ffap-file-name-with-spaces
1141 (skip-chars-forward (nth 1 args) pt) 1257 (memq mode '(nil file)))
1258 (when (setq dir-separator (ffap-dir-separator-near-point))
1259 (while (re-search-backward
1260 (regexp-quote dir-separator)
1261 (line-beginning-position) t)
1262 (goto-char (match-beginning 0))))
1263 (skip-chars-backward (car args))
1264 (skip-chars-forward (nth 1 args) pt))
1142 (point)))) 1265 (point))))
1143 (end (if region-selected 1266 (end (if region-selected
1144 (region-end) 1267 (region-end)
1145 (save-excursion 1268 (save-excursion
1146 (skip-chars-forward (car args)) 1269 (skip-chars-forward (car args))
1147 (skip-chars-backward (nth 2 args) pt) 1270 (skip-chars-backward (nth 2 args) pt)
1271 (when (and ffap-file-name-with-spaces
1272 (memq mode '(nil file)))
1273 (ffap-search-forward-file-end dir-separator)
1274 (ffap-search-backward-file-end dir-separator))
1148 (point)))) 1275 (point))))
1149 (region-len (- (max beg end) (min beg end)))) 1276 (region-len (- (max beg end) (min beg end))))
1150 1277
@@ -1825,12 +1952,6 @@ Only intended for interactive use."
1825(defalias 'find-file-literally-at-point 'ffap-literally) 1952(defalias 'find-file-literally-at-point 'ffap-literally)
1826 1953
1827 1954
1828;;; Bug Reporter:
1829
1830(define-obsolete-function-alias 'ffap-bug 'report-emacs-bug "23.1")
1831(define-obsolete-function-alias 'ffap-submit-bug 'report-emacs-bug "23.1")
1832
1833
1834;;; Hooks for Gnus, VM, Rmail: 1955;;; Hooks for Gnus, VM, Rmail:
1835;; 1956;;
1836;; If you do not like these bindings, write versions with whatever 1957;; If you do not like these bindings, write versions with whatever
diff --git a/lisp/files.el b/lisp/files.el
index 9270f334afa..975f78e8527 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -926,7 +926,10 @@ one or more of those symbols."
926 (logior (if (memq 'executable predicate) 1 0) 926 (logior (if (memq 'executable predicate) 1 0)
927 (if (memq 'writable predicate) 2 0) 927 (if (memq 'writable predicate) 2 0)
928 (if (memq 'readable predicate) 4 0)))) 928 (if (memq 'readable predicate) 4 0))))
929 (locate-file-internal filename path suffixes predicate)) 929 (let ((file (locate-file-internal filename path suffixes predicate)))
930 (if (and file (string-match "\\.eln\\'" file))
931 (gethash (file-name-nondirectory file) comp-eln-to-el-h)
932 file)))
930 933
931(defun locate-file-completion-table (dirs suffixes string pred action) 934(defun locate-file-completion-table (dirs suffixes string pred action)
932 "Do completion for file names passed to `locate-file'." 935 "Do completion for file names passed to `locate-file'."
@@ -985,14 +988,6 @@ one or more of those symbols."
985 (completion-table-with-context 988 (completion-table-with-context
986 string-dir names string-file pred action))))) 989 string-dir names string-file pred action)))))
987 990
988(defun locate-file-completion (string path-and-suffixes action)
989 "Do completion for file names passed to `locate-file'.
990PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)."
991 (declare (obsolete locate-file-completion-table "23.1"))
992 (locate-file-completion-table (car path-and-suffixes)
993 (cdr path-and-suffixes)
994 string nil action))
995
996(defvar locate-dominating-stop-dir-regexp 991(defvar locate-dominating-stop-dir-regexp
997 (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'") 992 (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'")
998 "Regexp of directory names that stop the search in `locate-dominating-file'. 993 "Regexp of directory names that stop the search in `locate-dominating-file'.
diff --git a/lisp/forms.el b/lisp/forms.el
index fcb6075f94b..83daabdcd6e 100644
--- a/lisp/forms.el
+++ b/lisp/forms.el
@@ -504,12 +504,9 @@ Commands: Equivalent keys in read-only mode:
504 (setq forms-new-record-filter nil) 504 (setq forms-new-record-filter nil)
505 (setq forms-modified-record-filter nil) 505 (setq forms-modified-record-filter nil)
506 506
507 ;; If running Emacs 19 under X, setup faces to show read-only and 507 ;; Setup faces to show read-only and read-write fields.
508 ;; read-write fields. 508 (make-local-variable 'forms-ro-face)
509 (if (fboundp 'make-face) 509 (make-local-variable 'forms-rw-face)
510 (progn
511 (make-local-variable 'forms-ro-face)
512 (make-local-variable 'forms-rw-face)))
513 510
514 ;; eval the buffer, should set variables 511 ;; eval the buffer, should set variables
515 ;;(message "forms: processing control file...") 512 ;;(message "forms: processing control file...")
@@ -609,16 +606,14 @@ Commands: Equivalent keys in read-only mode:
609 (setq forms--mode-setup t) 606 (setq forms--mode-setup t)
610 607
611 ;; Copy desired faces to the actual variables used by the forms formatter. 608 ;; Copy desired faces to the actual variables used by the forms formatter.
612 (if (fboundp 'make-face) 609 (make-local-variable 'forms--ro-face)
610 (make-local-variable 'forms--rw-face)
611 (if forms-read-only
613 (progn 612 (progn
614 (make-local-variable 'forms--ro-face) 613 (setq forms--ro-face forms-ro-face)
615 (make-local-variable 'forms--rw-face) 614 (setq forms--rw-face forms-ro-face))
616 (if forms-read-only 615 (setq forms--ro-face forms-ro-face)
617 (progn 616 (setq forms--rw-face forms-rw-face))
618 (setq forms--ro-face forms-ro-face)
619 (setq forms--rw-face forms-ro-face))
620 (setq forms--ro-face forms-ro-face)
621 (setq forms--rw-face forms-rw-face))))
622 617
623 ;; Make more local variables. 618 ;; Make more local variables.
624 (make-local-variable 'forms--file-buffer) 619 (make-local-variable 'forms--file-buffer)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 4363860eac8..c53f81fe026 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -1913,7 +1913,8 @@ increase the score of each group you read."
1913 "," gnus-summary-best-unread-article 1913 "," gnus-summary-best-unread-article
1914 "[" gnus-summary-prev-unseen-article 1914 "[" gnus-summary-prev-unseen-article
1915 "]" gnus-summary-next-unseen-article 1915 "]" gnus-summary-next-unseen-article
1916 "\M-s" gnus-summary-search-article-forward 1916 "\M-s\M-s" gnus-summary-search-article-forward
1917 "\M-s\M-r" gnus-summary-search-article-backward
1917 "\M-r" gnus-summary-search-article-backward 1918 "\M-r" gnus-summary-search-article-backward
1918 "\M-S" gnus-summary-repeat-search-article-forward 1919 "\M-S" gnus-summary-repeat-search-article-forward
1919 "\M-R" gnus-summary-repeat-search-article-backward 1920 "\M-R" gnus-summary-repeat-search-article-backward
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index ab625be9e37..07ff4890385 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -2751,16 +2751,17 @@ OpenPGP header will be left out. If all the values are nil,
2751or `message-openpgp-header' is itself nil, the OpenPGP header 2751or `message-openpgp-header' is itself nil, the OpenPGP header
2752will not be inserted." 2752will not be inserted."
2753 :type '(choice 2753 :type '(choice
2754 (const nil :tag "Don't add OpenPGP header") 2754 (const :tag "Don't add OpenPGP header" nil)
2755 (list (choice (string :tag "ID") 2755 (list :tag "Use OpenPGP header"
2756 (const nil :tag "No ID")) 2756 (choice (string :tag "ID")
2757 (const :tag "No ID" nil))
2757 (choice (string :tag "Key") 2758 (choice (string :tag "Key")
2758 (const nil :tag "No Key")) 2759 (const :tag "No Key" nil))
2759 (choice (other nil :tag "None") 2760 (choice (other :tag "None" nil)
2760 (const "unprotected" :tag "Unprotected") 2761 (const :tag "Unprotected" "unprotected")
2761 (const "sign" :tag "Sign") 2762 (const :tag "Sign" "sign")
2762 (const "encrypt" :tag "Encrypt") 2763 (const :tag "Encrypt" "encrypt")
2763 (const "signencrypt" :tag "Sign and Encrypt")))) 2764 (const :tag "Sign and Encrypt" "signencrypt"))))
2764 :version "28.1") 2765 :version "28.1")
2765 2766
2766(defun message-add-openpgp-header () 2767(defun message-add-openpgp-header ()
@@ -2768,32 +2769,34 @@ will not be inserted."
2768 2769
2769Header will be constructed as specified in `message-openpgp-header'. 2770Header will be constructed as specified in `message-openpgp-header'.
2770 2771
2771Consider adding this function to `message-send-hook'." 2772Consider adding this function to `message-header-setup-hook'"
2772 ;; See https://tools.ietf.org/html/draft-josefsson-openpgp-mailnews-header 2773 ;; See https://tools.ietf.org/html/draft-josefsson-openpgp-mailnews-header
2773 (when (and message-openpgp-header 2774 (when (and message-openpgp-header
2774 (or (nth 0 message-openpgp-header) 2775 (or (nth 0 message-openpgp-header)
2775 (nth 1 message-openpgp-header) 2776 (nth 1 message-openpgp-header)
2776 (nth 2 message-openpgp-header))) 2777 (nth 2 message-openpgp-header)))
2777 (with-temp-buffer 2778 (message-add-header
2778 (insert "OpenPGP: ") 2779 (with-temp-buffer
2779 ;; add ID 2780 (insert "OpenPGP: ")
2780 (let (need-sep) 2781 ;; add ID
2781 (when (nth 0 message-openpgp-header) 2782 (let (need-sep)
2782 (insert "id=" (nth 0 message-openpgp-header)) 2783 (when (nth 0 message-openpgp-header)
2783 (setq need-sep t)) 2784 (insert "id=" (nth 0 message-openpgp-header))
2784 ;; add URL 2785 (setq need-sep t))
2785 (when (nth 1 message-openpgp-header) 2786 ;; add URL
2786 (when need-sep (insert "; ")) 2787 (when (nth 1 message-openpgp-header)
2787 (if (string-match-p ";") 2788 (when need-sep (insert "; "))
2788 (insert "url=\"" (nth 1 message-openpgp-header) "\"") 2789 (if (string-match-p ";")
2789 (insert "url=\"" (nth 1 message-openpgp-header) "\"")) 2790 (insert "url=\"" (nth 1 message-openpgp-header) "\"")
2790 (setq need-sep t)) 2791 (insert "url=\"" (nth 1 message-openpgp-header) "\""))
2791 ;; add preference 2792 (setq need-sep t))
2792 (when (nth 2 message-openpgp-header) 2793 ;; add preference
2793 (when need-sep (insert "; ")) 2794 (when (nth 2 message-openpgp-header)
2794 (insert "preference=" (nth 2 message-openpgp-header)))) 2795 (when need-sep (insert "; "))
2795 ;; insert header 2796 (insert "preference=" (nth 2 message-openpgp-header))))
2796 (message-add-header (buffer-string))))) 2797 ;; insert header
2798 (buffer-string)))
2799 (message-sort-headers)))
2797 2800
2798 2801
2799 2802
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index 4754f37a2da..acddb300339 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -329,7 +329,6 @@ Whether the passphrase is cached at all is controlled by
329 (autoload 'epg-verify-string "epg") 329 (autoload 'epg-verify-string "epg")
330 (autoload 'epg-sign-string "epg") 330 (autoload 'epg-sign-string "epg")
331 (autoload 'epg-encrypt-string "epg") 331 (autoload 'epg-encrypt-string "epg")
332 (autoload 'epg-passphrase-callback-function "epg")
333 (autoload 'epg-context-set-passphrase-callback "epg") 332 (autoload 'epg-context-set-passphrase-callback "epg")
334 (autoload 'epg-sub-key-fingerprint "epg") 333 (autoload 'epg-sub-key-fingerprint "epg")
335 (autoload 'epg-configuration "epg-config") 334 (autoload 'epg-configuration "epg-config")
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 8be1b84e52f..88864ea3579 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -242,7 +242,6 @@ Whether the passphrase is cached at all is controlled by
242(defvar epg-user-id-alist) 242(defvar epg-user-id-alist)
243 243
244(autoload 'epg-make-context "epg") 244(autoload 'epg-make-context "epg")
245(autoload 'epg-passphrase-callback-function "epg")
246(autoload 'epa-select-keys "epa") 245(autoload 'epa-select-keys "epa")
247(autoload 'epg-list-keys "epg") 246(autoload 'epg-list-keys "epg")
248(autoload 'epg-context-set-armor "epg") 247(autoload 'epg-context-set-armor "epg")
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index d1d150ad2ee..45c9bbfe905 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -712,7 +712,6 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
712(autoload 'epg-verify-string "epg") 712(autoload 'epg-verify-string "epg")
713(autoload 'epg-sign-string "epg") 713(autoload 'epg-sign-string "epg")
714(autoload 'epg-encrypt-string "epg") 714(autoload 'epg-encrypt-string "epg")
715(autoload 'epg-passphrase-callback-function "epg")
716(autoload 'epg-context-set-passphrase-callback "epg") 715(autoload 'epg-context-set-passphrase-callback "epg")
717(autoload 'epg-key-sub-key-list "epg") 716(autoload 'epg-key-sub-key-list "epg")
718(autoload 'epg-sub-key-capability "epg") 717(autoload 'epg-sub-key-capability "epg")
diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el
index d41f32801ee..5504a520783 100644
--- a/lisp/gnus/smiley.el
+++ b/lisp/gnus/smiley.el
@@ -56,14 +56,11 @@
56 56
57(defvar smiley-data-directory) 57(defvar smiley-data-directory)
58 58
59(defcustom smiley-style 59;; In batch mode, attributes can be unspecified.
60 (if (and (fboundp 'face-attribute) 60(defcustom smiley-style (if (ignore-errors
61 ;; In batch mode, attributes can be unspecified. 61 (>= (face-attribute 'default :height) 160))
62 (condition-case nil 62 'medium
63 (>= (face-attribute 'default :height) 160) 63 'low-color)
64 (error nil)))
65 'medium
66 'low-color)
67 "Smiley style." 64 "Smiley style."
68 :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14 65 :type '(choice (const :tag "small, 3 colors" low-color) ;; 13x14
69 (const :tag "medium, ~10 colors" medium) ;; 16x16 66 (const :tag "medium, ~10 colors" medium) ;; 16x16
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index afca2cd932e..49cdb4ed5e4 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -333,10 +333,8 @@ suitable file is found, return nil."
333 object (or (if (symbolp type) type) 'defun)))) 333 object (or (if (symbolp type) type) 'defun))))
334 (file-name (if (and true-name 334 (file-name (if (and true-name
335 (string-match "[.]eln\\'" true-name)) 335 (string-match "[.]eln\\'" true-name))
336 (expand-file-name (concat (file-name-base true-name) 336 (gethash (file-name-nondirectory true-name)
337 ".el") 337 comp-eln-to-el-h)
338 (concat (file-name-directory true-name)
339 ".."))
340 true-name))) 338 true-name)))
341 (cond 339 (cond
342 (autoloaded 340 (autoloaded
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index 33ca40f8dec..0ffe77d2763 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -237,17 +237,11 @@ Instead, each hi-lock command will cycle through the faces in
237 "Human-readable lighters for `hi-lock-interactive-patterns'.") 237 "Human-readable lighters for `hi-lock-interactive-patterns'.")
238(put 'hi-lock-interactive-lighters 'permanent-local t) 238(put 'hi-lock-interactive-lighters 'permanent-local t)
239 239
240(define-obsolete-variable-alias 'hi-lock-face-history
241 'hi-lock-face-defaults "23.1")
242(defvar hi-lock-face-defaults 240(defvar hi-lock-face-defaults
243 '("hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-salmon" "hi-aquamarine" 241 '("hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-salmon" "hi-aquamarine"
244 "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb") 242 "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb")
245 "Default faces for hi-lock interactive functions.") 243 "Default faces for hi-lock interactive functions.")
246 244
247(define-obsolete-variable-alias 'hi-lock-regexp-history
248 'regexp-history
249 "23.1")
250
251(defvar hi-lock-file-patterns-prefix "Hi-lock" 245(defvar hi-lock-file-patterns-prefix "Hi-lock"
252 "String used to identify hi-lock patterns at the start of files.") 246 "String used to identify hi-lock patterns at the start of files.")
253 247
diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
index 04a5ccd8d59..ae97bb008af 100644
--- a/lisp/hilit-chg.el
+++ b/lisp/hilit-chg.el
@@ -224,9 +224,6 @@ colors then use this, if you want fancier faces then set
224;; When you invoke highlight-changes-mode, should highlight-changes-visible-mode 224;; When you invoke highlight-changes-mode, should highlight-changes-visible-mode
225;; be on or off? 225;; be on or off?
226 226
227(define-obsolete-variable-alias 'highlight-changes-initial-state
228 'highlight-changes-visibility-initial-state "23.1")
229
230(defcustom highlight-changes-visibility-initial-state t 227(defcustom highlight-changes-visibility-initial-state t
231 "Controls whether changes are initially visible in Highlight Changes mode. 228 "Controls whether changes are initially visible in Highlight Changes mode.
232 229
@@ -236,13 +233,7 @@ When a buffer is in Highlight Changes mode the function
236 :type 'boolean 233 :type 'boolean
237 :group 'highlight-changes) 234 :group 'highlight-changes)
238 235
239;; highlight-changes-global-initial-state has been removed
240
241
242
243;; These are the strings displayed in the mode-line for the minor mode: 236;; These are the strings displayed in the mode-line for the minor mode:
244(define-obsolete-variable-alias 'highlight-changes-active-string
245 'highlight-changes-visible-string "23.1")
246 237
247(defcustom highlight-changes-visible-string " +Chg" 238(defcustom highlight-changes-visible-string " +Chg"
248 "The string used when in Highlight Changes mode and changes are visible. 239 "The string used when in Highlight Changes mode and changes are visible.
@@ -252,9 +243,6 @@ a string with a leading space."
252 (const :tag "None" nil)) 243 (const :tag "None" nil))
253 :group 'highlight-changes) 244 :group 'highlight-changes)
254 245
255(define-obsolete-variable-alias 'highlight-changes-passive-string
256 'highlight-changes-invisible-string "23.1")
257
258(defcustom highlight-changes-invisible-string " -Chg" 246(defcustom highlight-changes-invisible-string " -Chg"
259 "The string used when in Highlight Changes mode and changes are hidden. 247 "The string used when in Highlight Changes mode and changes are hidden.
260This should be set to nil if no indication is desired, or to 248This should be set to nil if no indication is desired, or to
@@ -957,10 +945,6 @@ changes are made, so \\[highlight-changes-next-change] and
957(define-globalized-minor-mode global-highlight-changes-mode 945(define-globalized-minor-mode global-highlight-changes-mode
958 highlight-changes-mode highlight-changes-mode-turn-on) 946 highlight-changes-mode highlight-changes-mode-turn-on)
959 947
960(define-obsolete-function-alias
961 'global-highlight-changes
962 'global-highlight-changes-mode "23.1")
963
964(defun highlight-changes-mode-turn-on () 948(defun highlight-changes-mode-turn-on ()
965 "See if Highlight Changes mode should be turned on for this buffer. 949 "See if Highlight Changes mode should be turned on for this buffer.
966This is called when `global-highlight-changes-mode' is turned on." 950This is called when `global-highlight-changes-mode' is turned on."
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index 6265537e885..4d653972c95 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -556,10 +556,7 @@ If a window system is unavailable, calls `hfy-fallback-color-values'."
556 '(1 2 3)) 556 '(1 2 3))
557 ;;(message ">> %s" color) 557 ;;(message ">> %s" color)
558 (if window-system 558 (if window-system
559 (if (fboundp 'color-values) 559 (color-values color)
560 (color-values color)
561 ;;(message "[%S]" window-system)
562 (x-color-values color))
563 ;; blarg - tty colors are no good - go fetch some X colors: 560 ;; blarg - tty colors are no good - go fetch some X colors:
564 (hfy-fallback-color-values color)))) 561 (hfy-fallback-color-values color))))
565(define-obsolete-function-alias 'hfy-colour-vals #'hfy-color-vals "27.1") 562(define-obsolete-function-alias 'hfy-colour-vals #'hfy-color-vals "27.1")
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 3747ae3d281..8a68df876c1 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -75,7 +75,11 @@ everything preceding the ~/ is discarded so the interactive
75selection process starts again from the user's $HOME.") 75selection process starts again from the user's $HOME.")
76 76
77(defcustom icomplete-show-matches-on-no-input nil 77(defcustom icomplete-show-matches-on-no-input nil
78 "When non-nil, show completions when first prompting for input." 78 "When non-nil, show completions when first prompting for input.
79This also means that if you traverse the list of completions with
80commands like `C-.' and just hit `C-j' (enter) without typing any
81characters, the match under point will be chosen instead of the
82default."
79 :type 'boolean 83 :type 'boolean
80 :version "24.4") 84 :version "24.4")
81 85
@@ -709,7 +713,10 @@ matches exist."
709 (push comp prospects) 713 (push comp prospects)
710 (setq limit t)))) 714 (setq limit t))))
711 (setq prospects (nreverse prospects)) 715 (setq prospects (nreverse prospects))
712 ;; Decorate first of the prospects. 716 ;; Return the first match if the user hits enter.
717 (when icomplete-show-matches-on-no-input
718 (setq completion-content-when-empty (car prospects)))
719 ;; Decorate first of the prospects.
713 (when prospects 720 (when prospects
714 (let ((first (copy-sequence (pop prospects)))) 721 (let ((first (copy-sequence (pop prospects))))
715 (put-text-property 0 (length first) 722 (put-text-property 0 (length first)
diff --git a/lisp/ido.el b/lisp/ido.el
index e834916a6da..c83b700e656 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1523,8 +1523,10 @@ Removes badly formatted data and ignored directories."
1523 (remove-function read-file-name-function #'ido-read-file-name) 1523 (remove-function read-file-name-function #'ido-read-file-name)
1524 (remove-function read-buffer-function #'ido-read-buffer) 1524 (remove-function read-buffer-function #'ido-read-buffer)
1525 (when ido-everywhere 1525 (when ido-everywhere
1526 (add-function :override read-file-name-function #'ido-read-file-name) 1526 (if (not ido-mode)
1527 (add-function :override read-buffer-function #'ido-read-buffer))) 1527 (ido-mode 'both)
1528 (add-function :override read-file-name-function #'ido-read-file-name)
1529 (add-function :override read-buffer-function #'ido-read-buffer))))
1528 1530
1529(defvar ido-minor-mode-map-entry nil) 1531(defvar ido-minor-mode-map-entry nil)
1530 1532
@@ -2216,7 +2218,10 @@ If cursor is not at the end of the user input, move to end of input."
2216 ((and ido-enable-virtual-buffers 2218 ((and ido-enable-virtual-buffers
2217 ido-virtual-buffers 2219 ido-virtual-buffers
2218 (setq filename (assoc buf ido-virtual-buffers))) 2220 (setq filename (assoc buf ido-virtual-buffers)))
2219 (ido-visit-buffer (find-file-noselect (cdr filename)) method t)) 2221 (if (eq method 'kill)
2222 (setq recentf-list
2223 (delete (cdr filename) recentf-list))
2224 (ido-visit-buffer (find-file-noselect (cdr filename)) method t)))
2220 2225
2221 ((and (eq ido-create-new-buffer 'prompt) 2226 ((and (eq ido-create-new-buffer 'prompt)
2222 (null require-match) 2227 (null require-match)
@@ -4073,6 +4078,7 @@ Record command in `command-history' if optional RECORD is non-nil."
4073 (setq buffer (buffer-name buffer))) 4078 (setq buffer (buffer-name buffer)))
4074 (let (win newframe) 4079 (let (win newframe)
4075 (cond 4080 (cond
4081 ;; "Killing" of virtual buffers is handled in `ido-buffer-internal'.
4076 ((eq method 'kill) 4082 ((eq method 'kill)
4077 (if record 4083 (if record
4078 (ido-record-command 'kill-buffer buffer)) 4084 (ido-record-command 'kill-buffer buffer))
diff --git a/lisp/image/gravatar.el b/lisp/image/gravatar.el
index d1091e57cb5..3543be6de91 100644
--- a/lisp/image/gravatar.el
+++ b/lisp/image/gravatar.el
@@ -39,6 +39,7 @@
39 "Whether to cache retrieved gravatars." 39 "Whether to cache retrieved gravatars."
40 :type 'boolean 40 :type 'boolean
41 :group 'gravatar) 41 :group 'gravatar)
42(make-obsolete-variable 'gravatar-automatic-caching nil "28.1")
42 43
43(defcustom gravatar-cache-ttl 2592000 44(defcustom gravatar-cache-ttl 2592000
44 "Time to live in seconds for gravatar cache entries. 45 "Time to live in seconds for gravatar cache entries.
@@ -48,6 +49,7 @@ is retrieved anew. The default value is 30 days."
48 ;; Restricted :type to number of seconds. 49 ;; Restricted :type to number of seconds.
49 :version "27.1" 50 :version "27.1"
50 :group 'gravatar) 51 :group 'gravatar)
52(make-obsolete-variable 'gravatar-cache-ttl nil "28.1")
51 53
52(defcustom gravatar-rating "g" 54(defcustom gravatar-rating "g"
53 "Most explicit Gravatar rating level to allow. 55 "Most explicit Gravatar rating level to allow.
@@ -156,18 +158,58 @@ to track whether you're reading a specific mail."
156 (setq func 158 (setq func
157 (lambda (result) 159 (lambda (result)
158 (cond 160 (cond
159 (result 161 ((and
160 (funcall callback (format "%s://%s/avatar" 162 result ;there is a result
161 (cdar records) result))) 163 (let* ((data (mapcar (lambda (record)
162 ((> (length records) 1) 164 (dns-get 'data (cdr record)))
163 (pop records) 165 (dns-get 'answers result)))
166 (priorities (mapcar (lambda (r)
167 (dns-get 'priority r))
168 data))
169 (max-priority (if priorities
170 (apply #'max priorities)
171 0))
172 (sum 0) top)
173 ;; Attempt to find all records with the same maximal
174 ;; priority, and calculate the sum of their weights.
175 (dolist (ent data)
176 (when (= max-priority (dns-get 'priority ent))
177 (setq sum (+ sum (dns-get 'weight ent)))
178 (push ent top)))
179 ;; In case there is more than one maximal priority
180 ;; record, choose one at random, while taking the
181 ;; individual record weights into consideration.
182 (catch 'done
183 (dolist (ent top)
184 (when (and (or (= 0 sum)
185 (<= 0 (random sum)
186 (dns-get 'weight ent)))
187 ;; Ensure that port and domain data are
188 ;; valid. In case non of the results
189 ;; were valid, `catch' will evaluate to
190 ;; nil, and the next cond clause will be
191 ;; tested.
192 (<= 1 (dns-get 'port ent) 65535)
193 (string-match-p "\\`[-.0-9A-Za-z]+\\'"
194 (dns-get 'target ent)))
195 (funcall callback
196 (url-normalize-url
197 (format "%s://%s:%s/avatar"
198 (cdar records)
199 (dns-get 'target ent)
200 (dns-get 'port ent))))
201 (throw 'done t))
202 (setq sum (- sum (dns-get 'weight ent))))))))
203 ((setq records (cdr records))
204 ;; In case there are at least two methods.
164 (dns-query-asynchronous 205 (dns-query-asynchronous
165 (concat (caar records) "._tcp." domain) 206 (concat (caar records) "._tcp." domain)
166 func 'SRV)) 207 func 'SRV))
167 (t 208 (t ;fallback
168 (funcall callback "https://seccdn.libravatar.org/avatar"))))) 209 (funcall callback "https://seccdn.libravatar.org/avatar")))))
169 (dns-query-asynchronous 210 (dns-query-asynchronous
170 (concat (caar records) "._tcp." domain) func 'SRV))))) 211 (concat (caar records) "._tcp." domain)
212 func 'SRV t)))))
171 213
172(defun gravatar-hash (mail-address) 214(defun gravatar-hash (mail-address)
173 "Return the Gravatar hash for MAIL-ADDRESS." 215 "Return the Gravatar hash for MAIL-ADDRESS."
@@ -206,19 +248,50 @@ to track whether you're reading a specific mail."
206 (search-forward "\n\n" nil t) 248 (search-forward "\n\n" nil t)
207 (buffer-substring (point) (point-max))))) 249 (buffer-substring (point) (point-max)))))
208 250
251(defvar gravatar--cache (make-hash-table :test 'equal)
252 "Cache for gravatars.")
253
209;;;###autoload 254;;;###autoload
210(defun gravatar-retrieve (mail-address callback &optional cbargs) 255(defun gravatar-retrieve (mail-address callback &optional cbargs)
211 "Asynchronously retrieve a gravatar for MAIL-ADDRESS. 256 "Asynchronously retrieve a gravatar for MAIL-ADDRESS.
212When finished, call CALLBACK as (apply CALLBACK GRAVATAR CBARGS), 257When finished, call CALLBACK as (apply CALLBACK GRAVATAR CBARGS),
213where GRAVATAR is either an image descriptor, or the symbol 258where GRAVATAR is either an image descriptor, or the symbol
214`error' if the retrieval failed." 259`error' if the retrieval failed."
215 (gravatar-build-url 260 (let ((cached (gethash mail-address gravatar--cache)))
216 mail-address 261 (gravatar--prune-cache)
217 (lambda (url) 262 (if cached
218 (if (url-cache-expired url gravatar-cache-ttl) 263 (apply callback (cdr cached) cbargs)
219 (url-retrieve url #'gravatar-retrieved (list callback cbargs) t) 264 ;; Nothing in the cache, fetch it.
220 (with-current-buffer (url-fetch-from-cache url) 265 (gravatar-build-url
221 (gravatar-retrieved () callback cbargs)))))) 266 mail-address
267 (lambda (url)
268 (url-retrieve
269 url
270 (lambda (status)
271 (let* ((data (and (not (plist-get status :error))
272 (gravatar-get-data)))
273 (image (and data (create-image data nil t))))
274 ;; Store the image in the cache.
275 (when image
276 (setf (gethash mail-address gravatar--cache)
277 (cons (time-convert (current-time) 'integer)
278 image)))
279 (prog1
280 (apply callback (if data image 'error) cbargs)
281 (kill-buffer))))
282 nil t))))))
283
284(defun gravatar--prune-cache ()
285 (let ((expired nil)
286 (time (- (time-convert (current-time) 'integer)
287 ;; Twelve hours.
288 (* 12 60 60))))
289 (maphash (lambda (key val)
290 (when (< (car val) time)
291 (push key expired)))
292 gravatar--cache)
293 (dolist (key expired)
294 (remhash key gravatar--cache))))
222 295
223;;;###autoload 296;;;###autoload
224(defun gravatar-retrieve-synchronously (mail-address) 297(defun gravatar-retrieve-synchronously (mail-address)
@@ -229,10 +302,8 @@ retrieval failed."
229 (gravatar-build-url mail-address (lambda (u) (setq url u))) 302 (gravatar-build-url mail-address (lambda (u) (setq url u)))
230 (while (not url) 303 (while (not url)
231 (sleep-for 0.01)) 304 (sleep-for 0.01))
232 (with-current-buffer (if (url-cache-expired url gravatar-cache-ttl) 305 (with-current-buffer (url-retrieve-synchronously url t)
233 (url-retrieve-synchronously url t) 306 (gravatar-retrieved nil #'identity))))
234 (url-fetch-from-cache url))
235 (gravatar-retrieved () #'identity))))
236 307
237(defun gravatar-retrieved (status cb &optional cbargs) 308(defun gravatar-retrieved (status cb &optional cbargs)
238 "Handle Gravatar response data in current buffer. 309 "Handle Gravatar response data in current buffer.
@@ -241,10 +312,6 @@ an image descriptor, or the symbol `error' on failure.
241This function is intended as a callback for `url-retrieve'." 312This function is intended as a callback for `url-retrieve'."
242 (let ((data (unless (plist-get status :error) 313 (let ((data (unless (plist-get status :error)
243 (gravatar-get-data)))) 314 (gravatar-get-data))))
244 (and data ; Only cache on success.
245 url-current-object ; Only cache if not already cached.
246 gravatar-automatic-caching
247 (url-store-in-cache))
248 (prog1 (apply cb (if data (create-image data nil t) 'error) cbargs) 315 (prog1 (apply cb (if data (create-image data nil t) 'error) cbargs)
249 (kill-buffer)))) 316 (kill-buffer))))
250 317
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 7714a778fcb..5fe931dd9bb 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2968,11 +2968,6 @@ on encoding."
2968;; Doc said "obsolete" in 23.1, this statement only added in 24.1. 2968;; Doc said "obsolete" in 23.1, this statement only added in 24.1.
2969(make-obsolete 'unify-8859-on-decoding-mode "don't use it." "23.1") 2969(make-obsolete 'unify-8859-on-decoding-mode "don't use it." "23.1")
2970 2970
2971(defvar nonascii-insert-offset 0)
2972(make-obsolete-variable 'nonascii-insert-offset "do not use it." "23.1")
2973(defvar nonascii-translation-table nil)
2974(make-obsolete-variable 'nonascii-translation-table "do not use it." "23.1")
2975
2976(defvar ucs-names nil 2971(defvar ucs-names nil
2977 "Hash table of cached CHAR-NAME keys to CHAR-CODE values.") 2972 "Hash table of cached CHAR-NAME keys to CHAR-CODE values.")
2978 2973
diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el
index 80e78ef7877..b13bde58ca1 100644
--- a/lisp/international/mule-diag.el
+++ b/lisp/international/mule-diag.el
@@ -200,10 +200,6 @@ Character sets for defining other charsets, or for backward compatibility
200;;; (charset-iso-graphic-plane charset) 200;;; (charset-iso-graphic-plane charset)
201 (charset-description charset))))) 201 (charset-description charset)))))
202 202
203(defvar non-iso-charset-alist nil
204 "Obsolete.")
205(make-obsolete-variable 'non-iso-charset-alist "no longer relevant." "23.1")
206
207;; A variable to hold charset input history. 203;; A variable to hold charset input history.
208(defvar charset-history nil) 204(defvar charset-history nil)
209 205
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 5cc10b1315a..660ac58e022 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -275,15 +275,6 @@ operations such as `find-coding-systems-region'."
275(put 'with-coding-priority 'edebug-form-spec t) 275(put 'with-coding-priority 'edebug-form-spec t)
276 276
277;;;###autoload 277;;;###autoload
278(defmacro detect-coding-with-priority (from to priority-list)
279 "Detect a coding system of the text between FROM and TO with PRIORITY-LIST.
280PRIORITY-LIST is an alist of coding categories vs the corresponding
281coding systems ordered by priority."
282 (declare (obsolete with-coding-priority "23.1"))
283 `(with-coding-priority (mapcar #'cdr ,priority-list)
284 (detect-coding-region ,from ,to)))
285
286;;;###autoload
287(defun detect-coding-with-language-environment (from to lang-env) 278(defun detect-coding-with-language-environment (from to lang-env)
288 "Detect a coding system for the text between FROM and TO with LANG-ENV. 279 "Detect a coding system for the text between FROM and TO with LANG-ENV.
289The detection takes into account the coding system priorities for the 280The detection takes into account the coding system priorities for the
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 5fb04bc464f..958fc0d3101 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -409,16 +409,6 @@ PLIST (property list) may contain any type of information a user
409;; because that makes a bootstrapping problem 409;; because that makes a bootstrapping problem
410;; if you need to recompile all the Lisp files using interpreted code. 410;; if you need to recompile all the Lisp files using interpreted code.
411 411
412(defun charset-id (_charset)
413 "Always return 0. This is provided for backward compatibility."
414 (declare (obsolete nil "23.1"))
415 0)
416
417(defmacro charset-bytes (_charset)
418 "Always return 0. This is provided for backward compatibility."
419 (declare (obsolete nil "23.1"))
420 0)
421
422(defun get-charset-property (charset propname) 412(defun get-charset-property (charset propname)
423 "Return the value of CHARSET's PROPNAME property. 413 "Return the value of CHARSET's PROPNAME property.
424This is the last value stored with 414This is the last value stored with
@@ -464,19 +454,8 @@ Return -1 if charset isn't an ISO 2022 one."
464 "Return long name of CHARSET." 454 "Return long name of CHARSET."
465 (plist-get (charset-plist charset) :long-name)) 455 (plist-get (charset-plist charset) :long-name))
466 456
467(defun charset-list ()
468 "Return list of all charsets ever defined."
469 (declare (obsolete charset-list "23.1"))
470 charset-list)
471
472 457
473;;; CHARACTER 458;;; CHARACTER
474(define-obsolete-function-alias 'char-valid-p 'characterp "23.1")
475
476(defun generic-char-p (_char)
477 "Always return nil. This is provided for backward compatibility."
478 (declare (obsolete nil "23.1"))
479 nil)
480 459
481(defun make-char-internal (charset-id &optional code1 code2) 460(defun make-char-internal (charset-id &optional code1 code2)
482 (let ((charset (aref emacs-mule-charset-table charset-id))) 461 (let ((charset (aref emacs-mule-charset-table charset-id)))
@@ -1086,14 +1065,11 @@ formats (e.g. iso-latin-1-unix, koi8-r-dos)."
1086 (setq codings (cons alias codings)))))) 1065 (setq codings (cons alias codings))))))
1087 codings)) 1066 codings))
1088 1067
1089(defconst char-coding-system-table nil
1090 "It exists just for backward compatibility, and the value is always nil.")
1091(make-obsolete-variable 'char-coding-system-table nil "23.1")
1092
1093(defun transform-make-coding-system-args (name type &optional doc-string props) 1068(defun transform-make-coding-system-args (name type &optional doc-string props)
1094 "For internal use only. 1069 "For internal use only.
1095Transform XEmacs style args for `make-coding-system' to Emacs style. 1070Transform XEmacs style args for `make-coding-system' to Emacs style.
1096Value is a list of transformed arguments." 1071Value is a list of transformed arguments."
1072 (declare (obsolete nil "28.1"))
1097 (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?"))) 1073 (let ((mnemonic (string-to-char (or (plist-get props 'mnemonic) "?")))
1098 (eol-type (plist-get props 'eol-type)) 1074 (eol-type (plist-get props 'eol-type))
1099 properties tmp) 1075 properties tmp)
@@ -1171,106 +1147,6 @@ Value is a list of transformed arguments."
1171 (error "unsupported XEmacs style make-coding-style arguments: %S" 1147 (error "unsupported XEmacs style make-coding-style arguments: %S"
1172 `(,name ,type ,doc-string ,props)))))) 1148 `(,name ,type ,doc-string ,props))))))
1173 1149
1174(defun make-coding-system (coding-system type mnemonic doc-string
1175 &optional
1176 flags
1177 properties
1178 eol-type)
1179 "Define a new coding system CODING-SYSTEM (symbol).
1180This function is provided for backward compatibility."
1181 (declare (obsolete define-coding-system "23.1"))
1182 ;; For compatibility with XEmacs, we check the type of TYPE. If it
1183 ;; is a symbol, perhaps, this function is called with XEmacs-style
1184 ;; arguments. Here, try to transform that kind of arguments to
1185 ;; Emacs style.
1186 (if (symbolp type)
1187 (let ((args (transform-make-coding-system-args coding-system type
1188 mnemonic doc-string)))
1189 (setq coding-system (car args)
1190 type (nth 1 args)
1191 mnemonic (nth 2 args)
1192 doc-string (nth 3 args)
1193 flags (nth 4 args)
1194 properties (nth 5 args)
1195 eol-type (nth 6 args))))
1196
1197 (setq type
1198 (cond ((eq type 0) 'emacs-mule)
1199 ((eq type 1) 'shift-jis)
1200 ((eq type 2) 'iso2022)
1201 ((eq type 3) 'big5)
1202 ((eq type 4) 'ccl)
1203 ((eq type 5) 'raw-text)
1204 (t
1205 (error "Invalid coding system type: %s" type))))
1206
1207 (setq properties
1208 (let ((plist nil) key)
1209 (dolist (elt properties)
1210 (setq key (car elt))
1211 (cond ((eq key 'post-read-conversion)
1212 (setq key :post-read-conversion))
1213 ((eq key 'pre-write-conversion)
1214 (setq key :pre-write-conversion))
1215 ((eq key 'translation-table-for-decode)
1216 (setq key :decode-translation-table))
1217 ((eq key 'translation-table-for-encode)
1218 (setq key :encode-translation-table))
1219 ((eq key 'safe-charsets)
1220 (setq key :charset-list))
1221 ((eq key 'mime-charset)
1222 (setq key :mime-charset))
1223 ((eq key 'valid-codes)
1224 (setq key :valids)))
1225 (setq plist (plist-put plist key (cdr elt))))
1226 plist))
1227 (setq properties (plist-put properties :mnemonic mnemonic))
1228 (plist-put properties :coding-type type)
1229 (cond ((eq eol-type 0) (setq eol-type 'unix))
1230 ((eq eol-type 1) (setq eol-type 'dos))
1231 ((eq eol-type 2) (setq eol-type 'mac))
1232 ((vectorp eol-type) (setq eol-type nil)))
1233 (plist-put properties :eol-type eol-type)
1234
1235 (cond
1236 ((eq type 'iso2022)
1237 (plist-put properties :flags
1238 (list (and (or (consp (nth 0 flags))
1239 (consp (nth 1 flags))
1240 (consp (nth 2 flags))
1241 (consp (nth 3 flags))) 'designation)
1242 (or (nth 4 flags) 'long-form)
1243 (and (nth 5 flags) 'ascii-at-eol)
1244 (and (nth 6 flags) 'ascii-at-cntl)
1245 (and (nth 7 flags) '7-bit)
1246 (and (nth 8 flags) 'locking-shift)
1247 (and (nth 9 flags) 'single-shift)
1248 (and (nth 10 flags) 'use-roman)
1249 (and (nth 11 flags) 'use-oldjis)
1250 (or (nth 12 flags) 'direction)
1251 (and (nth 13 flags) 'init-at-bol)
1252 (and (nth 14 flags) 'designate-at-bol)
1253 (and (nth 15 flags) 'safe)
1254 (and (nth 16 flags) 'latin-extra)))
1255 (plist-put properties :designation
1256 (let ((vec (make-vector 4 nil)))
1257 (dotimes (i 4)
1258 (let ((spec (nth i flags)))
1259 (if (eq spec t)
1260 (aset vec i '(94 96))
1261 (if (consp spec)
1262 (progn
1263 (if (memq t spec)
1264 (setq spec (append (delq t spec) '(94 96))))
1265 (aset vec i spec))))))
1266 vec)))
1267
1268 ((eq type 'ccl)
1269 (plist-put properties :ccl-decoder (car flags))
1270 (plist-put properties :ccl-encoder (cdr flags))))
1271
1272 (apply 'define-coding-system coding-system doc-string properties))
1273
1274(defun merge-coding-systems (first second) 1150(defun merge-coding-systems (first second)
1275 "Fill in any unspecified aspects of coding system FIRST from SECOND. 1151 "Fill in any unspecified aspects of coding system FIRST from SECOND.
1276Return the resulting coding system." 1152Return the resulting coding system."
@@ -1617,15 +1493,6 @@ This setting is effective for the next communication only."
1617 1493
1618 (setq next-selection-coding-system coding-system)) 1494 (setq next-selection-coding-system coding-system))
1619 1495
1620(defun set-coding-priority (arg)
1621 "Set priority of coding categories according to ARG.
1622ARG is a list of coding categories ordered by priority.
1623
1624This function is provided for backward compatibility."
1625 (declare (obsolete set-coding-system-priority "23.1"))
1626 (apply 'set-coding-system-priority
1627 (mapcar #'(lambda (x) (symbol-value x)) arg)))
1628
1629;;; X selections 1496;;; X selections
1630 1497
1631(defvar ctext-non-standard-encodings-alist 1498(defvar ctext-non-standard-encodings-alist
diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el
index ae58bfc566b..7077925602c 100644
--- a/lisp/ldefs-boot.el
+++ b/lisp/ldefs-boot.el
@@ -31062,7 +31062,7 @@ values), despite potential performance issues, type \\[so-long-revert].
31062 31062
31063Use \\[so-long-commentary] for more information. 31063Use \\[so-long-commentary] for more information.
31064 31064
31065Use \\[so-long-customize] to configure the behavior. 31065Use \\[so-long-customize] to configure the behaviour.
31066 31066
31067\(fn)" t nil) 31067\(fn)" t nil)
31068 31068
@@ -31099,7 +31099,7 @@ or call the function `global-so-long-mode'.")
31099(custom-autoload 'global-so-long-mode "so-long" nil) 31099(custom-autoload 'global-so-long-mode "so-long" nil)
31100 31100
31101(autoload 'global-so-long-mode "so-long" "\ 31101(autoload 'global-so-long-mode "so-long" "\
31102Toggle automated performance mitigation for files with long lines. 31102Toggle automated performance mitigations for files with long lines.
31103 31103
31104If called interactively, enable Global So-Long mode if ARG is 31104If called interactively, enable Global So-Long mode if ARG is
31105positive, and disable it if ARG is zero or negative. If called from 31105positive, and disable it if ARG is zero or negative. If called from
@@ -31118,7 +31118,7 @@ When such files are detected by `so-long-predicate', we invoke the selected
31118 31118
31119Use \\[so-long-commentary] for more information. 31119Use \\[so-long-commentary] for more information.
31120 31120
31121Use \\[so-long-customize] to configure the behavior. 31121Use \\[so-long-customize] to configure the behaviour.
31122 31122
31123\(fn &optional ARG)" t nil) 31123\(fn &optional ARG)" t nil)
31124 31124
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 31843fc24d1..aaa5888bf92 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -449,33 +449,33 @@ lost after dumping")))
449;; At this point, we're ready to resume undo recording for scratch. 449;; At this point, we're ready to resume undo recording for scratch.
450(buffer-enable-undo "*scratch*") 450(buffer-enable-undo "*scratch*")
451 451
452(when (native-comp-available-p) 452(when (boundp 'comp-ctxt)
453 ;; Fix the compilation unit filename to have it working when 453 ;; Fix the compilation unit filename to have it working when
454 ;; when installed or if the source directory got moved. This is set to be 454 ;; when installed or if the source directory got moved. This is set to be
455 ;; a pair in the form: (rel-path-from-install-bin . rel-path-from-local-bin). 455 ;; a pair in the form: (rel-path-from-install-bin . rel-path-from-local-bin).
456 (let ((h (make-hash-table :test #'eq)) 456 (let ((h (make-hash-table :test #'eq))
457 (lisp-src-dir (expand-file-name (concat default-directory "../lisp")))
458 (bin-dest-dir (cadr (member "--bin-dest" command-line-args))) 457 (bin-dest-dir (cadr (member "--bin-dest" command-line-args)))
459 (lisp-dest-dir (cadr (member "--lisp-dest" command-line-args)))) 458 (eln-dest-dir (cadr (member "--eln-dest" command-line-args))))
460 (mapatoms (lambda (s) 459 (when (and bin-dest-dir eln-dest-dir)
461 (let ((f (symbol-function s))) 460 (setq eln-dest-dir
462 (when (subr-native-elisp-p f) 461 (concat eln-dest-dir "eln-cache/" comp-native-path-postfix "/"))
463 (puthash (subr-native-comp-unit f) nil h))))) 462 (mapatoms (lambda (s)
464 (maphash (lambda (cu _) 463 (let ((f (symbol-function s)))
465 (native-comp-unit-set-file 464 (when (subr-native-elisp-p f)
466 cu 465 (puthash (subr-native-comp-unit f) nil h)))))
467 (cons 466 (maphash (lambda (cu _)
468 ;; Relative path from the installed binary. 467 (native-comp-unit-set-file
469 (file-relative-name 468 cu
470 (concat lisp-dest-dir 469 (cons
471 (replace-regexp-in-string 470 ;; Relative path from the installed binary.
472 (regexp-quote lisp-src-dir) "" 471 (file-relative-name (concat eln-dest-dir
473 (native-comp-unit-file cu))) 472 (file-name-nondirectory
474 bin-dest-dir) 473 (native-comp-unit-file cu)))
475 ;; Relative path from the built uninstalled binary. 474 bin-dest-dir)
476 (file-relative-name (native-comp-unit-file cu) 475 ;; Relative path from the built uninstalled binary.
477 invocation-directory)))) 476 (file-relative-name (native-comp-unit-file cu)
478 h))) 477 invocation-directory))))
478 h))))
479 479
480(when (hash-table-p purify-flag) 480(when (hash-table-p purify-flag)
481 (let ((strings 0) 481 (let ((strings 0)
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 896f82d7bcc..2c77f88f97b 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -83,10 +83,8 @@ input and write the converted data to its standard output."
83 "^[^:]...............................................................$") 83 "^[^:]...............................................................$")
84(defconst binhex-end-line ":$") ; unused 84(defconst binhex-end-line ":$") ; unused
85 85
86(defvar binhex-temporary-file-directory 86(make-obsolete-variable 'binhex-temporary-file-directory
87 (cond ((fboundp 'temp-directory) (temp-directory)) 87 'temporary-file-directory "28.1")
88 ((boundp 'temporary-file-directory) temporary-file-directory)
89 ("/tmp/")))
90 88
91(defun binhex-insert-char (char &optional count ignored buffer) 89(defun binhex-insert-char (char &optional count ignored buffer)
92 "Insert COUNT copies of CHARACTER into BUFFER." 90 "Insert COUNT copies of CHARACTER into BUFFER."
@@ -285,7 +283,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
285 (file-name (expand-file-name 283 (file-name (expand-file-name
286 (concat (binhex-decode-region-internal start end t) 284 (concat (binhex-decode-region-internal start end t)
287 ".data") 285 ".data")
288 binhex-temporary-file-directory))) 286 temporary-file-directory)))
289 (save-excursion 287 (save-excursion
290 (goto-char start) 288 (goto-char start)
291 (when (re-search-forward binhex-begin-line nil t) 289 (when (re-search-forward binhex-begin-line nil t)
@@ -296,7 +294,7 @@ If HEADER-ONLY is non-nil only decode header and return filename."
296 (generate-new-buffer " *binhex-work*"))) 294 (generate-new-buffer " *binhex-work*")))
297 (buffer-disable-undo work-buffer) 295 (buffer-disable-undo work-buffer)
298 (insert-buffer-substring cbuf firstline end) 296 (insert-buffer-substring cbuf firstline end)
299 (cd binhex-temporary-file-directory) 297 (cd temporary-file-directory)
300 (apply 'call-process-region 298 (apply 'call-process-region
301 (point-min) 299 (point-min)
302 (point-max) 300 (point-max)
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index efbc0668553..6b9e1db5fc6 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -324,18 +324,6 @@ usually do not have translators for other languages.\n\n")))
324 (let ((os (ignore-errors (report-emacs-bug--os-description)))) 324 (let ((os (ignore-errors (report-emacs-bug--os-description))))
325 (if (stringp os) 325 (if (stringp os)
326 (insert "System Description: " os "\n\n"))) 326 (insert "System Description: " os "\n\n")))
327 (let ((message-buf (get-buffer "*Messages*")))
328 (if message-buf
329 (let (beg-pos
330 (end-pos message-end-point))
331 (with-current-buffer message-buf
332 (goto-char end-pos)
333 (forward-line -10)
334 (setq beg-pos (point)))
335 (terpri (current-buffer) t)
336 (insert "Recent messages:\n")
337 (insert-buffer-substring message-buf beg-pos end-pos))))
338 (insert "\n")
339 (when (and system-configuration-options 327 (when (and system-configuration-options
340 (not (equal system-configuration-options ""))) 328 (not (equal system-configuration-options "")))
341 (insert "Configured using:\n 'configure " 329 (insert "Configured using:\n 'configure "
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index af3b493a08a..f4b55031194 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -131,31 +131,37 @@ lines."
131 (goto-char (match-end 0)) 131 (goto-char (match-end 0))
132 (unless (looking-at " ") 132 (unless (looking-at " ")
133 (insert " ")) 133 (insert " "))
134 (end-of-line) 134 (while (and (eq (char-before (line-end-position)) ?\s)
135 (when (and (not (eobp)) 135 (not (eobp))
136 (save-excursion 136 (save-excursion
137 (forward-line 1) 137 (forward-line 1)
138 (looking-at (format "\\(%s ?\\)[^>]" prefix)))) 138 (looking-at (format "\\(%s ?\\)[^>]" prefix))))
139 ;; Delete the newline and the quote at the start of the 139 (end-of-line)
140 ;; next line. 140 (when (and (not (eobp))
141 (delete-region (point) (match-end 1)) 141 (save-excursion
142 (ignore-errors 142 (forward-line 1)
143 (looking-at (format "\\(%s ?\\)[^>]" prefix))))
144 ;; Delete the newline and the quote at the start of the
145 ;; next line.
146 (delete-region (point) (match-end 1))))
147 (ignore-errors
143 (let ((fill-prefix (concat prefix " ")) 148 (let ((fill-prefix (concat prefix " "))
144 adaptive-fill-mode) 149 adaptive-fill-mode)
145 (fill-region (line-beginning-position) 150 (fill-region (line-beginning-position)
146 (line-end-position) 151 (line-end-position)
147 'left 'nosqueeze)))))) 152 'left 'nosqueeze)))))
148 (t 153 (t
149 ;; Delete the newline. 154 ;; Delete the newline.
150 (when (eq (following-char) ?\s) 155 (when (eq (following-char) ?\s)
151 (delete-char 1)) 156 (delete-char 1))
152 ;; Hack: Don't do the flowing on the signature line. 157 ;; Hack: Don't do the flowing on the signature line.
153 (when (and (not (looking-at "-- $")) 158 (when (and (not (looking-at "-- $"))
154 (eq (char-before (line-end-position)) ?\s)) 159 (eq (char-before (line-end-position)) ?\s))
155 (end-of-line) 160 (while (eq (char-before (line-end-position)) ?\s)
156 (when delete-space 161 (end-of-line)
157 (delete-char -1)) 162 (when delete-space
158 (delete-char 1) 163 (delete-char -1))
164 (delete-char 1))
159 (ignore-errors 165 (ignore-errors
160 (let ((fill-prefix "")) 166 (let ((fill-prefix ""))
161 (fill-region (line-beginning-position) 167 (fill-region (line-beginning-position)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 44cde7cb5a9..312baffb901 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -521,25 +521,6 @@ still the current message in the Rmail buffer.")
521(defvar rmail-mmdf-delim2 "^\001\001\001\001\n" 521(defvar rmail-mmdf-delim2 "^\001\001\001\001\n"
522 "Regexp marking the end of an mmdf message.") 522 "Regexp marking the end of an mmdf message.")
523 523
524;; FIXME Post-mbox, this is now unused.
525;; In Emacs-22, this was called:
526;; i) the very first time a message was shown.
527;; ii) when toggling the headers to the normal state, every time.
528;; It's not clear what it should do now, since there is nothing that
529;; records when a message is shown for the first time (unseen is not
530;; necessarily the same thing).
531;; See https://lists.gnu.org/r/emacs-devel/2009-03/msg00013.html
532(defcustom rmail-message-filter nil
533 "If non-nil, a filter function for new messages in RMAIL.
534Called with region narrowed to the message, including headers,
535before obeying `rmail-ignored-headers'."
536 :group 'rmail-headers
537 :type '(choice (const nil) function))
538
539(make-obsolete-variable 'rmail-message-filter
540 "it is not used (try `rmail-show-message-hook')."
541 "23.1")
542
543(defcustom rmail-automatic-folder-directives nil 524(defcustom rmail-automatic-folder-directives nil
544 "List of directives specifying how to automatically file messages. 525 "List of directives specifying how to automatically file messages.
545Whenever Rmail shows a message in the folder that `rmail-file-name' 526Whenever Rmail shows a message in the folder that `rmail-file-name'
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index ba6ebad082c..3026283a082 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -63,9 +63,7 @@ This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'.
63 (use-local-map rmail-edit-map) 63 (use-local-map rmail-edit-map)
64 (setq major-mode 'rmail-edit-mode) 64 (setq major-mode 'rmail-edit-mode)
65 (setq mode-name "RMAIL Edit") 65 (setq mode-name "RMAIL Edit")
66 (if (boundp 'mode-line-modified) 66 (setq mode-line-modified (default-value 'mode-line-modified))
67 (setq mode-line-modified (default-value 'mode-line-modified))
68 (setq mode-line-format (default-value 'mode-line-format)))
69 ;; Don't turn off auto-saving based on the size of the buffer 67 ;; Don't turn off auto-saving based on the size of the buffer
70 ;; because that code does not understand buffer-swapping. 68 ;; because that code does not understand buffer-swapping.
71 (make-local-variable 'auto-save-include-big-deletions) 69 (make-local-variable 'auto-save-include-big-deletions)
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 9423275b2e5..945bff35f79 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -61,10 +61,8 @@ input and write the converted data to its standard output."
61 (setq str (concat str "[^a-z]"))) 61 (setq str (concat str "[^a-z]")))
62 (concat str ".?$"))) 62 (concat str ".?$")))
63 63
64(defvar uudecode-temporary-file-directory 64(make-obsolete-variable 'uudecode-temporary-file-directory
65 (cond ((fboundp 'temp-directory) (temp-directory)) 65 'temporary-file-directory "28.1")
66 ((boundp 'temporary-file-directory) temporary-file-directory)
67 ("/tmp")))
68 66
69;;;###autoload 67;;;###autoload
70(defun uudecode-decode-region-external (start end &optional file-name) 68(defun uudecode-decode-region-external (start end &optional file-name)
@@ -86,13 +84,7 @@ used is specified by `uudecode-decoder-program'."
86 (match-string 1))))) 84 (match-string 1)))))
87 (setq tempfile (if file-name 85 (setq tempfile (if file-name
88 (expand-file-name file-name) 86 (expand-file-name file-name)
89 (if (fboundp 'make-temp-file) 87 (make-temp-file "uu")))
90 (let ((temporary-file-directory
91 uudecode-temporary-file-directory))
92 (make-temp-file "uu"))
93 (expand-file-name
94 (make-temp-name "uu")
95 uudecode-temporary-file-directory))))
96 (let ((cdir default-directory) 88 (let ((cdir default-directory)
97 (default-process-coding-system nil)) 89 (default-process-coding-system nil))
98 (unwind-protect 90 (unwind-protect
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d2c3f9045e5..641a2e53152 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -685,13 +685,6 @@ for use at QPOS."
685 completions) 685 completions)
686 qboundary)))) 686 qboundary))))
687 687
688;; (defmacro complete-in-turn (a b) `(completion-table-in-turn ,a ,b))
689;; (defmacro dynamic-completion-table (fun) `(completion-table-dynamic ,fun))
690(define-obsolete-function-alias
691 'complete-in-turn #'completion-table-in-turn "23.1")
692(define-obsolete-function-alias
693 'dynamic-completion-table #'completion-table-dynamic "23.1")
694
695;;; Minibuffer completion 688;;; Minibuffer completion
696 689
697(defgroup minibuffer nil 690(defgroup minibuffer nil
@@ -1126,6 +1119,7 @@ completion candidates than this number."
1126(defvar-local completion-all-sorted-completions nil) 1119(defvar-local completion-all-sorted-completions nil)
1127(defvar-local completion--all-sorted-completions-location nil) 1120(defvar-local completion--all-sorted-completions-location nil)
1128(defvar completion-cycling nil) ;Function that takes down the cycling map. 1121(defvar completion-cycling nil) ;Function that takes down the cycling map.
1122(defvar completion-content-when-empty nil)
1129 1123
1130(defvar completion-fail-discreetly nil 1124(defvar completion-fail-discreetly nil
1131 "If non-nil, stay quiet when there is no match.") 1125 "If non-nil, stay quiet when there is no match.")
@@ -1510,8 +1504,13 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
1510COMPLETION-FUNCTION is called if the current buffer's content does not 1504COMPLETION-FUNCTION is called if the current buffer's content does not
1511appear to be a match." 1505appear to be a match."
1512 (cond 1506 (cond
1513 ;; Allow user to specify null string 1507 ;; Allow user to specify null string. In the case that
1514 ((= beg end) (funcall exit-function)) 1508 ;; `completion-content-when-empty' is set, use that instead.
1509 ((= beg end)
1510 (when completion-content-when-empty
1511 (completion--replace beg end completion-content-when-empty))
1512 (funcall exit-function))
1513
1515 ((test-completion (buffer-substring beg end) 1514 ((test-completion (buffer-substring beg end)
1516 minibuffer-completion-table 1515 minibuffer-completion-table
1517 minibuffer-completion-predicate) 1516 minibuffer-completion-predicate)
@@ -1770,9 +1769,6 @@ It also eliminates runs of equal strings."
1770 ;; Round up to a whole number of columns. 1769 ;; Round up to a whole number of columns.
1771 (* colwidth (ceiling length colwidth)))))))))))) 1770 (* colwidth (ceiling length colwidth))))))))))))
1772 1771
1773(defvar completion-common-substring nil)
1774(make-obsolete-variable 'completion-common-substring nil "23.1")
1775
1776(defvar completion-setup-hook nil 1772(defvar completion-setup-hook nil
1777 "Normal hook run at the end of setting up a completion list buffer. 1773 "Normal hook run at the end of setting up a completion list buffer.
1778When this hook is run, the current buffer is the one in which the 1774When this hook is run, the current buffer is the one in which the
@@ -1864,11 +1860,7 @@ It can find the completion buffer in `standard-output'."
1864 (insert "Possible completions are:\n") 1860 (insert "Possible completions are:\n")
1865 (completion--insert-strings completions)))) 1861 (completion--insert-strings completions))))
1866 1862
1867 ;; The hilit used to be applied via completion-setup-hook, so there 1863 (run-hooks 'completion-setup-hook)
1868 ;; may still be some code that uses completion-common-substring.
1869 (with-no-warnings
1870 (let ((completion-common-substring common-substring))
1871 (run-hooks 'completion-setup-hook)))
1872 nil) 1864 nil)
1873 1865
1874(defvar completion-extra-properties nil 1866(defvar completion-extra-properties nil
@@ -2374,8 +2366,6 @@ The completion method is determined by `completion-at-point-functions'."
2374Gets combined either with `minibuffer-local-completion-map' or 2366Gets combined either with `minibuffer-local-completion-map' or
2375with `minibuffer-local-must-match-map'.") 2367with `minibuffer-local-must-match-map'.")
2376 2368
2377(define-obsolete-variable-alias 'minibuffer-local-must-match-filename-map
2378 'minibuffer-local-filename-must-match-map "23.1")
2379(defvar minibuffer-local-filename-must-match-map (make-sparse-keymap)) 2369(defvar minibuffer-local-filename-must-match-map (make-sparse-keymap))
2380(make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1") 2370(make-obsolete-variable 'minibuffer-local-filename-must-match-map nil "24.1")
2381 2371
diff --git a/lisp/mouse.el b/lisp/mouse.el
index d369545f18e..a06ca2a56ca 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -274,34 +274,6 @@ not it is actually displayed."
274 local-menu 274 local-menu
275 minor-mode-menus))) 275 minor-mode-menus)))
276 276
277(defun mouse-major-mode-menu (event &optional prefix)
278 "Pop up a mode-specific menu of mouse commands.
279Default to the Edit menu if the major mode doesn't define a menu."
280 (declare (obsolete mouse-menu-major-mode-map "23.1"))
281 (interactive "@e\nP")
282 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
283 (popup-menu (mouse-menu-major-mode-map) event prefix))
284
285(defun mouse-popup-menubar (event prefix)
286 "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX.
287The contents are the items that would be in the menu bar whether or
288not it is actually displayed."
289 (declare (obsolete mouse-menu-bar-map "23.1"))
290 (interactive "@e \nP")
291 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
292 (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix))
293
294(defun mouse-popup-menubar-stuff (event prefix)
295 "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'.
296Use the former if the menu bar is showing, otherwise the latter."
297 (declare (obsolete nil "23.1"))
298 (interactive "@e\nP")
299 (run-hooks 'activate-menubar-hook 'menu-bar-update-hook)
300 (popup-menu
301 (if (zerop (or (frame-parameter nil 'menu-bar-lines) 0))
302 (mouse-menu-bar-map)
303 (mouse-menu-major-mode-map))
304 event prefix))
305 277
306;; Commands that operate on windows. 278;; Commands that operate on windows.
307 279
diff --git a/lisp/mwheel.el b/lisp/mwheel.el
index 317f2cd8edd..8e2039ba9d8 100644
--- a/lisp/mwheel.el
+++ b/lisp/mwheel.el
@@ -162,23 +162,18 @@ Also see `mouse-wheel-tilt-scroll'."
162 :type 'boolean 162 :type 'boolean
163 :version "26.1") 163 :version "26.1")
164 164
165(eval-and-compile 165(defun mwheel-event-button (event)
166 (if (fboundp 'event-button) 166 (let ((x (event-basic-type event)))
167 (fset 'mwheel-event-button 'event-button) 167 ;; Map mouse-wheel events to appropriate buttons
168 (defun mwheel-event-button (event) 168 (if (eq 'mouse-wheel x)
169 (let ((x (event-basic-type event))) 169 (let ((amount (car (cdr (cdr (cdr event))))))
170 ;; Map mouse-wheel events to appropriate buttons 170 (if (< amount 0)
171 (if (eq 'mouse-wheel x) 171 mouse-wheel-up-event
172 (let ((amount (car (cdr (cdr (cdr event)))))) 172 mouse-wheel-down-event))
173 (if (< amount 0) 173 x)))
174 mouse-wheel-up-event 174
175 mouse-wheel-down-event)) 175(defun mwheel-event-window (event)
176 x)))) 176 (posn-window (event-start event)))
177
178 (if (fboundp 'event-window)
179 (fset 'mwheel-event-window 'event-window)
180 (defun mwheel-event-window (event)
181 (posn-window (event-start event)))))
182 177
183(defvar mwheel-inhibit-click-event-timer nil 178(defvar mwheel-inhibit-click-event-timer nil
184 "Timer running while mouse wheel click event is inhibited.") 179 "Timer running while mouse wheel click event is inhibited.")
diff --git a/lisp/net/eudc-bob.el b/lisp/net/eudc-bob.el
index 56ea033a963..bb6682520ae 100644
--- a/lisp/net/eudc-bob.el
+++ b/lisp/net/eudc-bob.el
@@ -1,4 +1,4 @@
1;;; eudc-bob.el --- Binary Objects Support for EUDC 1;;; eudc-bob.el --- Binary Objects Support for EUDC -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 1999-2020 Free Software Foundation, Inc. 3;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
4 4
@@ -39,19 +39,41 @@
39 39
40(require 'eudc) 40(require 'eudc)
41 41
42(defvar eudc-bob-generic-keymap nil 42(defvar eudc-bob-generic-keymap
43 (let ((map (make-sparse-keymap)))
44 (define-key map "s" 'eudc-bob-save-object)
45 (define-key map "!" 'eudc-bob-pipe-object-to-external-program)
46 (define-key map [down-mouse-3] 'eudc-bob-popup-menu)
47 map)
43 "Keymap for multimedia objects.") 48 "Keymap for multimedia objects.")
44 49
45(defvar eudc-bob-image-keymap nil 50(defvar eudc-bob-image-keymap
51 (let ((map (make-sparse-keymap)))
52 (set-keymap-parent map eudc-bob-generic-keymap)
53 (define-key map "t" 'eudc-bob-toggle-inline-display)
54 map)
46 "Keymap for inline images.") 55 "Keymap for inline images.")
47 56
48(defvar eudc-bob-sound-keymap nil 57(defvar eudc-bob-sound-keymap
58 (let ((map (make-sparse-keymap)))
59 (set-keymap-parent map eudc-bob-generic-keymap)
60 (define-key map (kbd "RET") 'eudc-bob-play-sound-at-point)
61 (define-key map [down-mouse-2] 'eudc-bob-play-sound-at-mouse)
62 map)
49 "Keymap for inline sounds.") 63 "Keymap for inline sounds.")
50 64
51(defvar eudc-bob-url-keymap nil 65(defvar eudc-bob-url-keymap
66 (let ((map (make-sparse-keymap)))
67 (define-key map (kbd "RET") 'browse-url-at-point)
68 (define-key map [down-mouse-2] 'browse-url-at-mouse)
69 map)
52 "Keymap for inline urls.") 70 "Keymap for inline urls.")
53 71
54(defvar eudc-bob-mail-keymap nil 72(defvar eudc-bob-mail-keymap
73 (let ((map (make-sparse-keymap)))
74 (define-key map (kbd "RET") 'goto-address-at-point)
75 (define-key map [down-mouse-2] 'goto-address-at-point)
76 map)
55 "Keymap for inline e-mail addresses.") 77 "Keymap for inline e-mail addresses.")
56 78
57(defvar eudc-bob-generic-menu 79(defvar eudc-bob-generic-menu
@@ -74,13 +96,6 @@
74 (fboundp 'play-sound-internal)] 96 (fboundp 'play-sound-internal)]
75 ,@(cdr (cdr eudc-bob-generic-menu)))) 97 ,@(cdr (cdr eudc-bob-generic-menu))))
76 98
77(defun eudc-jump-to-event (event)
78 "Jump to the window and point where EVENT occurred."
79 (if (fboundp 'event-closest-point)
80 (goto-char (event-closest-point event))
81 (set-buffer (window-buffer (posn-window (event-start event))))
82 (goto-char (posn-point (event-start event)))))
83
84(defun eudc-bob-get-overlay-prop (prop) 99(defun eudc-bob-get-overlay-prop (prop)
85 "Get property PROP from one of the overlays around." 100 "Get property PROP from one of the overlays around."
86 (let ((overlays (append (overlays-at (1- (point))) 101 (let ((overlays (append (overlays-at (1- (point)))
@@ -205,42 +220,30 @@ display a button."
205 "Play the sound data contained in the button where EVENT occurred." 220 "Play the sound data contained in the button where EVENT occurred."
206 (interactive "e") 221 (interactive "e")
207 (save-excursion 222 (save-excursion
208 (eudc-jump-to-event event) 223 (mouse-set-point event)
209 (eudc-bob-play-sound-at-point))) 224 (eudc-bob-play-sound-at-point)))
210 225
211(defun eudc-bob-save-object () 226(defun eudc-bob-save-object (filename)
212 "Save the object data of the button at point." 227 "Save the object data of the button at point."
213 (interactive) 228 (interactive "fWrite file: ")
214 (let ((data (eudc-bob-get-overlay-prop 'object-data)) 229 (let ((data (eudc-bob-get-overlay-prop 'object-data))
215 (buffer (generate-new-buffer "*eudc-tmp*"))) 230 (coding-system-for-write 'binary)) ;Inhibit EOL conversion.
216 (save-excursion 231 (write-region data nil filename)))
217 (set-buffer-file-coding-system 'binary)
218 (set-buffer buffer)
219 (set-buffer-multibyte nil)
220 (insert data)
221 (save-buffer))
222 (kill-buffer buffer)))
223 232
224(defun eudc-bob-pipe-object-to-external-program () 233(defun eudc-bob-pipe-object-to-external-program (program)
225 "Pipe the object data of the button at point to an external program." 234 "Pipe the object data of the button at point to an external program."
226 (interactive) 235 (interactive (list (completing-read "Viewer: " eudc-external-viewers)))
227 (let ((data (eudc-bob-get-overlay-prop 'object-data)) 236 (let ((data (eudc-bob-get-overlay-prop 'object-data))
228 (buffer (generate-new-buffer "*eudc-tmp*")) 237 (viewer (assoc program eudc-external-viewers)))
229 program 238 (with-temp-buffer
230 viewer) 239 (set-buffer-multibyte nil)
231 (condition-case nil 240 (insert data)
232 (save-excursion 241 (let ((coding-system-for-write 'binary)) ;Inhibit EOL conversion
233 (set-buffer-file-coding-system 'binary) 242 (if viewer
234 (set-buffer buffer) 243 (call-process-region (point-min) (point-max)
235 (insert data) 244 (car (cdr viewer))
236 (setq program (completing-read "Viewer: " eudc-external-viewers)) 245 (cdr (cdr viewer)))
237 (if (setq viewer (assoc program eudc-external-viewers)) 246 (call-process-region (point-min) (point-max) program))))))
238 (call-process-region (point-min) (point-max)
239 (car (cdr viewer))
240 (cdr (cdr viewer)))
241 (call-process-region (point-min) (point-max) program)))
242 (error
243 (kill-buffer buffer)))))
244 247
245(defun eudc-bob-menu () 248(defun eudc-bob-menu ()
246 "Retrieve the menu attached to a binary object." 249 "Retrieve the menu attached to a binary object."
@@ -250,47 +253,8 @@ display a button."
250 "Pop-up a menu of EUDC multimedia commands." 253 "Pop-up a menu of EUDC multimedia commands."
251 (interactive "@e") 254 (interactive "@e")
252 (run-hooks 'activate-menubar-hook) 255 (run-hooks 'activate-menubar-hook)
253 (eudc-jump-to-event event) 256 (mouse-set-point event)
254 (let ((result (x-popup-menu t (eudc-bob-menu))) 257 (popup-menu (eudc-bob-menu) event))
255 command)
256 (if result
257 (progn
258 (setq command (lookup-key (eudc-bob-menu)
259 (apply 'vector result)))
260 (command-execute command)))))
261
262(setq eudc-bob-generic-keymap
263 (let ((map (make-sparse-keymap)))
264 (define-key map "s" 'eudc-bob-save-object)
265 (define-key map "!" 'eudc-bob-pipe-object-to-external-program)
266 (define-key map [down-mouse-3] 'eudc-bob-popup-menu)
267 map))
268
269(setq eudc-bob-image-keymap
270 (let ((map (make-sparse-keymap)))
271 (define-key map "t" 'eudc-bob-toggle-inline-display)
272 map))
273
274(setq eudc-bob-sound-keymap
275 (let ((map (make-sparse-keymap)))
276 (define-key map [return] 'eudc-bob-play-sound-at-point)
277 (define-key map [down-mouse-2] 'eudc-bob-play-sound-at-mouse)
278 map))
279
280(setq eudc-bob-url-keymap
281 (let ((map (make-sparse-keymap)))
282 (define-key map [return] 'browse-url-at-point)
283 (define-key map [down-mouse-2] 'browse-url-at-mouse)
284 map))
285
286(setq eudc-bob-mail-keymap
287 (let ((map (make-sparse-keymap)))
288 (define-key map [return] 'goto-address-at-point)
289 (define-key map [down-mouse-2] 'goto-address-at-point)
290 map))
291
292(set-keymap-parent eudc-bob-image-keymap eudc-bob-generic-keymap)
293(set-keymap-parent eudc-bob-sound-keymap eudc-bob-generic-keymap)
294 258
295;; If the first arguments can be nil here, then these 3 can be 259;; If the first arguments can be nil here, then these 3 can be
296;; defconsts once more. 260;; defconsts once more.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index e7170b3e6d1..04deb5bee05 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -672,9 +672,30 @@ Currently this means either text/html or application/xhtml+xml."
672 (setq header-line-format 672 (setq header-line-format
673 (and eww-header-line-format 673 (and eww-header-line-format
674 (let ((title (plist-get eww-data :title)) 674 (let ((title (plist-get eww-data :title))
675 (peer (plist-get eww-data :peer))) 675 (peer (plist-get eww-data :peer))
676 (url (plist-get eww-data :url)))
676 (when (zerop (length title)) 677 (when (zerop (length title))
677 (setq title "[untitled]")) 678 (setq title "[untitled]"))
679 ;; Limit the length of the title so that the host name
680 ;; of the URL is always visible.
681 (when url
682 (let* ((parsed (url-generic-parse-url url))
683 (host-length (length (format "%s://%s"
684 (url-type parsed)
685 (url-host parsed))))
686 (width (window-width)))
687 (cond
688 ;; The host bit is wider than the window, so nix
689 ;; the title.
690 ((> (+ host-length 5) width)
691 (setq title ""))
692 ;; Trim the title.
693 ((> (+ (length title) host-length 2) width)
694 (setq title (concat
695 (substring title 0 (- width
696 host-length
697 5))
698 "..."))))))
678 ;; This connection has is https. 699 ;; This connection has is https.
679 (when peer 700 (when peer
680 (setq title 701 (setq title
@@ -686,7 +707,7 @@ Currently this means either text/html or application/xhtml+xml."
686 "%" "%%" 707 "%" "%%"
687 (format-spec 708 (format-spec
688 eww-header-line-format 709 eww-header-line-format
689 `((?u . ,(or (plist-get eww-data :url) "")) 710 `((?u . ,(or url ""))
690 (?t . ,title)))))))) 711 (?t . ,title))))))))
691 712
692(defun eww-tag-title (dom) 713(defun eww-tag-title (dom)
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index 1bed61f3e7d..ff8a447c7c1 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -131,14 +131,6 @@ groupcontent := feedname | groupdefinition)
131Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\") 131Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\")
132\"feed3\")") 132\"feed3\")")
133 133
134(defcustom newsticker-groups-filename
135 nil
136 "Name of the newsticker groups settings file."
137 :version "25.1" ; changed default value to nil
138 :type '(choice (const nil) string)
139 :group 'newsticker-treeview)
140(make-obsolete-variable 'newsticker-groups-filename 'newsticker-dir "23.1")
141
142;; ====================================================================== 134;; ======================================================================
143;;; internal variables 135;;; internal variables
144;; ====================================================================== 136;; ======================================================================
@@ -1265,29 +1257,9 @@ Note: does not update the layout."
1265(defun newsticker--treeview-load () 1257(defun newsticker--treeview-load ()
1266 "Load treeview settings." 1258 "Load treeview settings."
1267 (let* ((coding-system-for-read 'utf-8) 1259 (let* ((coding-system-for-read 'utf-8)
1268 (filename 1260 (filename (concat newsticker-dir "/groups"))
1269 (or (and newsticker-groups-filename
1270 (not (string=
1271 (expand-file-name newsticker-groups-filename)
1272 (expand-file-name (concat newsticker-dir "/groups"))))
1273 (file-exists-p newsticker-groups-filename)
1274 (y-or-n-p
1275 (format-message
1276 (concat "Obsolete variable `newsticker-groups-filename' "
1277 "points to existing file \"%s\".\n"
1278 "Read it? ")
1279 newsticker-groups-filename))
1280 newsticker-groups-filename)
1281 (concat newsticker-dir "/groups")))
1282 (buf (and (file-exists-p filename) 1261 (buf (and (file-exists-p filename)
1283 (find-file-noselect filename)))) 1262 (find-file-noselect filename))))
1284 (and newsticker-groups-filename
1285 (file-exists-p newsticker-groups-filename)
1286 (y-or-n-p (format-message
1287 (concat "Delete the file \"%s\",\nto which the obsolete "
1288 "variable `newsticker-groups-filename' points ? ")
1289 newsticker-groups-filename))
1290 (delete-file newsticker-groups-filename))
1291 (when buf 1263 (when buf
1292 (set-buffer buf) 1264 (set-buffer buf)
1293 (goto-char (point-min)) 1265 (goto-char (point-min))
diff --git a/lisp/net/ntlm.el b/lisp/net/ntlm.el
index ebcd21948bf..9401430799c 100644
--- a/lisp/net/ntlm.el
+++ b/lisp/net/ntlm.el
@@ -69,7 +69,6 @@
69 69
70(require 'md4) 70(require 'md4)
71(require 'hmac-md5) 71(require 'hmac-md5)
72(require 'calc)
73 72
74(defgroup ntlm nil 73(defgroup ntlm nil
75 "NTLM (NT LanManager) authentication." 74 "NTLM (NT LanManager) authentication."
@@ -133,32 +132,27 @@ is not given."
133 domain ;buffer field 132 domain ;buffer field
134 )))) 133 ))))
135 134
136(defun ntlm-compute-timestamp () 135(defun ntlm--time-to-timestamp (time)
137 "Compute an NTLMv2 timestamp. 136 "Convert TIME to an NTLMv2 timestamp.
138Return a unibyte string representing the number of tenths of a 137Return a unibyte string representing the number of tenths of a
139microsecond since January 1, 1601 as a 64-bit little-endian 138microsecond since January 1, 1601 as a 64-bit little-endian
140signed integer." 139signed integer. TIME must be on the form (HIGH LOW USEC PSEC)."
141 ;; FIXME: This can likely be significantly simplified using the new 140 (let* ((s (+ (ash (nth 0 time) 16) (nth 1 time)))
142 ;; bignums support! 141 (us (nth 2 time))
143 (let* ((s-to-tenths-of-us "mul(add(lsh($1,16),$2),10000000)") 142 (ps (nth 3 time))
144 (us-to-tenths-of-us "mul($3,10)") 143 (tenths-of-us-since-jan-1-1601
145 (ps-to-tenths-of-us "idiv($4,100000)") 144 (+ (* s 10000000) (* us 10) (/ ps 100000)
146 (tenths-of-us-since-jan-1-1601 145 ;; tenths of microseconds between 1601-01-01 and 1970-01-01
147 (apply #'calc-eval (concat "add(add(add(" 146 116444736000000000)))
148 s-to-tenths-of-us "," 147 (apply #'unibyte-string
149 us-to-tenths-of-us ")," 148 (mapcar (lambda (i)
150 ps-to-tenths-of-us ")," 149 (logand (ash tenths-of-us-since-jan-1-1601 (* i -8))
151 ;; tenths of microseconds between 150 #xff))
152 ;; 1601-01-01 and 1970-01-01 151 (number-sequence 0 7)))))
153 "116444736000000000)") 152
154 'rawnum (time-convert nil 'list))) 153(defun ntlm-compute-timestamp ()
155 result-bytes) 154 "Current time as an NTLMv2 timestamp, as a unibyte string."
156 (dotimes (_byte 8) 155 (ntlm--time-to-timestamp (time-convert nil 'list)))
157 (push (calc-eval "and($1,16#FF)" 'rawnum tenths-of-us-since-jan-1-1601)
158 result-bytes)
159 (setq tenths-of-us-since-jan-1-1601
160 (calc-eval "rsh($1,8,64)" 'rawnum tenths-of-us-since-jan-1-1601)))
161 (apply #'unibyte-string (nreverse result-bytes))))
162 156
163(defun ntlm-generate-nonce () 157(defun ntlm-generate-nonce ()
164 "Generate a random nonce, not to be used more than once. 158 "Generate a random nonce, not to be used more than once.
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index ca43475f453..fae15fe6a8e 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4781,104 +4781,6 @@ Goes through the list `tramp-inline-compress-commands'."
4781 (tramp-message 4781 (tramp-message
4782 vec 2 "Couldn't find an inline transfer compress command"))))) 4782 vec 2 "Couldn't find an inline transfer compress command")))))
4783 4783
4784;;;###tramp-autoload
4785(defun tramp-multi-hop-p (vec)
4786 "Whether the method of VEC is capable of multi-hops."
4787 (and (tramp-sh-file-name-handler-p vec)
4788 (not (tramp-get-method-parameter vec 'tramp-copy-program))))
4789
4790(defun tramp-compute-multi-hops (vec)
4791 "Expands VEC according to `tramp-default-proxies-alist'."
4792 (let ((saved-tdpa tramp-default-proxies-alist)
4793 (target-alist `(,vec))
4794 (hops (or (tramp-file-name-hop vec) ""))
4795 (item vec)
4796 choices proxy)
4797
4798 ;; Ad-hoc proxy definitions.
4799 (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
4800 (let* ((host-port (tramp-file-name-host-port item))
4801 (user-domain (tramp-file-name-user-domain item))
4802 (proxy (concat
4803 tramp-prefix-format proxy tramp-postfix-host-format))
4804 (entry
4805 (list (and (stringp host-port)
4806 (concat "^" (regexp-quote host-port) "$"))
4807 (and (stringp user-domain)
4808 (concat "^" (regexp-quote user-domain) "$"))
4809 (propertize proxy 'tramp-ad-hoc t))))
4810 (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
4811 ;; Add the hop.
4812 (add-to-list 'tramp-default-proxies-alist entry)
4813 (setq item (tramp-dissect-file-name proxy))))
4814 ;; Save the new value.
4815 (when (and hops tramp-save-ad-hoc-proxies)
4816 (customize-save-variable
4817 'tramp-default-proxies-alist tramp-default-proxies-alist))
4818
4819 ;; Look for proxy hosts to be passed.
4820 (setq choices tramp-default-proxies-alist)
4821 (while choices
4822 (setq item (pop choices)
4823 proxy (eval (nth 2 item)))
4824 (when (and
4825 ;; Host.
4826 (string-match-p
4827 (or (eval (nth 0 item)) "")
4828 (or (tramp-file-name-host-port (car target-alist)) ""))
4829 ;; User.
4830 (string-match-p
4831 (or (eval (nth 1 item)) "")
4832 (or (tramp-file-name-user-domain (car target-alist)) "")))
4833 (if (null proxy)
4834 ;; No more hops needed.
4835 (setq choices nil)
4836 ;; Replace placeholders.
4837 (setq proxy
4838 (format-spec
4839 proxy
4840 (format-spec-make
4841 ?u (or (tramp-file-name-user (car target-alist)) "")
4842 ?h (or (tramp-file-name-host (car target-alist)) ""))))
4843 (with-parsed-tramp-file-name proxy l
4844 ;; Add the hop.
4845 (push l target-alist)
4846 ;; Start next search.
4847 (setq choices tramp-default-proxies-alist)))))
4848
4849 ;; Foreign and out-of-band methods are not supported for multi-hops.
4850 (when (cdr target-alist)
4851 (setq choices target-alist)
4852 (while (setq item (pop choices))
4853 (unless (tramp-multi-hop-p item)
4854 (setq tramp-default-proxies-alist saved-tdpa)
4855 (tramp-user-error
4856 vec "Method `%s' is not supported for multi-hops."
4857 (tramp-file-name-method item)))))
4858
4859 ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the
4860 ;; host name in their command template. In this case, the remote
4861 ;; file name must use either a local host name (first hop), or a
4862 ;; host name matching the previous hop.
4863 (let ((previous-host (or tramp-local-host-regexp "")))
4864 (setq choices target-alist)
4865 (while (setq item (pop choices))
4866 (let ((host (tramp-file-name-host item)))
4867 (unless
4868 (or
4869 ;; The host name is used for the remote shell command.
4870 (member
4871 '("%h") (tramp-get-method-parameter item 'tramp-login-args))
4872 ;; The host name must match previous hop.
4873 (string-match-p previous-host host))
4874 (setq tramp-default-proxies-alist saved-tdpa)
4875 (tramp-user-error
4876 vec "Host name `%s' does not match `%s'" host previous-host))
4877 (setq previous-host (concat "^" (regexp-quote host) "$")))))
4878
4879 ;; Result.
4880 target-alist))
4881
4882(defun tramp-ssh-controlmaster-options (vec) 4784(defun tramp-ssh-controlmaster-options (vec)
4883 "Return the Control* arguments of the local ssh." 4785 "Return the Control* arguments of the local ssh."
4884 (cond 4786 (cond
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index ab52bec39eb..83ade66ee14 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3634,12 +3634,109 @@ User is always nil."
3634 (delete-file local-copy))))) 3634 (delete-file local-copy)))))
3635 t))) 3635 t)))
3636 3636
3637(defun tramp-multi-hop-p (vec)
3638 "Whether the method of VEC is capable of multi-hops."
3639 (and (tramp-sh-file-name-handler-p vec)
3640 (not (tramp-get-method-parameter vec 'tramp-copy-program))))
3641
3642(defun tramp-compute-multi-hops (vec)
3643 "Expands VEC according to `tramp-default-proxies-alist'."
3644 (let ((saved-tdpa tramp-default-proxies-alist)
3645 (target-alist `(,vec))
3646 (hops (or (tramp-file-name-hop vec) ""))
3647 (item vec)
3648 choices proxy)
3649
3650 ;; Ad-hoc proxy definitions.
3651 (dolist (proxy (reverse (split-string hops tramp-postfix-hop-regexp 'omit)))
3652 (let* ((host-port (tramp-file-name-host-port item))
3653 (user-domain (tramp-file-name-user-domain item))
3654 (proxy (concat
3655 tramp-prefix-format proxy tramp-postfix-host-format))
3656 (entry
3657 (list (and (stringp host-port)
3658 (concat "^" (regexp-quote host-port) "$"))
3659 (and (stringp user-domain)
3660 (concat "^" (regexp-quote user-domain) "$"))
3661 (propertize proxy 'tramp-ad-hoc t))))
3662 (tramp-message vec 5 "Add %S to `tramp-default-proxies-alist'" entry)
3663 ;; Add the hop.
3664 (add-to-list 'tramp-default-proxies-alist entry)
3665 (setq item (tramp-dissect-file-name proxy))))
3666 ;; Save the new value.
3667 (when (and hops tramp-save-ad-hoc-proxies)
3668 (customize-save-variable
3669 'tramp-default-proxies-alist tramp-default-proxies-alist))
3670
3671 ;; Look for proxy hosts to be passed.
3672 (setq choices tramp-default-proxies-alist)
3673 (while choices
3674 (setq item (pop choices)
3675 proxy (eval (nth 2 item)))
3676 (when (and
3677 ;; Host.
3678 (string-match-p
3679 (or (eval (nth 0 item)) "")
3680 (or (tramp-file-name-host-port (car target-alist)) ""))
3681 ;; User.
3682 (string-match-p
3683 (or (eval (nth 1 item)) "")
3684 (or (tramp-file-name-user-domain (car target-alist)) "")))
3685 (if (null proxy)
3686 ;; No more hops needed.
3687 (setq choices nil)
3688 ;; Replace placeholders.
3689 (setq proxy
3690 (format-spec
3691 proxy
3692 (format-spec-make
3693 ?u (or (tramp-file-name-user (car target-alist)) "")
3694 ?h (or (tramp-file-name-host (car target-alist)) ""))))
3695 (with-parsed-tramp-file-name proxy l
3696 ;; Add the hop.
3697 (push l target-alist)
3698 ;; Start next search.
3699 (setq choices tramp-default-proxies-alist)))))
3700
3701 ;; Foreign and out-of-band methods are not supported for multi-hops.
3702 (when (cdr target-alist)
3703 (setq choices target-alist)
3704 (while (setq item (pop choices))
3705 (unless (tramp-multi-hop-p item)
3706 (setq tramp-default-proxies-alist saved-tdpa)
3707 (tramp-user-error
3708 vec "Method `%s' is not supported for multi-hops."
3709 (tramp-file-name-method item)))))
3710
3711 ;; Some methods ("su", "sg", "sudo", "doas", "ksu") do not use the
3712 ;; host name in their command template. In this case, the remote
3713 ;; file name must use either a local host name (first hop), or a
3714 ;; host name matching the previous hop.
3715 (let ((previous-host (or tramp-local-host-regexp "")))
3716 (setq choices target-alist)
3717 (while (setq item (pop choices))
3718 (let ((host (tramp-file-name-host item)))
3719 (unless
3720 (or
3721 ;; The host name is used for the remote shell command.
3722 (member
3723 '("%h") (tramp-get-method-parameter item 'tramp-login-args))
3724 ;; The host name must match previous hop.
3725 (string-match-p previous-host host))
3726 (setq tramp-default-proxies-alist saved-tdpa)
3727 (tramp-user-error
3728 vec "Host name `%s' does not match `%s'" host previous-host))
3729 (setq previous-host (concat "^" (regexp-quote host) "$")))))
3730
3731 ;; Result.
3732 target-alist))
3733
3637(defun tramp-direct-async-process-p (&rest args) 3734(defun tramp-direct-async-process-p (&rest args)
3638 "Whether direct async `make-process' can be called." 3735 "Whether direct async `make-process' can be called."
3639 (let ((v (tramp-dissect-file-name default-directory))) 3736 (let ((v (tramp-dissect-file-name default-directory)))
3640 (and (tramp-get-connection-property v"direct-async-process" nil) 3737 (and (tramp-get-connection-property v "direct-async-process" nil)
3641 (not (tramp-multi-hop-p v)) 3738 (= (length (tramp-compute-multi-hops v)) 1)
3642 (not (plist-get args :stderr))))) 3739 (not (plist-get args :stderr)))))
3643 3740
3644;; We use BUFFER also as connection buffer during setup. Because of 3741;; We use BUFFER also as connection buffer during setup. Because of
3645;; this, its original contents must be saved, and restored once 3742;; this, its original contents must be saved, and restored once
diff --git a/lisp/erc/erc-compat.el b/lisp/obsolete/erc-compat.el
index d71221b2674..7ef30d822ff 100644
--- a/lisp/erc/erc-compat.el
+++ b/lisp/obsolete/erc-compat.el
@@ -5,6 +5,7 @@
5;; Author: Alex Schroeder <alex@gnu.org> 5;; Author: Alex Schroeder <alex@gnu.org>
6;; Maintainer: Amin Bandali <bandali@gnu.org> 6;; Maintainer: Amin Bandali <bandali@gnu.org>
7;; URL: https://www.emacswiki.org/emacs/ERC 7;; URL: https://www.emacswiki.org/emacs/ERC
8;; Obsolete-since: 28.1
8 9
9;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
10 11
diff --git a/lisp/obsolete/tpu-edt.el b/lisp/obsolete/tpu-edt.el
index d71f79c87be..0de7aa096d6 100644
--- a/lisp/obsolete/tpu-edt.el
+++ b/lisp/obsolete/tpu-edt.el
@@ -287,14 +287,6 @@
287;;; 287;;;
288;;; User Configurable Variables 288;;; User Configurable Variables
289;;; 289;;;
290(defcustom tpu-have-ispell t
291 "Non-nil means `tpu-spell-check' uses `ispell-region' for spell checking.
292Otherwise, use `spell-region'."
293 :type 'boolean
294 :group 'tpu)
295(make-obsolete-variable 'tpu-have-ispell "the `spell' package is obsolete."
296 "23.1")
297
298(defcustom tpu-kill-buffers-silently nil 290(defcustom tpu-kill-buffers-silently nil
299 "If non-nil, TPU-edt kills modified buffers without asking." 291 "If non-nil, TPU-edt kills modified buffers without asking."
300 :type 'boolean 292 :type 'boolean
@@ -315,7 +307,6 @@ Otherwise, use `spell-region'."
315;;; Global Keymaps 307;;; Global Keymaps
316;;; 308;;;
317 309
318(define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1")
319(defvar tpu-gold-map 310(defvar tpu-gold-map
320 (let ((map (make-keymap))) 311 (let ((map (make-keymap)))
321 ;; Previously we used escape sequences here. We now instead presume 312 ;; Previously we used escape sequences here. We now instead presume
@@ -892,8 +883,7 @@ With argument, fill and justify."
892if no region is selected." 883if no region is selected."
893 (interactive) 884 (interactive)
894 (let ((m (tpu-mark))) 885 (let ((m (tpu-mark)))
895 (apply (if tpu-have-ispell 'ispell-region 886 (apply 'ispell-region
896 'spell-region)
897 (if m 887 (if m
898 (if (> m (point)) (list (point) m) 888 (if (> m (point)) (list (point) m)
899 (list m (point))) 889 (list m (point)))
diff --git a/lisp/password-cache.el b/lisp/password-cache.el
index f5007579a8a..2443f374a84 100644
--- a/lisp/password-cache.el
+++ b/lisp/password-cache.el
@@ -94,22 +94,6 @@ The variable `password-cache' control whether the cache is used."
94 (or (password-read-from-cache key) 94 (or (password-read-from-cache key)
95 (read-passwd prompt))) 95 (read-passwd prompt)))
96 96
97(defun password-read-and-add (prompt &optional key)
98 "Read password, for use with KEY, from user, or from cache if wanted.
99Then store the password in the cache. Uses `password-read' and
100`password-cache-add'. Custom variables `password-cache' and
101`password-cache-expiry' regulate cache behavior.
102
103Warning: the password is cached without checking that it is
104correct. It is better to check the password before caching. If
105you must use this function, take care to check passwords and
106remove incorrect ones from the cache."
107 (declare (obsolete password-read "23.1"))
108 (let ((password (password-read prompt key)))
109 (when (and password key)
110 (password-cache-add key password))
111 password))
112
113(defun password-cache-remove (key) 97(defun password-cache-remove (key)
114 "Remove password indexed by KEY from password cache. 98 "Remove password indexed by KEY from password cache.
115This is typically run by a timer setup from `password-cache-add', 99This is typically run by a timer setup from `password-cache-add',
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index c3a98d9c5cf..7b8b174c430 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -384,7 +384,7 @@ comment at the start of cc-engine.el for more info."
384 c-macro-cache-syntactic nil 384 c-macro-cache-syntactic nil
385 c-macro-cache-no-comment nil)) 385 c-macro-cache-no-comment nil))
386 (save-match-data 386 (save-match-data
387 (let ((safe-pos (point))) ; a point ouside any literal. 387 (let ((safe-pos (point))) ; a point outside any literal.
388 ;; Move over stuff followed by a multiline block comment lacking 388 ;; Move over stuff followed by a multiline block comment lacking
389 ;; escaped newlines each time around this loop. 389 ;; escaped newlines each time around this loop.
390 (while 390 (while
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0b9f417845f..a043bbcfa3c 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -316,8 +316,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
316 (gcc-include 316 (gcc-include
317 "^\\(?:In file included \\| \\|\t\\)from \ 317 "^\\(?:In file included \\| \\|\t\\)from \
318\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\ 318\\([0-9]*[^0-9\n]\\(?:[^\n :]\\| [^-/\n]\\|:[^ \n]\\)*?\\):\
319\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\(:\\)\\|\\(,\\|$\\)\\)?" 319\\([0-9]+\\)\\(?::\\([0-9]+\\)\\)?\\(?:\\([:,]\\|$\\)\\)?"
320 1 2 3 (4 . 5)) 320 1 2 3 (nil . 4))
321 321
322 (ruby-Test::Unit 322 (ruby-Test::Unit
323 "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2) 323 "^ [[ ]?\\([^ (].*\\):\\([1-9][0-9]*\\)\\(\\]\\)?:in " 1 2)
@@ -2417,12 +2417,9 @@ and runs `compilation-filter-hook'."
2417 &optional object limit) 2417 &optional object limit)
2418 (let (parsed res) 2418 (let (parsed res)
2419 (while (progn 2419 (while (progn
2420 ;; We parse the buffer here "on-demand" by chunks of 500 chars.
2421 ;; But we could also just parse the whole buffer.
2422 (compilation--ensure-parse 2420 (compilation--ensure-parse
2423 (setq parsed (max compilation--parsed 2421 (setq parsed (max compilation--parsed
2424 (min (+ position 500) 2422 (or limit (point-max)))))
2425 (or limit (point-max))))))
2426 (and (or (not (setq res (next-single-property-change 2423 (and (or (not (setq res (next-single-property-change
2427 position prop object limit))) 2424 position prop object limit)))
2428 (eq res limit)) 2425 (eq res limit))
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 6122caf5189..2d2713a36ab 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -3979,6 +3979,9 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
3979 (and (eq (preceding-char) ?.) 3979 (and (eq (preceding-char) ?.)
3980 (eq (char-after (- (point) 2)) ?.)) 3980 (eq (char-after (- (point) 2)) ?.))
3981 (bobp)) 3981 (bobp))
3982 ;; { $a++ / $b } doesn't start a regex, nor does $a--
3983 (not (and (memq (preceding-char) '(?+ ?-))
3984 (eq (preceding-char) (char-before (1- (point))))))
3982 ;; m|blah| ? foo : bar; 3985 ;; m|blah| ? foo : bar;
3983 (not 3986 (not
3984 (and (eq c ?\?) 3987 (and (eq c ?\?)
diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el
index 08cf802bcbe..22c70bf734d 100644
--- a/lisp/progmodes/ebnf2ps.el
+++ b/lisp/progmodes/ebnf2ps.el
@@ -4527,7 +4527,7 @@ end
4527 (let* ((ebnf-tree tree) 4527 (let* ((ebnf-tree tree)
4528 (ps-color-p (and ebnf-color-p (ps-color-device))) 4528 (ps-color-p (and ebnf-color-p (ps-color-device)))
4529 (ps-print-color-scale (if ps-color-p 4529 (ps-print-color-scale (if ps-color-p
4530 (float (car (ps-color-values "white"))) 4530 (float (car (color-values "white")))
4531 1.0)) 4531 1.0))
4532 (ebnf-total (length ebnf-tree)) 4532 (ebnf-total (length ebnf-tree))
4533 (ebnf-nprod 0) 4533 (ebnf-nprod 0)
@@ -4629,7 +4629,7 @@ end
4629 (let* ((ebnf-tree tree) 4629 (let* ((ebnf-tree tree)
4630 (ps-color-p (and ebnf-color-p (ps-color-device))) 4630 (ps-color-p (and ebnf-color-p (ps-color-device)))
4631 (ps-print-color-scale (if ps-color-p 4631 (ps-print-color-scale (if ps-color-p
4632 (float (car (ps-color-values "white"))) 4632 (float (car (color-values "white")))
4633 1.0)) 4633 1.0))
4634 ps-zebra-stripes ps-line-number ps-razzle-dazzle 4634 ps-zebra-stripes ps-line-number ps-razzle-dazzle
4635 ps-print-hook 4635 ps-print-hook
diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2f44118edb5..21ba42a0fe1 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1420,10 +1420,12 @@ Intended for `eldoc-documentation-functions' (which see)."
1420(defun elisp-eldoc-var-docstring (callback &rest _ignored) 1420(defun elisp-eldoc-var-docstring (callback &rest _ignored)
1421 "Document variable at point. 1421 "Document variable at point.
1422Intended for `eldoc-documentation-functions' (which see)." 1422Intended for `eldoc-documentation-functions' (which see)."
1423 (let ((sym (elisp--current-symbol))) 1423 (let* ((sym (elisp--current-symbol))
1424 (when sym (funcall callback (elisp-get-var-docstring sym) 1424 (docstring (and sym (elisp-get-var-docstring sym))))
1425 :thing sym 1425 (when docstring
1426 :face 'font-lock-variable-name-face)))) 1426 (funcall callback docstring
1427 :thing sym
1428 :face 'font-lock-variable-name-face))))
1427 1429
1428(defun elisp-get-fnsym-args-string (sym &optional index) 1430(defun elisp-get-fnsym-args-string (sym &optional index)
1429 "Return a string containing the parameter list of the function SYM. 1431 "Return a string containing the parameter list of the function SYM.
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index edadbbdafc1..2c5c36504a9 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1424,6 +1424,10 @@ hits the start of file."
1424 (goto-func goto-tag-location-function) 1424 (goto-func goto-tag-location-function)
1425 tag tag-info pt) 1425 tag tag-info pt)
1426 (forward-line 1) 1426 (forward-line 1)
1427 ;; Exuberant ctags add a line starting with the DEL character;
1428 ;; skip past it.
1429 (when (looking-at "\177")
1430 (forward-line 1))
1427 (while (not (or (eobp) (looking-at "\f"))) 1431 (while (not (or (eobp) (looking-at "\f")))
1428 ;; We used to use explicit tags when available, but the current goto-func 1432 ;; We used to use explicit tags when available, but the current goto-func
1429 ;; can only handle implicit tags. 1433 ;; can only handle implicit tags.
diff --git a/lisp/progmodes/idlw-help.el b/lisp/progmodes/idlw-help.el
index d3a2308e06b..ec4fd58886a 100644
--- a/lisp/progmodes/idlw-help.el
+++ b/lisp/progmodes/idlw-help.el
@@ -267,7 +267,6 @@ support."
267(declare-function idlwave-find-class-definition "idlwave") 267(declare-function idlwave-find-class-definition "idlwave")
268(declare-function idlwave-find-inherited-class "idlwave") 268(declare-function idlwave-find-inherited-class "idlwave")
269(declare-function idlwave-find-struct-tag "idlwave") 269(declare-function idlwave-find-struct-tag "idlwave")
270(declare-function idlwave-get-buffer-visiting "idlwave")
271(declare-function idlwave-in-quote "idlwave") 270(declare-function idlwave-in-quote "idlwave")
272(declare-function idlwave-make-full-name "idlwave") 271(declare-function idlwave-make-full-name "idlwave")
273(declare-function idlwave-members-only "idlwave") 272(declare-function idlwave-members-only "idlwave")
@@ -880,7 +879,7 @@ This function can be used as `idlwave-extra-help-function'."
880 (setq in-buf ; structure-tag completion is always in current buffer 879 (setq in-buf ; structure-tag completion is always in current buffer
881 (if struct-tag 880 (if struct-tag
882 idlwave-current-tags-buffer 881 idlwave-current-tags-buffer
883 (idlwave-get-buffer-visiting file))) 882 (find-buffer-visiting file)))
884 ;; see if file is in a visited buffer, insert those contents 883 ;; see if file is in a visited buffer, insert those contents
885 (if in-buf 884 (if in-buf
886 (progn 885 (progn
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el
index f875915ca8e..99ac0877c8b 100644
--- a/lisp/progmodes/idlw-shell.el
+++ b/lisp/progmodes/idlw-shell.el
@@ -2640,7 +2640,7 @@ Assumes that `idlwave-shell-sources-alist' contains an entry for that module."
2640 (if (or (not source-file) 2640 (if (or (not source-file)
2641 (not (file-regular-p source-file)) 2641 (not (file-regular-p source-file))
2642 (not (setq buf 2642 (not (setq buf
2643 (or (idlwave-get-buffer-visiting source-file) 2643 (or (find-buffer-visiting source-file)
2644 (find-file-noselect source-file))))) 2644 (find-file-noselect source-file)))))
2645 (progn 2645 (progn
2646 (message "The source file for module %s is probably not compiled" 2646 (message "The source file for module %s is probably not compiled"
@@ -3241,8 +3241,7 @@ Does not work for a region with multiline blocks - use
3241 "Delete the temporary files and kill associated buffers." 3241 "Delete the temporary files and kill associated buffers."
3242 (if (stringp idlwave-shell-temp-pro-file) 3242 (if (stringp idlwave-shell-temp-pro-file)
3243 (condition-case nil 3243 (condition-case nil
3244 (let ((buf (idlwave-get-buffer-visiting 3244 (let ((buf (find-buffer-visiting idlwave-shell-temp-pro-file)))
3245 idlwave-shell-temp-pro-file)))
3246 (if (buffer-live-p buf) 3245 (if (buffer-live-p buf)
3247 (kill-buffer buf)) 3246 (kill-buffer buf))
3248 (delete-file idlwave-shell-temp-pro-file)) 3247 (delete-file idlwave-shell-temp-pro-file))
@@ -3788,7 +3787,7 @@ handled by this command."
3788 (save-buffer) 3787 (save-buffer)
3789 (setq idlwave-shell-last-save-and-action-file (buffer-file-name))) 3788 (setq idlwave-shell-last-save-and-action-file (buffer-file-name)))
3790 (idlwave-shell-last-save-and-action-file 3789 (idlwave-shell-last-save-and-action-file
3791 (if (setq buf (idlwave-get-buffer-visiting 3790 (if (setq buf (find-buffer-visiting
3792 idlwave-shell-last-save-and-action-file)) 3791 idlwave-shell-last-save-and-action-file))
3793 (with-current-buffer buf 3792 (with-current-buffer buf
3794 (save-buffer)))) 3793 (save-buffer))))
diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el
index f7e53ec02d6..153f2578bf1 100644
--- a/lisp/progmodes/idlwave.el
+++ b/lisp/progmodes/idlwave.el
@@ -581,12 +581,7 @@ like this:
581MyMethod <Class1,Class2,Class3> 581MyMethod <Class1,Class2,Class3>
582 582
583The value of this variable may be nil to inhibit display, or an integer to 583The value of this variable may be nil to inhibit display, or an integer to
584indicate the maximum number of classes to display. 584indicate the maximum number of classes to display."
585
586On XEmacs, a full list of classes will also be placed into a `help-echo'
587property on the completion items, so that the list of classes for the current
588item is displayed in the echo area. If the value of this variable is a
589negative integer, the `help-echo' property will be suppressed."
590 :group 'idlwave-completion 585 :group 'idlwave-completion
591 :type '(choice (const :tag "Don't show" nil) 586 :type '(choice (const :tag "Don't show" nil)
592 (integer :tag "Number of classes shown" 1))) 587 (integer :tag "Number of classes shown" 1)))
@@ -1054,7 +1049,6 @@ goto Goto Statements
1054common-blocks Common Blocks 1049common-blocks Common Blocks
1055keyword-parameters Keyword Parameters in routine definitions and calls 1050keyword-parameters Keyword Parameters in routine definitions and calls
1056system-variables System Variables 1051system-variables System Variables
1057fixme FIXME: Warning in comments (on XEmacs only v. 21.0 and up)
1058class-arrows Object Arrows with class property" 1052class-arrows Object Arrows with class property"
1059 :group 'idlwave-misc 1053 :group 'idlwave-misc
1060 :type '(set 1054 :type '(set
@@ -1069,7 +1063,6 @@ class-arrows Object Arrows with class property"
1069 (const :tag "Common Blocks" common-blocks) 1063 (const :tag "Common Blocks" common-blocks)
1070 (const :tag "Keyword Parameters" keyword-parameters) 1064 (const :tag "Keyword Parameters" keyword-parameters)
1071 (const :tag "System Variables" system-variables) 1065 (const :tag "System Variables" system-variables)
1072 (const :tag "FIXME: Warning" fixme)
1073 (const :tag "Object Arrows with class property " class-arrows))) 1066 (const :tag "Object Arrows with class property " class-arrows)))
1074 1067
1075(defcustom idlwave-mode-hook nil 1068(defcustom idlwave-mode-hook nil
@@ -1138,23 +1131,16 @@ As a user, you should not set this to t.")
1138 ;; Common blocks 1131 ;; Common blocks
1139 (common-blocks 1132 (common-blocks
1140 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?" 1133 '("\\<\\(common\\)\\>[ \t]*\\(\\sw+\\)?[ \t]*,?"
1141 (1 font-lock-keyword-face) ; "common" 1134 (1 font-lock-keyword-face) ; "common"
1142 (2 font-lock-constant-face nil t) ; block name 1135 (2 font-lock-constant-face nil t) ; block name
1143 ("[ \t]*\\(\\sw+\\)[ ,]*" 1136 ("[ \t]*\\(\\sw+\\)[ ,]*"
1144 ;; Start with point after block name and comma 1137 ;; Start with point after block name and comma
1145 (goto-char (match-end 0)) ; needed for XEmacs, could be nil 1138 nil nil (1 font-lock-variable-name-face)))) ; variable names
1146 nil
1147 (1 font-lock-variable-name-face) ; variable names
1148 )))
1149 1139
1150 ;; Batch files 1140 ;; Batch files
1151 (batch-files 1141 (batch-files
1152 '("^[ \t]*\\(@[^ \t\n]+\\)" (1 font-lock-string-face))) 1142 '("^[ \t]*\\(@[^ \t\n]+\\)" (1 font-lock-string-face)))
1153 1143
1154 ;; FIXME warning.
1155 (fixme
1156 '("\\<FIXME:" (0 font-lock-warning-face t)))
1157
1158 ;; Labels 1144 ;; Labels
1159 (label 1145 (label
1160 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face))) 1146 '("^[ \t]*\\([a-zA-Z]\\sw*:\\)" (1 font-lock-constant-face)))
@@ -1241,9 +1227,6 @@ As a user, you should not set this to t.")
1241 ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w")) 1227 ((?$ . "w") (?_ . "w") (?. . "w") (?| . "w") (?& . "w"))
1242 beginning-of-line)) 1228 beginning-of-line))
1243 1229
1244(put 'idlwave-mode 'font-lock-defaults
1245 idlwave-font-lock-defaults) ; XEmacs
1246
1247(defconst idlwave-comment-line-start-skip "^[ \t]*;" 1230(defconst idlwave-comment-line-start-skip "^[ \t]*;"
1248 "Regexp to match the start of a full-line comment. 1231 "Regexp to match the start of a full-line comment.
1249That is the _beginning_ of a line containing a comment delimiter `;' preceded 1232That is the _beginning_ of a line containing a comment delimiter `;' preceded
@@ -1479,9 +1462,7 @@ Otherwise ARGS forms a list that is evaluated."
1479 (define-key map "\M-\C-i" 'idlwave-complete) 1462 (define-key map "\M-\C-i" 'idlwave-complete)
1480 (define-key map "\C-c\C-i" 'idlwave-update-routine-info) 1463 (define-key map "\C-c\C-i" 'idlwave-update-routine-info)
1481 (define-key map "\C-c=" 'idlwave-resolve) 1464 (define-key map "\C-c=" 'idlwave-resolve)
1482 (define-key map 1465 (define-key map [(shift mouse-3)] 'idlwave-mouse-context-help)
1483 (if (featurep 'xemacs) [(shift button3)] [(shift mouse-3)])
1484 'idlwave-mouse-context-help)
1485 map) 1466 map)
1486 "Keymap used in IDL mode.") 1467 "Keymap used in IDL mode.")
1487 1468
@@ -1916,8 +1897,6 @@ The main features of this mode are
1916 (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS"))) 1897 (add-to-list 'tag-table-alist '("\\.pro$" . "IDLTAGS")))
1917 1898
1918 ;; Font-lock additions 1899 ;; Font-lock additions
1919 ;; Following line is for Emacs - XEmacs uses the corresponding property
1920 ;; on the `idlwave-mode' symbol.
1921 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults) 1900 (set (make-local-variable 'font-lock-defaults) idlwave-font-lock-defaults)
1922 (set (make-local-variable 'font-lock-mark-block-function) 1901 (set (make-local-variable 'font-lock-mark-block-function)
1923 'idlwave-mark-subprogram) 1902 'idlwave-mark-subprogram)
@@ -3814,15 +3793,8 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
3814 (setq start (match-end 0))) 3793 (setq start (match-end 0)))
3815 (setq ret_string (concat ret_string (substring string start last))))) 3794 (setq ret_string (concat ret_string (substring string start last)))))
3816 3795
3817(defun idlwave-get-buffer-visiting (file) 3796(define-obsolete-function-alias 'idlwave-get-buffer-visiting
3818 ;; Return the buffer currently visiting FILE 3797 #'find-buffer-visiting "28.1")
3819 (cond
3820 ((boundp 'find-file-compare-truenames) ; XEmacs
3821 (let ((find-file-compare-truenames t))
3822 (get-file-buffer file)))
3823 ((fboundp 'find-buffer-visiting) ; Emacs
3824 (find-buffer-visiting file))
3825 (t (error "This should not happen (idlwave-get-buffer-visiting)"))))
3826 3798
3827(defvar idlwave-outlawed-buffers nil 3799(defvar idlwave-outlawed-buffers nil
3828 "List of buffers pulled up by IDLWAVE for special reasons. 3800 "List of buffers pulled up by IDLWAVE for special reasons.
@@ -3830,7 +3802,7 @@ Buffers in this list may be killed by `idlwave-kill-autoloaded-buffers'.")
3830 3802
3831(defun idlwave-find-file-noselect (file &optional why) 3803(defun idlwave-find-file-noselect (file &optional why)
3832 ;; Return a buffer visiting file. 3804 ;; Return a buffer visiting file.
3833 (or (idlwave-get-buffer-visiting file) 3805 (or (find-buffer-visiting file)
3834 (let ((buf (find-file-noselect file))) 3806 (let ((buf (find-file-noselect file)))
3835 (if why (add-to-list 'idlwave-outlawed-buffers (cons buf why))) 3807 (if why (add-to-list 'idlwave-outlawed-buffers (cons buf why)))
3836 buf))) 3808 buf)))
@@ -6618,7 +6590,6 @@ This function is not general, can only be used for completion stuff."
6618 "A form to evaluate after completion selection in *Completions* buffer.") 6590 "A form to evaluate after completion selection in *Completions* buffer.")
6619(defconst idlwave-completion-mark (make-marker) 6591(defconst idlwave-completion-mark (make-marker)
6620 "A mark pointing to the beginning of the completion string.") 6592 "A mark pointing to the beginning of the completion string.")
6621(defvar completion-highlight-first-word-only) ;XEmacs.
6622 6593
6623(defun idlwave-complete-in-buffer (type stype list selector prompt isa 6594(defun idlwave-complete-in-buffer (type stype list selector prompt isa
6624 &optional prepare-display-function 6595 &optional prepare-display-function
@@ -6697,12 +6668,7 @@ accumulate information on matching completions."
6697 list)) 6668 list))
6698 (let* ((list all-completions) 6669 (let* ((list all-completions)
6699 ;; "complete" means, this is already a valid completion 6670 ;; "complete" means, this is already a valid completion
6700 (complete (memq spart all-completions)) 6671 (complete (memq spart all-completions)))
6701 (completion-highlight-first-word-only t)) ; XEmacs
6702 ;; (completion-fixup-function ; Emacs
6703 ;; (lambda () (and (eq (preceding-char) ?>)
6704 ;; (re-search-backward " <" beg t)))))
6705
6706 (setq list (sort list (lambda (a b) 6672 (setq list (sort list (lambda (a b)
6707 (string< (downcase a) (downcase b))))) 6673 (string< (downcase a) (downcase b)))))
6708 (if prepare-display-function 6674 (if prepare-display-function
@@ -6764,7 +6730,6 @@ accumulate information on matching completions."
6764 (let* ((do-prop (and (>= show-classes 0) 6730 (let* ((do-prop (and (>= show-classes 0)
6765 (>= emacs-major-version 21))) 6731 (>= emacs-major-version 21)))
6766 (do-buf (not (= show-classes 0))) 6732 (do-buf (not (= show-classes 0)))
6767 ;; (do-dots (featurep 'xemacs))
6768 (do-dots t) 6733 (do-dots t)
6769 (inherit (if (and (not (eq type 'class-tag)) super-classes) 6734 (inherit (if (and (not (eq type 'class-tag)) super-classes)
6770 (cons class-selector super-classes))) 6735 (cons class-selector super-classes)))
@@ -6830,10 +6795,6 @@ accumulate information on matching completions."
6830;;---------------------------------------------------------------------- 6795;;----------------------------------------------------------------------
6831;;---------------------------------------------------------------------- 6796;;----------------------------------------------------------------------
6832;;---------------------------------------------------------------------- 6797;;----------------------------------------------------------------------
6833(when (featurep 'xemacs)
6834 (defvar rtn)
6835 (defun idlwave-pset (item)
6836 (set 'rtn item)))
6837 6798
6838(defun idlwave-popup-select (ev list title &optional sort) 6799(defun idlwave-popup-select (ev list title &optional sort)
6839 "Select an item in LIST with a popup menu. 6800 "Select an item in LIST with a popup menu.
@@ -6844,17 +6805,6 @@ sort the list before displaying."
6844 (cond ((null list)) 6805 (cond ((null list))
6845 ((= 1 (length list)) 6806 ((= 1 (length list))
6846 (setq rtn (car list))) 6807 (setq rtn (car list)))
6847 ((featurep 'xemacs)
6848 (if sort (setq list (sort list (lambda (a b)
6849 (string< (upcase a) (upcase b))))))
6850 (setq menu
6851 (append (list title)
6852 (mapcar (lambda (x) (vector x (list 'idlwave-pset
6853 x)))
6854 list)))
6855 (setq menu (idlwave-split-menu-xemacs menu maxpopup))
6856 (let ((resp (get-popup-menu-response menu)))
6857 (funcall (event-function resp) (event-object resp))))
6858 (t 6808 (t
6859 (if sort (setq list (sort list (lambda (a b) 6809 (if sort (setq list (sort list (lambda (a b)
6860 (string< (upcase a) (upcase b)))))) 6810 (string< (upcase a) (upcase b))))))
@@ -6862,36 +6812,14 @@ sort the list before displaying."
6862 (list 6812 (list
6863 (append (list "") 6813 (append (list "")
6864 (mapcar (lambda(x) (cons x x)) list))))) 6814 (mapcar (lambda(x) (cons x x)) list)))))
6865 (setq menu (idlwave-split-menu-emacs menu maxpopup)) 6815 (setq menu (idlwave-split-menu menu maxpopup))
6866 (setq rtn (x-popup-menu ev menu)))) 6816 (setq rtn (x-popup-menu ev menu))))
6867 rtn)) 6817 rtn))
6868 6818
6869(defun idlwave-split-menu-xemacs (menu N) 6819(define-obsolete-function-alias 'idlwave-split-menu-emacs
6870 "Split the MENU into submenus of maximum length N." 6820 #'idlwave-split-menu "28.1")
6871 (if (<= (length menu) (1+ N))
6872 ;; No splitting needed
6873 menu
6874 (let* ((title (car menu))
6875 (entries (cdr menu))
6876 (menu (list title))
6877 (cnt 0)
6878 (nextmenu nil))
6879 (while entries
6880 (while (and entries (< cnt N))
6881 (setq cnt (1+ cnt)
6882 nextmenu (cons (car entries) nextmenu)
6883 entries (cdr entries)))
6884 (setq nextmenu (nreverse nextmenu))
6885 (setq nextmenu (cons (format "%s...%s"
6886 (aref (car nextmenu) 0)
6887 (aref (nth (1- cnt) nextmenu) 0))
6888 nextmenu))
6889 (setq menu (cons nextmenu menu)
6890 nextmenu nil
6891 cnt 0))
6892 (nreverse menu))))
6893 6821
6894(defun idlwave-split-menu-emacs (menu N) 6822(defun idlwave-split-menu (menu N)
6895 "Split the MENU into submenus of maximum length N." 6823 "Split the MENU into submenus of maximum length N."
6896 (if (<= (length (nth 1 menu)) (1+ N)) 6824 (if (<= (length (nth 1 menu)) (1+ N))
6897 ;; No splitting needed 6825 ;; No splitting needed
@@ -6946,10 +6874,7 @@ sort the list before displaying."
6946 (move-marker idlwave-completion-mark beg) 6874 (move-marker idlwave-completion-mark beg)
6947 (setq idlwave-before-completion-wconf (current-window-configuration))) 6875 (setq idlwave-before-completion-wconf (current-window-configuration)))
6948 6876
6949 (if (featurep 'xemacs) 6877 (idlwave-display-completion-list-1 list)
6950 (idlwave-display-completion-list-xemacs
6951 list)
6952 (idlwave-display-completion-list-emacs list))
6953 6878
6954 ;; Store a special value in `this-command'. When `idlwave-complete' 6879 ;; Store a special value in `this-command'. When `idlwave-complete'
6955 ;; finds this in `last-command', it will scroll the *Completions* buffer. 6880 ;; finds this in `last-command', it will scroll the *Completions* buffer.
@@ -7007,8 +6932,7 @@ The key which is associated with each option is generated automatically.
7007First, the strings are checked for preselected keys, like in \"[P]rint\". 6932First, the strings are checked for preselected keys, like in \"[P]rint\".
7008If these don't exist, a letter in the string is automatically selected." 6933If these don't exist, a letter in the string is automatically selected."
7009 (let* ((alist (symbol-value sym)) 6934 (let* ((alist (symbol-value sym))
7010 (temp-buffer-show-hook (if (fboundp 'fit-window-to-buffer) 6935 (temp-buffer-show-hook '(fit-window-to-buffer))
7011 '(fit-window-to-buffer)))
7012 keys-alist char) 6936 keys-alist char)
7013 ;; First check the cache 6937 ;; First check the cache
7014 (if (and (eq (symbol-value sym) (get sym :one-key-alist-last))) 6938 (if (and (eq (symbol-value sym) (get sym :one-key-alist-last)))
@@ -7094,42 +7018,17 @@ If these don't exist, a letter in the string is automatically selected."
7094 (and (local-variable-p var (current-buffer)) 7018 (and (local-variable-p var (current-buffer))
7095 (symbol-value var)))) 7019 (symbol-value var))))
7096 7020
7097;; In XEmacs, we can use :activate-callback directly to advice the
7098;; choose functions. We use the private keymap only for the online
7099;; help feature.
7100
7101(defvar idlwave-completion-map nil 7021(defvar idlwave-completion-map nil
7102 "Keymap for `completion-list-mode' with `idlwave-complete'.") 7022 "Keymap for `completion-list-mode' with `idlwave-complete'.")
7103 7023
7104(defun idlwave-display-completion-list-xemacs (list &rest cl-args)
7105 (with-output-to-temp-buffer "*Completions*"
7106 (apply 'display-completion-list list
7107 ':activate-callback 'idlwave-default-choose-completion
7108 cl-args))
7109 (with-current-buffer "*Completions*"
7110 (use-local-map
7111 (or idlwave-completion-map
7112 (setq idlwave-completion-map
7113 (idlwave-make-modified-completion-map-xemacs
7114 (current-local-map)))))))
7115
7116(defun idlwave-default-choose-completion (&rest args) 7024(defun idlwave-default-choose-completion (&rest args)
7117 "Execute `default-choose-completion' and then restore the win-conf." 7025 "Execute `default-choose-completion' and then restore the win-conf."
7118 (apply 'idlwave-choose 'default-choose-completion args)) 7026 (apply 'idlwave-choose 'default-choose-completion args))
7119 7027
7120(defun idlwave-make-modified-completion-map-xemacs (old-map) 7028(define-obsolete-function-alias 'idlwave-display-completion-list-emacs
7121 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." 7029 #'idlwave-display-completion-list-1 "28.1")
7122 (let ((new-map (copy-keymap old-map)))
7123 (define-key new-map [button3up] 'idlwave-mouse-completion-help)
7124 (define-key new-map [button3] (lambda ()
7125 (interactive)
7126 (setq this-command last-command)))
7127 new-map))
7128
7129;; In Emacs we also replace keybindings in the completion
7130;; map in order to install our wrappers.
7131 7030
7132(defun idlwave-display-completion-list-emacs (list) 7031(defun idlwave-display-completion-list-1 (list)
7133 "Display completion list and install the choose wrappers." 7032 "Display completion list and install the choose wrappers."
7134 (with-output-to-temp-buffer "*Completions*" 7033 (with-output-to-temp-buffer "*Completions*"
7135 (display-completion-list list)) 7034 (display-completion-list list))
@@ -7137,10 +7036,12 @@ If these don't exist, a letter in the string is automatically selected."
7137 (use-local-map 7036 (use-local-map
7138 (or idlwave-completion-map 7037 (or idlwave-completion-map
7139 (setq idlwave-completion-map 7038 (setq idlwave-completion-map
7140 (idlwave-make-modified-completion-map-emacs 7039 (idlwave-make-modified-completion-map (current-local-map)))))))
7141 (current-local-map)))))))
7142 7040
7143(defun idlwave-make-modified-completion-map-emacs (old-map) 7041(define-obsolete-function-alias 'idlwave-make-modified-completion-map-emacs
7042 #'idlwave-make-modified-completion-map "28.1")
7043
7044(defun idlwave-make-modified-completion-map (old-map)
7144 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP." 7045 "Replace `choose-completion' and `mouse-choose-completion' in OLD-MAP."
7145 (let ((new-map (copy-keymap old-map))) 7046 (let ((new-map (copy-keymap old-map)))
7146 (substitute-key-definition 7047 (substitute-key-definition
@@ -7352,7 +7253,7 @@ class/struct definition."
7352 (file (idlwave-routine-source-file 7253 (file (idlwave-routine-source-file
7353 (nth 3 (idlwave-rinfo-assoc pro 'pro nil 7254 (nth 3 (idlwave-rinfo-assoc pro 'pro nil
7354 (idlwave-routines)))))) 7255 (idlwave-routines))))))
7355 (cons file (if file (idlwave-get-buffer-visiting file))))) 7256 (cons file (if file (find-buffer-visiting file)))))
7356 7257
7357 7258
7358(defun idlwave-scan-class-info (class) 7259(defun idlwave-scan-class-info (class)
@@ -8223,15 +8124,9 @@ If we do not know about MODULE, just return KEYWORD literally."
8223 8124
8224(defvar idlwave-rinfo-mouse-map 8125(defvar idlwave-rinfo-mouse-map
8225 (let ((map (make-sparse-keymap))) 8126 (let ((map (make-sparse-keymap)))
8226 (define-key map 8127 (define-key map [mouse-2] 'idlwave-mouse-active-rinfo)
8227 (if (featurep 'xemacs) [button2] [mouse-2]) 8128 (define-key map [(shift mouse-2)] 'idlwave-mouse-active-rinfo-shift)
8228 'idlwave-mouse-active-rinfo) 8129 (define-key map [mouse-3] 'idlwave-mouse-active-rinfo-right)
8229 (define-key map
8230 (if (featurep 'xemacs) [(shift button2)] [(shift mouse-2)])
8231 'idlwave-mouse-active-rinfo-shift)
8232 (define-key map
8233 (if (featurep 'xemacs) [button3] [mouse-3])
8234 'idlwave-mouse-active-rinfo-right)
8235 (define-key map " " 'idlwave-active-rinfo-space) 8130 (define-key map " " 'idlwave-active-rinfo-space)
8236 (define-key map "q" 'idlwave-quit-help) 8131 (define-key map "q" 'idlwave-quit-help)
8237 map)) 8132 map))
@@ -8283,7 +8178,6 @@ If we do not know about MODULE, just return KEYWORD literally."
8283 "Button2: Display info about same method in superclass") 8178 "Button2: Display info about same method in superclass")
8284 (col 0) 8179 (col 0)
8285 (data (list name type class (current-buffer) nil initial-class)) 8180 (data (list name type class (current-buffer) nil initial-class))
8286 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
8287 (face 'idlwave-help-link) 8181 (face 'idlwave-help-link)
8288 beg props win cnt total) 8182 beg props win cnt total)
8289 ;; Fix keywords, but don't add chained super-classes, since these 8183 ;; Fix keywords, but don't add chained super-classes, since these
@@ -8308,7 +8202,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8308 idlwave-current-obj_new-class) 8202 idlwave-current-obj_new-class)
8309 (when superclasses 8203 (when superclasses
8310 (setq props (list 'mouse-face 'highlight 8204 (setq props (list 'mouse-face 'highlight
8311 km-prop idlwave-rinfo-mouse-map 8205 'local-map idlwave-rinfo-mouse-map
8312 'help-echo help-echo-class 8206 'help-echo help-echo-class
8313 'data (cons 'class data))) 8207 'data (cons 'class data)))
8314 (let ((classes (cons initial-class superclasses)) c) 8208 (let ((classes (cons initial-class superclasses)) c)
@@ -8324,7 +8218,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8324 (add-text-properties beg (point) props)))) 8218 (add-text-properties beg (point) props))))
8325 (insert "\n"))) 8219 (insert "\n")))
8326 (setq props (list 'mouse-face 'highlight 8220 (setq props (list 'mouse-face 'highlight
8327 km-prop idlwave-rinfo-mouse-map 8221 'local-map idlwave-rinfo-mouse-map
8328 'help-echo help-echo-use 8222 'help-echo help-echo-use
8329 'data (cons 'usage data))) 8223 'data (cons 'usage data)))
8330 (if html-file (setq props (append (list 'face face 'link html-file) 8224 (if html-file (setq props (append (list 'face face 'link html-file)
@@ -8352,7 +8246,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8352 (setq beg (point) 8246 (setq beg (point)
8353 ;; Relevant keywords already have link property attached 8247 ;; Relevant keywords already have link property attached
8354 props (list 'mouse-face 'highlight 8248 props (list 'mouse-face 'highlight
8355 km-prop idlwave-rinfo-mouse-map 8249 'local-map idlwave-rinfo-mouse-map
8356 'data (cons 'keyword data) 8250 'data (cons 'keyword data)
8357 'help-echo help-echo-kwd 8251 'help-echo help-echo-kwd
8358 'keyword (car x))) 8252 'keyword (car x)))
@@ -8366,7 +8260,7 @@ If we do not know about MODULE, just return KEYWORD literally."
8366 ;; Here entry is (key file (list of type-conses)) 8260 ;; Here entry is (key file (list of type-conses))
8367 (while (setq entry (pop all)) 8261 (while (setq entry (pop all))
8368 (setq props (list 'mouse-face 'highlight 8262 (setq props (list 'mouse-face 'highlight
8369 km-prop idlwave-rinfo-mouse-map 8263 'local-map idlwave-rinfo-mouse-map
8370 'help-echo help-echo-src 8264 'help-echo help-echo-src
8371 'source (list (car (car (nth 2 entry))) ;type 8265 'source (list (car (car (nth 2 entry))) ;type
8372 (nth 1 entry) 8266 (nth 1 entry)
@@ -8471,8 +8365,7 @@ to it."
8471 (add-text-properties beg (point) (list 'face 'bold))) 8365 (add-text-properties beg (point) (list 'face 'bold)))
8472 (when (and file (not (equal file ""))) 8366 (when (and file (not (equal file "")))
8473 (setq beg (point)) 8367 (setq beg (point))
8474 (insert (apply 'abbreviate-file-name 8368 (insert (apply 'abbreviate-file-name (list file)))
8475 (if (featurep 'xemacs) (list file t) (list file))))
8476 (if file-props 8369 (if file-props
8477 (add-text-properties beg (point) file-props))))) 8370 (add-text-properties beg (point) file-props)))))
8478 8371
@@ -8632,10 +8525,9 @@ can be used to detect possible name clashes during this process."
8632 idlwave-user-catalog-routines 8525 idlwave-user-catalog-routines
8633 idlwave-buffer-routines 8526 idlwave-buffer-routines
8634 nil)) 8527 nil))
8635 (km-prop (if (featurep 'xemacs) 'keymap 'local-map))
8636 (keymap (make-sparse-keymap)) 8528 (keymap (make-sparse-keymap))
8637 (props (list 'mouse-face 'highlight 8529 (props (list 'mouse-face 'highlight
8638 km-prop keymap 8530 'local-map keymap
8639 'help-echo "Mouse2: Find source")) 8531 'help-echo "Mouse2: Find source"))
8640 (nroutines (length (or special-routines routines))) 8532 (nroutines (length (or special-routines routines)))
8641 (step (/ nroutines 100)) 8533 (step (/ nroutines 100))
@@ -8658,7 +8550,7 @@ can be used to detect possible name clashes during this process."
8658 (nth 2 b) (car b))))))) 8550 (nth 2 b) (car b)))))))
8659 (message "Sorting routines...done") 8551 (message "Sorting routines...done")
8660 8552
8661 (define-key keymap (if (featurep 'xemacs) [(button2)] [(mouse-2)]) 8553 (define-key keymap [(mouse-2)]
8662 (lambda (ev) 8554 (lambda (ev)
8663 (interactive "e") 8555 (interactive "e")
8664 (mouse-set-point ev) 8556 (mouse-set-point ev)
@@ -9020,23 +8912,6 @@ Assumes that point is at the beginning of the unit as found by
9020 'imenu) 8912 'imenu)
9021 (error nil))))) 8913 (error nil)))))
9022 8914
9023;; Here we hack func-menu.el in order to support this new mode.
9024;; The latest versions of func-menu.el already have this stuff in, so
9025;; we hack only if it is not already there.
9026(when (featurep 'xemacs)
9027 (eval-after-load "func-menu"
9028 '(progn
9029 (or (assq 'idlwave-mode fume-function-name-regexp-alist)
9030 (not (boundp 'fume-function-name-regexp-idl)) ; avoid problems
9031 (setq fume-function-name-regexp-alist
9032 (cons '(idlwave-mode . fume-function-name-regexp-idl)
9033 fume-function-name-regexp-alist)))
9034 (or (assq 'idlwave-mode fume-find-function-name-method-alist)
9035 (not (fboundp 'fume-find-next-idl-function-name)) ; avoid problems
9036 (setq fume-find-function-name-method-alist
9037 (cons '(idlwave-mode . fume-find-next-idl-function-name)
9038 fume-find-function-name-method-alist))))))
9039
9040(defun idlwave-edit-in-idlde () 8915(defun idlwave-edit-in-idlde ()
9041 "Edit the current file in IDL Development environment." 8916 "Edit the current file in IDL Development environment."
9042 (interactive) 8917 (interactive)
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index ff0b6a331bc..127b24cb890 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -214,7 +214,9 @@
214 (defconst perl--syntax-exp-intro-regexp 214 (defconst perl--syntax-exp-intro-regexp
215 (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)" 215 (concat "\\(?:\\(?:^\\|[^$@&%[:word:]]\\)"
216 (regexp-opt perl--syntax-exp-intro-keywords) 216 (regexp-opt perl--syntax-exp-intro-keywords)
217 "\\|[-?:.,;|&+*=!~({[]\\|\\(^\\)\\)[ \t\n]*"))) 217 "\\|[?:.,;|&*=!~({[]"
218 "\\|[^-+][-+]" ;Bug#42168: `+' is intro but `++' isn't!
219 "\\|\\(^\\)\\)[ \t\n]*")))
218 220
219(defun perl-syntax-propertize-function (start end) 221(defun perl-syntax-propertize-function (start end)
220 (let ((case-fold-search nil)) 222 (let ((case-fold-search nil))
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index b6161351f0b..8afd5ce7959 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1,8 +1,8 @@
1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*- 1;;; project.el --- Operations on the current project -*- lexical-binding: t; -*-
2 2
3;; Copyright (C) 2015-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2015-2020 Free Software Foundation, Inc.
4;; Version: 0.5.0 4;; Version: 0.5.1
5;; Package-Requires: ((emacs "26.3")) 5;; Package-Requires: ((emacs "26.3") (xref "1.0.2"))
6 6
7;; This is a GNU ELPA :core package. Avoid using functionality that 7;; This is a GNU ELPA :core package. Avoid using functionality that
8;; not compatible with the version of Emacs recorded above. 8;; not compatible with the version of Emacs recorded above.
@@ -731,24 +731,6 @@ pattern to search for."
731 (user-error "No matches for: %s" regexp)) 731 (user-error "No matches for: %s" regexp))
732 xrefs)) 732 xrefs))
733 733
734(defun project--process-file-region (start end program
735 &optional buffer display
736 &rest args)
737 ;; FIXME: This branching shouldn't be necessary, but
738 ;; call-process-region *is* measurably faster, even for a program
739 ;; doing some actual work (for a period of time). Even though
740 ;; call-process-region also creates a temp file internally
741 ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html).
742 (if (not (file-remote-p default-directory))
743 (apply #'call-process-region
744 start end program nil buffer display args)
745 (let ((infile (make-temp-file "ppfr")))
746 (unwind-protect
747 (progn
748 (write-region start end infile nil 'silent)
749 (apply #'process-file program infile buffer display args))
750 (delete-file infile)))))
751
752(defun project--read-regexp () 734(defun project--read-regexp ()
753 (let ((sym (thing-at-point 'symbol))) 735 (let ((sym (thing-at-point 'symbol)))
754 (read-regexp "Find regexp" (and sym (regexp-quote sym))))) 736 (read-regexp "Find regexp" (and sym (regexp-quote sym)))))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3af55be4a19..d83af83b32e 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -283,24 +283,6 @@
283 :link '(emacs-commentary-link "python")) 283 :link '(emacs-commentary-link "python"))
284 284
285 285
286;;; 24.x Compat
287
288
289(eval-and-compile
290 (unless (fboundp 'prog-first-column)
291 (defun prog-first-column ()
292 0))
293 (unless (fboundp 'file-local-name)
294 (defun file-local-name (file)
295 "Return the local name component of FILE.
296It returns a file name which can be used directly as argument of
297`process-file', `start-file-process', or `shell-command'."
298 (or (file-remote-p file 'localname) file))))
299
300;; In Emacs 24.3 and earlier, `define-derived-mode' does not define
301;; the hook variable, it only puts documentation on the symbol.
302(defvar inferior-python-mode-hook)
303
304 286
305;;; Bindings 287;;; Bindings
306 288
@@ -2809,6 +2791,7 @@ variable.
2809 python-shell-comint-watch-for-first-prompt-output-filter 2791 python-shell-comint-watch-for-first-prompt-output-filter
2810 python-comint-postoutput-scroll-to-bottom 2792 python-comint-postoutput-scroll-to-bottom
2811 comint-watch-for-password-prompt)) 2793 comint-watch-for-password-prompt))
2794 (setq-local comint-highlight-input nil)
2812 (set (make-local-variable 'compilation-error-regexp-alist) 2795 (set (make-local-variable 'compilation-error-regexp-alist)
2813 python-shell-compilation-regexp-alist) 2796 python-shell-compilation-regexp-alist)
2814 (add-hook 'completion-at-point-functions 2797 (add-hook 'completion-at-point-functions
diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el
index f9b069fd4e5..0f2c9431f6e 100644
--- a/lisp/progmodes/subword.el
+++ b/lisp/progmodes/subword.el
@@ -115,6 +115,8 @@ treat nomenclature boundaries as word boundaries."
115 (when subword-mode (superword-mode -1)) 115 (when subword-mode (superword-mode -1))
116 (subword-setup-buffer)) 116 (subword-setup-buffer))
117 117
118;; This is defined also in cc-cmds.el, but as obsolete since 24.3.
119;; Let's keep this until the other one can also be removed.
118(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2") 120(define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2")
119 121
120;;;###autoload 122;;;###autoload
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 3e3a37f6da5..bbf899e7017 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1,8 +1,8 @@
1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*- 1;;; xref.el --- Cross-referencing commands -*-lexical-binding:t-*-
2 2
3;; Copyright (C) 2014-2020 Free Software Foundation, Inc. 3;; Copyright (C) 2014-2020 Free Software Foundation, Inc.
4;; Version: 1.0.1 4;; Version: 1.0.2
5;; Package-Requires: ((emacs "26.3") (project "0.1.1")) 5;; Package-Requires: ((emacs "26.3"))
6 6
7;; This is a GNU ELPA :core package. Avoid functionality that is not 7;; This is a GNU ELPA :core package. Avoid functionality that is not
8;; compatible with the version of Emacs recorded above. 8;; compatible with the version of Emacs recorded above.
@@ -263,13 +263,16 @@ be found, return nil.
263 263
264The default implementation uses `semantic-symref-tool-alist' to 264The default implementation uses `semantic-symref-tool-alist' to
265find a search tool; by default, this uses \"find | grep\" in the 265find a search tool; by default, this uses \"find | grep\" in the
266`project-current' roots." 266current project's main and external roots."
267 (mapcan 267 (mapcan
268 (lambda (dir) 268 (lambda (dir)
269 (xref-references-in-directory identifier dir)) 269 (xref-references-in-directory identifier dir))
270 (let ((pr (project-current t))) 270 (let ((pr (project-current t)))
271 (cons 271 (cons
272 (project-root pr) 272 (if (fboundp 'project-root)
273 (project-root pr)
274 (with-no-warnings
275 (project-roots pr)))
273 (project-external-roots pr))))) 276 (project-external-roots pr)))))
274 277
275(cl-defgeneric xref-backend-apropos (backend pattern) 278(cl-defgeneric xref-backend-apropos (backend pattern)
@@ -1281,13 +1284,13 @@ FILES must be a list of absolute file names."
1281 (insert (mapconcat #'identity files "\0")) 1284 (insert (mapconcat #'identity files "\0"))
1282 (setq default-directory dir) 1285 (setq default-directory dir)
1283 (setq status 1286 (setq status
1284 (project--process-file-region (point-min) 1287 (xref--process-file-region (point-min)
1285 (point-max) 1288 (point-max)
1286 shell-file-name 1289 shell-file-name
1287 output 1290 output
1288 nil 1291 nil
1289 shell-command-switch 1292 shell-command-switch
1290 command))) 1293 command)))
1291 (goto-char (point-min)) 1294 (goto-char (point-min))
1292 (when (and (/= (point-min) (point-max)) 1295 (when (and (/= (point-min) (point-max))
1293 (not (looking-at grep-re)) 1296 (not (looking-at grep-re))
@@ -1302,6 +1305,24 @@ FILES must be a list of absolute file names."
1302 hits))) 1305 hits)))
1303 (xref--convert-hits (nreverse hits) regexp))) 1306 (xref--convert-hits (nreverse hits) regexp)))
1304 1307
1308(defun xref--process-file-region ( start end program
1309 &optional buffer display
1310 &rest args)
1311 ;; FIXME: This branching shouldn't be necessary, but
1312 ;; call-process-region *is* measurably faster, even for a program
1313 ;; doing some actual work (for a period of time). Even though
1314 ;; call-process-region also creates a temp file internally
1315 ;; (http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00211.html).
1316 (if (not (file-remote-p default-directory))
1317 (apply #'call-process-region
1318 start end program nil buffer display args)
1319 (let ((infile (make-temp-file "ppfr")))
1320 (unwind-protect
1321 (progn
1322 (write-region start end infile nil 'silent)
1323 (apply #'process-file program infile buffer display args))
1324 (delete-file infile)))))
1325
1305(defun xref--rgrep-command (regexp files dir ignores) 1326(defun xref--rgrep-command (regexp files dir ignores)
1306 (require 'find-dired) ; for `find-name-arg' 1327 (require 'find-dired) ; for `find-name-arg'
1307 (defvar grep-find-template) 1328 (defvar grep-find-template)
diff --git a/lisp/ps-def.el b/lisp/ps-def.el
index f532511b977..65e8011f771 100644
--- a/lisp/ps-def.el
+++ b/lisp/ps-def.el
@@ -58,21 +58,11 @@
58(define-obsolete-function-alias 'ps-frame-parameter #'frame-parameter "28.1") 58(define-obsolete-function-alias 'ps-frame-parameter #'frame-parameter "28.1")
59 59
60;; Return t if the device (which can be changed during an emacs session) can 60;; Return t if the device (which can be changed during an emacs session) can
61;; handle colors. This function is not yet implemented for GNU emacs. 61;; handle colors.
62(defun ps-color-device () 62(defun ps-color-device ()
63 (if (fboundp 'color-values) 63 (color-values "Green"))
64 (funcall 'color-values "Green") 64
65 t)) 65(define-obsolete-function-alias 'ps-color-values #'color-values "28.1")
66
67
68(defun ps-color-values (x-color)
69 (cond
70 ((fboundp 'color-values)
71 (funcall 'color-values x-color))
72 ((fboundp 'x-color-values)
73 (funcall 'x-color-values x-color))
74 (t
75 (error "No available function to determine X color values"))))
76 66
77 67
78(defun ps-face-bold-p (face) 68(defun ps-face-bold-p (face)
diff --git a/lisp/ps-print.el b/lisp/ps-print.el
index 17b486bca11..1ca4a23ab2c 100644
--- a/lisp/ps-print.el
+++ b/lisp/ps-print.el
@@ -3856,7 +3856,7 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'."
3856(defun ps-color-scale (color) 3856(defun ps-color-scale (color)
3857 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval. 3857 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval.
3858 (mapcar #'(lambda (value) (/ value ps-print-color-scale)) 3858 (mapcar #'(lambda (value) (/ value ps-print-color-scale))
3859 (ps-color-values color))) 3859 (color-values color)))
3860 3860
3861 3861
3862(defun ps-face-underlined-p (face) 3862(defun ps-face-underlined-p (face)
@@ -5752,7 +5752,7 @@ XSTART YSTART are the relative position for the first page in a sheet.")
5752 ;; evaluated at dump-time because X isn't initialized. 5752 ;; evaluated at dump-time because X isn't initialized.
5753 ps-color-p (and ps-print-color-p (ps-color-device)) 5753 ps-color-p (and ps-print-color-p (ps-color-device))
5754 ps-print-color-scale (if ps-color-p 5754 ps-print-color-scale (if ps-color-p
5755 (float (car (ps-color-values "white"))) 5755 (float (car (color-values "white")))
5756 1.0) 5756 1.0)
5757 ps-default-background (ps-rgb-color 5757 ps-default-background (ps-rgb-color
5758 (cond 5758 (cond
@@ -6275,10 +6275,6 @@ If FACE is not a valid face name, use default face."
6275 (goto-char to)) 6275 (goto-char to))
6276 6276
6277 6277
6278;; Ensure that face-list is fbound.
6279(or (fboundp 'face-list) (defalias 'face-list 'list-faces))
6280
6281
6282(defun ps-build-reference-face-lists () 6278(defun ps-build-reference-face-lists ()
6283 (setq ps-print-face-alist nil) 6279 (setq ps-print-face-alist nil)
6284 (if ps-auto-font-detect 6280 (if ps-auto-font-detect
diff --git a/lisp/savehist.el b/lisp/savehist.el
index fcfdb47c7e8..4e52efe7f1a 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -4,7 +4,7 @@
4 4
5;; Author: Hrvoje Nikšić <hrvoje.niksic@avl.com> 5;; Author: Hrvoje Nikšić <hrvoje.niksic@avl.com>
6;; Maintainer: emacs-devel@gnu.org 6;; Maintainer: emacs-devel@gnu.org
7;; Keywords: minibuffer 7;; Keywords: convenience, minibuffer
8;; Version: 24 8;; Version: 24
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
@@ -27,7 +27,7 @@
27;; Many editors (e.g. Vim) have the feature of saving minibuffer 27;; Many editors (e.g. Vim) have the feature of saving minibuffer
28;; history to an external file after exit. This package provides the 28;; history to an external file after exit. This package provides the
29;; same feature in Emacs. When set up, it saves recorded minibuffer 29;; same feature in Emacs. When set up, it saves recorded minibuffer
30;; histories to a file (`~/.emacs-history' by default). Additional 30;; histories to a file (`~/.emacs.d/history' by default). Additional
31;; variables may be specified by customizing 31;; variables may be specified by customizing
32;; `savehist-additional-variables'. 32;; `savehist-additional-variables'.
33 33
diff --git a/lisp/shell.el b/lisp/shell.el
index f5e18bbc728..9667dab2afd 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -990,9 +990,6 @@ this feature; see the function `dirtrack-mode'."
990 (add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t) 990 (add-hook 'comint-input-filter-functions #'shell-directory-tracker nil t)
991 (remove-hook 'comint-input-filter-functions #'shell-directory-tracker t))) 991 (remove-hook 'comint-input-filter-functions #'shell-directory-tracker t)))
992 992
993(define-obsolete-function-alias 'shell-dirtrack-toggle #'shell-dirtrack-mode
994 "23.1")
995
996(defun shell-cd (dir) 993(defun shell-cd (dir)
997 "Do normal `cd' to DIR, and set `list-buffers-directory'." 994 "Do normal `cd' to DIR, and set `list-buffers-directory'."
998 (cd dir) 995 (cd dir)
@@ -1038,25 +1035,41 @@ command again."
1038 (accept-process-output proc) 1035 (accept-process-output proc)
1039 (goto-char pt))) 1036 (goto-char pt)))
1040 (goto-char pmark) (delete-char 1) ; remove the extra newline 1037 (goto-char pmark) (delete-char 1) ; remove the extra newline
1041 ;; That's the dirlist. grab it & parse it. 1038 ;; That's the dirlist. Grab it & parse it.
1042 (let* ((dl (buffer-substring (match-beginning 2) (1- (match-end 2)))) 1039 (let* ((dls (buffer-substring-no-properties
1043 (dl-len (length dl)) 1040 (match-beginning 0) (1- (match-end 0))))
1044 (ds '()) ; new dir stack 1041 (dlsl nil)
1045 (i 0)) 1042 (pos 0)
1046 (while (< i dl-len) 1043 (ds nil))
1047 ;; regexp = optional whitespace, (non-whitespace), optional whitespace 1044 ;; Split the dirlist into whitespace and non-whitespace chunks.
1048 (string-match "\\s *\\(\\S +\\)\\s *" dl i) ; pick off next dir 1045 ;; dlsl will be a reversed list of tokens.
1049 (setq ds (cons (concat comint-file-name-prefix 1046 (while (string-match "\\(\\S-+\\|\\s-+\\)" dls pos)
1050 (substring dl (match-beginning 1) 1047 (push (match-string 1 dls) dlsl)
1051 (match-end 1))) 1048 (setq pos (match-end 1)))
1052 ds)) 1049
1053 (setq i (match-end 0))) 1050 ;; Prepend trailing entries until they form an existing directory,
1054 (let ((ds (nreverse ds))) 1051 ;; whitespace and all. Discard the next whitespace and repeat.
1055 (with-demoted-errors "Couldn't cd: %s" 1052 (while dlsl
1056 (shell-cd (car ds)) 1053 (let ((newelt "")
1057 (setq shell-dirstack (cdr ds) 1054 tem1 tem2)
1058 shell-last-dir (car shell-dirstack)) 1055 (while newelt
1059 (shell-dirstack-message))))) 1056 ;; We need tem1 because we don't want to prepend
1057 ;; `comint-file-name-prefix' repeatedly into newelt via tem2.
1058 (setq tem1 (pop dlsl)
1059 tem2 (concat comint-file-name-prefix tem1 newelt))
1060 (cond ((file-directory-p tem2)
1061 (push tem2 ds)
1062 (when (string= " " (car dlsl))
1063 (pop dlsl))
1064 (setq newelt nil))
1065 (t
1066 (setq newelt (concat tem1 newelt)))))))
1067
1068 (with-demoted-errors "Couldn't cd: %s"
1069 (shell-cd (car ds))
1070 (setq shell-dirstack (cdr ds)
1071 shell-last-dir (car shell-dirstack))
1072 (shell-dirstack-message))))
1060 (if started-at-pmark (goto-char (marker-position pmark))))) 1073 (if started-at-pmark (goto-char (marker-position pmark)))))
1061 1074
1062;; For your typing convenience: 1075;; For your typing convenience:
diff --git a/lisp/simple.el b/lisp/simple.el
index 6f72c3b81b9..f08015372af 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -247,7 +247,7 @@ from which next-error navigated, and a target buffer TO-BUFFER."
247 extra-test-exclusive) 247 extra-test-exclusive)
248 "Try the current buffer when outside navigation. 248 "Try the current buffer when outside navigation.
249But return nil if we navigated to the current buffer by the means 249But return nil if we navigated to the current buffer by the means
250of `next-error' command. Othewise, return it if it's next-error 250of `next-error' command. Otherwise, return it if it's next-error
251capable." 251capable."
252 ;; Check that next-error-buffer has no buffer-local value 252 ;; Check that next-error-buffer has no buffer-local value
253 ;; (i.e. we never navigated to the current buffer from another), 253 ;; (i.e. we never navigated to the current buffer from another),
@@ -1323,7 +1323,9 @@ If called from Lisp, return the number of words between START and
1323END, without printing any message." 1323END, without printing any message."
1324 (interactive (list nil nil)) 1324 (interactive (list nil nil))
1325 (cond ((not (called-interactively-p 'any)) 1325 (cond ((not (called-interactively-p 'any))
1326 (let ((words 0)) 1326 (let ((words 0)
1327 ;; Count across field boundaries. (Bug#41761)
1328 (inhibit-field-text-motion t))
1327 (save-excursion 1329 (save-excursion
1328 (save-restriction 1330 (save-restriction
1329 (narrow-to-region start end) 1331 (narrow-to-region start end)
@@ -1556,6 +1558,8 @@ in *Help* buffer. See also the command `describe-char'."
1556 ;; Might as well bind TAB to completion, since inserting a TAB char is 1558 ;; Might as well bind TAB to completion, since inserting a TAB char is
1557 ;; much too rarely useful. 1559 ;; much too rarely useful.
1558 (define-key m "\t" 'completion-at-point) 1560 (define-key m "\t" 'completion-at-point)
1561 (define-key m "\r" 'read--expression-try-read)
1562 (define-key m "\n" 'read--expression-try-read)
1559 (set-keymap-parent m minibuffer-local-map) 1563 (set-keymap-parent m minibuffer-local-map)
1560 m)) 1564 m))
1561 1565
@@ -1652,8 +1656,6 @@ function `read-from-minibuffer'."
1652 (set-syntax-table emacs-lisp-mode-syntax-table) 1656 (set-syntax-table emacs-lisp-mode-syntax-table)
1653 (add-hook 'completion-at-point-functions 1657 (add-hook 'completion-at-point-functions
1654 #'elisp-completion-at-point nil t) 1658 #'elisp-completion-at-point nil t)
1655 (local-set-key "\r" 'read--expression-try-read)
1656 (local-set-key "\n" 'read--expression-try-read)
1657 (run-hooks 'eval-expression-minibuffer-setup-hook)) 1659 (run-hooks 'eval-expression-minibuffer-setup-hook))
1658 (read-from-minibuffer prompt initial-contents 1660 (read-from-minibuffer prompt initial-contents
1659 read-expression-map t 1661 read-expression-map t
@@ -1845,9 +1847,15 @@ to get different commands to edit and resubmit."
1845 (lambda () 1847 (lambda ()
1846 ;; Get a command name at point in the original buffer 1848 ;; Get a command name at point in the original buffer
1847 ;; to propose it after M-n. 1849 ;; to propose it after M-n.
1848 (with-current-buffer (window-buffer (minibuffer-selected-window)) 1850 (let ((def (with-current-buffer
1849 (and (commandp (function-called-at-point)) 1851 (window-buffer (minibuffer-selected-window))
1850 (format "%S" (function-called-at-point))))))) 1852 (and (commandp (function-called-at-point))
1853 (format "%S" (function-called-at-point)))))
1854 (all (sort (minibuffer-default-add-completions)
1855 #'string<)))
1856 (if def
1857 (cons def (delete def all))
1858 all)))))
1851 ;; Read a string, completing from and restricting to the set of 1859 ;; Read a string, completing from and restricting to the set of
1852 ;; all defined commands. Don't provide any initial input. 1860 ;; all defined commands. Don't provide any initial input.
1853 ;; Save the command read on the extended-command history list. 1861 ;; Save the command read on the extended-command history list.
diff --git a/lisp/so-long.el b/lisp/so-long.el
index f2c078ba841..f8a5cc920d9 100644
--- a/lisp/so-long.el
+++ b/lisp/so-long.el
@@ -255,8 +255,7 @@
255;; `so-long-mode', completely bypassing the automated decision process. 255;; `so-long-mode', completely bypassing the automated decision process.
256;; Refer to M-: (info "(emacs) Specifying File Variables") RET 256;; Refer to M-: (info "(emacs) Specifying File Variables") RET
257;; 257;;
258;; If so-long itself is causing problems, it can be inhibited by setting the 258;; If so-long itself causes problems, disable the automated behaviour with
259;; `so-long-enabled' variable to nil, or by disabling the global mode with
260;; M-- M-x global-so-long-mode, or M-: (global-so-long-mode 0) 259;; M-- M-x global-so-long-mode, or M-: (global-so-long-mode 0)
261 260
262;; * Example configuration 261;; * Example configuration
@@ -282,6 +281,43 @@
282;; '((show-trailing-whitespace . nil) 281;; '((show-trailing-whitespace . nil)
283;; (truncate-lines . nil)))) 282;; (truncate-lines . nil))))
284 283
284;; * Mode-specific configuration
285;; -----------------------------
286;; The `so-long-predicate' function is called in the context of the buffer's
287;; original major mode, and therefore major mode hooks can be used to control
288;; the criteria for calling `so-long' in any given mode (plus its derivatives)
289;; by setting buffer-local values for the variables in question. This includes
290;; `so-long-predicate' itself, as well as any variables used by the predicate
291;; when determining the result. By default this means `so-long-max-lines',
292;; `so-long-skip-leading-comments', and `so-long-threshold'. E.g.:
293;;
294;; (add-hook 'js-mode-hook 'my-js-mode-hook)
295;;
296;; (defun my-js-mode-hook ()
297;; "Custom `js-mode' behaviours."
298;; (setq-local so-long-max-lines 100)
299;; (setq-local so-long-threshold 1000))
300;;
301;; `so-long-variable-overrides' and `so-long-minor-modes' may also be given
302;; buffer-local values in order to apply different settings to different types
303;; of file. For example, the Bidirectional Parentheses Algorithm does not apply
304;; to `<' and `>' characters by default, and therefore one might prefer to not
305;; set `bidi-inhibit-bpa' in XML files, on the basis that XML files with long
306;; lines are less likely to trigger BPA-related performance problems:
307;;
308;; (add-hook 'nxml-mode-hook 'my-nxml-mode-hook)
309;;
310;; (defun my-nxml-mode-hook ()
311;; "Custom `nxml-mode' behaviours."
312;; (require 'so-long)
313;; (setq-local so-long-variable-overrides
314;; (remove '(bidi-inhibit-bpa . t) so-long-variable-overrides)))
315;;
316;; Finally, note that setting `so-long-target-modes' to nil buffer-locally in
317;; a major mode hook would prevent that mode from ever being targeted. With
318;; `prog-mode' being targeted by default, specific derivatives of `prog-mode'
319;; could therefore be un-targeted if desired.
320
285;; * Other ways of using so-long 321;; * Other ways of using so-long
286;; ----------------------------- 322;; -----------------------------
287;; It may prove useful to automatically invoke major mode `so-long-mode' for 323;; It may prove useful to automatically invoke major mode `so-long-mode' for
@@ -376,7 +412,6 @@
376;; - Added mode-line indicator, user option `so-long-mode-line-label', 412;; - Added mode-line indicator, user option `so-long-mode-line-label',
377;; and faces `so-long-mode-line-active', `so-long-mode-line-inactive'. 413;; and faces `so-long-mode-line-active', `so-long-mode-line-inactive'.
378;; - New help commands `so-long-commentary' and `so-long-customize'. 414;; - New help commands `so-long-commentary' and `so-long-customize'.
379;; - Renamed `so-long-mode-enabled' to `so-long-enabled'.
380;; - Refactored the default hook values using variable overrides 415;; - Refactored the default hook values using variable overrides
381;; (and returning all the hooks to nil default values). 416;; (and returning all the hooks to nil default values).
382;; - Performance improvements for `so-long-detected-long-line-p'. 417;; - Performance improvements for `so-long-detected-long-line-p'.
@@ -416,9 +451,14 @@
416(declare-function longlines-mode "longlines") 451(declare-function longlines-mode "longlines")
417(defvar longlines-mode) 452(defvar longlines-mode)
418(defvar so-long-enabled nil 453(defvar so-long-enabled nil
419 "Set to nil to prevent `so-long' from being triggered automatically. 454 ;; This was initially a renaming of the old `so-long-mode-enabled' and
420 455 ;; documented as "Set to nil to prevent `so-long' from being triggered
421Has no effect if `global-so-long-mode' is not enabled.") 456 ;; automatically."; however `so-long--ensure-enabled' may forcibly re-enable
457 ;; it contrary to the user's expectations, so for the present this should be
458 ;; considered internal-use only (with `global-so-long-mode' the interface
459 ;; for enabling or disabling the automated behaviour). FIXME: Establish a
460 ;; way to support the original use-case, or rename to `so-long--enabled'.
461 "Internal use. Non-nil when any so-long functionality has been used.")
422 462
423(defvar-local so-long--active nil ; internal use 463(defvar-local so-long--active nil ; internal use
424 "Non-nil when `so-long' mitigations are in effect.") 464 "Non-nil when `so-long' mitigations are in effect.")
@@ -886,9 +926,15 @@ buffer-local."
886Stores the existing value for each entry in `so-long-variable-overrides'. 926Stores the existing value for each entry in `so-long-variable-overrides'.
887Stores the name of each enabled mode from the list `so-long-minor-modes'. 927Stores the name of each enabled mode from the list `so-long-minor-modes'.
888 928
929The lists themselves are also remembered, so that major mode hooks can
930provide buffer-local modifications which are still accessible after changing
931to `so-long-mode'.
932
889If RESET is non-nil, remove any existing values before storing the new ones." 933If RESET is non-nil, remove any existing values before storing the new ones."
890 (when reset 934 (when reset
891 (setq so-long-original-values nil)) 935 (setq so-long-original-values nil))
936 (so-long-remember 'so-long-variable-overrides)
937 (so-long-remember 'so-long-minor-modes)
892 (dolist (ovar so-long-variable-overrides) 938 (dolist (ovar so-long-variable-overrides)
893 (so-long-remember (car ovar))) 939 (so-long-remember (car ovar)))
894 (dolist (mode so-long-minor-modes) 940 (dolist (mode so-long-minor-modes)
@@ -1288,7 +1334,7 @@ Calls `so-long-disable-minor-modes' and `so-long-override-variables'."
1288 1334
1289(defun so-long-disable-minor-modes () 1335(defun so-long-disable-minor-modes ()
1290 "Disable any active minor modes listed in `so-long-minor-modes'." 1336 "Disable any active minor modes listed in `so-long-minor-modes'."
1291 (dolist (mode so-long-minor-modes) 1337 (dolist (mode (so-long-original 'so-long-minor-modes))
1292 (when (and (boundp mode) mode) 1338 (when (and (boundp mode) mode)
1293 (funcall mode 0)))) 1339 (funcall mode 0))))
1294 1340
@@ -1304,7 +1350,7 @@ The modes are enabled in accordance with what was remembered in `so-long'."
1304 1350
1305(defun so-long-override-variables () 1351(defun so-long-override-variables ()
1306 "Set the buffer-local values defined by `so-long-variable-overrides'." 1352 "Set the buffer-local values defined by `so-long-variable-overrides'."
1307 (dolist (ovar so-long-variable-overrides) 1353 (dolist (ovar (so-long-original 'so-long-variable-overrides))
1308 (set (make-local-variable (car ovar)) (cdr ovar)))) 1354 (set (make-local-variable (car ovar)) (cdr ovar))))
1309 1355
1310(defun so-long-restore-variables () 1356(defun so-long-restore-variables ()
@@ -1879,7 +1925,7 @@ If it appears in `%s', you should remove it."
1879; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq 1925; LocalWords: defadvice nadvice whitespace ie bos eos eobp origmode un Un setq
1880; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc 1926; LocalWords: docstring auf Wiedersehen longlines alist autoload Refactored Inc
1881; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval 1927; LocalWords: MERCHANTABILITY RET REGEXP VAR ELPA WS mitigations EmacsWiki eval
1882; LocalWords: rx filename filenames bidi bpa 1928; LocalWords: rx filename filenames js defun bidi bpa prog FIXME
1883 1929
1884;; So long, farewell, auf Wiedersehen, goodbye 1930;; So long, farewell, auf Wiedersehen, goodbye
1885;; You have to go, this code is minified 1931;; You have to go, this code is minified
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index e9c15b71ce6..5b98eb36bb9 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -3240,19 +3240,21 @@ With universal argument ARG, flush cached data."
3240 "Expand the line under the cursor and all descendants. 3240 "Expand the line under the cursor and all descendants.
3241Optional argument ARG indicates that any cache should be flushed." 3241Optional argument ARG indicates that any cache should be flushed."
3242 (interactive "P") 3242 (interactive "P")
3243 (speedbar-expand-line arg) 3243 (save-restriction
3244 ;; Now, inside the area expanded here, expand all subnodes of 3244 (narrow-to-region (line-beginning-position)
3245 ;; the same descendant type. 3245 (line-beginning-position 2))
3246 (save-excursion 3246 (speedbar-expand-line arg)
3247 (speedbar-next 1) ;; Move into the list. 3247 ;; Now, inside the area expanded here, expand all subnodes of
3248 (let ((err nil)) 3248 ;; the same descendant type.
3249 (while (not err) 3249 (save-excursion
3250 (condition-case nil 3250 (speedbar-next 1) ;; Move into the list.
3251 (progn 3251 (let ((err nil))
3252 (speedbar-expand-line-descendants arg) 3252 (while (not err)
3253 (speedbar-restricted-next 1)) 3253 (condition-case nil
3254 (error (setq err t)))))) 3254 (progn
3255 ) 3255 (speedbar-expand-line-descendants arg)
3256 (speedbar-restricted-next 1))
3257 (error (setq err t))))))))
3256 3258
3257(defun speedbar-contract-line-descendants () 3259(defun speedbar-contract-line-descendants ()
3258 "Expand the line under the cursor and all descendants." 3260 "Expand the line under the cursor and all descendants."
diff --git a/lisp/startup.el b/lisp/startup.el
index e58f27e7ebc..536a3de17a7 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -537,6 +537,9 @@ It is the default value of the variable `top-level'."
537 (setq user-emacs-directory 537 (setq user-emacs-directory
538 (startup--xdg-or-homedot startup--xdg-config-home-emacs nil)) 538 (startup--xdg-or-homedot startup--xdg-config-home-emacs nil))
539 539
540 (when (boundp 'comp-eln-load-path)
541 (setq comp-eln-load-path (cons (concat user-emacs-directory "eln-cache/")
542 comp-eln-load-path)))
540 ;; Look in each dir in load-path for a subdirs.el file. If we 543 ;; Look in each dir in load-path for a subdirs.el file. If we
541 ;; find one, load it, which will add the appropriate subdirs of 544 ;; find one, load it, which will add the appropriate subdirs of
542 ;; that dir into load-path. This needs to be done before setting 545 ;; that dir into load-path. This needs to be done before setting
@@ -649,11 +652,12 @@ It is the default value of the variable `top-level'."
649 ;; Use FOO/., so that if FOO is a symlink, file-attributes 652 ;; Use FOO/., so that if FOO is a symlink, file-attributes
650 ;; describes the directory linked to, not FOO itself. 653 ;; describes the directory linked to, not FOO itself.
651 (or (and default-directory 654 (or (and default-directory
652 (equal (file-attributes 655 (ignore-errors
653 (concat (file-name-as-directory pwd) ".")) 656 (equal (file-attributes
654 (file-attributes 657 (concat (file-name-as-directory pwd) "."))
655 (concat (file-name-as-directory default-directory) 658 (file-attributes
656 ".")))) 659 (concat (file-name-as-directory default-directory)
660 ".")))))
657 (setq process-environment 661 (setq process-environment
658 (delete (concat "PWD=" pwd) 662 (delete (concat "PWD=" pwd)
659 process-environment))))) 663 process-environment)))))
diff --git a/lisp/subr.el b/lisp/subr.el
index 0ae636b68b4..093cacc8cb6 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1588,11 +1588,6 @@ be a list of the form returned by `event-start' and `event-end'."
1588(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "26.1") 1588(make-obsolete 'string-as-multibyte "use `decode-coding-string'." "26.1")
1589(make-obsolete 'string-make-multibyte "use `decode-coding-string'." "26.1") 1589(make-obsolete 'string-make-multibyte "use `decode-coding-string'." "26.1")
1590 1590
1591(defun forward-point (n)
1592 "Return buffer position N characters after (before if N negative) point."
1593 (declare (obsolete "use (+ (point) N) instead." "23.1"))
1594 (+ (point) n))
1595
1596(defun log10 (x) 1591(defun log10 (x)
1597 "Return (log X 10), the log base 10 of X." 1592 "Return (log X 10), the log base 10 of X."
1598 (declare (obsolete log "24.4")) 1593 (declare (obsolete log "24.4"))
@@ -1617,8 +1612,6 @@ be a list of the form returned by `event-start' and `event-end'."
1617(make-obsolete 'set-window-redisplay-end-trigger nil "23.1") 1612(make-obsolete 'set-window-redisplay-end-trigger nil "23.1")
1618 1613
1619(make-obsolete 'run-window-configuration-change-hook nil "27.1") 1614(make-obsolete 'run-window-configuration-change-hook nil "27.1")
1620(make-obsolete 'process-filter-multibyte-p nil "23.1")
1621(make-obsolete 'set-process-filter-multibyte nil "23.1")
1622 1615
1623(make-obsolete-variable 'command-debug-status 1616(make-obsolete-variable 'command-debug-status
1624 "expect it to be removed in a future version." "25.2") 1617 "expect it to be removed in a future version." "25.2")
@@ -1661,7 +1654,8 @@ be a list of the form returned by `event-start' and `event-end'."
1661(defalias 'point-at-eol 'line-end-position) 1654(defalias 'point-at-eol 'line-end-position)
1662(defalias 'point-at-bol 'line-beginning-position) 1655(defalias 'point-at-bol 'line-beginning-position)
1663 1656
1664(defalias 'user-original-login-name 'user-login-name) 1657(define-obsolete-function-alias 'user-original-login-name
1658 'user-login-name "28.1")
1665 1659
1666 1660
1667;;;; Hook manipulation functions. 1661;;;; Hook manipulation functions.
diff --git a/lisp/t-mouse.el b/lisp/t-mouse.el
index a1af53d8c46..4feab71401e 100644
--- a/lisp/t-mouse.el
+++ b/lisp/t-mouse.el
@@ -63,8 +63,6 @@
63 (set-terminal-parameter nil 'gpm-mouse-active nil)) 63 (set-terminal-parameter nil 'gpm-mouse-active nil))
64 64
65;;;###autoload 65;;;###autoload
66(define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
67;;;###autoload
68(define-minor-mode gpm-mouse-mode 66(define-minor-mode gpm-mouse-mode
69 "Toggle mouse support in GNU/Linux consoles (GPM Mouse mode). 67 "Toggle mouse support in GNU/Linux consoles (GPM Mouse mode).
70 68
diff --git a/lisp/term.el b/lisp/term.el
index b990c83cfcb..99f1bf4f54f 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -467,6 +467,11 @@ Customize this option to nil if you want the previous behavior."
467 :type 'boolean 467 :type 'boolean
468 :group 'term) 468 :group 'term)
469 469
470(defcustom term-set-terminal-size nil
471 "If non-nil, set the LINES and COLUMNS environment variables."
472 :type 'boolean
473 :version "28.1")
474
470(defcustom term-char-mode-point-at-process-mark t 475(defcustom term-char-mode-point-at-process-mark t
471 "If non-nil, keep point at the process mark in char mode. 476 "If non-nil, keep point at the process mark in char mode.
472 477
@@ -501,6 +506,14 @@ This variable is buffer-local."
501 :type 'boolean 506 :type 'boolean
502 :group 'term) 507 :group 'term)
503 508
509(defcustom term-scroll-snap-to-bottom t
510 "Control whether to keep the prompt at the bottom of the window.
511If non-nil, when the prompt is visible within the window, then
512scroll so that the prompt is on the bottom on any input or
513output."
514 :version "28.1"
515 :type 'boolean)
516
504(defcustom term-scroll-show-maximum-output nil 517(defcustom term-scroll-show-maximum-output nil
505 "Controls how interpreter output causes window to scroll. 518 "Controls how interpreter output causes window to scroll.
506If non-nil, then show the maximum output when the window is scrolled. 519If non-nil, then show the maximum output when the window is scrolled.
@@ -1543,9 +1556,12 @@ Nil if unknown.")
1543 (format term-termcap-format "TERMCAP=" 1556 (format term-termcap-format "TERMCAP="
1544 term-term-name term-height term-width) 1557 term-term-name term-height term-width)
1545 1558
1546 (format "INSIDE_EMACS=%s,term:%s" emacs-version term-protocol-version) 1559 (format "INSIDE_EMACS=%s,term:%s"
1547 (format "LINES=%d" term-height) 1560 emacs-version term-protocol-version))
1548 (format "COLUMNS=%d" term-width)) 1561 (when term-set-terminal-size
1562 (list
1563 (format "LINES=%d" term-height)
1564 (format "COLUMNS=%d" term-width)))
1549 process-environment)) 1565 process-environment))
1550 (process-connection-type t) 1566 (process-connection-type t)
1551 ;; We should suppress conversion of end-of-line format. 1567 ;; We should suppress conversion of end-of-line format.
@@ -3108,15 +3124,19 @@ See `term-prompt-regexp'."
3108 (or (eq scroll 'this) (not save-point))) 3124 (or (eq scroll 'this) (not save-point)))
3109 (and (eq scroll 'others) 3125 (and (eq scroll 'others)
3110 (not (eq selected win)))) 3126 (not (eq selected win))))
3111 (goto-char term-home-marker) 3127 (when term-scroll-snap-to-bottom
3112 (recenter 0) 3128 (goto-char term-home-marker)
3129 (recenter 0))
3113 (goto-char (process-mark proc)) 3130 (goto-char (process-mark proc))
3114 (if (not (pos-visible-in-window-p (point) win)) 3131 (if (not (pos-visible-in-window-p (point) win))
3115 (recenter -1))) 3132 (recenter -1)))
3116 ;; Optionally scroll so that the text 3133 ;; Optionally scroll so that the text
3117 ;; ends at the bottom of the window. 3134 ;; ends at the bottom of the window.
3118 (when (and term-scroll-show-maximum-output 3135 (when (and term-scroll-show-maximum-output
3119 (>= (point) (process-mark proc))) 3136 (>= (point) (process-mark proc))
3137 (or term-scroll-snap-to-bottom
3138 (not (pos-visible-in-window-p
3139 (point-max) win))))
3120 (save-excursion 3140 (save-excursion
3121 (goto-char (point-max)) 3141 (goto-char (point-max))
3122 (recenter -1))))) 3142 (recenter -1)))))
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 6b9716ca307..f15337818b0 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -78,12 +78,8 @@
78(require 'dnd) 78(require 'dnd)
79(require 'w32-vars) 79(require 'w32-vars)
80 80
81;; Keep an obsolete alias for w32-focus-frame and w32-select-font in case
82;; they are used by code outside Emacs.
83(define-obsolete-function-alias 'w32-focus-frame 'x-focus-frame "23.1")
84(declare-function x-select-font "w32font.c" 81(declare-function x-select-font "w32font.c"
85 (&optional frame exclude-proportional)) 82 (&optional frame exclude-proportional))
86(define-obsolete-function-alias 'w32-select-font 'x-select-font "23.1")
87 83
88(defvar w32-color-map) ;; defined in w32fns.c 84(defvar w32-color-map) ;; defined in w32fns.c
89(make-obsolete 'w32-default-color-map nil "24.1") 85(make-obsolete 'w32-default-color-map nil "24.1")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 0018b89d858..910bd7dbb9d 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -3445,6 +3445,7 @@ if that value is non-nil.
3445 (set (make-local-variable 'syntax-propertize-function) 3445 (set (make-local-variable 'syntax-propertize-function)
3446 (syntax-propertize-via-font-lock 3446 (syntax-propertize-via-font-lock
3447 bibtex-font-lock-syntactic-keywords)) 3447 bibtex-font-lock-syntactic-keywords))
3448 (bibtex-set-dialect nil t)
3448 ;; Allow `bibtex-dialect' as a file-local variable. 3449 ;; Allow `bibtex-dialect' as a file-local variable.
3449 (add-hook 'hack-local-variables-hook #'bibtex-set-dialect nil t)) 3450 (add-hook 'hack-local-variables-hook #'bibtex-set-dialect nil t))
3450 3451
diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el
index 39a1b488a74..23f96d7e0ee 100644
--- a/lisp/textmodes/flyspell.el
+++ b/lisp/textmodes/flyspell.el
@@ -57,7 +57,6 @@
57(defcustom flyspell-highlight-flag t 57(defcustom flyspell-highlight-flag t
58 "How Flyspell should indicate misspelled words. 58 "How Flyspell should indicate misspelled words.
59Non-nil means use highlight, nil means use minibuffer messages." 59Non-nil means use highlight, nil means use minibuffer messages."
60 :group 'flyspell
61 :type 'boolean) 60 :type 'boolean)
62 61
63(defcustom flyspell-mark-duplications-flag t 62(defcustom flyspell-mark-duplications-flag t
@@ -65,12 +64,10 @@ Non-nil means use highlight, nil means use minibuffer messages."
65See `flyspell-mark-duplications-exceptions' to add exceptions to this rule. 64See `flyspell-mark-duplications-exceptions' to add exceptions to this rule.
66Detection of repeated words is not implemented in 65Detection of repeated words is not implemented in
67\"large\" regions; see variable `flyspell-large-region'." 66\"large\" regions; see variable `flyspell-large-region'."
68 :group 'flyspell
69 :type 'boolean) 67 :type 'boolean)
70 68
71(defcustom flyspell-case-fold-duplications t 69(defcustom flyspell-case-fold-duplications t
72 "Non-nil means Flyspell matches duplicate words case-insensitively." 70 "Non-nil means Flyspell matches duplicate words case-insensitively."
73 :group 'flyspell
74 :type 'boolean 71 :type 'boolean
75 :version "27.1") 72 :version "27.1")
76 73
@@ -87,7 +84,6 @@ dictionary name (`ispell-local-dictionary' or
87 84
88EXCEPTION-LIST is a list of strings. The checked word is 85EXCEPTION-LIST is a list of strings. The checked word is
89downcased before comparing with these exceptions." 86downcased before comparing with these exceptions."
90 :group 'flyspell
91 :type '(alist :key-type (choice (const :tag "All dictionaries" nil) 87 :type '(alist :key-type (choice (const :tag "All dictionaries" nil)
92 regexp) 88 regexp)
93 :value-type (repeat string)) 89 :value-type (repeat string))
@@ -97,7 +93,6 @@ downcased before comparing with these exceptions."
97 "If non-nil, sort the corrections before popping them. 93 "If non-nil, sort the corrections before popping them.
98The sorting is controlled by the `flyspell-sort-corrections-function' 94The sorting is controlled by the `flyspell-sort-corrections-function'
99variable, and defaults to sorting alphabetically." 95variable, and defaults to sorting alphabetically."
100 :group 'flyspell
101 :version "21.1" 96 :version "21.1"
102 :type 'boolean) 97 :type 'boolean)
103 98
@@ -109,8 +104,7 @@ function takes three parameters -- the two correction candidates
109to be sorted, and the third parameter is the word that's being 104to be sorted, and the third parameter is the word that's being
110corrected." 105corrected."
111 :version "26.1" 106 :version "26.1"
112 :type 'function 107 :type 'function)
113 :group 'flyspell)
114 108
115(defun flyspell-sort-corrections-alphabetically (corr1 corr2 _) 109(defun flyspell-sort-corrections-alphabetically (corr1 corr2 _)
116 (string< corr1 corr2)) 110 (string< corr1 corr2))
@@ -130,14 +124,12 @@ Flyspell uses a different face (`flyspell-duplicate') to highlight it.
130This variable specifies how far to search to find such a duplicate. 124This variable specifies how far to search to find such a duplicate.
131-1 means no limit (search the whole buffer). 125-1 means no limit (search the whole buffer).
1320 means do not search for duplicate unrecognized spellings." 1260 means do not search for duplicate unrecognized spellings."
133 :group 'flyspell
134 :version "24.5" ; -1 -> 400000 127 :version "24.5" ; -1 -> 400000
135 :type '(choice (const :tag "no limit" -1) 128 :type '(choice (const :tag "no limit" -1)
136 number)) 129 number))
137 130
138(defcustom flyspell-delay 3 131(defcustom flyspell-delay 3
139 "The number of seconds to wait before checking, after a \"delayed\" command." 132 "The number of seconds to wait before checking, after a \"delayed\" command."
140 :group 'flyspell
141 :type 'number) 133 :type 'number)
142 134
143(defcustom flyspell-persistent-highlight t 135(defcustom flyspell-persistent-highlight t
@@ -147,12 +139,10 @@ is highlighted, and the highlight is turned off as soon as point moves
147off the misspelled word. 139off the misspelled word.
148 140
149Make sure this variable is non-nil if you use `flyspell-region'." 141Make sure this variable is non-nil if you use `flyspell-region'."
150 :group 'flyspell
151 :type 'boolean) 142 :type 'boolean)
152 143
153(defcustom flyspell-highlight-properties t 144(defcustom flyspell-highlight-properties t
154 "Non-nil means highlight incorrect words even if a property exists for this word." 145 "Non-nil means highlight incorrect words even if a property exists for this word."
155 :group 'flyspell
156 :type 'boolean) 146 :type 'boolean)
157 147
158(defcustom flyspell-default-delayed-commands 148(defcustom flyspell-default-delayed-commands
@@ -164,7 +154,6 @@ Make sure this variable is non-nil if you use `flyspell-region'."
164 backward-delete-char-untabify) 154 backward-delete-char-untabify)
165 "The standard list of delayed commands for Flyspell. 155 "The standard list of delayed commands for Flyspell.
166See `flyspell-delayed-commands'." 156See `flyspell-delayed-commands'."
167 :group 'flyspell
168 :version "21.1" 157 :version "21.1"
169 :type '(repeat (symbol))) 158 :type '(repeat (symbol)))
170 159
@@ -172,7 +161,6 @@ See `flyspell-delayed-commands'."
172 "List of commands that are \"delayed\" for Flyspell mode. 161 "List of commands that are \"delayed\" for Flyspell mode.
173After these commands, Flyspell checking is delayed for a short time, 162After these commands, Flyspell checking is delayed for a short time,
174whose length is specified by `flyspell-delay'." 163whose length is specified by `flyspell-delay'."
175 :group 'flyspell
176 :type '(repeat (symbol))) 164 :type '(repeat (symbol)))
177 165
178(defcustom flyspell-default-deplacement-commands 166(defcustom flyspell-default-deplacement-commands
@@ -182,7 +170,6 @@ whose length is specified by `flyspell-delay'."
182 scroll-down) 170 scroll-down)
183 "The standard list of deplacement commands for Flyspell. 171 "The standard list of deplacement commands for Flyspell.
184See variable `flyspell-deplacement-commands'." 172See variable `flyspell-deplacement-commands'."
185 :group 'flyspell
186 :version "21.1" 173 :version "21.1"
187 :type '(repeat (symbol))) 174 :type '(repeat (symbol)))
188 175
@@ -190,18 +177,15 @@ See variable `flyspell-deplacement-commands'."
190 "List of commands that are \"deplacement\" for Flyspell mode. 177 "List of commands that are \"deplacement\" for Flyspell mode.
191After these commands, Flyspell checking is performed only if the previous 178After these commands, Flyspell checking is performed only if the previous
192command was not the very same command." 179command was not the very same command."
193 :group 'flyspell
194 :version "21.1" 180 :version "21.1"
195 :type '(repeat (symbol))) 181 :type '(repeat (symbol)))
196 182
197(defcustom flyspell-issue-welcome-flag t 183(defcustom flyspell-issue-welcome-flag t
198 "Non-nil means that Flyspell should display a welcome message when started." 184 "Non-nil means that Flyspell should display a welcome message when started."
199 :group 'flyspell
200 :type 'boolean) 185 :type 'boolean)
201 186
202(defcustom flyspell-issue-message-flag t 187(defcustom flyspell-issue-message-flag t
203 "Non-nil means that Flyspell emits messages when checking words." 188 "Non-nil means that Flyspell emits messages when checking words."
204 :group 'flyspell
205 :type 'boolean) 189 :type 'boolean)
206 190
207(defcustom flyspell-incorrect-hook nil 191(defcustom flyspell-incorrect-hook nil
@@ -213,7 +197,6 @@ of possible corrections as returned by `ispell-parse-output'.
213 197
214If any of the functions return non-nil, the word is not highlighted as 198If any of the functions return non-nil, the word is not highlighted as
215incorrect." 199incorrect."
216 :group 'flyspell
217 :version "21.1" 200 :version "21.1"
218 :type 'hook) 201 :type 'hook)
219 202
@@ -225,14 +208,12 @@ when flyspell is started, the value of that variable is used instead
225of `flyspell-default-dictionary' to select the default dictionary. 208of `flyspell-default-dictionary' to select the default dictionary.
226Otherwise, if `flyspell-default-dictionary' is nil, it means to use 209Otherwise, if `flyspell-default-dictionary' is nil, it means to use
227Ispell's ultimate default dictionary." 210Ispell's ultimate default dictionary."
228 :group 'flyspell
229 :version "21.1" 211 :version "21.1"
230 :type '(choice string (const :tag "Default" nil))) 212 :type '(choice string (const :tag "Default" nil)))
231 213
232(defcustom flyspell-tex-command-regexp 214(defcustom flyspell-tex-command-regexp
233 "\\(\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)" 215 "\\(\\(begin\\|end\\)[ \t]*{\\|\\(cite[a-z*]*\\|label\\|ref\\|eqref\\|usepackage\\|documentclass\\)[ \t]*\\(\\[[^]]*\\]\\)?{[^{}]*\\)"
234 "A string that is the regular expression that matches TeX commands." 216 "A string that is the regular expression that matches TeX commands."
235 :group 'flyspell
236 :version "21.1" 217 :version "21.1"
237 :type 'regexp) 218 :type 'regexp)
238 219
@@ -241,34 +222,29 @@ Ispell's ultimate default dictionary."
241TeX math environments are discovered by `texmathp', implemented 222TeX math environments are discovered by `texmathp', implemented
242inside AUCTeX package. That package may be found at 223inside AUCTeX package. That package may be found at
243URL `https://www.gnu.org/software/auctex/'" 224URL `https://www.gnu.org/software/auctex/'"
244 :group 'flyspell
245 :type 'boolean) 225 :type 'boolean)
246 226
247(defcustom flyspell-dictionaries-that-consider-dash-as-word-delimiter 227(defcustom flyspell-dictionaries-that-consider-dash-as-word-delimiter
248 '("francais" "deutsch8" "norsk") 228 '("francais" "deutsch8" "norsk")
249 "List of dictionary names that consider `-' as word delimiter." 229 "List of dictionary names that consider `-' as word delimiter."
250 :group 'flyspell
251 :version "21.1" 230 :version "21.1"
252 :type '(repeat (string))) 231 :type '(repeat (string)))
253 232
254(defcustom flyspell-abbrev-p 233(defcustom flyspell-abbrev-p
255 nil 234 nil
256 "If non-nil, add correction to abbreviation table." 235 "If non-nil, add correction to abbreviation table."
257 :group 'flyspell
258 :version "21.1" 236 :version "21.1"
259 :type 'boolean) 237 :type 'boolean)
260 238
261(defcustom flyspell-use-global-abbrev-table-p 239(defcustom flyspell-use-global-abbrev-table-p
262 nil 240 nil
263 "If non-nil, prefer global abbrev table to local abbrev table." 241 "If non-nil, prefer global abbrev table to local abbrev table."
264 :group 'flyspell
265 :version "21.1" 242 :version "21.1"
266 :type 'boolean) 243 :type 'boolean)
267 244
268(defcustom flyspell-mode-line-string " Fly" 245(defcustom flyspell-mode-line-string " Fly"
269 "String displayed on the mode line when flyspell is active. 246 "String displayed on the mode line when flyspell is active.
270Set this to nil if you don't want a mode line indicator." 247Set this to nil if you don't want a mode line indicator."
271 :group 'flyspell
272 :type '(choice string (const :tag "None" nil))) 248 :type '(choice string (const :tag "None" nil)))
273 249
274(defcustom flyspell-large-region 1000 250(defcustom flyspell-large-region 1000
@@ -282,30 +258,25 @@ Doubled words are not detected in a large region, because Ispell
282does not check for them. 258does not check for them.
283 259
284If this variable is nil, all regions are treated as small." 260If this variable is nil, all regions are treated as small."
285 :group 'flyspell
286 :version "21.1" 261 :version "21.1"
287 :type '(choice number (const :tag "All small" nil))) 262 :type '(choice number (const :tag "All small" nil)))
288 263
289(defcustom flyspell-insert-function (function insert) 264(defcustom flyspell-insert-function (function insert)
290 "Function for inserting word by flyspell upon correction." 265 "Function for inserting word by flyspell upon correction."
291 :group 'flyspell
292 :type 'function) 266 :type 'function)
293 267
294(defcustom flyspell-before-incorrect-word-string nil 268(defcustom flyspell-before-incorrect-word-string nil
295 "String used to indicate an incorrect word starting." 269 "String used to indicate an incorrect word starting."
296 :group 'flyspell
297 :type '(choice string (const nil))) 270 :type '(choice string (const nil)))
298 271
299(defcustom flyspell-after-incorrect-word-string nil 272(defcustom flyspell-after-incorrect-word-string nil
300 "String used to indicate an incorrect word ending." 273 "String used to indicate an incorrect word ending."
301 :group 'flyspell
302 :type '(choice string (const nil))) 274 :type '(choice string (const nil)))
303 275
304(defvar flyspell-mode-map) 276(defvar flyspell-mode-map)
305 277
306(defcustom flyspell-use-meta-tab t 278(defcustom flyspell-use-meta-tab t
307 "Non-nil means that flyspell uses M-TAB to correct word." 279 "Non-nil means that flyspell uses M-TAB to correct word."
308 :group 'flyspell
309 :type 'boolean 280 :type 'boolean
310 :initialize 'custom-initialize-default 281 :initialize 'custom-initialize-default
311 :set (lambda (sym val) 282 :set (lambda (sym val)
@@ -316,8 +287,7 @@ If this variable is nil, all regions are treated as small."
316(defcustom flyspell-auto-correct-binding 287(defcustom flyspell-auto-correct-binding
317 [(control ?\;)] 288 [(control ?\;)]
318 "The key binding for flyspell auto correction." 289 "The key binding for flyspell auto correction."
319 :type 'key-sequence 290 :type 'key-sequence)
320 :group 'flyspell)
321 291
322;;*---------------------------------------------------------------------*/ 292;;*---------------------------------------------------------------------*/
323;;* Mode specific options */ 293;;* Mode specific options */
@@ -475,6 +445,22 @@ like <img alt=\"Some thing.\">."
475 map) 445 map)
476 "Minor mode keymap for Flyspell mode--for the whole buffer.") 446 "Minor mode keymap for Flyspell mode--for the whole buffer.")
477 447
448;; correct on mouse 3
449(defun flyspell--set-use-mouse-3-for-menu (var value)
450 (set-default var value)
451 (if value
452 (progn (define-key flyspell-mouse-map [mouse-2] nil)
453 (define-key flyspell-mouse-map [down-mouse-3] 'flyspell-correct-word))
454 (define-key flyspell-mouse-map [mouse-2] 'flyspell-correct-word)
455 (define-key flyspell-mouse-map [down-mouse-3] nil)))
456
457(defcustom flyspell-use-mouse-3-for-menu nil
458 "Non-nil means to bind `mouse-3' to `flyspell-correct-word'.
459If this is set, also unbind `mouse-2'."
460 :type 'boolean
461 :set 'flyspell--set-use-mouse-3-for-menu
462 :version "28.1")
463
478;; dash character machinery 464;; dash character machinery
479(defvar flyspell-consider-dash-as-word-delimiter-flag nil 465(defvar flyspell-consider-dash-as-word-delimiter-flag nil
480 "Non-nil means that the `-' char is considered as a word delimiter.") 466 "Non-nil means that the `-' char is considered as a word delimiter.")
@@ -493,8 +479,7 @@ like <img alt=\"Some thing.\">."
493 (t 479 (t
494 :underline t :inherit error)) 480 :underline t :inherit error))
495 "Flyspell face for misspelled words." 481 "Flyspell face for misspelled words."
496 :version "24.4" 482 :version "24.4")
497 :group 'flyspell)
498 483
499(defface flyspell-duplicate 484(defface flyspell-duplicate
500 '((((supports :underline (:style wave))) 485 '((((supports :underline (:style wave)))
@@ -503,8 +488,7 @@ like <img alt=\"Some thing.\">."
503 :underline t :inherit warning)) 488 :underline t :inherit warning))
504 "Flyspell face for words that appear twice in a row. 489 "Flyspell face for words that appear twice in a row.
505See also `flyspell-duplicate-distance'." 490See also `flyspell-duplicate-distance'."
506 :version "24.4" 491 :version "24.4")
507 :group 'flyspell)
508 492
509(defvar flyspell-overlay nil) 493(defvar flyspell-overlay nil)
510 494
@@ -546,7 +530,10 @@ in your init file.
546 :group 'flyspell 530 :group 'flyspell
547 (if flyspell-mode 531 (if flyspell-mode
548 (condition-case err 532 (condition-case err
549 (flyspell-mode-on) 533 (progn
534 (when flyspell-use-mouse-3-for-menu
535 (flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t))
536 (flyspell-mode-on))
550 (error (message "Error enabling Flyspell mode:\n%s" (cdr err)) 537 (error (message "Error enabling Flyspell mode:\n%s" (cdr err))
551 (flyspell-mode -1))) 538 (flyspell-mode -1)))
552 (flyspell-mode-off))) 539 (flyspell-mode-off)))
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index 65f61644b6d..b2ccbc8da24 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -621,15 +621,6 @@ For Aspell, non-nil also means to try to automatically find its dictionaries.
621Earlier Aspell versions do not consistently support charset encoding. Handling 621Earlier Aspell versions do not consistently support charset encoding. Handling
622this would require some extra guessing in `ispell-aspell-find-dictionary'.") 622this would require some extra guessing in `ispell-aspell-find-dictionary'.")
623 623
624(defvar ispell-aspell-supports-utf8 nil
625 "Non-nil if Aspell has consistent command line UTF-8 support. Obsolete.
626ispell.el and flyspell.el will use for this purpose the more generic
627variable `ispell-encoding8-command' for both Aspell and Hunspell. Is left
628here just for backwards compatibility.")
629
630(make-obsolete-variable 'ispell-aspell-supports-utf8
631 'ispell-encoding8-command "23.1")
632
633(defvar ispell-dicts-name2locale-equivs-alist 624(defvar ispell-dicts-name2locale-equivs-alist
634 '(("american" "en_US") 625 '(("american" "en_US")
635 ("brasileiro" "pt_BR") 626 ("brasileiro" "pt_BR")
@@ -682,9 +673,7 @@ Otherwise returns the library directory name, if that is defined."
682 ;; all versions, since versions earlier than 3.0.09 didn't identify 673 ;; all versions, since versions earlier than 3.0.09 didn't identify
683 ;; themselves on startup. 674 ;; themselves on startup.
684 (interactive "p") 675 (interactive "p")
685 (let ((default-directory (or (and (boundp 'temporary-file-directory) 676 (let ((default-directory (or temporary-file-directory default-directory))
686 temporary-file-directory)
687 default-directory))
688 (get-config-var 677 (get-config-var
689 (lambda (var) 678 (lambda (var)
690 (when (re-search-forward 679 (when (re-search-forward
@@ -3734,8 +3723,7 @@ looking for a dictionary, please see the distribution of the GNU ispell
3734program, or do an Internet search; there are various dictionaries 3723program, or do an Internet search; there are various dictionaries
3735available on the net." 3724available on the net."
3736 (interactive) 3725 (interactive)
3737 (if (and (boundp 'transient-mark-mode) transient-mark-mode 3726 (if (and transient-mark-mode mark-active)
3738 (boundp 'mark-active) mark-active)
3739 (ispell-region (region-beginning) (region-end)) 3727 (ispell-region (region-beginning) (region-end))
3740 (ispell-buffer))) 3728 (ispell-buffer)))
3741 3729
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 279dbb4450c..7bc7dc1762e 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -487,9 +487,6 @@ Most useful for remembering things from other applications."
487 (interactive) 487 (interactive)
488 (remember-region (point-min) (point-max))) 488 (remember-region (point-min) (point-max)))
489 489
490;; Org needs this
491(define-obsolete-function-alias 'remember-buffer 'remember-finalize "23.1")
492
493(defun remember-destroy () 490(defun remember-destroy ()
494 "Destroy the current *Remember* buffer." 491 "Destroy the current *Remember* buffer."
495 (interactive) 492 (interactive)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 483a2c9bd83..3c2d766ffb1 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -258,7 +258,7 @@ E.g.:
258 258
259;; Filenames 259;; Filenames
260 260
261(defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:" 261(defvar thing-at-point-file-name-chars "-@~/[:alnum:]_.${}#%,:"
262 "Characters allowable in filenames.") 262 "Characters allowable in filenames.")
263 263
264(define-thing-chars filename thing-at-point-file-name-chars) 264(define-thing-chars filename thing-at-point-file-name-chars)
diff --git a/lisp/time.el b/lisp/time.el
index 44fd1a7e337..96b49ddabdd 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -25,8 +25,7 @@
25;; Facilities to display current time/date and a new-mail indicator 25;; Facilities to display current time/date and a new-mail indicator
26;; in the Emacs mode line. The entry point is `display-time'. 26;; in the Emacs mode line. The entry point is `display-time'.
27 27
28;; Display time world in a buffer, the entry point is 28;; Use `world-clock' to display world clock in a buffer.
29;; `display-time-world'.
30 29
31;;; Code: 30;;; Code:
32 31
@@ -35,23 +34,20 @@
35 :group 'mode-line 34 :group 'mode-line
36 :group 'mail) 35 :group 'mail)
37 36
38
39(defcustom display-time-mail-file nil 37(defcustom display-time-mail-file nil
40 "File name of mail inbox file, for indicating existence of new mail. 38 "File name of mail inbox file, for indicating existence of new mail.
41Non-nil and not a string means don't check for mail; nil means use 39Non-nil and not a string means don't check for mail; nil means use
42default, which is system-dependent, and is the same as used by Rmail." 40default, which is system-dependent, and is the same as used by Rmail."
43 :type '(choice (const :tag "None" none) 41 :type '(choice (const :tag "None" none)
44 (const :tag "Default" nil) 42 (const :tag "Default" nil)
45 (file :format "%v")) 43 (file :format "%v")))
46 :group 'display-time)
47 44
48(defcustom display-time-mail-directory nil 45(defcustom display-time-mail-directory nil
49 "Name of mail inbox directory, for indicating existence of new mail. 46 "Name of mail inbox directory, for indicating existence of new mail.
50Any nonempty regular file in the directory is regarded as newly arrived mail. 47Any nonempty regular file in the directory is regarded as newly arrived mail.
51If nil, do not check a directory for arriving mail." 48If nil, do not check a directory for arriving mail."
52 :type '(choice (const :tag "None" nil) 49 :type '(choice (const :tag "None" nil)
53 (directory :format "%v")) 50 (directory :format "%v")))
54 :group 'display-time)
55 51
56(defcustom display-time-mail-function nil 52(defcustom display-time-mail-function nil
57 "Function to call, for indicating existence of new mail. 53 "Function to call, for indicating existence of new mail.
@@ -59,8 +55,7 @@ If nil, that means use the default method: check that the file
59specified by `display-time-mail-file' is nonempty or that the 55specified by `display-time-mail-file' is nonempty or that the
60directory `display-time-mail-directory' contains nonempty files." 56directory `display-time-mail-directory' contains nonempty files."
61 :type '(choice (const :tag "Default" nil) 57 :type '(choice (const :tag "Default" nil)
62 (function)) 58 (function)))
63 :group 'display-time)
64 59
65(defcustom display-time-default-load-average 0 60(defcustom display-time-default-load-average 0
66 "Which load average value will be shown in the mode line. 61 "Which load average value will be shown in the mode line.
@@ -75,8 +70,7 @@ The value can be one of:
75 :type '(choice (const :tag "1 minute load" 0) 70 :type '(choice (const :tag "1 minute load" 0)
76 (const :tag "5 minutes load" 1) 71 (const :tag "5 minutes load" 1)
77 (const :tag "15 minutes load" 2) 72 (const :tag "15 minutes load" 2)
78 (const :tag "None" nil)) 73 (const :tag "None" nil)))
79 :group 'display-time)
80 74
81(defvar display-time-load-average nil 75(defvar display-time-load-average nil
82 "Value of the system's load average currently shown on the mode line. 76 "Value of the system's load average currently shown on the mode line.
@@ -86,27 +80,23 @@ This is an internal variable; setting it has no effect.")
86 80
87(defcustom display-time-load-average-threshold 0.1 81(defcustom display-time-load-average-threshold 0.1
88 "Load-average values below this value won't be shown in the mode line." 82 "Load-average values below this value won't be shown in the mode line."
89 :type 'number 83 :type 'number)
90 :group 'display-time)
91 84
92;;;###autoload 85;;;###autoload
93(defcustom display-time-day-and-date nil "\ 86(defcustom display-time-day-and-date nil "\
94Non-nil means \\[display-time] should display day and date as well as time." 87Non-nil means \\[display-time] should display day and date as well as time."
95 :type 'boolean 88 :type 'boolean)
96 :group 'display-time)
97 89
98(defvar display-time-timer nil) 90(defvar display-time-timer nil)
99 91
100(defcustom display-time-interval 60 92(defcustom display-time-interval 60
101 "Seconds between updates of time in the mode line." 93 "Seconds between updates of time in the mode line."
102 :type 'integer 94 :type 'integer)
103 :group 'display-time)
104 95
105(defcustom display-time-24hr-format nil 96(defcustom display-time-24hr-format nil
106 "Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23. 97 "Non-nil indicates time should be displayed as hh:mm, 0 <= hh <= 23.
107A value of nil means 1 <= hh <= 12, and an AM/PM suffix is used." 98A value of nil means 1 <= hh <= 12, and an AM/PM suffix is used."
108 :type 'boolean 99 :type 'boolean)
109 :group 'display-time)
110 100
111(defvar display-time-string nil 101(defvar display-time-string nil
112 "String used in mode lines to display a time string. 102 "String used in mode lines to display a time string.
@@ -116,103 +106,12 @@ It should not be set directly, but is instead updated by the
116 106
117(defcustom display-time-hook nil 107(defcustom display-time-hook nil
118 "List of functions to be called when the time is updated on the mode line." 108 "List of functions to be called when the time is updated on the mode line."
119 :type 'hook 109 :type 'hook)
120 :group 'display-time)
121 110
122(defvar display-time-server-down-time nil 111(defvar display-time-server-down-time nil
123 "Time when mail file's file system was recorded to be down. 112 "Time when mail file's file system was recorded to be down.
124If that file system seems to be up, the value is nil.") 113If that file system seems to be up, the value is nil.")
125 114
126(defcustom zoneinfo-style-world-list
127 '(("America/Los_Angeles" "Seattle")
128 ("America/New_York" "New York")
129 ("Europe/London" "London")
130 ("Europe/Paris" "Paris")
131 ("Asia/Calcutta" "Bangalore")
132 ("Asia/Tokyo" "Tokyo"))
133 "Alist of zoneinfo-style time zones and places for `display-time-world'.
134Each element has the form (TIMEZONE LABEL).
135TIMEZONE should be a string of the form AREA/LOCATION, where AREA is
136the name of a region -- a continent or ocean, and LOCATION is the name
137of a specific location, e.g., a city, within that region.
138LABEL is a string to display as the label of that TIMEZONE's time."
139 :group 'display-time
140 :type '(repeat (list string string))
141 :version "23.1")
142
143(defcustom legacy-style-world-list
144 '(("PST8PDT" "Seattle")
145 ("EST5EDT" "New York")
146 ("GMT0BST" "London")
147 ("CET-1CDT" "Paris")
148 ("IST-5:30" "Bangalore")
149 ("JST-9" "Tokyo"))
150 "Alist of traditional-style time zones and places for `display-time-world'.
151Each element has the form (TIMEZONE LABEL).
152TIMEZONE should be a string of the form:
153
154 std[+|-]offset[dst[offset][,date[/time],date[/time]]]
155
156See the documentation of the TZ environment variable on your system,
157for more details about the format of TIMEZONE.
158LABEL is a string to display as the label of that TIMEZONE's time."
159 :group 'display-time
160 :type '(repeat (list string string))
161 :version "23.1")
162
163(defcustom display-time-world-list t
164 "Alist of time zones and places for `display-time-world' to display.
165Each element has the form (TIMEZONE LABEL).
166TIMEZONE should be in a format supported by your system. See the
167documentation of `zoneinfo-style-world-list' and
168`legacy-style-world-list' for two widely used formats. LABEL is
169a string to display as the label of that TIMEZONE's time.
170
171If the value is t instead of an alist, use the value of
172`zoneinfo-style-world-list' if it works on this platform, and of
173`legacy-style-world-list' otherwise."
174
175 :group 'display-time
176 :type '(choice (const :tag "Default" t)
177 (repeat :tag "List of zones and labels"
178 (list (string :tag "Zone") (string :tag "Label"))))
179 :version "23.1")
180
181(defun time--display-world-list ()
182 (if (listp display-time-world-list)
183 display-time-world-list
184 ;; Determine if zoneinfo style timezones are supported by testing that
185 ;; America/New York and Europe/London return different timezones.
186 (let ((nyt (format-time-string "%z" nil "America/New_York"))
187 (gmt (format-time-string "%z" nil "Europe/London")))
188 (if (string-equal nyt gmt)
189 legacy-style-world-list
190 zoneinfo-style-world-list))))
191
192(defcustom display-time-world-time-format "%A %d %B %R %Z"
193 "Format of the time displayed, see `format-time-string'."
194 :group 'display-time
195 :type 'string
196 :version "23.1")
197
198(defcustom display-time-world-buffer-name "*wclock*"
199 "Name of the world clock buffer."
200 :group 'display-time
201 :type 'string
202 :version "23.1")
203
204(defcustom display-time-world-timer-enable t
205 "If non-nil, a timer will update the world clock."
206 :group 'display-time
207 :type 'boolean
208 :version "23.1")
209
210(defcustom display-time-world-timer-second 60
211 "Interval in seconds for updating the world clock."
212 :group 'display-time
213 :type 'integer
214 :version "23.1")
215
216;;;###autoload 115;;;###autoload
217(defun display-time () 116(defun display-time ()
218 "Enable display of time, load level, and mail flag in mode lines. 117 "Enable display of time, load level, and mail flag in mode lines.
@@ -249,14 +148,12 @@ See `display-time-use-mail-icon' and `display-time-mail-face'.")
249 "Non-nil means use an icon as mail indicator on a graphic display. 148 "Non-nil means use an icon as mail indicator on a graphic display.
250Otherwise use `display-time-mail-string'. The icon may consume less 149Otherwise use `display-time-mail-string'. The icon may consume less
251of the mode line. It is specified by `display-time-mail-icon'." 150of the mode line. It is specified by `display-time-mail-icon'."
252 :group 'display-time
253 :type 'boolean) 151 :type 'boolean)
254 152
255;; Fixme: maybe default to the character if we can display Unicode. 153;; Fixme: maybe default to the character if we can display Unicode.
256(defcustom display-time-mail-string "Mail" 154(defcustom display-time-mail-string "Mail"
257 "String to use as the mail indicator in `display-time-string-forms'. 155 "String to use as the mail indicator in `display-time-string-forms'.
258This can use the Unicode letter character if you can display it." 156This can use the Unicode letter character if you can display it."
259 :group 'display-time
260 :version "22.1" 157 :version "22.1"
261 :type '(choice (const "Mail") 158 :type '(choice (const "Mail")
262 ;; Use :tag here because the Lucid menu won't display 159 ;; Use :tag here because the Lucid menu won't display
@@ -270,8 +167,7 @@ See the function `format-time-string' for an explanation of
270how to write this string. If this is nil, the defaults 167how to write this string. If this is nil, the defaults
271depend on `display-time-day-and-date' and `display-time-24hr-format'." 168depend on `display-time-day-and-date' and `display-time-24hr-format'."
272 :type '(choice (const :tag "Default" nil) 169 :type '(choice (const :tag "Default" nil)
273 string) 170 string))
274 :group 'display-time)
275 171
276(defcustom display-time-string-forms 172(defcustom display-time-string-forms
277 '((if (and (not display-time-format) display-time-day-and-date) 173 '((if (and (not display-time-format) display-time-day-and-date)
@@ -325,8 +221,7 @@ For example:
325 (if mail \" Mail\" \"\")) 221 (if mail \" Mail\" \"\"))
326 222
327would give mode line times like `94/12/30 21:07:48 (UTC)'." 223would give mode line times like `94/12/30 21:07:48 (UTC)'."
328 :type '(repeat sexp) 224 :type '(repeat sexp))
329 :group 'display-time)
330 225
331(defun display-time-event-handler () 226(defun display-time-event-handler ()
332 (display-time-update) 227 (display-time-update)
@@ -508,13 +403,129 @@ runs the normal hook `display-time-hook' after each update."
508 (remove-hook 'rmail-after-get-new-mail-hook 403 (remove-hook 'rmail-after-get-new-mail-hook
509 'display-time-event-handler))) 404 'display-time-event-handler)))
510 405
406
407;;; Obsolete names
408
409(define-obsolete-variable-alias 'display-time-world-list
410 'world-clock-list "28.1")
411(define-obsolete-variable-alias 'display-time-world-time-format
412 'world-clock-time-format "28.1")
413(define-obsolete-variable-alias 'display-time-world-buffer-name
414 'world-clock-buffer-name "28.1")
415(define-obsolete-variable-alias 'display-time-world-timer-enable
416 'world-clock-timer-enable "28.1")
417(define-obsolete-variable-alias 'display-time-world-timer-second
418 'world-clock-timer-second "28.1")
419
420(define-obsolete-function-alias 'display-time-world-mode
421 #'world-clock-mode "28.1")
422(define-obsolete-function-alias 'display-time-world-display
423 #'world-clock-display "28.1")
424(define-obsolete-function-alias 'display-time-world
425 #'world-clock "28.1")
426(define-obsolete-function-alias 'display-time-world-timer
427 #'world-clock-update "28.1")
428
429
430;;; World clock
431
432(defgroup world-clock nil
433 "Display a world clock."
434 :group 'display-time)
435
436(defcustom zoneinfo-style-world-list
437 '(("America/Los_Angeles" "Seattle")
438 ("America/New_York" "New York")
439 ("Europe/London" "London")
440 ("Europe/Paris" "Paris")
441 ("Asia/Calcutta" "Bangalore")
442 ("Asia/Tokyo" "Tokyo"))
443 "Alist of zoneinfo-style time zones and places for `world-clock'.
444Each element has the form (TIMEZONE LABEL).
445TIMEZONE should be a string of the form AREA/LOCATION, where AREA is
446the name of a region -- a continent or ocean, and LOCATION is the name
447of a specific location, e.g., a city, within that region.
448LABEL is a string to display as the label of that TIMEZONE's time."
449 :type '(repeat (list string string))
450 :version "23.1")
451
452(defcustom legacy-style-world-list
453 '(("PST8PDT" "Seattle")
454 ("EST5EDT" "New York")
455 ("GMT0BST" "London")
456 ("CET-1CDT" "Paris")
457 ("IST-5:30" "Bangalore")
458 ("JST-9" "Tokyo"))
459 "Alist of traditional-style time zones and places for `world-clock'.
460Each element has the form (TIMEZONE LABEL).
461TIMEZONE should be a string of the form:
462
463 std[+|-]offset[dst[offset][,date[/time],date[/time]]]
464
465See the documentation of the TZ environment variable on your system,
466for more details about the format of TIMEZONE.
467LABEL is a string to display as the label of that TIMEZONE's time."
468 :type '(repeat (list string string))
469 :version "23.1")
470
471(defcustom world-clock-list t
472 "Alist of time zones and places for `world-clock' to display.
473Each element has the form (TIMEZONE LABEL).
474TIMEZONE should be in a format supported by your system. See the
475documentation of `zoneinfo-style-world-list' and
476`legacy-style-world-list' for two widely used formats. LABEL is
477a string to display as the label of that TIMEZONE's time.
478
479If the value is t instead of an alist, use the value of
480`zoneinfo-style-world-list' if it works on this platform, and of
481`legacy-style-world-list' otherwise."
482 :type '(choice (const :tag "Default" t)
483 (repeat :tag "List of zones and labels"
484 (list (string :tag "Zone") (string :tag "Label"))))
485 :version "28.1")
486
487(defun time--display-world-list ()
488 (if (listp world-clock-list)
489 world-clock-list
490 ;; Determine if zoneinfo style timezones are supported by testing that
491 ;; America/New York and Europe/London return different timezones.
492 (let ((nyt (format-time-string "%z" nil "America/New_York"))
493 (gmt (format-time-string "%z" nil "Europe/London")))
494 (if (string-equal nyt gmt)
495 legacy-style-world-list
496 zoneinfo-style-world-list))))
497
498(defcustom world-clock-time-format "%A %d %B %R %Z"
499 "Time format for `world-clock', see `format-time-string'."
500 :type 'string
501 :version "28.1")
502
503(defcustom world-clock-buffer-name "*wclock*"
504 "Name of the `world-clock' buffer."
505 :type 'string
506 :version "28.1")
507
508(defcustom world-clock-timer-enable t
509 "If non-nil, a timer will update the `world-clock' buffer."
510 :type 'boolean
511 :version "28.1")
512
513(defcustom world-clock-timer-second 60
514 "Interval in seconds for updating the `world-clock' buffer."
515 :type 'integer
516 :version "28.1")
517
518(defface world-clock-label
519 '((t :inherit font-lock-variable-name-face))
520 "Face for time zone label in `world-clock' buffer.")
511 521
512(define-derived-mode display-time-world-mode special-mode "World clock" 522(define-derived-mode world-clock-mode special-mode "World clock"
513 "Major mode for buffer that displays times in various time zones. 523 "Major mode for buffer that displays times in various time zones.
514See `display-time-world'." 524See `world-clock'."
525 (setq revert-buffer-function #'world-clock-update)
515 (setq show-trailing-whitespace nil)) 526 (setq show-trailing-whitespace nil))
516 527
517(defun display-time-world-display (alist) 528(defun world-clock-display (alist)
518 "Replace current buffer text with times in various zones, based on ALIST." 529 "Replace current buffer text with times in various zones, based on ALIST."
519 (let ((inhibit-read-only t) 530 (let ((inhibit-read-only t)
520 (buffer-undo-list t) 531 (buffer-undo-list t)
@@ -526,42 +537,45 @@ See `display-time-world'."
526 (let* ((label (cadr zone)) 537 (let* ((label (cadr zone))
527 (width (string-width label))) 538 (width (string-width label)))
528 (push (cons label 539 (push (cons label
529 (format-time-string display-time-world-time-format 540 (format-time-string world-clock-time-format
530 now (car zone))) 541 now (car zone)))
531 result) 542 result)
532 (when (> width max-width) 543 (when (> width max-width)
533 (setq max-width width)))) 544 (setq max-width width))))
534 (setq fmt (concat "%-" (int-to-string max-width) "s %s\n")) 545 (setq fmt (concat "%-" (int-to-string max-width) "s %s\n"))
535 (dolist (timedata (nreverse result)) 546 (dolist (timedata (nreverse result))
536 (insert (format fmt (car timedata) (cdr timedata)))) 547 (insert (format fmt
548 (propertize (car timedata)
549 'face 'world-clock-label)
550 (cdr timedata))))
537 (delete-char -1)) 551 (delete-char -1))
538 (goto-char (point-min))) 552 (goto-char (point-min)))
539 553
540;;;###autoload 554;;;###autoload
541(defun display-time-world () 555(defun world-clock ()
542 "Enable updating display of times in various time zones. 556 "Display a world clock buffer with times in various time zones.
543`display-time-world-list' specifies the zones. 557The variable `world-clock-list' specifies which time zones to use.
544To turn off the world time display, go to that window and type `q'." 558To turn off the world time display, go to the window and type `\\[quit-window]'."
545 (interactive) 559 (interactive)
546 (when (and display-time-world-timer-enable 560 (when (and world-clock-timer-enable
547 (not (get-buffer display-time-world-buffer-name))) 561 (not (get-buffer world-clock-buffer-name)))
548 (run-at-time t display-time-world-timer-second 'display-time-world-timer)) 562 (run-at-time t world-clock-timer-second #'world-clock-update))
549 (with-current-buffer (get-buffer-create display-time-world-buffer-name) 563 (pop-to-buffer world-clock-buffer-name)
550 (display-time-world-display (time--display-world-list)) 564 (world-clock-display (time--display-world-list))
551 (display-buffer display-time-world-buffer-name 565 (world-clock-mode)
552 (cons nil '((window-height . fit-window-to-buffer)))) 566 (fit-window-to-buffer))
553 (display-time-world-mode))) 567
554 568(defun world-clock-update (&optional _arg _noconfirm)
555(defun display-time-world-timer () 569 "Update the `world-clock' buffer."
556 (if (get-buffer display-time-world-buffer-name) 570 (if (get-buffer world-clock-buffer-name)
557 (with-current-buffer (get-buffer display-time-world-buffer-name) 571 (with-current-buffer (get-buffer world-clock-buffer-name)
558 (display-time-world-display (time--display-world-list))) 572 (world-clock-display (time--display-world-list)))
559 ;; cancel timer 573 ;; cancel timer
560 (let ((list timer-list)) 574 (let ((list timer-list))
561 (while list 575 (while list
562 (let ((elt (pop list))) 576 (let ((elt (pop list)))
563 (when (equal (symbol-name (timer--function elt)) 577 (when (equal (symbol-name (timer--function elt))
564 "display-time-world-timer") 578 "world-clock-update")
565 (cancel-timer elt))))))) 579 (cancel-timer elt)))))))
566 580
567;;;###autoload 581;;;###autoload
diff --git a/lisp/tooltip.el b/lisp/tooltip.el
index f35f6b9a03e..5f5a4788b26 100644
--- a/lisp/tooltip.el
+++ b/lisp/tooltip.el
@@ -167,8 +167,6 @@ This variable has effect only on GUI frames."
167 167
168;;; Variables that are not customizable. 168;;; Variables that are not customizable.
169 169
170(define-obsolete-variable-alias 'tooltip-hook 'tooltip-functions "23.1")
171
172(defvar tooltip-functions nil 170(defvar tooltip-functions nil
173 "Functions to call to display tooltips. 171 "Functions to call to display tooltips.
174Each function is called with one argument EVENT which is a copy 172Each function is called with one argument EVENT which is a copy
diff --git a/lisp/url/url-expand.el b/lisp/url/url-expand.el
index f34ef810c4a..be9b5426dc4 100644
--- a/lisp/url/url-expand.el
+++ b/lisp/url/url-expand.el
@@ -120,7 +120,7 @@ path components followed by `..' are removed, along with the `..' itself."
120 ;; Well, they told us the scheme, let's just go with it. 120 ;; Well, they told us the scheme, let's just go with it.
121 nil 121 nil
122 (setf (url-type urlobj) (or (url-type urlobj) (url-type defobj))) 122 (setf (url-type urlobj) (or (url-type urlobj) (url-type defobj)))
123 (setf (url-port urlobj) (or (url-portspec urlobj) 123 (setf (url-portspec urlobj) (or (url-portspec urlobj)
124 (and (string= (url-type urlobj) 124 (and (string= (url-type urlobj)
125 (url-type defobj)) 125 (url-type defobj))
126 (url-port defobj)))) 126 (url-port defobj))))
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 6dd7a9c2aac..0a7e7e205e0 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -569,31 +569,6 @@ Has a preference for looking backward when not directly on a symbol."
569 (setq url nil)) 569 (setq url nil))
570 url))) 570 url)))
571 571
572(defun url-generate-unique-filename (&optional fmt)
573 "Generate a unique filename in `url-temporary-directory'."
574 (declare (obsolete make-temp-file "23.1"))
575 ;; This variable is obsolete, but so is this function.
576 (let ((tempdir (with-no-warnings url-temporary-directory)))
577 (if (not fmt)
578 (let ((base (format "url-tmp.%d" (user-real-uid)))
579 (fname "")
580 (x 0))
581 (setq fname (format "%s%d" base x))
582 (while (file-exists-p
583 (expand-file-name fname tempdir))
584 (setq x (1+ x)
585 fname (concat base (int-to-string x))))
586 (expand-file-name fname tempdir))
587 (let ((base (concat "url" (int-to-string (user-real-uid))))
588 (fname "")
589 (x 0))
590 (setq fname (format fmt (concat base (int-to-string x))))
591 (while (file-exists-p
592 (expand-file-name fname tempdir))
593 (setq x (1+ x)
594 fname (format fmt (concat base (int-to-string x)))))
595 (expand-file-name fname tempdir)))))
596
597(defun url-extract-mime-headers () 572(defun url-extract-mime-headers ()
598 "Set `url-current-mime-headers' in current buffer." 573 "Set `url-current-mime-headers' in current buffer."
599 (save-excursion 574 (save-excursion
diff --git a/lisp/url/url-vars.el b/lisp/url/url-vars.el
index d9277cf6f42..e35823ab9af 100644
--- a/lisp/url/url-vars.el
+++ b/lisp/url/url-vars.el
@@ -312,13 +312,6 @@ Applies when a protected document is denied by the server."
312 :type 'integer 312 :type 'integer
313 :group 'url) 313 :group 'url)
314 314
315(defcustom url-temporary-directory (or (getenv "TMPDIR") "/tmp")
316 "Where temporary files go."
317 :type 'directory
318 :group 'url-file)
319(make-obsolete-variable 'url-temporary-directory
320 'temporary-file-directory "23.1")
321
322(defcustom url-show-status t 315(defcustom url-show-status t
323 "Whether to show a running total of bytes transferred. 316 "Whether to show a running total of bytes transferred.
324Can cause a large hit if using a remote X display over a slow link, or 317Can cause a large hit if using a remote X display over a slow link, or
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index d194d6c0a0e..bd5ac9b9a62 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2518,7 +2518,7 @@ fixed, visit it in a buffer."
2518 '((?+ . (left-fringe diff-fringe-add diff-indicator-added)) 2518 '((?+ . (left-fringe diff-fringe-add diff-indicator-added))
2519 (?- . (left-fringe diff-fringe-del diff-indicator-removed)) 2519 (?- . (left-fringe diff-fringe-del diff-indicator-removed))
2520 (?! . (left-fringe diff-fringe-rep diff-indicator-changed)) 2520 (?! . (left-fringe diff-fringe-rep diff-indicator-changed))
2521 (?\s . (left-fringe diff-fringe-nul)))))) 2521 (?\s . (left-fringe diff-fringe-nul fringe))))))
2522 (put-text-property (match-beginning 0) (match-end 0) 'display spec)))) 2522 (put-text-property (match-beginning 0) (match-end 0) 'display spec))))
2523 ;; Mimicks the output of Magit's diff. 2523 ;; Mimicks the output of Magit's diff.
2524 ;; FIXME: This has only been tested with Git's diff output. 2524 ;; FIXME: This has only been tested with Git's diff output.
diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el
index f5177bca112..04926af16ef 100644
--- a/lisp/vc/ediff-init.el
+++ b/lisp/vc/ediff-init.el
@@ -1573,9 +1573,8 @@ This default should work without changes."
1573 1573
1574 1574
1575(defun ediff-convert-standard-filename (fname) 1575(defun ediff-convert-standard-filename (fname)
1576 (if (fboundp 'convert-standard-filename) 1576 (declare (obsolete convert-standard-filename "28.1"))
1577 (convert-standard-filename fname) 1577 (convert-standard-filename fname))
1578 fname))
1579 1578
1580(define-obsolete-function-alias 'ediff-with-syntax-table 1579(define-obsolete-function-alias 'ediff-with-syntax-table
1581 #'with-syntax-table "27.1") 1580 #'with-syntax-table "27.1")
diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el
index 4a84c1ecd9c..f56d31c7136 100644
--- a/lisp/vc/ediff-util.el
+++ b/lisp/vc/ediff-util.el
@@ -240,18 +240,16 @@ to invocation.")
240 startup-hooks setup-parameters 240 startup-hooks setup-parameters
241 &optional merge-buffer-file) 241 &optional merge-buffer-file)
242 (run-hooks 'ediff-before-setup-hook) 242 (run-hooks 'ediff-before-setup-hook)
243 ;; ediff-convert-standard-filename puts file names in the form appropriate 243 ;; convert-standard-filename puts file names in the form appropriate
244 ;; for the OS at hand. 244 ;; for the OS at hand.
245 (setq file-A (ediff-convert-standard-filename (expand-file-name file-A))) 245 (setq file-A (convert-standard-filename (expand-file-name file-A)))
246 (setq file-B (ediff-convert-standard-filename (expand-file-name file-B))) 246 (setq file-B (convert-standard-filename (expand-file-name file-B)))
247 (if (stringp file-C) 247 (if (stringp file-C)
248 (setq file-C 248 (setq file-C (convert-standard-filename (expand-file-name file-C))))
249 (ediff-convert-standard-filename (expand-file-name file-C))))
250 (if (stringp merge-buffer-file) 249 (if (stringp merge-buffer-file)
251 (progn 250 (progn
252 (setq merge-buffer-file 251 (setq merge-buffer-file
253 (ediff-convert-standard-filename 252 (convert-standard-filename (expand-file-name merge-buffer-file)))
254 (expand-file-name merge-buffer-file)))
255 ;; check the directory exists 253 ;; check the directory exists
256 (or (file-exists-p (file-name-directory merge-buffer-file)) 254 (or (file-exists-p (file-name-directory merge-buffer-file))
257 (error "Directory %s given as place to save the merge doesn't exist" 255 (error "Directory %s given as place to save the merge doesn't exist"
@@ -3069,10 +3067,8 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3069 3067
3070 3068
3071;; for compatibility 3069;; for compatibility
3072(defmacro ediff-minibuffer-with-setup-hook (fun &rest body) 3070(define-obsolete-function-alias 'ediff-minibuffer-with-setup-hook
3073 `(if (fboundp 'minibuffer-with-setup-hook) 3071 #'minibuffer-with-setup-hook "28.1")
3074 (minibuffer-with-setup-hook ,fun ,@body)
3075 ,@body))
3076 3072
3077;; This is adapted from a similar function in `emerge.el'. 3073;; This is adapted from a similar function in `emerge.el'.
3078;; PROMPT should not have a trailing ': ', so that it can be modified 3074;; PROMPT should not have a trailing ': ', so that it can be modified
@@ -3101,7 +3097,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3101 (and default-file (list default-file)) 3097 (and default-file (list default-file))
3102 default-dir))) 3098 default-dir)))
3103 f) 3099 f)
3104 (setq f (ediff-minibuffer-with-setup-hook 3100 (setq f (minibuffer-with-setup-hook
3105 (lambda () (when defaults 3101 (lambda () (when defaults
3106 (setq minibuffer-default defaults))) 3102 (setq minibuffer-default defaults)))
3107 (read-file-name 3103 (read-file-name
@@ -3134,7 +3130,7 @@ Hit \\[ediff-recenter] to reset the windows afterward."
3134;; Also, save buffer from START to END in the file. 3130;; Also, save buffer from START to END in the file.
3135;; START defaults to (point-min), END to (point-max) 3131;; START defaults to (point-min), END to (point-max)
3136(defun ediff-make-temp-file (buff &optional prefix given-file start end) 3132(defun ediff-make-temp-file (buff &optional prefix given-file start end)
3137 (let* ((p (ediff-convert-standard-filename (or prefix "ediff"))) 3133 (let* ((p (convert-standard-filename (or prefix "ediff")))
3138 (short-p p) 3134 (short-p p)
3139 (coding-system-for-write ediff-coding-system-for-write) 3135 (coding-system-for-write ediff-coding-system-for-write)
3140 f short-f) 3136 f short-f)
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 78a2fa08795..84aeb0a1105 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -210,6 +210,16 @@ toggle display of the entire list."
210 widget)))) 210 widget))))
211 :version "27.1") 211 :version "27.1")
212 212
213(defcustom vc-git-revision-complete-only-branches nil
214 "Control whether tags are returned by revision completion for Git.
215
216When non-nil, only branches and remotes will be returned by
217`vc-git-revision-completion-table'. This is used by various VC
218commands when completing branch names. When nil, tags are also
219included in the completions."
220 :type 'boolean
221 :version "28.1")
222
213;; History of Git commands. 223;; History of Git commands.
214(defvar vc-git-history nil) 224(defvar vc-git-history nil)
215 225
@@ -1415,9 +1425,11 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"."
1415 (with-temp-buffer 1425 (with-temp-buffer
1416 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)") 1426 (vc-git-command t nil nil "for-each-ref" "--format=%(refname)")
1417 (goto-char (point-min)) 1427 (goto-char (point-min))
1418 (while (re-search-forward "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$" 1428 (let ((regexp (if vc-git-revision-complete-only-branches
1419 nil t) 1429 "^refs/\\(heads\\|remotes\\)/\\(.*\\)$"
1420 (push (match-string 2) table))) 1430 "^refs/\\(heads\\|tags\\|remotes\\)/\\(.*\\)$")))
1431 (while (re-search-forward regexp nil t)
1432 (push (match-string 2) table))))
1421 table)) 1433 table))
1422 1434
1423(defun vc-git-revision-completion-table (files) 1435(defun vc-git-revision-completion-table (files)
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index ce72a49b955..f09ceddcb37 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -505,14 +505,6 @@ If FILE is not registered, this function always returns nil."
505 (vc-call-backend 505 (vc-call-backend
506 backend 'working-revision file)))))) 506 backend 'working-revision file))))))
507 507
508;; Backward compatibility.
509(define-obsolete-function-alias
510 'vc-workfile-version 'vc-working-revision "23.1")
511(defun vc-default-working-revision (backend file)
512 (message
513 "`working-revision' not found: using the old `workfile-version' instead")
514 (vc-call-backend backend 'workfile-version file))
515
516(defun vc-default-registered (backend file) 508(defun vc-default-registered (backend file)
517 "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates." 509 "Check if FILE is registered in BACKEND using vc-BACKEND-master-templates."
518 (let ((sym (vc-make-backend-sym backend 'master-templates))) 510 (let ((sym (vc-make-backend-sym backend 'master-templates)))
diff --git a/lisp/vc/vc-mtn.el b/lisp/vc/vc-mtn.el
index 092d8b53968..3c26ffc0e58 100644
--- a/lisp/vc/vc-mtn.el
+++ b/lisp/vc/vc-mtn.el
@@ -60,7 +60,6 @@ switches."
60 :version "25.1" 60 :version "25.1"
61 :group 'vc-mtn) 61 :group 'vc-mtn)
62 62
63(define-obsolete-variable-alias 'vc-mtn-command 'vc-mtn-program "23.1")
64(defcustom vc-mtn-program "mtn" 63(defcustom vc-mtn-program "mtn"
65 "Name of the monotone executable." 64 "Name of the monotone executable."
66 :type 'string 65 :type 'string
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 65775f8e46e..5561292d8c0 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2710,9 +2710,6 @@ to the working revision (except for keyword expansion)."
2710 (message "Reverting %s...done" (vc-delistify files))))) 2710 (message "Reverting %s...done" (vc-delistify files)))))
2711 2711
2712;;;###autoload 2712;;;###autoload
2713(define-obsolete-function-alias 'vc-revert-buffer 'vc-revert "23.1")
2714
2715;;;###autoload
2716(defun vc-pull (&optional arg) 2713(defun vc-pull (&optional arg)
2717 "Update the current fileset or branch. 2714 "Update the current fileset or branch.
2718You must be visiting a version controlled file, or in a `vc-dir' buffer. 2715You must be visiting a version controlled file, or in a `vc-dir' buffer.
diff --git a/lisp/vcursor.el b/lisp/vcursor.el
index fa0cbb74b0d..3601abcd6e4 100644
--- a/lisp/vcursor.el
+++ b/lisp/vcursor.el
@@ -1132,9 +1132,6 @@ line is treated like ordinary characters."
1132 (vcursor-copy (if (or (= count 0) arg) (1+ count) count))) 1132 (vcursor-copy (if (or (= count 0) arg) (1+ count) count)))
1133 ) 1133 )
1134 1134
1135(define-obsolete-function-alias
1136 'vcursor-toggle-vcursor-map 'vcursor-use-vcursor-map "23.1")
1137
1138(defun vcursor-post-command () 1135(defun vcursor-post-command ()
1139 (and vcursor-auto-disable (not vcursor-last-command) 1136 (and vcursor-auto-disable (not vcursor-last-command)
1140 vcursor-overlay 1137 vcursor-overlay
diff --git a/lisp/vt-control.el b/lisp/vt-control.el
index fc3a514f921..d4c14197bdc 100644
--- a/lisp/vt-control.el
+++ b/lisp/vt-control.el
@@ -1,4 +1,4 @@
1;;; vt-control.el --- Common VTxxx control functions 1;;; vt-control.el --- Common VTxxx control functions -*- lexical-binding:t -*-
2 2
3;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc. 3;; Copyright (C) 1993-1994, 2001-2020 Free Software Foundation, Inc.
4 4
diff --git a/lisp/window.el b/lisp/window.el
index f20940fa0ea..bb34a6d7b4c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -2642,12 +2642,17 @@ and no others."
2642 "Return t if WINDOW is the currently active minibuffer window." 2642 "Return t if WINDOW is the currently active minibuffer window."
2643 (and (window-live-p window) (eq window (active-minibuffer-window)))) 2643 (and (window-live-p window) (eq window (active-minibuffer-window))))
2644 2644
2645(defun count-windows (&optional minibuf) 2645(defun count-windows (&optional minibuf all-frames)
2646 "Return the number of live windows on the selected frame. 2646 "Return the number of live windows on the selected frame.
2647
2647The optional argument MINIBUF specifies whether the minibuffer 2648The optional argument MINIBUF specifies whether the minibuffer
2648window shall be counted. See `walk-windows' for the precise 2649window is included in the count.
2649meaning of this argument." 2650
2650 (length (window-list-1 nil minibuf))) 2651If ALL-FRAMES is non-nil, count the windows in all frames instead
2652just the selected frame.
2653
2654See `walk-windows' for the precise meaning of this argument."
2655 (length (window-list-1 nil minibuf all-frames)))
2651 2656
2652;;; Resizing windows. 2657;;; Resizing windows.
2653(defun window--size-to-pixel (window size &optional horizontal pixelwise round-maybe) 2658(defun window--size-to-pixel (window size &optional horizontal pixelwise round-maybe)
@@ -5729,10 +5734,10 @@ window."
5729WINDOW defaults to the selected window. DIRECTION can be 5734WINDOW defaults to the selected window. DIRECTION can be
5730nil (i.e. any), `height' or `width'." 5735nil (i.e. any), `height' or `width'."
5731 (with-current-buffer (window-buffer window) 5736 (with-current-buffer (window-buffer window)
5732 (when (and (boundp 'window-size-fixed) window-size-fixed) 5737 (and window-size-fixed
5733 (not (and direction 5738 (not (and direction
5734 (member (cons direction window-size-fixed) 5739 (member (cons direction window-size-fixed)
5735 '((height . width) (width . height)))))))) 5740 '((height . width) (width . height))))))))
5736 5741
5737;;; A different solution to balance-windows. 5742;;; A different solution to balance-windows.
5738(defvar window-area-factor 1 5743(defvar window-area-factor 1
diff --git a/lisp/woman.el b/lisp/woman.el
index c0e27c57077..891a1263ace 100644
--- a/lisp/woman.el
+++ b/lisp/woman.el
@@ -914,8 +914,8 @@ Troff emulation is experimental and largely untested.
914 :group 'faces) 914 :group 'faces)
915 915
916(defcustom woman-fontify 916(defcustom woman-fontify
917 (or (and (fboundp 'display-color-p) (display-color-p)) 917 (or (display-color-p)
918 (and (fboundp 'display-graphic-p) (display-graphic-p)) 918 (display-graphic-p)
919 (x-display-color-p)) 919 (x-display-color-p))
920 "If non-nil then WoMan assumes that face support is available. 920 "If non-nil then WoMan assumes that face support is available.
921It defaults to a non-nil value if the display supports either colors 921It defaults to a non-nil value if the display supports either colors
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index 06eff4f3863..14628c363b7 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,44 +1,12 @@
1# 00gnulib.m4 serial 7 1# 00gnulib.m4 serial 8
2dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
6 6
7dnl This file must be named something that sorts before all other 7dnl This file must be named something that sorts before all other
8dnl gnulib-provided .m4 files. The first part is needed until such time 8dnl gnulib-provided .m4 files. It is needed until the clang fix has
9dnl as we can assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and 9dnl been included in Autoconf.
10dnl m4_divert semantics. The second part is needed until the clang fix
11dnl has been included in Autoconf.
12
13# Until autoconf 2.63, handling of the diversion stack required m4_init
14# to be called first; but this does not happen with aclocal. Wrapping
15# the entire execution in another layer of the diversion stack fixes this.
16# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
17# for whether it was FIFO or LIFO; in order to properly balance with
18# m4_init, we need to undo our push just before anything wrapped within
19# the m4_init body. The way to ensure this is to wrap both sides of
20# m4_init with a one-shot macro that does the pop at the right time.
21m4_ifndef([_m4_divert_diversion],
22[m4_divert_push([KILL])
23m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
24m4_define([m4_init],
25 [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
26
27
28# AC_DEFUN_ONCE([NAME], VALUE)
29# ----------------------------
30# Define NAME to expand to VALUE on the first use (whether by direct
31# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
32# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This
33# definition is slower than the version in Autoconf 2.64, because it
34# can only use interfaces that existed since 2.59; but it achieves the
35# same effect. Quoting is necessary to avoid confusing Automake.
36m4_version_prereq([2.63.263], [],
37[m4_define([AC][_DEFUN_ONCE],
38 [AC][_DEFUN([$1],
39 [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
40 [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
41[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
42 10
43# The following definitions arrange to use a compiler option 11# The following definitions arrange to use a compiler option
44# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the 12# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4
index 39726ba57ba..c043233de36 100644
--- a/m4/absolute-header.m4
+++ b/m4/absolute-header.m4
@@ -1,4 +1,4 @@
1# absolute-header.m4 serial 16 1# absolute-header.m4 serial 17
2dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -22,23 +22,21 @@ dnl From Derek Price.
22AC_DEFUN([gl_ABSOLUTE_HEADER], 22AC_DEFUN([gl_ABSOLUTE_HEADER],
23[AC_REQUIRE([AC_CANONICAL_HOST]) 23[AC_REQUIRE([AC_CANONICAL_HOST])
24AC_LANG_PREPROC_REQUIRE()dnl 24AC_LANG_PREPROC_REQUIRE()dnl
25dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
26dnl until we can assume autoconf 2.64 or newer.
27m4_foreach_w([gl_HEADER_NAME], [$1], 25m4_foreach_w([gl_HEADER_NAME], [$1],
28 [AS_VAR_PUSHDEF([gl_absolute_header], 26 [AS_VAR_PUSHDEF([gl_absolute_header],
29 [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl 27 [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
30 AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], 28 AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
31 m4_defn([gl_absolute_header]), 29 [gl_absolute_header],
32 [AS_VAR_PUSHDEF([ac_header_exists], 30 [AS_VAR_PUSHDEF([ac_header_exists],
33 [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl 31 [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
34 AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl 32 AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
35 if test AS_VAR_GET(ac_header_exists) = yes; then 33 if test AS_VAR_GET([ac_header_exists]) = yes; then
36 gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) 34 gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
37 fi 35 fi
38 AS_VAR_POPDEF([ac_header_exists])dnl 36 AS_VAR_POPDEF([ac_header_exists])dnl
39 ])dnl 37 ])dnl
40 AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), 38 AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
41 ["AS_VAR_GET(gl_absolute_header)"], 39 ["AS_VAR_GET([gl_absolute_header])"],
42 [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) 40 [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
43 AS_VAR_POPDEF([gl_absolute_header])dnl 41 AS_VAR_POPDEF([gl_absolute_header])dnl
44])dnl 42])dnl
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index b777f8450ce..d8414896308 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,4 +1,4 @@
1# alloca.m4 serial 17 1# alloca.m4 serial 18
2dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, 2dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -102,7 +102,7 @@ AH_VERBATIM([STACK_DIRECTION],
102 STACK_DIRECTION > 0 => grows toward higher addresses 102 STACK_DIRECTION > 0 => grows toward higher addresses
103 STACK_DIRECTION < 0 => grows toward lower addresses 103 STACK_DIRECTION < 0 => grows toward lower addresses
104 STACK_DIRECTION = 0 => direction of growth unknown */ 104 STACK_DIRECTION = 0 => direction of growth unknown */
105@%:@undef STACK_DIRECTION])dnl 105#undef STACK_DIRECTION])dnl
106AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) 106AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
107]) 107])
108]) 108])
diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4
index bdc5c8f71a7..14ea3e12fa0 100644
--- a/m4/canonicalize.m4
+++ b/m4/canonicalize.m4
@@ -1,4 +1,4 @@
1# canonicalize.m4 serial 31 1# canonicalize.m4 serial 33
2 2
3dnl Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc. 3dnl Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc.
4 4
@@ -56,7 +56,16 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
56AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE], 56AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
57[ 57[
58 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 58 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
59 AC_CHECK_FUNCS_ONCE([canonicalize_file_name getcwd readlink]) 59 AC_CHECK_FUNCS_ONCE([canonicalize_file_name readlink])
60
61 dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
62 dnl available through the linker option '-loldnames'.
63 AC_REQUIRE([AC_CANONICAL_HOST])
64 case "$host_os" in
65 mingw*) ;;
66 *) AC_CHECK_FUNCS([getcwd]) ;;
67 esac
68
60 AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) 69 AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
61 AC_REQUIRE([gl_FUNC_REALPATH_WORKS]) 70 AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
62 AC_CHECK_HEADERS_ONCE([sys/param.h]) 71 AC_CHECK_HEADERS_ONCE([sys/param.h])
@@ -70,6 +79,7 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS],
70 AC_CHECK_FUNCS_ONCE([realpath]) 79 AC_CHECK_FUNCS_ONCE([realpath])
71 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 80 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
72 AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [ 81 AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
82 rm -rf conftest.a conftest.d
73 touch conftest.a 83 touch conftest.a
74 mkdir conftest.d 84 mkdir conftest.d
75 AC_RUN_IFELSE([ 85 AC_RUN_IFELSE([
diff --git a/m4/dup2.m4 b/m4/dup2.m4
index 462bfd0e526..a82798d6bba 100644
--- a/m4/dup2.m4
+++ b/m4/dup2.m4
@@ -1,4 +1,4 @@
1#serial 26 1#serial 27
2dnl Copyright (C) 2002, 2005, 2007, 2009-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2002, 2005, 2007, 2009-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -16,6 +16,7 @@ AC_DEFUN([gl_FUNC_DUP2],
16 #include <limits.h> 16 #include <limits.h>
17 #include <sys/resource.h> 17 #include <sys/resource.h>
18 #include <unistd.h> 18 #include <unistd.h>
19 ]GL_MDA_DEFINES[
19 #ifndef RLIM_SAVED_CUR 20 #ifndef RLIM_SAVED_CUR
20 # define RLIM_SAVED_CUR RLIM_INFINITY 21 # define RLIM_SAVED_CUR RLIM_INFINITY
21 #endif 22 #endif
diff --git a/m4/fchmodat.m4 b/m4/fchmodat.m4
index e3f2f048162..cf5c87999c5 100644
--- a/m4/fchmodat.m4
+++ b/m4/fchmodat.m4
@@ -1,4 +1,4 @@
1# fchmodat.m4 serial 4 1# fchmodat.m4 serial 5
2dnl Copyright (C) 2004-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2004-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_FCHMODAT],
40 #ifndef S_IRWXO 40 #ifndef S_IRWXO
41 #define S_IRWXO 0007 41 #define S_IRWXO 0007
42 #endif 42 #endif
43 ]], 43 ]GL_MDA_DEFINES],
44 [[ 44 [[
45 int permissive = S_IRWXU | S_IRWXG | S_IRWXO; 45 int permissive = S_IRWXU | S_IRWXG | S_IRWXO;
46 int desired = S_IRUSR | S_IWUSR; 46 int desired = S_IRUSR | S_IWUSR;
diff --git a/m4/fcntl.m4 b/m4/fcntl.m4
index 562ae2395df..ea24f3d64ef 100644
--- a/m4/fcntl.m4
+++ b/m4/fcntl.m4
@@ -1,4 +1,4 @@
1# fcntl.m4 serial 9 1# fcntl.m4 serial 10
2dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -34,6 +34,7 @@ AC_DEFUN([gl_FUNC_FCNTL],
34 #include <limits.h> 34 #include <limits.h>
35 #include <sys/resource.h> 35 #include <sys/resource.h>
36 #include <unistd.h> 36 #include <unistd.h>
37 ]GL_MDA_DEFINES[
37 #ifndef RLIM_SAVED_CUR 38 #ifndef RLIM_SAVED_CUR
38 # define RLIM_SAVED_CUR RLIM_INFINITY 39 # define RLIM_SAVED_CUR RLIM_INFINITY
39 #endif 40 #endif
diff --git a/m4/fdopendir.m4 b/m4/fdopendir.m4
index d9cc1a00173..9937a74ea8d 100644
--- a/m4/fdopendir.m4
+++ b/m4/fdopendir.m4
@@ -1,4 +1,4 @@
1# serial 12 1# serial 14
2# See if we need to provide fdopendir. 2# See if we need to provide fdopendir.
3 3
4dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. 4dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
@@ -25,10 +25,12 @@ AC_DEFUN([gl_FUNC_FDOPENDIR],
25 else 25 else
26 AC_CACHE_CHECK([whether fdopendir works], 26 AC_CACHE_CHECK([whether fdopendir works],
27 [gl_cv_func_fdopendir_works], 27 [gl_cv_func_fdopendir_works],
28 [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ 28 [AC_RUN_IFELSE(
29 [AC_LANG_PROGRAM([[
29#include <dirent.h> 30#include <dirent.h>
30#include <fcntl.h> 31#include <fcntl.h>
31#include <unistd.h> 32#include <unistd.h>
33]GL_MDA_DEFINES[
32#if !HAVE_DECL_FDOPENDIR 34#if !HAVE_DECL_FDOPENDIR
33extern 35extern
34# ifdef __cplusplus 36# ifdef __cplusplus
@@ -36,12 +38,14 @@ extern
36# endif 38# endif
37DIR *fdopendir (int); 39DIR *fdopendir (int);
38#endif 40#endif
39]], [int result = 0; 41]],
40 int fd = open ("conftest.c", O_RDONLY); 42 [[int result = 0;
41 if (fd < 0) result |= 1; 43 int fd = open ("conftest.c", O_RDONLY);
42 if (fdopendir (fd)) result |= 2; 44 if (fd < 0) result |= 1;
43 if (close (fd)) result |= 4; 45 if (fdopendir (fd)) result |= 2;
44 return result;])], 46 if (close (fd)) result |= 4;
47 return result;
48 ]])],
45 [gl_cv_func_fdopendir_works=yes], 49 [gl_cv_func_fdopendir_works=yes],
46 [gl_cv_func_fdopendir_works=no], 50 [gl_cv_func_fdopendir_works=no],
47 [case "$host_os" in 51 [case "$host_os" in
diff --git a/m4/fpending.m4 b/m4/fpending.m4
index ea9725e4890..edabcec5f0b 100644
--- a/m4/fpending.m4
+++ b/m4/fpending.m4
@@ -1,4 +1,4 @@
1# serial 22 1# serial 23
2 2
3# Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc. 3# Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4# This file is free software; the Free Software Foundation
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_FPENDING],
25 AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending], 25 AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending],
26 [ 26 [
27 AC_LINK_IFELSE( 27 AC_LINK_IFELSE(
28 [AC_LANG_PROGRAM([$fp_headers], 28 [AC_LANG_PROGRAM([[$fp_headers]],
29 [[return ! __fpending (stdin);]])], 29 [[return ! __fpending (stdin);]])],
30 [gl_cv_func___fpending=yes], 30 [gl_cv_func___fpending=yes],
31 [gl_cv_func___fpending=no]) 31 [gl_cv_func___fpending=no])
diff --git a/m4/futimens.m4 b/m4/futimens.m4
index dc5cfa94119..145b8ff0d51 100644
--- a/m4/futimens.m4
+++ b/m4/futimens.m4
@@ -1,4 +1,4 @@
1# serial 8 1# serial 9
2# See if we need to provide futimens replacement. 2# See if we need to provide futimens replacement.
3 3
4dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. 4dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
@@ -24,7 +24,8 @@ AC_DEFUN([gl_FUNC_FUTIMENS],
24#include <sys/stat.h> 24#include <sys/stat.h>
25#include <unistd.h> 25#include <unistd.h>
26#include <errno.h> 26#include <errno.h>
27]], [[struct timespec ts[2]; 27]GL_MDA_DEFINES],
28 [[struct timespec ts[2];
28 int fd = creat ("conftest.file", 0600); 29 int fd = creat ("conftest.file", 0600);
29 struct stat st; 30 struct stat st;
30 if (fd < 0) return 1; 31 if (fd < 0) return 1;
diff --git a/m4/getdtablesize.m4 b/m4/getdtablesize.m4
index ab2e3feb37b..af328644adb 100644
--- a/m4/getdtablesize.m4
+++ b/m4/getdtablesize.m4
@@ -1,4 +1,4 @@
1# getdtablesize.m4 serial 7 1# getdtablesize.m4 serial 8
2dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -29,13 +29,16 @@ AC_DEFUN([gl_FUNC_GETDTABLESIZE],
29 dnl correctly require setrlimit before getdtablesize() can report 29 dnl correctly require setrlimit before getdtablesize() can report
30 dnl a larger value. 30 dnl a larger value.
31 AC_RUN_IFELSE([ 31 AC_RUN_IFELSE([
32 AC_LANG_PROGRAM([[#include <unistd.h>]], 32 AC_LANG_PROGRAM(
33 [int size = getdtablesize(); 33 [[#include <unistd.h>]
34 if (dup2 (0, getdtablesize()) != -1) 34 GL_MDA_DEFINES
35 return 1; 35 ],
36 if (size != getdtablesize()) 36 [[int size = getdtablesize();
37 return 2; 37 if (dup2 (0, getdtablesize()) != -1)
38 ])], 38 return 1;
39 if (size != getdtablesize())
40 return 2;
41 ]])],
39 [gl_cv_func_getdtablesize_works=yes], 42 [gl_cv_func_getdtablesize_works=yes],
40 [gl_cv_func_getdtablesize_works=no], 43 [gl_cv_func_getdtablesize_works=no],
41 [case "$host_os" in 44 [case "$host_os" in
diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4
index 8e96965d828..9fe328efc02 100644
--- a/m4/getloadavg.m4
+++ b/m4/getloadavg.m4
@@ -7,7 +7,7 @@
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved. 8# with or without modifications, as long as this notice is preserved.
9 9
10#serial 9 10#serial 10
11 11
12# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. 12# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
13# New applications should use gl_GETLOADAVG instead. 13# New applications should use gl_GETLOADAVG instead.
@@ -147,7 +147,7 @@ fi
147AC_CHECK_HEADERS([nlist.h], 147AC_CHECK_HEADERS([nlist.h],
148[AC_CHECK_MEMBERS([struct nlist.n_un.n_name], 148[AC_CHECK_MEMBERS([struct nlist.n_un.n_name],
149 [], [], 149 [], [],
150 [@%:@include <nlist.h>]) 150 [#include <nlist.h>])
151 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]], 151 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
152 [[struct nlist x; 152 [[struct nlist x;
153 #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME 153 #ifdef HAVE_STRUCT_NLIST_N_UN_N_NAME
diff --git a/m4/getrandom.m4 b/m4/getrandom.m4
index 424c2fad3e3..d6da71a2c83 100644
--- a/m4/getrandom.m4
+++ b/m4/getrandom.m4
@@ -1,4 +1,4 @@
1# getrandom.m4 serial 7 1# getrandom.m4 serial 8
2dnl Copyright 2020 Free Software Foundation, Inc. 2dnl Copyright 2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +18,8 @@ AC_DEFUN([gl_FUNC_GETRANDOM],
18 [gl_cv_func_getrandom_ok], 18 [gl_cv_func_getrandom_ok],
19 [AC_COMPILE_IFELSE( 19 [AC_COMPILE_IFELSE(
20 [AC_LANG_PROGRAM( 20 [AC_LANG_PROGRAM(
21 [[/* Additional includes are needed before <sys/random.h> on Mac OS X. */ 21 [[/* Additional includes are needed before <sys/random.h> on uClibc
22 and Mac OS X. */
22 #include <sys/types.h> 23 #include <sys/types.h>
23 #include <stdlib.h> 24 #include <stdlib.h>
24 #include <sys/random.h> 25 #include <sys/random.h>
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 03da2287d48..33e56faa98e 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
1# gnulib-common.m4 serial 55 1# gnulib-common.m4 serial 57
2dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -480,14 +480,6 @@ AC_DEFUN([gl_FEATURES_H],
480 AC_SUBST([HAVE_FEATURES_H]) 480 AC_SUBST([HAVE_FEATURES_H])
481]) 481])
482 482
483# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
484# ----------------------------------------------------
485# Backport of autoconf-2.63b's macro.
486# Remove this macro when we can assume autoconf >= 2.64.
487m4_ifndef([AS_VAR_IF],
488[m4_define([AS_VAR_IF],
489[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
490
491# gl_PROG_CC_C99 483# gl_PROG_CC_C99
492# Modifies the value of the shell variable CC in an attempt to make $CC 484# Modifies the value of the shell variable CC in an attempt to make $CC
493# understand ISO C99 source code. 485# understand ISO C99 source code.
@@ -660,6 +652,72 @@ AC_DEFUN([gl_CACHE_VAL_SILENT],
660 as_echo_n="$saved_as_echo_n" 652 as_echo_n="$saved_as_echo_n"
661]) 653])
662 654
663# AS_VAR_COPY was added in autoconf 2.63b 655dnl Expands to some code for use in .c programs that, on native Windows, defines
664m4_define_default([AS_VAR_COPY], 656dnl the Microsoft deprecated alias function names to the underscore-prefixed
665[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) 657dnl actual function names. With this macro, these function names are available
658dnl without linking with '-loldnames' and without generating warnings.
659dnl Usage: Use it after all system header files are included.
660dnl #include <...>
661dnl #include <...>
662dnl ]GL_MDA_DEFINES[
663dnl ...
664AC_DEFUN([GL_MDA_DEFINES],[
665AC_REQUIRE([_GL_MDA_DEFINES])
666[$gl_mda_defines]
667])
668AC_DEFUN([_GL_MDA_DEFINES],
669[gl_mda_defines='
670#if defined _WIN32 && !defined __CYGWIN__
671#define access _access
672#define chdir _chdir
673#define chmod _chmod
674#define close _close
675#define creat _creat
676#define dup _dup
677#define dup2 _dup2
678#define ecvt _ecvt
679#define execl _execl
680#define execle _execle
681#define execlp _execlp
682#define execv _execv
683#define execve _execve
684#define execvp _execvp
685#define execvpe _execvpe
686#define fcloseall _fcloseall
687#define fcvt _fcvt
688#define fdopen _fdopen
689#define fileno _fileno
690#define gcvt _gcvt
691#define getcwd _getcwd
692#define getpid _getpid
693#define getw _getw
694#define isatty _isatty
695#define j0 _j0
696#define j1 _j1
697#define jn _jn
698#define lfind _lfind
699#define lsearch _lsearch
700#define lseek _lseek
701#define memccpy _memccpy
702#define mkdir _mkdir
703#define mktemp _mktemp
704#define open _open
705#define putenv _putenv
706#define putw _putw
707#define read _read
708#define rmdir _rmdir
709#define strdup _strdup
710#define swab _swab
711#define tempnam _tempnam
712#define tzset _tzset
713#define umask _umask
714#define unlink _unlink
715#define utime _utime
716#define wcsdup _wcsdup
717#define write _write
718#define y0 _y0
719#define y1 _y1
720#define yn _yn
721#endif
722'
723])
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index 9009e293b53..33601aa3b43 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,4 +1,4 @@
1# include_next.m4 serial 24 1# include_next.m4 serial 25
2dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2006-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -176,42 +176,40 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
176 [AC_CHECK_HEADERS_ONCE([$1]) 176 [AC_CHECK_HEADERS_ONCE([$1])
177 ]) 177 ])
178 178
179dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
180dnl until we can assume autoconf 2.64 or newer.
181 m4_foreach_w([gl_HEADER_NAME], [$1], 179 m4_foreach_w([gl_HEADER_NAME], [$1],
182 [AS_VAR_PUSHDEF([gl_next_header], 180 [AS_VAR_PUSHDEF([gl_next_header],
183 [gl_cv_next_]m4_defn([gl_HEADER_NAME])) 181 [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
184 if test $gl_cv_have_include_next = yes; then 182 if test $gl_cv_have_include_next = yes; then
185 AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) 183 AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
186 else 184 else
187 AC_CACHE_CHECK( 185 AC_CACHE_CHECK(
188 [absolute name of <]m4_defn([gl_HEADER_NAME])[>], 186 [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
189 m4_defn([gl_next_header]), 187 [gl_next_header],
190 [m4_if([$2], [check], 188 [m4_if([$2], [check],
191 [AS_VAR_PUSHDEF([gl_header_exists], 189 [AS_VAR_PUSHDEF([gl_header_exists],
192 [ac_cv_header_]m4_defn([gl_HEADER_NAME])) 190 [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
193 if test AS_VAR_GET(gl_header_exists) = yes; then 191 if test AS_VAR_GET([gl_header_exists]) = yes; then
194 AS_VAR_POPDEF([gl_header_exists]) 192 AS_VAR_POPDEF([gl_header_exists])
195 ]) 193 ])
196 gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) 194 gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
197 AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) 195 AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
198 AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) 196 AS_VAR_SET([gl_next_header], ['"'$gl_header'"'])
199 m4_if([$2], [check], 197 m4_if([$2], [check],
200 [else 198 [else
201 AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) 199 AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
202 fi 200 fi
203 ]) 201 ])
204 ]) 202 ])
205 fi 203 fi
206 AC_SUBST( 204 AC_SUBST(
207 AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), 205 AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
208 [AS_VAR_GET(gl_next_header)]) 206 [AS_VAR_GET([gl_next_header])])
209 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then 207 if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
210 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' 208 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
211 gl_next_as_first_directive='<'gl_HEADER_NAME'>' 209 gl_next_as_first_directive='<'gl_HEADER_NAME'>'
212 else 210 else
213 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' 211 # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
214 gl_next_as_first_directive=AS_VAR_GET(gl_next_header) 212 gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
215 fi 213 fi
216 AC_SUBST( 214 AC_SUBST(
217 AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), 215 AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index f7140dd0a3a..f4c5d3a5cea 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -30,12 +30,12 @@ m4_version_prereq([2.70], [] ,[
30# _AC_SYS_LARGEFILE_TEST_INCLUDES 30# _AC_SYS_LARGEFILE_TEST_INCLUDES
31# ------------------------------- 31# -------------------------------
32m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], 32m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
33[@%:@include <sys/types.h> 33[#include <sys/types.h>
34 /* Check that off_t can represent 2**63 - 1 correctly. 34 /* Check that off_t can represent 2**63 - 1 correctly.
35 We can't simply define LARGE_OFF_T to be 9223372036854775807, 35 We can't simply define LARGE_OFF_T to be 9223372036854775807,
36 since some C++ compilers masquerading as C compilers 36 since some C++ compilers masquerading as C compilers
37 incorrectly reject 9223372036854775807. */ 37 incorrectly reject 9223372036854775807. */
38@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) 38#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
39 int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 39 int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
40 && LARGE_OFF_T % 2147483647 == 1) 40 && LARGE_OFF_T % 2147483647 == 1)
41 ? 1 : -1]];[]dnl 41 ? 1 : -1]];[]dnl
@@ -54,7 +54,7 @@ m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
54 [AC_LANG_PROGRAM([$5], [$6])], 54 [AC_LANG_PROGRAM([$5], [$6])],
55 [$3=no; break]) 55 [$3=no; break])
56 m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( 56 m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
57 [AC_LANG_PROGRAM([@%:@define $1 $2 57 [AC_LANG_PROGRAM([#define $1 $2
58$5], [$6])], 58$5], [$6])],
59 [$3=$2; break]) 59 [$3=$2; break])
60 $3=unknown 60 $3=unknown
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index d18da048d9e..a37cd15b69a 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,4 +1,4 @@
1# manywarnings.m4 serial 20 1# manywarnings.m4 serial 21
2dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -39,8 +39,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
39[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) 39[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
40 40
41# Specialization for _AC_LANG = C. 41# Specialization for _AC_LANG = C.
42# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. 42AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
43m4_defun([gl_MANYWARN_ALL_GCC(C)],
44[ 43[
45 AC_LANG_PUSH([C]) 44 AC_LANG_PUSH([C])
46 45
@@ -210,8 +209,7 @@ m4_defun([gl_MANYWARN_ALL_GCC(C)],
210]) 209])
211 210
212# Specialization for _AC_LANG = C++. 211# Specialization for _AC_LANG = C++.
213# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. 212AC_DEFUN([gl_MANYWARN_ALL_GCC(C++)],
214m4_defun([gl_MANYWARN_ALL_GCC(C++)],
215[ 213[
216 gl_MANYWARN_ALL_GCC_CXX_IMPL([$1]) 214 gl_MANYWARN_ALL_GCC_CXX_IMPL([$1])
217]) 215])
diff --git a/m4/mktime.m4 b/m4/mktime.m4
index 8d9b827fe21..4e7e423fa54 100644
--- a/m4/mktime.m4
+++ b/m4/mktime.m4
@@ -1,4 +1,4 @@
1# serial 32 1# serial 35
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, 2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation,
3dnl Inc. 3dnl Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
@@ -31,7 +31,6 @@ AC_DEFUN([gl_FUNC_MKTIME_WORKS],
31 dnl in Autoconf and because it invokes AC_LIBOBJ. 31 dnl in Autoconf and because it invokes AC_LIBOBJ.
32 AC_CHECK_HEADERS_ONCE([unistd.h]) 32 AC_CHECK_HEADERS_ONCE([unistd.h])
33 AC_CHECK_DECLS_ONCE([alarm]) 33 AC_CHECK_DECLS_ONCE([alarm])
34 AC_CHECK_FUNCS_ONCE([tzset])
35 AC_REQUIRE([gl_MULTIARCH]) 34 AC_REQUIRE([gl_MULTIARCH])
36 AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime], 35 AC_CACHE_CHECK([for working mktime], [gl_cv_func_working_mktime],
37 [if test $APPLE_UNIVERSAL_BUILD = 1; then 36 [if test $APPLE_UNIVERSAL_BUILD = 1; then
@@ -55,13 +54,12 @@ AC_DEFUN([gl_FUNC_MKTIME_WORKS],
55# include <signal.h> 54# include <signal.h>
56#endif 55#endif
57 56
57]GL_MDA_DEFINES[
58
58#ifndef TIME_T_IS_SIGNED 59#ifndef TIME_T_IS_SIGNED
59# define TIME_T_IS_SIGNED 0 60# define TIME_T_IS_SIGNED 0
60#endif 61#endif
61 62
62/* Work around redefinition to rpl_putenv by other config tests. */
63#undef putenv
64
65static time_t time_t_max; 63static time_t time_t_max;
66static time_t time_t_min; 64static time_t time_t_min;
67 65
diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4
index 6f2762aa276..e4eb87de0b9 100644
--- a/m4/nstrftime.m4
+++ b/m4/nstrftime.m4
@@ -1,4 +1,4 @@
1# serial 35 1# serial 36
2 2
3# Copyright (C) 1996-1997, 1999-2007, 2009-2020 Free Software Foundation, Inc. 3# Copyright (C) 1996-1997, 1999-2007, 2009-2020 Free Software Foundation, Inc.
4# 4#
@@ -17,8 +17,6 @@ AC_DEFUN([gl_FUNC_GNU_STRFTIME],
17 17
18 AC_REQUIRE([gl_TM_GMTOFF]) 18 AC_REQUIRE([gl_TM_GMTOFF])
19 19
20 AC_CHECK_FUNCS_ONCE([tzset])
21
22 AC_DEFINE([my_strftime], [nstrftime], 20 AC_DEFINE([my_strftime], [nstrftime],
23 [Define to the name of the strftime replacement function.]) 21 [Define to the name of the strftime replacement function.])
24]) 22])
diff --git a/m4/open-slash.m4 b/m4/open-slash.m4
index 1e57c96960e..5d84f2b548a 100644
--- a/m4/open-slash.m4
+++ b/m4/open-slash.m4
@@ -1,4 +1,4 @@
1# open-slash.m4 serial 1 1# open-slash.m4 serial 2
2dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2007-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -25,6 +25,7 @@ AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG],
25#if HAVE_UNISTD_H 25#if HAVE_UNISTD_H
26# include <unistd.h> 26# include <unistd.h>
27#endif 27#endif
28]GL_MDA_DEFINES[
28int main () 29int main ()
29{ 30{
30 int result = 0; 31 int result = 0;
diff --git a/m4/pselect.m4 b/m4/pselect.m4
index f3e5afe0b38..08a5823c6f9 100644
--- a/m4/pselect.m4
+++ b/m4/pselect.m4
@@ -1,4 +1,4 @@
1# pselect.m4 serial 8 1# pselect.m4 serial 9
2dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,8 @@ AC_DEFUN([gl_FUNC_PSELECT],
37#endif 37#endif
38#include <unistd.h> 38#include <unistd.h>
39#include <errno.h> 39#include <errno.h>
40]],[[ 40]GL_MDA_DEFINES],
41[[
41 fd_set set; 42 fd_set set;
42 dup2(0, 16); 43 dup2(0, 16);
43 FD_ZERO(&set); 44 FD_ZERO(&set);
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index d67511f73dd..030862de015 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -1,4 +1,4 @@
1# pthread_sigmask.m4 serial 18 1# pthread_sigmask.m4 serial 19
2dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2011-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -220,6 +220,7 @@ int main ()
220#include <stdio.h> 220#include <stdio.h>
221#include <stdlib.h> 221#include <stdlib.h>
222#include <unistd.h> 222#include <unistd.h>
223]GL_MDA_DEFINES[
223static volatile int sigint_occurred; 224static volatile int sigint_occurred;
224static void 225static void
225sigint_handler (int sig) 226sigint_handler (int sig)
diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4
index a964b157841..8c5d53703be 100644
--- a/m4/sys_random_h.m4
+++ b/m4/sys_random_h.m4
@@ -1,4 +1,4 @@
1# sys_random_h.m4 serial 4 1# sys_random_h.m4 serial 5
2dnl Copyright (C) 2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -25,7 +25,8 @@ AC_DEFUN([gl_HEADER_SYS_RANDOM],
25 dnl corresponding gnulib module is not in use. 25 dnl corresponding gnulib module is not in use.
26 gl_WARN_ON_USE_PREPARE([[ 26 gl_WARN_ON_USE_PREPARE([[
27#if HAVE_SYS_RANDOM_H 27#if HAVE_SYS_RANDOM_H
28/* Additional includes are needed before <sys/random.h> on Mac OS X. */ 28/* Additional includes are needed before <sys/random.h> on uClibc
29 and Mac OS X. */
29# include <sys/types.h> 30# include <sys/types.h>
30# include <stdlib.h> 31# include <stdlib.h>
31# include <sys/random.h> 32# include <sys/random.h>
diff --git a/m4/time_h.m4 b/m4/time_h.m4
index d0f89327c4b..a15c09dc07b 100644
--- a/m4/time_h.m4
+++ b/m4/time_h.m4
@@ -121,7 +121,6 @@ AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
121 HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) 121 HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP])
122 HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) 122 HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME])
123 HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) 123 HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM])
124 HAVE_TZSET=1; AC_SUBST([HAVE_TZSET])
125 dnl Even GNU libc does not have timezone_t yet. 124 dnl Even GNU libc does not have timezone_t yet.
126 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) 125 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
127 dnl If another module says to replace or to not replace, do that. 126 dnl If another module says to replace or to not replace, do that.
diff --git a/m4/utimens.m4 b/m4/utimens.m4
index 65617ac862c..3d31085fc6d 100644
--- a/m4/utimens.m4
+++ b/m4/utimens.m4
@@ -3,7 +3,7 @@ dnl This file is free software; the Free Software Foundation
3dnl gives unlimited permission to copy and/or distribute it, 3dnl gives unlimited permission to copy and/or distribute it,
4dnl with or without modifications, as long as this notice is preserved. 4dnl with or without modifications, as long as this notice is preserved.
5 5
6dnl serial 10 6dnl serial 11
7 7
8AC_DEFUN([gl_UTIMENS], 8AC_DEFUN([gl_UTIMENS],
9[ 9[
@@ -24,7 +24,8 @@ AC_DEFUN([gl_UTIMENS],
24#include <stddef.h> 24#include <stddef.h>
25#include <sys/times.h> 25#include <sys/times.h>
26#include <fcntl.h> 26#include <fcntl.h>
27]], [[ int fd = open ("conftest.file", O_RDWR); 27]GL_MDA_DEFINES],
28 [[int fd = open ("conftest.file", O_RDWR);
28 if (fd < 0) return 1; 29 if (fd < 0) return 1;
29 if (futimesat (fd, NULL, NULL)) return 2; 30 if (futimesat (fd, NULL, NULL)) return 2;
30 ]])], 31 ]])],
diff --git a/m4/utimensat.m4 b/m4/utimensat.m4
index 2bc1bfebb5d..e9e4f26b1c1 100644
--- a/m4/utimensat.m4
+++ b/m4/utimensat.m4
@@ -1,4 +1,4 @@
1# serial 6 1# serial 7
2# See if we need to provide utimensat replacement. 2# See if we need to provide utimensat replacement.
3 3
4dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. 4dnl Copyright (C) 2009-2020 Free Software Foundation, Inc.
@@ -23,7 +23,8 @@ AC_DEFUN([gl_FUNC_UTIMENSAT],
23#include <fcntl.h> 23#include <fcntl.h>
24#include <sys/stat.h> 24#include <sys/stat.h>
25#include <unistd.h> 25#include <unistd.h>
26]], [[int result = 0; 26]GL_MDA_DEFINES],
27 [[int result = 0;
27 const char *f = "conftest.file"; 28 const char *f = "conftest.file";
28 if (close (creat (f, 0600))) 29 if (close (creat (f, 0600)))
29 return 1; 30 return 1;
diff --git a/m4/utimes.m4 b/m4/utimes.m4
index e1056bbba4e..877bfd2a735 100644
--- a/m4/utimes.m4
+++ b/m4/utimes.m4
@@ -1,5 +1,5 @@
1# Detect some bugs in glibc's implementation of utimes. 1# Detect some bugs in glibc's implementation of utimes.
2# serial 7 2# serial 8
3 3
4dnl Copyright (C) 2003-2005, 2009-2020 Free Software Foundation, Inc. 4dnl Copyright (C) 2003-2005, 2009-2020 Free Software Foundation, Inc.
5dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
@@ -34,6 +34,7 @@ AC_DEFUN([gl_FUNC_UTIMES],
34#include <stdio.h> 34#include <stdio.h>
35#include <utime.h> 35#include <utime.h>
36#include <errno.h> 36#include <errno.h>
37]GL_MDA_DEFINES[
37 38
38static int 39static int
39inorder (time_t a, time_t b, time_t c) 40inorder (time_t a, time_t b, time_t c)
diff --git a/m4/warnings.m4 b/m4/warnings.m4
index d272365f0a1..d4e4b073453 100644
--- a/m4/warnings.m4
+++ b/m4/warnings.m4
@@ -1,4 +1,4 @@
1# warnings.m4 serial 14 1# warnings.m4 serial 16
2dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. 2dnl Copyright (C) 2008-2020 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
@@ -23,8 +23,6 @@ m4_ifdef([AS_VAR_APPEND],
23# The effects of this macro depend on the current language (_AC_LANG). 23# The effects of this macro depend on the current language (_AC_LANG).
24AC_DEFUN([gl_COMPILER_OPTION_IF], 24AC_DEFUN([gl_COMPILER_OPTION_IF],
25[ 25[
26dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf
27dnl 2.64 or newer.
28AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl 26AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
29AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl 27AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
30AS_LITERAL_IF([$1], 28AS_LITERAL_IF([$1],
@@ -34,13 +32,13 @@ case $gl_positive in
34 -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; 32 -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
35esac 33esac
36m4_pushdef([gl_Positive], [$gl_positive])])dnl 34m4_pushdef([gl_Positive], [$gl_positive])])dnl
37AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ 35AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [
38 gl_save_compiler_FLAGS="$gl_Flags" 36 gl_save_compiler_FLAGS="$gl_Flags"
39 gl_AS_VAR_APPEND(m4_defn([gl_Flags]), 37 gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
40 [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) 38 [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
41 AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], 39 AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])],
42 [AS_VAR_SET(gl_Warn, [yes])], 40 [AS_VAR_SET([gl_Warn], [yes])],
43 [AS_VAR_SET(gl_Warn, [no])]) 41 [AS_VAR_SET([gl_Warn], [no])])
44 gl_Flags="$gl_save_compiler_FLAGS" 42 gl_Flags="$gl_save_compiler_FLAGS"
45]) 43])
46AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) 44AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
@@ -59,8 +57,7 @@ AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
59[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) 57[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
60 58
61# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd. 59# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd.
62# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. 60AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
63m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
64[ 61[
65 AC_LANG_PUSH([C]) 62 AC_LANG_PUSH([C])
66 gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL 63 gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
@@ -68,8 +65,7 @@ m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
68]) 65])
69 66
70# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd. 67# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd.
71# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. 68AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
72m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
73[ 69[
74 AC_LANG_PUSH([C++]) 70 AC_LANG_PUSH([C++])
75 gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL 71 gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
@@ -77,8 +73,7 @@ m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
77]) 73])
78 74
79# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. 75# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd.
80# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. 76AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)],
81m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)],
82[ 77[
83 AC_LANG_PUSH([Objective C]) 78 AC_LANG_PUSH([Objective C])
84 gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL 79 gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
diff --git a/src/Makefile.in b/src/Makefile.in
index 63a4aa80e93..31a5a7e7709 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -587,7 +587,7 @@ endif
587ifeq ($(DUMPING),pdumper) 587ifeq ($(DUMPING),pdumper)
588$(pdmp): emacs$(EXEEXT) 588$(pdmp): emacs$(EXEEXT)
589 LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump \ 589 LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=pdump \
590 --bin-dest $(BIN_DESTDIR) --lisp-dest $(LISP_DESTDIR) 590 --bin-dest $(BIN_DESTDIR) --eln-dest $(ELN_DESTDIR)
591 cp -f $@ $(bootstrap_pdmp) 591 cp -f $@ $(bootstrap_pdmp)
592endif 592endif
593 593
@@ -790,10 +790,6 @@ tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
790 @$(MAKE) $(AM_V_NO_PD) -C ../lisp EMACS="$(bootstrap_exe)"\ 790 @$(MAKE) $(AM_V_NO_PD) -C ../lisp EMACS="$(bootstrap_exe)"\
791 THEFILE=$< $<c 791 THEFILE=$< $<c
792 792
793%.eln: %.el | bootstrap-emacs$(EXEEXT) $(bootstrap_pdmp)
794 @$(MAKE) $(AM_V_NO_PD) -C ../lisp EMACS="$(bootstrap_exe)"\
795 THEFILE=$< $<n
796
797## VCSWITNESS points to the file that holds info about the current checkout. 793## VCSWITNESS points to the file that holds info about the current checkout.
798## We use it as a heuristic to decide when to rebuild loaddefs.el. 794## We use it as a heuristic to decide when to rebuild loaddefs.el.
799## If empty it is ignored; the parent makefile can set it to some other value. 795## If empty it is ignored; the parent makefile can set it to some other value.
diff --git a/src/ccl.c b/src/ccl.c
index ef059ffff25..86debeef0e5 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1142,19 +1142,52 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1142 ccl_expr_self: 1142 ccl_expr_self:
1143 switch (op) 1143 switch (op)
1144 { 1144 {
1145 case CCL_PLUS: reg[rrr] += i; break; 1145 case CCL_PLUS: INT_ADD_WRAPV (reg[rrr], i, &reg[rrr]); break;
1146 case CCL_MINUS: reg[rrr] -= i; break; 1146 case CCL_MINUS: INT_SUBTRACT_WRAPV (reg[rrr], i, &reg[rrr]); break;
1147 case CCL_MUL: reg[rrr] *= i; break; 1147 case CCL_MUL: INT_MULTIPLY_WRAPV (reg[rrr], i, &reg[rrr]); break;
1148 case CCL_DIV: reg[rrr] /= i; break; 1148 case CCL_DIV:
1149 if (!i)
1150 CCL_INVALID_CMD;
1151 if (!INT_DIVIDE_OVERFLOW (reg[rrr], i))
1152 reg[rrr] /= i;
1153 break;
1149 case CCL_MOD: reg[rrr] %= i; break; 1154 case CCL_MOD: reg[rrr] %= i; break;
1155 if (!i)
1156 CCL_INVALID_CMD;
1157 reg[rrr] = i == -1 ? 0 : reg[rrr] % i;
1158 break;
1150 case CCL_AND: reg[rrr] &= i; break; 1159 case CCL_AND: reg[rrr] &= i; break;
1151 case CCL_OR: reg[rrr] |= i; break; 1160 case CCL_OR: reg[rrr] |= i; break;
1152 case CCL_XOR: reg[rrr] ^= i; break; 1161 case CCL_XOR: reg[rrr] ^= i; break;
1153 case CCL_LSH: reg[rrr] <<= i; break; 1162 case CCL_LSH:
1154 case CCL_RSH: reg[rrr] >>= i; break; 1163 if (i < 0)
1155 case CCL_LSH8: reg[rrr] <<= 8; reg[rrr] |= i; break; 1164 CCL_INVALID_CMD;
1165 reg[rrr] = i < UINT_WIDTH ? (unsigned) reg[rrr] << i : 0;
1166 break;
1167 case CCL_RSH:
1168 if (i < 0)
1169 CCL_INVALID_CMD;
1170 reg[rrr] = reg[rrr] >> min (i, INT_WIDTH - 1);
1171 break;
1172 case CCL_LSH8:
1173 reg[rrr] = (unsigned) reg[rrr] << 8;
1174 reg[rrr] |= i;
1175 break;
1156 case CCL_RSH8: reg[7] = reg[rrr] & 0xFF; reg[rrr] >>= 8; break; 1176 case CCL_RSH8: reg[7] = reg[rrr] & 0xFF; reg[rrr] >>= 8; break;
1157 case CCL_DIVMOD: reg[7] = reg[rrr] % i; reg[rrr] /= i; break; 1177 case CCL_DIVMOD:
1178 if (!i)
1179 CCL_INVALID_CMD;
1180 if (i == -1)
1181 {
1182 reg[7] = 0;
1183 INT_SUBTRACT_WRAPV (0, reg[rrr], &reg[rrr]);
1184 }
1185 else
1186 {
1187 reg[7] = reg[rrr] % i;
1188 reg[rrr] /= i;
1189 }
1190 break;
1158 case CCL_LS: reg[rrr] = reg[rrr] < i; break; 1191 case CCL_LS: reg[rrr] = reg[rrr] < i; break;
1159 case CCL_GT: reg[rrr] = reg[rrr] > i; break; 1192 case CCL_GT: reg[rrr] = reg[rrr] > i; break;
1160 case CCL_EQ: reg[rrr] = reg[rrr] == i; break; 1193 case CCL_EQ: reg[rrr] = reg[rrr] == i; break;
@@ -1204,19 +1237,52 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1204 ccl_set_expr: 1237 ccl_set_expr:
1205 switch (op) 1238 switch (op)
1206 { 1239 {
1207 case CCL_PLUS: reg[rrr] = i + j; break; 1240 case CCL_PLUS: INT_ADD_WRAPV (i, j, &reg[rrr]); break;
1208 case CCL_MINUS: reg[rrr] = i - j; break; 1241 case CCL_MINUS: INT_SUBTRACT_WRAPV (i, j, &reg[rrr]); break;
1209 case CCL_MUL: reg[rrr] = i * j; break; 1242 case CCL_MUL: INT_MULTIPLY_WRAPV (i, j, &reg[rrr]); break;
1210 case CCL_DIV: reg[rrr] = i / j; break; 1243 case CCL_DIV:
1211 case CCL_MOD: reg[rrr] = i % j; break; 1244 if (!j)
1245 CCL_INVALID_CMD;
1246 if (!INT_DIVIDE_OVERFLOW (i, j))
1247 i /= j;
1248 reg[rrr] = i;
1249 break;
1250 case CCL_MOD:
1251 if (!j)
1252 CCL_INVALID_CMD;
1253 reg[rrr] = j == -1 ? 0 : i % j;
1254 break;
1212 case CCL_AND: reg[rrr] = i & j; break; 1255 case CCL_AND: reg[rrr] = i & j; break;
1213 case CCL_OR: reg[rrr] = i | j; break; 1256 case CCL_OR: reg[rrr] = i | j; break;
1214 case CCL_XOR: reg[rrr] = i ^ j; break; 1257 case CCL_XOR: reg[rrr] = i ^ j; break;
1215 case CCL_LSH: reg[rrr] = i << j; break; 1258 case CCL_LSH:
1216 case CCL_RSH: reg[rrr] = i >> j; break; 1259 if (j < 0)
1217 case CCL_LSH8: reg[rrr] = (i << 8) | j; break; 1260 CCL_INVALID_CMD;
1261 reg[rrr] = j < UINT_WIDTH ? (unsigned) i << j : 0;
1262 break;
1263 case CCL_RSH:
1264 if (j < 0)
1265 CCL_INVALID_CMD;
1266 reg[rrr] = i >> min (j, INT_WIDTH - 1);
1267 break;
1268 case CCL_LSH8:
1269 reg[rrr] = ((unsigned) i << 8) | j;
1270 break;
1218 case CCL_RSH8: reg[rrr] = i >> 8; reg[7] = i & 0xFF; break; 1271 case CCL_RSH8: reg[rrr] = i >> 8; reg[7] = i & 0xFF; break;
1219 case CCL_DIVMOD: reg[rrr] = i / j; reg[7] = i % j; break; 1272 case CCL_DIVMOD:
1273 if (!j)
1274 CCL_INVALID_CMD;
1275 if (j == -1)
1276 {
1277 INT_SUBTRACT_WRAPV (0, reg[rrr], &reg[rrr]);
1278 reg[7] = 0;
1279 }
1280 else
1281 {
1282 reg[rrr] = i / j;
1283 reg[7] = i % j;
1284 }
1285 break;
1220 case CCL_LS: reg[rrr] = i < j; break; 1286 case CCL_LS: reg[rrr] = i < j; break;
1221 case CCL_GT: reg[rrr] = i > j; break; 1287 case CCL_GT: reg[rrr] = i > j; break;
1222 case CCL_EQ: reg[rrr] = i == j; break; 1288 case CCL_EQ: reg[rrr] = i == j; break;
@@ -1225,7 +1291,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1225 case CCL_NE: reg[rrr] = i != j; break; 1291 case CCL_NE: reg[rrr] = i != j; break;
1226 case CCL_DECODE_SJIS: 1292 case CCL_DECODE_SJIS:
1227 { 1293 {
1228 i = (i << 8) | j; 1294 i = ((unsigned) i << 8) | j;
1229 SJIS_TO_JIS (i); 1295 SJIS_TO_JIS (i);
1230 reg[rrr] = i >> 8; 1296 reg[rrr] = i >> 8;
1231 reg[7] = i & 0xFF; 1297 reg[7] = i & 0xFF;
@@ -1233,7 +1299,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1233 } 1299 }
1234 case CCL_ENCODE_SJIS: 1300 case CCL_ENCODE_SJIS:
1235 { 1301 {
1236 i = (i << 8) | j; 1302 i = ((unsigned) i << 8) | j;
1237 JIS_TO_SJIS (i); 1303 JIS_TO_SJIS (i);
1238 reg[rrr] = i >> 8; 1304 reg[rrr] = i >> 8;
1239 reg[7] = i & 0xFF; 1305 reg[7] = i & 0xFF;
@@ -2219,15 +2285,8 @@ Return index number of the registered CCL program. */)
2219 /* Extend the table. */ 2285 /* Extend the table. */
2220 Vccl_program_table = larger_vector (Vccl_program_table, 1, -1); 2286 Vccl_program_table = larger_vector (Vccl_program_table, 1, -1);
2221 2287
2222 { 2288 ASET (Vccl_program_table, idx,
2223 Lisp_Object elt = make_uninit_vector (4); 2289 CALLN (Fvector, name, ccl_prog, resolved, Qt));
2224
2225 ASET (elt, 0, name);
2226 ASET (elt, 1, ccl_prog);
2227 ASET (elt, 2, resolved);
2228 ASET (elt, 3, Qt);
2229 ASET (Vccl_program_table, idx, elt);
2230 }
2231 2290
2232 Fput (name, Qccl_program_idx, make_fixnum (idx)); 2291 Fput (name, Qccl_program_idx, make_fixnum (idx));
2233 return make_fixnum (idx); 2292 return make_fixnum (idx);
diff --git a/src/charset.c b/src/charset.c
index 8635aad3ed6..520dd3a9605 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1035,12 +1035,9 @@ usage: (define-charset-internal ...) */)
1035 CHECK_FIXNAT (parent_max_code); 1035 CHECK_FIXNAT (parent_max_code);
1036 parent_code_offset = Fnth (make_fixnum (3), val); 1036 parent_code_offset = Fnth (make_fixnum (3), val);
1037 CHECK_FIXNUM (parent_code_offset); 1037 CHECK_FIXNUM (parent_code_offset);
1038 val = make_uninit_vector (4); 1038 ASET (attrs, charset_subset,
1039 ASET (val, 0, make_fixnum (parent_charset->id)); 1039 CALLN (Fvector, make_fixnum (parent_charset->id),
1040 ASET (val, 1, parent_min_code); 1040 parent_min_code, parent_max_code, parent_code_offset));
1041 ASET (val, 2, parent_max_code);
1042 ASET (val, 3, parent_code_offset);
1043 ASET (attrs, charset_subset, val);
1044 1041
1045 charset.method = CHARSET_METHOD_SUBSET; 1042 charset.method = CHARSET_METHOD_SUBSET;
1046 /* Here, we just copy the parent's fast_map. It's not accurate, 1043 /* Here, we just copy the parent's fast_map. It's not accurate,
diff --git a/src/coding.c b/src/coding.c
index 071124b4ef1..51bd441de9d 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -10856,20 +10856,17 @@ HIGHESTP non-nil means just return the highest priority one. */)
10856 return Fnreverse (val); 10856 return Fnreverse (val);
10857} 10857}
10858 10858
10859static const char *const suffixes[] = { "-unix", "-dos", "-mac" };
10860
10861static Lisp_Object 10859static Lisp_Object
10862make_subsidiaries (Lisp_Object base) 10860make_subsidiaries (Lisp_Object base)
10863{ 10861{
10864 Lisp_Object subsidiaries; 10862 static char const suffixes[][8] = { "-unix", "-dos", "-mac" };
10865 ptrdiff_t base_name_len = SBYTES (SYMBOL_NAME (base)); 10863 ptrdiff_t base_name_len = SBYTES (SYMBOL_NAME (base));
10866 USE_SAFE_ALLOCA; 10864 USE_SAFE_ALLOCA;
10867 char *buf = SAFE_ALLOCA (base_name_len + 6); 10865 char *buf = SAFE_ALLOCA (base_name_len + 6);
10868 int i;
10869 10866
10870 memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len); 10867 memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len);
10871 subsidiaries = make_uninit_vector (3); 10868 Lisp_Object subsidiaries = make_nil_vector (3);
10872 for (i = 0; i < 3; i++) 10869 for (int i = 0; i < 3; i++)
10873 { 10870 {
10874 strcpy (buf + base_name_len, suffixes[i]); 10871 strcpy (buf + base_name_len, suffixes[i]);
10875 ASET (subsidiaries, i, intern (buf)); 10872 ASET (subsidiaries, i, intern (buf));
@@ -11829,8 +11826,7 @@ Each element is one element list of coding system name.
11829This variable is given to `completing-read' as COLLECTION argument. 11826This variable is given to `completing-read' as COLLECTION argument.
11830 11827
11831Do not alter the value of this variable manually. This variable should be 11828Do not alter the value of this variable manually. This variable should be
11832updated by the functions `make-coding-system' and 11829updated by `define-coding-system-alias'. */);
11833`define-coding-system-alias'. */);
11834 Vcoding_system_alist = Qnil; 11830 Vcoding_system_alist = Qnil;
11835 11831
11836 DEFVAR_LISP ("coding-category-list", Vcoding_category_list, 11832 DEFVAR_LISP ("coding-category-list", Vcoding_category_list,
diff --git a/src/comp.c b/src/comp.c
index 704bd4b6b35..ff73245b8de 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -29,6 +29,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
29#include <stdio.h> 29#include <stdio.h>
30#include <signal.h> 30#include <signal.h>
31#include <libgccjit.h> 31#include <libgccjit.h>
32#include <epaths.h>
32 33
33#include "puresize.h" 34#include "puresize.h"
34#include "window.h" 35#include "window.h"
@@ -393,6 +394,8 @@ load_gccjit_if_necessary (bool mandatory)
393} 394}
394 395
395 396
397#define ELN_FILENAME_HASH_LEN 64
398
396/* C symbols emitted for the load relocation mechanism. */ 399/* C symbols emitted for the load relocation mechanism. */
397#define CURRENT_THREAD_RELOC_SYM "current_thread_reloc" 400#define CURRENT_THREAD_RELOC_SYM "current_thread_reloc"
398#define PURE_RELOC_SYM "pure_reloc" 401#define PURE_RELOC_SYM "pure_reloc"
@@ -634,6 +637,16 @@ format_string (const char *format, ...)
634 return scratch_area; 637 return scratch_area;
635} 638}
636 639
640static Lisp_Object
641comp_hash_string (Lisp_Object string)
642{
643 Lisp_Object digest = make_uninit_string (SHA512_DIGEST_SIZE * 2);
644 sha512_buffer (SSDATA (string), SCHARS (string), SSDATA (digest));
645 hexbuf_digest (SSDATA (digest), SDATA (digest), SHA512_DIGEST_SIZE);
646
647 return digest;
648}
649
637/* Produce a key hashing Vcomp_subr_list. */ 650/* Produce a key hashing Vcomp_subr_list. */
638 651
639void 652void
@@ -641,10 +654,7 @@ hash_native_abi (void)
641{ 654{
642 Lisp_Object string = Fmapconcat (intern_c_string ("subr-name"), 655 Lisp_Object string = Fmapconcat (intern_c_string ("subr-name"),
643 Vcomp_subr_list, build_string (" ")); 656 Vcomp_subr_list, build_string (" "));
644 Lisp_Object digest = make_uninit_string (SHA512_DIGEST_SIZE * 2); 657 Lisp_Object digest = comp_hash_string (string);
645
646 sha512_buffer (SSDATA (string), SCHARS (string), SSDATA (digest));
647 hexbuf_digest (SSDATA (digest), SDATA (digest), SHA512_DIGEST_SIZE);
648 658
649 /* Check runs once. */ 659 /* Check runs once. */
650 eassert (NILP (Vcomp_abi_hash)); 660 eassert (NILP (Vcomp_abi_hash));
@@ -652,8 +662,7 @@ hash_native_abi (void)
652 /* If 10 characters are usually sufficient for git I guess 16 are 662 /* If 10 characters are usually sufficient for git I guess 16 are
653 fine for us here. */ 663 fine for us here. */
654 Vcomp_native_path_postfix = 664 Vcomp_native_path_postfix =
655 concat3 (make_string ("eln-", 4), 665 concat2 (Vsystem_configuration,
656 Vsystem_configuration,
657 concat2 (make_string ("-", 1), 666 concat2 (make_string ("-", 1),
658 Fsubstring_no_properties (Vcomp_abi_hash, 667 Fsubstring_no_properties (Vcomp_abi_hash,
659 make_fixnum (0), 668 make_fixnum (0),
@@ -3852,6 +3861,71 @@ compile_function (Lisp_Object func)
3852/* Entry points exposed to lisp. */ 3861/* Entry points exposed to lisp. */
3853/**********************************/ 3862/**********************************/
3854 3863
3864/* In use by Fcomp_el_to_eln_filename. */
3865static Lisp_Object loadsearch_re_list;
3866
3867DEFUN ("comp-el-to-eln-filename", Fcomp_el_to_eln_filename,
3868 Scomp_el_to_eln_filename, 1, 2, 0,
3869 doc: /* Given a source file return the corresponding .eln true filename.
3870If BASE-DIR is nil use the first entry in `comp-eln-load-path'. */)
3871 (Lisp_Object filename, Lisp_Object base_dir)
3872{
3873 CHECK_STRING (filename);
3874
3875 if (suffix_p (filename, ".gz"))
3876 filename = Fsubstring (filename, Qnil, make_fixnum (-3));
3877 filename = Fexpand_file_name (filename, Qnil);
3878
3879 /* We create eln filenames with an hash in order to look-up these
3880 starting from the source filename, IOW have a relation
3881 /absolute/path/filename.el -> eln-cache/filename-hash.eln.
3882
3883 As installing .eln files compiled during the build changes their
3884 absolute path we need an hashing mechanism that is not sensitive
3885 to that. For this we replace if match PATH_DUMPLOADSEARCH or
3886 PATH_LOADSEARCH with '//' before generating the hash.
3887
3888 Another approach would be to hash using the source file content
3889 but this may have a measurable performance impact. */
3890
3891 if (NILP (loadsearch_re_list))
3892 {
3893 Lisp_Object loadsearch_list =
3894 Fcons (build_string (PATH_DUMPLOADSEARCH),
3895 Fcons (build_string (PATH_LOADSEARCH), Qnil));
3896 FOR_EACH_TAIL (loadsearch_list)
3897 loadsearch_re_list =
3898 Fcons (Fregexp_quote (XCAR (loadsearch_list)), loadsearch_re_list);
3899 }
3900 Lisp_Object loadsearch_res = loadsearch_re_list;
3901 FOR_EACH_TAIL (loadsearch_res)
3902 {
3903 Lisp_Object match_idx =
3904 Fstring_match (XCAR (loadsearch_res), filename, Qnil);
3905 if (EQ (match_idx, make_fixnum (0)))
3906 {
3907 filename =
3908 Freplace_match (build_string ("//"), Qt, Qt, filename, Qnil);
3909 break;
3910 }
3911 }
3912
3913 Lisp_Object hash = Fsubstring (comp_hash_string (filename), Qnil,
3914 make_fixnum (ELN_FILENAME_HASH_LEN));
3915 filename = concat2 (Ffile_name_nondirectory (Fsubstring (filename, Qnil,
3916 make_fixnum (-3))),
3917 build_string ("-"));
3918 filename = concat3 (filename, hash, build_string (NATIVE_ELISP_SUFFIX));
3919 if (NILP (base_dir))
3920 base_dir = XCAR (Vcomp_eln_load_path);
3921
3922 if (!file_name_absolute_p (SSDATA (base_dir)))
3923 base_dir = Fexpand_file_name (base_dir, Vinvocation_directory);
3924
3925 return Fexpand_file_name (filename,
3926 concat2 (base_dir, Vcomp_native_path_postfix));
3927}
3928
3855DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt, 3929DEFUN ("comp--init-ctxt", Fcomp__init_ctxt, Scomp__init_ctxt,
3856 0, 0, 0, 3930 0, 0, 0,
3857 doc: /* Initialize the native compiler context. Return t on success. */) 3931 doc: /* Initialize the native compiler context. Return t on success. */)
@@ -4039,11 +4113,12 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
4039 Scomp__compile_ctxt_to_file, 4113 Scomp__compile_ctxt_to_file,
4040 1, 1, 0, 4114 1, 1, 0,
4041 doc: /* Compile as native code the current context to file. */) 4115 doc: /* Compile as native code the current context to file. */)
4042 (Lisp_Object base_name) 4116 (Lisp_Object file_name)
4043{ 4117{
4044 load_gccjit_if_necessary (true); 4118 load_gccjit_if_necessary (true);
4045 4119
4046 CHECK_STRING (base_name); 4120 CHECK_STRING (file_name);
4121 Lisp_Object base_name = Fsubstring (file_name, Qnil, make_fixnum (-4));
4047 4122
4048 gcc_jit_context_set_int_option (comp.ctxt, 4123 gcc_jit_context_set_int_option (comp.ctxt,
4049 GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL, 4124 GCC_JIT_INT_OPTION_OPTIMIZATION_LEVEL,
@@ -4105,19 +4180,18 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file,
4105 4180
4106 AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX); 4181 AUTO_STRING (dot_so, NATIVE_ELISP_SUFFIX);
4107 4182
4108 Lisp_Object out_file = CALLN (Fconcat, base_name, dot_so);
4109 Lisp_Object tmp_file = 4183 Lisp_Object tmp_file =
4110 Fmake_temp_file_internal (base_name, Qnil, dot_so, Qnil); 4184 Fmake_temp_file_internal (base_name, Qnil, dot_so, Qnil);
4111 gcc_jit_context_compile_to_file (comp.ctxt, 4185 gcc_jit_context_compile_to_file (comp.ctxt,
4112 GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY, 4186 GCC_JIT_OUTPUT_KIND_DYNAMIC_LIBRARY,
4113 SSDATA (tmp_file)); 4187 SSDATA (tmp_file));
4114 4188
4115 CALL2I (comp--replace-output-file, out_file, tmp_file); 4189 CALL2I (comp--replace-output-file, file_name, tmp_file);
4116 4190
4117 if (!noninteractive) 4191 if (!noninteractive)
4118 unbind_to (count, Qnil); 4192 unbind_to (count, Qnil);
4119 4193
4120 return out_file; 4194 return file_name;
4121} 4195}
4122 4196
4123DEFUN ("comp-libgccjit-version", Fcomp_libgccjit_version, 4197DEFUN ("comp-libgccjit-version", Fcomp_libgccjit_version,
@@ -4462,7 +4536,11 @@ maybe_defer_native_compilation (Lisp_Object function_name,
4462 concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name), 4536 concat2 (CALL1I (file-name-sans-extension, Vload_true_file_name),
4463 build_pure_c_string (".el")); 4537 build_pure_c_string (".el"));
4464 if (NILP (Ffile_exists_p (src))) 4538 if (NILP (Ffile_exists_p (src)))
4465 return; 4539 {
4540 src = concat2 (src, build_pure_c_string (".gz"));
4541 if (NILP (Ffile_exists_p (src)))
4542 return;
4543 }
4466 4544
4467 /* This is to have deferred compilaiton able to compile comp 4545 /* This is to have deferred compilaiton able to compile comp
4468 dependecies breaking circularity. */ 4546 dependecies breaking circularity. */
@@ -4497,6 +4575,27 @@ maybe_defer_native_compilation (Lisp_Object function_name,
4497/* Functions used to load eln files. */ 4575/* Functions used to load eln files. */
4498/**************************************/ 4576/**************************************/
4499 4577
4578/* Fixup the system eln-cache dir. This is the last entry in
4579 `comp-eln-load-path'. */
4580void
4581fixup_eln_load_path (Lisp_Object directory)
4582{
4583 Lisp_Object last_cell = Qnil;
4584 Lisp_Object tmp = Vcomp_eln_load_path;
4585 FOR_EACH_TAIL (tmp)
4586 if (CONSP (tmp))
4587 last_cell = tmp;
4588
4589 Lisp_Object eln_cache_sys =
4590 Ffile_name_directory (concat2 (Vinvocation_directory,
4591 directory));
4592 /* One directory up... */
4593 eln_cache_sys =
4594 Ffile_name_directory (Fsubstring (eln_cache_sys, Qnil,
4595 make_fixnum (-1)));
4596 Fsetcar (last_cell, eln_cache_sys);
4597}
4598
4500typedef char *(*comp_lit_str_func) (void); 4599typedef char *(*comp_lit_str_func) (void);
4501 4600
4502/* Deserialize read and return static object. */ 4601/* Deserialize read and return static object. */
@@ -4869,7 +4968,13 @@ syms_of_comp (void)
4869#ifdef HAVE_NATIVE_COMP 4968#ifdef HAVE_NATIVE_COMP
4870 /* Compiler control customizes. */ 4969 /* Compiler control customizes. */
4871 DEFVAR_BOOL ("comp-deferred-compilation", comp_deferred_compilation, 4970 DEFVAR_BOOL ("comp-deferred-compilation", comp_deferred_compilation,
4872 doc: /* If t compile asyncronously every .elc file loaded. */); 4971 doc: /* If non-nil compile asyncronously all .elc files
4972being loaded.
4973
4974Once compilation happened each function definition is updated to the
4975native compiled one. */);
4976 comp_deferred_compilation = true;
4977
4873 DEFSYM (Qcomp_speed, "comp-speed"); 4978 DEFSYM (Qcomp_speed, "comp-speed");
4874 DEFSYM (Qcomp_debug, "comp-debug"); 4979 DEFSYM (Qcomp_debug, "comp-debug");
4875 4980
@@ -4971,6 +5076,7 @@ syms_of_comp (void)
4971 build_pure_c_string ("eln file inconsistent with current runtime " 5076 build_pure_c_string ("eln file inconsistent with current runtime "
4972 "configuration, please recompile")); 5077 "configuration, please recompile"));
4973 5078
5079 defsubr (&Scomp_el_to_eln_filename);
4974 defsubr (&Scomp__init_ctxt); 5080 defsubr (&Scomp__init_ctxt);
4975 defsubr (&Scomp__release_ctxt); 5081 defsubr (&Scomp__release_ctxt);
4976 defsubr (&Scomp__compile_ctxt_to_file); 5082 defsubr (&Scomp__compile_ctxt_to_file);
@@ -4989,6 +5095,8 @@ syms_of_comp (void)
4989 comp.emitter_dispatcher = Qnil; 5095 comp.emitter_dispatcher = Qnil;
4990 staticpro (&delayed_sources); 5096 staticpro (&delayed_sources);
4991 delayed_sources = Qnil; 5097 delayed_sources = Qnil;
5098 staticpro (&loadsearch_re_list);
5099 loadsearch_re_list = Qnil;
4992 5100
4993#ifdef WINDOWSNT 5101#ifdef WINDOWSNT
4994 staticpro (&all_loaded_comp_units_h); 5102 staticpro (&all_loaded_comp_units_h);
@@ -5015,6 +5123,22 @@ syms_of_comp (void)
5015 internal use during */); 5123 internal use during */);
5016 Vcomp_deferred_pending_h = CALLN (Fmake_hash_table, QCtest, Qeq); 5124 Vcomp_deferred_pending_h = CALLN (Fmake_hash_table, QCtest, Qeq);
5017 5125
5126 DEFVAR_LISP ("comp-eln-to-el-h", Vcomp_eln_to_el_h,
5127 doc: /* Hash table eln-filename -> el-filename. */);
5128 Vcomp_eln_to_el_h = CALLN (Fmake_hash_table, QCtest, Qequal);
5129
5130 DEFVAR_LISP ("comp-eln-load-path", Vcomp_eln_load_path,
5131 doc: /* List of eln cache directories.
5132
5133If a directory is non absolute is assumed to be relative to
5134`invocation-directory'.
5135The last directory of this list is assumed to be the system one. */);
5136
5137 /* Temporary value in use for boostrap. We can't do better as
5138 `invocation-directory' is still unset, will be fixed up during
5139 dump reload. */
5140 Vcomp_eln_load_path = Fcons (build_string ("../eln-cache/"), Qnil);
5141
5018#endif /* #ifdef HAVE_NATIVE_COMP */ 5142#endif /* #ifdef HAVE_NATIVE_COMP */
5019 5143
5020 defsubr (&Snative_comp_available_p); 5144 defsubr (&Snative_comp_available_p);
diff --git a/src/comp.h b/src/comp.h
index 687e426b1ef..9270f8bf664 100644
--- a/src/comp.h
+++ b/src/comp.h
@@ -101,6 +101,8 @@ extern void dispose_all_remaining_comp_units (void);
101 101
102extern void clean_package_user_dir_of_old_comp_units (void); 102extern void clean_package_user_dir_of_old_comp_units (void);
103 103
104extern void fixup_eln_load_path (Lisp_Object directory);
105
104#else /* #ifdef HAVE_NATIVE_COMP */ 106#else /* #ifdef HAVE_NATIVE_COMP */
105 107
106static inline void 108static inline void
diff --git a/src/composite.c b/src/composite.c
index ec2b8328f78..984e0d9cda8 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1258,7 +1258,7 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
1258 is backward in the buffer, which can only happen if the 1258 is backward in the buffer, which can only happen if the
1259 display routines were called to perform the bidi 1259 display routines were called to perform the bidi
1260 reordering. But it doesn't harm to test for that, and 1260 reordering. But it doesn't harm to test for that, and
1261 avoid someon raising their brows and thinking it's a 1261 avoid someone raising their brows and thinking it's a
1262 subtle bug... */ 1262 subtle bug... */
1263 if (bidi_level < 0) 1263 if (bidi_level < 0)
1264 direction = Qnil; 1264 direction = Qnil;
@@ -1939,7 +1939,7 @@ syms_of_composite (void)
1939 staticpro (&gstring_hash_table); 1939 staticpro (&gstring_hash_table);
1940 1940
1941 staticpro (&gstring_work_headers); 1941 staticpro (&gstring_work_headers);
1942 gstring_work_headers = make_uninit_vector (8); 1942 gstring_work_headers = make_nil_vector (8);
1943 for (i = 0; i < 8; i++) 1943 for (i = 0; i < 8; i++)
1944 ASET (gstring_work_headers, i, make_nil_vector (i + 2)); 1944 ASET (gstring_work_headers, i, make_nil_vector (i + 2));
1945 staticpro (&gstring_work); 1945 staticpro (&gstring_work);
diff --git a/src/emacs.c b/src/emacs.c
index 288ddb47bd7..8e52da75926 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -1643,23 +1643,27 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1643 { 1643 {
1644#ifdef NS_IMPL_COCOA 1644#ifdef NS_IMPL_COCOA
1645 /* Started from GUI? */ 1645 /* Started from GUI? */
1646 /* FIXME: Do the right thing if get_homedir returns "", or if 1646 bool go_home = (!ch_to_dir && !inhibit_window_system
1647 chdir fails. */ 1647 && !isatty (STDIN_FILENO));
1648 if (! inhibit_window_system && ! isatty (STDIN_FILENO) && ! ch_to_dir)
1649 chdir (get_homedir ());
1650 if (skip_args < argc) 1648 if (skip_args < argc)
1651 { 1649 {
1652 if (!strncmp (argv[skip_args], "-psn", 4)) 1650 if (!strncmp (argv[skip_args], "-psn", 4))
1653 { 1651 {
1654 skip_args += 1; 1652 skip_args += 1;
1655 if (! ch_to_dir) chdir (get_homedir ()); 1653 go_home |= !ch_to_dir;
1656 } 1654 }
1657 else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4)) 1655 else if (skip_args+1 < argc && !strncmp (argv[skip_args+1], "-psn", 4))
1658 { 1656 {
1659 skip_args += 2; 1657 skip_args += 2;
1660 if (! ch_to_dir) chdir (get_homedir ()); 1658 go_home |= !ch_to_dir;
1661 } 1659 }
1662 } 1660 }
1661 if (go_home)
1662 {
1663 char const *home = get_homedir ();
1664 if (*home && chdir (home) == 0)
1665 emacs_wd = emacs_get_current_dir_name ();
1666 }
1663#endif /* COCOA */ 1667#endif /* COCOA */
1664 } 1668 }
1665#endif /* HAVE_NS */ 1669#endif /* HAVE_NS */
diff --git a/src/fns.c b/src/fns.c
index 91991782124..a3b8d6ef57d 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -1747,25 +1747,27 @@ changing the value of a sequence `foo'. */)
1747{ 1747{
1748 if (VECTORP (seq)) 1748 if (VECTORP (seq))
1749 { 1749 {
1750 ptrdiff_t i, n; 1750 ptrdiff_t n = 0;
1751 ptrdiff_t size = ASIZE (seq);
1752 USE_SAFE_ALLOCA;
1753 Lisp_Object *kept = SAFE_ALLOCA (size * sizeof *kept);
1751 1754
1752 for (i = n = 0; i < ASIZE (seq); ++i) 1755 for (ptrdiff_t i = 0; i < size; i++)
1753 if (NILP (Fequal (AREF (seq, i), elt)))
1754 ++n;
1755
1756 if (n != ASIZE (seq))
1757 { 1756 {
1758 struct Lisp_Vector *p = allocate_vector (n); 1757 kept[n] = AREF (seq, i);
1758 n += NILP (Fequal (AREF (seq, i), elt));
1759 }
1759 1760
1760 for (i = n = 0; i < ASIZE (seq); ++i) 1761 if (n != size)
1761 if (NILP (Fequal (AREF (seq, i), elt))) 1762 seq = Fvector (n, kept);
1762 p->contents[n++] = AREF (seq, i);
1763 1763
1764 XSETVECTOR (seq, p); 1764 SAFE_FREE ();
1765 }
1766 } 1765 }
1767 else if (STRINGP (seq)) 1766 else if (STRINGP (seq))
1768 { 1767 {
1768 if (!CHARACTERP (elt))
1769 return seq;
1770
1769 ptrdiff_t i, ibyte, nchars, nbytes, cbytes; 1771 ptrdiff_t i, ibyte, nchars, nbytes, cbytes;
1770 int c; 1772 int c;
1771 1773
@@ -1784,7 +1786,7 @@ changing the value of a sequence `foo'. */)
1784 cbytes = 1; 1786 cbytes = 1;
1785 } 1787 }
1786 1788
1787 if (!FIXNUMP (elt) || c != XFIXNUM (elt)) 1789 if (c != XFIXNUM (elt))
1788 { 1790 {
1789 ++nchars; 1791 ++nchars;
1790 nbytes += cbytes; 1792 nbytes += cbytes;
@@ -1814,7 +1816,7 @@ changing the value of a sequence `foo'. */)
1814 cbytes = 1; 1816 cbytes = 1;
1815 } 1817 }
1816 1818
1817 if (!FIXNUMP (elt) || c != XFIXNUM (elt)) 1819 if (c != XFIXNUM (elt))
1818 { 1820 {
1819 unsigned char *from = SDATA (seq) + ibyte; 1821 unsigned char *from = SDATA (seq) + ibyte;
1820 unsigned char *to = SDATA (tem) + nbytes; 1822 unsigned char *to = SDATA (tem) + nbytes;
diff --git a/src/font.c b/src/font.c
index ab00402b40b..5c01c7ff796 100644
--- a/src/font.c
+++ b/src/font.c
@@ -4847,21 +4847,18 @@ If the font is not OpenType font, CAPABILITY is nil. */)
4847 (Lisp_Object font_object) 4847 (Lisp_Object font_object)
4848{ 4848{
4849 struct font *font = CHECK_FONT_GET_OBJECT (font_object); 4849 struct font *font = CHECK_FONT_GET_OBJECT (font_object);
4850 Lisp_Object val = make_uninit_vector (9); 4850 return CALLN (Fvector,
4851 4851 AREF (font_object, FONT_NAME_INDEX),
4852 ASET (val, 0, AREF (font_object, FONT_NAME_INDEX)); 4852 AREF (font_object, FONT_FILE_INDEX),
4853 ASET (val, 1, AREF (font_object, FONT_FILE_INDEX)); 4853 make_fixnum (font->pixel_size),
4854 ASET (val, 2, make_fixnum (font->pixel_size)); 4854 make_fixnum (font->max_width),
4855 ASET (val, 3, make_fixnum (font->max_width)); 4855 make_fixnum (font->ascent),
4856 ASET (val, 4, make_fixnum (font->ascent)); 4856 make_fixnum (font->descent),
4857 ASET (val, 5, make_fixnum (font->descent)); 4857 make_fixnum (font->space_width),
4858 ASET (val, 6, make_fixnum (font->space_width)); 4858 make_fixnum (font->average_width),
4859 ASET (val, 7, make_fixnum (font->average_width)); 4859 (font->driver->otf_capability
4860 if (font->driver->otf_capability) 4860 ? Fcons (Qopentype, font->driver->otf_capability (font))
4861 ASET (val, 8, Fcons (Qopentype, font->driver->otf_capability (font))); 4861 : Qnil));
4862 else
4863 ASET (val, 8, Qnil);
4864 return val;
4865} 4862}
4866 4863
4867DEFUN ("font-get-glyphs", Ffont_get_glyphs, Sfont_get_glyphs, 3, 4, 0, 4864DEFUN ("font-get-glyphs", Ffont_get_glyphs, Sfont_get_glyphs, 3, 4, 0,
@@ -4889,7 +4886,7 @@ the corresponding element is nil. */)
4889{ 4886{
4890 struct font *font = CHECK_FONT_GET_OBJECT (font_object); 4887 struct font *font = CHECK_FONT_GET_OBJECT (font_object);
4891 ptrdiff_t len; 4888 ptrdiff_t len;
4892 Lisp_Object *chars, vec; 4889 Lisp_Object *chars;
4893 USE_SAFE_ALLOCA; 4890 USE_SAFE_ALLOCA;
4894 4891
4895 if (NILP (object)) 4892 if (NILP (object))
@@ -4957,7 +4954,7 @@ the corresponding element is nil. */)
4957 else 4954 else
4958 wrong_type_argument (Qarrayp, object); 4955 wrong_type_argument (Qarrayp, object);
4959 4956
4960 vec = make_uninit_vector (len); 4957 Lisp_Object vec = make_nil_vector (len);
4961 for (ptrdiff_t i = 0; i < len; i++) 4958 for (ptrdiff_t i = 0; i < len; i++)
4962 { 4959 {
4963 Lisp_Object g; 4960 Lisp_Object g;
@@ -5168,24 +5165,23 @@ If the named font cannot be opened and loaded, return nil. */)
5168 return Qnil; 5165 return Qnil;
5169 font = XFONT_OBJECT (font_object); 5166 font = XFONT_OBJECT (font_object);
5170 5167
5171 info = make_uninit_vector (14); 5168 info = CALLN (Fvector,
5172 ASET (info, 0, AREF (font_object, FONT_NAME_INDEX)); 5169 AREF (font_object, FONT_NAME_INDEX),
5173 ASET (info, 1, AREF (font_object, FONT_FULLNAME_INDEX)); 5170 AREF (font_object, FONT_FULLNAME_INDEX),
5174 ASET (info, 2, make_fixnum (font->pixel_size)); 5171 make_fixnum (font->pixel_size),
5175 ASET (info, 3, make_fixnum (font->height)); 5172 make_fixnum (font->height),
5176 ASET (info, 4, make_fixnum (font->baseline_offset)); 5173 make_fixnum (font->baseline_offset),
5177 ASET (info, 5, make_fixnum (font->relative_compose)); 5174 make_fixnum (font->relative_compose),
5178 ASET (info, 6, make_fixnum (font->default_ascent)); 5175 make_fixnum (font->default_ascent),
5179 ASET (info, 7, make_fixnum (font->max_width)); 5176 make_fixnum (font->max_width),
5180 ASET (info, 8, make_fixnum (font->ascent)); 5177 make_fixnum (font->ascent),
5181 ASET (info, 9, make_fixnum (font->descent)); 5178 make_fixnum (font->descent),
5182 ASET (info, 10, make_fixnum (font->space_width)); 5179 make_fixnum (font->space_width),
5183 ASET (info, 11, make_fixnum (font->average_width)); 5180 make_fixnum (font->average_width),
5184 ASET (info, 12, AREF (font_object, FONT_FILE_INDEX)); 5181 AREF (font_object, FONT_FILE_INDEX),
5185 if (font->driver->otf_capability) 5182 (font->driver->otf_capability
5186 ASET (info, 13, Fcons (Qopentype, font->driver->otf_capability (font))); 5183 ? Fcons (Qopentype, font->driver->otf_capability (font))
5187 else 5184 : Qnil));
5188 ASET (info, 13, Qnil);
5189 5185
5190#if 0 5186#if 0
5191 /* As font_object is still in FONT_OBJLIST of the entity, we can't 5187 /* As font_object is still in FONT_OBJLIST of the entity, we can't
@@ -5203,7 +5199,7 @@ If the named font cannot be opened and loaded, return nil. */)
5203static Lisp_Object 5199static Lisp_Object
5204build_style_table (const struct table_entry *entry, int nelement) 5200build_style_table (const struct table_entry *entry, int nelement)
5205{ 5201{
5206 Lisp_Object table = make_uninit_vector (nelement); 5202 Lisp_Object table = make_nil_vector (nelement);
5207 for (int i = 0; i < nelement; i++) 5203 for (int i = 0; i < nelement; i++)
5208 { 5204 {
5209 int j; 5205 int j;
@@ -5494,10 +5490,8 @@ This variable cannot be set; trying to do so will signal an error. */);
5494 make_symbol_constant (intern_c_string ("font-width-table")); 5490 make_symbol_constant (intern_c_string ("font-width-table"));
5495 5491
5496 staticpro (&font_style_table); 5492 staticpro (&font_style_table);
5497 font_style_table = make_uninit_vector (3); 5493 font_style_table = CALLN (Fvector, Vfont_weight_table, Vfont_slant_table,
5498 ASET (font_style_table, 0, Vfont_weight_table); 5494 Vfont_width_table);
5499 ASET (font_style_table, 1, Vfont_slant_table);
5500 ASET (font_style_table, 2, Vfont_width_table);
5501 5495
5502 DEFVAR_LISP ("font-log", Vfont_log, doc: /* 5496 DEFVAR_LISP ("font-log", Vfont_log, doc: /*
5503A list that logs font-related actions and results, for debugging. 5497A list that logs font-related actions and results, for debugging.
diff --git a/src/fontset.c b/src/fontset.c
index c2bb8b21f26..8c86075c07e 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -252,14 +252,13 @@ set_fontset_fallback (Lisp_Object fontset, Lisp_Object fallback)
252 252
253#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset))) 253#define BASE_FONTSET_P(fontset) (NILP (FONTSET_BASE (fontset)))
254 254
255/* Macros for FONT-DEF and RFONT-DEF of fontset. */ 255/* Definitions for FONT-DEF and RFONT-DEF of fontset. */
256#define FONT_DEF_NEW(font_def, font_spec, encoding, repertory) \ 256static Lisp_Object
257 do { \ 257font_def_new (Lisp_Object font_spec, Lisp_Object encoding,
258 (font_def) = make_uninit_vector (3); \ 258 Lisp_Object repertory)
259 ASET ((font_def), 0, font_spec); \ 259{
260 ASET ((font_def), 1, encoding); \ 260 return CALLN (Fvector, font_spec, encoding, repertory);
261 ASET ((font_def), 2, repertory); \ 261}
262 } while (0)
263 262
264#define FONT_DEF_SPEC(font_def) AREF (font_def, 0) 263#define FONT_DEF_SPEC(font_def) AREF (font_def, 0)
265#define FONT_DEF_ENCODING(font_def) AREF (font_def, 1) 264#define FONT_DEF_ENCODING(font_def) AREF (font_def, 1)
@@ -1547,7 +1546,7 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1547 repertory = CHARSET_SYMBOL_ID (repertory); 1546 repertory = CHARSET_SYMBOL_ID (repertory);
1548 } 1547 }
1549 } 1548 }
1550 FONT_DEF_NEW (font_def, font_spec, encoding, repertory); 1549 font_def = font_def_new (font_spec, encoding, repertory);
1551 } 1550 }
1552 else 1551 else
1553 font_def = Qnil; 1552 font_def = Qnil;
@@ -1619,14 +1618,8 @@ appended. By default, FONT-SPEC overrides the previous settings. */)
1619 1618
1620 if (charset) 1619 if (charset)
1621 { 1620 {
1622 Lisp_Object arg; 1621 Lisp_Object arg = CALLN (Fvector, fontset, font_def, add,
1623 1622 ascii_changed ? Qt : Qnil, range_list);
1624 arg = make_uninit_vector (5);
1625 ASET (arg, 0, fontset);
1626 ASET (arg, 1, font_def);
1627 ASET (arg, 2, add);
1628 ASET (arg, 3, ascii_changed ? Qt : Qnil);
1629 ASET (arg, 4, range_list);
1630 1623
1631 map_charset_chars (set_fontset_font, Qnil, arg, charset, 1624 map_charset_chars (set_fontset_font, Qnil, arg, charset,
1632 CHARSET_MIN_CODE (charset), 1625 CHARSET_MIN_CODE (charset),
diff --git a/src/ftfont.c b/src/ftfont.c
index 696f5e65341..a904007a329 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -2826,14 +2826,10 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font,
2826 LGLYPH_SET_ASCENT (lglyph, g->g.ascent >> 6); 2826 LGLYPH_SET_ASCENT (lglyph, g->g.ascent >> 6);
2827 LGLYPH_SET_DESCENT (lglyph, g->g.descent >> 6); 2827 LGLYPH_SET_DESCENT (lglyph, g->g.descent >> 6);
2828 if (g->g.adjusted) 2828 if (g->g.adjusted)
2829 { 2829 LGLYPH_SET_ADJUSTMENT (lglyph, CALLN (Fvector,
2830 Lisp_Object vec = make_uninit_vector (3); 2830 make_fixnum (g->g.xoff >> 6),
2831 2831 make_fixnum (g->g.yoff >> 6),
2832 ASET (vec, 0, make_fixnum (g->g.xoff >> 6)); 2832 make_fixnum (g->g.xadv >> 6)));
2833 ASET (vec, 1, make_fixnum (g->g.yoff >> 6));
2834 ASET (vec, 2, make_fixnum (g->g.xadv >> 6));
2835 LGLYPH_SET_ADJUSTMENT (lglyph, vec);
2836 }
2837 } 2833 }
2838 return make_fixnum (i); 2834 return make_fixnum (i);
2839} 2835}
diff --git a/src/hbfont.c b/src/hbfont.c
index 4b3f64ef504..82b115e6868 100644
--- a/src/hbfont.c
+++ b/src/hbfont.c
@@ -594,13 +594,10 @@ hbfont_shape (Lisp_Object lgstring, Lisp_Object direction)
594 yoff = - lround (pos[i].y_offset * position_unit); 594 yoff = - lround (pos[i].y_offset * position_unit);
595 wadjust = lround (pos[i].x_advance * position_unit); 595 wadjust = lround (pos[i].x_advance * position_unit);
596 if (xoff || yoff || wadjust != metrics.width) 596 if (xoff || yoff || wadjust != metrics.width)
597 { 597 LGLYPH_SET_ADJUSTMENT (lglyph, CALLN (Fvector,
598 Lisp_Object vec = make_uninit_vector (3); 598 make_fixnum (xoff),
599 ASET (vec, 0, make_fixnum (xoff)); 599 make_fixnum (yoff),
600 ASET (vec, 1, make_fixnum (yoff)); 600 make_fixnum (wadjust)));
601 ASET (vec, 2, make_fixnum (wadjust));
602 LGLYPH_SET_ADJUSTMENT (lglyph, vec);
603 }
604 } 601 }
605 602
606 return make_fixnum (glyph_len); 603 return make_fixnum (glyph_len);
diff --git a/src/image.c b/src/image.c
index e236b389210..643b3d0a1f4 100644
--- a/src/image.c
+++ b/src/image.c
@@ -803,17 +803,23 @@ valid_image_p (Lisp_Object object)
803 { 803 {
804 Lisp_Object tail = XCDR (object); 804 Lisp_Object tail = XCDR (object);
805 FOR_EACH_TAIL_SAFE (tail) 805 FOR_EACH_TAIL_SAFE (tail)
806 if (EQ (XCAR (tail), QCtype)) 806 {
807 { 807 if (EQ (XCAR (tail), QCtype))
808 tail = XCDR (tail); 808 {
809 if (CONSP (tail)) 809 tail = XCDR (tail);
810 { 810 if (CONSP (tail))
811 struct image_type const *type = lookup_image_type (XCAR (tail)); 811 {
812 if (type) 812 struct image_type const *type =
813 return type->valid_p (object); 813 lookup_image_type (XCAR (tail));
814 } 814 if (type)
815 break; 815 return type->valid_p (object);
816 } 816 }
817 break;
818 }
819 tail = XCDR (tail);
820 if (! CONSP (tail))
821 return false;
822 }
817 } 823 }
818 824
819 return false; 825 return false;
@@ -899,7 +905,7 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
899 return false; 905 return false;
900 906
901 plist = XCDR (spec); 907 plist = XCDR (spec);
902 while (CONSP (plist)) 908 FOR_EACH_TAIL_SAFE (plist)
903 { 909 {
904 Lisp_Object key, value; 910 Lisp_Object key, value;
905 911
@@ -913,7 +919,6 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
913 if (!CONSP (plist)) 919 if (!CONSP (plist))
914 return false; 920 return false;
915 value = XCAR (plist); 921 value = XCAR (plist);
916 plist = XCDR (plist);
917 922
918 /* Find key in KEYWORDS. Error if not found. */ 923 /* Find key in KEYWORDS. Error if not found. */
919 for (i = 0; i < nkeywords; ++i) 924 for (i = 0; i < nkeywords; ++i)
@@ -921,7 +926,7 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
921 break; 926 break;
922 927
923 if (i == nkeywords) 928 if (i == nkeywords)
924 continue; 929 goto maybe_done;
925 930
926 /* Record that we recognized the keyword. If a keyword 931 /* Record that we recognized the keyword. If a keyword
927 was found more than once, it's an error. */ 932 was found more than once, it's an error. */
@@ -1009,14 +1014,20 @@ parse_image_spec (Lisp_Object spec, struct image_keyword *keywords,
1009 if (EQ (key, QCtype) 1014 if (EQ (key, QCtype)
1010 && !(EQ (type, value) || EQ (type, Qnative_image))) 1015 && !(EQ (type, value) || EQ (type, Qnative_image)))
1011 return false; 1016 return false;
1012 }
1013 1017
1014 /* Check that all mandatory fields are present. */ 1018 maybe_done:
1015 for (i = 0; i < nkeywords; ++i) 1019 if (EQ (XCDR (plist), Qnil))
1016 if (keywords[i].count < keywords[i].mandatory_p) 1020 {
1017 return false; 1021 /* Check that all mandatory fields are present. */
1022 for (i = 0; i < nkeywords; ++i)
1023 if (keywords[i].mandatory_p && keywords[i].count == 0)
1024 return false;
1025
1026 return true;
1027 }
1028 }
1018 1029
1019 return NILP (plist); 1030 return false;
1020} 1031}
1021 1032
1022 1033
@@ -1031,9 +1042,8 @@ image_spec_value (Lisp_Object spec, Lisp_Object key, bool *found)
1031 1042
1032 eassert (valid_image_p (spec)); 1043 eassert (valid_image_p (spec));
1033 1044
1034 for (tail = XCDR (spec); 1045 tail = XCDR (spec);
1035 CONSP (tail) && CONSP (XCDR (tail)); 1046 FOR_EACH_TAIL_SAFE (tail)
1036 tail = XCDR (XCDR (tail)))
1037 { 1047 {
1038 if (EQ (XCAR (tail), key)) 1048 if (EQ (XCAR (tail), key))
1039 { 1049 {
@@ -1041,6 +1051,9 @@ image_spec_value (Lisp_Object spec, Lisp_Object key, bool *found)
1041 *found = 1; 1051 *found = 1;
1042 return XCAR (XCDR (tail)); 1052 return XCAR (XCDR (tail));
1043 } 1053 }
1054 tail = XCDR (tail);
1055 if (! CONSP (tail))
1056 break;
1044 } 1057 }
1045 1058
1046 if (found) 1059 if (found)
@@ -1584,6 +1597,16 @@ make_image_cache (void)
1584 return c; 1597 return c;
1585} 1598}
1586 1599
1600/* Compare two lists (one of which must be proper), comparing each
1601 element with `eq'. */
1602static bool
1603equal_lists (Lisp_Object a, Lisp_Object b)
1604{
1605 while (CONSP (a) && CONSP (b) && EQ (XCAR (a), XCAR (b)))
1606 a = XCDR (a), b = XCDR (b);
1607
1608 return EQ (a, b);
1609}
1587 1610
1588/* Find an image matching SPEC in the cache, and return it. If no 1611/* Find an image matching SPEC in the cache, and return it. If no
1589 image is found, return NULL. */ 1612 image is found, return NULL. */
@@ -1610,7 +1633,7 @@ search_image_cache (struct frame *f, Lisp_Object spec, EMACS_UINT hash)
1610 1633
1611 for (img = c->buckets[i]; img; img = img->next) 1634 for (img = c->buckets[i]; img; img = img->next)
1612 if (img->hash == hash 1635 if (img->hash == hash
1613 && !NILP (Fequal (img->spec, spec)) 1636 && !equal_lists (img->spec, spec)
1614 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f) 1637 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
1615 && img->frame_background == FRAME_BACKGROUND_PIXEL (f)) 1638 && img->frame_background == FRAME_BACKGROUND_PIXEL (f))
1616 break; 1639 break;
diff --git a/src/lisp.h b/src/lisp.h
index 5f913b72b45..ddaeb0c1517 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -1812,7 +1812,8 @@ bool_vector_uchar_data (Lisp_Object a)
1812INLINE bool 1812INLINE bool
1813bool_vector_bitref (Lisp_Object a, EMACS_INT i) 1813bool_vector_bitref (Lisp_Object a, EMACS_INT i)
1814{ 1814{
1815 eassume (0 <= i && i < bool_vector_size (a)); 1815 eassume (0 <= i);
1816 eassert (i < bool_vector_size (a));
1816 return !! (bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR] 1817 return !! (bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR]
1817 & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR))); 1818 & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR)));
1818} 1819}
@@ -1828,11 +1829,11 @@ bool_vector_ref (Lisp_Object a, EMACS_INT i)
1828INLINE void 1829INLINE void
1829bool_vector_set (Lisp_Object a, EMACS_INT i, bool b) 1830bool_vector_set (Lisp_Object a, EMACS_INT i, bool b)
1830{ 1831{
1831 unsigned char *addr; 1832 eassume (0 <= i);
1832 1833 eassert (i < bool_vector_size (a));
1833 eassume (0 <= i && i < bool_vector_size (a));
1834 addr = &bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR];
1835 1834
1835 unsigned char *addr
1836 = &bool_vector_uchar_data (a)[i / BOOL_VECTOR_BITS_PER_CHAR];
1836 if (b) 1837 if (b)
1837 *addr |= 1 << (i % BOOL_VECTOR_BITS_PER_CHAR); 1838 *addr |= 1 << (i % BOOL_VECTOR_BITS_PER_CHAR);
1838 else 1839 else
@@ -3926,7 +3927,6 @@ build_string (const char *str)
3926 3927
3927extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object); 3928extern Lisp_Object pure_cons (Lisp_Object, Lisp_Object);
3928extern Lisp_Object make_vector (ptrdiff_t, Lisp_Object); 3929extern Lisp_Object make_vector (ptrdiff_t, Lisp_Object);
3929extern struct Lisp_Vector *allocate_vector (ptrdiff_t);
3930extern struct Lisp_Vector *allocate_nil_vector (ptrdiff_t); 3930extern struct Lisp_Vector *allocate_nil_vector (ptrdiff_t);
3931 3931
3932/* Make an uninitialized vector for SIZE objects. NOTE: you must 3932/* Make an uninitialized vector for SIZE objects. NOTE: you must
@@ -3936,7 +3936,11 @@ extern struct Lisp_Vector *allocate_nil_vector (ptrdiff_t);
3936 v = make_uninit_vector (3); 3936 v = make_uninit_vector (3);
3937 ASET (v, 0, obj0); 3937 ASET (v, 0, obj0);
3938 ASET (v, 1, Ffunction_can_gc ()); 3938 ASET (v, 1, Ffunction_can_gc ());
3939 ASET (v, 2, obj1); */ 3939 ASET (v, 2, obj1);
3940
3941 allocate_vector has a similar problem. */
3942
3943extern struct Lisp_Vector *allocate_vector (ptrdiff_t);
3940 3944
3941INLINE Lisp_Object 3945INLINE Lisp_Object
3942make_uninit_vector (ptrdiff_t size) 3946make_uninit_vector (ptrdiff_t size)
diff --git a/src/lread.c b/src/lread.c
index f5a7d44a1e0..521da4e1d81 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1099,7 +1099,7 @@ close_infile_unwind (void *arg)
1099 infile = prev_infile; 1099 infile = prev_infile;
1100} 1100}
1101 1101
1102static Lisp_Object 1102static ATTRIBUTE_UNUSED Lisp_Object
1103parent_directory (Lisp_Object directory) 1103parent_directory (Lisp_Object directory)
1104{ 1104{
1105 return Ffile_name_directory (Fsubstring (directory, 1105 return Ffile_name_directory (Fsubstring (directory,
@@ -1231,8 +1231,7 @@ Return t if the file exists and loads successfully. */)
1231 suffixes = CALLN (Fappend, suffixes, Vload_file_rep_suffixes); 1231 suffixes = CALLN (Fappend, suffixes, Vload_file_rep_suffixes);
1232 } 1232 }
1233 1233
1234 fd = 1234 fd = openp (Vload_path, file, suffixes, &found, Qnil, load_prefer_newer);
1235 openp (Vload_path, file, suffixes, &found, Qnil, load_prefer_newer);
1236 } 1235 }
1237 1236
1238 if (fd == -1) 1237 if (fd == -1)
@@ -1478,9 +1477,8 @@ Return t if the file exists and loads successfully. */)
1478 same folder of their respective sources therfore not to break 1477 same folder of their respective sources therfore not to break
1479 packages we fake `load-file-name' here. The non faked 1478 packages we fake `load-file-name' here. The non faked
1480 version of it is `load-true-file-name'. */ 1479 version of it is `load-true-file-name'. */
1481 specbind (Qload_file_name, 1480 specbind (Qload_file_name, Fgethash (Ffile_name_nondirectory (found),
1482 concat2 (parent_directory (Ffile_name_directory (found)), 1481 Vcomp_eln_to_el_h, Qnil));
1483 Ffile_name_nondirectory (found)));
1484 } 1482 }
1485 else 1483 else
1486 specbind (Qload_file_name, found); 1484 specbind (Qload_file_name, found);
@@ -1608,118 +1606,52 @@ directories, make sure the PREDICATE function returns `dir-ok' for them. */)
1608 return file; 1606 return file;
1609} 1607}
1610 1608
1611/* This function turns a list of suffixes into a list of middle dirs 1609/* Look for a suitable .eln file to be loaded in place of FILENAME.
1612 and suffixes. If the suffix is not NATIVE_ELISP_SUFFIX then its 1610 If found replace the content of FILENAME and FD. */
1613 suffix is nil and it is added to the list as is. Instead, if it
1614 suffix is NATIVE_ELISP_SUFFIX then two elements are added to the
1615 list. The first one has middledir equal to nil and the second uses
1616 comp-native-path-postfix as middledir. This is because we'd like
1617 to search for dir/foo.eln before dir/middledir/foo.eln.
1618
1619For example, it turns this:
1620
1621(".eln" ".elc" ".elc.gz" ".el" ".el.gz")
1622 1611
1623 into this: 1612static void
1624 1613maybe_swap_for_eln (Lisp_Object *filename, int *fd, struct timespec mtime)
1625((nil . ".eln")
1626 (comp-native-path-postfix . ".eln")
1627 (nil . ".elc")
1628 (nil . ".elc.gz")
1629 (nil . ".el")
1630 (nil . ".el.gz"))
1631*/
1632static Lisp_Object
1633openp_add_middle_dir_to_suffixes (Lisp_Object suffixes)
1634{ 1614{
1635 Lisp_Object tail = suffixes;
1636 Lisp_Object extended_suf = Qnil;
1637 FOR_EACH_TAIL_SAFE (tail)
1638 {
1639 /* suffixes may be a stack-based cons pointing to stack-based
1640 strings. We must copy the suffix if we are putting it into
1641 a heap-based cons to avoid a dangling reference. This would
1642 lead to crashes during the GC. */
1643 CHECK_STRING_CAR (tail);
1644 char * suf = SSDATA (XCAR (tail));
1645 Lisp_Object copied_suffix = build_string (suf);
1646#ifdef HAVE_NATIVE_COMP 1615#ifdef HAVE_NATIVE_COMP
1647 if (strcmp (NATIVE_ELISP_SUFFIX, suf) == 0) 1616 struct stat eln_st;
1648 {
1649 CHECK_STRING (Vcomp_native_path_postfix);
1650 /* Here we add them in the opposite order so that nreverse
1651 corrects it. */
1652 extended_suf = Fcons (Fcons (Qnil, copied_suffix), extended_suf);
1653 extended_suf = Fcons (Fcons (Vcomp_native_path_postfix,
1654 copied_suffix),
1655 extended_suf);
1656 }
1657 else
1658#endif
1659 extended_suf = Fcons (Fcons (Qnil, copied_suffix), extended_suf);
1660 }
1661 1617
1662 suffixes = Fnreverse (extended_suf); 1618 if (load_no_native
1663 return suffixes; 1619 || !suffix_p (*filename, ".elc"))
1664} 1620 return;
1665 1621
1666/* This function takes a list of middledirs and suffixes and returns 1622 /* Search eln in the eln-cache directories. */
1667 the maximum buffer space that this part of the filename will 1623 Lisp_Object eln_path_tail = Vcomp_eln_load_path;
1668 need. */ 1624 FOR_EACH_TAIL_SAFE (eln_path_tail)
1669static ptrdiff_t
1670openp_max_middledir_and_suffix_len (Lisp_Object middledir_and_suffixes)
1671{
1672 ptrdiff_t max_extra_len = 0;
1673 Lisp_Object tail = middledir_and_suffixes;
1674 FOR_EACH_TAIL_SAFE (tail)
1675 { 1625 {
1676 Lisp_Object middledir_and_suffix = XCAR (tail); 1626 Lisp_Object el_name =
1677 Lisp_Object middledir = XCAR (middledir_and_suffix); 1627 Fsubstring (*filename, Qnil, make_fixnum (-1));
1678 Lisp_Object suffix = XCDR (middledir_and_suffix); 1628 Lisp_Object eln_name =
1679 ptrdiff_t len = SBYTES (suffix); 1629 Fcomp_el_to_eln_filename (el_name, XCAR (eln_path_tail));
1680 if (!NILP (middledir)) 1630 int eln_fd = emacs_open (SSDATA (ENCODE_FILE (eln_name)), O_RDONLY, 0);
1681 len += 2 + SBYTES (middledir); /* Add two slashes. */
1682 max_extra_len = max (max_extra_len, len);
1683 }
1684 return max_extra_len;
1685}
1686 1631
1687/* This function completes the FN buffer with the middledir, 1632 if (eln_fd > 0)
1688 basenameme, and suffix. It takes the directory length in DIRNAME, 1633 {
1689 but it requires that it has been copied already to the start of 1634 if (fstat (eln_fd, &eln_st) || S_ISDIR (eln_st.st_mode))
1690 the buffer. 1635 emacs_close (eln_fd);
1691 1636 else
1692 After this function the FN buffer will be (depending on middledir) 1637 {
1693 dirname/middledir/basename.suffix 1638 struct timespec eln_mtime = get_stat_mtime (&eln_st);
1694 or 1639 if (timespec_cmp (eln_mtime, mtime) > 0)
1695 dirname/basename.suffix 1640 {
1696*/ 1641 *filename = eln_name;
1697static ptrdiff_t 1642 emacs_close (*fd);
1698openp_fill_filename_buffer (char *fn, ptrdiff_t dirnamelen, 1643 *fd = eln_fd;
1699 Lisp_Object basenamewext, 1644 /* Store the eln -> el relation. */
1700 Lisp_Object middledir_and_suffix) 1645 Fputhash (Ffile_name_nondirectory (eln_name),
1701{ 1646 el_name, Vcomp_eln_to_el_h);
1702 Lisp_Object middledir = XCAR (middledir_and_suffix); 1647 return;
1703 Lisp_Object suffix = XCDR (middledir_and_suffix); 1648 }
1704 ptrdiff_t basenamewext_len = SBYTES (basenamewext); 1649 else
1705 ptrdiff_t fnlen, lsuffix = SBYTES (suffix); 1650 emacs_close (eln_fd);
1706 ptrdiff_t lmiddledir = 0; 1651 }
1707 if (!NILP (middledir)) 1652 }
1708 {
1709 /* Add 1 for the slash. */
1710 lmiddledir = SBYTES (middledir) + 1;
1711 memcpy (fn + dirnamelen, SDATA (middledir),
1712 lmiddledir - 1);
1713 fn[dirnamelen + (lmiddledir - 1)] = '/';
1714 } 1653 }
1715 1654#endif
1716 memcpy (fn + dirnamelen + lmiddledir, SDATA (basenamewext),
1717 basenamewext_len);
1718 /* Make complete filename by appending SUFFIX. */
1719 memcpy (fn + dirnamelen + lmiddledir + basenamewext_len,
1720 SDATA (suffix), lsuffix + 1);
1721 fnlen = dirnamelen + lmiddledir + basenamewext_len + lsuffix;
1722 return fnlen;
1723} 1655}
1724 1656
1725/* Search for a file whose name is STR, looking in directories 1657/* Search for a file whose name is STR, looking in directories
@@ -1759,21 +1691,23 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
1759 ptrdiff_t want_length; 1691 ptrdiff_t want_length;
1760 Lisp_Object filename; 1692 Lisp_Object filename;
1761 Lisp_Object string, tail, encoded_fn, save_string; 1693 Lisp_Object string, tail, encoded_fn, save_string;
1762 Lisp_Object middledir_and_suffixes; 1694 ptrdiff_t max_suffix_len = 0;
1763 ptrdiff_t max_extra_len = 0;
1764 int last_errno = ENOENT; 1695 int last_errno = ENOENT;
1765 int save_fd = -1; 1696 int save_fd = -1;
1766 USE_SAFE_ALLOCA; 1697 USE_SAFE_ALLOCA;
1767
1768 /* The last-modified time of the newest matching file found. 1698 /* The last-modified time of the newest matching file found.
1769 Initialize it to something less than all valid timestamps. */ 1699 Initialize it to something less than all valid timestamps. */
1770 struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1); 1700 struct timespec save_mtime = make_timespec (TYPE_MINIMUM (time_t), -1);
1771 1701
1772 CHECK_STRING (str); 1702 CHECK_STRING (str);
1773 1703
1774 middledir_and_suffixes = openp_add_middle_dir_to_suffixes (suffixes); 1704 tail = suffixes;
1775 1705 FOR_EACH_TAIL_SAFE (tail)
1776 max_extra_len = openp_max_middledir_and_suffix_len (middledir_and_suffixes); 1706 {
1707 CHECK_STRING_CAR (tail);
1708 max_suffix_len = max (max_suffix_len,
1709 SBYTES (XCAR (tail)));
1710 }
1777 1711
1778 string = filename = encoded_fn = save_string = Qnil; 1712 string = filename = encoded_fn = save_string = Qnil;
1779 1713
@@ -1790,7 +1724,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
1790 executable. */ 1724 executable. */
1791 FOR_EACH_TAIL_SAFE (path) 1725 FOR_EACH_TAIL_SAFE (path)
1792 { 1726 {
1793 ptrdiff_t dirnamelen, prefixlen; 1727 ptrdiff_t baselen, prefixlen;
1794 1728
1795 if (EQ (path, just_use_str)) 1729 if (EQ (path, just_use_str))
1796 filename = str; 1730 filename = str;
@@ -1807,40 +1741,35 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
1807 continue; 1741 continue;
1808 } 1742 }
1809 1743
1810
1811 /* Calculate maximum length of any filename made from 1744 /* Calculate maximum length of any filename made from
1812 this path element/specified file name and any possible suffix. */ 1745 this path element/specified file name and any possible suffix. */
1813 want_length = max_extra_len + SBYTES (filename); 1746 want_length = max_suffix_len + SBYTES (filename);
1814 if (fn_size <= want_length) 1747 if (fn_size <= want_length)
1815 { 1748 {
1816 fn_size = 100 + want_length; 1749 fn_size = 100 + want_length;
1817 fn = SAFE_ALLOCA (fn_size); 1750 fn = SAFE_ALLOCA (fn_size);
1818 } 1751 }
1819 1752
1820 Lisp_Object dirnamewslash = Ffile_name_directory (filename);
1821 Lisp_Object basenamewext = Ffile_name_nondirectory (filename);
1822
1823 /* Copy FILENAME's data to FN but remove starting /: if any. */ 1753 /* Copy FILENAME's data to FN but remove starting /: if any. */
1824 prefixlen = ((SCHARS (dirnamewslash) > 2 1754 prefixlen = ((SCHARS (filename) > 2
1825 && SREF (dirnamewslash, 0) == '/' 1755 && SREF (filename, 0) == '/'
1826 && SREF (dirnamewslash, 1) == ':') 1756 && SREF (filename, 1) == ':')
1827 ? 2 : 0); 1757 ? 2 : 0);
1828 dirnamelen = SBYTES (dirnamewslash) - prefixlen; 1758 baselen = SBYTES (filename) - prefixlen;
1829 memcpy (fn, SDATA (dirnamewslash) + prefixlen, dirnamelen); 1759 memcpy (fn, SDATA (filename) + prefixlen, baselen);
1830 1760
1831 /* Loop over middledir_and_suffixes. */ 1761 /* Loop over suffixes. */
1832 AUTO_LIST1 (empty_string_only, Fcons (Qnil, empty_unibyte_string)); 1762 AUTO_LIST1 (empty_string_only, empty_unibyte_string);
1833 tail = NILP (middledir_and_suffixes) ? empty_string_only 1763 tail = NILP (suffixes) ? empty_string_only : suffixes;
1834 : middledir_and_suffixes;
1835 FOR_EACH_TAIL_SAFE (tail) 1764 FOR_EACH_TAIL_SAFE (tail)
1836 { 1765 {
1837 Lisp_Object middledir_and_suffix = XCAR (tail); 1766 Lisp_Object suffix = XCAR (tail);
1838 Lisp_Object suffix = XCDR (middledir_and_suffix); 1767 ptrdiff_t fnlen, lsuffix = SBYTES (suffix);
1839 Lisp_Object handler; 1768 Lisp_Object handler;
1840 1769
1841 ptrdiff_t fnlen = openp_fill_filename_buffer (fn, dirnamelen, 1770 /* Make complete filename by appending SUFFIX. */
1842 basenamewext, 1771 memcpy (fn + baselen, SDATA (suffix), lsuffix + 1);
1843 middledir_and_suffix); 1772 fnlen = baselen + lsuffix;
1844 1773
1845 /* Check that the file exists and is not a directory. */ 1774 /* Check that the file exists and is not a directory. */
1846 /* We used to only check for handlers on non-absolute file names: 1775 /* We used to only check for handlers on non-absolute file names:
@@ -1962,9 +1891,11 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
1962 } 1891 }
1963 else 1892 else
1964 { 1893 {
1894 maybe_swap_for_eln (&string, &fd, get_stat_mtime (&st));
1965 /* We succeeded; return this descriptor and filename. */ 1895 /* We succeeded; return this descriptor and filename. */
1966 if (storeptr) 1896 if (storeptr)
1967 *storeptr = string; 1897 *storeptr = string;
1898
1968 SAFE_FREE (); 1899 SAFE_FREE ();
1969 return fd; 1900 return fd;
1970 } 1901 }
@@ -1973,6 +1904,7 @@ openp (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
1973 /* No more suffixes. Return the newest. */ 1904 /* No more suffixes. Return the newest. */
1974 if (0 <= save_fd && ! CONSP (XCDR (tail))) 1905 if (0 <= save_fd && ! CONSP (XCDR (tail)))
1975 { 1906 {
1907 maybe_swap_for_eln (&save_string, &save_fd, save_mtime);
1976 if (storeptr) 1908 if (storeptr)
1977 *storeptr = save_string; 1909 *storeptr = save_string;
1978 SAFE_FREE (); 1910 SAFE_FREE ();
@@ -5030,11 +4962,8 @@ to the specified file name if a suffix is allowed or required. */);
5030 Vload_suffixes = 4962 Vload_suffixes =
5031 Fcons (build_pure_c_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes); 4963 Fcons (build_pure_c_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes);
5032#endif 4964#endif
5033#endif
5034#ifdef HAVE_NATIVE_COMP
5035 Vload_suffixes = Fcons (build_pure_c_string (NATIVE_ELISP_SUFFIX), Vload_suffixes);
5036#endif
5037 4965
4966#endif
5038 DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix, 4967 DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix,
5039 doc: /* Suffix of loadable module file, or nil if modules are not supported. */); 4968 doc: /* Suffix of loadable module file, or nil if modules are not supported. */);
5040#ifdef HAVE_MODULES 4969#ifdef HAVE_MODULES
@@ -5228,6 +5157,11 @@ Note that if you customize this, obviously it will not affect files
5228that are loaded before your customizations are read! */); 5157that are loaded before your customizations are read! */);
5229 load_prefer_newer = 0; 5158 load_prefer_newer = 0;
5230 5159
5160 DEFVAR_BOOL ("load-no-native", load_no_native,
5161 doc: /* Do not try to load the a .eln file in place of
5162 a .elc one. */);
5163 load_no_native = false;
5164
5231 /* Vsource_directory was initialized in init_lread. */ 5165 /* Vsource_directory was initialized in init_lread. */
5232 5166
5233 DEFSYM (Qcurrent_load_list, "current-load-list"); 5167 DEFSYM (Qcurrent_load_list, "current-load-list");
diff --git a/src/macfont.m b/src/macfont.m
index c7430d32772..904814647f9 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -3137,10 +3137,8 @@ macfont_shape (Lisp_Object lgstring, Lisp_Object direction)
3137 wadjust = lround (gl->advance); 3137 wadjust = lround (gl->advance);
3138 if (xoff != 0 || yoff != 0 || wadjust != metrics.width) 3138 if (xoff != 0 || yoff != 0 || wadjust != metrics.width)
3139 { 3139 {
3140 Lisp_Object vec = make_uninit_vector (3); 3140 Lisp_Object vec = CALLN (Fvector, make_fixnum (xoff),
3141 ASET (vec, 0, make_fixnum (xoff)); 3141 make_fixnum (yoff), make_fixnum (wadjust));
3142 ASET (vec, 1, make_fixnum (yoff));
3143 ASET (vec, 2, make_fixnum (wadjust));
3144 LGLYPH_SET_ADJUSTMENT (lglyph, vec); 3142 LGLYPH_SET_ADJUSTMENT (lglyph, vec);
3145 } 3143 }
3146 } 3144 }
diff --git a/src/minibuf.c b/src/minibuf.c
index cb302c5a605..e18ff17abbf 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -251,7 +251,7 @@ read_minibuf_noninteractive (Lisp_Object prompt, bool expflag,
251 else 251 else
252 { 252 {
253 xfree (line); 253 xfree (line);
254 error ("Error reading from stdin"); 254 xsignal1 (Qend_of_file, build_string ("Error reading from stdin"));
255 } 255 }
256 256
257 /* If Lisp form desired instead of string, parse it. */ 257 /* If Lisp form desired instead of string, parse it. */
diff --git a/src/nsselect.m b/src/nsselect.m
index 38ac66e9c7b..7b1937f5d99 100644
--- a/src/nsselect.m
+++ b/src/nsselect.m
@@ -114,7 +114,7 @@ clean_local_selection_data (Lisp_Object obj)
114 114
115 if (size == 1) 115 if (size == 1)
116 return clean_local_selection_data (AREF (obj, 0)); 116 return clean_local_selection_data (AREF (obj, 0));
117 copy = make_uninit_vector (size); 117 copy = make_nil_vector (size);
118 for (i = 0; i < size; i++) 118 for (i = 0; i < size; i++)
119 ASET (copy, i, clean_local_selection_data (AREF (obj, i))); 119 ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
120 return copy; 120 return copy;
diff --git a/src/nsterm.m b/src/nsterm.m
index 9f5916d78ed..98c5b69d681 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -7669,11 +7669,8 @@ not_in_argv (NSString *arg)
7669 /* macOS Sierra automatically enables tabbed windows. We can't 7669 /* macOS Sierra automatically enables tabbed windows. We can't
7670 allow this to be enabled until it's available on a Free system. 7670 allow this to be enabled until it's available on a Free system.
7671 Currently it only happens by accident and is buggy anyway. */ 7671 Currently it only happens by accident and is buggy anyway. */
7672#if defined (NS_IMPL_COCOA) \ 7672#ifdef NS_IMPL_COCOA
7673 && MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
7674#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
7675 if ([win respondsToSelector: @selector(setTabbingMode:)]) 7673 if ([win respondsToSelector: @selector(setTabbingMode:)])
7676#endif
7677 [win setTabbingMode: NSWindowTabbingModeDisallowed]; 7674 [win setTabbingMode: NSWindowTabbingModeDisallowed];
7678#endif 7675#endif
7679 7676
@@ -8424,25 +8421,17 @@ not_in_argv (NSString *arg)
8424 8421
8425 8422
8426- (void)windowDidChangeBackingProperties:(NSNotification *)notification 8423- (void)windowDidChangeBackingProperties:(NSNotification *)notification
8427 /* Update the drawing buffer when the backing scale factor changes. */ 8424 /* Update the drawing buffer when the backing properties change. */
8428{ 8425{
8429 NSTRACE ("EmacsView windowDidChangeBackingProperties:]"); 8426 NSTRACE ("EmacsView windowDidChangeBackingProperties:]");
8430 8427
8431 if (! [self wantsUpdateLayer]) 8428 if (! [self wantsUpdateLayer])
8432 return; 8429 return;
8433 8430
8434 CGFloat old = [[[notification userInfo] 8431 NSRect frame = [self frame];
8435 objectForKey:@"NSBackingPropertyOldScaleFactorKey"] 8432 [self createDrawingBuffer];
8436 doubleValue]; 8433 ns_clear_frame (emacsframe);
8437 CGFloat new = [[self window] backingScaleFactor]; 8434 expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
8438
8439 if (old != new)
8440 {
8441 NSRect frame = [self frame];
8442 [self createDrawingBuffer];
8443 ns_clear_frame (emacsframe);
8444 expose_frame (emacsframe, 0, 0, NSWidth (frame), NSHeight (frame));
8445 }
8446} 8435}
8447#endif /* NS_DRAW_TO_BUFFER */ 8436#endif /* NS_DRAW_TO_BUFFER */
8448 8437
diff --git a/src/nsxwidget.m b/src/nsxwidget.m
index 370abee395c..e81ca7fc0cb 100644
--- a/src/nsxwidget.m
+++ b/src/nsxwidget.m
@@ -388,7 +388,7 @@ js_to_lisp (id value)
388 NSArray *nsarr = (NSArray *) value; 388 NSArray *nsarr = (NSArray *) value;
389 EMACS_INT n = nsarr.count; 389 EMACS_INT n = nsarr.count;
390 Lisp_Object obj; 390 Lisp_Object obj;
391 struct Lisp_Vector *p = allocate_vector (n); 391 struct Lisp_Vector *p = allocate_nil_vector (n);
392 392
393 for (ptrdiff_t i = 0; i < n; ++i) 393 for (ptrdiff_t i = 0; i < n; ++i)
394 p->contents[i] = js_to_lisp ([nsarr objectAtIndex:i]); 394 p->contents[i] = js_to_lisp ([nsarr objectAtIndex:i]);
@@ -401,7 +401,7 @@ js_to_lisp (id value)
401 NSArray *keys = nsdict.allKeys; 401 NSArray *keys = nsdict.allKeys;
402 ptrdiff_t n = keys.count; 402 ptrdiff_t n = keys.count;
403 Lisp_Object obj; 403 Lisp_Object obj;
404 struct Lisp_Vector *p = allocate_vector (n); 404 struct Lisp_Vector *p = allocate_nil_vector (n);
405 405
406 for (ptrdiff_t i = 0; i < n; ++i) 406 for (ptrdiff_t i = 0; i < n; ++i)
407 { 407 {
diff --git a/src/pdumper.c b/src/pdumper.c
index 629d0969346..9c615a9a1a7 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -4903,14 +4903,19 @@ struct dump_bitset
4903}; 4903};
4904 4904
4905static bool 4905static bool
4906dump_bitset_init (struct dump_bitset *bitset, size_t number_bits) 4906dump_bitsets_init (struct dump_bitset bitset[2], size_t number_bits)
4907{ 4907{
4908 int xword_size = sizeof (bitset->bits[0]); 4908 int xword_size = sizeof (bitset[0].bits[0]);
4909 int bits_per_word = xword_size * CHAR_BIT; 4909 int bits_per_word = xword_size * CHAR_BIT;
4910 ptrdiff_t words_needed = divide_round_up (number_bits, bits_per_word); 4910 ptrdiff_t words_needed = divide_round_up (number_bits, bits_per_word);
4911 bitset->number_words = words_needed; 4911 dump_bitset_word *bits = calloc (words_needed, 2 * xword_size);
4912 bitset->bits = calloc (words_needed, xword_size); 4912 if (!bits)
4913 return bitset->bits != NULL; 4913 return false;
4914 bitset[0].bits = bits;
4915 bitset[0].number_words = bitset[1].number_words = words_needed;
4916 bitset[1].bits = memset (bits + words_needed, UCHAR_MAX,
4917 words_needed * xword_size);
4918 return true;
4914} 4919}
4915 4920
4916static dump_bitset_word * 4921static dump_bitset_word *
@@ -4971,7 +4976,7 @@ struct pdumper_loaded_dump_private
4971 /* Copy of the header we read from the dump. */ 4976 /* Copy of the header we read from the dump. */
4972 struct dump_header header; 4977 struct dump_header header;
4973 /* Mark bits for objects in the dump; used during GC. */ 4978 /* Mark bits for objects in the dump; used during GC. */
4974 struct dump_bitset mark_bits; 4979 struct dump_bitset mark_bits, last_mark_bits;
4975 /* Time taken to load the dump. */ 4980 /* Time taken to load the dump. */
4976 double load_time; 4981 double load_time;
4977 /* Dump file name. */ 4982 /* Dump file name. */
@@ -5094,6 +5099,10 @@ pdumper_find_object_type_impl (const void *obj)
5094 dump_off offset = ptrdiff_t_to_dump_off ((uintptr_t) obj - dump_public.start); 5099 dump_off offset = ptrdiff_t_to_dump_off ((uintptr_t) obj - dump_public.start);
5095 if (offset % DUMP_ALIGNMENT != 0) 5100 if (offset % DUMP_ALIGNMENT != 0)
5096 return PDUMPER_NO_OBJECT; 5101 return PDUMPER_NO_OBJECT;
5102 ptrdiff_t bitno = offset / DUMP_ALIGNMENT;
5103 if (offset < dump_private.header.discardable_start
5104 && !dump_bitset_bit_set_p (&dump_private.last_mark_bits, bitno))
5105 return PDUMPER_NO_OBJECT;
5097 const struct dump_reloc *reloc = 5106 const struct dump_reloc *reloc =
5098 dump_find_relocation (&dump_private.header.object_starts, offset); 5107 dump_find_relocation (&dump_private.header.object_starts, offset);
5099 return (reloc != NULL && dump_reloc_get_offset (*reloc) == offset) 5108 return (reloc != NULL && dump_reloc_get_offset (*reloc) == offset)
@@ -5122,12 +5131,16 @@ pdumper_set_marked_impl (const void *obj)
5122 eassert (offset < dump_private.header.cold_start); 5131 eassert (offset < dump_private.header.cold_start);
5123 eassert (offset < dump_private.header.discardable_start); 5132 eassert (offset < dump_private.header.discardable_start);
5124 ptrdiff_t bitno = offset / DUMP_ALIGNMENT; 5133 ptrdiff_t bitno = offset / DUMP_ALIGNMENT;
5134 eassert (dump_bitset_bit_set_p (&dump_private.last_mark_bits, bitno));
5125 dump_bitset_set_bit (&dump_private.mark_bits, bitno); 5135 dump_bitset_set_bit (&dump_private.mark_bits, bitno);
5126} 5136}
5127 5137
5128void 5138void
5129pdumper_clear_marks_impl (void) 5139pdumper_clear_marks_impl (void)
5130{ 5140{
5141 dump_bitset_word *swap = dump_private.last_mark_bits.bits;
5142 dump_private.last_mark_bits.bits = dump_private.mark_bits.bits;
5143 dump_private.mark_bits.bits = swap;
5131 dump_bitset_clear (&dump_private.mark_bits); 5144 dump_bitset_clear (&dump_private.mark_bits);
5132} 5145}
5133 5146
@@ -5249,9 +5262,13 @@ dump_do_dump_relocation (const uintptr_t dump_base,
5249 { 5262 {
5250 fclose (file); 5263 fclose (file);
5251 installation_state = INSTALLED; 5264 installation_state = INSTALLED;
5265 fixup_eln_load_path (XCAR (comp_u->file));
5252 } 5266 }
5253 else 5267 else
5254 installation_state = LOCAL_BUILD; 5268 {
5269 installation_state = LOCAL_BUILD;
5270 fixup_eln_load_path (XCDR (comp_u->file));
5271 }
5255 } 5272 }
5256 5273
5257 comp_u->file = 5274 comp_u->file =
@@ -5423,7 +5440,7 @@ pdumper_load (const char *dump_filename, char *argv0, char const *original_pwd)
5423 int dump_page_size; 5440 int dump_page_size;
5424 dump_off adj_discardable_start; 5441 dump_off adj_discardable_start;
5425 5442
5426 struct dump_bitset mark_bits; 5443 struct dump_bitset mark_bits[2];
5427 size_t mark_bits_needed; 5444 size_t mark_bits_needed;
5428 5445
5429 struct dump_header header_buf = { 0 }; 5446 struct dump_header header_buf = { 0 };
@@ -5537,7 +5554,7 @@ pdumper_load (const char *dump_filename, char *argv0, char const *original_pwd)
5537 err = PDUMPER_LOAD_ERROR; 5554 err = PDUMPER_LOAD_ERROR;
5538 mark_bits_needed = 5555 mark_bits_needed =
5539 divide_round_up (header->discardable_start, DUMP_ALIGNMENT); 5556 divide_round_up (header->discardable_start, DUMP_ALIGNMENT);
5540 if (!dump_bitset_init (&mark_bits, mark_bits_needed)) 5557 if (!dump_bitsets_init (mark_bits, mark_bits_needed))
5541 goto out; 5558 goto out;
5542 5559
5543 /* Point of no return. */ 5560 /* Point of no return. */
@@ -5545,7 +5562,8 @@ pdumper_load (const char *dump_filename, char *argv0, char const *original_pwd)
5545 dump_base = (uintptr_t) sections[DS_HOT].mapping; 5562 dump_base = (uintptr_t) sections[DS_HOT].mapping;
5546 gflags.dumped_with_pdumper_ = true; 5563 gflags.dumped_with_pdumper_ = true;
5547 dump_private.header = *header; 5564 dump_private.header = *header;
5548 dump_private.mark_bits = mark_bits; 5565 dump_private.mark_bits = mark_bits[0];
5566 dump_private.last_mark_bits = mark_bits[1];
5549 dump_public.start = dump_base; 5567 dump_public.start = dump_base;
5550 dump_public.end = dump_public.start + dump_size; 5568 dump_public.end = dump_public.start + dump_size;
5551 5569
diff --git a/src/search.c b/src/search.c
index 38c64caf7c0..6fb3716cd43 100644
--- a/src/search.c
+++ b/src/search.c
@@ -3271,7 +3271,7 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */)
3271 TYPE_MAXIMUM (ptrdiff_t), &nl_count_cache, NULL, true); 3271 TYPE_MAXIMUM (ptrdiff_t), &nl_count_cache, NULL, true);
3272 3272
3273 /* Create vector and populate it. */ 3273 /* Create vector and populate it. */
3274 cache_newlines = make_uninit_vector (nl_count_cache); 3274 cache_newlines = make_vector (nl_count_cache, make_fixnum (-1));
3275 3275
3276 if (nl_count_cache) 3276 if (nl_count_cache)
3277 { 3277 {
@@ -3285,15 +3285,12 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */)
3285 break; 3285 break;
3286 ASET (cache_newlines, i, make_fixnum (found - 1)); 3286 ASET (cache_newlines, i, make_fixnum (found - 1));
3287 } 3287 }
3288 /* Fill the rest of slots with an invalid position. */
3289 for ( ; i < nl_count_cache; i++)
3290 ASET (cache_newlines, i, make_fixnum (-1));
3291 } 3288 }
3292 3289
3293 /* Now do the same, but without using the cache. */ 3290 /* Now do the same, but without using the cache. */
3294 find_newline1 (BEGV, BEGV_BYTE, ZV, ZV_BYTE, 3291 find_newline1 (BEGV, BEGV_BYTE, ZV, ZV_BYTE,
3295 TYPE_MAXIMUM (ptrdiff_t), &nl_count_buf, NULL, true); 3292 TYPE_MAXIMUM (ptrdiff_t), &nl_count_buf, NULL, true);
3296 buf_newlines = make_uninit_vector (nl_count_buf); 3293 buf_newlines = make_vector (nl_count_buf, make_fixnum (-1));
3297 if (nl_count_buf) 3294 if (nl_count_buf)
3298 { 3295 {
3299 for (from = BEGV, found = from, i = 0; from < ZV; from = found, i++) 3296 for (from = BEGV, found = from, i = 0; from < ZV; from = found, i++)
@@ -3306,14 +3303,10 @@ the buffer. If the buffer doesn't have a cache, the value is nil. */)
3306 break; 3303 break;
3307 ASET (buf_newlines, i, make_fixnum (found - 1)); 3304 ASET (buf_newlines, i, make_fixnum (found - 1));
3308 } 3305 }
3309 for ( ; i < nl_count_buf; i++)
3310 ASET (buf_newlines, i, make_fixnum (-1));
3311 } 3306 }
3312 3307
3313 /* Construct the value and return it. */ 3308 /* Construct the value and return it. */
3314 val = make_uninit_vector (2); 3309 val = CALLN (Fvector, cache_newlines, buf_newlines);
3315 ASET (val, 0, cache_newlines);
3316 ASET (val, 1, buf_newlines);
3317 3310
3318 if (old != NULL) 3311 if (old != NULL)
3319 set_buffer_internal_1 (old); 3312 set_buffer_internal_1 (old);
diff --git a/src/syntax.c b/src/syntax.c
index a03202d386c..9f77ea5f9b0 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3617,9 +3617,9 @@ init_syntax_once (void)
3617 DEFSYM (Qsyntax_table, "syntax-table"); 3617 DEFSYM (Qsyntax_table, "syntax-table");
3618 3618
3619 /* Create objects which can be shared among syntax tables. */ 3619 /* Create objects which can be shared among syntax tables. */
3620 Vsyntax_code_object = make_uninit_vector (Smax); 3620 Vsyntax_code_object = make_nil_vector (Smax);
3621 for (i = 0; i < Smax; i++) 3621 for (i = 0; i < Smax; i++)
3622 ASET (Vsyntax_code_object, i, Fcons (make_fixnum (i), Qnil)); 3622 ASET (Vsyntax_code_object, i, list1 (make_fixnum (i)));
3623 3623
3624 /* Now we are ready to set up this property, so we can 3624 /* Now we are ready to set up this property, so we can
3625 create syntax tables. */ 3625 create syntax tables. */
diff --git a/src/sysdep.c b/src/sysdep.c
index 6b54ed3b6ec..a1050c4309a 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -49,10 +49,14 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
49# include <cygwin/fs.h> 49# include <cygwin/fs.h>
50#endif 50#endif
51 51
52#if defined DARWIN_OS || defined __FreeBSD__ 52#if defined DARWIN_OS || defined __FreeBSD__ || defined __OpenBSD__
53# include <sys/sysctl.h> 53# include <sys/sysctl.h>
54#endif 54#endif
55 55
56#ifdef DARWIN_OS
57# include <libproc.h>
58#endif
59
56#ifdef __FreeBSD__ 60#ifdef __FreeBSD__
57/* Sparc/ARM machine/frame.h has 'struct frame' which conflicts with Emacs's 61/* Sparc/ARM machine/frame.h has 'struct frame' which conflicts with Emacs's
58 'struct frame', so rename it. */ 62 'struct frame', so rename it. */
@@ -3061,37 +3065,43 @@ list_system_processes (void)
3061 return proclist; 3065 return proclist;
3062} 3066}
3063 3067
3064#elif defined DARWIN_OS || defined __FreeBSD__ 3068#elif defined DARWIN_OS || defined __FreeBSD__ || defined __OpenBSD__
3065 3069
3066Lisp_Object 3070Lisp_Object
3067list_system_processes (void) 3071list_system_processes (void)
3068{ 3072{
3069#ifdef DARWIN_OS 3073#ifdef DARWIN_OS
3070 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; 3074 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL};
3075#elif defined __OpenBSD__
3076 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0,
3077 sizeof (struct kinfo_proc), 4096};
3071#else 3078#else
3072 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC}; 3079 int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PROC};
3073#endif 3080#endif
3074 size_t len; 3081 size_t len;
3082 size_t mibsize = sizeof mib / sizeof mib[0];
3075 struct kinfo_proc *procs; 3083 struct kinfo_proc *procs;
3076 size_t i; 3084 size_t i;
3077 3085
3078 Lisp_Object proclist = Qnil; 3086 Lisp_Object proclist = Qnil;
3079 3087
3080 if (sysctl (mib, 3, NULL, &len, NULL, 0) != 0 || len == 0) 3088 if (sysctl (mib, mibsize, NULL, &len, NULL, 0) != 0 || len == 0)
3081 return proclist; 3089 return proclist;
3082 3090
3083 procs = xmalloc (len); 3091 procs = xmalloc (len);
3084 if (sysctl (mib, 3, procs, &len, NULL, 0) != 0 || len == 0) 3092 if (sysctl (mib, mibsize, procs, &len, NULL, 0) != 0 || len == 0)
3085 { 3093 {
3086 xfree (procs); 3094 xfree (procs);
3087 return proclist; 3095 return proclist;
3088 } 3096 }
3089 3097
3090 len /= sizeof (struct kinfo_proc); 3098 len /= sizeof procs[0];
3091 for (i = 0; i < len; i++) 3099 for (i = 0; i < len; i++)
3092 { 3100 {
3093#ifdef DARWIN_OS 3101#ifdef DARWIN_OS
3094 proclist = Fcons (INT_TO_INTEGER (procs[i].kp_proc.p_pid), proclist); 3102 proclist = Fcons (INT_TO_INTEGER (procs[i].kp_proc.p_pid), proclist);
3103#elif defined __OpenBSD__
3104 proclist = Fcons (INT_TO_INTEGER (procs[i].p_pid), proclist);
3095#else 3105#else
3096 proclist = Fcons (INT_TO_INTEGER (procs[i].ki_pid), proclist); 3106 proclist = Fcons (INT_TO_INTEGER (procs[i].ki_pid), proclist);
3097#endif 3107#endif
@@ -3865,8 +3875,21 @@ system_process_attributes (Lisp_Object pid)
3865 if (gr) 3875 if (gr)
3866 attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs); 3876 attrs = Fcons (Fcons (Qgroup, build_string (gr->gr_name)), attrs);
3867 3877
3878 char pathbuf[PROC_PIDPATHINFO_MAXSIZE];
3879 char *comm;
3880
3881 if (proc_pidpath (proc_id, pathbuf, sizeof(pathbuf)) > 0)
3882 {
3883 if ((comm = strrchr (pathbuf, '/')))
3884 comm++;
3885 else
3886 comm = pathbuf;
3887 }
3888 else
3889 comm = proc.kp_proc.p_comm;
3890
3868 decoded_comm = (code_convert_string_norecord 3891 decoded_comm = (code_convert_string_norecord
3869 (build_unibyte_string (proc.kp_proc.p_comm), 3892 (build_unibyte_string (comm),
3870 Vlocale_coding_system, 0)); 3893 Vlocale_coding_system, 0));
3871 3894
3872 attrs = Fcons (Fcons (Qcomm, decoded_comm), attrs); 3895 attrs = Fcons (Fcons (Qcomm, decoded_comm), attrs);
diff --git a/src/timefns.c b/src/timefns.c
index 94cfddf0da9..71d5e10872a 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -1312,11 +1312,12 @@ or (if you need time as a string) `format-time-string'. */)
1312 ((size_t) -1) for MAXSIZE. 1312 ((size_t) -1) for MAXSIZE.
1313 1313
1314 This function behaves like nstrftime, except it allows NUL 1314 This function behaves like nstrftime, except it allows NUL
1315 bytes in FORMAT and it does not support nanoseconds. */ 1315 bytes in FORMAT. */
1316static size_t 1316static size_t
1317emacs_nmemftime (char *s, size_t maxsize, const char *format, 1317emacs_nmemftime (char *s, size_t maxsize, const char *format,
1318 size_t format_len, const struct tm *tp, timezone_t tz, int ns) 1318 size_t format_len, const struct tm *tp, timezone_t tz, int ns)
1319{ 1319{
1320 int saved_errno = errno;
1320 size_t total = 0; 1321 size_t total = 0;
1321 1322
1322 /* Loop through all the NUL-terminated strings in the format 1323 /* Loop through all the NUL-terminated strings in the format
@@ -1326,30 +1327,25 @@ emacs_nmemftime (char *s, size_t maxsize, const char *format,
1326 '\0' byte so we must invoke it separately for each such string. */ 1327 '\0' byte so we must invoke it separately for each such string. */
1327 for (;;) 1328 for (;;)
1328 { 1329 {
1329 size_t len; 1330 errno = 0;
1330 size_t result; 1331 size_t result = nstrftime (s, maxsize, format, tp, tz, ns);
1331 1332 if (result == 0 && errno != 0)
1333 return result;
1332 if (s) 1334 if (s)
1333 s[0] = '\1'; 1335 s += result + 1;
1334
1335 result = nstrftime (s, maxsize, format, tp, tz, ns);
1336
1337 if (s)
1338 {
1339 if (result == 0 && s[0] != '\0')
1340 return 0;
1341 s += result + 1;
1342 }
1343 1336
1344 maxsize -= result + 1; 1337 maxsize -= result + 1;
1345 total += result; 1338 total += result;
1346 len = strlen (format); 1339 size_t len = strlen (format);
1347 if (len == format_len) 1340 if (len == format_len)
1348 return total; 1341 break;
1349 total++; 1342 total++;
1350 format += len + 1; 1343 format += len + 1;
1351 format_len -= len + 1; 1344 format_len -= len + 1;
1352 } 1345 }
1346
1347 errno = saved_errno;
1348 return total;
1353} 1349}
1354 1350
1355static Lisp_Object 1351static Lisp_Object
@@ -1379,10 +1375,11 @@ format_time_string (char const *format, ptrdiff_t formatlen,
1379 1375
1380 while (true) 1376 while (true)
1381 { 1377 {
1382 buf[0] = '\1'; 1378 errno = 0;
1383 len = emacs_nmemftime (buf, size, format, formatlen, tmp, tz, ns); 1379 len = emacs_nmemftime (buf, size, format, formatlen, tmp, tz, ns);
1384 if ((0 < len && len < size) || (len == 0 && buf[0] == '\0')) 1380 if (len != 0 || errno == 0)
1385 break; 1381 break;
1382 eassert (errno == ERANGE);
1386 1383
1387 /* Buffer was too small, so make it bigger and try again. */ 1384 /* Buffer was too small, so make it bigger and try again. */
1388 len = emacs_nmemftime (NULL, SIZE_MAX, format, formatlen, tmp, tz, ns); 1385 len = emacs_nmemftime (NULL, SIZE_MAX, format, formatlen, tmp, tz, ns);
diff --git a/src/window.c b/src/window.c
index e2dea8b70ef..ef58f43a0bd 100644
--- a/src/window.c
+++ b/src/window.c
@@ -7465,7 +7465,7 @@ saved by this function. */)
7465 data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil; 7465 data->minibuf_selected_window = minibuf_level > 0 ? minibuf_selected_window : Qnil;
7466 data->root_window = FRAME_ROOT_WINDOW (f); 7466 data->root_window = FRAME_ROOT_WINDOW (f);
7467 data->focus_frame = FRAME_FOCUS_FRAME (f); 7467 data->focus_frame = FRAME_FOCUS_FRAME (f);
7468 Lisp_Object tem = make_uninit_vector (n_windows); 7468 Lisp_Object tem = make_nil_vector (n_windows);
7469 data->saved_windows = tem; 7469 data->saved_windows = tem;
7470 for (ptrdiff_t i = 0; i < n_windows; i++) 7470 for (ptrdiff_t i = 0; i < n_windows; i++)
7471 ASET (tem, i, make_nil_vector (VECSIZE (struct saved_window))); 7471 ASET (tem, i, make_nil_vector (VECSIZE (struct saved_window)));
diff --git a/src/xdisp.c b/src/xdisp.c
index 4fe1c4288af..ad03ac46054 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -180,8 +180,8 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
180 present (non-empty) only if the corresponding display margin is 180 present (non-empty) only if the corresponding display margin is
181 shown in the window. If the glyph array for a marginal area is not 181 shown in the window. If the glyph array for a marginal area is not
182 present its beginning and end coincide, i.e. such arrays are 182 present its beginning and end coincide, i.e. such arrays are
183 actually empty (they contain no glyphs). Frame glyph matrics, used 183 actually empty (they contain no glyphs). Frame glyph matrices, used
184 on text-mode terminals (see below) never have marginal areas, they 184 on text-mode terminals (see below) never have marginal areas; they
185 treat the entire frame-wide row of glyphs as a single large "text 185 treat the entire frame-wide row of glyphs as a single large "text
186 area". 186 area".
187 187
@@ -7555,7 +7555,7 @@ get_next_display_element (struct it *it)
7555 /* Merge `nobreak-space' into the current face. */ 7555 /* Merge `nobreak-space' into the current face. */
7556 face_id = merge_faces (it->w, Qnobreak_space, 0, 7556 face_id = merge_faces (it->w, Qnobreak_space, 0,
7557 it->face_id); 7557 it->face_id);
7558 XSETINT (it->ctl_chars[0], ' '); 7558 XSETINT (it->ctl_chars[0], it->c);
7559 ctl_len = 1; 7559 ctl_len = 1;
7560 goto display_control; 7560 goto display_control;
7561 } 7561 }
@@ -7568,7 +7568,7 @@ get_next_display_element (struct it *it)
7568 /* Merge `nobreak-space' into the current face. */ 7568 /* Merge `nobreak-space' into the current face. */
7569 face_id = merge_faces (it->w, Qnobreak_hyphen, 0, 7569 face_id = merge_faces (it->w, Qnobreak_hyphen, 0,
7570 it->face_id); 7570 it->face_id);
7571 XSETINT (it->ctl_chars[0], '-'); 7571 XSETINT (it->ctl_chars[0], it->c);
7572 ctl_len = 1; 7572 ctl_len = 1;
7573 goto display_control; 7573 goto display_control;
7574 } 7574 }
diff --git a/src/xfaces.c b/src/xfaces.c
index 2c6e593f631..06d2f994de6 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -1572,22 +1572,18 @@ the face font sort order. */)
1572 for (i = nfonts - 1; i >= 0; --i) 1572 for (i = nfonts - 1; i >= 0; --i)
1573 { 1573 {
1574 Lisp_Object font = AREF (vec, i); 1574 Lisp_Object font = AREF (vec, i);
1575 Lisp_Object v = make_uninit_vector (8); 1575 int point = PIXEL_TO_POINT (XFIXNUM (AREF (font, FONT_SIZE_INDEX)) * 10,
1576 int point; 1576 FRAME_RES_Y (f));
1577 Lisp_Object spacing; 1577 Lisp_Object spacing = Ffont_get (font, QCspacing);
1578 1578 Lisp_Object v = CALLN (Fvector,
1579 ASET (v, 0, AREF (font, FONT_FAMILY_INDEX)); 1579 AREF (font, FONT_FAMILY_INDEX),
1580 ASET (v, 1, FONT_WIDTH_SYMBOLIC (font)); 1580 FONT_WIDTH_SYMBOLIC (font),
1581 point = PIXEL_TO_POINT (XFIXNUM (AREF (font, FONT_SIZE_INDEX)) * 10, 1581 make_fixnum (point),
1582 FRAME_RES_Y (f)); 1582 FONT_WEIGHT_SYMBOLIC (font),
1583 ASET (v, 2, make_fixnum (point)); 1583 FONT_SLANT_SYMBOLIC (font),
1584 ASET (v, 3, FONT_WEIGHT_SYMBOLIC (font)); 1584 NILP (spacing) || EQ (spacing, Qp) ? Qnil : Qt,
1585 ASET (v, 4, FONT_SLANT_SYMBOLIC (font)); 1585 Ffont_xlfd_name (font, Qnil),
1586 spacing = Ffont_get (font, QCspacing); 1586 AREF (font, FONT_REGISTRY_INDEX));
1587 ASET (v, 5, (NILP (spacing) || EQ (spacing, Qp)) ? Qnil : Qt);
1588 ASET (v, 6, Ffont_xlfd_name (font, Qnil));
1589 ASET (v, 7, AREF (font, FONT_REGISTRY_INDEX));
1590
1591 result = Fcons (v, result); 1587 result = Fcons (v, result);
1592 } 1588 }
1593 1589
diff --git a/src/xfns.c b/src/xfns.c
index 09dcbbfb92d..78f977bf0aa 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5890,7 +5890,8 @@ If WINDOW-ID is non-nil, change the property of that window instead
5890 elsize = element_format == 32 ? sizeof (long) : element_format >> 3; 5890 elsize = element_format == 32 ? sizeof (long) : element_format >> 3;
5891 data = xnmalloc (nelements, elsize); 5891 data = xnmalloc (nelements, elsize);
5892 5892
5893 x_fill_property_data (FRAME_X_DISPLAY (f), value, data, element_format); 5893 x_fill_property_data (FRAME_X_DISPLAY (f), value, data, nelements,
5894 element_format);
5894 } 5895 }
5895 else 5896 else
5896 { 5897 {
@@ -6196,10 +6197,10 @@ Otherwise, the return value is a vector with the following fields:
6196 { 6197 {
6197 XFree (tmp_data); 6198 XFree (tmp_data);
6198 6199
6199 prop_attr = make_uninit_vector (3); 6200 prop_attr = CALLN (Fvector,
6200 ASET (prop_attr, 0, make_fixnum (actual_type)); 6201 make_fixnum (actual_type),
6201 ASET (prop_attr, 1, make_fixnum (actual_format)); 6202 make_fixnum (actual_format),
6202 ASET (prop_attr, 2, make_fixnum (bytes_remaining / (actual_format >> 3))); 6203 make_fixnum (bytes_remaining / (actual_format >> 3)));
6203 } 6204 }
6204 6205
6205 unblock_input (); 6206 unblock_input ();
@@ -8027,7 +8028,7 @@ If this equals the symbol 'resize-mode', Emacs uses GTK's resize mode to
8027always trigger an immediate resize of the child frame. This method is 8028always trigger an immediate resize of the child frame. This method is
8028deprecated by GTK and may not work in future versions of that toolkit. 8029deprecated by GTK and may not work in future versions of that toolkit.
8029It also may freeze Emacs when used with other desktop environments. It 8030It also may freeze Emacs when used with other desktop environments. It
8030avoids, however, the unpleasent flicker induced by the hiding approach. 8031avoids, however, the unpleasant flicker induced by the hiding approach.
8031 8032
8032This variable is considered a temporary workaround and will be hopefully 8033This variable is considered a temporary workaround and will be hopefully
8033eliminated in future versions of Emacs. */); 8034eliminated in future versions of Emacs. */);
diff --git a/src/xrdb.c b/src/xrdb.c
index e3a1fcb15a9..3d7f715c88f 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -289,9 +289,9 @@ get_user_app (const char *class)
289 /* Check in the home directory. This is a bit of a hack; let's 289 /* Check in the home directory. This is a bit of a hack; let's
290 hope one's home directory doesn't contain ':' or '%'. */ 290 hope one's home directory doesn't contain ':' or '%'. */
291 char const *home = get_homedir (); 291 char const *home = get_homedir ();
292 db = search_magic_path (home, class, "%L/%N"); 292 db = search_magic_path (home, class, "/%L/%N");
293 if (! db) 293 if (! db)
294 db = search_magic_path (home, class, "%N"); 294 db = search_magic_path (home, class, "/%N");
295 } 295 }
296 296
297 return db; 297 return db;
diff --git a/src/xselect.c b/src/xselect.c
index 48d6215a7bb..383aebf96c8 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -1594,7 +1594,7 @@ selection_data_to_lisp_data (struct x_display_info *dpyinfo,
1594 return x_atom_to_symbol (dpyinfo, (Atom) idata[0]); 1594 return x_atom_to_symbol (dpyinfo, (Atom) idata[0]);
1595 else 1595 else
1596 { 1596 {
1597 Lisp_Object v = make_uninit_vector (size / sizeof (int)); 1597 Lisp_Object v = make_nil_vector (size / sizeof (int));
1598 1598
1599 for (i = 0; i < size / sizeof (int); i++) 1599 for (i = 0; i < size / sizeof (int); i++)
1600 ASET (v, i, x_atom_to_symbol (dpyinfo, (Atom) idata[i])); 1600 ASET (v, i, x_atom_to_symbol (dpyinfo, (Atom) idata[i]));
@@ -1653,7 +1653,7 @@ selection_data_to_lisp_data (struct x_display_info *dpyinfo,
1653 else 1653 else
1654 { 1654 {
1655 ptrdiff_t i; 1655 ptrdiff_t i;
1656 Lisp_Object v = make_uninit_vector (size / X_LONG_SIZE); 1656 Lisp_Object v = make_nil_vector (size / X_LONG_SIZE);
1657 1657
1658 if (type == XA_INTEGER) 1658 if (type == XA_INTEGER)
1659 { 1659 {
@@ -1860,7 +1860,7 @@ clean_local_selection_data (Lisp_Object obj)
1860 Lisp_Object copy; 1860 Lisp_Object copy;
1861 if (size == 1) 1861 if (size == 1)
1862 return clean_local_selection_data (AREF (obj, 0)); 1862 return clean_local_selection_data (AREF (obj, 0));
1863 copy = make_uninit_vector (size); 1863 copy = make_nil_vector (size);
1864 for (i = 0; i < size; i++) 1864 for (i = 0; i < size; i++)
1865 ASET (copy, i, clean_local_selection_data (AREF (obj, i))); 1865 ASET (copy, i, clean_local_selection_data (AREF (obj, i)));
1866 return copy; 1866 return copy;
@@ -2276,23 +2276,28 @@ x_check_property_data (Lisp_Object data)
2276 2276
2277 DPY is the display use to look up X atoms. 2277 DPY is the display use to look up X atoms.
2278 DATA is a Lisp list of values to be converted. 2278 DATA is a Lisp list of values to be converted.
2279 RET is the C array that contains the converted values. It is assumed 2279 RET is the C array that contains the converted values.
2280 it is big enough to hold all values. 2280 NELEMENTS_MAX is the number of values that will fit in RET.
2281 Any excess values in DATA are ignored.
2281 FORMAT is 8, 16 or 32 and denotes char/short/long for each C value to 2282 FORMAT is 8, 16 or 32 and denotes char/short/long for each C value to
2282 be stored in RET. Note that long is used for 32 even if long is more 2283 be stored in RET. Note that long is used for 32 even if long is more
2283 than 32 bits (see man pages for XChangeProperty, XGetWindowProperty and 2284 than 32 bits (see man pages for XChangeProperty, XGetWindowProperty and
2284 XClientMessageEvent). */ 2285 XClientMessageEvent). */
2285 2286
2286void 2287void
2287x_fill_property_data (Display *dpy, Lisp_Object data, void *ret, int format) 2288x_fill_property_data (Display *dpy, Lisp_Object data, void *ret,
2289 int nelements_max, int format)
2288{ 2290{
2289 unsigned long val; 2291 unsigned long val;
2290 unsigned long *d32 = (unsigned long *) ret; 2292 unsigned long *d32 = (unsigned long *) ret;
2291 unsigned short *d16 = (unsigned short *) ret; 2293 unsigned short *d16 = (unsigned short *) ret;
2292 unsigned char *d08 = (unsigned char *) ret; 2294 unsigned char *d08 = (unsigned char *) ret;
2295 int nelements;
2293 Lisp_Object iter; 2296 Lisp_Object iter;
2294 2297
2295 for (iter = data; CONSP (iter); iter = XCDR (iter)) 2298 for (iter = data, nelements = 0;
2299 CONSP (iter) && nelements < nelements_max;
2300 iter = XCDR (iter), nelements++)
2296 { 2301 {
2297 Lisp_Object o = XCAR (iter); 2302 Lisp_Object o = XCAR (iter);
2298 2303
@@ -2593,7 +2598,9 @@ x_send_client_event (Lisp_Object display, Lisp_Object dest, Lisp_Object from,
2593 event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest; 2598 event.xclient.window = to_root ? FRAME_OUTER_WINDOW (f) : wdest;
2594 2599
2595 memset (event.xclient.data.l, 0, sizeof (event.xclient.data.l)); 2600 memset (event.xclient.data.l, 0, sizeof (event.xclient.data.l));
2601 /* event.xclient.data can hold 20 chars, 10 shorts, or 5 longs. */
2596 x_fill_property_data (dpyinfo->display, values, event.xclient.data.b, 2602 x_fill_property_data (dpyinfo->display, values, event.xclient.data.b,
2603 5 * 32 / event.xclient.format,
2597 event.xclient.format); 2604 event.xclient.format);
2598 2605
2599 /* If event mask is 0 the event is sent to the client that created 2606 /* If event mask is 0 the event is sent to the client that created
diff --git a/src/xterm.c b/src/xterm.c
index 6340700cb89..2e0407aff40 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8760,6 +8760,20 @@ handle_one_xevent (struct x_display_info *dpyinfo,
8760 goto OTHER; 8760 goto OTHER;
8761 8761
8762 case FocusIn: 8762 case FocusIn:
8763 /* Some WMs (e.g. Mutter in Gnome Shell), don't unmap
8764 minimized/iconified windows; thus, for those WMs we won't get
8765 a MapNotify when unminimizing/deconifying. Check here if we
8766 are deconizing a window (Bug42655). */
8767 f = any;
8768 if (f && FRAME_ICONIFIED_P (f))
8769 {
8770 SET_FRAME_VISIBLE (f, 1);
8771 SET_FRAME_ICONIFIED (f, false);
8772 f->output_data.x->has_been_visible = true;
8773 inev.ie.kind = DEICONIFY_EVENT;
8774 XSETFRAME (inev.ie.frame_or_window, f);
8775 }
8776
8763 x_detect_focus_change (dpyinfo, any, event, &inev.ie); 8777 x_detect_focus_change (dpyinfo, any, event, &inev.ie);
8764 goto OTHER; 8778 goto OTHER;
8765 8779
@@ -9907,6 +9921,13 @@ x_uncatch_errors (void)
9907{ 9921{
9908 struct x_error_message_stack *tmp; 9922 struct x_error_message_stack *tmp;
9909 9923
9924 /* In rare situations when running Emacs run in daemon mode,
9925 shutting down an emacsclient via delete-frame can cause
9926 x_uncatch_errors to be called when x_error_message is set to
9927 NULL. */
9928 if (x_error_message == NULL)
9929 return;
9930
9910 block_input (); 9931 block_input ();
9911 9932
9912 /* The display may have been closed before this function is called. 9933 /* The display may have been closed before this function is called.
diff --git a/src/xterm.h b/src/xterm.h
index bc10043c54c..db8d5847814 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -1207,6 +1207,7 @@ extern int x_check_property_data (Lisp_Object);
1207extern void x_fill_property_data (Display *, 1207extern void x_fill_property_data (Display *,
1208 Lisp_Object, 1208 Lisp_Object,
1209 void *, 1209 void *,
1210 int,
1210 int); 1211 int);
1211extern Lisp_Object x_property_data_to_lisp (struct frame *, 1212extern Lisp_Object x_property_data_to_lisp (struct frame *,
1212 const unsigned char *, 1213 const unsigned char *,
diff --git a/src/xwidget.c b/src/xwidget.c
index c61f5bef88d..154b3e9c82c 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -343,7 +343,7 @@ webkit_js_to_lisp (JSCValue *value)
343 memory_full (SIZE_MAX); 343 memory_full (SIZE_MAX);
344 344
345 ptrdiff_t n = dlen; 345 ptrdiff_t n = dlen;
346 struct Lisp_Vector *p = allocate_vector (n); 346 struct Lisp_Vector *p = allocate_nil_vector (n);
347 347
348 for (ptrdiff_t i = 0; i < n; ++i) 348 for (ptrdiff_t i = 0; i < n; ++i)
349 { 349 {
@@ -361,7 +361,7 @@ webkit_js_to_lisp (JSCValue *value)
361 Lisp_Object obj; 361 Lisp_Object obj;
362 if (PTRDIFF_MAX < n) 362 if (PTRDIFF_MAX < n)
363 memory_full (n); 363 memory_full (n);
364 struct Lisp_Vector *p = allocate_vector (n); 364 struct Lisp_Vector *p = allocate_nil_vector (n);
365 365
366 for (ptrdiff_t i = 0; i < n; ++i) 366 for (ptrdiff_t i = 0; i < n; ++i)
367 { 367 {
diff --git a/test/lisp/cedet/srecode-utest-template.el b/test/lisp/cedet/srecode-utest-template.el
index 63c33a3c440..7c5bbc599a3 100644
--- a/test/lisp/cedet/srecode-utest-template.el
+++ b/test/lisp/cedet/srecode-utest-template.el
@@ -323,7 +323,6 @@ INSIDE SECTION: ARG HANDLER ONE")
323 323
324(ert-deftest srecode-utest-project () 324(ert-deftest srecode-utest-project ()
325 "Test that project filtering works." 325 "Test that project filtering works."
326 :expected-result (if (getenv "EMACS_HYDRA_CI") :failed :passed) ; fixme
327 (save-excursion 326 (save-excursion
328 (let ((testbuff (find-file-noselect srecode-utest-testfile)) 327 (let ((testbuff (find-file-noselect srecode-utest-testfile))
329 (temp nil)) 328 (temp nil))
@@ -347,6 +346,10 @@ INSIDE SECTION: ARG HANDLER ONE")
347 ;; Load the application templates, and make sure we can find them. 346 ;; Load the application templates, and make sure we can find them.
348 (srecode-load-tables-for-mode major-mode 'tests) 347 (srecode-load-tables-for-mode major-mode 'tests)
349 348
349 (dolist (table (oref (srecode-table) tables))
350 (when (gethash "test" (oref table contexthash))
351 (oset table project default-directory)))
352
350 (setq temp (srecode-template-get-table (srecode-table) 353 (setq temp (srecode-template-get-table (srecode-table)
351 "test-project" 354 "test-project"
352 "test" 355 "test"
diff --git a/test/lisp/emacs-lisp/bytecomp-tests.el b/test/lisp/emacs-lisp/bytecomp-tests.el
index 894914300ae..834e3b6d914 100644
--- a/test/lisp/emacs-lisp/bytecomp-tests.el
+++ b/test/lisp/emacs-lisp/bytecomp-tests.el
@@ -365,24 +365,24 @@ bytecompiled code, and their results compared.")
365(defun bytecomp-check-1 (pat) 365(defun bytecomp-check-1 (pat)
366 "Return non-nil if PAT is the same whether directly evalled or compiled." 366 "Return non-nil if PAT is the same whether directly evalled or compiled."
367 (let ((warning-minimum-log-level :emergency) 367 (let ((warning-minimum-log-level :emergency)
368 (byte-compile-warnings nil) 368 (byte-compile-warnings nil)
369 (v0 (condition-case nil 369 (v0 (condition-case err
370 (eval pat) 370 (eval pat)
371 (error 'bytecomp-check-error))) 371 (error (list 'bytecomp-check-error (car err)))))
372 (v1 (condition-case nil 372 (v1 (condition-case err
373 (funcall (byte-compile (list 'lambda nil pat))) 373 (funcall (byte-compile (list 'lambda nil pat)))
374 (error 'bytecomp-check-error)))) 374 (error (list 'bytecomp-check-error (car err))))))
375 (equal v0 v1))) 375 (equal v0 v1)))
376 376
377(put 'bytecomp-check-1 'ert-explainer 'bytecomp-explain-1) 377(put 'bytecomp-check-1 'ert-explainer 'bytecomp-explain-1)
378 378
379(defun bytecomp-explain-1 (pat) 379(defun bytecomp-explain-1 (pat)
380 (let ((v0 (condition-case nil 380 (let ((v0 (condition-case err
381 (eval pat) 381 (eval pat)
382 (error 'bytecomp-check-error))) 382 (error (list 'bytecomp-check-error (car err)))))
383 (v1 (condition-case nil 383 (v1 (condition-case err
384 (funcall (byte-compile (list 'lambda nil pat))) 384 (funcall (byte-compile (list 'lambda nil pat)))
385 (error 'bytecomp-check-error)))) 385 (error (list 'bytecomp-check-error (car err))))))
386 (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled." 386 (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
387 pat v0 v1))) 387 pat v0 v1)))
388 388
@@ -405,12 +405,12 @@ Subtests signal errors if something goes wrong."
405 (print-quoted t) 405 (print-quoted t)
406 v0 v1) 406 v0 v1)
407 (dolist (pat byte-opt-testsuite-arith-data) 407 (dolist (pat byte-opt-testsuite-arith-data)
408 (condition-case nil 408 (condition-case err
409 (setq v0 (eval pat)) 409 (setq v0 (eval pat))
410 (error (setq v0 'bytecomp-check-error))) 410 (error (setq v0 (list 'bytecomp-check-error (car err)))))
411 (condition-case nil 411 (condition-case err
412 (setq v1 (funcall (byte-compile (list 'lambda nil pat)))) 412 (setq v1 (funcall (byte-compile (list 'lambda nil pat))))
413 (error (setq v1 'bytecomp-check-error))) 413 (error (setq v1 (list 'bytecomp-check-error (car err)))))
414 (insert (format "%s" pat)) 414 (insert (format "%s" pat))
415 (indent-to-column 65) 415 (indent-to-column 65)
416 (if (equal v0 v1) 416 (if (equal v0 v1)
@@ -479,6 +479,7 @@ Subtests signal errors if something goes wrong."
479(ert-deftest bytecomp-tests--warnings () 479(ert-deftest bytecomp-tests--warnings ()
480 (with-current-buffer (get-buffer-create "*Compile-Log*") 480 (with-current-buffer (get-buffer-create "*Compile-Log*")
481 (let ((inhibit-read-only t)) (erase-buffer))) 481 (let ((inhibit-read-only t)) (erase-buffer)))
482 (mapc #'fmakunbound '(my-test0 my--test11 my--test12 my--test2))
482 (test-byte-comp-compile-and-load t 483 (test-byte-comp-compile-and-load t
483 '(progn 484 '(progn
484 (defun my-test0 () 485 (defun my-test0 ()
@@ -564,25 +565,25 @@ bytecompiled code, and their results compared.")
564 "Return non-nil if PAT is the same whether directly evalled or compiled." 565 "Return non-nil if PAT is the same whether directly evalled or compiled."
565 (let ((warning-minimum-log-level :emergency) 566 (let ((warning-minimum-log-level :emergency)
566 (byte-compile-warnings nil) 567 (byte-compile-warnings nil)
567 (v0 (condition-case nil 568 (v0 (condition-case err
568 (eval pat t) 569 (eval pat t)
569 (error 'bytecomp-check-error))) 570 (error (list 'bytecomp-check-error (car err)))))
570 (v1 (condition-case nil 571 (v1 (condition-case err
571 (funcall (let ((lexical-binding t)) 572 (funcall (let ((lexical-binding t))
572 (byte-compile `(lambda nil ,pat)))) 573 (byte-compile `(lambda nil ,pat))))
573 (error 'bytecomp-check-error)))) 574 (error (list 'bytecomp-check-error (car err))))))
574 (equal v0 v1))) 575 (equal v0 v1)))
575 576
576(put 'bytecomp-lexbind-check-1 'ert-explainer 'bytecomp-lexbind-explain-1) 577(put 'bytecomp-lexbind-check-1 'ert-explainer 'bytecomp-lexbind-explain-1)
577 578
578(defun bytecomp-lexbind-explain-1 (pat) 579(defun bytecomp-lexbind-explain-1 (pat)
579 (let ((v0 (condition-case nil 580 (let ((v0 (condition-case err
580 (eval pat t) 581 (eval pat t)
581 (error 'bytecomp-check-error))) 582 (error (list 'bytecomp-check-error (car err)))))
582 (v1 (condition-case nil 583 (v1 (condition-case err
583 (funcall (let ((lexical-binding t)) 584 (funcall (let ((lexical-binding t))
584 (byte-compile (list 'lambda nil pat)))) 585 (byte-compile (list 'lambda nil pat))))
585 (error 'bytecomp-check-error)))) 586 (error (list 'bytecomp-check-error (car err))))))
586 (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled." 587 (format "Expression `%s' gives `%s' if directly evalled, `%s' if compiled."
587 pat v0 v1))) 588 pat v0 v1)))
588 589
diff --git a/test/lisp/emacs-lisp/cl-lib-tests.el b/test/lisp/emacs-lisp/cl-lib-tests.el
index 57b9d23efb0..40dd7e4eeb0 100644
--- a/test/lisp/emacs-lisp/cl-lib-tests.el
+++ b/test/lisp/emacs-lisp/cl-lib-tests.el
@@ -242,6 +242,22 @@
242 (should (= (cl-the integer (cl-incf side-effect)) 1)) 242 (should (= (cl-the integer (cl-incf side-effect)) 1))
243 (should (= side-effect 1)))) 243 (should (= side-effect 1))))
244 244
245(ert-deftest cl-lib-test-incf ()
246 (let ((var 0))
247 (should (= (cl-incf var) 1))
248 (should (= var 1)))
249 (let ((alist))
250 (should (= (cl-incf (alist-get 'a alist 0)) 1))
251 (should (= (alist-get 'a alist 0) 1))))
252
253(ert-deftest cl-lib-test-decf ()
254 (let ((var 1))
255 (should (= (cl-decf var) 0))
256 (should (= var 0)))
257 (let ((alist))
258 (should (= (cl-decf (alist-get 'a alist 0)) -1))
259 (should (= (alist-get 'a alist 0) -1))))
260
245(ert-deftest cl-lib-test-plusp () 261(ert-deftest cl-lib-test-plusp ()
246 (should-not (cl-plusp -1.0e+INF)) 262 (should-not (cl-plusp -1.0e+INF))
247 (should-not (cl-plusp -1.5e2)) 263 (should-not (cl-plusp -1.5e2))
diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el
index 30c8f794577..e8c12669c1a 100644
--- a/test/lisp/ffap-tests.el
+++ b/test/lisp/ffap-tests.el
@@ -77,6 +77,46 @@ left alone when opening a URL in an external browser."
77 (should (compare-window-configurations (current-window-configuration) old)) 77 (should (compare-window-configurations (current-window-configuration) old))
78 (should (equal urls '("https://www.gnu.org"))))) 78 (should (equal urls '("https://www.gnu.org")))))
79 79
80(defun ffap-test-string (space string)
81 (let ((ffap-file-name-with-spaces space))
82 (with-temp-buffer
83 (insert string)
84 (goto-char (point-min))
85 (forward-char 10)
86 (ffap-string-at-point))))
87
88(ert-deftest ffap-test-with-spaces ()
89 (should
90 (equal
91 (ffap-test-string
92 t "c:/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program here.txt")
93 "/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program here.txt"))
94 (should
95 (equal
96 (ffap-test-string
97 nil "c:/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program here.txt")
98 "c:/Program"))
99 (should
100 (equal
101 (ffap-test-string
102 t "c:/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program Files/Hummingbird/")
103 "/Program Files/Open Text Evaluation Media/Open Text Exceed 14 x86/Program Files/Hummingbird/"))
104 (should
105 (equal
106 (ffap-test-string
107 t "c:\\Program Files\\Open Text Evaluation Media\\Open Text Exceed 14 x86\\Program Files\\Hummingbird\\")
108 "\\Program Files\\Open Text Evaluation Media\\Open Text Exceed 14 x86\\Program Files\\Hummingbird\\"))
109 (should
110 (equal
111 (ffap-test-string
112 t "c:\\Program Files\\Freescale\\CW for MPC55xx and MPC56xx 2.10\\PowerPC_EABI_Tools\\Command_Line_Tools\\CLT_Usage_Notes.txt")
113 "\\Program Files\\Freescale\\CW for MPC55xx and MPC56xx 2.10\\PowerPC_EABI_Tools\\Command_Line_Tools\\CLT_Usage_Notes.txt"))
114 (should
115 (equal
116 (ffap-test-string
117 t "C:\\temp\\program.log on Windows or /var/log/program.log on Unix.")
118 "\\temp\\program.log")))
119
80(provide 'ffap-tests) 120(provide 'ffap-tests)
81 121
82;;; ffap-tests.el ends here 122;;; ffap-tests.el ends here
diff --git a/test/lisp/mail/flow-fill-tests.el b/test/lisp/mail/flow-fill-tests.el
index 4d435aeda71..c2e4178b7d4 100644
--- a/test/lisp/mail/flow-fill-tests.el
+++ b/test/lisp/mail/flow-fill-tests.el
@@ -35,7 +35,8 @@
35 ">>> unmuzzled ratsbane!\n" 35 ">>> unmuzzled ratsbane!\n"
36 ">>>> Henceforth, the coding style is to be strictly \n" 36 ">>>> Henceforth, the coding style is to be strictly \n"
37 ">>>> enforced, including the use of only upper case.\n" 37 ">>>> enforced, including the use of only upper case.\n"
38 ">>>>> I've noticed a lack of adherence to the coding \n" 38 ">>>>> I've noticed a lack of adherence to \n"
39 ">>>>> the coding \n"
39 ">>>>> styles, of late.\n" 40 ">>>>> styles, of late.\n"
40 ">>>>>> Any complaints?\n")) 41 ">>>>>> Any complaints?\n"))
41 (output 42 (output
diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el
index cd736497e66..d566e7dd862 100644
--- a/test/lisp/progmodes/compile-tests.el
+++ b/test/lisp/progmodes/compile-tests.el
@@ -435,8 +435,8 @@ The test data is in `compile-tests--test-regexps-data'."
435 (compilation-num-infos-found 0)) 435 (compilation-num-infos-found 0))
436 (mapc #'compile--test-error-line compile-tests--test-regexps-data) 436 (mapc #'compile--test-error-line compile-tests--test-regexps-data)
437 (should (eq compilation-num-errors-found 94)) 437 (should (eq compilation-num-errors-found 94))
438 (should (eq compilation-num-warnings-found 37)) 438 (should (eq compilation-num-warnings-found 35))
439 (should (eq compilation-num-infos-found 26))))) 439 (should (eq compilation-num-infos-found 28)))))
440 440
441(ert-deftest compile-test-grep-regexps () 441(ert-deftest compile-test-grep-regexps ()
442 "Test the `grep-regexp-alist' regexps. 442 "Test the `grep-regexp-alist' regexps.
diff --git a/test/lisp/progmodes/cperl-mode-tests.el b/test/lisp/progmodes/cperl-mode-tests.el
new file mode 100644
index 00000000000..be8b42d99a8
--- /dev/null
+++ b/test/lisp/progmodes/cperl-mode-tests.el
@@ -0,0 +1,51 @@
1;;; cperl-mode-tests --- Test for cperl-mode -*- lexical-binding: t -*-
2
3;; Copyright (C) 2020 Free Software Foundation, Inc.
4
5;; Author: Harald Jörg <haj@posteo.de>
6;; Maintainer: Harald Jörg
7;; Keywords: internal
8;; Homepage: https://github.com/HaraldJoerg/cperl-mode
9
10;;; Commentary:
11
12;; This is a collection of tests for the fontification of CPerl-mode.
13
14;; Run these tests interactively:
15;; (ert-run-tests-interactively '(tag :fontification))
16
17;;; Code:
18
19(defvar cperl-test-mode #'cperl-mode)
20
21(defun cperl-test-ppss (text regexp)
22 "Return the `syntax-ppss' of the first character matched by REGEXP in TEXT."
23 (interactive)
24 (with-temp-buffer
25 (insert text)
26 (funcall cperl-test-mode)
27 (goto-char (point-min))
28 (re-search-forward regexp)
29 (syntax-ppss)))
30
31(ert-deftest cperl-mode-test-bug-42168 ()
32 "Verify that '/' is a division after ++ or --, not a regexp.
33Reported in https://github.com/jrockway/cperl-mode/issues/45.
34If seen as regular expression, then the slash is displayed using
35font-lock-constant-face. If seen as a division, then it doesn't
36have a face property."
37 :tags '(:fontification)
38 ;; The next two Perl expressions have divisions. Perl "punctuation"
39 ;; operators don't get a face.
40 (let ((code "{ $a++ / $b }"))
41 (should (equal (nth 8 (cperl-test-ppss code "/")) nil)))
42 (let ((code "{ $a-- / $b }"))
43 (should (equal (nth 8 (cperl-test-ppss code "/")) nil)))
44 ;; The next two Perl expressions have regular expressions. The
45 ;; delimiter of a RE is fontified with font-lock-constant-face.
46 (let ((code "{ $a+ / $b } # /"))
47 (should (equal (nth 8 (cperl-test-ppss code "/")) 7)))
48 (let ((code "{ $a- / $b } # /"))
49 (should (equal (nth 8 (cperl-test-ppss code "/")) 7))))
50
51;;; cperl-mode-tests.el ends here
diff --git a/test/lisp/simple-tests.el b/test/lisp/simple-tests.el
index 4adcacb279b..63e504bbe17 100644
--- a/test/lisp/simple-tests.el
+++ b/test/lisp/simple-tests.el
@@ -39,6 +39,13 @@
39 (with-no-warnings (simple-test--buffer-substrings)))) 39 (with-no-warnings (simple-test--buffer-substrings))))
40 40
41 41
42;;; `count-words'
43(ert-deftest simple-test-count-words-bug-41761 ()
44 (with-temp-buffer
45 (dotimes (i 10) (insert (propertize "test " 'field (cons nil nil))))
46 (should (= (count-words (point-min) (point-max)) 10))))
47
48
42;;; `transpose-sexps' 49;;; `transpose-sexps'
43(defmacro simple-test--transpositions (&rest body) 50(defmacro simple-test--transpositions (&rest body)
44 (declare (indent 0) 51 (declare (indent 0)
diff --git a/test/lisp/textmodes/bibtex-tests.el b/test/lisp/textmodes/bibtex-tests.el
new file mode 100644
index 00000000000..b3858de9e61
--- /dev/null
+++ b/test/lisp/textmodes/bibtex-tests.el
@@ -0,0 +1,57 @@
1;;; bibtex-tests.el --- Test suite for bibtex.
2
3;; Copyright (C) 2013-2020 Free Software Foundation, Inc.
4
5;; Keywords: bibtex
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;;; Code:
25
26(require 'ert)
27(require 'bibtex)
28
29(ert-deftest bibtex-test-set-dialect ()
30 "Tests if `bibtex-set-dialect' is executed."
31 (with-temp-buffer
32 (insert "@article{someID,
33 author = {some author},
34 title = {some title},
35}")
36 (bibtex-mode)
37 (should-not (null bibtex-dialect))
38 (should-not (null bibtex-entry-type))
39 (should-not (null bibtex-entry-head))
40 (should-not (null bibtex-reference-key))
41 (should-not (null bibtex-entry-head))
42 (should-not (null bibtex-entry-maybe-empty-head))
43 (should-not (null bibtex-any-valid-entry-type))))
44
45(ert-deftest bibtex-test-parse-buffers-stealthily ()
46 "Tests if `bibtex-parse-buffers-stealthily' can be executed."
47 (with-temp-buffer
48 (insert "@article{someID,
49 author = {some author},
50 title = {some title},
51}")
52 (bibtex-mode)
53 (should (progn (bibtex-parse-buffers-stealthily) t))))
54
55(provide 'bibtex-tests)
56
57;;; bibtex-tests.el ends here
diff --git a/test/lisp/textmodes/paragraphs-tests.el b/test/lisp/textmodes/paragraphs-tests.el
index fc839fe7d95..0b264e7e184 100644
--- a/test/lisp/textmodes/paragraphs-tests.el
+++ b/test/lisp/textmodes/paragraphs-tests.el
@@ -50,8 +50,8 @@
50 (goto-char (point-min)) 50 (goto-char (point-min))
51 (mark-paragraph) 51 (mark-paragraph)
52 (should mark-active) 52 (should mark-active)
53 (should (equal (mark) 7))) 53 (should (equal (mark) 7))))
54 (should-error (mark-paragraph 0))) 54;;; (should-error (mark-paragraph 0)))
55 55
56(ert-deftest paragraphs-tests-kill-paragraph () 56(ert-deftest paragraphs-tests-kill-paragraph ()
57 (with-temp-buffer 57 (with-temp-buffer
diff --git a/test/lisp/url/url-expand-tests.el b/test/lisp/url/url-expand-tests.el
index 6e0ce869502..3b0b6fbd41a 100644
--- a/test/lisp/url/url-expand-tests.el
+++ b/test/lisp/url/url-expand-tests.el
@@ -100,6 +100,13 @@
100 (should (equal (url-expand-file-name "foo#bar" "http://host/foobar") "http://host/foo#bar")) 100 (should (equal (url-expand-file-name "foo#bar" "http://host/foobar") "http://host/foo#bar"))
101 (should (equal (url-expand-file-name "foo#bar" "http://host/foobar/") "http://host/foobar/foo#bar"))) 101 (should (equal (url-expand-file-name "foo#bar" "http://host/foobar/") "http://host/foobar/foo#bar")))
102 102
103(ert-deftest url-expand-file-name/relative-resolution-file-url ()
104 "RFC 3986, Section 5.4 Reference Resolution Examples / Section 5.4.1. Normal Examples"
105 (should (equal (url-expand-file-name "bar.html" "file:///a/b/c/foo.html") "file:///a/b/c/bar.html"))
106 (should (equal (url-expand-file-name "bar.html" "file:///a/b/c/") "file:///a/b/c/bar.html"))
107 (should (equal (url-expand-file-name "../d/bar.html" "file:///a/b/c/") "file:///a/b/d/bar.html"))
108 (should (equal (url-expand-file-name "../d/bar.html" "file:///a/b/c/foo.html") "file:///a/b/d/bar.html")))
109
103(provide 'url-expand-tests) 110(provide 'url-expand-tests)
104 111
105;;; url-expand-tests.el ends here 112;;; url-expand-tests.el ends here
diff --git a/test/manual/etags/c-src/abbrev.c b/test/manual/etags/c-src/abbrev.c
index 03b9f0e65b8..44563d6046a 100644
--- a/test/manual/etags/c-src/abbrev.c
+++ b/test/manual/etags/c-src/abbrev.c
@@ -78,9 +78,6 @@ Lisp_Object Vlast_abbrev_text;
78 78
79int last_abbrev_point; 79int last_abbrev_point;
80 80
81/* Hook to run before expanding any abbrev. */
82
83Lisp_Object Vpre_abbrev_expand_hook, Qpre_abbrev_expand_hook;
84 81
85DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0, 82DEFUN ("make-abbrev-table", Fmake_abbrev_table, Smake_abbrev_table, 0, 0, 0,
86 "Create a new, empty abbrev table object.") 83 "Create a new, empty abbrev table object.")
@@ -232,9 +229,6 @@ Returns the abbrev symbol, if expansion took place.")
232 229
233 value = Qnil; 230 value = Qnil;
234 231
235 if (!NILP (Vrun_hooks))
236 call1 (Vrun_hooks, Qpre_abbrev_expand_hook);
237
238 wordstart = 0; 232 wordstart = 0;
239 if (!(BUFFERP (Vabbrev_start_location_buffer) 233 if (!(BUFFERP (Vabbrev_start_location_buffer)
240 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) 234 && XBUFFER (Vabbrev_start_location_buffer) == current_buffer))
@@ -595,14 +589,6 @@ This causes `save-some-buffers' to offer to save the abbrevs.");
595 "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so."); 589 "*Set non-nil means expand multi-word abbrevs all caps if abbrev was so.");
596 abbrev_all_caps = 0; 590 abbrev_all_caps = 0;
597 591
598 DEFVAR_LISP ("pre-abbrev-expand-hook", &Vpre_abbrev_expand_hook,
599 "Function or functions to be called before abbrev expansion is done.\n\
600This is the first thing that `expand-abbrev' does, and so this may change\n\
601the current abbrev table before abbrev lookup happens.");
602 Vpre_abbrev_expand_hook = Qnil;
603 Qpre_abbrev_expand_hook = intern ("pre-abbrev-expand-hook");
604 staticpro (&Qpre_abbrev_expand_hook);
605
606 defsubr (&Smake_abbrev_table); 592 defsubr (&Smake_abbrev_table);
607 defsubr (&Sclear_abbrev_table); 593 defsubr (&Sclear_abbrev_table);
608 defsubr (&Sdefine_abbrev); 594 defsubr (&Sdefine_abbrev);
diff --git a/test/manual/image-circular-tests.el b/test/manual/image-circular-tests.el
new file mode 100644
index 00000000000..33ea3ea9547
--- /dev/null
+++ b/test/manual/image-circular-tests.el
@@ -0,0 +1,144 @@
1;;; image-tests.el --- Test suite for image-related functions.
2
3;; Copyright (C) 2019 Free Software Foundation, Inc.
4
5;; Author: Pip Cet <pipcet@gmail.com>
6;; Keywords: internal
7;; Human-Keywords: internal
8
9;; This file is part of GNU Emacs.
10
11;; GNU Emacs is free software: you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation, either version 3 of the License, or
14;; (at your option) any later version.
15
16;; GNU Emacs is distributed in the hope that it will be useful,
17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;; GNU General Public License for more details.
20
21;; You should have received a copy of the GNU General Public License
22;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
23
24;;; Commentary:
25
26;;; Code:
27
28(require 'ert)
29
30(ert-deftest image-test-duplicate-keywords ()
31 "Test that duplicate keywords in an image spec lead to rejection."
32 (should-error (image-size `(image :type xbm :type xbm :width 1 :height 1
33 :data ,(bool-vector t))
34 t)))
35
36(ert-deftest image-test-circular-plist ()
37 "Test that a circular image spec is rejected."
38 (should-error
39 (let ((l `(image :type xbm :width 1 :height 1 :data ,(bool-vector t))))
40 (setcdr (last l) '#1=(:invalid . #1#))
41 (image-size l t))))
42
43(ert-deftest image-test-:type-property-value ()
44 "Test that :type is allowed as a property value in an image spec."
45 (should (equal (image-size `(image :dummy :type :type xbm :width 1 :height 1
46 :data ,(bool-vector t))
47 t)
48 (cons 1 1))))
49
50(ert-deftest image-test-circular-specs ()
51 "Test that circular image spec property values do not cause infinite recursion."
52 (should
53 (let* ((circ1 (cons :dummy nil))
54 (circ2 (cons :dummy nil))
55 (spec1 `(image :type xbm :width 1 :height 1
56 :data ,(bool-vector 1) :ignored ,circ1))
57 (spec2 `(image :type xbm :width 1 :height 1
58 :data ,(bool-vector 1) :ignored ,circ2)))
59 (setcdr circ1 circ1)
60 (setcdr circ2 circ2)
61 (and (equal (image-size spec1 t) (cons 1 1))
62 (equal (image-size spec2 t) (cons 1 1))))))
63
64(provide 'image-tests)
65;;; image-tests.el ends here.
66;;; image-tests.el --- tests for image.el -*- lexical-binding: t -*-
67
68;; Copyright (C) 2019-2020 Free Software Foundation, Inc.
69
70;; This file is part of GNU Emacs.
71
72;; GNU Emacs is free software: you can redistribute it and/or modify
73;; it under the terms of the GNU General Public License as published by
74;; the Free Software Foundation, either version 3 of the License, or
75;; (at your option) any later version.
76
77;; GNU Emacs is distributed in the hope that it will be useful,
78;; but WITHOUT ANY WARRANTY; without even the implied warranty of
79;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80;; GNU General Public License for more details.
81
82;; You should have received a copy of the GNU General Public License
83;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
84
85;;; Code:
86
87(require 'ert)
88(require 'image)
89(eval-when-compile
90 (require 'cl-lib))
91
92(defconst image-tests--emacs-images-directory
93 (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY"))
94 "Directory containing Emacs images.")
95
96(ert-deftest image--set-property ()
97 "Test `image--set-property' behavior."
98 (let ((image (list 'image)))
99 ;; Add properties.
100 (setf (image-property image :scale) 1)
101 (should (equal image '(image :scale 1)))
102 (setf (image-property image :width) 8)
103 (should (equal image '(image :scale 1 :width 8)))
104 (setf (image-property image :height) 16)
105 (should (equal image '(image :scale 1 :width 8 :height 16)))
106 ;; Delete properties.
107 (setf (image-property image :type) nil)
108 (should (equal image '(image :scale 1 :width 8 :height 16)))
109 (setf (image-property image :scale) nil)
110 (should (equal image '(image :width 8 :height 16)))
111 (setf (image-property image :height) nil)
112 (should (equal image '(image :width 8)))
113 (setf (image-property image :width) nil)
114 (should (equal image '(image)))))
115
116(ert-deftest image-type-from-file-header-test ()
117 "Test image-type-from-file-header."
118 (should (eq (if (image-type-available-p 'svg) 'svg)
119 (image-type-from-file-header
120 (expand-file-name "splash.svg"
121 image-tests--emacs-images-directory)))))
122
123(ert-deftest image-rotate ()
124 "Test `image-rotate'."
125 (cl-letf* ((image (list 'image))
126 ((symbol-function 'image--get-imagemagick-and-warn)
127 (lambda () image)))
128 (let ((current-prefix-arg '(4)))
129 (call-interactively #'image-rotate))
130 (should (equal image '(image :rotation 270.0)))
131 (call-interactively #'image-rotate)
132 (should (equal image '(image :rotation 0.0)))
133 (image-rotate)
134 (should (equal image '(image :rotation 90.0)))
135 (image-rotate 0)
136 (should (equal image '(image :rotation 90.0)))
137 (image-rotate 1)
138 (should (equal image '(image :rotation 91.0)))
139 (image-rotate 1234.5)
140 (should (equal image '(image :rotation 245.5)))
141 (image-rotate -154.5)
142 (should (equal image '(image :rotation 91.0)))))
143
144;;; image-tests.el ends here
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 092504565a6..33b307b1c6e 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -54,7 +54,8 @@ Check that the resulting binaries do not differ."
54 (comp-debug 0)) 54 (comp-debug 0))
55 (copy-file comp-src comp1-src t) 55 (copy-file comp-src comp1-src t)
56 (copy-file comp-src comp2-src t) 56 (copy-file comp-src comp2-src t)
57 (load (concat comp-src "c") nil nil t t) 57 (let ((load-no-native t))
58 (load (concat comp-src "c") nil nil t t))
58 (should-not (subr-native-elisp-p (symbol-function #'native-compile))) 59 (should-not (subr-native-elisp-p (symbol-function #'native-compile)))
59 (message "Compiling stage1...") 60 (message "Compiling stage1...")
60 (let ((comp1-eln (native-compile comp1-src))) 61 (let ((comp1-eln (native-compile comp1-src)))
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el
index f1faf58659a..400e9126486 100644
--- a/test/src/fns-tests.el
+++ b/test/src/fns-tests.el
@@ -895,3 +895,9 @@
895 ;; This does not test randomness; it's merely a format check. 895 ;; This does not test randomness; it's merely a format check.
896 (should (string-match "\\`[0-9a-f]\\{128\\}\\'" 896 (should (string-match "\\`[0-9a-f]\\{128\\}\\'"
897 (secure-hash 'sha512 'iv-auto 100)))) 897 (secure-hash 'sha512 'iv-auto 100))))
898
899(ert-deftest test-vector-delete ()
900 (let ((v1 (make-vector 1000 1)))
901 (should (equal (delete t [nil t]) [nil]))
902 (should (equal (delete 1 v1) (vector)))
903 (should (equal (delete 2 v1) v1))))